bruce-models 1.4.6 → 1.4.7
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 +25 -18
- package/dist/bruce-models.es5.js.map +1 -1
- package/dist/bruce-models.umd.js +25 -18
- package/dist/bruce-models.umd.js.map +1 -1
- package/dist/lib/entity/entity-source.js +25 -18
- package/dist/lib/entity/entity-source.js.map +1 -1
- package/dist/types/entity/entity-source.d.ts +6 -0
- package/package.json +1 -1
package/dist/bruce-models.es5.js
CHANGED
|
@@ -3382,29 +3382,21 @@ var EntitySource;
|
|
|
3382
3382
|
}
|
|
3383
3383
|
EntitySource.GetCacheKey = GetCacheKey;
|
|
3384
3384
|
function Get(params) {
|
|
3385
|
+
var _a;
|
|
3385
3386
|
return __awaiter(this, void 0, void 0, function* () {
|
|
3386
3387
|
const { api, sourceId, sourceKey, req: reqParams } = params;
|
|
3387
3388
|
if (!sourceId || !sourceKey) {
|
|
3388
3389
|
throw ("Source ID and Source Key are required.");
|
|
3389
3390
|
}
|
|
3390
|
-
const
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
|
|
3396
|
-
|
|
3397
|
-
|
|
3398
|
-
|
|
3399
|
-
source: data
|
|
3400
|
-
});
|
|
3401
|
-
}
|
|
3402
|
-
catch (e) {
|
|
3403
|
-
rej(e);
|
|
3404
|
-
}
|
|
3405
|
-
}));
|
|
3406
|
-
api.Cache.Set(key, prom, Api.DEFAULT_CACHE_DURATION);
|
|
3407
|
-
return prom;
|
|
3391
|
+
const res = yield GetListByKeys({
|
|
3392
|
+
api: api,
|
|
3393
|
+
sourceId: sourceId,
|
|
3394
|
+
sourceKeys: [sourceKey],
|
|
3395
|
+
req: reqParams
|
|
3396
|
+
});
|
|
3397
|
+
return {
|
|
3398
|
+
source: ((_a = res.sources) === null || _a === void 0 ? void 0 : _a.length) ? res.sources[0] : null
|
|
3399
|
+
};
|
|
3408
3400
|
});
|
|
3409
3401
|
}
|
|
3410
3402
|
EntitySource.Get = Get;
|
|
@@ -3485,6 +3477,21 @@ var EntitySource;
|
|
|
3485
3477
|
});
|
|
3486
3478
|
}
|
|
3487
3479
|
EntitySource.GetEntityIdsBySourceKeys = GetEntityIdsBySourceKeys;
|
|
3480
|
+
function CreateLink(params) {
|
|
3481
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3482
|
+
const { source } = params;
|
|
3483
|
+
if (!source["Entity.ID"] || !source["Source.ID"] || !source["SourceRecord.Key"]) {
|
|
3484
|
+
throw ("Entity ID, Source ID and Source Key are required.");
|
|
3485
|
+
}
|
|
3486
|
+
const res = yield params.api.POST("entitysource", source);
|
|
3487
|
+
const cacheKey = GetCacheKey(source["Source.ID"], source["SourceRecord.Key"]);
|
|
3488
|
+
params.api.Cache.Remove(cacheKey);
|
|
3489
|
+
return {
|
|
3490
|
+
source: res
|
|
3491
|
+
};
|
|
3492
|
+
});
|
|
3493
|
+
}
|
|
3494
|
+
EntitySource.CreateLink = CreateLink;
|
|
3488
3495
|
})(EntitySource || (EntitySource = {}));
|
|
3489
3496
|
|
|
3490
3497
|
/**
|