bruce-models 7.1.104 → 7.1.106

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.
@@ -91,6 +91,10 @@ var Api;
91
91
  ECacheKey["EntityHistoricDataPage"] = "entityhistoricdatapage";
92
92
  ECacheKey["AccountLimits"] = "accountlimits";
93
93
  ECacheKey["WorkflowType"] = "workflowtype";
94
+ ECacheKey["WorkflowStatus"] = "workflowstatus";
95
+ ECacheKey["WorkflowQueue"] = "workflowqueue";
96
+ ECacheKey["WorkflowItem"] = "workflowitem";
97
+ ECacheKey["WorkflowSchedule"] = "workflowschedule";
94
98
  })(ECacheKey = Api.ECacheKey || (Api.ECacheKey = {}));
95
99
  // 1 minute.
96
100
  Api.DEFAULT_CACHE_DURATION = 60 * 1000;
@@ -368,6 +372,7 @@ var AccountConcept;
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) {
@@ -704,6 +709,16 @@ var RecordChangeFeed;
704
709
  return [Api.ECacheKey.ProjectView, Api.ECacheKey.ProjectViewBookmark];
705
710
  case AccountConcept.EConcept.RELATION_TYPE:
706
711
  return [Api.ECacheKey.RelationType];
712
+ case AccountConcept.EConcept.WORKFLOW_ITEM:
713
+ return [Api.ECacheKey.WorkflowItem];
714
+ case AccountConcept.EConcept.WORKFLOW_ITEM_STATUS:
715
+ return [Api.ECacheKey.WorkflowStatus, Api.ECacheKey.WorkflowType, Api.ECacheKey.WorkflowItem];
716
+ case AccountConcept.EConcept.WORKFLOW_ITEM_TYPE:
717
+ return [Api.ECacheKey.WorkflowType, Api.ECacheKey.WorkflowItem, Api.ECacheKey.WorkflowSchedule];
718
+ case AccountConcept.EConcept.WORKFLOW_QUEUE:
719
+ return [Api.ECacheKey.WorkflowQueue, Api.ECacheKey.WorkflowType, Api.ECacheKey.WorkflowItem, Api.ECacheKey.WorkflowSchedule];
720
+ case AccountConcept.EConcept.WORKFLOW_SCHEDULE:
721
+ return [Api.ECacheKey.WorkflowSchedule, Api.ECacheKey.WorkflowItem];
707
722
  case AccountConcept.EConcept.TILESET:
708
723
  return [Api.ECacheKey.Tileset, Api.ECacheKey.PublishTileset, Api.ECacheKey.TilesetAccess];
709
724
  case AccountConcept.EConcept.UI_ENTITY_DISPLAY_SETTING:
@@ -14395,6 +14410,15 @@ var Style;
14395
14410
  EPolygonExtrusionType["Path"] = "PATH";
14396
14411
  EPolygonExtrusionType["Texture"] = "TEXTURE";
14397
14412
  })(EPolygonExtrusionType = Style.EPolygonExtrusionType || (Style.EPolygonExtrusionType = {}));
14413
+ /**
14414
+ * A look a renderer may put over a polygon, on top of whatever its fill already decided.
14415
+ * Default is "NONE".
14416
+ */
14417
+ let EEffectType;
14418
+ (function (EEffectType) {
14419
+ EEffectType["None"] = "NONE";
14420
+ EEffectType["Water"] = "WATER";
14421
+ })(EEffectType = Style.EEffectType || (Style.EEffectType = {}));
14398
14422
  /**
14399
14423
  * Returns a list of styles.
14400
14424
  * @param params
@@ -17590,7 +17614,7 @@ var Ontology;
17590
17614
  try {
17591
17615
  const data = yield api.GET(`ontology/${ontologyId}`, Api.PrepReqParams(reqParams));
17592
17616
  res({
17593
- ontology: ParseResponse(data)
17617
+ ontology: data
17594
17618
  });
17595
17619
  }
17596
17620
  catch (e) {
@@ -17618,10 +17642,11 @@ var Ontology;
17618
17642
  return cache.data;
17619
17643
  }
17620
17644
  const req = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
17645
+ var _a;
17621
17646
  try {
17622
17647
  const data = yield api.GET("ontologies", Api.PrepReqParams(reqParams));
17623
17648
  res({
17624
- ontologies: ParseListResponse(data)
17649
+ ontologies: (_a = data === null || data === void 0 ? void 0 : data.Items) !== null && _a !== void 0 ? _a : []
17625
17650
  });
17626
17651
  }
17627
17652
  catch (e) {
@@ -17653,7 +17678,7 @@ var Ontology;
17653
17678
  api.Cache.Remove(GetCacheKey(data.ID));
17654
17679
  api.Cache.RemoveByStartsWith(GetListCacheKey());
17655
17680
  return {
17656
- ontology: ParseResponse(res)
17681
+ ontology: res
17657
17682
  };
17658
17683
  });
17659
17684
  }
@@ -17690,24 +17715,52 @@ var Ontology;
17690
17715
  });
17691
17716
  }
17692
17717
  Ontology.Describe = Describe;
17693
- function ParseResponse(response) {
17694
- var _a, _b, _c, _d, _e, _f;
17695
- const parsed = parseObject$5(response);
17696
- const parsedResult = (_a = parseObject$5(parsed === null || parsed === void 0 ? void 0 : parsed.Result)) !== null && _a !== void 0 ? _a : parsed === null || parsed === void 0 ? void 0 : parsed.Result;
17697
- return (_f = (_e = (_d = (_c = (_b = parsed === null || parsed === void 0 ? void 0 : parsed.Ontology) !== null && _b !== void 0 ? _b : parsed === null || parsed === void 0 ? void 0 : parsed.BruceOntology) !== null && _c !== void 0 ? _c : parsedResult === null || parsedResult === void 0 ? void 0 : parsedResult.Ontology) !== null && _d !== void 0 ? _d : parsedResult === null || parsedResult === void 0 ? void 0 : parsedResult.BruceOntology) !== null && _e !== void 0 ? _e : parsedResult) !== null && _f !== void 0 ? _f : parsed;
17698
- }
17699
- Ontology.ParseResponse = ParseResponse;
17700
- function ParseListResponse(response) {
17701
- var _a, _b, _c, _d, _e, _f, _g, _h;
17702
- const parsed = parseObject$5(response);
17703
- const parsedResult = (_a = parseObject$5(parsed === null || parsed === void 0 ? void 0 : parsed.Result)) !== null && _a !== void 0 ? _a : parsed === null || parsed === void 0 ? void 0 : parsed.Result;
17704
- const list = (_h = (_g = (_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 : parsed === null || parsed === void 0 ? void 0 : parsed.Ontologies) !== null && _d !== void 0 ? _d : parsedResult === null || parsedResult === void 0 ? void 0 : parsedResult.Ontologies) !== null && _e !== void 0 ? _e : parsed === null || parsed === void 0 ? void 0 : parsed.BruceOntologies) !== null && _f !== void 0 ? _f : parsedResult === null || parsedResult === void 0 ? void 0 : parsedResult.BruceOntologies) !== null && _g !== void 0 ? _g : parsedResult) !== null && _h !== void 0 ? _h : parsed;
17705
- if (Array.isArray(list)) {
17706
- return list;
17707
- }
17708
- return [];
17718
+ /**
17719
+ * Reads an Ontology Diagram's records in one request.
17720
+ */
17721
+ function GetConnections(params) {
17722
+ return __awaiter(this, void 0, void 0, function* () {
17723
+ let { api, ontologyId, unassigned, entityTypeIds, depth, includeImports, includeParents, req: reqParams } = params;
17724
+ if (!api) {
17725
+ api = ENVIRONMENT.Api().GetBruceApi();
17726
+ }
17727
+ const hasEntityTypeIds = Array.isArray(entityTypeIds) && entityTypeIds.length > 0;
17728
+ if ((ontologyId == null || ontologyId === "") && !unassigned && !hasEntityTypeIds) {
17729
+ throw ("One of ontologyId, unassigned or entityTypeIds is required.");
17730
+ }
17731
+ const urlParams = new URLSearchParams();
17732
+ if (includeImports) {
17733
+ urlParams.append("IncludeImports", "true");
17734
+ }
17735
+ let url;
17736
+ if (!unassigned && !hasEntityTypeIds) {
17737
+ url = `ontology/${ontologyId}/connections`;
17738
+ }
17739
+ else {
17740
+ if (ontologyId != null && ontologyId !== "") {
17741
+ urlParams.append("Ontology.ID", String(ontologyId));
17742
+ }
17743
+ if (unassigned) {
17744
+ urlParams.append("Unassigned", "true");
17745
+ }
17746
+ for (const id of entityTypeIds !== null && entityTypeIds !== void 0 ? entityTypeIds : []) {
17747
+ urlParams.append("EntityType.ID", id);
17748
+ }
17749
+ if (depth != null) {
17750
+ urlParams.append("Depth", String(depth));
17751
+ }
17752
+ if (includeParents) {
17753
+ urlParams.append("IncludeParents", "true");
17754
+ }
17755
+ url = "ontologyConnections";
17756
+ }
17757
+ const query = urlParams.toString();
17758
+ return {
17759
+ connections: yield api.GET(query ? `${url}?${query}` : url, Api.PrepReqParams(reqParams))
17760
+ };
17761
+ });
17709
17762
  }
17710
- Ontology.ParseListResponse = ParseListResponse;
17763
+ Ontology.GetConnections = GetConnections;
17711
17764
  function GetCacheKey(id) {
17712
17765
  return `${Api.ECacheKey.Ontology}${Api.ECacheKey.Id}${id}`;
17713
17766
  }
@@ -17717,20 +17770,6 @@ var Ontology;
17717
17770
  }
17718
17771
  Ontology.GetListCacheKey = GetListCacheKey;
17719
17772
  })(Ontology || (Ontology = {}));
17720
- function parseObject$5(data) {
17721
- if (data == null || data == undefined) {
17722
- return null;
17723
- }
17724
- if (typeof data == "string") {
17725
- try {
17726
- return JSON.parse(data);
17727
- }
17728
- catch (_a) {
17729
- return null;
17730
- }
17731
- }
17732
- return data;
17733
- }
17734
17773
 
17735
17774
  var ExportBrz;
17736
17775
  (function (ExportBrz) {
@@ -23979,6 +24018,367 @@ var UrlUtils;
23979
24018
  UrlUtils.ConstructUrl = ConstructUrl;
23980
24019
  })(UrlUtils || (UrlUtils = {}));
23981
24020
 
24021
+ var WorkflowItem;
24022
+ (function (WorkflowItem) {
24023
+ function Get(params) {
24024
+ return __awaiter(this, void 0, void 0, function* () {
24025
+ let { api, workflowItemId, req } = params;
24026
+ if (isInvalidId(workflowItemId)) {
24027
+ throw ("Workflow Item ID is required.");
24028
+ }
24029
+ if (!api) {
24030
+ api = ENVIRONMENT.Api().GetBruceApi();
24031
+ }
24032
+ const key = GetCacheKey(workflowItemId);
24033
+ const cache = api.GetCacheItem(key, req);
24034
+ if (cache === null || cache === void 0 ? void 0 : cache.found) {
24035
+ return cache.data;
24036
+ }
24037
+ const request = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
24038
+ try {
24039
+ const data = yield api.GET(`workflow/item/${workflowItemId}`, Api.PrepReqParams(req));
24040
+ res({ workflowItem: ParseResponse(data) });
24041
+ }
24042
+ catch (e) {
24043
+ rej(e);
24044
+ }
24045
+ }));
24046
+ api.SetCacheItem({ key, value: request, req });
24047
+ return request;
24048
+ });
24049
+ }
24050
+ WorkflowItem.Get = Get;
24051
+ function GetList(params) {
24052
+ return __awaiter(this, void 0, void 0, function* () {
24053
+ if (!params) {
24054
+ params = {};
24055
+ }
24056
+ let { api, req } = params;
24057
+ if (!api) {
24058
+ api = ENVIRONMENT.Api().GetBruceApi();
24059
+ }
24060
+ const url = BuildListUrl(params);
24061
+ const key = GetListCacheKey(params);
24062
+ const cache = api.GetCacheItem(key, req);
24063
+ if (cache === null || cache === void 0 ? void 0 : cache.found) {
24064
+ return cache.data;
24065
+ }
24066
+ const request = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
24067
+ try {
24068
+ const data = yield api.GET(url, Api.PrepReqParams(req));
24069
+ res(ParseListResponse(data));
24070
+ }
24071
+ catch (e) {
24072
+ rej(e);
24073
+ }
24074
+ }));
24075
+ api.SetCacheItem({ key, value: request, req });
24076
+ return request;
24077
+ });
24078
+ }
24079
+ WorkflowItem.GetList = GetList;
24080
+ function Create(params) {
24081
+ var _a, _b, _c, _d, _e;
24082
+ return __awaiter(this, void 0, void 0, function* () {
24083
+ let { api, workflowItemTypeId, entityTypeId, workflowItem, req } = params;
24084
+ if (!api) {
24085
+ api = ENVIRONMENT.Api().GetBruceApi();
24086
+ }
24087
+ if (!workflowItem) {
24088
+ workflowItem = {};
24089
+ }
24090
+ 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;
24091
+ if (isInvalidId(typeId)) {
24092
+ throw ("Workflow Item Type ID is required.");
24093
+ }
24094
+ const typePath = encodePath(typeId);
24095
+ const entityTypePath = encodePath((_d = entityTypeId !== null && entityTypeId !== void 0 ? entityTypeId : workflowItem["EntityType.ID"]) !== null && _d !== void 0 ? _d : "");
24096
+ const data = yield api.POST(`workflow/createnew/${typePath}/${entityTypePath}`, workflowItem, Api.PrepReqParams(req));
24097
+ api.Cache.RemoveByStartsWith(Api.ECacheKey.WorkflowItem);
24098
+ api.Cache.RemoveByStartsWith(Api.ECacheKey.Entity);
24099
+ return {
24100
+ workflowItem: ParseResponse(data),
24101
+ entity: (_e = parseObject$5(data)) === null || _e === void 0 ? void 0 : _e.Entity
24102
+ };
24103
+ });
24104
+ }
24105
+ WorkflowItem.Create = Create;
24106
+ function Update(params) {
24107
+ return __awaiter(this, void 0, void 0, function* () {
24108
+ let { api, workflowItem, req } = params;
24109
+ if (!api) {
24110
+ api = ENVIRONMENT.Api().GetBruceApi();
24111
+ }
24112
+ if (!workflowItem) {
24113
+ workflowItem = {};
24114
+ }
24115
+ const id = workflowItem.ID && workflowItem.ID > 0 ? workflowItem.ID : 0;
24116
+ const data = yield api.POST(`workflow/item/${id}`, workflowItem, Api.PrepReqParams(req));
24117
+ api.Cache.RemoveByStartsWith(Api.ECacheKey.WorkflowItem);
24118
+ if (workflowItem["Entity.ID"]) {
24119
+ api.Cache.RemoveByStartsWith(`${Api.ECacheKey.Entity}${Api.ECacheKey.Id}${workflowItem["Entity.ID"]}`);
24120
+ }
24121
+ return { workflowItem: ParseResponse(data) };
24122
+ });
24123
+ }
24124
+ WorkflowItem.Update = Update;
24125
+ function Delete(params) {
24126
+ return __awaiter(this, void 0, void 0, function* () {
24127
+ let { api, workflowItemId, req } = params;
24128
+ if (isInvalidId(workflowItemId)) {
24129
+ throw ("Workflow Item ID is required.");
24130
+ }
24131
+ if (!api) {
24132
+ api = ENVIRONMENT.Api().GetBruceApi();
24133
+ }
24134
+ yield api.DELETE(`workflow/item/${workflowItemId}`, Api.PrepReqParams(req));
24135
+ api.Cache.RemoveByStartsWith(Api.ECacheKey.WorkflowItem);
24136
+ api.Cache.RemoveByStartsWith(Api.ECacheKey.Entity);
24137
+ });
24138
+ }
24139
+ WorkflowItem.Delete = Delete;
24140
+ function BuildListUrl(params) {
24141
+ var _a;
24142
+ const q = new URLSearchParams();
24143
+ appendParam(q, "pageSize", params === null || params === void 0 ? void 0 : params.pageSize);
24144
+ appendParam(q, "pageIndex", params === null || params === void 0 ? void 0 : params.pageIndex);
24145
+ appendParam(q, "OrderBy", params === null || params === void 0 ? void 0 : params.orderBy);
24146
+ appendParam(q, "SortOrder", params === null || params === void 0 ? void 0 : params.sortOrder);
24147
+ appendParam(q, "statusend", params === null || params === void 0 ? void 0 : params.statusEnd);
24148
+ appendParam(q, "assignedtome", params === null || params === void 0 ? void 0 : params.assignedToMe);
24149
+ appendParam(q, "itemtypeid", params === null || params === void 0 ? void 0 : params.itemTypeId);
24150
+ appendParam(q, "queueid", params === null || params === void 0 ? void 0 : params.queueId);
24151
+ 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);
24152
+ appendParam(q, "statusid", params === null || params === void 0 ? void 0 : params.statusId);
24153
+ appendParam(q, "CreatedByUserID", params === null || params === void 0 ? void 0 : params.createdByUserId);
24154
+ appendParam(q, "DueDate", params === null || params === void 0 ? void 0 : params.dueDate);
24155
+ appendParam(q, "DueDateFrom", params === null || params === void 0 ? void 0 : params.dueDateFrom);
24156
+ appendParam(q, "DueDateTo", params === null || params === void 0 ? void 0 : params.dueDateTo);
24157
+ appendParam(q, "SlideID", params === null || params === void 0 ? void 0 : params.slideId);
24158
+ appendParam(q, "EntityID", params === null || params === void 0 ? void 0 : params.entityId);
24159
+ appendParam(q, "SubjectEntityID", params === null || params === void 0 ? void 0 : params.subjectEntityId);
24160
+ appendParam(q, "Description", params === null || params === void 0 ? void 0 : params.description);
24161
+ appendParam(q, "Search", params === null || params === void 0 ? void 0 : params.search);
24162
+ const qs = q.toString();
24163
+ return qs ? `workflow/itemsquery?${qs}` : "workflow/itemsquery";
24164
+ }
24165
+ WorkflowItem.BuildListUrl = BuildListUrl;
24166
+ function ParseResponse(response) {
24167
+ var _a, _b, _c, _d;
24168
+ const parsed = parseObject$5(response);
24169
+ const parsedResult = (_a = parseObject$5(parsed === null || parsed === void 0 ? void 0 : parsed.Result)) !== null && _a !== void 0 ? _a : parsed === null || parsed === void 0 ? void 0 : parsed.Result;
24170
+ 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;
24171
+ }
24172
+ WorkflowItem.ParseResponse = ParseResponse;
24173
+ function ParseListResponse(response) {
24174
+ var _a;
24175
+ const parsed = parseObject$5(response);
24176
+ const parsedResult = (_a = parseObject$5(parsed === null || parsed === void 0 ? void 0 : parsed.Result)) !== null && _a !== void 0 ? _a : parsed === null || parsed === void 0 ? void 0 : parsed.Result;
24177
+ const source = parsedResult !== null && parsedResult !== void 0 ? parsedResult : parsed;
24178
+ const items = Array.isArray(source)
24179
+ ? source
24180
+ : Array.isArray(source === null || source === void 0 ? void 0 : source.Items)
24181
+ ? source.Items
24182
+ : [];
24183
+ return {
24184
+ items,
24185
+ totalCount: source === null || source === void 0 ? void 0 : source.TotalCount,
24186
+ nextPage: source === null || source === void 0 ? void 0 : source.NextPage,
24187
+ nextPageUrl: source === null || source === void 0 ? void 0 : source.NextPageURL
24188
+ };
24189
+ }
24190
+ WorkflowItem.ParseListResponse = ParseListResponse;
24191
+ function GetCacheKey(id) {
24192
+ return `${Api.ECacheKey.WorkflowItem}${Api.ECacheKey.Id}${id}`;
24193
+ }
24194
+ WorkflowItem.GetCacheKey = GetCacheKey;
24195
+ function GetListCacheKey(params) {
24196
+ return `${Api.ECacheKey.WorkflowItem}${Api.ECacheKey.ListId}${BuildListUrl(params)}`;
24197
+ }
24198
+ WorkflowItem.GetListCacheKey = GetListCacheKey;
24199
+ })(WorkflowItem || (WorkflowItem = {}));
24200
+ function appendParam(q, key, value) {
24201
+ if (value == null || value === "") {
24202
+ return;
24203
+ }
24204
+ if (Array.isArray(value)) {
24205
+ if (value.length) {
24206
+ q.append(key, value.join(","));
24207
+ }
24208
+ return;
24209
+ }
24210
+ q.append(key, String(value));
24211
+ }
24212
+ function parseObject$5(data) {
24213
+ if (data == null || data == undefined) {
24214
+ return null;
24215
+ }
24216
+ if (typeof data == "string") {
24217
+ try {
24218
+ return JSON.parse(data);
24219
+ }
24220
+ catch (_a) {
24221
+ return null;
24222
+ }
24223
+ }
24224
+ return data;
24225
+ }
24226
+ function isInvalidId(id) {
24227
+ return id == null || id === "" || !isFinite(Number(id)) || Number(id) <= 0;
24228
+ }
24229
+ function encodePath(value) {
24230
+ return encodeURIComponent(String(value !== null && value !== void 0 ? value : ""));
24231
+ }
24232
+
24233
+ var WorkflowSchedule;
24234
+ (function (WorkflowSchedule) {
24235
+ function Get(params) {
24236
+ return __awaiter(this, void 0, void 0, function* () {
24237
+ let { api, workflowScheduleId, req } = params;
24238
+ if (isInvalidId$1(workflowScheduleId)) {
24239
+ throw ("Workflow Schedule ID is required.");
24240
+ }
24241
+ if (!api) {
24242
+ api = ENVIRONMENT.Api().GetBruceApi();
24243
+ }
24244
+ const key = GetCacheKey(workflowScheduleId);
24245
+ const cache = api.GetCacheItem(key, req);
24246
+ if (cache === null || cache === void 0 ? void 0 : cache.found) {
24247
+ return cache.data;
24248
+ }
24249
+ const request = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
24250
+ try {
24251
+ const data = yield api.GET(`workflow/schedule/${workflowScheduleId}`, Api.PrepReqParams(req));
24252
+ res({ workflowSchedule: ParseResponse(data) });
24253
+ }
24254
+ catch (e) {
24255
+ rej(e);
24256
+ }
24257
+ }));
24258
+ api.SetCacheItem({ key, value: request, req });
24259
+ return request;
24260
+ });
24261
+ }
24262
+ WorkflowSchedule.Get = Get;
24263
+ function GetList(params) {
24264
+ return __awaiter(this, void 0, void 0, function* () {
24265
+ if (!params) {
24266
+ params = {};
24267
+ }
24268
+ let { api, req } = params;
24269
+ if (!api) {
24270
+ api = ENVIRONMENT.Api().GetBruceApi();
24271
+ }
24272
+ const key = GetListCacheKey();
24273
+ const cache = api.GetCacheItem(key, req);
24274
+ if (cache === null || cache === void 0 ? void 0 : cache.found) {
24275
+ return cache.data;
24276
+ }
24277
+ const request = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
24278
+ try {
24279
+ const data = yield api.GET("workflow/schedules", Api.PrepReqParams(req));
24280
+ res({ workflowSchedules: ParseListResponse(data) });
24281
+ }
24282
+ catch (e) {
24283
+ rej(e);
24284
+ }
24285
+ }));
24286
+ api.SetCacheItem({ key, value: request, req });
24287
+ return request;
24288
+ });
24289
+ }
24290
+ WorkflowSchedule.GetList = GetList;
24291
+ function Update(params) {
24292
+ return __awaiter(this, void 0, void 0, function* () {
24293
+ let { api, workflowSchedule, req } = params;
24294
+ if (!api) {
24295
+ api = ENVIRONMENT.Api().GetBruceApi();
24296
+ }
24297
+ if (!workflowSchedule) {
24298
+ workflowSchedule = {};
24299
+ }
24300
+ const id = workflowSchedule.ID && workflowSchedule.ID > 0 ? workflowSchedule.ID : 0;
24301
+ const data = yield api.POST(`workflow/schedule/${id}`, workflowSchedule, Api.PrepReqParams(req));
24302
+ const parsed = ParseResponse(data);
24303
+ api.Cache.Remove(GetListCacheKey());
24304
+ if (id > 0) {
24305
+ api.Cache.Remove(GetCacheKey(id));
24306
+ }
24307
+ if (parsed === null || parsed === void 0 ? void 0 : parsed.ID) {
24308
+ api.Cache.Remove(GetCacheKey(parsed.ID));
24309
+ }
24310
+ api.Cache.RemoveByStartsWith(Api.ECacheKey.WorkflowItem);
24311
+ return { workflowSchedule: parsed };
24312
+ });
24313
+ }
24314
+ WorkflowSchedule.Update = Update;
24315
+ function Delete(params) {
24316
+ return __awaiter(this, void 0, void 0, function* () {
24317
+ let { api, workflowScheduleId, req } = params;
24318
+ if (isInvalidId$1(workflowScheduleId)) {
24319
+ throw ("Workflow Schedule ID is required.");
24320
+ }
24321
+ if (!api) {
24322
+ api = ENVIRONMENT.Api().GetBruceApi();
24323
+ }
24324
+ yield api.DELETE(`workflow/schedule/${workflowScheduleId}`, Api.PrepReqParams(req));
24325
+ api.Cache.Remove(GetCacheKey(workflowScheduleId));
24326
+ api.Cache.Remove(GetListCacheKey());
24327
+ api.Cache.RemoveByStartsWith(Api.ECacheKey.WorkflowItem);
24328
+ });
24329
+ }
24330
+ WorkflowSchedule.Delete = Delete;
24331
+ function ParseResponse(response) {
24332
+ var _a, _b, _c, _d;
24333
+ const parsed = parseObject$6(response);
24334
+ 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;
24335
+ 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;
24336
+ }
24337
+ WorkflowSchedule.ParseResponse = ParseResponse;
24338
+ function ParseListResponse(response) {
24339
+ var _a;
24340
+ const parsed = parseObject$6(response);
24341
+ 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;
24342
+ const source = parsedResult !== null && parsedResult !== void 0 ? parsedResult : parsed;
24343
+ if (Array.isArray(source === null || source === void 0 ? void 0 : source.Items)) {
24344
+ return source.Items;
24345
+ }
24346
+ if (Array.isArray(source === null || source === void 0 ? void 0 : source.WorkflowSchedules)) {
24347
+ return source.WorkflowSchedules;
24348
+ }
24349
+ if (Array.isArray(source)) {
24350
+ return source;
24351
+ }
24352
+ return [];
24353
+ }
24354
+ WorkflowSchedule.ParseListResponse = ParseListResponse;
24355
+ function GetCacheKey(id) {
24356
+ return `${Api.ECacheKey.WorkflowSchedule}${Api.ECacheKey.Id}${id}`;
24357
+ }
24358
+ WorkflowSchedule.GetCacheKey = GetCacheKey;
24359
+ function GetListCacheKey() {
24360
+ return Api.ECacheKey.WorkflowSchedule;
24361
+ }
24362
+ WorkflowSchedule.GetListCacheKey = GetListCacheKey;
24363
+ })(WorkflowSchedule || (WorkflowSchedule = {}));
24364
+ function parseObject$6(data) {
24365
+ if (data == null || data == undefined) {
24366
+ return null;
24367
+ }
24368
+ if (typeof data == "string") {
24369
+ try {
24370
+ return JSON.parse(data);
24371
+ }
24372
+ catch (_a) {
24373
+ return null;
24374
+ }
24375
+ }
24376
+ return data;
24377
+ }
24378
+ function isInvalidId$1(id) {
24379
+ return id == null || id === "" || !isFinite(Number(id)) || Number(id) <= 0;
24380
+ }
24381
+
23982
24382
  /**
23983
24383
  * Describes the "Workflow Type" concept within Nextspace.
23984
24384
  * The API names this record Workflow Item Type.
@@ -23992,7 +24392,7 @@ var WorkflowType;
23992
24392
  function Get(params) {
23993
24393
  return __awaiter(this, void 0, void 0, function* () {
23994
24394
  let { api, workflowTypeId, req: reqParams } = params;
23995
- if (isInvalidId(workflowTypeId)) {
24395
+ if (isInvalidId$2(workflowTypeId)) {
23996
24396
  throw ("Workflow Type ID is required.");
23997
24397
  }
23998
24398
  if (!api) {
@@ -24098,7 +24498,7 @@ var WorkflowType;
24098
24498
  function Delete(params) {
24099
24499
  return __awaiter(this, void 0, void 0, function* () {
24100
24500
  let { api, workflowTypeId, req: reqParams } = params;
24101
- if (isInvalidId(workflowTypeId)) {
24501
+ if (isInvalidId$2(workflowTypeId)) {
24102
24502
  throw ("Workflow Type ID is required.");
24103
24503
  }
24104
24504
  if (!api) {
@@ -24118,7 +24518,7 @@ var WorkflowType;
24118
24518
  function GetStatuses(params) {
24119
24519
  return __awaiter(this, void 0, void 0, function* () {
24120
24520
  let { api, workflowTypeId, req: reqParams } = params;
24121
- if (isInvalidId(workflowTypeId)) {
24521
+ if (isInvalidId$2(workflowTypeId)) {
24122
24522
  throw ("Workflow Type ID is required.");
24123
24523
  }
24124
24524
  if (!api) {
@@ -24156,7 +24556,7 @@ var WorkflowType;
24156
24556
  function AddStatuses(params) {
24157
24557
  return __awaiter(this, void 0, void 0, function* () {
24158
24558
  let { api, workflowTypeId, workflowStatusIds, req: reqParams } = params;
24159
- if (isInvalidId(workflowTypeId)) {
24559
+ if (isInvalidId$2(workflowTypeId)) {
24160
24560
  throw ("Workflow Type ID is required.");
24161
24561
  }
24162
24562
  if (!(workflowStatusIds === null || workflowStatusIds === void 0 ? void 0 : workflowStatusIds.length)) {
@@ -24180,7 +24580,7 @@ var WorkflowType;
24180
24580
  function RemoveStatuses(params) {
24181
24581
  return __awaiter(this, void 0, void 0, function* () {
24182
24582
  let { api, workflowTypeId, workflowStatusIds, req: reqParams } = params;
24183
- if (isInvalidId(workflowTypeId)) {
24583
+ if (isInvalidId$2(workflowTypeId)) {
24184
24584
  throw ("Workflow Type ID is required.");
24185
24585
  }
24186
24586
  if (!(workflowStatusIds === null || workflowStatusIds === void 0 ? void 0 : workflowStatusIds.length)) {
@@ -24202,8 +24602,8 @@ var WorkflowType;
24202
24602
  */
24203
24603
  function ParseResponse(response) {
24204
24604
  var _a, _b, _c, _d, _e, _f, _g, _h;
24205
- const parsed = parseObject$6(response);
24206
- 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;
24605
+ const parsed = parseObject$7(response);
24606
+ 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;
24207
24607
  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;
24208
24608
  }
24209
24609
  WorkflowType.ParseResponse = ParseResponse;
@@ -24250,7 +24650,7 @@ var WorkflowType;
24250
24650
  })(WorkflowType || (WorkflowType = {}));
24251
24651
  // Alias that mirrors the API route/model wording.
24252
24652
  var WorkflowItemType = WorkflowType;
24253
- function parseObject$6(data) {
24653
+ function parseObject$7(data) {
24254
24654
  if (data == null || data == undefined) {
24255
24655
  return null;
24256
24656
  }
@@ -24264,13 +24664,13 @@ function parseObject$6(data) {
24264
24664
  }
24265
24665
  return data;
24266
24666
  }
24267
- function isInvalidId(id) {
24667
+ function isInvalidId$2(id) {
24268
24668
  return id == null || id === "" || !isFinite(Number(id)) || Number(id) <= 0;
24269
24669
  }
24270
24670
  function parseList(response, wrapperKeys) {
24271
24671
  var _a, _b, _c, _d, _e, _f;
24272
- const parsed = parseObject$6(response);
24273
- 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;
24672
+ const parsed = parseObject$7(response);
24673
+ 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;
24274
24674
  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;
24275
24675
  if (Array.isArray(list)) {
24276
24676
  return list;
@@ -24290,7 +24690,7 @@ function getFirstWrappedArray(data, wrapperKeys) {
24290
24690
  }
24291
24691
 
24292
24692
  // This is updated with the package.json version on build.
24293
- const VERSION = "7.1.104";
24693
+ const VERSION = "7.1.106";
24294
24694
 
24295
- export { VERSION, Account, AccountAudit, AccountConcept, AccountFeatures, AccountInvite, AccountLimits, AccountTemplate, AccountType, AnnDocument, AbstractApi, Api, ApiGetters, BruceApi, GlobalApi, GuardianApi, Assembly, Calculator, ChangeSet, ClientFile, ClientFileValueMap, Bounds, BruceEvent, BruceVariable, CacheControl, Camera, Cartes, Carto, Color, DelayQueue, RequestLane, GeoJson, Geometry, LRUCache, UTC, CustomForm, DashboardView, DataFeed, DataLab, DataLabGroup, DataSource, DataTransform, Comment, Entity, EntityAttachment, EntityAttachmentType, EntityAttribute, EntityComment, EntityCoords, EntityHistoricData, EntityLink, EntityLod, EntityLodCategory, EntityRelation, EntityRelationType, EntitySource, EntityTableView, EntityTag, EntityType, EntityTypeRelation, EntityTypeTrigger, Ontology, OntologyDocument, ENVIRONMENT, ExportBrz, ExportCsv, ExportNsx, ExportUsd, Hexbin, ImportAssembly, ImportCad, ImportCsv, ImportGeoJson, ImportJson, ImportKml, ImportLcc, ImportTif, ImportedFile, Uploader, Markup, UIMarkup, NAVIGATOR_CHAT_EVENT_ENTITY_HIGHLIGHT_APPLIED, NAVIGATOR_CHAT_EVENT_SCENE_CONTEXT_PREFETCHED, NavigatorChatClient, NavigatorMcpWebSocketClient, Plugin, PluginAiTool, ProgramKey, MenuItem, ProjectView, ProjectViewBookmark, ProjectViewBookmarkGroup, ProjectViewLegacy, ProjectViewLegacyBookmark, ProjectViewLegacyTile, ProjectViewTile, ZoomControl, Scenario, HostingLocation, MessageBroker, PendingAction, RecordChangeFeed, Style, Tileset, Tracking, Permission, Session, User, UserGroup, UserMfaMethod, EncryptUtils, MathUtils, ObjectUtils, PathUtils, UrlUtils, WorkflowType, WorkflowItemType };
24695
+ export { VERSION, Account, AccountAudit, AccountConcept, AccountFeatures, AccountInvite, AccountLimits, AccountTemplate, AccountType, AnnDocument, AbstractApi, Api, ApiGetters, BruceApi, GlobalApi, GuardianApi, Assembly, Calculator, ChangeSet, ClientFile, ClientFileValueMap, Bounds, BruceEvent, BruceVariable, CacheControl, Camera, Cartes, Carto, Color, DelayQueue, RequestLane, GeoJson, Geometry, LRUCache, UTC, CustomForm, DashboardView, DataFeed, DataLab, DataLabGroup, DataSource, DataTransform, Comment, Entity, EntityAttachment, EntityAttachmentType, EntityAttribute, EntityComment, EntityCoords, EntityHistoricData, EntityLink, EntityLod, EntityLodCategory, EntityRelation, EntityRelationType, EntitySource, EntityTableView, EntityTag, EntityType, EntityTypeRelation, EntityTypeTrigger, Ontology, OntologyDocument, ENVIRONMENT, ExportBrz, ExportCsv, ExportNsx, ExportUsd, Hexbin, ImportAssembly, ImportCad, ImportCsv, ImportGeoJson, ImportJson, ImportKml, ImportLcc, ImportTif, ImportedFile, Uploader, Markup, UIMarkup, NAVIGATOR_CHAT_EVENT_ENTITY_HIGHLIGHT_APPLIED, NAVIGATOR_CHAT_EVENT_SCENE_CONTEXT_PREFETCHED, NavigatorChatClient, NavigatorMcpWebSocketClient, Plugin, PluginAiTool, ProgramKey, MenuItem, ProjectView, ProjectViewBookmark, ProjectViewBookmarkGroup, ProjectViewLegacy, ProjectViewLegacyBookmark, ProjectViewLegacyTile, ProjectViewTile, ZoomControl, Scenario, HostingLocation, MessageBroker, PendingAction, RecordChangeFeed, Style, Tileset, Tracking, Permission, Session, User, UserGroup, UserMfaMethod, EncryptUtils, MathUtils, ObjectUtils, PathUtils, UrlUtils, WorkflowItem, WorkflowSchedule, WorkflowType, WorkflowItemType };
24296
24696
  //# sourceMappingURL=bruce-models.es5.js.map