bruce-models 2.4.5 → 2.4.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bruce-models.es5.js +975 -402
- package/dist/bruce-models.es5.js.map +1 -1
- package/dist/bruce-models.umd.js +957 -385
- package/dist/bruce-models.umd.js.map +1 -1
- package/dist/lib/account/account-invite.js +17 -4
- package/dist/lib/account/account-invite.js.map +1 -1
- package/dist/lib/account/account.js +20 -4
- package/dist/lib/account/account.js.map +1 -1
- package/dist/lib/ann-document/ann-document.js +8 -1
- package/dist/lib/ann-document/ann-document.js.map +1 -1
- package/dist/lib/api/api-getters.js +34 -0
- package/dist/lib/api/api-getters.js.map +1 -1
- package/dist/lib/api/bruce-api.js.map +1 -1
- package/dist/lib/bruce-models.js +1 -0
- package/dist/lib/bruce-models.js.map +1 -1
- package/dist/lib/client-file/client-file.js +34 -6
- package/dist/lib/client-file/client-file.js.map +1 -1
- package/dist/lib/custom-form/custom-form.js +17 -4
- package/dist/lib/custom-form/custom-form.js.map +1 -1
- package/dist/lib/data-lab/data-lab.js +4 -0
- package/dist/lib/data-lab/data-lab.js.map +1 -1
- package/dist/lib/entity/entity-attachment-type.js +13 -3
- package/dist/lib/entity/entity-attachment-type.js.map +1 -1
- package/dist/lib/entity/entity-attachment.js +21 -5
- package/dist/lib/entity/entity-attachment.js.map +1 -1
- package/dist/lib/entity/entity-comment.js +13 -3
- package/dist/lib/entity/entity-comment.js.map +1 -1
- package/dist/lib/entity/entity-coords.js +21 -5
- package/dist/lib/entity/entity-coords.js.map +1 -1
- package/dist/lib/entity/entity-link.js +13 -3
- package/dist/lib/entity/entity-link.js.map +1 -1
- package/dist/lib/entity/entity-lod-category.js +17 -4
- package/dist/lib/entity/entity-lod-category.js.map +1 -1
- package/dist/lib/entity/entity-lod.js +26 -4
- package/dist/lib/entity/entity-lod.js.map +1 -1
- package/dist/lib/entity/entity-relation-type.js +17 -4
- package/dist/lib/entity/entity-relation-type.js.map +1 -1
- package/dist/lib/entity/entity-relation.js +20 -4
- package/dist/lib/entity/entity-relation.js.map +1 -1
- package/dist/lib/entity/entity-source.js +19 -6
- package/dist/lib/entity/entity-source.js.map +1 -1
- package/dist/lib/entity/entity-tag.js +21 -5
- package/dist/lib/entity/entity-tag.js.map +1 -1
- package/dist/lib/entity/entity-type.js +16 -3
- package/dist/lib/entity/entity-type.js.map +1 -1
- package/dist/lib/entity/entity.js +25 -6
- package/dist/lib/entity/entity.js.map +1 -1
- package/dist/lib/environment.js +55 -0
- package/dist/lib/environment.js.map +1 -0
- package/dist/lib/import/import-cad.js +9 -2
- package/dist/lib/import/import-cad.js.map +1 -1
- package/dist/lib/import/import-csv.js +5 -1
- package/dist/lib/import/import-csv.js.map +1 -1
- package/dist/lib/import/import-json.js +5 -1
- package/dist/lib/import/import-json.js.map +1 -1
- package/dist/lib/import/import-kml.js +5 -1
- package/dist/lib/import/import-kml.js.map +1 -1
- package/dist/lib/import/imported-file.js +12 -2
- package/dist/lib/import/imported-file.js.map +1 -1
- package/dist/lib/internal/uploader.js +5 -1
- package/dist/lib/internal/uploader.js.map +1 -1
- package/dist/lib/plugin/plugin.js +12 -2
- package/dist/lib/plugin/plugin.js.map +1 -1
- package/dist/lib/program-key/program-key.js +17 -4
- package/dist/lib/program-key/program-key.js.map +1 -1
- package/dist/lib/project/project-view-bookmark.js +21 -5
- package/dist/lib/project/project-view-bookmark.js.map +1 -1
- package/dist/lib/project/project-view-legacy-tile.js +9 -2
- package/dist/lib/project/project-view-legacy-tile.js.map +1 -1
- package/dist/lib/project/project-view.js +16 -3
- package/dist/lib/project/project-view.js.map +1 -1
- package/dist/lib/server/hosting-location.js +22 -5
- package/dist/lib/server/hosting-location.js.map +1 -1
- package/dist/lib/server/pending-action.js +12 -2
- package/dist/lib/server/pending-action.js.map +1 -1
- package/dist/lib/server/task.js +9 -2
- package/dist/lib/server/task.js.map +1 -1
- package/dist/lib/style/style.js +17 -4
- package/dist/lib/style/style.js.map +1 -1
- package/dist/lib/tileset/tileset.js +61 -10
- package/dist/lib/tileset/tileset.js.map +1 -1
- package/dist/lib/user/session.js +13 -3
- package/dist/lib/user/session.js.map +1 -1
- package/dist/lib/user/user-group.js +25 -6
- package/dist/lib/user/user-group.js.map +1 -1
- package/dist/lib/user/user.js +58 -12
- package/dist/lib/user/user.js.map +1 -1
- package/dist/types/account/account-invite.d.ts +5 -4
- package/dist/types/account/account.d.ts +5 -5
- package/dist/types/ann-document/ann-document.d.ts +3 -3
- package/dist/types/api/api-getters.d.ts +6 -5
- package/dist/types/api/bruce-api.d.ts +1 -1
- package/dist/types/bruce-models.d.ts +1 -0
- package/dist/types/client-file/client-file.d.ts +10 -10
- package/dist/types/custom-form/custom-form.d.ts +4 -4
- package/dist/types/data-lab/data-lab.d.ts +1 -1
- package/dist/types/entity/entity-attachment-type.d.ts +3 -3
- package/dist/types/entity/entity-attachment.d.ts +6 -6
- package/dist/types/entity/entity-comment.d.ts +5 -4
- package/dist/types/entity/entity-coords.d.ts +5 -5
- package/dist/types/entity/entity-link.d.ts +4 -4
- package/dist/types/entity/entity-lod-category.d.ts +4 -4
- package/dist/types/entity/entity-lod.d.ts +7 -7
- package/dist/types/entity/entity-relation-type.d.ts +4 -4
- package/dist/types/entity/entity-relation.d.ts +5 -5
- package/dist/types/entity/entity-source.d.ts +6 -5
- package/dist/types/entity/entity-tag.d.ts +5 -5
- package/dist/types/entity/entity-type.d.ts +4 -4
- package/dist/types/entity/entity.d.ts +6 -6
- package/dist/types/environment.d.ts +16 -0
- package/dist/types/import/import-cad.d.ts +2 -2
- package/dist/types/import/import-csv.d.ts +1 -1
- package/dist/types/import/import-json.d.ts +1 -1
- package/dist/types/import/import-kml.d.ts +1 -1
- package/dist/types/import/imported-file.d.ts +3 -3
- package/dist/types/internal/uploader.d.ts +1 -1
- package/dist/types/plugin/plugin.d.ts +3 -3
- package/dist/types/program-key/program-key.d.ts +4 -4
- package/dist/types/project/project-view-bookmark.d.ts +7 -6
- package/dist/types/project/project-view-legacy-tile.d.ts +2 -2
- package/dist/types/project/project-view.d.ts +4 -4
- package/dist/types/server/hosting-location.d.ts +5 -5
- package/dist/types/server/pending-action.d.ts +5 -4
- package/dist/types/server/task.d.ts +4 -3
- package/dist/types/style/style.d.ts +6 -5
- package/dist/types/tileset/tileset.d.ts +18 -17
- package/dist/types/user/session.d.ts +4 -3
- package/dist/types/user/user-group.d.ts +10 -7
- package/dist/types/user/user.d.ts +16 -15
- package/package.json +1 -1
package/dist/bruce-models.umd.js
CHANGED
|
@@ -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
|
-
|
|
3607
|
+
let { api, accountId: id, req: reqParams } = params;
|
|
3608
|
+
if (!api) {
|
|
3609
|
+
api = exports.ENVIRONMENT.GetGetters().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
|
-
|
|
3630
|
+
let { api, req: reqParams } = params;
|
|
3631
|
+
if (!api) {
|
|
3632
|
+
api = exports.ENVIRONMENT.GetGetters().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
|
-
|
|
3662
|
+
let { api, accountId: id, appId, req: reqParams } = params;
|
|
3663
|
+
if (!api) {
|
|
3664
|
+
api = exports.ENVIRONMENT.GetGetters().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
|
-
|
|
3700
|
+
let { api, accountId: id, appId, settings: data, req: reqParams } = params;
|
|
3701
|
+
if (!api) {
|
|
3702
|
+
api = exports.ENVIRONMENT.GetGetters().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.GetGetters().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
|
-
|
|
3753
|
+
let { api, req } = params;
|
|
3754
|
+
if (!api) {
|
|
3755
|
+
api = exports.ENVIRONMENT.GetGetters().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
|
-
|
|
3766
|
+
let { id, api, req } = params;
|
|
3767
|
+
if (!api) {
|
|
3768
|
+
api = exports.ENVIRONMENT.GetGetters().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
|
-
|
|
3782
|
+
let { key, api, req } = params;
|
|
3783
|
+
if (!api) {
|
|
3784
|
+
api = exports.ENVIRONMENT.GetGetters().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
|
-
|
|
3842
|
+
let { accountId, apiSettings, api, req } = params;
|
|
3843
|
+
if (!api) {
|
|
3844
|
+
api = exports.ENVIRONMENT.GetGetters().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
|
-
|
|
3875
|
+
let { accountId, apiSettings, api, req } = params;
|
|
3876
|
+
if (!api) {
|
|
3877
|
+
api = exports.ENVIRONMENT.GetGetters().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 (
|
|
4177
|
+
(function (GlobalApi) {
|
|
4344
4178
|
/**
|
|
4345
|
-
* This is the request handler for
|
|
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: "
|
|
4352
|
-
cacheId: `
|
|
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
|
|
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
|
-
|
|
4364
|
-
url += "-dev.net/";
|
|
4196
|
+
url = "https://bruceglobal.nextspace-dev.net/";
|
|
4365
4197
|
break;
|
|
4366
4198
|
case exports.Api.EEnv.STG:
|
|
4367
|
-
|
|
4368
|
-
url += "-stg.net/";
|
|
4199
|
+
url = "https://bruceglobal.nextspace-stg.net/";
|
|
4369
4200
|
break;
|
|
4370
4201
|
case exports.Api.EEnv.UAT:
|
|
4371
|
-
|
|
4372
|
-
url += "-uat.net/";
|
|
4202
|
+
url = "https://bruceglobal.api.nextspace-uat.net/";
|
|
4373
4203
|
break;
|
|
4374
4204
|
case exports.Api.EEnv.PROD:
|
|
4375
|
-
url
|
|
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
|
-
|
|
4414
|
-
})(exports.
|
|
4242
|
+
GlobalApi.Api = Api$$1;
|
|
4243
|
+
})(exports.GlobalApi || (exports.GlobalApi = {}));
|
|
4415
4244
|
|
|
4416
|
-
(function (
|
|
4245
|
+
(function (IdmApi) {
|
|
4417
4246
|
/**
|
|
4418
|
-
* This is the request handler for
|
|
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: "
|
|
4425
|
-
cacheId: `
|
|
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
|
|
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
|
-
|
|
4265
|
+
codeWord = "guardian";
|
|
4266
|
+
url += "-dev.net/";
|
|
4436
4267
|
break;
|
|
4437
4268
|
case exports.Api.EEnv.STG:
|
|
4438
|
-
|
|
4269
|
+
codeWord = "guardian";
|
|
4270
|
+
url += "-stg.net/";
|
|
4439
4271
|
break;
|
|
4440
4272
|
case exports.Api.EEnv.UAT:
|
|
4441
|
-
|
|
4273
|
+
codeWord = "guardian";
|
|
4274
|
+
url += "-uat.net/";
|
|
4442
4275
|
break;
|
|
4443
4276
|
case exports.Api.EEnv.PROD:
|
|
4444
|
-
url
|
|
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
|
-
|
|
4482
|
-
})(exports.
|
|
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,11 +4370,15 @@
|
|
|
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;
|
|
4524
4377
|
}
|
|
4525
4378
|
GetBruceApi(params) {
|
|
4379
|
+
if (!params) {
|
|
4380
|
+
params = {};
|
|
4381
|
+
}
|
|
4526
4382
|
let { accountId, env } = params;
|
|
4527
4383
|
accountId = accountId ? accountId : this.accountId;
|
|
4528
4384
|
env = env ? env : this.env;
|
|
@@ -4551,6 +4407,9 @@
|
|
|
4551
4407
|
* @returns
|
|
4552
4408
|
*/
|
|
4553
4409
|
GetIdmApi(params) {
|
|
4410
|
+
if (!params) {
|
|
4411
|
+
params = {};
|
|
4412
|
+
}
|
|
4554
4413
|
let { env } = params;
|
|
4555
4414
|
env = env ? env : this.env;
|
|
4556
4415
|
const key = `${env}`;
|
|
@@ -4579,6 +4438,9 @@
|
|
|
4579
4438
|
* @returns
|
|
4580
4439
|
*/
|
|
4581
4440
|
GetCamApi(params) {
|
|
4441
|
+
if (!params) {
|
|
4442
|
+
params = {};
|
|
4443
|
+
}
|
|
4582
4444
|
let { env } = params;
|
|
4583
4445
|
env = env ? env : this.env;
|
|
4584
4446
|
const key = `${env}`;
|
|
@@ -4603,6 +4465,9 @@
|
|
|
4603
4465
|
};
|
|
4604
4466
|
}
|
|
4605
4467
|
GetGlobalApi(params) {
|
|
4468
|
+
if (!params) {
|
|
4469
|
+
params = {};
|
|
4470
|
+
}
|
|
4606
4471
|
let { env } = params;
|
|
4607
4472
|
env = env ? env : this.env;
|
|
4608
4473
|
const key = `${env}`;
|
|
@@ -4610,39 +4475,306 @@
|
|
|
4610
4475
|
this.global[key] = new exports.GlobalApi.Api({
|
|
4611
4476
|
env
|
|
4612
4477
|
});
|
|
4613
|
-
this.global[key].SetSessionId(this.sessionId);
|
|
4614
|
-
}
|
|
4615
|
-
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 GetGetters() {
|
|
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.GetGetters = GetGetters;
|
|
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.GetGetters().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.GetGetters().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.GetGetters().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
|
+
});
|
|
4616
4695
|
}
|
|
4617
|
-
|
|
4618
|
-
|
|
4619
|
-
|
|
4620
|
-
|
|
4621
|
-
|
|
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.GetGetters().GetBruceApi();
|
|
4622
4702
|
}
|
|
4623
|
-
|
|
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
|
+
});
|
|
4624
4709
|
}
|
|
4625
|
-
|
|
4626
|
-
|
|
4627
|
-
|
|
4628
|
-
|
|
4629
|
-
|
|
4630
|
-
|
|
4631
|
-
|
|
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.GetGetters().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
|
+
};
|
|
4632
4727
|
});
|
|
4633
|
-
|
|
4634
|
-
|
|
4635
|
-
|
|
4728
|
+
yield api.SetCacheItem({
|
|
4729
|
+
key: GetListCacheKey(typeId),
|
|
4730
|
+
value: prom,
|
|
4731
|
+
req: reqParams
|
|
4732
|
+
});
|
|
4733
|
+
return prom;
|
|
4734
|
+
});
|
|
4636
4735
|
}
|
|
4637
|
-
|
|
4638
|
-
|
|
4639
|
-
|
|
4640
|
-
|
|
4641
|
-
|
|
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.GetGetters().GetBruceApi();
|
|
4642
4742
|
}
|
|
4643
|
-
|
|
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
|
+
});
|
|
4644
4752
|
}
|
|
4645
|
-
|
|
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 = {}));
|
|
4646
4778
|
|
|
4647
4779
|
(function (Color) {
|
|
4648
4780
|
let EBlendMode;
|
|
@@ -4809,7 +4941,10 @@
|
|
|
4809
4941
|
Entity.GetCacheKey = GetCacheKey;
|
|
4810
4942
|
function Get(params) {
|
|
4811
4943
|
return __awaiter(this, void 0, void 0, function* () {
|
|
4812
|
-
|
|
4944
|
+
let { api, entityId, req: reqParams, expandLocation, entityTypeId } = params;
|
|
4945
|
+
if (!api) {
|
|
4946
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
4947
|
+
}
|
|
4813
4948
|
if (!entityId) {
|
|
4814
4949
|
throw ("Entity ID is required.");
|
|
4815
4950
|
}
|
|
@@ -4847,7 +4982,10 @@
|
|
|
4847
4982
|
Entity.Get = Get;
|
|
4848
4983
|
function GetListByIds(params) {
|
|
4849
4984
|
return __awaiter(this, void 0, void 0, function* () {
|
|
4850
|
-
|
|
4985
|
+
let { api, entityIds, req: reqParams } = params;
|
|
4986
|
+
if (!api) {
|
|
4987
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
4988
|
+
}
|
|
4851
4989
|
if (!entityIds.length) {
|
|
4852
4990
|
throw ("Entity IDs are required.");
|
|
4853
4991
|
}
|
|
@@ -4906,7 +5044,10 @@
|
|
|
4906
5044
|
Entity.GetListByIds = GetListByIds;
|
|
4907
5045
|
function Delete(params) {
|
|
4908
5046
|
return __awaiter(this, void 0, void 0, function* () {
|
|
4909
|
-
|
|
5047
|
+
let { api, entityId, req: reqParams } = params;
|
|
5048
|
+
if (!api) {
|
|
5049
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
5050
|
+
}
|
|
4910
5051
|
if (!entityId) {
|
|
4911
5052
|
throw ("Entity ID is required.");
|
|
4912
5053
|
}
|
|
@@ -4917,7 +5058,10 @@
|
|
|
4917
5058
|
Entity.Delete = Delete;
|
|
4918
5059
|
function DeleteList(params) {
|
|
4919
5060
|
return __awaiter(this, void 0, void 0, function* () {
|
|
4920
|
-
|
|
5061
|
+
let { api, entityIds, req: reqParams } = params;
|
|
5062
|
+
if (!api) {
|
|
5063
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
5064
|
+
}
|
|
4921
5065
|
if (!(entityIds === null || entityIds === void 0 ? void 0 : entityIds.length)) {
|
|
4922
5066
|
throw ("Entity IDs are required.");
|
|
4923
5067
|
}
|
|
@@ -4934,7 +5078,10 @@
|
|
|
4934
5078
|
function Update(params) {
|
|
4935
5079
|
var _a, _b;
|
|
4936
5080
|
return __awaiter(this, void 0, void 0, function* () {
|
|
4937
|
-
|
|
5081
|
+
let { api, entity: data, override, req: reqParams } = params;
|
|
5082
|
+
if (!api) {
|
|
5083
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
5084
|
+
}
|
|
4938
5085
|
if (!((_a = data === null || data === void 0 ? void 0 : data.Bruce) === null || _a === void 0 ? void 0 : _a["EntityType.ID"])) {
|
|
4939
5086
|
throw ("Entity Type ID is required.");
|
|
4940
5087
|
}
|
|
@@ -5037,7 +5184,10 @@
|
|
|
5037
5184
|
Entity.CalculateName = CalculateName;
|
|
5038
5185
|
function GetList(params) {
|
|
5039
5186
|
return __awaiter(this, void 0, void 0, function* () {
|
|
5040
|
-
|
|
5187
|
+
let { api, filter, req: reqParams, viaCdn, viaCdnCacheToken } = params;
|
|
5188
|
+
if (!api) {
|
|
5189
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
5190
|
+
}
|
|
5041
5191
|
let requestFilter = {};
|
|
5042
5192
|
if (filter.entityTypeConditions) {
|
|
5043
5193
|
requestFilter = Object.assign({}, filter.entityTypeConditions);
|
|
@@ -6028,7 +6178,10 @@
|
|
|
6028
6178
|
})(EType = EntityAttachmentType.EType || (EntityAttachmentType.EType = {}));
|
|
6029
6179
|
function Delete(params) {
|
|
6030
6180
|
return __awaiter(this, void 0, void 0, function* () {
|
|
6031
|
-
|
|
6181
|
+
let { api, attachmentTypeId: id, req: reqParams } = params;
|
|
6182
|
+
if (!api) {
|
|
6183
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
6184
|
+
}
|
|
6032
6185
|
if (!id) {
|
|
6033
6186
|
throw ("Type ID is required.");
|
|
6034
6187
|
}
|
|
@@ -6040,7 +6193,10 @@
|
|
|
6040
6193
|
EntityAttachmentType.Delete = Delete;
|
|
6041
6194
|
function Update(params) {
|
|
6042
6195
|
return __awaiter(this, void 0, void 0, function* () {
|
|
6043
|
-
|
|
6196
|
+
let { api, attachmentType: data, req: reqParams } = params;
|
|
6197
|
+
if (!api) {
|
|
6198
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
6199
|
+
}
|
|
6044
6200
|
if (!(data === null || data === void 0 ? void 0 : data.ID)) {
|
|
6045
6201
|
throw ("Type ID is required.");
|
|
6046
6202
|
}
|
|
@@ -6055,7 +6211,10 @@
|
|
|
6055
6211
|
EntityAttachmentType.Update = Update;
|
|
6056
6212
|
function GetList(params) {
|
|
6057
6213
|
return __awaiter(this, void 0, void 0, function* () {
|
|
6058
|
-
|
|
6214
|
+
let { api, reqParams } = params;
|
|
6215
|
+
if (!api) {
|
|
6216
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
6217
|
+
}
|
|
6059
6218
|
const cache = yield api.GetCacheItem(GetListCacheKey(), reqParams);
|
|
6060
6219
|
if (cache === null || cache === void 0 ? void 0 : cache.found) {
|
|
6061
6220
|
return cache.data;
|
|
@@ -6093,7 +6252,10 @@
|
|
|
6093
6252
|
EntityAttachment.GetListCacheKey = GetListCacheKey;
|
|
6094
6253
|
function Update(params) {
|
|
6095
6254
|
return __awaiter(this, void 0, void 0, function* () {
|
|
6096
|
-
|
|
6255
|
+
let { api, attachments, req, entityId } = params;
|
|
6256
|
+
if (!api) {
|
|
6257
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
6258
|
+
}
|
|
6097
6259
|
if (!(attachments === null || attachments === void 0 ? void 0 : attachments.length)) {
|
|
6098
6260
|
return {
|
|
6099
6261
|
attachments: []
|
|
@@ -6116,7 +6278,10 @@
|
|
|
6116
6278
|
EntityAttachment.Update = Update;
|
|
6117
6279
|
function UpdateOrder(params) {
|
|
6118
6280
|
return __awaiter(this, void 0, void 0, function* () {
|
|
6119
|
-
|
|
6281
|
+
let { api, entityId, attachmentTypeId: typeId, attachments, req: reqParams } = params;
|
|
6282
|
+
if (!api) {
|
|
6283
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
6284
|
+
}
|
|
6120
6285
|
if (!entityId || !typeId || !(attachments === null || attachments === void 0 ? void 0 : attachments.length)) {
|
|
6121
6286
|
throw ("Entity ID, Type ID, and Attachments are required.");
|
|
6122
6287
|
}
|
|
@@ -6134,7 +6299,10 @@
|
|
|
6134
6299
|
EntityAttachment.UpdateOrder = UpdateOrder;
|
|
6135
6300
|
function Delete(params) {
|
|
6136
6301
|
return __awaiter(this, void 0, void 0, function* () {
|
|
6137
|
-
|
|
6302
|
+
let { api, attachmentId, entityId, req } = params;
|
|
6303
|
+
if (!api) {
|
|
6304
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
6305
|
+
}
|
|
6138
6306
|
if (!attachmentId || !entityId) {
|
|
6139
6307
|
throw ("Entity id and attachment id.");
|
|
6140
6308
|
}
|
|
@@ -6145,7 +6313,10 @@
|
|
|
6145
6313
|
EntityAttachment.Delete = Delete;
|
|
6146
6314
|
function GetListByEntityId(params) {
|
|
6147
6315
|
return __awaiter(this, void 0, void 0, function* () {
|
|
6148
|
-
|
|
6316
|
+
let { api, entityId, req: reqParams } = params;
|
|
6317
|
+
if (!api) {
|
|
6318
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
6319
|
+
}
|
|
6149
6320
|
if (!entityId) {
|
|
6150
6321
|
throw ("Entity ID is required.");
|
|
6151
6322
|
}
|
|
@@ -6175,7 +6346,10 @@
|
|
|
6175
6346
|
EntityAttachment.GetListByEntityId = GetListByEntityId;
|
|
6176
6347
|
function Upload(params) {
|
|
6177
6348
|
return __awaiter(this, void 0, void 0, function* () {
|
|
6178
|
-
|
|
6349
|
+
let { api, file, entityId, attachmentTypeId: typeId, req: reqParams } = params;
|
|
6350
|
+
if (!api) {
|
|
6351
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
6352
|
+
}
|
|
6179
6353
|
if (!entityId || !typeId || !file) {
|
|
6180
6354
|
throw ("Entity ID, Type ID, and File are required.");
|
|
6181
6355
|
}
|
|
@@ -6201,7 +6375,10 @@
|
|
|
6201
6375
|
EntityComment.GetListCacheKey = GetListCacheKey;
|
|
6202
6376
|
function Update(params) {
|
|
6203
6377
|
return __awaiter(this, void 0, void 0, function* () {
|
|
6204
|
-
|
|
6378
|
+
let { api, comment: data, req: reqParams } = params;
|
|
6379
|
+
if (!api) {
|
|
6380
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
6381
|
+
}
|
|
6205
6382
|
if (!(data === null || data === void 0 ? void 0 : data["TargetObject.ID"])) {
|
|
6206
6383
|
throw ("TargetObject.ID (entity id) is required.");
|
|
6207
6384
|
}
|
|
@@ -6217,7 +6394,10 @@
|
|
|
6217
6394
|
EntityComment.Update = Update;
|
|
6218
6395
|
function Delete(params) {
|
|
6219
6396
|
return __awaiter(this, void 0, void 0, function* () {
|
|
6220
|
-
|
|
6397
|
+
let { api, entityId, commentId, req: reqParams } = params;
|
|
6398
|
+
if (!api) {
|
|
6399
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
6400
|
+
}
|
|
6221
6401
|
if (!commentId) {
|
|
6222
6402
|
throw ("Comment ID is required.");
|
|
6223
6403
|
}
|
|
@@ -6229,7 +6409,10 @@
|
|
|
6229
6409
|
EntityComment.Delete = Delete;
|
|
6230
6410
|
function GetListByEntityId(params) {
|
|
6231
6411
|
return __awaiter(this, void 0, void 0, function* () {
|
|
6232
|
-
|
|
6412
|
+
let { api, entityId, req: reqParams } = params;
|
|
6413
|
+
if (!api) {
|
|
6414
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
6415
|
+
}
|
|
6233
6416
|
if (!entityId) {
|
|
6234
6417
|
throw ("Entity ID is required.");
|
|
6235
6418
|
}
|
|
@@ -6270,7 +6453,10 @@
|
|
|
6270
6453
|
EntityLink.GetListCacheKey = GetListCacheKey;
|
|
6271
6454
|
function Update(params) {
|
|
6272
6455
|
return __awaiter(this, void 0, void 0, function* () {
|
|
6273
|
-
|
|
6456
|
+
let { api, link: data, req: reqParams } = params;
|
|
6457
|
+
if (!api) {
|
|
6458
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
6459
|
+
}
|
|
6274
6460
|
if (!(data === null || data === void 0 ? void 0 : data["Entity.ID"])) {
|
|
6275
6461
|
throw ("Entity ID is required.");
|
|
6276
6462
|
}
|
|
@@ -6286,7 +6472,10 @@
|
|
|
6286
6472
|
EntityLink.Update = Update;
|
|
6287
6473
|
function Delete(params) {
|
|
6288
6474
|
return __awaiter(this, void 0, void 0, function* () {
|
|
6289
|
-
|
|
6475
|
+
let { api, entityId, linkId, req: reqParams } = params;
|
|
6476
|
+
if (!api) {
|
|
6477
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
6478
|
+
}
|
|
6290
6479
|
if (!linkId) {
|
|
6291
6480
|
throw ("Link ID is required.");
|
|
6292
6481
|
}
|
|
@@ -6298,7 +6487,10 @@
|
|
|
6298
6487
|
EntityLink.Delete = Delete;
|
|
6299
6488
|
function GetListByEntityId(params) {
|
|
6300
6489
|
return __awaiter(this, void 0, void 0, function* () {
|
|
6301
|
-
|
|
6490
|
+
let { api, entityId, req: reqParams } = params;
|
|
6491
|
+
if (!api) {
|
|
6492
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
6493
|
+
}
|
|
6302
6494
|
if (!entityId) {
|
|
6303
6495
|
throw ("Entity ID is required.");
|
|
6304
6496
|
}
|
|
@@ -6343,6 +6535,9 @@
|
|
|
6343
6535
|
EntityLod.GetEntityListKey = GetEntityListKey;
|
|
6344
6536
|
function GetUrl(params) {
|
|
6345
6537
|
let { api, entityId, categoryId, level, strict } = params;
|
|
6538
|
+
if (!api) {
|
|
6539
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
6540
|
+
}
|
|
6346
6541
|
if (!entityId) {
|
|
6347
6542
|
throw ("Entity ID is required.");
|
|
6348
6543
|
}
|
|
@@ -6363,7 +6558,10 @@
|
|
|
6363
6558
|
EntityLod.GetUrl = GetUrl;
|
|
6364
6559
|
function GetUrlFileId(params) {
|
|
6365
6560
|
return __awaiter(this, void 0, void 0, function* () {
|
|
6366
|
-
|
|
6561
|
+
let { api, url, req: reqParams } = params;
|
|
6562
|
+
if (!api) {
|
|
6563
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
6564
|
+
}
|
|
6367
6565
|
if (!url) {
|
|
6368
6566
|
throw ("Url is required.");
|
|
6369
6567
|
}
|
|
@@ -6394,7 +6592,10 @@
|
|
|
6394
6592
|
function GetLods(params) {
|
|
6395
6593
|
var _a;
|
|
6396
6594
|
return __awaiter(this, void 0, void 0, function* () {
|
|
6397
|
-
|
|
6595
|
+
let { api, filter, req: reqParams } = params;
|
|
6596
|
+
if (!api) {
|
|
6597
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
6598
|
+
}
|
|
6398
6599
|
if (!((_a = filter === null || filter === void 0 ? void 0 : filter.Items) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
6399
6600
|
throw ("Items are required.");
|
|
6400
6601
|
}
|
|
@@ -6407,7 +6608,10 @@
|
|
|
6407
6608
|
EntityLod.GetLods = GetLods;
|
|
6408
6609
|
function GetEntityLods(params) {
|
|
6409
6610
|
return __awaiter(this, void 0, void 0, function* () {
|
|
6410
|
-
|
|
6611
|
+
let { api, entityId, req: reqParams } = params;
|
|
6612
|
+
if (!api) {
|
|
6613
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
6614
|
+
}
|
|
6411
6615
|
if (!entityId) {
|
|
6412
6616
|
throw ("Entity id is required.");
|
|
6413
6617
|
}
|
|
@@ -6443,6 +6647,9 @@
|
|
|
6443
6647
|
function GetTypeLods(params) {
|
|
6444
6648
|
return __awaiter(this, void 0, void 0, function* () {
|
|
6445
6649
|
let { api, entityTypeId: typeId, group, req: reqParams } = params;
|
|
6650
|
+
if (!api) {
|
|
6651
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
6652
|
+
}
|
|
6446
6653
|
if (!group) {
|
|
6447
6654
|
group = "DEFAULT";
|
|
6448
6655
|
}
|
|
@@ -6474,7 +6681,10 @@
|
|
|
6474
6681
|
EntityLod.GetTypeLods = GetTypeLods;
|
|
6475
6682
|
function Update(params) {
|
|
6476
6683
|
return __awaiter(this, void 0, void 0, function* () {
|
|
6477
|
-
|
|
6684
|
+
let { api, entityId, req: reqParams } = params;
|
|
6685
|
+
if (!api) {
|
|
6686
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
6687
|
+
}
|
|
6478
6688
|
if (!params["ClientFile.ID"] || !params["LODCategory.Key"] || (!params.Level && params.Level !== 0)) {
|
|
6479
6689
|
throw ("ClientFile.ID, LODCategory.Key and Level are required.");
|
|
6480
6690
|
}
|
|
@@ -6490,6 +6700,9 @@
|
|
|
6490
6700
|
function Delete(params) {
|
|
6491
6701
|
return __awaiter(this, void 0, void 0, function* () {
|
|
6492
6702
|
let { api, entityId, lodCategoryId, level, req: reqParams } = params;
|
|
6703
|
+
if (!api) {
|
|
6704
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
6705
|
+
}
|
|
6493
6706
|
if (!entityId || !lodCategoryId) {
|
|
6494
6707
|
throw ("Entity ID and LOD Category ID are required.");
|
|
6495
6708
|
}
|
|
@@ -6517,7 +6730,10 @@
|
|
|
6517
6730
|
EntityLodCategory.GetListCacheKey = GetListCacheKey;
|
|
6518
6731
|
function GetList(params) {
|
|
6519
6732
|
return __awaiter(this, void 0, void 0, function* () {
|
|
6520
|
-
|
|
6733
|
+
let { api, req: reqParams } = params;
|
|
6734
|
+
if (!api) {
|
|
6735
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
6736
|
+
}
|
|
6521
6737
|
const cache = yield api.GetCacheItem(GetListCacheKey(), reqParams);
|
|
6522
6738
|
if (cache === null || cache === void 0 ? void 0 : cache.found) {
|
|
6523
6739
|
return cache.data;
|
|
@@ -6544,7 +6760,10 @@
|
|
|
6544
6760
|
EntityLodCategory.GetList = GetList;
|
|
6545
6761
|
function Get(params) {
|
|
6546
6762
|
return __awaiter(this, void 0, void 0, function* () {
|
|
6547
|
-
|
|
6763
|
+
let { api, categoryId: id, req: reqParams } = params;
|
|
6764
|
+
if (!api) {
|
|
6765
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
6766
|
+
}
|
|
6548
6767
|
if (!id) {
|
|
6549
6768
|
throw ("Lod category id is required.");
|
|
6550
6769
|
}
|
|
@@ -6574,7 +6793,10 @@
|
|
|
6574
6793
|
EntityLodCategory.Get = Get;
|
|
6575
6794
|
function Delete(params) {
|
|
6576
6795
|
return __awaiter(this, void 0, void 0, function* () {
|
|
6577
|
-
|
|
6796
|
+
let { api, categoryId: id, req: reqParams } = params;
|
|
6797
|
+
if (!api) {
|
|
6798
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
6799
|
+
}
|
|
6578
6800
|
if (!id) {
|
|
6579
6801
|
throw ("Lod category id is required.");
|
|
6580
6802
|
}
|
|
@@ -6586,7 +6808,10 @@
|
|
|
6586
6808
|
EntityLodCategory.Delete = Delete;
|
|
6587
6809
|
function Update(params) {
|
|
6588
6810
|
return __awaiter(this, void 0, void 0, function* () {
|
|
6589
|
-
|
|
6811
|
+
let { api, category: data, req: reqParams } = params;
|
|
6812
|
+
if (!api) {
|
|
6813
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
6814
|
+
}
|
|
6590
6815
|
if (!data.Key || !data.Name) {
|
|
6591
6816
|
throw ("Lod category key and name are required.");
|
|
6592
6817
|
}
|
|
@@ -6612,7 +6837,10 @@
|
|
|
6612
6837
|
EntityRelationType.GetListCacheKey = GetListCacheKey;
|
|
6613
6838
|
function Get(params) {
|
|
6614
6839
|
return __awaiter(this, void 0, void 0, function* () {
|
|
6615
|
-
|
|
6840
|
+
let { api, relationTypeId: typeId, req: reqParams } = params;
|
|
6841
|
+
if (!api) {
|
|
6842
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
6843
|
+
}
|
|
6616
6844
|
if (!typeId) {
|
|
6617
6845
|
throw ("Type ID is required.");
|
|
6618
6846
|
}
|
|
@@ -6643,7 +6871,10 @@
|
|
|
6643
6871
|
EntityRelationType.Get = Get;
|
|
6644
6872
|
function Delete(params) {
|
|
6645
6873
|
return __awaiter(this, void 0, void 0, function* () {
|
|
6646
|
-
|
|
6874
|
+
let { api, relationTypeId: typeId, req: reqParams } = params;
|
|
6875
|
+
if (!api) {
|
|
6876
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
6877
|
+
}
|
|
6647
6878
|
if (!typeId) {
|
|
6648
6879
|
throw ("Type ID is required.");
|
|
6649
6880
|
}
|
|
@@ -6655,7 +6886,10 @@
|
|
|
6655
6886
|
EntityRelationType.Delete = Delete;
|
|
6656
6887
|
function GetList(params) {
|
|
6657
6888
|
return __awaiter(this, void 0, void 0, function* () {
|
|
6658
|
-
|
|
6889
|
+
let { api, req: reqParams } = params;
|
|
6890
|
+
if (!api) {
|
|
6891
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
6892
|
+
}
|
|
6659
6893
|
const cache = yield api.GetCacheItem(GetListCacheKey(), reqParams);
|
|
6660
6894
|
if (cache === null || cache === void 0 ? void 0 : cache.found) {
|
|
6661
6895
|
return cache.data;
|
|
@@ -6682,7 +6916,10 @@
|
|
|
6682
6916
|
EntityRelationType.GetList = GetList;
|
|
6683
6917
|
function Update(params) {
|
|
6684
6918
|
return __awaiter(this, void 0, void 0, function* () {
|
|
6685
|
-
|
|
6919
|
+
let { api, relationType: data, req: reqParams } = params;
|
|
6920
|
+
if (!api) {
|
|
6921
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
6922
|
+
}
|
|
6686
6923
|
if (!(data === null || data === void 0 ? void 0 : data.ForwardName) || !(data === null || data === void 0 ? void 0 : data.ReverseName)) {
|
|
6687
6924
|
throw ("Forward and reverse names are required.");
|
|
6688
6925
|
}
|
|
@@ -6719,7 +6956,10 @@
|
|
|
6719
6956
|
EntityRelation.GetListCacheKey = GetListCacheKey;
|
|
6720
6957
|
function Create(params) {
|
|
6721
6958
|
return __awaiter(this, void 0, void 0, function* () {
|
|
6722
|
-
|
|
6959
|
+
let { api, relation: data, req: reqParams } = params;
|
|
6960
|
+
if (!api) {
|
|
6961
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
6962
|
+
}
|
|
6723
6963
|
if (!data["Principal.Entity.ID"] || !data["Related.Entity.ID"] || !data["Relation.Type.ID"]) {
|
|
6724
6964
|
throw ("Principal Entity ID, Related Entity ID, and Relation Type ID are required.");
|
|
6725
6965
|
}
|
|
@@ -6739,7 +6979,10 @@
|
|
|
6739
6979
|
EntityRelation.Create = Create;
|
|
6740
6980
|
function Delete(params) {
|
|
6741
6981
|
return __awaiter(this, void 0, void 0, function* () {
|
|
6742
|
-
|
|
6982
|
+
let { api, principalEntityId, relatedEntityId, relationTypeId, req: reqParams } = params;
|
|
6983
|
+
if (!api) {
|
|
6984
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
6985
|
+
}
|
|
6743
6986
|
if (!principalEntityId || !relatedEntityId || !relationTypeId) {
|
|
6744
6987
|
throw new Error("Principal Entity ID, Related Entity ID, and Relation Type ID are required.");
|
|
6745
6988
|
}
|
|
@@ -6756,7 +6999,10 @@
|
|
|
6756
6999
|
EntityRelation.Delete = Delete;
|
|
6757
7000
|
function Update(params) {
|
|
6758
7001
|
return __awaiter(this, void 0, void 0, function* () {
|
|
6759
|
-
|
|
7002
|
+
let { api, relation: data, req: reqParams } = params;
|
|
7003
|
+
if (!api) {
|
|
7004
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
7005
|
+
}
|
|
6760
7006
|
if (!data["Principal.Entity.ID"] || !data["Related.Entity.ID"] || !data["Relation.Type.ID"]) {
|
|
6761
7007
|
throw ("Principal Entity ID, Related Entity ID, and Relation Type ID are required.");
|
|
6762
7008
|
}
|
|
@@ -6774,6 +7020,9 @@
|
|
|
6774
7020
|
function GetList(params) {
|
|
6775
7021
|
return __awaiter(this, void 0, void 0, function* () {
|
|
6776
7022
|
let { api, entityId, filter, req: reqParams } = params;
|
|
7023
|
+
if (!api) {
|
|
7024
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
7025
|
+
}
|
|
6777
7026
|
if (!entityId) {
|
|
6778
7027
|
throw ("Entity ID is required.");
|
|
6779
7028
|
}
|
|
@@ -6809,7 +7058,10 @@
|
|
|
6809
7058
|
EntityRelation.GetList = GetList;
|
|
6810
7059
|
function GetByDataEntityId(params) {
|
|
6811
7060
|
return __awaiter(this, void 0, void 0, function* () {
|
|
6812
|
-
|
|
7061
|
+
let { api, entityId, req: reqParams } = params;
|
|
7062
|
+
if (!api) {
|
|
7063
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
7064
|
+
}
|
|
6813
7065
|
if (!entityId) {
|
|
6814
7066
|
throw ("Entity ID is required.");
|
|
6815
7067
|
}
|
|
@@ -6847,7 +7099,10 @@
|
|
|
6847
7099
|
function Get(params) {
|
|
6848
7100
|
var _a;
|
|
6849
7101
|
return __awaiter(this, void 0, void 0, function* () {
|
|
6850
|
-
|
|
7102
|
+
let { api, sourceId, sourceKey, req: reqParams } = params;
|
|
7103
|
+
if (!api) {
|
|
7104
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
7105
|
+
}
|
|
6851
7106
|
if (!sourceId || !sourceKey) {
|
|
6852
7107
|
throw ("Source ID and Source Key are required.");
|
|
6853
7108
|
}
|
|
@@ -6865,7 +7120,10 @@
|
|
|
6865
7120
|
EntitySource.Get = Get;
|
|
6866
7121
|
function GetListByKeys(params) {
|
|
6867
7122
|
return __awaiter(this, void 0, void 0, function* () {
|
|
6868
|
-
|
|
7123
|
+
let { api, sourceId, sourceKeys, req: reqParams } = params;
|
|
7124
|
+
if (!api) {
|
|
7125
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
7126
|
+
}
|
|
6869
7127
|
if (!sourceId || !sourceKeys.length) {
|
|
6870
7128
|
throw ("Source ID and Source Keys are required.");
|
|
6871
7129
|
}
|
|
@@ -6912,7 +7170,10 @@
|
|
|
6912
7170
|
EntitySource.GetListByKeys = GetListByKeys;
|
|
6913
7171
|
function GetEntityIdsBySourceKeys(params) {
|
|
6914
7172
|
return __awaiter(this, void 0, void 0, function* () {
|
|
6915
|
-
|
|
7173
|
+
let { api, sourceId, sourceKeys, req: reqParams } = params;
|
|
7174
|
+
if (!api) {
|
|
7175
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
7176
|
+
}
|
|
6916
7177
|
if (!sourceId || !sourceKeys.length) {
|
|
6917
7178
|
throw ("Source ID and Source Keys are required.");
|
|
6918
7179
|
}
|
|
@@ -6942,13 +7203,16 @@
|
|
|
6942
7203
|
EntitySource.GetEntityIdsBySourceKeys = GetEntityIdsBySourceKeys;
|
|
6943
7204
|
function CreateLink(params) {
|
|
6944
7205
|
return __awaiter(this, void 0, void 0, function* () {
|
|
6945
|
-
|
|
7206
|
+
let { source, api } = params;
|
|
7207
|
+
if (!api) {
|
|
7208
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
7209
|
+
}
|
|
6946
7210
|
if (!source["Entity.ID"] || !source["Source.ID"] || !source["SourceRecord.Key"]) {
|
|
6947
7211
|
throw ("Entity ID, Source ID and Source Key are required.");
|
|
6948
7212
|
}
|
|
6949
|
-
const res = yield
|
|
7213
|
+
const res = yield api.POST("entitysource", source);
|
|
6950
7214
|
const cacheKey = GetCacheKey(source["Source.ID"], source["SourceRecord.Key"]);
|
|
6951
|
-
yield
|
|
7215
|
+
yield api.Cache.Remove(cacheKey);
|
|
6952
7216
|
return {
|
|
6953
7217
|
source: res
|
|
6954
7218
|
};
|
|
@@ -6971,7 +7235,10 @@
|
|
|
6971
7235
|
EntityTag.GetListCacheKey = GetListCacheKey;
|
|
6972
7236
|
function Get(params) {
|
|
6973
7237
|
return __awaiter(this, void 0, void 0, function* () {
|
|
6974
|
-
|
|
7238
|
+
let { api, tagId, req: reqParams } = params;
|
|
7239
|
+
if (!api) {
|
|
7240
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
7241
|
+
}
|
|
6975
7242
|
if (!tagId) {
|
|
6976
7243
|
throw ("Tag ID is required.");
|
|
6977
7244
|
}
|
|
@@ -6988,7 +7255,10 @@
|
|
|
6988
7255
|
EntityTag.Get = Get;
|
|
6989
7256
|
function GetListByIds(params) {
|
|
6990
7257
|
return __awaiter(this, void 0, void 0, function* () {
|
|
6991
|
-
|
|
7258
|
+
let { api, tagIds, req: reqParams } = params;
|
|
7259
|
+
if (!api) {
|
|
7260
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
7261
|
+
}
|
|
6992
7262
|
if (!tagIds.length) {
|
|
6993
7263
|
throw ("Tag Ids are empty.");
|
|
6994
7264
|
}
|
|
@@ -7044,7 +7314,10 @@
|
|
|
7044
7314
|
EntityTag.GetListByIds = GetListByIds;
|
|
7045
7315
|
function GetList(params) {
|
|
7046
7316
|
return __awaiter(this, void 0, void 0, function* () {
|
|
7047
|
-
|
|
7317
|
+
let { api, entityTypeId, req: reqParams } = params;
|
|
7318
|
+
if (!api) {
|
|
7319
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
7320
|
+
}
|
|
7048
7321
|
const cache = yield api.GetCacheItem(GetListCacheKey(entityTypeId), reqParams);
|
|
7049
7322
|
if (cache === null || cache === void 0 ? void 0 : cache.found) {
|
|
7050
7323
|
return cache.data;
|
|
@@ -7071,7 +7344,10 @@
|
|
|
7071
7344
|
EntityTag.GetList = GetList;
|
|
7072
7345
|
function Delete(params) {
|
|
7073
7346
|
return __awaiter(this, void 0, void 0, function* () {
|
|
7074
|
-
|
|
7347
|
+
let { api, tagId, req: reqParams } = params;
|
|
7348
|
+
if (!api) {
|
|
7349
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
7350
|
+
}
|
|
7075
7351
|
if (!tagId) {
|
|
7076
7352
|
throw ("Tag ID is required.");
|
|
7077
7353
|
}
|
|
@@ -7083,7 +7359,10 @@
|
|
|
7083
7359
|
EntityTag.Delete = Delete;
|
|
7084
7360
|
function Update(params) {
|
|
7085
7361
|
return __awaiter(this, void 0, void 0, function* () {
|
|
7086
|
-
|
|
7362
|
+
let { api, tag: data, req: reqParams } = params;
|
|
7363
|
+
if (!api) {
|
|
7364
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
7365
|
+
}
|
|
7087
7366
|
const url = data.ID ? `layer/${data.ID}` : "layer";
|
|
7088
7367
|
const res = yield api.POST(url, data, exports.Api.PrepReqParams(reqParams));
|
|
7089
7368
|
api.Cache.Remove(GetCacheKey(data.ID));
|
|
@@ -7107,7 +7386,10 @@
|
|
|
7107
7386
|
EntityType.GetListCacheKey = GetListCacheKey;
|
|
7108
7387
|
function Get(params) {
|
|
7109
7388
|
return __awaiter(this, void 0, void 0, function* () {
|
|
7110
|
-
|
|
7389
|
+
let { api, entityTypeId: typeId, req: reqParams } = params;
|
|
7390
|
+
if (!api) {
|
|
7391
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
7392
|
+
}
|
|
7111
7393
|
if (!typeId) {
|
|
7112
7394
|
throw ("Type ID is required.");
|
|
7113
7395
|
}
|
|
@@ -7138,7 +7420,10 @@
|
|
|
7138
7420
|
EntityType.Get = Get;
|
|
7139
7421
|
function Delete(params) {
|
|
7140
7422
|
return __awaiter(this, void 0, void 0, function* () {
|
|
7141
|
-
|
|
7423
|
+
let { api, entityTypeId: typeId, req: reqParams } = params;
|
|
7424
|
+
if (!api) {
|
|
7425
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
7426
|
+
}
|
|
7142
7427
|
if (!typeId) {
|
|
7143
7428
|
throw ("Type ID is required.");
|
|
7144
7429
|
}
|
|
@@ -7150,7 +7435,10 @@
|
|
|
7150
7435
|
EntityType.Delete = Delete;
|
|
7151
7436
|
function GetList(params) {
|
|
7152
7437
|
return __awaiter(this, void 0, void 0, function* () {
|
|
7153
|
-
|
|
7438
|
+
let { api, req: reqParams } = params;
|
|
7439
|
+
if (!api) {
|
|
7440
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
7441
|
+
}
|
|
7154
7442
|
const cache = yield api.GetCacheItem(GetListCacheKey(), reqParams);
|
|
7155
7443
|
if (cache === null || cache === void 0 ? void 0 : cache.found) {
|
|
7156
7444
|
return cache.data;
|
|
@@ -7179,6 +7467,9 @@
|
|
|
7179
7467
|
function Update(params) {
|
|
7180
7468
|
return __awaiter(this, void 0, void 0, function* () {
|
|
7181
7469
|
let { api, entityType: data, req: reqParams } = params;
|
|
7470
|
+
if (!api) {
|
|
7471
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
7472
|
+
}
|
|
7182
7473
|
if (!data) {
|
|
7183
7474
|
data = {};
|
|
7184
7475
|
}
|
|
@@ -7757,7 +8048,10 @@
|
|
|
7757
8048
|
EntityCoords.GetCacheKey = GetCacheKey;
|
|
7758
8049
|
function GetEntityCoords(params) {
|
|
7759
8050
|
return __awaiter(this, void 0, void 0, function* () {
|
|
7760
|
-
|
|
8051
|
+
let { api, rootEntityId: entityId, req: reqParams } = params;
|
|
8052
|
+
if (!api) {
|
|
8053
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
8054
|
+
}
|
|
7761
8055
|
const cache = yield api.GetCacheItem(GetCacheKey(entityId), reqParams);
|
|
7762
8056
|
if (cache === null || cache === void 0 ? void 0 : cache.found) {
|
|
7763
8057
|
return cache.data;
|
|
@@ -7784,7 +8078,10 @@
|
|
|
7784
8078
|
EntityCoords.GetEntityCoords = GetEntityCoords;
|
|
7785
8079
|
function EntityRelativeToPoint(params) {
|
|
7786
8080
|
return __awaiter(this, void 0, void 0, function* () {
|
|
7787
|
-
|
|
8081
|
+
let { api, rootEntityId: entityId, req: reqParams } = params;
|
|
8082
|
+
if (!api) {
|
|
8083
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
8084
|
+
}
|
|
7788
8085
|
if (!params.test) {
|
|
7789
8086
|
yield UnlinkCoords({
|
|
7790
8087
|
api,
|
|
@@ -7821,7 +8118,10 @@
|
|
|
7821
8118
|
function EntityRelativeToEpsg(params) {
|
|
7822
8119
|
var _a;
|
|
7823
8120
|
return __awaiter(this, void 0, void 0, function* () {
|
|
7824
|
-
|
|
8121
|
+
let { api, rootEntityId: entityId, req: reqParams } = params;
|
|
8122
|
+
if (!api) {
|
|
8123
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
8124
|
+
}
|
|
7825
8125
|
if (!params.test) {
|
|
7826
8126
|
yield UnlinkCoords({
|
|
7827
8127
|
api,
|
|
@@ -7855,7 +8155,10 @@
|
|
|
7855
8155
|
EntityCoords.EntityRelativeToEpsg = EntityRelativeToEpsg;
|
|
7856
8156
|
function EntityRelativeToUcs(params) {
|
|
7857
8157
|
return __awaiter(this, void 0, void 0, function* () {
|
|
7858
|
-
|
|
8158
|
+
let { api, rootEntityId: entityId, req: reqParams } = params;
|
|
8159
|
+
if (!api) {
|
|
8160
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
8161
|
+
}
|
|
7859
8162
|
if (!params.test) {
|
|
7860
8163
|
yield UnlinkCoords({
|
|
7861
8164
|
api,
|
|
@@ -7881,7 +8184,10 @@
|
|
|
7881
8184
|
EntityCoords.EntityRelativeToUcs = EntityRelativeToUcs;
|
|
7882
8185
|
function UnlinkCoords(params) {
|
|
7883
8186
|
return __awaiter(this, void 0, void 0, function* () {
|
|
7884
|
-
|
|
8187
|
+
let { api, rootEntityId: entityId, req: reqParams } = params;
|
|
8188
|
+
if (!api) {
|
|
8189
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
8190
|
+
}
|
|
7885
8191
|
return api.DELETE(`entity/${entityId}/ucs`, reqParams);
|
|
7886
8192
|
});
|
|
7887
8193
|
}
|
|
@@ -7928,7 +8234,10 @@
|
|
|
7928
8234
|
Uploader.MIN_LARGE_FILE_SIZE = 100000000; // 100MB.
|
|
7929
8235
|
function DoMultiPartUpload(params) {
|
|
7930
8236
|
return __awaiter(this, void 0, void 0, function* () {
|
|
7931
|
-
|
|
8237
|
+
let { file, api, urlSuffix: url, req, onProgress } = params;
|
|
8238
|
+
if (!api) {
|
|
8239
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
8240
|
+
}
|
|
7932
8241
|
const FILE_PORTION_SIZE = 100000000; // 100MB.
|
|
7933
8242
|
let fileSize = file.size;
|
|
7934
8243
|
let fileOffset = 0;
|
|
@@ -7992,18 +8301,27 @@
|
|
|
7992
8301
|
}
|
|
7993
8302
|
ClientFile.GetCacheKey = GetCacheKey;
|
|
7994
8303
|
function GetUrl(params) {
|
|
7995
|
-
|
|
8304
|
+
let { api, fileId } = params;
|
|
8305
|
+
if (!api) {
|
|
8306
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
8307
|
+
}
|
|
7996
8308
|
return `${api.GetBaseUrl()}file/${fileId}`;
|
|
7997
8309
|
}
|
|
7998
8310
|
ClientFile.GetUrl = GetUrl;
|
|
7999
8311
|
function GetUrlWithExt(params) {
|
|
8000
|
-
|
|
8312
|
+
let { api, file } = params;
|
|
8313
|
+
if (!api) {
|
|
8314
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
8315
|
+
}
|
|
8001
8316
|
return `${api.GetBaseUrl()}file/${file.ID}${file.FileExt ? file.FileExt : ""}`;
|
|
8002
8317
|
}
|
|
8003
8318
|
ClientFile.GetUrlWithExt = GetUrlWithExt;
|
|
8004
8319
|
function Get(params) {
|
|
8005
8320
|
return __awaiter(this, void 0, void 0, function* () {
|
|
8006
|
-
|
|
8321
|
+
let { api, fileId, req: reqParams } = params;
|
|
8322
|
+
if (!api) {
|
|
8323
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
8324
|
+
}
|
|
8007
8325
|
if (!fileId) {
|
|
8008
8326
|
throw ("File ID is required.");
|
|
8009
8327
|
}
|
|
@@ -8034,7 +8352,10 @@
|
|
|
8034
8352
|
ClientFile.Get = Get;
|
|
8035
8353
|
function Delete(params) {
|
|
8036
8354
|
return __awaiter(this, void 0, void 0, function* () {
|
|
8037
|
-
|
|
8355
|
+
let { api, fileIds, req: reqParams } = params;
|
|
8356
|
+
if (!api) {
|
|
8357
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
8358
|
+
}
|
|
8038
8359
|
if (!fileIds.length) {
|
|
8039
8360
|
throw ("File IDs are required.");
|
|
8040
8361
|
}
|
|
@@ -8052,6 +8373,9 @@
|
|
|
8052
8373
|
function Upload(params) {
|
|
8053
8374
|
return __awaiter(this, void 0, void 0, function* () {
|
|
8054
8375
|
let { api, file, purpose, req, onProgress } = params;
|
|
8376
|
+
if (!api) {
|
|
8377
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
8378
|
+
}
|
|
8055
8379
|
if (!file) {
|
|
8056
8380
|
throw ("File is required.");
|
|
8057
8381
|
}
|
|
@@ -8107,6 +8431,9 @@
|
|
|
8107
8431
|
function UpdatePurpose(params) {
|
|
8108
8432
|
return __awaiter(this, void 0, void 0, function* () {
|
|
8109
8433
|
let { api, fileId, purpose, req: reqParams } = params;
|
|
8434
|
+
if (!api) {
|
|
8435
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
8436
|
+
}
|
|
8110
8437
|
if (!purpose) {
|
|
8111
8438
|
purpose = "";
|
|
8112
8439
|
}
|
|
@@ -8127,6 +8454,9 @@
|
|
|
8127
8454
|
function UploadTemp(params) {
|
|
8128
8455
|
return __awaiter(this, void 0, void 0, function* () {
|
|
8129
8456
|
let { api, file, req, onProgress } = params;
|
|
8457
|
+
if (!api) {
|
|
8458
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
8459
|
+
}
|
|
8130
8460
|
if (!file) {
|
|
8131
8461
|
throw ("File is required.");
|
|
8132
8462
|
}
|
|
@@ -8190,7 +8520,10 @@
|
|
|
8190
8520
|
})(Filter = ClientFile.Filter || (ClientFile.Filter = {}));
|
|
8191
8521
|
function GetList(params) {
|
|
8192
8522
|
return __awaiter(this, void 0, void 0, function* () {
|
|
8193
|
-
|
|
8523
|
+
let { api, filter, req: reqParams } = params;
|
|
8524
|
+
if (!api) {
|
|
8525
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
8526
|
+
}
|
|
8194
8527
|
const data = yield api.POST("files/filtered", filter, exports.Api.PrepReqParams(reqParams));
|
|
8195
8528
|
return {
|
|
8196
8529
|
clientFiles: data.Items,
|
|
@@ -8208,7 +8541,10 @@
|
|
|
8208
8541
|
})(EConvertExt = Processor.EConvertExt || (Processor.EConvertExt = {}));
|
|
8209
8542
|
function ConvertFormat(params) {
|
|
8210
8543
|
return __awaiter(this, void 0, void 0, function* () {
|
|
8211
|
-
|
|
8544
|
+
let { api, fileId: clientFileId, ext, req: reqParams } = params;
|
|
8545
|
+
if (!api) {
|
|
8546
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
8547
|
+
}
|
|
8212
8548
|
if (!clientFileId || !ext) {
|
|
8213
8549
|
throw ("Client File ID and extension are required.");
|
|
8214
8550
|
}
|
|
@@ -8241,7 +8577,10 @@
|
|
|
8241
8577
|
})(EProgramId = ProgramKey.EProgramId || (ProgramKey.EProgramId = {}));
|
|
8242
8578
|
function Get(params) {
|
|
8243
8579
|
return __awaiter(this, void 0, void 0, function* () {
|
|
8244
|
-
|
|
8580
|
+
let { api, programId, req: reqParams } = params;
|
|
8581
|
+
if (!api) {
|
|
8582
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
8583
|
+
}
|
|
8245
8584
|
if (!programId) {
|
|
8246
8585
|
throw ("Program ID is required.");
|
|
8247
8586
|
}
|
|
@@ -8272,7 +8611,10 @@
|
|
|
8272
8611
|
ProgramKey.Get = Get;
|
|
8273
8612
|
function GetList(params) {
|
|
8274
8613
|
return __awaiter(this, void 0, void 0, function* () {
|
|
8275
|
-
|
|
8614
|
+
let { api, req: reqParams } = params;
|
|
8615
|
+
if (!api) {
|
|
8616
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
8617
|
+
}
|
|
8276
8618
|
const cache = yield api.GetCacheItem(GetListCacheKey(), reqParams);
|
|
8277
8619
|
if (cache === null || cache === void 0 ? void 0 : cache.found) {
|
|
8278
8620
|
return cache.data;
|
|
@@ -8299,7 +8641,10 @@
|
|
|
8299
8641
|
ProgramKey.GetList = GetList;
|
|
8300
8642
|
function Delete(params) {
|
|
8301
8643
|
return __awaiter(this, void 0, void 0, function* () {
|
|
8302
|
-
|
|
8644
|
+
let { api, programId, req: reqParams } = params;
|
|
8645
|
+
if (!api) {
|
|
8646
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
8647
|
+
}
|
|
8303
8648
|
if (!programId) {
|
|
8304
8649
|
throw ("Program ID is required.");
|
|
8305
8650
|
}
|
|
@@ -8311,7 +8656,10 @@
|
|
|
8311
8656
|
ProgramKey.Delete = Delete;
|
|
8312
8657
|
function Update(params) {
|
|
8313
8658
|
return __awaiter(this, void 0, void 0, function* () {
|
|
8314
|
-
|
|
8659
|
+
let { api, programKey: data, req: reqParams } = params;
|
|
8660
|
+
if (!api) {
|
|
8661
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
8662
|
+
}
|
|
8315
8663
|
if (!(data === null || data === void 0 ? void 0 : data.ProgramId)) {
|
|
8316
8664
|
throw ("Program ID is required.");
|
|
8317
8665
|
}
|
|
@@ -8372,7 +8720,10 @@
|
|
|
8372
8720
|
})(EPivot = Tileset.EPivot || (Tileset.EPivot = {}));
|
|
8373
8721
|
function Get(params) {
|
|
8374
8722
|
return __awaiter(this, void 0, void 0, function* () {
|
|
8375
|
-
|
|
8723
|
+
let { api, tilesetId, loadFiles, req: reqParams } = params;
|
|
8724
|
+
if (!api) {
|
|
8725
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
8726
|
+
}
|
|
8376
8727
|
if (!tilesetId) {
|
|
8377
8728
|
throw ("Tileset ID is required.");
|
|
8378
8729
|
}
|
|
@@ -8403,13 +8754,18 @@
|
|
|
8403
8754
|
/**
|
|
8404
8755
|
* Returns tileset types for given tileset ids.
|
|
8405
8756
|
* @param params
|
|
8757
|
+
* @deprecated Just use GetList and Get to find the type from the tileset record.
|
|
8406
8758
|
* @returns
|
|
8407
8759
|
*/
|
|
8408
8760
|
function GetTypes(params) {
|
|
8409
8761
|
return __awaiter(this, void 0, void 0, function* () {
|
|
8762
|
+
// UPDATE: This was corrected, this will be removed.
|
|
8410
8763
|
// Our api is auto-converting legacy types right now which makes it impossible to know what they are.
|
|
8411
8764
|
// This uses the legacy end-point which doesn't do that...
|
|
8412
|
-
|
|
8765
|
+
let { api, tilesetIds, req: reqParams } = params;
|
|
8766
|
+
if (!api) {
|
|
8767
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
8768
|
+
}
|
|
8413
8769
|
const mapping = {};
|
|
8414
8770
|
if (tilesetIds.length == 1) {
|
|
8415
8771
|
const tileset = yield api.GET("ui.tileset/" + tilesetIds[0], exports.Api.PrepReqParams(reqParams));
|
|
@@ -8433,7 +8789,10 @@
|
|
|
8433
8789
|
Tileset.GetTypes = GetTypes;
|
|
8434
8790
|
function GetList(params) {
|
|
8435
8791
|
return __awaiter(this, void 0, void 0, function* () {
|
|
8436
|
-
|
|
8792
|
+
let { api, req: reqParams } = params;
|
|
8793
|
+
if (!api) {
|
|
8794
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
8795
|
+
}
|
|
8437
8796
|
const cache = yield api.GetCacheItem(GetListCacheKey(), reqParams);
|
|
8438
8797
|
if (cache === null || cache === void 0 ? void 0 : cache.found) {
|
|
8439
8798
|
return cache.data;
|
|
@@ -8460,7 +8819,10 @@
|
|
|
8460
8819
|
Tileset.GetList = GetList;
|
|
8461
8820
|
function Delete(params) {
|
|
8462
8821
|
return __awaiter(this, void 0, void 0, function* () {
|
|
8463
|
-
|
|
8822
|
+
let { api, tilesetId, req: reqParams } = params;
|
|
8823
|
+
if (!api) {
|
|
8824
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
8825
|
+
}
|
|
8464
8826
|
if (!tilesetId) {
|
|
8465
8827
|
throw ("Tileset ID is required.");
|
|
8466
8828
|
}
|
|
@@ -8473,6 +8835,9 @@
|
|
|
8473
8835
|
function Update(params) {
|
|
8474
8836
|
return __awaiter(this, void 0, void 0, function* () {
|
|
8475
8837
|
let { api, tileset: data, req: reqParams } = params;
|
|
8838
|
+
if (!api) {
|
|
8839
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
8840
|
+
}
|
|
8476
8841
|
if (!(data === null || data === void 0 ? void 0 : data.name) || !(data === null || data === void 0 ? void 0 : data.type)) {
|
|
8477
8842
|
throw ("Tileset name and type are required.");
|
|
8478
8843
|
}
|
|
@@ -8493,6 +8858,9 @@
|
|
|
8493
8858
|
function UploadFile(params) {
|
|
8494
8859
|
return __awaiter(this, void 0, void 0, function* () {
|
|
8495
8860
|
let { api, file, req, tilesetId, onProgress } = params;
|
|
8861
|
+
if (!api) {
|
|
8862
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
8863
|
+
}
|
|
8496
8864
|
if (!tilesetId || !file) {
|
|
8497
8865
|
throw ("Tileset ID and file are required.");
|
|
8498
8866
|
}
|
|
@@ -8530,7 +8898,10 @@
|
|
|
8530
8898
|
Tileset.UploadFile = UploadFile;
|
|
8531
8899
|
function DeleteFile(params) {
|
|
8532
8900
|
return __awaiter(this, void 0, void 0, function* () {
|
|
8533
|
-
|
|
8901
|
+
let { api, tilesetId, file, req: reqParams } = params;
|
|
8902
|
+
if (!api) {
|
|
8903
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
8904
|
+
}
|
|
8534
8905
|
if (!tilesetId || !file) {
|
|
8535
8906
|
throw ("Tileset ID and file are required.");
|
|
8536
8907
|
}
|
|
@@ -8542,6 +8913,9 @@
|
|
|
8542
8913
|
function UploadSrcFile(params) {
|
|
8543
8914
|
return __awaiter(this, void 0, void 0, function* () {
|
|
8544
8915
|
let { api, file, req, tilesetId, onProgress } = params;
|
|
8916
|
+
if (!api) {
|
|
8917
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
8918
|
+
}
|
|
8545
8919
|
if (!tilesetId || !file) {
|
|
8546
8920
|
throw ("Tileset ID and file are required.");
|
|
8547
8921
|
}
|
|
@@ -8580,7 +8954,10 @@
|
|
|
8580
8954
|
Tileset.UploadSrcFile = UploadSrcFile;
|
|
8581
8955
|
function DeleteSrcFile(params) {
|
|
8582
8956
|
return __awaiter(this, void 0, void 0, function* () {
|
|
8583
|
-
|
|
8957
|
+
let { api, tilesetId, file, req: reqParams } = params;
|
|
8958
|
+
if (!api) {
|
|
8959
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
8960
|
+
}
|
|
8584
8961
|
if (!tilesetId || !file) {
|
|
8585
8962
|
throw ("Tileset ID and file are required.");
|
|
8586
8963
|
}
|
|
@@ -8591,6 +8968,9 @@
|
|
|
8591
8968
|
Tileset.DeleteSrcFile = DeleteSrcFile;
|
|
8592
8969
|
function GetFileUrl(params) {
|
|
8593
8970
|
let { api, tilesetId, file } = params;
|
|
8971
|
+
if (!api) {
|
|
8972
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
8973
|
+
}
|
|
8594
8974
|
if (!tilesetId) {
|
|
8595
8975
|
throw ("Tileset ID is required.");
|
|
8596
8976
|
}
|
|
@@ -8602,6 +8982,9 @@
|
|
|
8602
8982
|
Tileset.GetFileUrl = GetFileUrl;
|
|
8603
8983
|
function GetSrcFileUrl(params) {
|
|
8604
8984
|
let { api, tilesetId, file } = params;
|
|
8985
|
+
if (!api) {
|
|
8986
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
8987
|
+
}
|
|
8605
8988
|
if (!tilesetId) {
|
|
8606
8989
|
throw ("Tileset ID is required.");
|
|
8607
8990
|
}
|
|
@@ -8613,6 +8996,9 @@
|
|
|
8613
8996
|
Tileset.GetSrcFileUrl = GetSrcFileUrl;
|
|
8614
8997
|
function GetPublicFileUrl(params) {
|
|
8615
8998
|
let { api, tilesetId, file } = params;
|
|
8999
|
+
if (!api) {
|
|
9000
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
9001
|
+
}
|
|
8616
9002
|
if (!tilesetId) {
|
|
8617
9003
|
throw ("Tileset ID is required.");
|
|
8618
9004
|
}
|
|
@@ -8624,7 +9010,10 @@
|
|
|
8624
9010
|
Tileset.GetPublicFileUrl = GetPublicFileUrl;
|
|
8625
9011
|
function Generate(params) {
|
|
8626
9012
|
return __awaiter(this, void 0, void 0, function* () {
|
|
8627
|
-
|
|
9013
|
+
let { api, tilesetId, req: reqParams } = params;
|
|
9014
|
+
if (!api) {
|
|
9015
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
9016
|
+
}
|
|
8628
9017
|
if (!tilesetId) {
|
|
8629
9018
|
throw ("Tileset ID is required.");
|
|
8630
9019
|
}
|
|
@@ -8646,7 +9035,10 @@
|
|
|
8646
9035
|
Publish.GetCacheKey = GetCacheKey;
|
|
8647
9036
|
function Update(params) {
|
|
8648
9037
|
return __awaiter(this, void 0, void 0, function* () {
|
|
8649
|
-
|
|
9038
|
+
let { api, published: data, req: reqParams } = params;
|
|
9039
|
+
if (!api) {
|
|
9040
|
+
api = exports.ENVIRONMENT.GetGetters().GetGlobalApi();
|
|
9041
|
+
}
|
|
8650
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"])) {
|
|
8651
9043
|
throw ("Tileset ID, client account ID, and user ID are required.");
|
|
8652
9044
|
}
|
|
@@ -8669,7 +9061,10 @@
|
|
|
8669
9061
|
Publish.Update = Update;
|
|
8670
9062
|
function Get(params) {
|
|
8671
9063
|
return __awaiter(this, void 0, void 0, function* () {
|
|
8672
|
-
|
|
9064
|
+
let { api, accountId, tilesetId, req: reqParams } = params;
|
|
9065
|
+
if (!api) {
|
|
9066
|
+
api = exports.ENVIRONMENT.GetGetters().GetGlobalApi();
|
|
9067
|
+
}
|
|
8673
9068
|
if (!accountId || !tilesetId) {
|
|
8674
9069
|
throw ("Client account ID and tileset ID are required.");
|
|
8675
9070
|
}
|
|
@@ -8699,7 +9094,10 @@
|
|
|
8699
9094
|
Publish.Get = Get;
|
|
8700
9095
|
function GetList(params) {
|
|
8701
9096
|
return __awaiter(this, void 0, void 0, function* () {
|
|
8702
|
-
|
|
9097
|
+
let { api, accountId, req: reqParams } = params;
|
|
9098
|
+
if (!api) {
|
|
9099
|
+
api = exports.ENVIRONMENT.GetGetters().GetGlobalApi();
|
|
9100
|
+
}
|
|
8703
9101
|
if (!accountId) {
|
|
8704
9102
|
throw ("Client account ID is required.");
|
|
8705
9103
|
}
|
|
@@ -8879,7 +9277,10 @@
|
|
|
8879
9277
|
})(Navigator = ProjectViewBookmark.Navigator || (ProjectViewBookmark.Navigator = {}));
|
|
8880
9278
|
function Get(params) {
|
|
8881
9279
|
return __awaiter(this, void 0, void 0, function* () {
|
|
8882
|
-
|
|
9280
|
+
let { api, viewId, bookmarkId, req: reqParams } = params;
|
|
9281
|
+
if (!api) {
|
|
9282
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
9283
|
+
}
|
|
8883
9284
|
if (!viewId || !bookmarkId) {
|
|
8884
9285
|
throw ("View ID and Bookmark ID are required.");
|
|
8885
9286
|
}
|
|
@@ -8910,7 +9311,10 @@
|
|
|
8910
9311
|
ProjectViewBookmark.Get = Get;
|
|
8911
9312
|
function Delete(params) {
|
|
8912
9313
|
return __awaiter(this, void 0, void 0, function* () {
|
|
8913
|
-
|
|
9314
|
+
let { api, viewId, bookmarkId, req: reqParams } = params;
|
|
9315
|
+
if (!api) {
|
|
9316
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
9317
|
+
}
|
|
8914
9318
|
if (!viewId || !bookmarkId) {
|
|
8915
9319
|
throw ("View ID and Bookmark ID are required.");
|
|
8916
9320
|
}
|
|
@@ -8922,7 +9326,10 @@
|
|
|
8922
9326
|
ProjectViewBookmark.Delete = Delete;
|
|
8923
9327
|
function GetList(params) {
|
|
8924
9328
|
return __awaiter(this, void 0, void 0, function* () {
|
|
8925
|
-
|
|
9329
|
+
let { api, viewId, req: reqParams } = params;
|
|
9330
|
+
if (!api) {
|
|
9331
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
9332
|
+
}
|
|
8926
9333
|
if (!viewId) {
|
|
8927
9334
|
throw ("View ID is required.");
|
|
8928
9335
|
}
|
|
@@ -8969,7 +9376,10 @@
|
|
|
8969
9376
|
ProjectViewBookmark.GetList = GetList;
|
|
8970
9377
|
function Update(params) {
|
|
8971
9378
|
return __awaiter(this, void 0, void 0, function* () {
|
|
8972
|
-
|
|
9379
|
+
let { api, viewId, bookmark: data, req: reqParams } = params;
|
|
9380
|
+
if (!api) {
|
|
9381
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
9382
|
+
}
|
|
8973
9383
|
if (!(data === null || data === void 0 ? void 0 : data.Title)) {
|
|
8974
9384
|
data.Title = data.ID;
|
|
8975
9385
|
}
|
|
@@ -8984,7 +9394,10 @@
|
|
|
8984
9394
|
ProjectViewBookmark.Update = Update;
|
|
8985
9395
|
function SetOrder(params) {
|
|
8986
9396
|
return __awaiter(this, void 0, void 0, function* () {
|
|
8987
|
-
|
|
9397
|
+
let { api, viewId, bookmarkIds, req: reqParams } = params;
|
|
9398
|
+
if (!api) {
|
|
9399
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
9400
|
+
}
|
|
8988
9401
|
const reqData = {
|
|
8989
9402
|
"UISlide.ID": bookmarkIds,
|
|
8990
9403
|
"DisplayOrder.Start": 0
|
|
@@ -9018,7 +9431,10 @@
|
|
|
9018
9431
|
})(Navigator = ProjectView.Navigator || (ProjectView.Navigator = {}));
|
|
9019
9432
|
function Get(params) {
|
|
9020
9433
|
return __awaiter(this, void 0, void 0, function* () {
|
|
9021
|
-
|
|
9434
|
+
let { api, viewId, req: reqParams } = params;
|
|
9435
|
+
if (!api) {
|
|
9436
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
9437
|
+
}
|
|
9022
9438
|
if (!viewId) {
|
|
9023
9439
|
throw ("View ID is required.");
|
|
9024
9440
|
}
|
|
@@ -9049,7 +9465,10 @@
|
|
|
9049
9465
|
ProjectView.Get = Get;
|
|
9050
9466
|
function GetList(params) {
|
|
9051
9467
|
return __awaiter(this, void 0, void 0, function* () {
|
|
9052
|
-
|
|
9468
|
+
let { api, req: reqParams } = params;
|
|
9469
|
+
if (!api) {
|
|
9470
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
9471
|
+
}
|
|
9053
9472
|
const cache = yield api.GetCacheItem(GetListCacheKey(), reqParams);
|
|
9054
9473
|
if (cache === null || cache === void 0 ? void 0 : cache.found) {
|
|
9055
9474
|
return cache.data;
|
|
@@ -9076,7 +9495,10 @@
|
|
|
9076
9495
|
ProjectView.GetList = GetList;
|
|
9077
9496
|
function Delete(params) {
|
|
9078
9497
|
return __awaiter(this, void 0, void 0, function* () {
|
|
9079
|
-
|
|
9498
|
+
let { api, viewId, req: reqParams } = params;
|
|
9499
|
+
if (!api) {
|
|
9500
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
9501
|
+
}
|
|
9080
9502
|
if (!viewId) {
|
|
9081
9503
|
throw ("View ID is required.");
|
|
9082
9504
|
}
|
|
@@ -9089,6 +9511,9 @@
|
|
|
9089
9511
|
function Update(params) {
|
|
9090
9512
|
return __awaiter(this, void 0, void 0, function* () {
|
|
9091
9513
|
let { api, view: data, req: reqParams } = params;
|
|
9514
|
+
if (!api) {
|
|
9515
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
9516
|
+
}
|
|
9092
9517
|
if (!data) {
|
|
9093
9518
|
data = {};
|
|
9094
9519
|
}
|
|
@@ -9145,7 +9570,10 @@
|
|
|
9145
9570
|
function MergeMapTemplateData(params) {
|
|
9146
9571
|
var _a;
|
|
9147
9572
|
return __awaiter(this, void 0, void 0, function* () {
|
|
9148
|
-
|
|
9573
|
+
let { getter, sources: items, addIfMissing, req: reqParams } = params;
|
|
9574
|
+
if (!getter) {
|
|
9575
|
+
getter = exports.ENVIRONMENT.GetGetters().GetBruceGetter();
|
|
9576
|
+
}
|
|
9149
9577
|
const settings = yield getTemplateSettings(getter, reqParams);
|
|
9150
9578
|
const maps = (_a = settings.CesiumMapSources) !== null && _a !== void 0 ? _a : [];
|
|
9151
9579
|
for (let i = 0; i < maps.length; i++) {
|
|
@@ -9161,7 +9589,10 @@
|
|
|
9161
9589
|
function MergeTerrainTemplateData(params) {
|
|
9162
9590
|
var _a;
|
|
9163
9591
|
return __awaiter(this, void 0, void 0, function* () {
|
|
9164
|
-
|
|
9592
|
+
let { getter, sources: items, addIfMissing, req: reqParams } = params;
|
|
9593
|
+
if (!getter) {
|
|
9594
|
+
getter = exports.ENVIRONMENT.GetGetters().GetBruceGetter();
|
|
9595
|
+
}
|
|
9165
9596
|
const settings = yield getTemplateSettings(getter, reqParams);
|
|
9166
9597
|
const terrains = (_a = settings.CesiumTerrainSources) !== null && _a !== void 0 ? _a : [];
|
|
9167
9598
|
for (let i = 0; i < terrains.length; i++) {
|
|
@@ -9315,7 +9746,10 @@
|
|
|
9315
9746
|
})(EMessageType = PendingAction.EMessageType || (PendingAction.EMessageType = {}));
|
|
9316
9747
|
function Get(params) {
|
|
9317
9748
|
return __awaiter(this, void 0, void 0, function* () {
|
|
9318
|
-
|
|
9749
|
+
let { api, actionId, req: reqParams } = params;
|
|
9750
|
+
if (!api) {
|
|
9751
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
9752
|
+
}
|
|
9319
9753
|
if (!actionId) {
|
|
9320
9754
|
throw ("Action ID is required.");
|
|
9321
9755
|
}
|
|
@@ -9328,7 +9762,10 @@
|
|
|
9328
9762
|
PendingAction.Get = Get;
|
|
9329
9763
|
function GetRelevantList(params) {
|
|
9330
9764
|
return __awaiter(this, void 0, void 0, function* () {
|
|
9331
|
-
|
|
9765
|
+
let { api, stricter, reqParams } = params;
|
|
9766
|
+
if (!api) {
|
|
9767
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
9768
|
+
}
|
|
9332
9769
|
const data = yield api.GET(`pendingActions/important?Update=${Boolean(stricter)}`, exports.Api.PrepReqParams(reqParams));
|
|
9333
9770
|
return {
|
|
9334
9771
|
actions: data.Items
|
|
@@ -9339,6 +9776,9 @@
|
|
|
9339
9776
|
function GetMessages(params) {
|
|
9340
9777
|
return __awaiter(this, void 0, void 0, function* () {
|
|
9341
9778
|
let { api, actionId, order, startIndex, amount, req: reqParams, types } = params;
|
|
9779
|
+
if (!api) {
|
|
9780
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
9781
|
+
}
|
|
9342
9782
|
if (amount == null) {
|
|
9343
9783
|
amount = 500;
|
|
9344
9784
|
}
|
|
@@ -9385,7 +9825,10 @@
|
|
|
9385
9825
|
})(EPointType = Style.EPointType || (Style.EPointType = {}));
|
|
9386
9826
|
function GetList(params) {
|
|
9387
9827
|
return __awaiter(this, void 0, void 0, function* () {
|
|
9388
|
-
|
|
9828
|
+
let { api, req: reqParams } = params;
|
|
9829
|
+
if (!api) {
|
|
9830
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
9831
|
+
}
|
|
9389
9832
|
const cache = yield api.GetCacheItem(GetListCacheKey(), reqParams);
|
|
9390
9833
|
if (cache === null || cache === void 0 ? void 0 : cache.found) {
|
|
9391
9834
|
return cache.data;
|
|
@@ -9412,7 +9855,10 @@
|
|
|
9412
9855
|
Style.GetList = GetList;
|
|
9413
9856
|
function Get(params) {
|
|
9414
9857
|
return __awaiter(this, void 0, void 0, function* () {
|
|
9415
|
-
|
|
9858
|
+
let { api, styleId: id, req: reqParams } = params;
|
|
9859
|
+
if (!api) {
|
|
9860
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
9861
|
+
}
|
|
9416
9862
|
if (!id) {
|
|
9417
9863
|
throw ("Style ID is required.");
|
|
9418
9864
|
}
|
|
@@ -9442,7 +9888,10 @@
|
|
|
9442
9888
|
Style.Get = Get;
|
|
9443
9889
|
function Update(params) {
|
|
9444
9890
|
return __awaiter(this, void 0, void 0, function* () {
|
|
9445
|
-
|
|
9891
|
+
let { api, style: data, req: reqParams } = params;
|
|
9892
|
+
if (!api) {
|
|
9893
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
9894
|
+
}
|
|
9446
9895
|
if (!(data === null || data === void 0 ? void 0 : data.Name)) {
|
|
9447
9896
|
throw ("Style name is required.");
|
|
9448
9897
|
}
|
|
@@ -9460,7 +9909,10 @@
|
|
|
9460
9909
|
Style.Update = Update;
|
|
9461
9910
|
function Delete(params) {
|
|
9462
9911
|
return __awaiter(this, void 0, void 0, function* () {
|
|
9463
|
-
|
|
9912
|
+
let { api, styleId: id, req: reqParams } = params;
|
|
9913
|
+
if (!api) {
|
|
9914
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
9915
|
+
}
|
|
9464
9916
|
if (!id) {
|
|
9465
9917
|
throw ("Style ID is required.");
|
|
9466
9918
|
}
|
|
@@ -9495,7 +9947,10 @@
|
|
|
9495
9947
|
}
|
|
9496
9948
|
function Get(params) {
|
|
9497
9949
|
return __awaiter(this, void 0, void 0, function* () {
|
|
9498
|
-
|
|
9950
|
+
let { api, sessionId, req: reqParams } = params;
|
|
9951
|
+
if (!api) {
|
|
9952
|
+
api = exports.ENVIRONMENT.GetGetters().GetGuardianApi();
|
|
9953
|
+
}
|
|
9499
9954
|
if (!sessionId) {
|
|
9500
9955
|
throw ("Session ID is required.");
|
|
9501
9956
|
}
|
|
@@ -9533,7 +9988,10 @@
|
|
|
9533
9988
|
*/
|
|
9534
9989
|
function Login(params) {
|
|
9535
9990
|
return __awaiter(this, void 0, void 0, function* () {
|
|
9536
|
-
|
|
9991
|
+
let { api, username, password, accountId, req: reqParams } = params;
|
|
9992
|
+
if (!api) {
|
|
9993
|
+
api = exports.ENVIRONMENT.GetGetters().GetGuardianApi();
|
|
9994
|
+
}
|
|
9537
9995
|
const data = yield api.POST("login", {
|
|
9538
9996
|
account: accountId ? accountId : "",
|
|
9539
9997
|
login: username,
|
|
@@ -9551,7 +10009,10 @@
|
|
|
9551
10009
|
Session.Login = Login;
|
|
9552
10010
|
function Logout(params) {
|
|
9553
10011
|
return __awaiter(this, void 0, void 0, function* () {
|
|
9554
|
-
|
|
10012
|
+
let { api, req: reqParams } = params;
|
|
10013
|
+
if (!api) {
|
|
10014
|
+
api = exports.ENVIRONMENT.GetGetters().GetGuardianApi();
|
|
10015
|
+
}
|
|
9555
10016
|
const ssid = api.GetSessionId();
|
|
9556
10017
|
if (ssid) {
|
|
9557
10018
|
yield api.POST("logout", null, reqParams);
|
|
@@ -9618,7 +10079,10 @@
|
|
|
9618
10079
|
(function (UserGroup) {
|
|
9619
10080
|
function GetByName(params) {
|
|
9620
10081
|
return __awaiter(this, void 0, void 0, function* () {
|
|
9621
|
-
|
|
10082
|
+
let { api, accountId, name, req: reqParams } = params;
|
|
10083
|
+
if (!api) {
|
|
10084
|
+
api = exports.ENVIRONMENT.GetGetters().GetGuardianApi();
|
|
10085
|
+
}
|
|
9622
10086
|
if (!name || !accountId) {
|
|
9623
10087
|
throw ("Name and AccountID are required.");
|
|
9624
10088
|
}
|
|
@@ -9631,7 +10095,10 @@
|
|
|
9631
10095
|
UserGroup.GetByName = GetByName;
|
|
9632
10096
|
function GetUsers(params) {
|
|
9633
10097
|
return __awaiter(this, void 0, void 0, function* () {
|
|
9634
|
-
|
|
10098
|
+
let { api, accountId, groupId: id, req: reqParams } = params;
|
|
10099
|
+
if (!api) {
|
|
10100
|
+
api = exports.ENVIRONMENT.GetGetters().GetGuardianApi();
|
|
10101
|
+
}
|
|
9635
10102
|
if (!accountId || !id) {
|
|
9636
10103
|
throw ("AccountID and ID are required.");
|
|
9637
10104
|
}
|
|
@@ -9644,7 +10111,10 @@
|
|
|
9644
10111
|
UserGroup.GetUsers = GetUsers;
|
|
9645
10112
|
function GetListByPerm(params) {
|
|
9646
10113
|
return __awaiter(this, void 0, void 0, function* () {
|
|
9647
|
-
|
|
10114
|
+
let { api, accountId, perm, req: reqParams } = params;
|
|
10115
|
+
if (!api) {
|
|
10116
|
+
api = exports.ENVIRONMENT.GetGetters().GetGuardianApi();
|
|
10117
|
+
}
|
|
9648
10118
|
if (!accountId || !perm) {
|
|
9649
10119
|
throw ("AccountID and Perm are required.");
|
|
9650
10120
|
}
|
|
@@ -9657,7 +10127,10 @@
|
|
|
9657
10127
|
UserGroup.GetListByPerm = GetListByPerm;
|
|
9658
10128
|
function GetList(params) {
|
|
9659
10129
|
return __awaiter(this, void 0, void 0, function* () {
|
|
9660
|
-
|
|
10130
|
+
let { api, accountId, req: reqParams } = params;
|
|
10131
|
+
if (!api) {
|
|
10132
|
+
api = exports.ENVIRONMENT.GetGetters().GetGuardianApi();
|
|
10133
|
+
}
|
|
9661
10134
|
if (!accountId) {
|
|
9662
10135
|
throw ("AccountID is required.");
|
|
9663
10136
|
}
|
|
@@ -9670,7 +10143,10 @@
|
|
|
9670
10143
|
UserGroup.GetList = GetList;
|
|
9671
10144
|
function Delete(params) {
|
|
9672
10145
|
return __awaiter(this, void 0, void 0, function* () {
|
|
9673
|
-
|
|
10146
|
+
let { api, accountId, groupId: id, req: reqParams } = params;
|
|
10147
|
+
if (!api) {
|
|
10148
|
+
api = exports.ENVIRONMENT.GetGetters().GetGuardianApi();
|
|
10149
|
+
}
|
|
9674
10150
|
if (!accountId || !id) {
|
|
9675
10151
|
throw ("AccountID and ID are required.");
|
|
9676
10152
|
}
|
|
@@ -9680,7 +10156,10 @@
|
|
|
9680
10156
|
UserGroup.Delete = Delete;
|
|
9681
10157
|
function Update(params) {
|
|
9682
10158
|
return __awaiter(this, void 0, void 0, function* () {
|
|
9683
|
-
|
|
10159
|
+
let { api, group: data, reqParams } = params;
|
|
10160
|
+
if (!api) {
|
|
10161
|
+
api = exports.ENVIRONMENT.GetGetters().GetGuardianApi();
|
|
10162
|
+
}
|
|
9684
10163
|
if (!data.Name || !data["ClientAccount.ID"]) {
|
|
9685
10164
|
throw ("User group name and client account ID are required.");
|
|
9686
10165
|
}
|
|
@@ -9719,7 +10198,10 @@
|
|
|
9719
10198
|
})(EType = User.EType || (User.EType = {}));
|
|
9720
10199
|
function Get(params) {
|
|
9721
10200
|
return __awaiter(this, void 0, void 0, function* () {
|
|
9722
|
-
|
|
10201
|
+
let { api, userId: id, accountId, req: reqParams } = params;
|
|
10202
|
+
if (!api) {
|
|
10203
|
+
api = exports.ENVIRONMENT.GetGetters().GetGuardianApi();
|
|
10204
|
+
}
|
|
9723
10205
|
if (!id) {
|
|
9724
10206
|
throw ("ID is required.");
|
|
9725
10207
|
}
|
|
@@ -9750,7 +10232,10 @@
|
|
|
9750
10232
|
function Update(params) {
|
|
9751
10233
|
var _a;
|
|
9752
10234
|
return __awaiter(this, void 0, void 0, function* () {
|
|
9753
|
-
|
|
10235
|
+
let { api, user: data, req: reqParams } = params;
|
|
10236
|
+
if (!api) {
|
|
10237
|
+
api = exports.ENVIRONMENT.GetGetters().GetGuardianApi();
|
|
10238
|
+
}
|
|
9754
10239
|
if (!(data === null || data === void 0 ? void 0 : data.ID) || !(data === null || data === void 0 ? void 0 : data.Type)) {
|
|
9755
10240
|
throw ("ID and Type are required.");
|
|
9756
10241
|
}
|
|
@@ -9788,7 +10273,10 @@
|
|
|
9788
10273
|
*/
|
|
9789
10274
|
function GetSettings(params) {
|
|
9790
10275
|
return __awaiter(this, void 0, void 0, function* () {
|
|
9791
|
-
|
|
10276
|
+
let { api, userId, appId, req } = params;
|
|
10277
|
+
if (!api) {
|
|
10278
|
+
api = exports.ENVIRONMENT.GetGetters().GetGuardianApi();
|
|
10279
|
+
}
|
|
9792
10280
|
if (!userId || !appId) {
|
|
9793
10281
|
throw ("UserId and appId are required.");
|
|
9794
10282
|
}
|
|
@@ -9835,7 +10323,10 @@
|
|
|
9835
10323
|
*/
|
|
9836
10324
|
function UpdateSettings(params) {
|
|
9837
10325
|
return __awaiter(this, void 0, void 0, function* () {
|
|
9838
|
-
|
|
10326
|
+
let { api, accId, userId, appId, settings, req } = params;
|
|
10327
|
+
if (!api) {
|
|
10328
|
+
api = exports.ENVIRONMENT.GetGetters().GetGuardianApi();
|
|
10329
|
+
}
|
|
9839
10330
|
if (!userId || !appId) {
|
|
9840
10331
|
throw ("UserId and appId are required.");
|
|
9841
10332
|
}
|
|
@@ -9853,7 +10344,10 @@
|
|
|
9853
10344
|
User.UpdateSettings = UpdateSettings;
|
|
9854
10345
|
function GetUsernameAvailable(params) {
|
|
9855
10346
|
return __awaiter(this, void 0, void 0, function* () {
|
|
9856
|
-
|
|
10347
|
+
let { api, username, excludeUserId, req: reqParams } = params;
|
|
10348
|
+
if (!api) {
|
|
10349
|
+
api = exports.ENVIRONMENT.GetGetters().GetGuardianApi();
|
|
10350
|
+
}
|
|
9857
10351
|
if (!username) {
|
|
9858
10352
|
throw ("Username is required.");
|
|
9859
10353
|
}
|
|
@@ -9881,7 +10375,10 @@
|
|
|
9881
10375
|
LoginUser.GetListCacheKey = GetListCacheKey;
|
|
9882
10376
|
function GetByEmail(params) {
|
|
9883
10377
|
return __awaiter(this, void 0, void 0, function* () {
|
|
9884
|
-
|
|
10378
|
+
let { api, email, accountId, req: reqParams } = params;
|
|
10379
|
+
if (!api) {
|
|
10380
|
+
api = exports.ENVIRONMENT.GetGetters().GetGuardianApi();
|
|
10381
|
+
}
|
|
9885
10382
|
if (!email) {
|
|
9886
10383
|
throw ("Email is required.");
|
|
9887
10384
|
}
|
|
@@ -9912,6 +10409,9 @@
|
|
|
9912
10409
|
function GetList(params) {
|
|
9913
10410
|
return __awaiter(this, void 0, void 0, function* () {
|
|
9914
10411
|
let { api, accountId, exclusive, req: reqParams } = params;
|
|
10412
|
+
if (!api) {
|
|
10413
|
+
api = exports.ENVIRONMENT.GetGetters().GetGuardianApi();
|
|
10414
|
+
}
|
|
9915
10415
|
if (!accountId) {
|
|
9916
10416
|
throw ("Client account ID is required.");
|
|
9917
10417
|
}
|
|
@@ -9963,7 +10463,10 @@
|
|
|
9963
10463
|
*/
|
|
9964
10464
|
function Signup(params) {
|
|
9965
10465
|
return __awaiter(this, void 0, void 0, function* () {
|
|
9966
|
-
|
|
10466
|
+
let { api, email, req: reqParams } = params;
|
|
10467
|
+
if (!api) {
|
|
10468
|
+
api = exports.ENVIRONMENT.GetGetters().GetGuardianApi();
|
|
10469
|
+
}
|
|
9967
10470
|
if (!email) {
|
|
9968
10471
|
throw ("Email is required.");
|
|
9969
10472
|
}
|
|
@@ -9980,7 +10483,10 @@
|
|
|
9980
10483
|
*/
|
|
9981
10484
|
function SignupResend(params) {
|
|
9982
10485
|
return __awaiter(this, void 0, void 0, function* () {
|
|
9983
|
-
|
|
10486
|
+
let { api, expiredCode, req: reqParams } = params;
|
|
10487
|
+
if (!api) {
|
|
10488
|
+
api = exports.ENVIRONMENT.GetGetters().GetGuardianApi();
|
|
10489
|
+
}
|
|
9984
10490
|
if (!expiredCode) {
|
|
9985
10491
|
throw ("Expired activation code is required.");
|
|
9986
10492
|
}
|
|
@@ -9996,6 +10502,9 @@
|
|
|
9996
10502
|
function SignupComplete(params) {
|
|
9997
10503
|
return __awaiter(this, void 0, void 0, function* () {
|
|
9998
10504
|
let { api, code, user: data, accountId, req: reqParams } = params;
|
|
10505
|
+
if (!api) {
|
|
10506
|
+
api = exports.ENVIRONMENT.GetGetters().GetGuardianApi();
|
|
10507
|
+
}
|
|
9999
10508
|
if (!code || !(data === null || data === void 0 ? void 0 : data.Login) || !(data === null || data === void 0 ? void 0 : data.Password)) {
|
|
10000
10509
|
throw ("Login, password, and activation code are required.");
|
|
10001
10510
|
}
|
|
@@ -10021,7 +10530,10 @@
|
|
|
10021
10530
|
*/
|
|
10022
10531
|
function ForgotPassword(params) {
|
|
10023
10532
|
return __awaiter(this, void 0, void 0, function* () {
|
|
10024
|
-
|
|
10533
|
+
let { api, accountId, email, req: reqParams } = params;
|
|
10534
|
+
if (!api) {
|
|
10535
|
+
api = exports.ENVIRONMENT.GetGetters().GetGuardianApi();
|
|
10536
|
+
}
|
|
10025
10537
|
if (!accountId || !email) {
|
|
10026
10538
|
throw ("Account ID and email are required.");
|
|
10027
10539
|
}
|
|
@@ -10050,7 +10562,10 @@
|
|
|
10050
10562
|
*/
|
|
10051
10563
|
function ForgotPasswordComplete(params) {
|
|
10052
10564
|
return __awaiter(this, void 0, void 0, function* () {
|
|
10053
|
-
|
|
10565
|
+
let { api, code, userId, password, req: reqParams } = params;
|
|
10566
|
+
if (!api) {
|
|
10567
|
+
api = exports.ENVIRONMENT.GetGetters().GetGuardianApi();
|
|
10568
|
+
}
|
|
10054
10569
|
const { user } = yield Get({
|
|
10055
10570
|
api: api,
|
|
10056
10571
|
userId: userId,
|
|
@@ -10079,7 +10594,10 @@
|
|
|
10079
10594
|
AccessToken.GetListCacheKey = GetListCacheKey;
|
|
10080
10595
|
function GetList(params) {
|
|
10081
10596
|
return __awaiter(this, void 0, void 0, function* () {
|
|
10082
|
-
|
|
10597
|
+
let { api, accountId, req: reqParams } = params;
|
|
10598
|
+
if (!api) {
|
|
10599
|
+
api = exports.ENVIRONMENT.GetGetters().GetGuardianApi();
|
|
10600
|
+
}
|
|
10083
10601
|
const cache = yield api.GetCacheItem(GetListCacheKey(accountId), reqParams);
|
|
10084
10602
|
if (cache === null || cache === void 0 ? void 0 : cache.found) {
|
|
10085
10603
|
return cache.data;
|
|
@@ -10118,7 +10636,10 @@
|
|
|
10118
10636
|
AccessToken.GetList = GetList;
|
|
10119
10637
|
function Delete(params) {
|
|
10120
10638
|
return __awaiter(this, void 0, void 0, function* () {
|
|
10121
|
-
|
|
10639
|
+
let { api, tokenId: id, req: reqParams } = params;
|
|
10640
|
+
if (!api) {
|
|
10641
|
+
api = exports.ENVIRONMENT.GetGetters().GetGuardianApi();
|
|
10642
|
+
}
|
|
10122
10643
|
yield api.DELETE(`accessToken/${id}`, reqParams);
|
|
10123
10644
|
api.Cache.RemoveByContains(exports.Api.ECacheKey.User + exports.Api.ECacheKey.Id + id);
|
|
10124
10645
|
yield api.Cache.RemoveByStartsWith(exports.Api.ECacheKey.AccessToken + exports.Api.ECacheKey.Account);
|
|
@@ -10128,6 +10649,9 @@
|
|
|
10128
10649
|
function Create(params) {
|
|
10129
10650
|
return __awaiter(this, void 0, void 0, function* () {
|
|
10130
10651
|
let { api, token: data, req: reqParams } = params;
|
|
10652
|
+
if (!api) {
|
|
10653
|
+
api = exports.ENVIRONMENT.GetGetters().GetGuardianApi();
|
|
10654
|
+
}
|
|
10131
10655
|
if (!data) {
|
|
10132
10656
|
data = {};
|
|
10133
10657
|
}
|
|
@@ -10165,7 +10689,10 @@
|
|
|
10165
10689
|
})(EInviteMethod = AccountInvite.EInviteMethod || (AccountInvite.EInviteMethod = {}));
|
|
10166
10690
|
function GetByCode(params) {
|
|
10167
10691
|
return __awaiter(this, void 0, void 0, function* () {
|
|
10168
|
-
|
|
10692
|
+
let { api, code, req } = params;
|
|
10693
|
+
if (!api) {
|
|
10694
|
+
api = exports.ENVIRONMENT.GetGetters().GetGuardianApi();
|
|
10695
|
+
}
|
|
10169
10696
|
const res = yield api.GET(`invite/code?inviteCode=${code}`, exports.Api.PrepReqParams(req));
|
|
10170
10697
|
return res;
|
|
10171
10698
|
});
|
|
@@ -10173,7 +10700,10 @@
|
|
|
10173
10700
|
AccountInvite.GetByCode = GetByCode;
|
|
10174
10701
|
function GetList(params) {
|
|
10175
10702
|
return __awaiter(this, void 0, void 0, function* () {
|
|
10176
|
-
|
|
10703
|
+
let { api, accountId, userId, req } = params;
|
|
10704
|
+
if (!api) {
|
|
10705
|
+
api = exports.ENVIRONMENT.GetGetters().GetGuardianApi();
|
|
10706
|
+
}
|
|
10177
10707
|
const urlParams = new URLSearchParams();
|
|
10178
10708
|
if (accountId) {
|
|
10179
10709
|
urlParams.append("accountId", accountId);
|
|
@@ -10188,7 +10718,10 @@
|
|
|
10188
10718
|
AccountInvite.GetList = GetList;
|
|
10189
10719
|
function Update(params) {
|
|
10190
10720
|
return __awaiter(this, void 0, void 0, function* () {
|
|
10191
|
-
|
|
10721
|
+
let { api, code, status, user, req } = params;
|
|
10722
|
+
if (!api) {
|
|
10723
|
+
api = exports.ENVIRONMENT.GetGetters().GetGuardianApi();
|
|
10724
|
+
}
|
|
10192
10725
|
const res = yield api.POST("invite/update", {
|
|
10193
10726
|
InviteCode: code,
|
|
10194
10727
|
Status: status,
|
|
@@ -10200,7 +10733,10 @@
|
|
|
10200
10733
|
AccountInvite.Update = Update;
|
|
10201
10734
|
function Create(params) {
|
|
10202
10735
|
return __awaiter(this, void 0, void 0, function* () {
|
|
10203
|
-
|
|
10736
|
+
let { api, accountId, login, userId, email, mobile, emailTemplateKey, groupIds, req } = params;
|
|
10737
|
+
if (!api) {
|
|
10738
|
+
api = exports.ENVIRONMENT.GetGetters().GetGuardianApi();
|
|
10739
|
+
}
|
|
10204
10740
|
const res = yield api.POST("invite/new", {
|
|
10205
10741
|
accountId,
|
|
10206
10742
|
login,
|
|
@@ -10332,6 +10868,9 @@
|
|
|
10332
10868
|
function Run(params) {
|
|
10333
10869
|
return __awaiter(this, void 0, void 0, function* () {
|
|
10334
10870
|
let { api, query, key, skip, load, req: reqParams } = params;
|
|
10871
|
+
if (!api) {
|
|
10872
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
10873
|
+
}
|
|
10335
10874
|
if (!key) {
|
|
10336
10875
|
key = EReqKey.Primary;
|
|
10337
10876
|
}
|
|
@@ -10362,14 +10901,20 @@
|
|
|
10362
10901
|
(function (ImportCad) {
|
|
10363
10902
|
function Analyze(params) {
|
|
10364
10903
|
return __awaiter(this, void 0, void 0, function* () {
|
|
10365
|
-
|
|
10904
|
+
let { api, fileAnalyze, req: reqParams } = params;
|
|
10905
|
+
if (!api) {
|
|
10906
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
10907
|
+
}
|
|
10366
10908
|
return api.POST("entities/PrepareIFCForImport", fileAnalyze, exports.Api.PrepReqParams(reqParams));
|
|
10367
10909
|
});
|
|
10368
10910
|
}
|
|
10369
10911
|
ImportCad.Analyze = Analyze;
|
|
10370
10912
|
function ImportEntities(params) {
|
|
10371
10913
|
return __awaiter(this, void 0, void 0, function* () {
|
|
10372
|
-
|
|
10914
|
+
let { api, fileImport, req: reqParams } = params;
|
|
10915
|
+
if (!api) {
|
|
10916
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
10917
|
+
}
|
|
10373
10918
|
return api.POST("entities/importIFCWithProgress", fileImport, exports.Api.PrepReqParams(reqParams));
|
|
10374
10919
|
});
|
|
10375
10920
|
}
|
|
@@ -10398,7 +10943,10 @@
|
|
|
10398
10943
|
(function (ImportCsv) {
|
|
10399
10944
|
function ImportEntities(params) {
|
|
10400
10945
|
return __awaiter(this, void 0, void 0, function* () {
|
|
10401
|
-
|
|
10946
|
+
let { api, fileImport, req: reqParams } = params;
|
|
10947
|
+
if (!api) {
|
|
10948
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
10949
|
+
}
|
|
10402
10950
|
return api.POST("entities/importCSVWithProgress2", fileImport, exports.Api.PrepReqParams(reqParams));
|
|
10403
10951
|
});
|
|
10404
10952
|
}
|
|
@@ -10408,7 +10956,10 @@
|
|
|
10408
10956
|
(function (ImportJson) {
|
|
10409
10957
|
function ImportEntities(params) {
|
|
10410
10958
|
return __awaiter(this, void 0, void 0, function* () {
|
|
10411
|
-
|
|
10959
|
+
let { api, fileImport, req: reqParams } = params;
|
|
10960
|
+
if (!api) {
|
|
10961
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
10962
|
+
}
|
|
10412
10963
|
return api.POST("entities/importJsonWithProgress", fileImport, exports.Api.PrepReqParams(reqParams));
|
|
10413
10964
|
});
|
|
10414
10965
|
}
|
|
@@ -10418,7 +10969,10 @@
|
|
|
10418
10969
|
(function (ImportKml) {
|
|
10419
10970
|
function ImportEntities(params) {
|
|
10420
10971
|
return __awaiter(this, void 0, void 0, function* () {
|
|
10421
|
-
|
|
10972
|
+
let { api, fileImport, req: reqParams } = params;
|
|
10973
|
+
if (!api) {
|
|
10974
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
10975
|
+
}
|
|
10422
10976
|
return api.POST("entities/importKMLWithProgress2", fileImport, exports.Api.PrepReqParams(reqParams));
|
|
10423
10977
|
});
|
|
10424
10978
|
}
|
|
@@ -10446,6 +11000,9 @@
|
|
|
10446
11000
|
function GetList(params) {
|
|
10447
11001
|
return __awaiter(this, void 0, void 0, function* () {
|
|
10448
11002
|
let { api, fileType: type, pageIndex, req: reqParams } = params;
|
|
11003
|
+
if (!api) {
|
|
11004
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
11005
|
+
}
|
|
10449
11006
|
if (!type) {
|
|
10450
11007
|
type = EFileType.All;
|
|
10451
11008
|
}
|
|
@@ -10488,7 +11045,10 @@
|
|
|
10488
11045
|
ImportedFile.GetList = GetList;
|
|
10489
11046
|
function GetListByRootId(params) {
|
|
10490
11047
|
return __awaiter(this, void 0, void 0, function* () {
|
|
10491
|
-
|
|
11048
|
+
let { api, rootId, req: reqParams } = params;
|
|
11049
|
+
if (!api) {
|
|
11050
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
11051
|
+
}
|
|
10492
11052
|
const cache = yield api.GetCacheItem(GetCacheKeyByRootId(rootId), reqParams);
|
|
10493
11053
|
if (cache === null || cache === void 0 ? void 0 : cache.found) {
|
|
10494
11054
|
return cache.data;
|
|
@@ -10515,7 +11075,10 @@
|
|
|
10515
11075
|
ImportedFile.GetListByRootId = GetListByRootId;
|
|
10516
11076
|
function Get(params) {
|
|
10517
11077
|
return __awaiter(this, void 0, void 0, function* () {
|
|
10518
|
-
|
|
11078
|
+
let { api, importedFileId: fileId, req: reqParams } = params;
|
|
11079
|
+
if (!api) {
|
|
11080
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
11081
|
+
}
|
|
10519
11082
|
const cache = yield api.GetCacheItem(GetCacheKey(fileId), reqParams);
|
|
10520
11083
|
if (cache === null || cache === void 0 ? void 0 : cache.found) {
|
|
10521
11084
|
return cache.data;
|
|
@@ -10735,7 +11298,10 @@
|
|
|
10735
11298
|
Plugin.GetListCacheKey = GetListCacheKey;
|
|
10736
11299
|
function Get(params) {
|
|
10737
11300
|
return __awaiter(this, void 0, void 0, function* () {
|
|
10738
|
-
|
|
11301
|
+
let { api, pluginId, req } = params;
|
|
11302
|
+
if (!api) {
|
|
11303
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
11304
|
+
}
|
|
10739
11305
|
if (!pluginId) {
|
|
10740
11306
|
throw ("Plugin ID is required.");
|
|
10741
11307
|
}
|
|
@@ -10765,7 +11331,10 @@
|
|
|
10765
11331
|
Plugin.Get = Get;
|
|
10766
11332
|
function GetList(params) {
|
|
10767
11333
|
return __awaiter(this, void 0, void 0, function* () {
|
|
10768
|
-
|
|
11334
|
+
let { api, req } = params;
|
|
11335
|
+
if (!api) {
|
|
11336
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
11337
|
+
}
|
|
10769
11338
|
const cache = yield api.GetCacheItem(GetListCacheKey(), req);
|
|
10770
11339
|
if (cache === null || cache === void 0 ? void 0 : cache.found) {
|
|
10771
11340
|
return cache.data;
|
|
@@ -10792,6 +11361,9 @@
|
|
|
10792
11361
|
Plugin.GetList = GetList;
|
|
10793
11362
|
function GetLoadUrl(params) {
|
|
10794
11363
|
let { api, pluginId, req, cacheKey } = params;
|
|
11364
|
+
if (!api) {
|
|
11365
|
+
api = exports.ENVIRONMENT.GetGetters().GetBruceApi();
|
|
11366
|
+
}
|
|
10795
11367
|
if (!cacheKey) {
|
|
10796
11368
|
cacheKey = 0;
|
|
10797
11369
|
}
|