import { HttpStatusCode } from '@shared/core-utils'
-import { makeDeleteRequest, makeGetRequest, makePostBodyRequest, makePutBodyRequest, unwrapBody, unwrapText } from '../requests/requests'
+import { makeDeleteRequest, makeGetRequest, makePostBodyRequest, makePutBodyRequest, makeUploadRequest, unwrapBody, unwrapText } from '../requests/requests'
import { ServerInfo } from '../server/servers'
export interface OverrideCommandOptions {
})
}
+ protected postUploadRequest (options: CommonCommandOptions & {
+ fields?: { [ fieldName: string ]: any }
+ attaches?: any
+ }) {
+ const { fields, attaches } = options
+
+ return makeUploadRequest({
+ ...this.buildCommonRequestOptions(options),
+
+ method: 'POST',
+ fields,
+ attaches
+ })
+ }
+
+ protected putUploadRequest (options: CommonCommandOptions & {
+ fields?: { [ fieldName: string ]: any }
+ attaches?: any
+ }) {
+ const { fields, attaches } = options
+
+ return makeUploadRequest({
+ ...this.buildCommonRequestOptions(options),
+
+ method: 'PUT',
+ fields,
+ attaches
+ })
+ }
+
private buildCommonRequestOptions (options: CommonCommandOptions) {
const { token, expectedStatus, defaultExpectedStatus, path } = options