bruce-models 7.1.104 → 7.1.105
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 +389 -13
- package/dist/bruce-models.es5.js.map +1 -1
- package/dist/bruce-models.umd.js +386 -12
- package/dist/bruce-models.umd.js.map +1 -1
- package/dist/lib/account/account-concept.js +1 -0
- package/dist/lib/account/account-concept.js.map +1 -1
- package/dist/lib/api/api.js +4 -0
- package/dist/lib/api/api.js.map +1 -1
- package/dist/lib/bruce-models.js +3 -1
- package/dist/lib/bruce-models.js.map +1 -1
- package/dist/lib/server/record-change-feed.js +10 -0
- package/dist/lib/server/record-change-feed.js.map +1 -1
- package/dist/lib/workflow/workflow-item.js +226 -0
- package/dist/lib/workflow/workflow-item.js.map +1 -0
- package/dist/lib/workflow/workflow-schedule.js +163 -0
- package/dist/lib/workflow/workflow-schedule.js.map +1 -0
- package/dist/types/account/account-concept.d.ts +2 -1
- package/dist/types/api/api.d.ts +5 -1
- package/dist/types/bruce-models.d.ts +3 -1
- package/dist/types/workflow/workflow-item.d.ts +99 -0
- package/dist/types/workflow/workflow-schedule.d.ts +57 -0
- package/package.json +1 -1
package/dist/bruce-models.umd.js
CHANGED
|
@@ -96,6 +96,10 @@
|
|
|
96
96
|
ECacheKey["EntityHistoricDataPage"] = "entityhistoricdatapage";
|
|
97
97
|
ECacheKey["AccountLimits"] = "accountlimits";
|
|
98
98
|
ECacheKey["WorkflowType"] = "workflowtype";
|
|
99
|
+
ECacheKey["WorkflowStatus"] = "workflowstatus";
|
|
100
|
+
ECacheKey["WorkflowQueue"] = "workflowqueue";
|
|
101
|
+
ECacheKey["WorkflowItem"] = "workflowitem";
|
|
102
|
+
ECacheKey["WorkflowSchedule"] = "workflowschedule";
|
|
99
103
|
})(ECacheKey = Api.ECacheKey || (Api.ECacheKey = {}));
|
|
100
104
|
// 1 minute.
|
|
101
105
|
Api.DEFAULT_CACHE_DURATION = 60 * 1000;
|
|
@@ -368,6 +372,7 @@
|
|
|
368
372
|
EConcept["WORKFLOW_ITEM_STATUS"] = "wis";
|
|
369
373
|
EConcept["WORKFLOW_ITEM_TYPE"] = "wit";
|
|
370
374
|
EConcept["WORKFLOW_QUEUE"] = "wq";
|
|
375
|
+
EConcept["WORKFLOW_SCHEDULE"] = "ws";
|
|
371
376
|
})(EConcept = AccountConcept.EConcept || (AccountConcept.EConcept = {}));
|
|
372
377
|
let EAction;
|
|
373
378
|
(function (EAction) {
|
|
@@ -699,6 +704,16 @@
|
|
|
699
704
|
return [exports.Api.ECacheKey.ProjectView, exports.Api.ECacheKey.ProjectViewBookmark];
|
|
700
705
|
case exports.AccountConcept.EConcept.RELATION_TYPE:
|
|
701
706
|
return [exports.Api.ECacheKey.RelationType];
|
|
707
|
+
case exports.AccountConcept.EConcept.WORKFLOW_ITEM:
|
|
708
|
+
return [exports.Api.ECacheKey.WorkflowItem];
|
|
709
|
+
case exports.AccountConcept.EConcept.WORKFLOW_ITEM_STATUS:
|
|
710
|
+
return [exports.Api.ECacheKey.WorkflowStatus, exports.Api.ECacheKey.WorkflowType, exports.Api.ECacheKey.WorkflowItem];
|
|
711
|
+
case exports.AccountConcept.EConcept.WORKFLOW_ITEM_TYPE:
|
|
712
|
+
return [exports.Api.ECacheKey.WorkflowType, exports.Api.ECacheKey.WorkflowItem, exports.Api.ECacheKey.WorkflowSchedule];
|
|
713
|
+
case exports.AccountConcept.EConcept.WORKFLOW_QUEUE:
|
|
714
|
+
return [exports.Api.ECacheKey.WorkflowQueue, exports.Api.ECacheKey.WorkflowType, exports.Api.ECacheKey.WorkflowItem, exports.Api.ECacheKey.WorkflowSchedule];
|
|
715
|
+
case exports.AccountConcept.EConcept.WORKFLOW_SCHEDULE:
|
|
716
|
+
return [exports.Api.ECacheKey.WorkflowSchedule, exports.Api.ECacheKey.WorkflowItem];
|
|
702
717
|
case exports.AccountConcept.EConcept.TILESET:
|
|
703
718
|
return [exports.Api.ECacheKey.Tileset, exports.Api.ECacheKey.PublishTileset, exports.Api.ECacheKey.TilesetAccess];
|
|
704
719
|
case exports.AccountConcept.EConcept.UI_ENTITY_DISPLAY_SETTING:
|
|
@@ -23599,6 +23614,365 @@
|
|
|
23599
23614
|
UrlUtils.ConstructUrl = ConstructUrl;
|
|
23600
23615
|
})(exports.UrlUtils || (exports.UrlUtils = {}));
|
|
23601
23616
|
|
|
23617
|
+
(function (WorkflowItem) {
|
|
23618
|
+
function Get(params) {
|
|
23619
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
23620
|
+
let { api, workflowItemId, req } = params;
|
|
23621
|
+
if (isInvalidId(workflowItemId)) {
|
|
23622
|
+
throw ("Workflow Item ID is required.");
|
|
23623
|
+
}
|
|
23624
|
+
if (!api) {
|
|
23625
|
+
api = exports.ENVIRONMENT.Api().GetBruceApi();
|
|
23626
|
+
}
|
|
23627
|
+
const key = GetCacheKey(workflowItemId);
|
|
23628
|
+
const cache = api.GetCacheItem(key, req);
|
|
23629
|
+
if (cache === null || cache === void 0 ? void 0 : cache.found) {
|
|
23630
|
+
return cache.data;
|
|
23631
|
+
}
|
|
23632
|
+
const request = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
|
|
23633
|
+
try {
|
|
23634
|
+
const data = yield api.GET(`workflow/item/${workflowItemId}`, exports.Api.PrepReqParams(req));
|
|
23635
|
+
res({ workflowItem: ParseResponse(data) });
|
|
23636
|
+
}
|
|
23637
|
+
catch (e) {
|
|
23638
|
+
rej(e);
|
|
23639
|
+
}
|
|
23640
|
+
}));
|
|
23641
|
+
api.SetCacheItem({ key, value: request, req });
|
|
23642
|
+
return request;
|
|
23643
|
+
});
|
|
23644
|
+
}
|
|
23645
|
+
WorkflowItem.Get = Get;
|
|
23646
|
+
function GetList(params) {
|
|
23647
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
23648
|
+
if (!params) {
|
|
23649
|
+
params = {};
|
|
23650
|
+
}
|
|
23651
|
+
let { api, req } = params;
|
|
23652
|
+
if (!api) {
|
|
23653
|
+
api = exports.ENVIRONMENT.Api().GetBruceApi();
|
|
23654
|
+
}
|
|
23655
|
+
const url = BuildListUrl(params);
|
|
23656
|
+
const key = GetListCacheKey(params);
|
|
23657
|
+
const cache = api.GetCacheItem(key, req);
|
|
23658
|
+
if (cache === null || cache === void 0 ? void 0 : cache.found) {
|
|
23659
|
+
return cache.data;
|
|
23660
|
+
}
|
|
23661
|
+
const request = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
|
|
23662
|
+
try {
|
|
23663
|
+
const data = yield api.GET(url, exports.Api.PrepReqParams(req));
|
|
23664
|
+
res(ParseListResponse(data));
|
|
23665
|
+
}
|
|
23666
|
+
catch (e) {
|
|
23667
|
+
rej(e);
|
|
23668
|
+
}
|
|
23669
|
+
}));
|
|
23670
|
+
api.SetCacheItem({ key, value: request, req });
|
|
23671
|
+
return request;
|
|
23672
|
+
});
|
|
23673
|
+
}
|
|
23674
|
+
WorkflowItem.GetList = GetList;
|
|
23675
|
+
function Create(params) {
|
|
23676
|
+
var _a, _b, _c, _d, _e;
|
|
23677
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
23678
|
+
let { api, workflowItemTypeId, entityTypeId, workflowItem, req } = params;
|
|
23679
|
+
if (!api) {
|
|
23680
|
+
api = exports.ENVIRONMENT.Api().GetBruceApi();
|
|
23681
|
+
}
|
|
23682
|
+
if (!workflowItem) {
|
|
23683
|
+
workflowItem = {};
|
|
23684
|
+
}
|
|
23685
|
+
const typeId = (_c = (_b = (_a = workflowItemTypeId !== null && workflowItemTypeId !== void 0 ? workflowItemTypeId : workflowItem["Workflow.ItemType.ID"]) !== null && _a !== void 0 ? _a : workflowItem["ItemType.ID"]) !== null && _b !== void 0 ? _b : workflowItem.WorkflowItemTypeID) !== null && _c !== void 0 ? _c : workflowItem.ItemTypeID;
|
|
23686
|
+
if (isInvalidId(typeId)) {
|
|
23687
|
+
throw ("Workflow Item Type ID is required.");
|
|
23688
|
+
}
|
|
23689
|
+
const typePath = encodePath(typeId);
|
|
23690
|
+
const entityTypePath = encodePath((_d = entityTypeId !== null && entityTypeId !== void 0 ? entityTypeId : workflowItem["EntityType.ID"]) !== null && _d !== void 0 ? _d : "");
|
|
23691
|
+
const data = yield api.POST(`workflow/createnew/${typePath}/${entityTypePath}`, workflowItem, exports.Api.PrepReqParams(req));
|
|
23692
|
+
api.Cache.RemoveByStartsWith(exports.Api.ECacheKey.WorkflowItem);
|
|
23693
|
+
api.Cache.RemoveByStartsWith(exports.Api.ECacheKey.Entity);
|
|
23694
|
+
return {
|
|
23695
|
+
workflowItem: ParseResponse(data),
|
|
23696
|
+
entity: (_e = parseObject$6(data)) === null || _e === void 0 ? void 0 : _e.Entity
|
|
23697
|
+
};
|
|
23698
|
+
});
|
|
23699
|
+
}
|
|
23700
|
+
WorkflowItem.Create = Create;
|
|
23701
|
+
function Update(params) {
|
|
23702
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
23703
|
+
let { api, workflowItem, req } = params;
|
|
23704
|
+
if (!api) {
|
|
23705
|
+
api = exports.ENVIRONMENT.Api().GetBruceApi();
|
|
23706
|
+
}
|
|
23707
|
+
if (!workflowItem) {
|
|
23708
|
+
workflowItem = {};
|
|
23709
|
+
}
|
|
23710
|
+
const id = workflowItem.ID && workflowItem.ID > 0 ? workflowItem.ID : 0;
|
|
23711
|
+
const data = yield api.POST(`workflow/item/${id}`, workflowItem, exports.Api.PrepReqParams(req));
|
|
23712
|
+
api.Cache.RemoveByStartsWith(exports.Api.ECacheKey.WorkflowItem);
|
|
23713
|
+
if (workflowItem["Entity.ID"]) {
|
|
23714
|
+
api.Cache.RemoveByStartsWith(`${exports.Api.ECacheKey.Entity}${exports.Api.ECacheKey.Id}${workflowItem["Entity.ID"]}`);
|
|
23715
|
+
}
|
|
23716
|
+
return { workflowItem: ParseResponse(data) };
|
|
23717
|
+
});
|
|
23718
|
+
}
|
|
23719
|
+
WorkflowItem.Update = Update;
|
|
23720
|
+
function Delete(params) {
|
|
23721
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
23722
|
+
let { api, workflowItemId, req } = params;
|
|
23723
|
+
if (isInvalidId(workflowItemId)) {
|
|
23724
|
+
throw ("Workflow Item ID is required.");
|
|
23725
|
+
}
|
|
23726
|
+
if (!api) {
|
|
23727
|
+
api = exports.ENVIRONMENT.Api().GetBruceApi();
|
|
23728
|
+
}
|
|
23729
|
+
yield api.DELETE(`workflow/item/${workflowItemId}`, exports.Api.PrepReqParams(req));
|
|
23730
|
+
api.Cache.RemoveByStartsWith(exports.Api.ECacheKey.WorkflowItem);
|
|
23731
|
+
api.Cache.RemoveByStartsWith(exports.Api.ECacheKey.Entity);
|
|
23732
|
+
});
|
|
23733
|
+
}
|
|
23734
|
+
WorkflowItem.Delete = Delete;
|
|
23735
|
+
function BuildListUrl(params) {
|
|
23736
|
+
var _a;
|
|
23737
|
+
const q = new URLSearchParams();
|
|
23738
|
+
appendParam(q, "pageSize", params === null || params === void 0 ? void 0 : params.pageSize);
|
|
23739
|
+
appendParam(q, "pageIndex", params === null || params === void 0 ? void 0 : params.pageIndex);
|
|
23740
|
+
appendParam(q, "OrderBy", params === null || params === void 0 ? void 0 : params.orderBy);
|
|
23741
|
+
appendParam(q, "SortOrder", params === null || params === void 0 ? void 0 : params.sortOrder);
|
|
23742
|
+
appendParam(q, "statusend", params === null || params === void 0 ? void 0 : params.statusEnd);
|
|
23743
|
+
appendParam(q, "assignedtome", params === null || params === void 0 ? void 0 : params.assignedToMe);
|
|
23744
|
+
appendParam(q, "itemtypeid", params === null || params === void 0 ? void 0 : params.itemTypeId);
|
|
23745
|
+
appendParam(q, "queueid", params === null || params === void 0 ? void 0 : params.queueId);
|
|
23746
|
+
appendParam(q, "scheduleid", (_a = params === null || params === void 0 ? void 0 : params.scheduleId) !== null && _a !== void 0 ? _a : params === null || params === void 0 ? void 0 : params.workflowScheduleId);
|
|
23747
|
+
appendParam(q, "statusid", params === null || params === void 0 ? void 0 : params.statusId);
|
|
23748
|
+
appendParam(q, "CreatedByUserID", params === null || params === void 0 ? void 0 : params.createdByUserId);
|
|
23749
|
+
appendParam(q, "DueDate", params === null || params === void 0 ? void 0 : params.dueDate);
|
|
23750
|
+
appendParam(q, "DueDateFrom", params === null || params === void 0 ? void 0 : params.dueDateFrom);
|
|
23751
|
+
appendParam(q, "DueDateTo", params === null || params === void 0 ? void 0 : params.dueDateTo);
|
|
23752
|
+
appendParam(q, "SlideID", params === null || params === void 0 ? void 0 : params.slideId);
|
|
23753
|
+
appendParam(q, "EntityID", params === null || params === void 0 ? void 0 : params.entityId);
|
|
23754
|
+
appendParam(q, "SubjectEntityID", params === null || params === void 0 ? void 0 : params.subjectEntityId);
|
|
23755
|
+
appendParam(q, "Description", params === null || params === void 0 ? void 0 : params.description);
|
|
23756
|
+
appendParam(q, "Search", params === null || params === void 0 ? void 0 : params.search);
|
|
23757
|
+
const qs = q.toString();
|
|
23758
|
+
return qs ? `workflow/itemsquery?${qs}` : "workflow/itemsquery";
|
|
23759
|
+
}
|
|
23760
|
+
WorkflowItem.BuildListUrl = BuildListUrl;
|
|
23761
|
+
function ParseResponse(response) {
|
|
23762
|
+
var _a, _b, _c, _d;
|
|
23763
|
+
const parsed = parseObject$6(response);
|
|
23764
|
+
const parsedResult = (_a = parseObject$6(parsed === null || parsed === void 0 ? void 0 : parsed.Result)) !== null && _a !== void 0 ? _a : parsed === null || parsed === void 0 ? void 0 : parsed.Result;
|
|
23765
|
+
return (_d = (_c = (_b = parsed === null || parsed === void 0 ? void 0 : parsed.WorkflowItem) !== null && _b !== void 0 ? _b : parsedResult === null || parsedResult === void 0 ? void 0 : parsedResult.WorkflowItem) !== null && _c !== void 0 ? _c : parsedResult) !== null && _d !== void 0 ? _d : parsed;
|
|
23766
|
+
}
|
|
23767
|
+
WorkflowItem.ParseResponse = ParseResponse;
|
|
23768
|
+
function ParseListResponse(response) {
|
|
23769
|
+
var _a;
|
|
23770
|
+
const parsed = parseObject$6(response);
|
|
23771
|
+
const parsedResult = (_a = parseObject$6(parsed === null || parsed === void 0 ? void 0 : parsed.Result)) !== null && _a !== void 0 ? _a : parsed === null || parsed === void 0 ? void 0 : parsed.Result;
|
|
23772
|
+
const source = parsedResult !== null && parsedResult !== void 0 ? parsedResult : parsed;
|
|
23773
|
+
const items = Array.isArray(source)
|
|
23774
|
+
? source
|
|
23775
|
+
: Array.isArray(source === null || source === void 0 ? void 0 : source.Items)
|
|
23776
|
+
? source.Items
|
|
23777
|
+
: [];
|
|
23778
|
+
return {
|
|
23779
|
+
items,
|
|
23780
|
+
totalCount: source === null || source === void 0 ? void 0 : source.TotalCount,
|
|
23781
|
+
nextPage: source === null || source === void 0 ? void 0 : source.NextPage,
|
|
23782
|
+
nextPageUrl: source === null || source === void 0 ? void 0 : source.NextPageURL
|
|
23783
|
+
};
|
|
23784
|
+
}
|
|
23785
|
+
WorkflowItem.ParseListResponse = ParseListResponse;
|
|
23786
|
+
function GetCacheKey(id) {
|
|
23787
|
+
return `${exports.Api.ECacheKey.WorkflowItem}${exports.Api.ECacheKey.Id}${id}`;
|
|
23788
|
+
}
|
|
23789
|
+
WorkflowItem.GetCacheKey = GetCacheKey;
|
|
23790
|
+
function GetListCacheKey(params) {
|
|
23791
|
+
return `${exports.Api.ECacheKey.WorkflowItem}${exports.Api.ECacheKey.ListId}${BuildListUrl(params)}`;
|
|
23792
|
+
}
|
|
23793
|
+
WorkflowItem.GetListCacheKey = GetListCacheKey;
|
|
23794
|
+
})(exports.WorkflowItem || (exports.WorkflowItem = {}));
|
|
23795
|
+
function appendParam(q, key, value) {
|
|
23796
|
+
if (value == null || value === "") {
|
|
23797
|
+
return;
|
|
23798
|
+
}
|
|
23799
|
+
if (Array.isArray(value)) {
|
|
23800
|
+
if (value.length) {
|
|
23801
|
+
q.append(key, value.join(","));
|
|
23802
|
+
}
|
|
23803
|
+
return;
|
|
23804
|
+
}
|
|
23805
|
+
q.append(key, String(value));
|
|
23806
|
+
}
|
|
23807
|
+
function parseObject$6(data) {
|
|
23808
|
+
if (data == null || data == undefined) {
|
|
23809
|
+
return null;
|
|
23810
|
+
}
|
|
23811
|
+
if (typeof data == "string") {
|
|
23812
|
+
try {
|
|
23813
|
+
return JSON.parse(data);
|
|
23814
|
+
}
|
|
23815
|
+
catch (_a) {
|
|
23816
|
+
return null;
|
|
23817
|
+
}
|
|
23818
|
+
}
|
|
23819
|
+
return data;
|
|
23820
|
+
}
|
|
23821
|
+
function isInvalidId(id) {
|
|
23822
|
+
return id == null || id === "" || !isFinite(Number(id)) || Number(id) <= 0;
|
|
23823
|
+
}
|
|
23824
|
+
function encodePath(value) {
|
|
23825
|
+
return encodeURIComponent(String(value !== null && value !== void 0 ? value : ""));
|
|
23826
|
+
}
|
|
23827
|
+
|
|
23828
|
+
(function (WorkflowSchedule) {
|
|
23829
|
+
function Get(params) {
|
|
23830
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
23831
|
+
let { api, workflowScheduleId, req } = params;
|
|
23832
|
+
if (isInvalidId$1(workflowScheduleId)) {
|
|
23833
|
+
throw ("Workflow Schedule ID is required.");
|
|
23834
|
+
}
|
|
23835
|
+
if (!api) {
|
|
23836
|
+
api = exports.ENVIRONMENT.Api().GetBruceApi();
|
|
23837
|
+
}
|
|
23838
|
+
const key = GetCacheKey(workflowScheduleId);
|
|
23839
|
+
const cache = api.GetCacheItem(key, req);
|
|
23840
|
+
if (cache === null || cache === void 0 ? void 0 : cache.found) {
|
|
23841
|
+
return cache.data;
|
|
23842
|
+
}
|
|
23843
|
+
const request = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
|
|
23844
|
+
try {
|
|
23845
|
+
const data = yield api.GET(`workflow/schedule/${workflowScheduleId}`, exports.Api.PrepReqParams(req));
|
|
23846
|
+
res({ workflowSchedule: ParseResponse(data) });
|
|
23847
|
+
}
|
|
23848
|
+
catch (e) {
|
|
23849
|
+
rej(e);
|
|
23850
|
+
}
|
|
23851
|
+
}));
|
|
23852
|
+
api.SetCacheItem({ key, value: request, req });
|
|
23853
|
+
return request;
|
|
23854
|
+
});
|
|
23855
|
+
}
|
|
23856
|
+
WorkflowSchedule.Get = Get;
|
|
23857
|
+
function GetList(params) {
|
|
23858
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
23859
|
+
if (!params) {
|
|
23860
|
+
params = {};
|
|
23861
|
+
}
|
|
23862
|
+
let { api, req } = params;
|
|
23863
|
+
if (!api) {
|
|
23864
|
+
api = exports.ENVIRONMENT.Api().GetBruceApi();
|
|
23865
|
+
}
|
|
23866
|
+
const key = GetListCacheKey();
|
|
23867
|
+
const cache = api.GetCacheItem(key, req);
|
|
23868
|
+
if (cache === null || cache === void 0 ? void 0 : cache.found) {
|
|
23869
|
+
return cache.data;
|
|
23870
|
+
}
|
|
23871
|
+
const request = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
|
|
23872
|
+
try {
|
|
23873
|
+
const data = yield api.GET("workflow/schedules", exports.Api.PrepReqParams(req));
|
|
23874
|
+
res({ workflowSchedules: ParseListResponse(data) });
|
|
23875
|
+
}
|
|
23876
|
+
catch (e) {
|
|
23877
|
+
rej(e);
|
|
23878
|
+
}
|
|
23879
|
+
}));
|
|
23880
|
+
api.SetCacheItem({ key, value: request, req });
|
|
23881
|
+
return request;
|
|
23882
|
+
});
|
|
23883
|
+
}
|
|
23884
|
+
WorkflowSchedule.GetList = GetList;
|
|
23885
|
+
function Update(params) {
|
|
23886
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
23887
|
+
let { api, workflowSchedule, req } = params;
|
|
23888
|
+
if (!api) {
|
|
23889
|
+
api = exports.ENVIRONMENT.Api().GetBruceApi();
|
|
23890
|
+
}
|
|
23891
|
+
if (!workflowSchedule) {
|
|
23892
|
+
workflowSchedule = {};
|
|
23893
|
+
}
|
|
23894
|
+
const id = workflowSchedule.ID && workflowSchedule.ID > 0 ? workflowSchedule.ID : 0;
|
|
23895
|
+
const data = yield api.POST(`workflow/schedule/${id}`, workflowSchedule, exports.Api.PrepReqParams(req));
|
|
23896
|
+
const parsed = ParseResponse(data);
|
|
23897
|
+
api.Cache.Remove(GetListCacheKey());
|
|
23898
|
+
if (id > 0) {
|
|
23899
|
+
api.Cache.Remove(GetCacheKey(id));
|
|
23900
|
+
}
|
|
23901
|
+
if (parsed === null || parsed === void 0 ? void 0 : parsed.ID) {
|
|
23902
|
+
api.Cache.Remove(GetCacheKey(parsed.ID));
|
|
23903
|
+
}
|
|
23904
|
+
api.Cache.RemoveByStartsWith(exports.Api.ECacheKey.WorkflowItem);
|
|
23905
|
+
return { workflowSchedule: parsed };
|
|
23906
|
+
});
|
|
23907
|
+
}
|
|
23908
|
+
WorkflowSchedule.Update = Update;
|
|
23909
|
+
function Delete(params) {
|
|
23910
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
23911
|
+
let { api, workflowScheduleId, req } = params;
|
|
23912
|
+
if (isInvalidId$1(workflowScheduleId)) {
|
|
23913
|
+
throw ("Workflow Schedule ID is required.");
|
|
23914
|
+
}
|
|
23915
|
+
if (!api) {
|
|
23916
|
+
api = exports.ENVIRONMENT.Api().GetBruceApi();
|
|
23917
|
+
}
|
|
23918
|
+
yield api.DELETE(`workflow/schedule/${workflowScheduleId}`, exports.Api.PrepReqParams(req));
|
|
23919
|
+
api.Cache.Remove(GetCacheKey(workflowScheduleId));
|
|
23920
|
+
api.Cache.Remove(GetListCacheKey());
|
|
23921
|
+
api.Cache.RemoveByStartsWith(exports.Api.ECacheKey.WorkflowItem);
|
|
23922
|
+
});
|
|
23923
|
+
}
|
|
23924
|
+
WorkflowSchedule.Delete = Delete;
|
|
23925
|
+
function ParseResponse(response) {
|
|
23926
|
+
var _a, _b, _c, _d;
|
|
23927
|
+
const parsed = parseObject$7(response);
|
|
23928
|
+
const parsedResult = (_a = parseObject$7(parsed === null || parsed === void 0 ? void 0 : parsed.Result)) !== null && _a !== void 0 ? _a : parsed === null || parsed === void 0 ? void 0 : parsed.Result;
|
|
23929
|
+
return (_d = (_c = (_b = parsed === null || parsed === void 0 ? void 0 : parsed.WorkflowSchedule) !== null && _b !== void 0 ? _b : parsedResult === null || parsedResult === void 0 ? void 0 : parsedResult.WorkflowSchedule) !== null && _c !== void 0 ? _c : parsedResult) !== null && _d !== void 0 ? _d : parsed;
|
|
23930
|
+
}
|
|
23931
|
+
WorkflowSchedule.ParseResponse = ParseResponse;
|
|
23932
|
+
function ParseListResponse(response) {
|
|
23933
|
+
var _a;
|
|
23934
|
+
const parsed = parseObject$7(response);
|
|
23935
|
+
const parsedResult = (_a = parseObject$7(parsed === null || parsed === void 0 ? void 0 : parsed.Result)) !== null && _a !== void 0 ? _a : parsed === null || parsed === void 0 ? void 0 : parsed.Result;
|
|
23936
|
+
const source = parsedResult !== null && parsedResult !== void 0 ? parsedResult : parsed;
|
|
23937
|
+
if (Array.isArray(source === null || source === void 0 ? void 0 : source.Items)) {
|
|
23938
|
+
return source.Items;
|
|
23939
|
+
}
|
|
23940
|
+
if (Array.isArray(source === null || source === void 0 ? void 0 : source.WorkflowSchedules)) {
|
|
23941
|
+
return source.WorkflowSchedules;
|
|
23942
|
+
}
|
|
23943
|
+
if (Array.isArray(source)) {
|
|
23944
|
+
return source;
|
|
23945
|
+
}
|
|
23946
|
+
return [];
|
|
23947
|
+
}
|
|
23948
|
+
WorkflowSchedule.ParseListResponse = ParseListResponse;
|
|
23949
|
+
function GetCacheKey(id) {
|
|
23950
|
+
return `${exports.Api.ECacheKey.WorkflowSchedule}${exports.Api.ECacheKey.Id}${id}`;
|
|
23951
|
+
}
|
|
23952
|
+
WorkflowSchedule.GetCacheKey = GetCacheKey;
|
|
23953
|
+
function GetListCacheKey() {
|
|
23954
|
+
return exports.Api.ECacheKey.WorkflowSchedule;
|
|
23955
|
+
}
|
|
23956
|
+
WorkflowSchedule.GetListCacheKey = GetListCacheKey;
|
|
23957
|
+
})(exports.WorkflowSchedule || (exports.WorkflowSchedule = {}));
|
|
23958
|
+
function parseObject$7(data) {
|
|
23959
|
+
if (data == null || data == undefined) {
|
|
23960
|
+
return null;
|
|
23961
|
+
}
|
|
23962
|
+
if (typeof data == "string") {
|
|
23963
|
+
try {
|
|
23964
|
+
return JSON.parse(data);
|
|
23965
|
+
}
|
|
23966
|
+
catch (_a) {
|
|
23967
|
+
return null;
|
|
23968
|
+
}
|
|
23969
|
+
}
|
|
23970
|
+
return data;
|
|
23971
|
+
}
|
|
23972
|
+
function isInvalidId$1(id) {
|
|
23973
|
+
return id == null || id === "" || !isFinite(Number(id)) || Number(id) <= 0;
|
|
23974
|
+
}
|
|
23975
|
+
|
|
23602
23976
|
(function (WorkflowType) {
|
|
23603
23977
|
/**
|
|
23604
23978
|
* Gets a workflow type by ID.
|
|
@@ -23607,7 +23981,7 @@
|
|
|
23607
23981
|
function Get(params) {
|
|
23608
23982
|
return __awaiter(this, void 0, void 0, function* () {
|
|
23609
23983
|
let { api, workflowTypeId, req: reqParams } = params;
|
|
23610
|
-
if (isInvalidId(workflowTypeId)) {
|
|
23984
|
+
if (isInvalidId$2(workflowTypeId)) {
|
|
23611
23985
|
throw ("Workflow Type ID is required.");
|
|
23612
23986
|
}
|
|
23613
23987
|
if (!api) {
|
|
@@ -23713,7 +24087,7 @@
|
|
|
23713
24087
|
function Delete(params) {
|
|
23714
24088
|
return __awaiter(this, void 0, void 0, function* () {
|
|
23715
24089
|
let { api, workflowTypeId, req: reqParams } = params;
|
|
23716
|
-
if (isInvalidId(workflowTypeId)) {
|
|
24090
|
+
if (isInvalidId$2(workflowTypeId)) {
|
|
23717
24091
|
throw ("Workflow Type ID is required.");
|
|
23718
24092
|
}
|
|
23719
24093
|
if (!api) {
|
|
@@ -23733,7 +24107,7 @@
|
|
|
23733
24107
|
function GetStatuses(params) {
|
|
23734
24108
|
return __awaiter(this, void 0, void 0, function* () {
|
|
23735
24109
|
let { api, workflowTypeId, req: reqParams } = params;
|
|
23736
|
-
if (isInvalidId(workflowTypeId)) {
|
|
24110
|
+
if (isInvalidId$2(workflowTypeId)) {
|
|
23737
24111
|
throw ("Workflow Type ID is required.");
|
|
23738
24112
|
}
|
|
23739
24113
|
if (!api) {
|
|
@@ -23771,7 +24145,7 @@
|
|
|
23771
24145
|
function AddStatuses(params) {
|
|
23772
24146
|
return __awaiter(this, void 0, void 0, function* () {
|
|
23773
24147
|
let { api, workflowTypeId, workflowStatusIds, req: reqParams } = params;
|
|
23774
|
-
if (isInvalidId(workflowTypeId)) {
|
|
24148
|
+
if (isInvalidId$2(workflowTypeId)) {
|
|
23775
24149
|
throw ("Workflow Type ID is required.");
|
|
23776
24150
|
}
|
|
23777
24151
|
if (!(workflowStatusIds === null || workflowStatusIds === void 0 ? void 0 : workflowStatusIds.length)) {
|
|
@@ -23795,7 +24169,7 @@
|
|
|
23795
24169
|
function RemoveStatuses(params) {
|
|
23796
24170
|
return __awaiter(this, void 0, void 0, function* () {
|
|
23797
24171
|
let { api, workflowTypeId, workflowStatusIds, req: reqParams } = params;
|
|
23798
|
-
if (isInvalidId(workflowTypeId)) {
|
|
24172
|
+
if (isInvalidId$2(workflowTypeId)) {
|
|
23799
24173
|
throw ("Workflow Type ID is required.");
|
|
23800
24174
|
}
|
|
23801
24175
|
if (!(workflowStatusIds === null || workflowStatusIds === void 0 ? void 0 : workflowStatusIds.length)) {
|
|
@@ -23817,8 +24191,8 @@
|
|
|
23817
24191
|
*/
|
|
23818
24192
|
function ParseResponse(response) {
|
|
23819
24193
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
23820
|
-
const parsed = parseObject$
|
|
23821
|
-
const parsedResult = (_a = parseObject$
|
|
24194
|
+
const parsed = parseObject$8(response);
|
|
24195
|
+
const parsedResult = (_a = parseObject$8(parsed === null || parsed === void 0 ? void 0 : parsed.Result)) !== null && _a !== void 0 ? _a : parsed === null || parsed === void 0 ? void 0 : parsed.Result;
|
|
23822
24196
|
return (_h = (_g = (_f = (_e = (_d = (_c = (_b = parsed === null || parsed === void 0 ? void 0 : parsed.WorkflowType) !== null && _b !== void 0 ? _b : parsed === null || parsed === void 0 ? void 0 : parsed.WorkflowItemType) !== null && _c !== void 0 ? _c : parsed === null || parsed === void 0 ? void 0 : parsed.BruceWorkflowItemType) !== null && _d !== void 0 ? _d : parsedResult === null || parsedResult === void 0 ? void 0 : parsedResult.WorkflowType) !== null && _e !== void 0 ? _e : parsedResult === null || parsedResult === void 0 ? void 0 : parsedResult.WorkflowItemType) !== null && _f !== void 0 ? _f : parsedResult === null || parsedResult === void 0 ? void 0 : parsedResult.BruceWorkflowItemType) !== null && _g !== void 0 ? _g : parsedResult) !== null && _h !== void 0 ? _h : parsed;
|
|
23823
24197
|
}
|
|
23824
24198
|
WorkflowType.ParseResponse = ParseResponse;
|
|
@@ -23865,7 +24239,7 @@
|
|
|
23865
24239
|
})(exports.WorkflowType || (exports.WorkflowType = {}));
|
|
23866
24240
|
// Alias that mirrors the API route/model wording.
|
|
23867
24241
|
var WorkflowItemType = exports.WorkflowType;
|
|
23868
|
-
function parseObject$
|
|
24242
|
+
function parseObject$8(data) {
|
|
23869
24243
|
if (data == null || data == undefined) {
|
|
23870
24244
|
return null;
|
|
23871
24245
|
}
|
|
@@ -23879,13 +24253,13 @@
|
|
|
23879
24253
|
}
|
|
23880
24254
|
return data;
|
|
23881
24255
|
}
|
|
23882
|
-
function isInvalidId(id) {
|
|
24256
|
+
function isInvalidId$2(id) {
|
|
23883
24257
|
return id == null || id === "" || !isFinite(Number(id)) || Number(id) <= 0;
|
|
23884
24258
|
}
|
|
23885
24259
|
function parseList(response, wrapperKeys) {
|
|
23886
24260
|
var _a, _b, _c, _d, _e, _f;
|
|
23887
|
-
const parsed = parseObject$
|
|
23888
|
-
const parsedResult = (_a = parseObject$
|
|
24261
|
+
const parsed = parseObject$8(response);
|
|
24262
|
+
const parsedResult = (_a = parseObject$8(parsed === null || parsed === void 0 ? void 0 : parsed.Result)) !== null && _a !== void 0 ? _a : parsed === null || parsed === void 0 ? void 0 : parsed.Result;
|
|
23889
24263
|
const list = (_f = (_e = (_d = (_c = (_b = parsed === null || parsed === void 0 ? void 0 : parsed.Items) !== null && _b !== void 0 ? _b : parsedResult === null || parsedResult === void 0 ? void 0 : parsedResult.Items) !== null && _c !== void 0 ? _c : getFirstWrappedArray(parsed, wrapperKeys)) !== null && _d !== void 0 ? _d : getFirstWrappedArray(parsedResult, wrapperKeys)) !== null && _e !== void 0 ? _e : parsedResult) !== null && _f !== void 0 ? _f : parsed;
|
|
23890
24264
|
if (Array.isArray(list)) {
|
|
23891
24265
|
return list;
|
|
@@ -23905,7 +24279,7 @@
|
|
|
23905
24279
|
}
|
|
23906
24280
|
|
|
23907
24281
|
// This is updated with the package.json version on build.
|
|
23908
|
-
const VERSION = "7.1.
|
|
24282
|
+
const VERSION = "7.1.105";
|
|
23909
24283
|
|
|
23910
24284
|
exports.VERSION = VERSION;
|
|
23911
24285
|
exports.AbstractApi = AbstractApi;
|