bruce-models 0.3.9 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bruce-models.es5.js +15 -2
- package/dist/bruce-models.es5.js.map +1 -1
- package/dist/bruce-models.umd.js +15 -2
- package/dist/bruce-models.umd.js.map +1 -1
- package/dist/lib/api/abstract-api.js +5 -0
- package/dist/lib/api/abstract-api.js.map +1 -1
- package/dist/lib/api/api.js +1 -0
- package/dist/lib/api/api.js.map +1 -1
- package/dist/lib/bruce-models.js +1 -1
- package/dist/lib/bruce-models.js.map +1 -1
- package/dist/lib/{file → client-file}/client-file.js +9 -2
- package/dist/lib/client-file/client-file.js.map +1 -0
- package/dist/lib/import/imported-file.js +122 -0
- package/dist/lib/import/imported-file.js.map +1 -0
- package/dist/lib/server/task.js +114 -0
- package/dist/lib/server/task.js.map +1 -0
- package/dist/types/api/api.d.ts +3 -1
- package/dist/types/bruce-models.d.ts +1 -1
- package/dist/types/{file → client-file}/client-file.d.ts +1 -1
- package/dist/types/entity/entity-attachment.d.ts +1 -1
- package/dist/types/entity/entity-lod.d.ts +1 -1
- package/dist/types/import/imported-file.d.ts +24 -0
- package/dist/types/server/task.d.ts +23 -0
- package/package.json +1 -1
- package/dist/lib/file/client-file.js.map +0 -1
package/dist/bruce-models.umd.js
CHANGED
|
@@ -116,6 +116,7 @@
|
|
|
116
116
|
ECacheKey["UserGroup"] = "usergroup";
|
|
117
117
|
ECacheKey["Account"] = "account";
|
|
118
118
|
ECacheKey["CustomForm"] = "customform";
|
|
119
|
+
ECacheKey["ImportedFile"] = "importedfile";
|
|
119
120
|
})(ECacheKey = Api.ECacheKey || (Api.ECacheKey = {}));
|
|
120
121
|
Api.DEFAULT_CACHE_DURATION = 60 * 5; // 5 minutes.
|
|
121
122
|
Api.TEMPLATE_ACCOUNT_ID = "template";
|
|
@@ -607,6 +608,11 @@
|
|
|
607
608
|
xhr_1.setRequestHeader(_this.ssidHeader, _this.ssid);
|
|
608
609
|
}
|
|
609
610
|
var formData = new FormData();
|
|
611
|
+
if (params === null || params === void 0 ? void 0 : params.formData) {
|
|
612
|
+
for (var key in params.formData) {
|
|
613
|
+
formData.append(key, params.formData[key]);
|
|
614
|
+
}
|
|
615
|
+
}
|
|
610
616
|
formData.append("file", blob);
|
|
611
617
|
xhr_1.send(formData);
|
|
612
618
|
}
|
|
@@ -3655,13 +3661,20 @@
|
|
|
3655
3661
|
});
|
|
3656
3662
|
}
|
|
3657
3663
|
ClientFile.Delete = Delete;
|
|
3658
|
-
function Upload(api, file, onProgress) {
|
|
3664
|
+
function Upload(api, file, purpose, onProgress) {
|
|
3659
3665
|
return __awaiter(this, void 0, void 0, function () {
|
|
3666
|
+
var formData;
|
|
3660
3667
|
return __generator(this, function (_a) {
|
|
3661
3668
|
if (!file) {
|
|
3662
3669
|
throw ("File is required.");
|
|
3663
3670
|
}
|
|
3664
|
-
|
|
3671
|
+
formData = null;
|
|
3672
|
+
if (purpose) {
|
|
3673
|
+
formData = {
|
|
3674
|
+
"Purpose": purpose
|
|
3675
|
+
};
|
|
3676
|
+
}
|
|
3677
|
+
return [2 /*return*/, api.UPLOAD("file/uploadNew", file, { onProgress: onProgress, formData: formData })];
|
|
3665
3678
|
});
|
|
3666
3679
|
});
|
|
3667
3680
|
}
|