bruce-models 2.4.6 → 2.4.8

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.
Files changed (129) hide show
  1. package/dist/bruce-models.es5.js +963 -405
  2. package/dist/bruce-models.es5.js.map +1 -1
  3. package/dist/bruce-models.umd.js +945 -388
  4. package/dist/bruce-models.umd.js.map +1 -1
  5. package/dist/lib/account/account-invite.js +17 -4
  6. package/dist/lib/account/account-invite.js.map +1 -1
  7. package/dist/lib/account/account.js +20 -4
  8. package/dist/lib/account/account.js.map +1 -1
  9. package/dist/lib/ann-document/ann-document.js +8 -1
  10. package/dist/lib/ann-document/ann-document.js.map +1 -1
  11. package/dist/lib/api/api-getters.js +19 -0
  12. package/dist/lib/api/api-getters.js.map +1 -1
  13. package/dist/lib/api/bruce-api.js.map +1 -1
  14. package/dist/lib/bruce-models.js +1 -0
  15. package/dist/lib/bruce-models.js.map +1 -1
  16. package/dist/lib/client-file/client-file.js +34 -6
  17. package/dist/lib/client-file/client-file.js.map +1 -1
  18. package/dist/lib/custom-form/custom-form.js +17 -4
  19. package/dist/lib/custom-form/custom-form.js.map +1 -1
  20. package/dist/lib/data-lab/data-lab.js +4 -0
  21. package/dist/lib/data-lab/data-lab.js.map +1 -1
  22. package/dist/lib/entity/entity-attachment-type.js +13 -3
  23. package/dist/lib/entity/entity-attachment-type.js.map +1 -1
  24. package/dist/lib/entity/entity-attachment.js +21 -5
  25. package/dist/lib/entity/entity-attachment.js.map +1 -1
  26. package/dist/lib/entity/entity-comment.js +13 -3
  27. package/dist/lib/entity/entity-comment.js.map +1 -1
  28. package/dist/lib/entity/entity-coords.js +21 -5
  29. package/dist/lib/entity/entity-coords.js.map +1 -1
  30. package/dist/lib/entity/entity-link.js +13 -3
  31. package/dist/lib/entity/entity-link.js.map +1 -1
  32. package/dist/lib/entity/entity-lod-category.js +17 -4
  33. package/dist/lib/entity/entity-lod-category.js.map +1 -1
  34. package/dist/lib/entity/entity-lod.js +26 -4
  35. package/dist/lib/entity/entity-lod.js.map +1 -1
  36. package/dist/lib/entity/entity-relation-type.js +17 -4
  37. package/dist/lib/entity/entity-relation-type.js.map +1 -1
  38. package/dist/lib/entity/entity-relation.js +20 -4
  39. package/dist/lib/entity/entity-relation.js.map +1 -1
  40. package/dist/lib/entity/entity-source.js +19 -6
  41. package/dist/lib/entity/entity-source.js.map +1 -1
  42. package/dist/lib/entity/entity-tag.js +21 -5
  43. package/dist/lib/entity/entity-tag.js.map +1 -1
  44. package/dist/lib/entity/entity-type.js +16 -3
  45. package/dist/lib/entity/entity-type.js.map +1 -1
  46. package/dist/lib/entity/entity.js +25 -6
  47. package/dist/lib/entity/entity.js.map +1 -1
  48. package/dist/lib/environment.js +55 -0
  49. package/dist/lib/environment.js.map +1 -0
  50. package/dist/lib/import/import-cad.js +9 -2
  51. package/dist/lib/import/import-cad.js.map +1 -1
  52. package/dist/lib/import/import-csv.js +5 -1
  53. package/dist/lib/import/import-csv.js.map +1 -1
  54. package/dist/lib/import/import-json.js +5 -1
  55. package/dist/lib/import/import-json.js.map +1 -1
  56. package/dist/lib/import/import-kml.js +5 -1
  57. package/dist/lib/import/import-kml.js.map +1 -1
  58. package/dist/lib/import/imported-file.js +12 -2
  59. package/dist/lib/import/imported-file.js.map +1 -1
  60. package/dist/lib/internal/uploader.js +5 -1
  61. package/dist/lib/internal/uploader.js.map +1 -1
  62. package/dist/lib/plugin/plugin.js +12 -2
  63. package/dist/lib/plugin/plugin.js.map +1 -1
  64. package/dist/lib/program-key/program-key.js +17 -4
  65. package/dist/lib/program-key/program-key.js.map +1 -1
  66. package/dist/lib/project/project-view-bookmark.js +21 -5
  67. package/dist/lib/project/project-view-bookmark.js.map +1 -1
  68. package/dist/lib/project/project-view-legacy-tile.js +9 -2
  69. package/dist/lib/project/project-view-legacy-tile.js.map +1 -1
  70. package/dist/lib/project/project-view.js +16 -3
  71. package/dist/lib/project/project-view.js.map +1 -1
  72. package/dist/lib/server/hosting-location.js +22 -5
  73. package/dist/lib/server/hosting-location.js.map +1 -1
  74. package/dist/lib/server/pending-action.js +12 -2
  75. package/dist/lib/server/pending-action.js.map +1 -1
  76. package/dist/lib/server/task.js +9 -2
  77. package/dist/lib/server/task.js.map +1 -1
  78. package/dist/lib/style/style.js +17 -4
  79. package/dist/lib/style/style.js.map +1 -1
  80. package/dist/lib/tileset/tileset.js +61 -10
  81. package/dist/lib/tileset/tileset.js.map +1 -1
  82. package/dist/lib/user/session.js +13 -3
  83. package/dist/lib/user/session.js.map +1 -1
  84. package/dist/lib/user/user-group.js +25 -6
  85. package/dist/lib/user/user-group.js.map +1 -1
  86. package/dist/lib/user/user.js +58 -12
  87. package/dist/lib/user/user.js.map +1 -1
  88. package/dist/types/account/account-invite.d.ts +5 -4
  89. package/dist/types/account/account.d.ts +5 -5
  90. package/dist/types/ann-document/ann-document.d.ts +3 -3
  91. package/dist/types/api/api-getters.d.ts +1 -0
  92. package/dist/types/bruce-models.d.ts +1 -0
  93. package/dist/types/client-file/client-file.d.ts +10 -10
  94. package/dist/types/custom-form/custom-form.d.ts +4 -4
  95. package/dist/types/data-lab/data-lab.d.ts +1 -1
  96. package/dist/types/entity/entity-attachment-type.d.ts +3 -3
  97. package/dist/types/entity/entity-attachment.d.ts +6 -6
  98. package/dist/types/entity/entity-comment.d.ts +5 -4
  99. package/dist/types/entity/entity-coords.d.ts +5 -5
  100. package/dist/types/entity/entity-link.d.ts +4 -4
  101. package/dist/types/entity/entity-lod-category.d.ts +4 -4
  102. package/dist/types/entity/entity-lod.d.ts +7 -7
  103. package/dist/types/entity/entity-relation-type.d.ts +4 -4
  104. package/dist/types/entity/entity-relation.d.ts +5 -5
  105. package/dist/types/entity/entity-source.d.ts +6 -5
  106. package/dist/types/entity/entity-tag.d.ts +5 -5
  107. package/dist/types/entity/entity-type.d.ts +4 -4
  108. package/dist/types/entity/entity.d.ts +6 -6
  109. package/dist/types/environment.d.ts +16 -0
  110. package/dist/types/import/import-cad.d.ts +2 -2
  111. package/dist/types/import/import-csv.d.ts +1 -1
  112. package/dist/types/import/import-json.d.ts +1 -1
  113. package/dist/types/import/import-kml.d.ts +1 -1
  114. package/dist/types/import/imported-file.d.ts +3 -3
  115. package/dist/types/internal/uploader.d.ts +1 -1
  116. package/dist/types/plugin/plugin.d.ts +3 -3
  117. package/dist/types/program-key/program-key.d.ts +4 -4
  118. package/dist/types/project/project-view-bookmark.d.ts +7 -6
  119. package/dist/types/project/project-view-legacy-tile.d.ts +2 -2
  120. package/dist/types/project/project-view.d.ts +4 -4
  121. package/dist/types/server/hosting-location.d.ts +5 -5
  122. package/dist/types/server/pending-action.d.ts +5 -4
  123. package/dist/types/server/task.d.ts +4 -3
  124. package/dist/types/style/style.d.ts +6 -5
  125. package/dist/types/tileset/tileset.d.ts +18 -17
  126. package/dist/types/user/session.d.ts +4 -3
  127. package/dist/types/user/user-group.d.ts +10 -7
  128. package/dist/types/user/user.d.ts +16 -15
  129. package/package.json +1 -1
@@ -118,203 +118,6 @@
118
118
  Api.PrepReqParams = PrepReqParams;
119
119
  })(exports.Api || (exports.Api = {}));
120
120
 
121
- (function (AnnDocument) {
122
- function GetCacheKey(id) {
123
- return `${exports.Api.ECacheKey.AnnDocument}${exports.Api.ECacheKey.Id}${id}`;
124
- }
125
- AnnDocument.GetCacheKey = GetCacheKey;
126
- function GetListCacheKey(type) {
127
- return exports.Api.ECacheKey.AnnDocument + type;
128
- }
129
- AnnDocument.GetListCacheKey = GetListCacheKey;
130
- let EType;
131
- (function (EType) {
132
- EType["SVG"] = "SVG";
133
- })(EType = AnnDocument.EType || (AnnDocument.EType = {}));
134
- function Get(params) {
135
- return __awaiter(this, void 0, void 0, function* () {
136
- const { api, docId, req: reqParams } = params;
137
- if (!docId) {
138
- throw ("Doc ID is required.");
139
- }
140
- const key = GetCacheKey(docId);
141
- const cache = yield api.GetCacheItem(key, reqParams);
142
- if (cache === null || cache === void 0 ? void 0 : cache.found) {
143
- return cache.data;
144
- }
145
- const prom = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
146
- try {
147
- const data = yield api.GET(`documentView/${docId}`, exports.Api.PrepReqParams(reqParams));
148
- res({
149
- document: data
150
- });
151
- }
152
- catch (e) {
153
- rej(e);
154
- }
155
- }));
156
- yield api.SetCacheItem({
157
- key,
158
- value: prom,
159
- req: reqParams
160
- });
161
- return prom;
162
- });
163
- }
164
- AnnDocument.Get = Get;
165
- function GetList(params) {
166
- return __awaiter(this, void 0, void 0, function* () {
167
- let { api, docType: type, req: reqParams } = params;
168
- if (!type) {
169
- type = "";
170
- }
171
- const cache = yield api.GetCacheItem(GetListCacheKey(type), reqParams);
172
- if (cache === null || cache === void 0 ? void 0 : cache.found) {
173
- return cache.data;
174
- }
175
- const req = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
176
- try {
177
- const url = "documentViews" + (type ? "?type=" + type : "");
178
- const data = yield api.GET(url, exports.Api.PrepReqParams(reqParams));
179
- res({
180
- documents: data.Items
181
- });
182
- }
183
- catch (e) {
184
- rej(e);
185
- }
186
- }));
187
- yield api.SetCacheItem({
188
- key: GetListCacheKey(type),
189
- value: req,
190
- req: reqParams
191
- });
192
- return req;
193
- });
194
- }
195
- AnnDocument.GetList = GetList;
196
- })(exports.AnnDocument || (exports.AnnDocument = {}));
197
-
198
- (function (CustomForm) {
199
- function GetCacheKey(id) {
200
- return exports.Api.ECacheKey.CustomForm + exports.Api.ECacheKey.Id + id;
201
- }
202
- CustomForm.GetCacheKey = GetCacheKey;
203
- function GetListCacheKey(typeId) {
204
- if (typeId) {
205
- return exports.Api.ECacheKey.CustomForm + exports.Api.ECacheKey.EntityType + exports.Api.ECacheKey.Id + typeId;
206
- }
207
- return exports.Api.ECacheKey.CustomForm;
208
- }
209
- CustomForm.GetListCacheKey = GetListCacheKey;
210
- let EType;
211
- (function (EType) {
212
- EType["Form"] = "GENERIC";
213
- EType["Markup"] = "MARKUP";
214
- })(EType = CustomForm.EType || (CustomForm.EType = {}));
215
- function Get(params) {
216
- return __awaiter(this, void 0, void 0, function* () {
217
- const { api, formId: id, req: reqParams } = params;
218
- if (!id) {
219
- throw ("Id is required.");
220
- }
221
- const cache = yield api.GetCacheItem(GetCacheKey(id), reqParams);
222
- if (cache === null || cache === void 0 ? void 0 : cache.found) {
223
- return cache.data;
224
- }
225
- const prom = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
226
- try {
227
- const data = yield api.GET(`customForm/${id}`, exports.Api.PrepReqParams(reqParams));
228
- res({
229
- form: data
230
- });
231
- }
232
- catch (err) {
233
- rej(err);
234
- }
235
- }));
236
- yield api.SetCacheItem({
237
- key: GetCacheKey(id),
238
- value: prom,
239
- req: reqParams
240
- });
241
- return prom;
242
- });
243
- }
244
- CustomForm.Get = Get;
245
- function Delete(params) {
246
- return __awaiter(this, void 0, void 0, function* () {
247
- const { api, formId: id, req: reqParams } = params;
248
- if (!id) {
249
- throw ("Id is required.");
250
- }
251
- yield api.DELETE(`customForm/${id}`, exports.Api.PrepReqParams(reqParams));
252
- yield api.Cache.RemoveByStartsWith(exports.Api.ECacheKey.CustomForm);
253
- });
254
- }
255
- CustomForm.Delete = Delete;
256
- function GetList(params) {
257
- return __awaiter(this, void 0, void 0, function* () {
258
- const { api, entityTypeId: typeId, req: reqParams } = params;
259
- const url = typeId ? `entityType/${typeId}/customForms` : "customForms";
260
- const cache = yield api.GetCacheItem(GetListCacheKey(typeId), reqParams);
261
- if (cache === null || cache === void 0 ? void 0 : cache.found) {
262
- return cache.data;
263
- }
264
- const req = api.GET(url, exports.Api.PrepReqParams(reqParams));
265
- const prom = req.then((data) => {
266
- return {
267
- forms: data.Items
268
- };
269
- });
270
- yield api.SetCacheItem({
271
- key: GetListCacheKey(typeId),
272
- value: prom,
273
- req: reqParams
274
- });
275
- return prom;
276
- });
277
- }
278
- CustomForm.GetList = GetList;
279
- function Update(params) {
280
- return __awaiter(this, void 0, void 0, function* () {
281
- const { api, form: data, reqParams } = params;
282
- if (!data.ID) {
283
- data.ID = 0;
284
- }
285
- const res = yield api.POST(`customForm/${data.ID}`, data, exports.Api.PrepReqParams(reqParams));
286
- yield api.Cache.RemoveByStartsWith(exports.Api.ECacheKey.CustomForm);
287
- return {
288
- form: res
289
- };
290
- });
291
- }
292
- CustomForm.Update = Update;
293
- })(exports.CustomForm || (exports.CustomForm = {}));
294
-
295
- /**
296
- * Describes content of a GENERIC type custom form.
297
- * The alternative type is MARKUP (Markup.IMarkup).
298
- */
299
- (function (CustomFormContent) {
300
- let ECellType;
301
- (function (ECellType) {
302
- ECellType[ECellType["StaticText"] = 0] = "StaticText";
303
- ECellType[ECellType["DataValue"] = 1] = "DataValue";
304
- ECellType[ECellType["StaticPicture"] = 2] = "StaticPicture";
305
- ECellType[ECellType["SubSection"] = 3] = "SubSection";
306
- ECellType[ECellType["ButtonMore"] = 4] = "ButtonMore";
307
- ECellType[ECellType["EntityPhoto"] = 5] = "EntityPhoto";
308
- ECellType[ECellType["EmbeddedMedia"] = 6] = "EmbeddedMedia";
309
- ECellType[ECellType["Chart"] = 7] = "Chart";
310
- })(ECellType = CustomFormContent.ECellType || (CustomFormContent.ECellType = {}));
311
- let EFlowDirection;
312
- (function (EFlowDirection) {
313
- EFlowDirection["Vertically"] = "v";
314
- EFlowDirection["Horizontally"] = "h";
315
- })(EFlowDirection = CustomFormContent.EFlowDirection || (CustomFormContent.EFlowDirection = {}));
316
- })(exports.CustomFormContent || (exports.CustomFormContent = {}));
317
-
318
121
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
319
122
 
320
123
  function commonjsRequire () {
@@ -3801,7 +3604,10 @@
3801
3604
  })(EStarterContent = Account.EStarterContent || (Account.EStarterContent = {}));
3802
3605
  function Get(params) {
3803
3606
  return __awaiter(this, void 0, void 0, function* () {
3804
- const { api, accountId: id, req: reqParams } = params;
3607
+ let { api, accountId: id, req: reqParams } = params;
3608
+ if (!api) {
3609
+ api = exports.ENVIRONMENT.Api().GetGuardianApi();
3610
+ }
3805
3611
  const cache = yield api.GetCacheItem(GetCacheKey(id), reqParams);
3806
3612
  if (cache === null || cache === void 0 ? void 0 : cache.found) {
3807
3613
  return cache.data;
@@ -3821,7 +3627,10 @@
3821
3627
  Account.Get = Get;
3822
3628
  function GetRelatedList(params) {
3823
3629
  return __awaiter(this, void 0, void 0, function* () {
3824
- const { api, req: reqParams } = params;
3630
+ let { api, req: reqParams } = params;
3631
+ if (!api) {
3632
+ api = exports.ENVIRONMENT.Api().GetGuardianApi();
3633
+ }
3825
3634
  const cache = yield api.GetCacheItem(GetListCacheKey(api.GetSessionId()), reqParams);
3826
3635
  if (cache === null || cache === void 0 ? void 0 : cache.found) {
3827
3636
  return cache.data;
@@ -3850,7 +3659,10 @@
3850
3659
  Account.GetRelatedList = GetRelatedList;
3851
3660
  function GetAppSettings(params) {
3852
3661
  return __awaiter(this, void 0, void 0, function* () {
3853
- const { api, accountId: id, appId, req: reqParams } = params;
3662
+ let { api, accountId: id, appId, req: reqParams } = params;
3663
+ if (!api) {
3664
+ api = exports.ENVIRONMENT.Api().GetGuardianApi();
3665
+ }
3854
3666
  const cache = yield api.GetCacheItem(GetCacheKey(id, appId), reqParams);
3855
3667
  if (cache === null || cache === void 0 ? void 0 : cache.found) {
3856
3668
  return cache.data;
@@ -3885,7 +3697,10 @@
3885
3697
  */
3886
3698
  function UpdateAppSettings(params) {
3887
3699
  return __awaiter(this, void 0, void 0, function* () {
3888
- const { api, accountId: id, appId, settings: data, req: reqParams } = params;
3700
+ let { api, accountId: id, appId, settings: data, req: reqParams } = params;
3701
+ if (!api) {
3702
+ api = exports.ENVIRONMENT.Api().GetGuardianApi();
3703
+ }
3889
3704
  const res = yield api.POST(`account/${id}/applicationSettings/${appId}`, data, reqParams);
3890
3705
  yield api.Cache.RemoveByStartsWith(exports.Api.ECacheKey.Account + exports.Api.ECacheKey.Id + id);
3891
3706
  return {
@@ -3902,6 +3717,9 @@
3902
3717
  function Create(params) {
3903
3718
  return __awaiter(this, void 0, void 0, function* () {
3904
3719
  let { api, accountId: id, name, hostingLocationKey, starterContent, req: reqParams } = params;
3720
+ if (!api) {
3721
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
3722
+ }
3905
3723
  if (!id || !name || !hostingLocationKey) {
3906
3724
  throw new Error("Id, Name and hostingLocationKey are required.");
3907
3725
  }
@@ -3932,7 +3750,11 @@
3932
3750
  */
3933
3751
  function GetList(params) {
3934
3752
  return __awaiter(this, void 0, void 0, function* () {
3935
- const res = yield params.api.GET("hostinglocations", exports.Api.PrepReqParams(params.req));
3753
+ let { api, req } = params;
3754
+ if (!api) {
3755
+ api = exports.ENVIRONMENT.Api().GetGuardianApi();
3756
+ }
3757
+ const res = yield api.GET("hostinglocations", exports.Api.PrepReqParams(req));
3936
3758
  return {
3937
3759
  locations: res.Items
3938
3760
  };
@@ -3941,7 +3763,10 @@
3941
3763
  HostingLocation.GetList = GetList;
3942
3764
  function GetById(params) {
3943
3765
  return __awaiter(this, void 0, void 0, function* () {
3944
- const { id, api, req } = params;
3766
+ let { id, api, req } = params;
3767
+ if (!api) {
3768
+ api = exports.ENVIRONMENT.Api().GetGuardianApi();
3769
+ }
3945
3770
  if (!id) {
3946
3771
  throw ("Invalid id");
3947
3772
  }
@@ -3954,7 +3779,10 @@
3954
3779
  HostingLocation.GetById = GetById;
3955
3780
  function GetByKey(params) {
3956
3781
  return __awaiter(this, void 0, void 0, function* () {
3957
- const { key, api, req } = params;
3782
+ let { key, api, req } = params;
3783
+ if (!api) {
3784
+ api = exports.ENVIRONMENT.Api().GetGuardianApi();
3785
+ }
3958
3786
  if (!key) {
3959
3787
  throw ("Invalid key");
3960
3788
  }
@@ -4011,7 +3839,10 @@
4011
3839
  HostingLocation.GuessKey = GuessKey;
4012
3840
  function GetKeyByAccountId(params) {
4013
3841
  return __awaiter(this, void 0, void 0, function* () {
4014
- const { accountId, apiSettings, api, req } = params;
3842
+ let { accountId, apiSettings, api, req } = params;
3843
+ if (!api) {
3844
+ api = exports.ENVIRONMENT.Api().GetGuardianApi();
3845
+ }
4015
3846
  if (!accountId && !apiSettings) {
4016
3847
  throw ("Invalid accountId or apiSettings");
4017
3848
  }
@@ -4041,7 +3872,10 @@
4041
3872
  HostingLocation.GetKeyByAccountId = GetKeyByAccountId;
4042
3873
  function GetByAccountId(params) {
4043
3874
  return __awaiter(this, void 0, void 0, function* () {
4044
- const { accountId, apiSettings, api, req } = params;
3875
+ let { accountId, apiSettings, api, req } = params;
3876
+ if (!api) {
3877
+ api = exports.ENVIRONMENT.Api().GetGuardianApi();
3878
+ }
4045
3879
  const data = yield GetKeyByAccountId({
4046
3880
  accountId,
4047
3881
  apiSettings,
@@ -4340,44 +4174,39 @@
4340
4174
  CamApi.Api = Api$$1;
4341
4175
  })(exports.CamApi || (exports.CamApi = {}));
4342
4176
 
4343
- (function (IdmApi) {
4177
+ (function (GlobalApi) {
4344
4178
  /**
4345
- * This is the request handler for Idm Api,
4179
+ * This is the request handler for Global Api,
4346
4180
  * it should be passed to any method that wants to communicate with this particular api.
4347
4181
  */
4348
4182
  class Api$$1 extends AbstractApi {
4349
4183
  constructor(params) {
4350
4184
  super({
4351
- ssidHeader: "SSID",
4352
- cacheId: `IDM_API_${params === null || params === void 0 ? void 0 : params.env}_`
4185
+ ssidHeader: "x-sessionid",
4186
+ cacheId: `GLOBAL_API_${params === null || params === void 0 ? void 0 : params.env}_`
4353
4187
  });
4354
4188
  this.env = (params === null || params === void 0 ? void 0 : params.env) ? params.env : exports.Api.EEnv.PROD;
4355
4189
  this.setBaseUrl();
4356
4190
  }
4357
4191
  setBaseUrl() {
4358
- let codeWord = "idm";
4359
- let url = "https://<CODEWORD>.nextspace";
4192
+ let url;
4360
4193
  const env = this.env.toUpperCase();
4361
4194
  switch (env) {
4362
4195
  case exports.Api.EEnv.DEV:
4363
- codeWord = "guardian";
4364
- url += "-dev.net/";
4196
+ url = "https://bruceglobal.nextspace-dev.net/";
4365
4197
  break;
4366
4198
  case exports.Api.EEnv.STG:
4367
- codeWord = "guardian";
4368
- url += "-stg.net/";
4199
+ url = "https://bruceglobal.nextspace-stg.net/";
4369
4200
  break;
4370
4201
  case exports.Api.EEnv.UAT:
4371
- codeWord = "guardian";
4372
- url += "-uat.net/";
4202
+ url = "https://bruceglobal.api.nextspace-uat.net/";
4373
4203
  break;
4374
4204
  case exports.Api.EEnv.PROD:
4375
- url += ".host/";
4205
+ url = "https://bruceglobal.api.nextspace.host/";
4376
4206
  break;
4377
4207
  default:
4378
4208
  throw ("Specified Environment is not valid. SuppliedEnv=" + env);
4379
4209
  }
4380
- url = url.replace("<CODEWORD>", codeWord);
4381
4210
  this.baseUrl = url;
4382
4211
  }
4383
4212
  GetBaseUrl() {
@@ -4410,42 +4239,47 @@
4410
4239
  });
4411
4240
  }
4412
4241
  }
4413
- IdmApi.Api = Api$$1;
4414
- })(exports.IdmApi || (exports.IdmApi = {}));
4242
+ GlobalApi.Api = Api$$1;
4243
+ })(exports.GlobalApi || (exports.GlobalApi = {}));
4415
4244
 
4416
- (function (GlobalApi) {
4245
+ (function (IdmApi) {
4417
4246
  /**
4418
- * This is the request handler for Global Api,
4247
+ * This is the request handler for Idm Api,
4419
4248
  * it should be passed to any method that wants to communicate with this particular api.
4420
4249
  */
4421
4250
  class Api$$1 extends AbstractApi {
4422
4251
  constructor(params) {
4423
4252
  super({
4424
- ssidHeader: "x-sessionid",
4425
- cacheId: `GLOBAL_API_${params === null || params === void 0 ? void 0 : params.env}_`
4253
+ ssidHeader: "SSID",
4254
+ cacheId: `IDM_API_${params === null || params === void 0 ? void 0 : params.env}_`
4426
4255
  });
4427
4256
  this.env = (params === null || params === void 0 ? void 0 : params.env) ? params.env : exports.Api.EEnv.PROD;
4428
4257
  this.setBaseUrl();
4429
4258
  }
4430
4259
  setBaseUrl() {
4431
- let url;
4260
+ let codeWord = "idm";
4261
+ let url = "https://<CODEWORD>.nextspace";
4432
4262
  const env = this.env.toUpperCase();
4433
4263
  switch (env) {
4434
4264
  case exports.Api.EEnv.DEV:
4435
- url = "https://bruceglobal.nextspace-dev.net/";
4265
+ codeWord = "guardian";
4266
+ url += "-dev.net/";
4436
4267
  break;
4437
4268
  case exports.Api.EEnv.STG:
4438
- url = "https://bruceglobal.nextspace-stg.net/";
4269
+ codeWord = "guardian";
4270
+ url += "-stg.net/";
4439
4271
  break;
4440
4272
  case exports.Api.EEnv.UAT:
4441
- url = "https://bruceglobal.api.nextspace-uat.net/";
4273
+ codeWord = "guardian";
4274
+ url += "-uat.net/";
4442
4275
  break;
4443
4276
  case exports.Api.EEnv.PROD:
4444
- url = "https://bruceglobal.api.nextspace.host/";
4277
+ url += ".host/";
4445
4278
  break;
4446
4279
  default:
4447
4280
  throw ("Specified Environment is not valid. SuppliedEnv=" + env);
4448
4281
  }
4282
+ url = url.replace("<CODEWORD>", codeWord);
4449
4283
  this.baseUrl = url;
4450
4284
  }
4451
4285
  GetBaseUrl() {
@@ -4478,8 +4312,8 @@
4478
4312
  });
4479
4313
  }
4480
4314
  }
4481
- GlobalApi.Api = Api$$1;
4482
- })(exports.GlobalApi || (exports.GlobalApi = {}));
4315
+ IdmApi.Api = Api$$1;
4316
+ })(exports.IdmApi || (exports.IdmApi = {}));
4483
4317
 
4484
4318
  class ApiGetters {
4485
4319
  constructor(params) {
@@ -4492,6 +4326,24 @@
4492
4326
  this.env = (params === null || params === void 0 ? void 0 : params.env) ? params.env : exports.Api.EEnv.PROD;
4493
4327
  this.sessionId = params === null || params === void 0 ? void 0 : params.sessionId;
4494
4328
  }
4329
+ ClearCache() {
4330
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
4331
+ for (const key in this.bruce) {
4332
+ (_b = (_a = this.bruce[key]) === null || _a === void 0 ? void 0 : _a.Cache) === null || _b === void 0 ? void 0 : _b.Clear();
4333
+ }
4334
+ for (const key in this.idm) {
4335
+ (_d = (_c = this.idm[key]) === null || _c === void 0 ? void 0 : _c.Cache) === null || _d === void 0 ? void 0 : _d.Clear();
4336
+ }
4337
+ for (const key in this.cam) {
4338
+ (_f = (_e = this.cam[key]) === null || _e === void 0 ? void 0 : _e.Cache) === null || _f === void 0 ? void 0 : _f.Clear();
4339
+ }
4340
+ for (const key in this.guardian) {
4341
+ (_h = (_g = this.guardian[key]) === null || _g === void 0 ? void 0 : _g.Cache) === null || _h === void 0 ? void 0 : _h.Clear();
4342
+ }
4343
+ for (const key in this.global) {
4344
+ (_k = (_j = this.global[key]) === null || _j === void 0 ? void 0 : _j.Cache) === null || _k === void 0 ? void 0 : _k.Clear();
4345
+ }
4346
+ }
4495
4347
  SetAccountId(accountId) {
4496
4348
  this.accountId = accountId;
4497
4349
  }
@@ -4518,6 +4370,7 @@
4518
4370
  for (const key in this.global) {
4519
4371
  this.global[key].SetSessionId(sessionId);
4520
4372
  }
4373
+ this.ClearCache();
4521
4374
  }
4522
4375
  GetSessionId() {
4523
4376
  return this.sessionId;
@@ -4622,42 +4475,306 @@
4622
4475
  this.global[key] = new exports.GlobalApi.Api({
4623
4476
  env
4624
4477
  });
4625
- this.global[key].SetSessionId(this.sessionId);
4626
- }
4627
- return this.global[key];
4478
+ this.global[key].SetSessionId(this.sessionId);
4479
+ }
4480
+ return this.global[key];
4481
+ }
4482
+ GetGlobalGetter() {
4483
+ return {
4484
+ env: this.env,
4485
+ getApi: (env) => {
4486
+ return this.GetGlobalApi({ env });
4487
+ }
4488
+ };
4489
+ }
4490
+ GetGuardianApi(params) {
4491
+ if (!params) {
4492
+ params = {};
4493
+ }
4494
+ let { env } = params;
4495
+ env = env ? env : this.env;
4496
+ const key = `${env}`;
4497
+ if (!this.guardian[key]) {
4498
+ this.guardian[key] = new exports.GuardianApi.Api({
4499
+ env
4500
+ });
4501
+ this.guardian[key].SetSessionId(this.sessionId);
4502
+ }
4503
+ return this.guardian[key];
4504
+ }
4505
+ GetGuardianGetter() {
4506
+ return {
4507
+ env: this.env,
4508
+ getApi: (env) => {
4509
+ return this.GetGuardianApi({ env });
4510
+ }
4511
+ };
4512
+ }
4513
+ }
4514
+
4515
+ // Global instance for smaller use-cases where you don't want to manage the getters yourself.
4516
+ let _getters;
4517
+ (function (ENVIRONMENT) {
4518
+ // If true, then defaults are not touched and it's assumed this is being managed.
4519
+ ENVIRONMENT.IS_SELF_MANAGED = false;
4520
+ // Unused if IS_SELF_MANAGED is false.
4521
+ ENVIRONMENT.PARAMS = {
4522
+ accountId: "",
4523
+ env: exports.Api.EEnv.PROD,
4524
+ sessionId: ""
4525
+ };
4526
+ function Api$$1() {
4527
+ if (ENVIRONMENT.IS_SELF_MANAGED) {
4528
+ throw ("Self managed mode ON. You are getting this error because you didn't pass an Api instance to a function.");
4529
+ }
4530
+ if (!ENVIRONMENT.PARAMS.accountId) {
4531
+ console.warn("No accountId set. This is required for the getters to work properly.");
4532
+ }
4533
+ if (!_getters) {
4534
+ _getters = new ApiGetters({
4535
+ accountId: ENVIRONMENT.PARAMS.accountId,
4536
+ env: ENVIRONMENT.PARAMS.env,
4537
+ sessionId: ENVIRONMENT.PARAMS.sessionId
4538
+ });
4539
+ }
4540
+ return _getters;
4541
+ }
4542
+ ENVIRONMENT.Api = Api$$1;
4543
+ function Reset(params) {
4544
+ if (ENVIRONMENT.IS_SELF_MANAGED) {
4545
+ throw ("Self managed mode ON. You are getting this error because you didn't pass an Api instance to a function.");
4546
+ }
4547
+ if (_getters) {
4548
+ _getters.ClearCache();
4549
+ if (params.accountId) {
4550
+ _getters.SetAccountId(params.accountId);
4551
+ }
4552
+ if (params.sessionId) {
4553
+ _getters.SetSessionId(params.sessionId);
4554
+ }
4555
+ if (params.env) {
4556
+ _getters.SetEnv(params.env);
4557
+ }
4558
+ }
4559
+ ENVIRONMENT.PARAMS = Object.assign(Object.assign({}, ENVIRONMENT.PARAMS), params);
4560
+ }
4561
+ ENVIRONMENT.Reset = Reset;
4562
+ })(exports.ENVIRONMENT || (exports.ENVIRONMENT = {}));
4563
+
4564
+ (function (AnnDocument) {
4565
+ function GetCacheKey(id) {
4566
+ return `${exports.Api.ECacheKey.AnnDocument}${exports.Api.ECacheKey.Id}${id}`;
4567
+ }
4568
+ AnnDocument.GetCacheKey = GetCacheKey;
4569
+ function GetListCacheKey(type) {
4570
+ return exports.Api.ECacheKey.AnnDocument + type;
4571
+ }
4572
+ AnnDocument.GetListCacheKey = GetListCacheKey;
4573
+ let EType;
4574
+ (function (EType) {
4575
+ EType["SVG"] = "SVG";
4576
+ })(EType = AnnDocument.EType || (AnnDocument.EType = {}));
4577
+ function Get(params) {
4578
+ return __awaiter(this, void 0, void 0, function* () {
4579
+ let { api, docId, req: reqParams } = params;
4580
+ if (!api) {
4581
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
4582
+ }
4583
+ if (!docId) {
4584
+ throw ("Doc ID is required.");
4585
+ }
4586
+ const key = GetCacheKey(docId);
4587
+ const cache = yield api.GetCacheItem(key, reqParams);
4588
+ if (cache === null || cache === void 0 ? void 0 : cache.found) {
4589
+ return cache.data;
4590
+ }
4591
+ const prom = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
4592
+ try {
4593
+ const data = yield api.GET(`documentView/${docId}`, exports.Api.PrepReqParams(reqParams));
4594
+ res({
4595
+ document: data
4596
+ });
4597
+ }
4598
+ catch (e) {
4599
+ rej(e);
4600
+ }
4601
+ }));
4602
+ yield api.SetCacheItem({
4603
+ key,
4604
+ value: prom,
4605
+ req: reqParams
4606
+ });
4607
+ return prom;
4608
+ });
4609
+ }
4610
+ AnnDocument.Get = Get;
4611
+ function GetList(params) {
4612
+ return __awaiter(this, void 0, void 0, function* () {
4613
+ let { api, docType: type, req: reqParams } = params;
4614
+ if (!api) {
4615
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
4616
+ }
4617
+ if (!type) {
4618
+ type = "";
4619
+ }
4620
+ const cache = yield api.GetCacheItem(GetListCacheKey(type), reqParams);
4621
+ if (cache === null || cache === void 0 ? void 0 : cache.found) {
4622
+ return cache.data;
4623
+ }
4624
+ const req = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
4625
+ try {
4626
+ const url = "documentViews" + (type ? "?type=" + type : "");
4627
+ const data = yield api.GET(url, exports.Api.PrepReqParams(reqParams));
4628
+ res({
4629
+ documents: data.Items
4630
+ });
4631
+ }
4632
+ catch (e) {
4633
+ rej(e);
4634
+ }
4635
+ }));
4636
+ yield api.SetCacheItem({
4637
+ key: GetListCacheKey(type),
4638
+ value: req,
4639
+ req: reqParams
4640
+ });
4641
+ return req;
4642
+ });
4643
+ }
4644
+ AnnDocument.GetList = GetList;
4645
+ })(exports.AnnDocument || (exports.AnnDocument = {}));
4646
+
4647
+ (function (CustomForm) {
4648
+ function GetCacheKey(id) {
4649
+ return exports.Api.ECacheKey.CustomForm + exports.Api.ECacheKey.Id + id;
4650
+ }
4651
+ CustomForm.GetCacheKey = GetCacheKey;
4652
+ function GetListCacheKey(typeId) {
4653
+ if (typeId) {
4654
+ return exports.Api.ECacheKey.CustomForm + exports.Api.ECacheKey.EntityType + exports.Api.ECacheKey.Id + typeId;
4655
+ }
4656
+ return exports.Api.ECacheKey.CustomForm;
4657
+ }
4658
+ CustomForm.GetListCacheKey = GetListCacheKey;
4659
+ let EType;
4660
+ (function (EType) {
4661
+ EType["Form"] = "GENERIC";
4662
+ EType["Markup"] = "MARKUP";
4663
+ })(EType = CustomForm.EType || (CustomForm.EType = {}));
4664
+ function Get(params) {
4665
+ return __awaiter(this, void 0, void 0, function* () {
4666
+ let { api, formId: id, req: reqParams } = params;
4667
+ if (!api) {
4668
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
4669
+ }
4670
+ if (!id) {
4671
+ throw ("Id is required.");
4672
+ }
4673
+ const cache = yield api.GetCacheItem(GetCacheKey(id), reqParams);
4674
+ if (cache === null || cache === void 0 ? void 0 : cache.found) {
4675
+ return cache.data;
4676
+ }
4677
+ const prom = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
4678
+ try {
4679
+ const data = yield api.GET(`customForm/${id}`, exports.Api.PrepReqParams(reqParams));
4680
+ res({
4681
+ form: data
4682
+ });
4683
+ }
4684
+ catch (err) {
4685
+ rej(err);
4686
+ }
4687
+ }));
4688
+ yield api.SetCacheItem({
4689
+ key: GetCacheKey(id),
4690
+ value: prom,
4691
+ req: reqParams
4692
+ });
4693
+ return prom;
4694
+ });
4628
4695
  }
4629
- GetGlobalGetter() {
4630
- return {
4631
- env: this.env,
4632
- getApi: (env) => {
4633
- return this.GetGlobalApi({ env });
4696
+ CustomForm.Get = Get;
4697
+ function Delete(params) {
4698
+ return __awaiter(this, void 0, void 0, function* () {
4699
+ let { api, formId: id, req: reqParams } = params;
4700
+ if (!api) {
4701
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
4634
4702
  }
4635
- };
4703
+ if (!id) {
4704
+ throw ("Id is required.");
4705
+ }
4706
+ yield api.DELETE(`customForm/${id}`, exports.Api.PrepReqParams(reqParams));
4707
+ yield api.Cache.RemoveByStartsWith(exports.Api.ECacheKey.CustomForm);
4708
+ });
4636
4709
  }
4637
- GetGuardianApi(params) {
4638
- if (!params) {
4639
- params = {};
4640
- }
4641
- let { env } = params;
4642
- env = env ? env : this.env;
4643
- const key = `${env}`;
4644
- if (!this.guardian[key]) {
4645
- this.guardian[key] = new exports.GuardianApi.Api({
4646
- env
4710
+ CustomForm.Delete = Delete;
4711
+ function GetList(params) {
4712
+ return __awaiter(this, void 0, void 0, function* () {
4713
+ let { api, entityTypeId: typeId, req: reqParams } = params;
4714
+ if (!api) {
4715
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
4716
+ }
4717
+ const url = typeId ? `entityType/${typeId}/customForms` : "customForms";
4718
+ const cache = yield api.GetCacheItem(GetListCacheKey(typeId), reqParams);
4719
+ if (cache === null || cache === void 0 ? void 0 : cache.found) {
4720
+ return cache.data;
4721
+ }
4722
+ const req = api.GET(url, exports.Api.PrepReqParams(reqParams));
4723
+ const prom = req.then((data) => {
4724
+ return {
4725
+ forms: data.Items
4726
+ };
4647
4727
  });
4648
- this.guardian[key].SetSessionId(this.sessionId);
4649
- }
4650
- return this.guardian[key];
4728
+ yield api.SetCacheItem({
4729
+ key: GetListCacheKey(typeId),
4730
+ value: prom,
4731
+ req: reqParams
4732
+ });
4733
+ return prom;
4734
+ });
4651
4735
  }
4652
- GetGuardianGetter() {
4653
- return {
4654
- env: this.env,
4655
- getApi: (env) => {
4656
- return this.GetGuardianApi({ env });
4736
+ CustomForm.GetList = GetList;
4737
+ function Update(params) {
4738
+ return __awaiter(this, void 0, void 0, function* () {
4739
+ let { api, form: data, reqParams } = params;
4740
+ if (!api) {
4741
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
4657
4742
  }
4658
- };
4743
+ if (!data.ID) {
4744
+ data.ID = 0;
4745
+ }
4746
+ const res = yield api.POST(`customForm/${data.ID}`, data, exports.Api.PrepReqParams(reqParams));
4747
+ yield api.Cache.RemoveByStartsWith(exports.Api.ECacheKey.CustomForm);
4748
+ return {
4749
+ form: res
4750
+ };
4751
+ });
4659
4752
  }
4660
- }
4753
+ CustomForm.Update = Update;
4754
+ })(exports.CustomForm || (exports.CustomForm = {}));
4755
+
4756
+ /**
4757
+ * Describes content of a GENERIC type custom form.
4758
+ * The alternative type is MARKUP (Markup.IMarkup).
4759
+ */
4760
+ (function (CustomFormContent) {
4761
+ let ECellType;
4762
+ (function (ECellType) {
4763
+ ECellType[ECellType["StaticText"] = 0] = "StaticText";
4764
+ ECellType[ECellType["DataValue"] = 1] = "DataValue";
4765
+ ECellType[ECellType["StaticPicture"] = 2] = "StaticPicture";
4766
+ ECellType[ECellType["SubSection"] = 3] = "SubSection";
4767
+ ECellType[ECellType["ButtonMore"] = 4] = "ButtonMore";
4768
+ ECellType[ECellType["EntityPhoto"] = 5] = "EntityPhoto";
4769
+ ECellType[ECellType["EmbeddedMedia"] = 6] = "EmbeddedMedia";
4770
+ ECellType[ECellType["Chart"] = 7] = "Chart";
4771
+ })(ECellType = CustomFormContent.ECellType || (CustomFormContent.ECellType = {}));
4772
+ let EFlowDirection;
4773
+ (function (EFlowDirection) {
4774
+ EFlowDirection["Vertically"] = "v";
4775
+ EFlowDirection["Horizontally"] = "h";
4776
+ })(EFlowDirection = CustomFormContent.EFlowDirection || (CustomFormContent.EFlowDirection = {}));
4777
+ })(exports.CustomFormContent || (exports.CustomFormContent = {}));
4661
4778
 
4662
4779
  (function (Color) {
4663
4780
  let EBlendMode;
@@ -4824,7 +4941,10 @@
4824
4941
  Entity.GetCacheKey = GetCacheKey;
4825
4942
  function Get(params) {
4826
4943
  return __awaiter(this, void 0, void 0, function* () {
4827
- const { api, entityId, req: reqParams, expandLocation, entityTypeId } = params;
4944
+ let { api, entityId, req: reqParams, expandLocation, entityTypeId } = params;
4945
+ if (!api) {
4946
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
4947
+ }
4828
4948
  if (!entityId) {
4829
4949
  throw ("Entity ID is required.");
4830
4950
  }
@@ -4862,7 +4982,10 @@
4862
4982
  Entity.Get = Get;
4863
4983
  function GetListByIds(params) {
4864
4984
  return __awaiter(this, void 0, void 0, function* () {
4865
- const { api, entityIds, req: reqParams } = params;
4985
+ let { api, entityIds, req: reqParams } = params;
4986
+ if (!api) {
4987
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
4988
+ }
4866
4989
  if (!entityIds.length) {
4867
4990
  throw ("Entity IDs are required.");
4868
4991
  }
@@ -4921,7 +5044,10 @@
4921
5044
  Entity.GetListByIds = GetListByIds;
4922
5045
  function Delete(params) {
4923
5046
  return __awaiter(this, void 0, void 0, function* () {
4924
- const { api, entityId, req: reqParams } = params;
5047
+ let { api, entityId, req: reqParams } = params;
5048
+ if (!api) {
5049
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
5050
+ }
4925
5051
  if (!entityId) {
4926
5052
  throw ("Entity ID is required.");
4927
5053
  }
@@ -4932,7 +5058,10 @@
4932
5058
  Entity.Delete = Delete;
4933
5059
  function DeleteList(params) {
4934
5060
  return __awaiter(this, void 0, void 0, function* () {
4935
- const { api, entityIds, req: reqParams } = params;
5061
+ let { api, entityIds, req: reqParams } = params;
5062
+ if (!api) {
5063
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
5064
+ }
4936
5065
  if (!(entityIds === null || entityIds === void 0 ? void 0 : entityIds.length)) {
4937
5066
  throw ("Entity IDs are required.");
4938
5067
  }
@@ -4949,7 +5078,10 @@
4949
5078
  function Update(params) {
4950
5079
  var _a, _b;
4951
5080
  return __awaiter(this, void 0, void 0, function* () {
4952
- const { api, entity: data, override, req: reqParams } = params;
5081
+ let { api, entity: data, override, req: reqParams } = params;
5082
+ if (!api) {
5083
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
5084
+ }
4953
5085
  if (!((_a = data === null || data === void 0 ? void 0 : data.Bruce) === null || _a === void 0 ? void 0 : _a["EntityType.ID"])) {
4954
5086
  throw ("Entity Type ID is required.");
4955
5087
  }
@@ -5052,7 +5184,10 @@
5052
5184
  Entity.CalculateName = CalculateName;
5053
5185
  function GetList(params) {
5054
5186
  return __awaiter(this, void 0, void 0, function* () {
5055
- const { api, filter, req: reqParams, viaCdn, viaCdnCacheToken } = params;
5187
+ let { api, filter, req: reqParams, viaCdn, viaCdnCacheToken } = params;
5188
+ if (!api) {
5189
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
5190
+ }
5056
5191
  let requestFilter = {};
5057
5192
  if (filter.entityTypeConditions) {
5058
5193
  requestFilter = Object.assign({}, filter.entityTypeConditions);
@@ -6043,7 +6178,10 @@
6043
6178
  })(EType = EntityAttachmentType.EType || (EntityAttachmentType.EType = {}));
6044
6179
  function Delete(params) {
6045
6180
  return __awaiter(this, void 0, void 0, function* () {
6046
- const { api, attachmentTypeId: id, req: reqParams } = params;
6181
+ let { api, attachmentTypeId: id, req: reqParams } = params;
6182
+ if (!api) {
6183
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
6184
+ }
6047
6185
  if (!id) {
6048
6186
  throw ("Type ID is required.");
6049
6187
  }
@@ -6055,7 +6193,10 @@
6055
6193
  EntityAttachmentType.Delete = Delete;
6056
6194
  function Update(params) {
6057
6195
  return __awaiter(this, void 0, void 0, function* () {
6058
- const { api, attachmentType: data, req: reqParams } = params;
6196
+ let { api, attachmentType: data, req: reqParams } = params;
6197
+ if (!api) {
6198
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
6199
+ }
6059
6200
  if (!(data === null || data === void 0 ? void 0 : data.ID)) {
6060
6201
  throw ("Type ID is required.");
6061
6202
  }
@@ -6070,7 +6211,10 @@
6070
6211
  EntityAttachmentType.Update = Update;
6071
6212
  function GetList(params) {
6072
6213
  return __awaiter(this, void 0, void 0, function* () {
6073
- const { api, reqParams } = params;
6214
+ let { api, reqParams } = params;
6215
+ if (!api) {
6216
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
6217
+ }
6074
6218
  const cache = yield api.GetCacheItem(GetListCacheKey(), reqParams);
6075
6219
  if (cache === null || cache === void 0 ? void 0 : cache.found) {
6076
6220
  return cache.data;
@@ -6108,7 +6252,10 @@
6108
6252
  EntityAttachment.GetListCacheKey = GetListCacheKey;
6109
6253
  function Update(params) {
6110
6254
  return __awaiter(this, void 0, void 0, function* () {
6111
- const { api, attachments, req, entityId } = params;
6255
+ let { api, attachments, req, entityId } = params;
6256
+ if (!api) {
6257
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
6258
+ }
6112
6259
  if (!(attachments === null || attachments === void 0 ? void 0 : attachments.length)) {
6113
6260
  return {
6114
6261
  attachments: []
@@ -6131,7 +6278,10 @@
6131
6278
  EntityAttachment.Update = Update;
6132
6279
  function UpdateOrder(params) {
6133
6280
  return __awaiter(this, void 0, void 0, function* () {
6134
- const { api, entityId, attachmentTypeId: typeId, attachments, req: reqParams } = params;
6281
+ let { api, entityId, attachmentTypeId: typeId, attachments, req: reqParams } = params;
6282
+ if (!api) {
6283
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
6284
+ }
6135
6285
  if (!entityId || !typeId || !(attachments === null || attachments === void 0 ? void 0 : attachments.length)) {
6136
6286
  throw ("Entity ID, Type ID, and Attachments are required.");
6137
6287
  }
@@ -6149,7 +6299,10 @@
6149
6299
  EntityAttachment.UpdateOrder = UpdateOrder;
6150
6300
  function Delete(params) {
6151
6301
  return __awaiter(this, void 0, void 0, function* () {
6152
- const { api, attachmentId, entityId, req } = params;
6302
+ let { api, attachmentId, entityId, req } = params;
6303
+ if (!api) {
6304
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
6305
+ }
6153
6306
  if (!attachmentId || !entityId) {
6154
6307
  throw ("Entity id and attachment id.");
6155
6308
  }
@@ -6160,7 +6313,10 @@
6160
6313
  EntityAttachment.Delete = Delete;
6161
6314
  function GetListByEntityId(params) {
6162
6315
  return __awaiter(this, void 0, void 0, function* () {
6163
- const { api, entityId, req: reqParams } = params;
6316
+ let { api, entityId, req: reqParams } = params;
6317
+ if (!api) {
6318
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
6319
+ }
6164
6320
  if (!entityId) {
6165
6321
  throw ("Entity ID is required.");
6166
6322
  }
@@ -6190,7 +6346,10 @@
6190
6346
  EntityAttachment.GetListByEntityId = GetListByEntityId;
6191
6347
  function Upload(params) {
6192
6348
  return __awaiter(this, void 0, void 0, function* () {
6193
- const { api, file, entityId, attachmentTypeId: typeId, req: reqParams } = params;
6349
+ let { api, file, entityId, attachmentTypeId: typeId, req: reqParams } = params;
6350
+ if (!api) {
6351
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
6352
+ }
6194
6353
  if (!entityId || !typeId || !file) {
6195
6354
  throw ("Entity ID, Type ID, and File are required.");
6196
6355
  }
@@ -6216,7 +6375,10 @@
6216
6375
  EntityComment.GetListCacheKey = GetListCacheKey;
6217
6376
  function Update(params) {
6218
6377
  return __awaiter(this, void 0, void 0, function* () {
6219
- const { api, comment: data, req: reqParams } = params;
6378
+ let { api, comment: data, req: reqParams } = params;
6379
+ if (!api) {
6380
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
6381
+ }
6220
6382
  if (!(data === null || data === void 0 ? void 0 : data["TargetObject.ID"])) {
6221
6383
  throw ("TargetObject.ID (entity id) is required.");
6222
6384
  }
@@ -6232,7 +6394,10 @@
6232
6394
  EntityComment.Update = Update;
6233
6395
  function Delete(params) {
6234
6396
  return __awaiter(this, void 0, void 0, function* () {
6235
- const { api, entityId, commentId, req: reqParams } = params;
6397
+ let { api, entityId, commentId, req: reqParams } = params;
6398
+ if (!api) {
6399
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
6400
+ }
6236
6401
  if (!commentId) {
6237
6402
  throw ("Comment ID is required.");
6238
6403
  }
@@ -6244,7 +6409,10 @@
6244
6409
  EntityComment.Delete = Delete;
6245
6410
  function GetListByEntityId(params) {
6246
6411
  return __awaiter(this, void 0, void 0, function* () {
6247
- const { api, entityId, req: reqParams } = params;
6412
+ let { api, entityId, req: reqParams } = params;
6413
+ if (!api) {
6414
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
6415
+ }
6248
6416
  if (!entityId) {
6249
6417
  throw ("Entity ID is required.");
6250
6418
  }
@@ -6285,7 +6453,10 @@
6285
6453
  EntityLink.GetListCacheKey = GetListCacheKey;
6286
6454
  function Update(params) {
6287
6455
  return __awaiter(this, void 0, void 0, function* () {
6288
- const { api, link: data, req: reqParams } = params;
6456
+ let { api, link: data, req: reqParams } = params;
6457
+ if (!api) {
6458
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
6459
+ }
6289
6460
  if (!(data === null || data === void 0 ? void 0 : data["Entity.ID"])) {
6290
6461
  throw ("Entity ID is required.");
6291
6462
  }
@@ -6301,7 +6472,10 @@
6301
6472
  EntityLink.Update = Update;
6302
6473
  function Delete(params) {
6303
6474
  return __awaiter(this, void 0, void 0, function* () {
6304
- const { api, entityId, linkId, req: reqParams } = params;
6475
+ let { api, entityId, linkId, req: reqParams } = params;
6476
+ if (!api) {
6477
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
6478
+ }
6305
6479
  if (!linkId) {
6306
6480
  throw ("Link ID is required.");
6307
6481
  }
@@ -6313,7 +6487,10 @@
6313
6487
  EntityLink.Delete = Delete;
6314
6488
  function GetListByEntityId(params) {
6315
6489
  return __awaiter(this, void 0, void 0, function* () {
6316
- const { api, entityId, req: reqParams } = params;
6490
+ let { api, entityId, req: reqParams } = params;
6491
+ if (!api) {
6492
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
6493
+ }
6317
6494
  if (!entityId) {
6318
6495
  throw ("Entity ID is required.");
6319
6496
  }
@@ -6358,6 +6535,9 @@
6358
6535
  EntityLod.GetEntityListKey = GetEntityListKey;
6359
6536
  function GetUrl(params) {
6360
6537
  let { api, entityId, categoryId, level, strict } = params;
6538
+ if (!api) {
6539
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
6540
+ }
6361
6541
  if (!entityId) {
6362
6542
  throw ("Entity ID is required.");
6363
6543
  }
@@ -6378,7 +6558,10 @@
6378
6558
  EntityLod.GetUrl = GetUrl;
6379
6559
  function GetUrlFileId(params) {
6380
6560
  return __awaiter(this, void 0, void 0, function* () {
6381
- const { api, url, req: reqParams } = params;
6561
+ let { api, url, req: reqParams } = params;
6562
+ if (!api) {
6563
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
6564
+ }
6382
6565
  if (!url) {
6383
6566
  throw ("Url is required.");
6384
6567
  }
@@ -6409,7 +6592,10 @@
6409
6592
  function GetLods(params) {
6410
6593
  var _a;
6411
6594
  return __awaiter(this, void 0, void 0, function* () {
6412
- const { api, filter, req: reqParams } = params;
6595
+ let { api, filter, req: reqParams } = params;
6596
+ if (!api) {
6597
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
6598
+ }
6413
6599
  if (!((_a = filter === null || filter === void 0 ? void 0 : filter.Items) === null || _a === void 0 ? void 0 : _a.length)) {
6414
6600
  throw ("Items are required.");
6415
6601
  }
@@ -6422,7 +6608,10 @@
6422
6608
  EntityLod.GetLods = GetLods;
6423
6609
  function GetEntityLods(params) {
6424
6610
  return __awaiter(this, void 0, void 0, function* () {
6425
- const { api, entityId, req: reqParams } = params;
6611
+ let { api, entityId, req: reqParams } = params;
6612
+ if (!api) {
6613
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
6614
+ }
6426
6615
  if (!entityId) {
6427
6616
  throw ("Entity id is required.");
6428
6617
  }
@@ -6458,6 +6647,9 @@
6458
6647
  function GetTypeLods(params) {
6459
6648
  return __awaiter(this, void 0, void 0, function* () {
6460
6649
  let { api, entityTypeId: typeId, group, req: reqParams } = params;
6650
+ if (!api) {
6651
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
6652
+ }
6461
6653
  if (!group) {
6462
6654
  group = "DEFAULT";
6463
6655
  }
@@ -6489,7 +6681,10 @@
6489
6681
  EntityLod.GetTypeLods = GetTypeLods;
6490
6682
  function Update(params) {
6491
6683
  return __awaiter(this, void 0, void 0, function* () {
6492
- const { api, entityId, req: reqParams } = params;
6684
+ let { api, entityId, req: reqParams } = params;
6685
+ if (!api) {
6686
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
6687
+ }
6493
6688
  if (!params["ClientFile.ID"] || !params["LODCategory.Key"] || (!params.Level && params.Level !== 0)) {
6494
6689
  throw ("ClientFile.ID, LODCategory.Key and Level are required.");
6495
6690
  }
@@ -6505,6 +6700,9 @@
6505
6700
  function Delete(params) {
6506
6701
  return __awaiter(this, void 0, void 0, function* () {
6507
6702
  let { api, entityId, lodCategoryId, level, req: reqParams } = params;
6703
+ if (!api) {
6704
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
6705
+ }
6508
6706
  if (!entityId || !lodCategoryId) {
6509
6707
  throw ("Entity ID and LOD Category ID are required.");
6510
6708
  }
@@ -6532,7 +6730,10 @@
6532
6730
  EntityLodCategory.GetListCacheKey = GetListCacheKey;
6533
6731
  function GetList(params) {
6534
6732
  return __awaiter(this, void 0, void 0, function* () {
6535
- const { api, req: reqParams } = params;
6733
+ let { api, req: reqParams } = params;
6734
+ if (!api) {
6735
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
6736
+ }
6536
6737
  const cache = yield api.GetCacheItem(GetListCacheKey(), reqParams);
6537
6738
  if (cache === null || cache === void 0 ? void 0 : cache.found) {
6538
6739
  return cache.data;
@@ -6559,7 +6760,10 @@
6559
6760
  EntityLodCategory.GetList = GetList;
6560
6761
  function Get(params) {
6561
6762
  return __awaiter(this, void 0, void 0, function* () {
6562
- const { api, categoryId: id, req: reqParams } = params;
6763
+ let { api, categoryId: id, req: reqParams } = params;
6764
+ if (!api) {
6765
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
6766
+ }
6563
6767
  if (!id) {
6564
6768
  throw ("Lod category id is required.");
6565
6769
  }
@@ -6589,7 +6793,10 @@
6589
6793
  EntityLodCategory.Get = Get;
6590
6794
  function Delete(params) {
6591
6795
  return __awaiter(this, void 0, void 0, function* () {
6592
- const { api, categoryId: id, req: reqParams } = params;
6796
+ let { api, categoryId: id, req: reqParams } = params;
6797
+ if (!api) {
6798
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
6799
+ }
6593
6800
  if (!id) {
6594
6801
  throw ("Lod category id is required.");
6595
6802
  }
@@ -6601,7 +6808,10 @@
6601
6808
  EntityLodCategory.Delete = Delete;
6602
6809
  function Update(params) {
6603
6810
  return __awaiter(this, void 0, void 0, function* () {
6604
- const { api, category: data, req: reqParams } = params;
6811
+ let { api, category: data, req: reqParams } = params;
6812
+ if (!api) {
6813
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
6814
+ }
6605
6815
  if (!data.Key || !data.Name) {
6606
6816
  throw ("Lod category key and name are required.");
6607
6817
  }
@@ -6627,7 +6837,10 @@
6627
6837
  EntityRelationType.GetListCacheKey = GetListCacheKey;
6628
6838
  function Get(params) {
6629
6839
  return __awaiter(this, void 0, void 0, function* () {
6630
- const { api, relationTypeId: typeId, req: reqParams } = params;
6840
+ let { api, relationTypeId: typeId, req: reqParams } = params;
6841
+ if (!api) {
6842
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
6843
+ }
6631
6844
  if (!typeId) {
6632
6845
  throw ("Type ID is required.");
6633
6846
  }
@@ -6658,7 +6871,10 @@
6658
6871
  EntityRelationType.Get = Get;
6659
6872
  function Delete(params) {
6660
6873
  return __awaiter(this, void 0, void 0, function* () {
6661
- const { api, relationTypeId: typeId, req: reqParams } = params;
6874
+ let { api, relationTypeId: typeId, req: reqParams } = params;
6875
+ if (!api) {
6876
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
6877
+ }
6662
6878
  if (!typeId) {
6663
6879
  throw ("Type ID is required.");
6664
6880
  }
@@ -6670,7 +6886,10 @@
6670
6886
  EntityRelationType.Delete = Delete;
6671
6887
  function GetList(params) {
6672
6888
  return __awaiter(this, void 0, void 0, function* () {
6673
- const { api, req: reqParams } = params;
6889
+ let { api, req: reqParams } = params;
6890
+ if (!api) {
6891
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
6892
+ }
6674
6893
  const cache = yield api.GetCacheItem(GetListCacheKey(), reqParams);
6675
6894
  if (cache === null || cache === void 0 ? void 0 : cache.found) {
6676
6895
  return cache.data;
@@ -6697,7 +6916,10 @@
6697
6916
  EntityRelationType.GetList = GetList;
6698
6917
  function Update(params) {
6699
6918
  return __awaiter(this, void 0, void 0, function* () {
6700
- const { api, relationType: data, req: reqParams } = params;
6919
+ let { api, relationType: data, req: reqParams } = params;
6920
+ if (!api) {
6921
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
6922
+ }
6701
6923
  if (!(data === null || data === void 0 ? void 0 : data.ForwardName) || !(data === null || data === void 0 ? void 0 : data.ReverseName)) {
6702
6924
  throw ("Forward and reverse names are required.");
6703
6925
  }
@@ -6734,7 +6956,10 @@
6734
6956
  EntityRelation.GetListCacheKey = GetListCacheKey;
6735
6957
  function Create(params) {
6736
6958
  return __awaiter(this, void 0, void 0, function* () {
6737
- const { api, relation: data, req: reqParams } = params;
6959
+ let { api, relation: data, req: reqParams } = params;
6960
+ if (!api) {
6961
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
6962
+ }
6738
6963
  if (!data["Principal.Entity.ID"] || !data["Related.Entity.ID"] || !data["Relation.Type.ID"]) {
6739
6964
  throw ("Principal Entity ID, Related Entity ID, and Relation Type ID are required.");
6740
6965
  }
@@ -6754,7 +6979,10 @@
6754
6979
  EntityRelation.Create = Create;
6755
6980
  function Delete(params) {
6756
6981
  return __awaiter(this, void 0, void 0, function* () {
6757
- const { api, principalEntityId, relatedEntityId, relationTypeId, req: reqParams } = params;
6982
+ let { api, principalEntityId, relatedEntityId, relationTypeId, req: reqParams } = params;
6983
+ if (!api) {
6984
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
6985
+ }
6758
6986
  if (!principalEntityId || !relatedEntityId || !relationTypeId) {
6759
6987
  throw new Error("Principal Entity ID, Related Entity ID, and Relation Type ID are required.");
6760
6988
  }
@@ -6771,7 +6999,10 @@
6771
6999
  EntityRelation.Delete = Delete;
6772
7000
  function Update(params) {
6773
7001
  return __awaiter(this, void 0, void 0, function* () {
6774
- const { api, relation: data, req: reqParams } = params;
7002
+ let { api, relation: data, req: reqParams } = params;
7003
+ if (!api) {
7004
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
7005
+ }
6775
7006
  if (!data["Principal.Entity.ID"] || !data["Related.Entity.ID"] || !data["Relation.Type.ID"]) {
6776
7007
  throw ("Principal Entity ID, Related Entity ID, and Relation Type ID are required.");
6777
7008
  }
@@ -6789,6 +7020,9 @@
6789
7020
  function GetList(params) {
6790
7021
  return __awaiter(this, void 0, void 0, function* () {
6791
7022
  let { api, entityId, filter, req: reqParams } = params;
7023
+ if (!api) {
7024
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
7025
+ }
6792
7026
  if (!entityId) {
6793
7027
  throw ("Entity ID is required.");
6794
7028
  }
@@ -6824,7 +7058,10 @@
6824
7058
  EntityRelation.GetList = GetList;
6825
7059
  function GetByDataEntityId(params) {
6826
7060
  return __awaiter(this, void 0, void 0, function* () {
6827
- const { api, entityId, req: reqParams } = params;
7061
+ let { api, entityId, req: reqParams } = params;
7062
+ if (!api) {
7063
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
7064
+ }
6828
7065
  if (!entityId) {
6829
7066
  throw ("Entity ID is required.");
6830
7067
  }
@@ -6862,7 +7099,10 @@
6862
7099
  function Get(params) {
6863
7100
  var _a;
6864
7101
  return __awaiter(this, void 0, void 0, function* () {
6865
- const { api, sourceId, sourceKey, req: reqParams } = params;
7102
+ let { api, sourceId, sourceKey, req: reqParams } = params;
7103
+ if (!api) {
7104
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
7105
+ }
6866
7106
  if (!sourceId || !sourceKey) {
6867
7107
  throw ("Source ID and Source Key are required.");
6868
7108
  }
@@ -6880,7 +7120,10 @@
6880
7120
  EntitySource.Get = Get;
6881
7121
  function GetListByKeys(params) {
6882
7122
  return __awaiter(this, void 0, void 0, function* () {
6883
- const { api, sourceId, sourceKeys, req: reqParams } = params;
7123
+ let { api, sourceId, sourceKeys, req: reqParams } = params;
7124
+ if (!api) {
7125
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
7126
+ }
6884
7127
  if (!sourceId || !sourceKeys.length) {
6885
7128
  throw ("Source ID and Source Keys are required.");
6886
7129
  }
@@ -6927,7 +7170,10 @@
6927
7170
  EntitySource.GetListByKeys = GetListByKeys;
6928
7171
  function GetEntityIdsBySourceKeys(params) {
6929
7172
  return __awaiter(this, void 0, void 0, function* () {
6930
- const { api, sourceId, sourceKeys, req: reqParams } = params;
7173
+ let { api, sourceId, sourceKeys, req: reqParams } = params;
7174
+ if (!api) {
7175
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
7176
+ }
6931
7177
  if (!sourceId || !sourceKeys.length) {
6932
7178
  throw ("Source ID and Source Keys are required.");
6933
7179
  }
@@ -6957,13 +7203,16 @@
6957
7203
  EntitySource.GetEntityIdsBySourceKeys = GetEntityIdsBySourceKeys;
6958
7204
  function CreateLink(params) {
6959
7205
  return __awaiter(this, void 0, void 0, function* () {
6960
- const { source } = params;
7206
+ let { source, api } = params;
7207
+ if (!api) {
7208
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
7209
+ }
6961
7210
  if (!source["Entity.ID"] || !source["Source.ID"] || !source["SourceRecord.Key"]) {
6962
7211
  throw ("Entity ID, Source ID and Source Key are required.");
6963
7212
  }
6964
- const res = yield params.api.POST("entitysource", source);
7213
+ const res = yield api.POST("entitysource", source);
6965
7214
  const cacheKey = GetCacheKey(source["Source.ID"], source["SourceRecord.Key"]);
6966
- yield params.api.Cache.Remove(cacheKey);
7215
+ yield api.Cache.Remove(cacheKey);
6967
7216
  return {
6968
7217
  source: res
6969
7218
  };
@@ -6986,7 +7235,10 @@
6986
7235
  EntityTag.GetListCacheKey = GetListCacheKey;
6987
7236
  function Get(params) {
6988
7237
  return __awaiter(this, void 0, void 0, function* () {
6989
- const { api, tagId, req: reqParams } = params;
7238
+ let { api, tagId, req: reqParams } = params;
7239
+ if (!api) {
7240
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
7241
+ }
6990
7242
  if (!tagId) {
6991
7243
  throw ("Tag ID is required.");
6992
7244
  }
@@ -7003,7 +7255,10 @@
7003
7255
  EntityTag.Get = Get;
7004
7256
  function GetListByIds(params) {
7005
7257
  return __awaiter(this, void 0, void 0, function* () {
7006
- const { api, tagIds, req: reqParams } = params;
7258
+ let { api, tagIds, req: reqParams } = params;
7259
+ if (!api) {
7260
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
7261
+ }
7007
7262
  if (!tagIds.length) {
7008
7263
  throw ("Tag Ids are empty.");
7009
7264
  }
@@ -7059,7 +7314,10 @@
7059
7314
  EntityTag.GetListByIds = GetListByIds;
7060
7315
  function GetList(params) {
7061
7316
  return __awaiter(this, void 0, void 0, function* () {
7062
- const { api, entityTypeId, req: reqParams } = params;
7317
+ let { api, entityTypeId, req: reqParams } = params;
7318
+ if (!api) {
7319
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
7320
+ }
7063
7321
  const cache = yield api.GetCacheItem(GetListCacheKey(entityTypeId), reqParams);
7064
7322
  if (cache === null || cache === void 0 ? void 0 : cache.found) {
7065
7323
  return cache.data;
@@ -7086,7 +7344,10 @@
7086
7344
  EntityTag.GetList = GetList;
7087
7345
  function Delete(params) {
7088
7346
  return __awaiter(this, void 0, void 0, function* () {
7089
- const { api, tagId, req: reqParams } = params;
7347
+ let { api, tagId, req: reqParams } = params;
7348
+ if (!api) {
7349
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
7350
+ }
7090
7351
  if (!tagId) {
7091
7352
  throw ("Tag ID is required.");
7092
7353
  }
@@ -7098,7 +7359,10 @@
7098
7359
  EntityTag.Delete = Delete;
7099
7360
  function Update(params) {
7100
7361
  return __awaiter(this, void 0, void 0, function* () {
7101
- const { api, tag: data, req: reqParams } = params;
7362
+ let { api, tag: data, req: reqParams } = params;
7363
+ if (!api) {
7364
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
7365
+ }
7102
7366
  const url = data.ID ? `layer/${data.ID}` : "layer";
7103
7367
  const res = yield api.POST(url, data, exports.Api.PrepReqParams(reqParams));
7104
7368
  api.Cache.Remove(GetCacheKey(data.ID));
@@ -7122,7 +7386,10 @@
7122
7386
  EntityType.GetListCacheKey = GetListCacheKey;
7123
7387
  function Get(params) {
7124
7388
  return __awaiter(this, void 0, void 0, function* () {
7125
- const { api, entityTypeId: typeId, req: reqParams } = params;
7389
+ let { api, entityTypeId: typeId, req: reqParams } = params;
7390
+ if (!api) {
7391
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
7392
+ }
7126
7393
  if (!typeId) {
7127
7394
  throw ("Type ID is required.");
7128
7395
  }
@@ -7153,7 +7420,10 @@
7153
7420
  EntityType.Get = Get;
7154
7421
  function Delete(params) {
7155
7422
  return __awaiter(this, void 0, void 0, function* () {
7156
- const { api, entityTypeId: typeId, req: reqParams } = params;
7423
+ let { api, entityTypeId: typeId, req: reqParams } = params;
7424
+ if (!api) {
7425
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
7426
+ }
7157
7427
  if (!typeId) {
7158
7428
  throw ("Type ID is required.");
7159
7429
  }
@@ -7165,7 +7435,10 @@
7165
7435
  EntityType.Delete = Delete;
7166
7436
  function GetList(params) {
7167
7437
  return __awaiter(this, void 0, void 0, function* () {
7168
- const { api, req: reqParams } = params;
7438
+ let { api, req: reqParams } = params;
7439
+ if (!api) {
7440
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
7441
+ }
7169
7442
  const cache = yield api.GetCacheItem(GetListCacheKey(), reqParams);
7170
7443
  if (cache === null || cache === void 0 ? void 0 : cache.found) {
7171
7444
  return cache.data;
@@ -7194,6 +7467,9 @@
7194
7467
  function Update(params) {
7195
7468
  return __awaiter(this, void 0, void 0, function* () {
7196
7469
  let { api, entityType: data, req: reqParams } = params;
7470
+ if (!api) {
7471
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
7472
+ }
7197
7473
  if (!data) {
7198
7474
  data = {};
7199
7475
  }
@@ -7772,7 +8048,10 @@
7772
8048
  EntityCoords.GetCacheKey = GetCacheKey;
7773
8049
  function GetEntityCoords(params) {
7774
8050
  return __awaiter(this, void 0, void 0, function* () {
7775
- const { api, rootEntityId: entityId, req: reqParams } = params;
8051
+ let { api, rootEntityId: entityId, req: reqParams } = params;
8052
+ if (!api) {
8053
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
8054
+ }
7776
8055
  const cache = yield api.GetCacheItem(GetCacheKey(entityId), reqParams);
7777
8056
  if (cache === null || cache === void 0 ? void 0 : cache.found) {
7778
8057
  return cache.data;
@@ -7799,7 +8078,10 @@
7799
8078
  EntityCoords.GetEntityCoords = GetEntityCoords;
7800
8079
  function EntityRelativeToPoint(params) {
7801
8080
  return __awaiter(this, void 0, void 0, function* () {
7802
- const { api, rootEntityId: entityId, req: reqParams } = params;
8081
+ let { api, rootEntityId: entityId, req: reqParams } = params;
8082
+ if (!api) {
8083
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
8084
+ }
7803
8085
  if (!params.test) {
7804
8086
  yield UnlinkCoords({
7805
8087
  api,
@@ -7836,7 +8118,10 @@
7836
8118
  function EntityRelativeToEpsg(params) {
7837
8119
  var _a;
7838
8120
  return __awaiter(this, void 0, void 0, function* () {
7839
- const { api, rootEntityId: entityId, req: reqParams } = params;
8121
+ let { api, rootEntityId: entityId, req: reqParams } = params;
8122
+ if (!api) {
8123
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
8124
+ }
7840
8125
  if (!params.test) {
7841
8126
  yield UnlinkCoords({
7842
8127
  api,
@@ -7870,7 +8155,10 @@
7870
8155
  EntityCoords.EntityRelativeToEpsg = EntityRelativeToEpsg;
7871
8156
  function EntityRelativeToUcs(params) {
7872
8157
  return __awaiter(this, void 0, void 0, function* () {
7873
- const { api, rootEntityId: entityId, req: reqParams } = params;
8158
+ let { api, rootEntityId: entityId, req: reqParams } = params;
8159
+ if (!api) {
8160
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
8161
+ }
7874
8162
  if (!params.test) {
7875
8163
  yield UnlinkCoords({
7876
8164
  api,
@@ -7896,7 +8184,10 @@
7896
8184
  EntityCoords.EntityRelativeToUcs = EntityRelativeToUcs;
7897
8185
  function UnlinkCoords(params) {
7898
8186
  return __awaiter(this, void 0, void 0, function* () {
7899
- const { api, rootEntityId: entityId, req: reqParams } = params;
8187
+ let { api, rootEntityId: entityId, req: reqParams } = params;
8188
+ if (!api) {
8189
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
8190
+ }
7900
8191
  return api.DELETE(`entity/${entityId}/ucs`, reqParams);
7901
8192
  });
7902
8193
  }
@@ -7943,7 +8234,10 @@
7943
8234
  Uploader.MIN_LARGE_FILE_SIZE = 100000000; // 100MB.
7944
8235
  function DoMultiPartUpload(params) {
7945
8236
  return __awaiter(this, void 0, void 0, function* () {
7946
- const { file, api, urlSuffix: url, req, onProgress } = params;
8237
+ let { file, api, urlSuffix: url, req, onProgress } = params;
8238
+ if (!api) {
8239
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
8240
+ }
7947
8241
  const FILE_PORTION_SIZE = 100000000; // 100MB.
7948
8242
  let fileSize = file.size;
7949
8243
  let fileOffset = 0;
@@ -8007,18 +8301,27 @@
8007
8301
  }
8008
8302
  ClientFile.GetCacheKey = GetCacheKey;
8009
8303
  function GetUrl(params) {
8010
- const { api, fileId } = params;
8304
+ let { api, fileId } = params;
8305
+ if (!api) {
8306
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
8307
+ }
8011
8308
  return `${api.GetBaseUrl()}file/${fileId}`;
8012
8309
  }
8013
8310
  ClientFile.GetUrl = GetUrl;
8014
8311
  function GetUrlWithExt(params) {
8015
- const { api, file } = params;
8312
+ let { api, file } = params;
8313
+ if (!api) {
8314
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
8315
+ }
8016
8316
  return `${api.GetBaseUrl()}file/${file.ID}${file.FileExt ? file.FileExt : ""}`;
8017
8317
  }
8018
8318
  ClientFile.GetUrlWithExt = GetUrlWithExt;
8019
8319
  function Get(params) {
8020
8320
  return __awaiter(this, void 0, void 0, function* () {
8021
- const { api, fileId, req: reqParams } = params;
8321
+ let { api, fileId, req: reqParams } = params;
8322
+ if (!api) {
8323
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
8324
+ }
8022
8325
  if (!fileId) {
8023
8326
  throw ("File ID is required.");
8024
8327
  }
@@ -8049,7 +8352,10 @@
8049
8352
  ClientFile.Get = Get;
8050
8353
  function Delete(params) {
8051
8354
  return __awaiter(this, void 0, void 0, function* () {
8052
- const { api, fileIds, req: reqParams } = params;
8355
+ let { api, fileIds, req: reqParams } = params;
8356
+ if (!api) {
8357
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
8358
+ }
8053
8359
  if (!fileIds.length) {
8054
8360
  throw ("File IDs are required.");
8055
8361
  }
@@ -8067,6 +8373,9 @@
8067
8373
  function Upload(params) {
8068
8374
  return __awaiter(this, void 0, void 0, function* () {
8069
8375
  let { api, file, purpose, req, onProgress } = params;
8376
+ if (!api) {
8377
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
8378
+ }
8070
8379
  if (!file) {
8071
8380
  throw ("File is required.");
8072
8381
  }
@@ -8122,6 +8431,9 @@
8122
8431
  function UpdatePurpose(params) {
8123
8432
  return __awaiter(this, void 0, void 0, function* () {
8124
8433
  let { api, fileId, purpose, req: reqParams } = params;
8434
+ if (!api) {
8435
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
8436
+ }
8125
8437
  if (!purpose) {
8126
8438
  purpose = "";
8127
8439
  }
@@ -8142,6 +8454,9 @@
8142
8454
  function UploadTemp(params) {
8143
8455
  return __awaiter(this, void 0, void 0, function* () {
8144
8456
  let { api, file, req, onProgress } = params;
8457
+ if (!api) {
8458
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
8459
+ }
8145
8460
  if (!file) {
8146
8461
  throw ("File is required.");
8147
8462
  }
@@ -8205,7 +8520,10 @@
8205
8520
  })(Filter = ClientFile.Filter || (ClientFile.Filter = {}));
8206
8521
  function GetList(params) {
8207
8522
  return __awaiter(this, void 0, void 0, function* () {
8208
- const { api, filter, req: reqParams } = params;
8523
+ let { api, filter, req: reqParams } = params;
8524
+ if (!api) {
8525
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
8526
+ }
8209
8527
  const data = yield api.POST("files/filtered", filter, exports.Api.PrepReqParams(reqParams));
8210
8528
  return {
8211
8529
  clientFiles: data.Items,
@@ -8223,7 +8541,10 @@
8223
8541
  })(EConvertExt = Processor.EConvertExt || (Processor.EConvertExt = {}));
8224
8542
  function ConvertFormat(params) {
8225
8543
  return __awaiter(this, void 0, void 0, function* () {
8226
- const { api, fileId: clientFileId, ext, req: reqParams } = params;
8544
+ let { api, fileId: clientFileId, ext, req: reqParams } = params;
8545
+ if (!api) {
8546
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
8547
+ }
8227
8548
  if (!clientFileId || !ext) {
8228
8549
  throw ("Client File ID and extension are required.");
8229
8550
  }
@@ -8256,7 +8577,10 @@
8256
8577
  })(EProgramId = ProgramKey.EProgramId || (ProgramKey.EProgramId = {}));
8257
8578
  function Get(params) {
8258
8579
  return __awaiter(this, void 0, void 0, function* () {
8259
- const { api, programId, req: reqParams } = params;
8580
+ let { api, programId, req: reqParams } = params;
8581
+ if (!api) {
8582
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
8583
+ }
8260
8584
  if (!programId) {
8261
8585
  throw ("Program ID is required.");
8262
8586
  }
@@ -8287,7 +8611,10 @@
8287
8611
  ProgramKey.Get = Get;
8288
8612
  function GetList(params) {
8289
8613
  return __awaiter(this, void 0, void 0, function* () {
8290
- const { api, req: reqParams } = params;
8614
+ let { api, req: reqParams } = params;
8615
+ if (!api) {
8616
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
8617
+ }
8291
8618
  const cache = yield api.GetCacheItem(GetListCacheKey(), reqParams);
8292
8619
  if (cache === null || cache === void 0 ? void 0 : cache.found) {
8293
8620
  return cache.data;
@@ -8314,7 +8641,10 @@
8314
8641
  ProgramKey.GetList = GetList;
8315
8642
  function Delete(params) {
8316
8643
  return __awaiter(this, void 0, void 0, function* () {
8317
- const { api, programId, req: reqParams } = params;
8644
+ let { api, programId, req: reqParams } = params;
8645
+ if (!api) {
8646
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
8647
+ }
8318
8648
  if (!programId) {
8319
8649
  throw ("Program ID is required.");
8320
8650
  }
@@ -8326,7 +8656,10 @@
8326
8656
  ProgramKey.Delete = Delete;
8327
8657
  function Update(params) {
8328
8658
  return __awaiter(this, void 0, void 0, function* () {
8329
- const { api, programKey: data, req: reqParams } = params;
8659
+ let { api, programKey: data, req: reqParams } = params;
8660
+ if (!api) {
8661
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
8662
+ }
8330
8663
  if (!(data === null || data === void 0 ? void 0 : data.ProgramId)) {
8331
8664
  throw ("Program ID is required.");
8332
8665
  }
@@ -8387,7 +8720,10 @@
8387
8720
  })(EPivot = Tileset.EPivot || (Tileset.EPivot = {}));
8388
8721
  function Get(params) {
8389
8722
  return __awaiter(this, void 0, void 0, function* () {
8390
- const { api, tilesetId, loadFiles, req: reqParams } = params;
8723
+ let { api, tilesetId, loadFiles, req: reqParams } = params;
8724
+ if (!api) {
8725
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
8726
+ }
8391
8727
  if (!tilesetId) {
8392
8728
  throw ("Tileset ID is required.");
8393
8729
  }
@@ -8418,13 +8754,18 @@
8418
8754
  /**
8419
8755
  * Returns tileset types for given tileset ids.
8420
8756
  * @param params
8757
+ * @deprecated Just use GetList and Get to find the type from the tileset record.
8421
8758
  * @returns
8422
8759
  */
8423
8760
  function GetTypes(params) {
8424
8761
  return __awaiter(this, void 0, void 0, function* () {
8762
+ // UPDATE: This was corrected, this will be removed.
8425
8763
  // Our api is auto-converting legacy types right now which makes it impossible to know what they are.
8426
8764
  // This uses the legacy end-point which doesn't do that...
8427
- const { api, tilesetIds, req: reqParams } = params;
8765
+ let { api, tilesetIds, req: reqParams } = params;
8766
+ if (!api) {
8767
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
8768
+ }
8428
8769
  const mapping = {};
8429
8770
  if (tilesetIds.length == 1) {
8430
8771
  const tileset = yield api.GET("ui.tileset/" + tilesetIds[0], exports.Api.PrepReqParams(reqParams));
@@ -8448,7 +8789,10 @@
8448
8789
  Tileset.GetTypes = GetTypes;
8449
8790
  function GetList(params) {
8450
8791
  return __awaiter(this, void 0, void 0, function* () {
8451
- const { api, req: reqParams } = params;
8792
+ let { api, req: reqParams } = params;
8793
+ if (!api) {
8794
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
8795
+ }
8452
8796
  const cache = yield api.GetCacheItem(GetListCacheKey(), reqParams);
8453
8797
  if (cache === null || cache === void 0 ? void 0 : cache.found) {
8454
8798
  return cache.data;
@@ -8475,7 +8819,10 @@
8475
8819
  Tileset.GetList = GetList;
8476
8820
  function Delete(params) {
8477
8821
  return __awaiter(this, void 0, void 0, function* () {
8478
- const { api, tilesetId, req: reqParams } = params;
8822
+ let { api, tilesetId, req: reqParams } = params;
8823
+ if (!api) {
8824
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
8825
+ }
8479
8826
  if (!tilesetId) {
8480
8827
  throw ("Tileset ID is required.");
8481
8828
  }
@@ -8488,6 +8835,9 @@
8488
8835
  function Update(params) {
8489
8836
  return __awaiter(this, void 0, void 0, function* () {
8490
8837
  let { api, tileset: data, req: reqParams } = params;
8838
+ if (!api) {
8839
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
8840
+ }
8491
8841
  if (!(data === null || data === void 0 ? void 0 : data.name) || !(data === null || data === void 0 ? void 0 : data.type)) {
8492
8842
  throw ("Tileset name and type are required.");
8493
8843
  }
@@ -8508,6 +8858,9 @@
8508
8858
  function UploadFile(params) {
8509
8859
  return __awaiter(this, void 0, void 0, function* () {
8510
8860
  let { api, file, req, tilesetId, onProgress } = params;
8861
+ if (!api) {
8862
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
8863
+ }
8511
8864
  if (!tilesetId || !file) {
8512
8865
  throw ("Tileset ID and file are required.");
8513
8866
  }
@@ -8545,7 +8898,10 @@
8545
8898
  Tileset.UploadFile = UploadFile;
8546
8899
  function DeleteFile(params) {
8547
8900
  return __awaiter(this, void 0, void 0, function* () {
8548
- const { api, tilesetId, file, req: reqParams } = params;
8901
+ let { api, tilesetId, file, req: reqParams } = params;
8902
+ if (!api) {
8903
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
8904
+ }
8549
8905
  if (!tilesetId || !file) {
8550
8906
  throw ("Tileset ID and file are required.");
8551
8907
  }
@@ -8557,6 +8913,9 @@
8557
8913
  function UploadSrcFile(params) {
8558
8914
  return __awaiter(this, void 0, void 0, function* () {
8559
8915
  let { api, file, req, tilesetId, onProgress } = params;
8916
+ if (!api) {
8917
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
8918
+ }
8560
8919
  if (!tilesetId || !file) {
8561
8920
  throw ("Tileset ID and file are required.");
8562
8921
  }
@@ -8595,7 +8954,10 @@
8595
8954
  Tileset.UploadSrcFile = UploadSrcFile;
8596
8955
  function DeleteSrcFile(params) {
8597
8956
  return __awaiter(this, void 0, void 0, function* () {
8598
- const { api, tilesetId, file, req: reqParams } = params;
8957
+ let { api, tilesetId, file, req: reqParams } = params;
8958
+ if (!api) {
8959
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
8960
+ }
8599
8961
  if (!tilesetId || !file) {
8600
8962
  throw ("Tileset ID and file are required.");
8601
8963
  }
@@ -8606,6 +8968,9 @@
8606
8968
  Tileset.DeleteSrcFile = DeleteSrcFile;
8607
8969
  function GetFileUrl(params) {
8608
8970
  let { api, tilesetId, file } = params;
8971
+ if (!api) {
8972
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
8973
+ }
8609
8974
  if (!tilesetId) {
8610
8975
  throw ("Tileset ID is required.");
8611
8976
  }
@@ -8617,6 +8982,9 @@
8617
8982
  Tileset.GetFileUrl = GetFileUrl;
8618
8983
  function GetSrcFileUrl(params) {
8619
8984
  let { api, tilesetId, file } = params;
8985
+ if (!api) {
8986
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
8987
+ }
8620
8988
  if (!tilesetId) {
8621
8989
  throw ("Tileset ID is required.");
8622
8990
  }
@@ -8628,6 +8996,9 @@
8628
8996
  Tileset.GetSrcFileUrl = GetSrcFileUrl;
8629
8997
  function GetPublicFileUrl(params) {
8630
8998
  let { api, tilesetId, file } = params;
8999
+ if (!api) {
9000
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
9001
+ }
8631
9002
  if (!tilesetId) {
8632
9003
  throw ("Tileset ID is required.");
8633
9004
  }
@@ -8639,7 +9010,10 @@
8639
9010
  Tileset.GetPublicFileUrl = GetPublicFileUrl;
8640
9011
  function Generate(params) {
8641
9012
  return __awaiter(this, void 0, void 0, function* () {
8642
- const { api, tilesetId, req: reqParams } = params;
9013
+ let { api, tilesetId, req: reqParams } = params;
9014
+ if (!api) {
9015
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
9016
+ }
8643
9017
  if (!tilesetId) {
8644
9018
  throw ("Tileset ID is required.");
8645
9019
  }
@@ -8661,7 +9035,10 @@
8661
9035
  Publish.GetCacheKey = GetCacheKey;
8662
9036
  function Update(params) {
8663
9037
  return __awaiter(this, void 0, void 0, function* () {
8664
- const { api, published: data, req: reqParams } = params;
9038
+ let { api, published: data, req: reqParams } = params;
9039
+ if (!api) {
9040
+ api = exports.ENVIRONMENT.Api().GetGlobalApi();
9041
+ }
8665
9042
  if (!(data === null || data === void 0 ? void 0 : data["Tileset.ID"]) || !(data === null || data === void 0 ? void 0 : data["PublishedBy.ClientAccount.ID"]) || !(data === null || data === void 0 ? void 0 : data["PublishedBy.User.ID"])) {
8666
9043
  throw ("Tileset ID, client account ID, and user ID are required.");
8667
9044
  }
@@ -8684,7 +9061,10 @@
8684
9061
  Publish.Update = Update;
8685
9062
  function Get(params) {
8686
9063
  return __awaiter(this, void 0, void 0, function* () {
8687
- const { api, accountId, tilesetId, req: reqParams } = params;
9064
+ let { api, accountId, tilesetId, req: reqParams } = params;
9065
+ if (!api) {
9066
+ api = exports.ENVIRONMENT.Api().GetGlobalApi();
9067
+ }
8688
9068
  if (!accountId || !tilesetId) {
8689
9069
  throw ("Client account ID and tileset ID are required.");
8690
9070
  }
@@ -8714,7 +9094,10 @@
8714
9094
  Publish.Get = Get;
8715
9095
  function GetList(params) {
8716
9096
  return __awaiter(this, void 0, void 0, function* () {
8717
- const { api, accountId, req: reqParams } = params;
9097
+ let { api, accountId, req: reqParams } = params;
9098
+ if (!api) {
9099
+ api = exports.ENVIRONMENT.Api().GetGlobalApi();
9100
+ }
8718
9101
  if (!accountId) {
8719
9102
  throw ("Client account ID is required.");
8720
9103
  }
@@ -8894,7 +9277,10 @@
8894
9277
  })(Navigator = ProjectViewBookmark.Navigator || (ProjectViewBookmark.Navigator = {}));
8895
9278
  function Get(params) {
8896
9279
  return __awaiter(this, void 0, void 0, function* () {
8897
- const { api, viewId, bookmarkId, req: reqParams } = params;
9280
+ let { api, viewId, bookmarkId, req: reqParams } = params;
9281
+ if (!api) {
9282
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
9283
+ }
8898
9284
  if (!viewId || !bookmarkId) {
8899
9285
  throw ("View ID and Bookmark ID are required.");
8900
9286
  }
@@ -8925,7 +9311,10 @@
8925
9311
  ProjectViewBookmark.Get = Get;
8926
9312
  function Delete(params) {
8927
9313
  return __awaiter(this, void 0, void 0, function* () {
8928
- const { api, viewId, bookmarkId, req: reqParams } = params;
9314
+ let { api, viewId, bookmarkId, req: reqParams } = params;
9315
+ if (!api) {
9316
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
9317
+ }
8929
9318
  if (!viewId || !bookmarkId) {
8930
9319
  throw ("View ID and Bookmark ID are required.");
8931
9320
  }
@@ -8937,7 +9326,10 @@
8937
9326
  ProjectViewBookmark.Delete = Delete;
8938
9327
  function GetList(params) {
8939
9328
  return __awaiter(this, void 0, void 0, function* () {
8940
- const { api, viewId, req: reqParams } = params;
9329
+ let { api, viewId, req: reqParams } = params;
9330
+ if (!api) {
9331
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
9332
+ }
8941
9333
  if (!viewId) {
8942
9334
  throw ("View ID is required.");
8943
9335
  }
@@ -8984,7 +9376,10 @@
8984
9376
  ProjectViewBookmark.GetList = GetList;
8985
9377
  function Update(params) {
8986
9378
  return __awaiter(this, void 0, void 0, function* () {
8987
- const { api, viewId, bookmark: data, req: reqParams } = params;
9379
+ let { api, viewId, bookmark: data, req: reqParams } = params;
9380
+ if (!api) {
9381
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
9382
+ }
8988
9383
  if (!(data === null || data === void 0 ? void 0 : data.Title)) {
8989
9384
  data.Title = data.ID;
8990
9385
  }
@@ -8999,7 +9394,10 @@
8999
9394
  ProjectViewBookmark.Update = Update;
9000
9395
  function SetOrder(params) {
9001
9396
  return __awaiter(this, void 0, void 0, function* () {
9002
- const { api, viewId, bookmarkIds, req: reqParams } = params;
9397
+ let { api, viewId, bookmarkIds, req: reqParams } = params;
9398
+ if (!api) {
9399
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
9400
+ }
9003
9401
  const reqData = {
9004
9402
  "UISlide.ID": bookmarkIds,
9005
9403
  "DisplayOrder.Start": 0
@@ -9033,7 +9431,10 @@
9033
9431
  })(Navigator = ProjectView.Navigator || (ProjectView.Navigator = {}));
9034
9432
  function Get(params) {
9035
9433
  return __awaiter(this, void 0, void 0, function* () {
9036
- const { api, viewId, req: reqParams } = params;
9434
+ let { api, viewId, req: reqParams } = params;
9435
+ if (!api) {
9436
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
9437
+ }
9037
9438
  if (!viewId) {
9038
9439
  throw ("View ID is required.");
9039
9440
  }
@@ -9064,7 +9465,10 @@
9064
9465
  ProjectView.Get = Get;
9065
9466
  function GetList(params) {
9066
9467
  return __awaiter(this, void 0, void 0, function* () {
9067
- const { api, req: reqParams } = params;
9468
+ let { api, req: reqParams } = params;
9469
+ if (!api) {
9470
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
9471
+ }
9068
9472
  const cache = yield api.GetCacheItem(GetListCacheKey(), reqParams);
9069
9473
  if (cache === null || cache === void 0 ? void 0 : cache.found) {
9070
9474
  return cache.data;
@@ -9091,7 +9495,10 @@
9091
9495
  ProjectView.GetList = GetList;
9092
9496
  function Delete(params) {
9093
9497
  return __awaiter(this, void 0, void 0, function* () {
9094
- const { api, viewId, req: reqParams } = params;
9498
+ let { api, viewId, req: reqParams } = params;
9499
+ if (!api) {
9500
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
9501
+ }
9095
9502
  if (!viewId) {
9096
9503
  throw ("View ID is required.");
9097
9504
  }
@@ -9104,6 +9511,9 @@
9104
9511
  function Update(params) {
9105
9512
  return __awaiter(this, void 0, void 0, function* () {
9106
9513
  let { api, view: data, req: reqParams } = params;
9514
+ if (!api) {
9515
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
9516
+ }
9107
9517
  if (!data) {
9108
9518
  data = {};
9109
9519
  }
@@ -9160,7 +9570,10 @@
9160
9570
  function MergeMapTemplateData(params) {
9161
9571
  var _a;
9162
9572
  return __awaiter(this, void 0, void 0, function* () {
9163
- const { getter, sources: items, addIfMissing, req: reqParams } = params;
9573
+ let { getter, sources: items, addIfMissing, req: reqParams } = params;
9574
+ if (!getter) {
9575
+ getter = exports.ENVIRONMENT.Api().GetBruceGetter();
9576
+ }
9164
9577
  const settings = yield getTemplateSettings(getter, reqParams);
9165
9578
  const maps = (_a = settings.CesiumMapSources) !== null && _a !== void 0 ? _a : [];
9166
9579
  for (let i = 0; i < maps.length; i++) {
@@ -9176,7 +9589,10 @@
9176
9589
  function MergeTerrainTemplateData(params) {
9177
9590
  var _a;
9178
9591
  return __awaiter(this, void 0, void 0, function* () {
9179
- const { getter, sources: items, addIfMissing, req: reqParams } = params;
9592
+ let { getter, sources: items, addIfMissing, req: reqParams } = params;
9593
+ if (!getter) {
9594
+ getter = exports.ENVIRONMENT.Api().GetBruceGetter();
9595
+ }
9180
9596
  const settings = yield getTemplateSettings(getter, reqParams);
9181
9597
  const terrains = (_a = settings.CesiumTerrainSources) !== null && _a !== void 0 ? _a : [];
9182
9598
  for (let i = 0; i < terrains.length; i++) {
@@ -9330,7 +9746,10 @@
9330
9746
  })(EMessageType = PendingAction.EMessageType || (PendingAction.EMessageType = {}));
9331
9747
  function Get(params) {
9332
9748
  return __awaiter(this, void 0, void 0, function* () {
9333
- const { api, actionId, req: reqParams } = params;
9749
+ let { api, actionId, req: reqParams } = params;
9750
+ if (!api) {
9751
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
9752
+ }
9334
9753
  if (!actionId) {
9335
9754
  throw ("Action ID is required.");
9336
9755
  }
@@ -9343,7 +9762,10 @@
9343
9762
  PendingAction.Get = Get;
9344
9763
  function GetRelevantList(params) {
9345
9764
  return __awaiter(this, void 0, void 0, function* () {
9346
- const { api, stricter, reqParams } = params;
9765
+ let { api, stricter, reqParams } = params;
9766
+ if (!api) {
9767
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
9768
+ }
9347
9769
  const data = yield api.GET(`pendingActions/important?Update=${Boolean(stricter)}`, exports.Api.PrepReqParams(reqParams));
9348
9770
  return {
9349
9771
  actions: data.Items
@@ -9354,6 +9776,9 @@
9354
9776
  function GetMessages(params) {
9355
9777
  return __awaiter(this, void 0, void 0, function* () {
9356
9778
  let { api, actionId, order, startIndex, amount, req: reqParams, types } = params;
9779
+ if (!api) {
9780
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
9781
+ }
9357
9782
  if (amount == null) {
9358
9783
  amount = 500;
9359
9784
  }
@@ -9400,7 +9825,10 @@
9400
9825
  })(EPointType = Style.EPointType || (Style.EPointType = {}));
9401
9826
  function GetList(params) {
9402
9827
  return __awaiter(this, void 0, void 0, function* () {
9403
- const { api, req: reqParams } = params;
9828
+ let { api, req: reqParams } = params;
9829
+ if (!api) {
9830
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
9831
+ }
9404
9832
  const cache = yield api.GetCacheItem(GetListCacheKey(), reqParams);
9405
9833
  if (cache === null || cache === void 0 ? void 0 : cache.found) {
9406
9834
  return cache.data;
@@ -9427,7 +9855,10 @@
9427
9855
  Style.GetList = GetList;
9428
9856
  function Get(params) {
9429
9857
  return __awaiter(this, void 0, void 0, function* () {
9430
- const { api, styleId: id, req: reqParams } = params;
9858
+ let { api, styleId: id, req: reqParams } = params;
9859
+ if (!api) {
9860
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
9861
+ }
9431
9862
  if (!id) {
9432
9863
  throw ("Style ID is required.");
9433
9864
  }
@@ -9457,7 +9888,10 @@
9457
9888
  Style.Get = Get;
9458
9889
  function Update(params) {
9459
9890
  return __awaiter(this, void 0, void 0, function* () {
9460
- const { api, style: data, req: reqParams } = params;
9891
+ let { api, style: data, req: reqParams } = params;
9892
+ if (!api) {
9893
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
9894
+ }
9461
9895
  if (!(data === null || data === void 0 ? void 0 : data.Name)) {
9462
9896
  throw ("Style name is required.");
9463
9897
  }
@@ -9475,7 +9909,10 @@
9475
9909
  Style.Update = Update;
9476
9910
  function Delete(params) {
9477
9911
  return __awaiter(this, void 0, void 0, function* () {
9478
- const { api, styleId: id, req: reqParams } = params;
9912
+ let { api, styleId: id, req: reqParams } = params;
9913
+ if (!api) {
9914
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
9915
+ }
9479
9916
  if (!id) {
9480
9917
  throw ("Style ID is required.");
9481
9918
  }
@@ -9510,7 +9947,10 @@
9510
9947
  }
9511
9948
  function Get(params) {
9512
9949
  return __awaiter(this, void 0, void 0, function* () {
9513
- const { api, sessionId, req: reqParams } = params;
9950
+ let { api, sessionId, req: reqParams } = params;
9951
+ if (!api) {
9952
+ api = exports.ENVIRONMENT.Api().GetGuardianApi();
9953
+ }
9514
9954
  if (!sessionId) {
9515
9955
  throw ("Session ID is required.");
9516
9956
  }
@@ -9548,7 +9988,10 @@
9548
9988
  */
9549
9989
  function Login(params) {
9550
9990
  return __awaiter(this, void 0, void 0, function* () {
9551
- const { api, username, password, accountId, req: reqParams } = params;
9991
+ let { api, username, password, accountId, req: reqParams } = params;
9992
+ if (!api) {
9993
+ api = exports.ENVIRONMENT.Api().GetGuardianApi();
9994
+ }
9552
9995
  const data = yield api.POST("login", {
9553
9996
  account: accountId ? accountId : "",
9554
9997
  login: username,
@@ -9566,7 +10009,10 @@
9566
10009
  Session.Login = Login;
9567
10010
  function Logout(params) {
9568
10011
  return __awaiter(this, void 0, void 0, function* () {
9569
- const { api, req: reqParams } = params;
10012
+ let { api, req: reqParams } = params;
10013
+ if (!api) {
10014
+ api = exports.ENVIRONMENT.Api().GetGuardianApi();
10015
+ }
9570
10016
  const ssid = api.GetSessionId();
9571
10017
  if (ssid) {
9572
10018
  yield api.POST("logout", null, reqParams);
@@ -9633,7 +10079,10 @@
9633
10079
  (function (UserGroup) {
9634
10080
  function GetByName(params) {
9635
10081
  return __awaiter(this, void 0, void 0, function* () {
9636
- const { api, accountId, name, req: reqParams } = params;
10082
+ let { api, accountId, name, req: reqParams } = params;
10083
+ if (!api) {
10084
+ api = exports.ENVIRONMENT.Api().GetGuardianApi();
10085
+ }
9637
10086
  if (!name || !accountId) {
9638
10087
  throw ("Name and AccountID are required.");
9639
10088
  }
@@ -9646,7 +10095,10 @@
9646
10095
  UserGroup.GetByName = GetByName;
9647
10096
  function GetUsers(params) {
9648
10097
  return __awaiter(this, void 0, void 0, function* () {
9649
- const { api, accountId, groupId: id, req: reqParams } = params;
10098
+ let { api, accountId, groupId: id, req: reqParams } = params;
10099
+ if (!api) {
10100
+ api = exports.ENVIRONMENT.Api().GetGuardianApi();
10101
+ }
9650
10102
  if (!accountId || !id) {
9651
10103
  throw ("AccountID and ID are required.");
9652
10104
  }
@@ -9659,7 +10111,10 @@
9659
10111
  UserGroup.GetUsers = GetUsers;
9660
10112
  function GetListByPerm(params) {
9661
10113
  return __awaiter(this, void 0, void 0, function* () {
9662
- const { api, accountId, perm, req: reqParams } = params;
10114
+ let { api, accountId, perm, req: reqParams } = params;
10115
+ if (!api) {
10116
+ api = exports.ENVIRONMENT.Api().GetGuardianApi();
10117
+ }
9663
10118
  if (!accountId || !perm) {
9664
10119
  throw ("AccountID and Perm are required.");
9665
10120
  }
@@ -9672,7 +10127,10 @@
9672
10127
  UserGroup.GetListByPerm = GetListByPerm;
9673
10128
  function GetList(params) {
9674
10129
  return __awaiter(this, void 0, void 0, function* () {
9675
- const { api, accountId, req: reqParams } = params;
10130
+ let { api, accountId, req: reqParams } = params;
10131
+ if (!api) {
10132
+ api = exports.ENVIRONMENT.Api().GetGuardianApi();
10133
+ }
9676
10134
  if (!accountId) {
9677
10135
  throw ("AccountID is required.");
9678
10136
  }
@@ -9685,7 +10143,10 @@
9685
10143
  UserGroup.GetList = GetList;
9686
10144
  function Delete(params) {
9687
10145
  return __awaiter(this, void 0, void 0, function* () {
9688
- const { api, accountId, groupId: id, req: reqParams } = params;
10146
+ let { api, accountId, groupId: id, req: reqParams } = params;
10147
+ if (!api) {
10148
+ api = exports.ENVIRONMENT.Api().GetGuardianApi();
10149
+ }
9689
10150
  if (!accountId || !id) {
9690
10151
  throw ("AccountID and ID are required.");
9691
10152
  }
@@ -9695,7 +10156,10 @@
9695
10156
  UserGroup.Delete = Delete;
9696
10157
  function Update(params) {
9697
10158
  return __awaiter(this, void 0, void 0, function* () {
9698
- const { api, group: data, reqParams } = params;
10159
+ let { api, group: data, reqParams } = params;
10160
+ if (!api) {
10161
+ api = exports.ENVIRONMENT.Api().GetGuardianApi();
10162
+ }
9699
10163
  if (!data.Name || !data["ClientAccount.ID"]) {
9700
10164
  throw ("User group name and client account ID are required.");
9701
10165
  }
@@ -9734,7 +10198,10 @@
9734
10198
  })(EType = User.EType || (User.EType = {}));
9735
10199
  function Get(params) {
9736
10200
  return __awaiter(this, void 0, void 0, function* () {
9737
- const { api, userId: id, accountId, req: reqParams } = params;
10201
+ let { api, userId: id, accountId, req: reqParams } = params;
10202
+ if (!api) {
10203
+ api = exports.ENVIRONMENT.Api().GetGuardianApi();
10204
+ }
9738
10205
  if (!id) {
9739
10206
  throw ("ID is required.");
9740
10207
  }
@@ -9765,7 +10232,10 @@
9765
10232
  function Update(params) {
9766
10233
  var _a;
9767
10234
  return __awaiter(this, void 0, void 0, function* () {
9768
- const { api, user: data, req: reqParams } = params;
10235
+ let { api, user: data, req: reqParams } = params;
10236
+ if (!api) {
10237
+ api = exports.ENVIRONMENT.Api().GetGuardianApi();
10238
+ }
9769
10239
  if (!(data === null || data === void 0 ? void 0 : data.ID) || !(data === null || data === void 0 ? void 0 : data.Type)) {
9770
10240
  throw ("ID and Type are required.");
9771
10241
  }
@@ -9803,7 +10273,10 @@
9803
10273
  */
9804
10274
  function GetSettings(params) {
9805
10275
  return __awaiter(this, void 0, void 0, function* () {
9806
- const { api, userId, appId, req } = params;
10276
+ let { api, userId, appId, req } = params;
10277
+ if (!api) {
10278
+ api = exports.ENVIRONMENT.Api().GetGuardianApi();
10279
+ }
9807
10280
  if (!userId || !appId) {
9808
10281
  throw ("UserId and appId are required.");
9809
10282
  }
@@ -9850,7 +10323,10 @@
9850
10323
  */
9851
10324
  function UpdateSettings(params) {
9852
10325
  return __awaiter(this, void 0, void 0, function* () {
9853
- const { api, accId, userId, appId, settings, req } = params;
10326
+ let { api, accId, userId, appId, settings, req } = params;
10327
+ if (!api) {
10328
+ api = exports.ENVIRONMENT.Api().GetGuardianApi();
10329
+ }
9854
10330
  if (!userId || !appId) {
9855
10331
  throw ("UserId and appId are required.");
9856
10332
  }
@@ -9868,7 +10344,10 @@
9868
10344
  User.UpdateSettings = UpdateSettings;
9869
10345
  function GetUsernameAvailable(params) {
9870
10346
  return __awaiter(this, void 0, void 0, function* () {
9871
- const { api, username, excludeUserId, req: reqParams } = params;
10347
+ let { api, username, excludeUserId, req: reqParams } = params;
10348
+ if (!api) {
10349
+ api = exports.ENVIRONMENT.Api().GetGuardianApi();
10350
+ }
9872
10351
  if (!username) {
9873
10352
  throw ("Username is required.");
9874
10353
  }
@@ -9896,7 +10375,10 @@
9896
10375
  LoginUser.GetListCacheKey = GetListCacheKey;
9897
10376
  function GetByEmail(params) {
9898
10377
  return __awaiter(this, void 0, void 0, function* () {
9899
- const { api, email, accountId, req: reqParams } = params;
10378
+ let { api, email, accountId, req: reqParams } = params;
10379
+ if (!api) {
10380
+ api = exports.ENVIRONMENT.Api().GetGuardianApi();
10381
+ }
9900
10382
  if (!email) {
9901
10383
  throw ("Email is required.");
9902
10384
  }
@@ -9927,6 +10409,9 @@
9927
10409
  function GetList(params) {
9928
10410
  return __awaiter(this, void 0, void 0, function* () {
9929
10411
  let { api, accountId, exclusive, req: reqParams } = params;
10412
+ if (!api) {
10413
+ api = exports.ENVIRONMENT.Api().GetGuardianApi();
10414
+ }
9930
10415
  if (!accountId) {
9931
10416
  throw ("Client account ID is required.");
9932
10417
  }
@@ -9978,7 +10463,10 @@
9978
10463
  */
9979
10464
  function Signup(params) {
9980
10465
  return __awaiter(this, void 0, void 0, function* () {
9981
- const { api, email, req: reqParams } = params;
10466
+ let { api, email, req: reqParams } = params;
10467
+ if (!api) {
10468
+ api = exports.ENVIRONMENT.Api().GetGuardianApi();
10469
+ }
9982
10470
  if (!email) {
9983
10471
  throw ("Email is required.");
9984
10472
  }
@@ -9995,7 +10483,10 @@
9995
10483
  */
9996
10484
  function SignupResend(params) {
9997
10485
  return __awaiter(this, void 0, void 0, function* () {
9998
- const { api, expiredCode, req: reqParams } = params;
10486
+ let { api, expiredCode, req: reqParams } = params;
10487
+ if (!api) {
10488
+ api = exports.ENVIRONMENT.Api().GetGuardianApi();
10489
+ }
9999
10490
  if (!expiredCode) {
10000
10491
  throw ("Expired activation code is required.");
10001
10492
  }
@@ -10011,6 +10502,9 @@
10011
10502
  function SignupComplete(params) {
10012
10503
  return __awaiter(this, void 0, void 0, function* () {
10013
10504
  let { api, code, user: data, accountId, req: reqParams } = params;
10505
+ if (!api) {
10506
+ api = exports.ENVIRONMENT.Api().GetGuardianApi();
10507
+ }
10014
10508
  if (!code || !(data === null || data === void 0 ? void 0 : data.Login) || !(data === null || data === void 0 ? void 0 : data.Password)) {
10015
10509
  throw ("Login, password, and activation code are required.");
10016
10510
  }
@@ -10036,7 +10530,10 @@
10036
10530
  */
10037
10531
  function ForgotPassword(params) {
10038
10532
  return __awaiter(this, void 0, void 0, function* () {
10039
- const { api, accountId, email, req: reqParams } = params;
10533
+ let { api, accountId, email, req: reqParams } = params;
10534
+ if (!api) {
10535
+ api = exports.ENVIRONMENT.Api().GetGuardianApi();
10536
+ }
10040
10537
  if (!accountId || !email) {
10041
10538
  throw ("Account ID and email are required.");
10042
10539
  }
@@ -10065,7 +10562,10 @@
10065
10562
  */
10066
10563
  function ForgotPasswordComplete(params) {
10067
10564
  return __awaiter(this, void 0, void 0, function* () {
10068
- const { api, code, userId, password, req: reqParams } = params;
10565
+ let { api, code, userId, password, req: reqParams } = params;
10566
+ if (!api) {
10567
+ api = exports.ENVIRONMENT.Api().GetGuardianApi();
10568
+ }
10069
10569
  const { user } = yield Get({
10070
10570
  api: api,
10071
10571
  userId: userId,
@@ -10094,7 +10594,10 @@
10094
10594
  AccessToken.GetListCacheKey = GetListCacheKey;
10095
10595
  function GetList(params) {
10096
10596
  return __awaiter(this, void 0, void 0, function* () {
10097
- const { api, accountId, req: reqParams } = params;
10597
+ let { api, accountId, req: reqParams } = params;
10598
+ if (!api) {
10599
+ api = exports.ENVIRONMENT.Api().GetGuardianApi();
10600
+ }
10098
10601
  const cache = yield api.GetCacheItem(GetListCacheKey(accountId), reqParams);
10099
10602
  if (cache === null || cache === void 0 ? void 0 : cache.found) {
10100
10603
  return cache.data;
@@ -10133,7 +10636,10 @@
10133
10636
  AccessToken.GetList = GetList;
10134
10637
  function Delete(params) {
10135
10638
  return __awaiter(this, void 0, void 0, function* () {
10136
- const { api, tokenId: id, req: reqParams } = params;
10639
+ let { api, tokenId: id, req: reqParams } = params;
10640
+ if (!api) {
10641
+ api = exports.ENVIRONMENT.Api().GetGuardianApi();
10642
+ }
10137
10643
  yield api.DELETE(`accessToken/${id}`, reqParams);
10138
10644
  api.Cache.RemoveByContains(exports.Api.ECacheKey.User + exports.Api.ECacheKey.Id + id);
10139
10645
  yield api.Cache.RemoveByStartsWith(exports.Api.ECacheKey.AccessToken + exports.Api.ECacheKey.Account);
@@ -10143,6 +10649,9 @@
10143
10649
  function Create(params) {
10144
10650
  return __awaiter(this, void 0, void 0, function* () {
10145
10651
  let { api, token: data, req: reqParams } = params;
10652
+ if (!api) {
10653
+ api = exports.ENVIRONMENT.Api().GetGuardianApi();
10654
+ }
10146
10655
  if (!data) {
10147
10656
  data = {};
10148
10657
  }
@@ -10180,7 +10689,10 @@
10180
10689
  })(EInviteMethod = AccountInvite.EInviteMethod || (AccountInvite.EInviteMethod = {}));
10181
10690
  function GetByCode(params) {
10182
10691
  return __awaiter(this, void 0, void 0, function* () {
10183
- const { api, code, req } = params;
10692
+ let { api, code, req } = params;
10693
+ if (!api) {
10694
+ api = exports.ENVIRONMENT.Api().GetGuardianApi();
10695
+ }
10184
10696
  const res = yield api.GET(`invite/code?inviteCode=${code}`, exports.Api.PrepReqParams(req));
10185
10697
  return res;
10186
10698
  });
@@ -10188,7 +10700,10 @@
10188
10700
  AccountInvite.GetByCode = GetByCode;
10189
10701
  function GetList(params) {
10190
10702
  return __awaiter(this, void 0, void 0, function* () {
10191
- const { api, accountId, userId, req } = params;
10703
+ let { api, accountId, userId, req } = params;
10704
+ if (!api) {
10705
+ api = exports.ENVIRONMENT.Api().GetGuardianApi();
10706
+ }
10192
10707
  const urlParams = new URLSearchParams();
10193
10708
  if (accountId) {
10194
10709
  urlParams.append("accountId", accountId);
@@ -10203,7 +10718,10 @@
10203
10718
  AccountInvite.GetList = GetList;
10204
10719
  function Update(params) {
10205
10720
  return __awaiter(this, void 0, void 0, function* () {
10206
- const { api, code, status, user, req } = params;
10721
+ let { api, code, status, user, req } = params;
10722
+ if (!api) {
10723
+ api = exports.ENVIRONMENT.Api().GetGuardianApi();
10724
+ }
10207
10725
  const res = yield api.POST("invite/update", {
10208
10726
  InviteCode: code,
10209
10727
  Status: status,
@@ -10215,7 +10733,10 @@
10215
10733
  AccountInvite.Update = Update;
10216
10734
  function Create(params) {
10217
10735
  return __awaiter(this, void 0, void 0, function* () {
10218
- const { api, accountId, login, userId, email, mobile, emailTemplateKey, groupIds, req } = params;
10736
+ let { api, accountId, login, userId, email, mobile, emailTemplateKey, groupIds, req } = params;
10737
+ if (!api) {
10738
+ api = exports.ENVIRONMENT.Api().GetGuardianApi();
10739
+ }
10219
10740
  const res = yield api.POST("invite/new", {
10220
10741
  accountId,
10221
10742
  login,
@@ -10347,6 +10868,9 @@
10347
10868
  function Run(params) {
10348
10869
  return __awaiter(this, void 0, void 0, function* () {
10349
10870
  let { api, query, key, skip, load, req: reqParams } = params;
10871
+ if (!api) {
10872
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
10873
+ }
10350
10874
  if (!key) {
10351
10875
  key = EReqKey.Primary;
10352
10876
  }
@@ -10377,14 +10901,20 @@
10377
10901
  (function (ImportCad) {
10378
10902
  function Analyze(params) {
10379
10903
  return __awaiter(this, void 0, void 0, function* () {
10380
- const { api, fileAnalyze, req: reqParams } = params;
10904
+ let { api, fileAnalyze, req: reqParams } = params;
10905
+ if (!api) {
10906
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
10907
+ }
10381
10908
  return api.POST("entities/PrepareIFCForImport", fileAnalyze, exports.Api.PrepReqParams(reqParams));
10382
10909
  });
10383
10910
  }
10384
10911
  ImportCad.Analyze = Analyze;
10385
10912
  function ImportEntities(params) {
10386
10913
  return __awaiter(this, void 0, void 0, function* () {
10387
- const { api, fileImport, req: reqParams } = params;
10914
+ let { api, fileImport, req: reqParams } = params;
10915
+ if (!api) {
10916
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
10917
+ }
10388
10918
  return api.POST("entities/importIFCWithProgress", fileImport, exports.Api.PrepReqParams(reqParams));
10389
10919
  });
10390
10920
  }
@@ -10413,7 +10943,10 @@
10413
10943
  (function (ImportCsv) {
10414
10944
  function ImportEntities(params) {
10415
10945
  return __awaiter(this, void 0, void 0, function* () {
10416
- const { api, fileImport, req: reqParams } = params;
10946
+ let { api, fileImport, req: reqParams } = params;
10947
+ if (!api) {
10948
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
10949
+ }
10417
10950
  return api.POST("entities/importCSVWithProgress2", fileImport, exports.Api.PrepReqParams(reqParams));
10418
10951
  });
10419
10952
  }
@@ -10423,7 +10956,10 @@
10423
10956
  (function (ImportJson) {
10424
10957
  function ImportEntities(params) {
10425
10958
  return __awaiter(this, void 0, void 0, function* () {
10426
- const { api, fileImport, req: reqParams } = params;
10959
+ let { api, fileImport, req: reqParams } = params;
10960
+ if (!api) {
10961
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
10962
+ }
10427
10963
  return api.POST("entities/importJsonWithProgress", fileImport, exports.Api.PrepReqParams(reqParams));
10428
10964
  });
10429
10965
  }
@@ -10433,7 +10969,10 @@
10433
10969
  (function (ImportKml) {
10434
10970
  function ImportEntities(params) {
10435
10971
  return __awaiter(this, void 0, void 0, function* () {
10436
- const { api, fileImport, req: reqParams } = params;
10972
+ let { api, fileImport, req: reqParams } = params;
10973
+ if (!api) {
10974
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
10975
+ }
10437
10976
  return api.POST("entities/importKMLWithProgress2", fileImport, exports.Api.PrepReqParams(reqParams));
10438
10977
  });
10439
10978
  }
@@ -10461,6 +11000,9 @@
10461
11000
  function GetList(params) {
10462
11001
  return __awaiter(this, void 0, void 0, function* () {
10463
11002
  let { api, fileType: type, pageIndex, req: reqParams } = params;
11003
+ if (!api) {
11004
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
11005
+ }
10464
11006
  if (!type) {
10465
11007
  type = EFileType.All;
10466
11008
  }
@@ -10503,7 +11045,10 @@
10503
11045
  ImportedFile.GetList = GetList;
10504
11046
  function GetListByRootId(params) {
10505
11047
  return __awaiter(this, void 0, void 0, function* () {
10506
- const { api, rootId, req: reqParams } = params;
11048
+ let { api, rootId, req: reqParams } = params;
11049
+ if (!api) {
11050
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
11051
+ }
10507
11052
  const cache = yield api.GetCacheItem(GetCacheKeyByRootId(rootId), reqParams);
10508
11053
  if (cache === null || cache === void 0 ? void 0 : cache.found) {
10509
11054
  return cache.data;
@@ -10530,7 +11075,10 @@
10530
11075
  ImportedFile.GetListByRootId = GetListByRootId;
10531
11076
  function Get(params) {
10532
11077
  return __awaiter(this, void 0, void 0, function* () {
10533
- const { api, importedFileId: fileId, req: reqParams } = params;
11078
+ let { api, importedFileId: fileId, req: reqParams } = params;
11079
+ if (!api) {
11080
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
11081
+ }
10534
11082
  const cache = yield api.GetCacheItem(GetCacheKey(fileId), reqParams);
10535
11083
  if (cache === null || cache === void 0 ? void 0 : cache.found) {
10536
11084
  return cache.data;
@@ -10750,7 +11298,10 @@
10750
11298
  Plugin.GetListCacheKey = GetListCacheKey;
10751
11299
  function Get(params) {
10752
11300
  return __awaiter(this, void 0, void 0, function* () {
10753
- const { api, pluginId, req } = params;
11301
+ let { api, pluginId, req } = params;
11302
+ if (!api) {
11303
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
11304
+ }
10754
11305
  if (!pluginId) {
10755
11306
  throw ("Plugin ID is required.");
10756
11307
  }
@@ -10780,7 +11331,10 @@
10780
11331
  Plugin.Get = Get;
10781
11332
  function GetList(params) {
10782
11333
  return __awaiter(this, void 0, void 0, function* () {
10783
- const { api, req } = params;
11334
+ let { api, req } = params;
11335
+ if (!api) {
11336
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
11337
+ }
10784
11338
  const cache = yield api.GetCacheItem(GetListCacheKey(), req);
10785
11339
  if (cache === null || cache === void 0 ? void 0 : cache.found) {
10786
11340
  return cache.data;
@@ -10807,6 +11361,9 @@
10807
11361
  Plugin.GetList = GetList;
10808
11362
  function GetLoadUrl(params) {
10809
11363
  let { api, pluginId, req, cacheKey } = params;
11364
+ if (!api) {
11365
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
11366
+ }
10810
11367
  if (!cacheKey) {
10811
11368
  cacheKey = 0;
10812
11369
  }