ame-super-app-web
Advanced tools
Comparing version 4.0.1 to 4.1.0-beta.0
@@ -0,1 +1,9 @@ | ||
export declare enum UploadFileMethod { | ||
post = "post", | ||
put = "put", | ||
patch = "patch" | ||
} | ||
export declare class UploadFileUtils { | ||
static isValidMethod(methodName: string): boolean; | ||
} | ||
export default interface UploadFileInput { | ||
@@ -7,2 +15,3 @@ fileId: string; | ||
uploadTimeout?: any; | ||
method?: UploadFileMethod; | ||
} |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.UploadFileUtils = exports.UploadFileMethod = void 0; | ||
var UploadFileMethod; | ||
(function (UploadFileMethod) { | ||
UploadFileMethod["post"] = "post"; | ||
UploadFileMethod["put"] = "put"; | ||
UploadFileMethod["patch"] = "patch"; | ||
})(UploadFileMethod = exports.UploadFileMethod || (exports.UploadFileMethod = {})); | ||
class UploadFileUtils { | ||
static isValidMethod(methodName) { | ||
return methodName in UploadFileMethod; | ||
} | ||
} | ||
exports.UploadFileUtils = UploadFileUtils; | ||
//# sourceMappingURL=UploadFileInput.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const tslib_1 = require("tslib"); | ||
const UploadFileInput_1 = require("../model/input/UploadFileInput"); | ||
const HttpService_1 = tslib_1.__importDefault(require("./HttpService")); | ||
@@ -24,2 +25,3 @@ const uuid_1 = require("uuid"); | ||
const { url, additionalData, headers, fileId } = params; | ||
let { method } = params; | ||
if (!url) { | ||
@@ -31,2 +33,8 @@ throw new Error("uploadFile.url.is.required"); | ||
} | ||
if (!method) { | ||
method = UploadFileInput_1.UploadFileMethod.post; | ||
} | ||
if (!UploadFileInput_1.UploadFileUtils.isValidMethod(method)) { | ||
throw new Error("uploadFile.method.invalid"); | ||
} | ||
const file = this.selectedFiles[fileId]; | ||
@@ -55,3 +63,3 @@ console.log(">>> file: ", file); | ||
}; | ||
const resData = yield this.httpService.post(url, data, configs); | ||
const resData = yield this.httpService.httpCall(method, [url, data, configs]); | ||
return { | ||
@@ -58,0 +66,0 @@ data: resData.data, |
@@ -1,2 +0,2 @@ | ||
declare const _default: "4.0.1"; | ||
declare const _default: "4.1.0-beta.0"; | ||
export default _default; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.default = "4.0.1"; | ||
exports.default = "4.1.0-beta.0"; | ||
//# sourceMappingURL=version.js.map |
{ | ||
"name": "ame-super-app-web", | ||
"version": "4.0.1", | ||
"version": "4.1.0-beta.0", | ||
"_versionBetaExample": "1.0.2-beta.0", | ||
@@ -5,0 +5,0 @@ "__versionBetaExample": "1.0.2-alpha.0", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1029481
216
4405
2