bruce-models 4.0.4 → 4.0.5
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 +35 -6
- package/dist/bruce-models.es5.js.map +1 -1
- package/dist/bruce-models.umd.js +35 -6
- package/dist/bruce-models.umd.js.map +1 -1
- package/dist/lib/bruce-models.js +1 -1
- package/dist/lib/entity/entity-attachment-type.js +34 -5
- package/dist/lib/entity/entity-attachment-type.js.map +1 -1
- package/dist/types/bruce-models.d.ts +1 -1
- package/dist/types/entity/entity-attachment-type.d.ts +14 -2
- package/package.json +1 -1
package/dist/bruce-models.umd.js
CHANGED
|
@@ -4905,21 +4905,50 @@
|
|
|
4905
4905
|
EType["Photo"] = "photo";
|
|
4906
4906
|
EType["Document"] = "document";
|
|
4907
4907
|
})(EType = EntityAttachmentType.EType || (EntityAttachmentType.EType = {}));
|
|
4908
|
+
/**
|
|
4909
|
+
* Gets an attachment type record by ID.
|
|
4910
|
+
* @param params
|
|
4911
|
+
* @returns
|
|
4912
|
+
*/
|
|
4913
|
+
function Get(params) {
|
|
4914
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
4915
|
+
let { api, attachmentTypeId, req: reqParams } = params;
|
|
4916
|
+
if (!api) {
|
|
4917
|
+
api = exports.ENVIRONMENT.Api().GetBruceApi();
|
|
4918
|
+
}
|
|
4919
|
+
if (!attachmentTypeId) {
|
|
4920
|
+
throw ("Type ID is required.");
|
|
4921
|
+
}
|
|
4922
|
+
reqParams = exports.Api.PrepReqParams(reqParams);
|
|
4923
|
+
const cacheData = api.GetCacheItem(GetCacheKey(attachmentTypeId), reqParams);
|
|
4924
|
+
if (cacheData === null || cacheData === void 0 ? void 0 : cacheData.found) {
|
|
4925
|
+
return cacheData.data;
|
|
4926
|
+
}
|
|
4927
|
+
const prom = api.GET(`entityAttachmentType/${attachmentTypeId}`, exports.Api.PrepReqParams(reqParams));
|
|
4928
|
+
api.SetCacheItem({
|
|
4929
|
+
key: GetCacheKey(attachmentTypeId),
|
|
4930
|
+
value: prom,
|
|
4931
|
+
req: reqParams
|
|
4932
|
+
});
|
|
4933
|
+
return prom;
|
|
4934
|
+
});
|
|
4935
|
+
}
|
|
4936
|
+
EntityAttachmentType.Get = Get;
|
|
4908
4937
|
/**
|
|
4909
4938
|
* Deletes an attachment type.
|
|
4910
4939
|
* @param params
|
|
4911
4940
|
*/
|
|
4912
4941
|
function Delete(params) {
|
|
4913
4942
|
return __awaiter(this, void 0, void 0, function* () {
|
|
4914
|
-
let { api, attachmentTypeId
|
|
4943
|
+
let { api, attachmentTypeId, req: reqParams } = params;
|
|
4915
4944
|
if (!api) {
|
|
4916
4945
|
api = exports.ENVIRONMENT.Api().GetBruceApi();
|
|
4917
4946
|
}
|
|
4918
|
-
if (!
|
|
4947
|
+
if (!attachmentTypeId) {
|
|
4919
4948
|
throw ("Type ID is required.");
|
|
4920
4949
|
}
|
|
4921
|
-
yield api.DELETE(`entityAttachmentType/${
|
|
4922
|
-
api.Cache.Remove(GetCacheKey(
|
|
4950
|
+
yield api.DELETE(`entityAttachmentType/${attachmentTypeId}`, exports.Api.PrepReqParams(reqParams));
|
|
4951
|
+
api.Cache.Remove(GetCacheKey(attachmentTypeId));
|
|
4923
4952
|
api.Cache.Remove(GetListCacheKey());
|
|
4924
4953
|
});
|
|
4925
4954
|
}
|
|
@@ -4954,7 +4983,7 @@
|
|
|
4954
4983
|
*/
|
|
4955
4984
|
function GetList(params) {
|
|
4956
4985
|
return __awaiter(this, void 0, void 0, function* () {
|
|
4957
|
-
let { api, reqParams } = params;
|
|
4986
|
+
let { api, req: reqParams } = params;
|
|
4958
4987
|
if (!api) {
|
|
4959
4988
|
api = exports.ENVIRONMENT.Api().GetBruceApi();
|
|
4960
4989
|
}
|
|
@@ -11403,7 +11432,7 @@
|
|
|
11403
11432
|
})(exports.DataSource || (exports.DataSource = {}));
|
|
11404
11433
|
|
|
11405
11434
|
// This is updated with the package.json version on build.
|
|
11406
|
-
const VERSION = "4.0.
|
|
11435
|
+
const VERSION = "4.0.5";
|
|
11407
11436
|
|
|
11408
11437
|
exports.VERSION = VERSION;
|
|
11409
11438
|
exports.AbstractApi = AbstractApi;
|