bruce-models 2.1.9 → 2.2.0
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 +31 -0
- package/dist/bruce-models.es5.js.map +1 -1
- package/dist/bruce-models.umd.js +31 -0
- package/dist/bruce-models.umd.js.map +1 -1
- package/dist/lib/import/imported-file.js +31 -0
- package/dist/lib/import/imported-file.js.map +1 -1
- package/dist/types/import/imported-file.d.ts +8 -0
- package/package.json +1 -1
package/dist/bruce-models.umd.js
CHANGED
|
@@ -7408,6 +7408,10 @@
|
|
|
7408
7408
|
return exports.Api.ECacheKey.ImportedFile + exports.Api.ECacheKey.Id + fileId;
|
|
7409
7409
|
}
|
|
7410
7410
|
ImportedFile.GetCacheKey = GetCacheKey;
|
|
7411
|
+
function GetCacheKeyByRootId(rootId) {
|
|
7412
|
+
return exports.Api.ECacheKey.ImportedFile + exports.Api.ECacheKey.Id + rootId;
|
|
7413
|
+
}
|
|
7414
|
+
ImportedFile.GetCacheKeyByRootId = GetCacheKeyByRootId;
|
|
7411
7415
|
function GetListCacheKey(type, pageIndex) {
|
|
7412
7416
|
return exports.Api.ECacheKey.ImportedFile + type + pageIndex;
|
|
7413
7417
|
}
|
|
@@ -7460,6 +7464,33 @@
|
|
|
7460
7464
|
});
|
|
7461
7465
|
}
|
|
7462
7466
|
ImportedFile.GetList = GetList;
|
|
7467
|
+
function GetListByRootId(params) {
|
|
7468
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
7469
|
+
const { api, rootId, req: reqParams } = params;
|
|
7470
|
+
const cacheData = yield api.GetCacheItem(GetCacheKeyByRootId(rootId), reqParams);
|
|
7471
|
+
if (cacheData) {
|
|
7472
|
+
return cacheData;
|
|
7473
|
+
}
|
|
7474
|
+
const prom = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
|
|
7475
|
+
try {
|
|
7476
|
+
const data = yield api.GET(`entityImportFiles?Entity.ID=${rootId}`, exports.Api.PrepReqParams(reqParams));
|
|
7477
|
+
res({
|
|
7478
|
+
importedFiles: data.Items
|
|
7479
|
+
});
|
|
7480
|
+
}
|
|
7481
|
+
catch (e) {
|
|
7482
|
+
rej(e);
|
|
7483
|
+
}
|
|
7484
|
+
}));
|
|
7485
|
+
yield api.SetCacheItem({
|
|
7486
|
+
key: GetCacheKeyByRootId(rootId),
|
|
7487
|
+
value: prom,
|
|
7488
|
+
req: reqParams
|
|
7489
|
+
});
|
|
7490
|
+
return prom;
|
|
7491
|
+
});
|
|
7492
|
+
}
|
|
7493
|
+
ImportedFile.GetListByRootId = GetListByRootId;
|
|
7463
7494
|
function Get(params) {
|
|
7464
7495
|
return __awaiter(this, void 0, void 0, function* () {
|
|
7465
7496
|
const { api, importedFileId: fileId, req: reqParams } = params;
|