bruce-models 1.5.1 → 1.5.3

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.
@@ -1332,6 +1332,132 @@
1332
1332
  GlobalApi.Api = Api$$1;
1333
1333
  })(exports.GlobalApi || (exports.GlobalApi = {}));
1334
1334
 
1335
+ class ApiGetters {
1336
+ constructor(params) {
1337
+ this.bruce = {};
1338
+ this.idm = {};
1339
+ this.cam = {};
1340
+ this.global = {};
1341
+ this.accountId = params === null || params === void 0 ? void 0 : params.accountId;
1342
+ this.env = (params === null || params === void 0 ? void 0 : params.env) ? params.env : exports.Api.EEnv.PROD;
1343
+ this.sessionId = params === null || params === void 0 ? void 0 : params.sessionId;
1344
+ }
1345
+ SetAccountId(accountId) {
1346
+ this.accountId = accountId;
1347
+ }
1348
+ GetAccountId() {
1349
+ return this.accountId;
1350
+ }
1351
+ SetEnv(env) {
1352
+ this.env = env;
1353
+ }
1354
+ GetEnv() {
1355
+ return this.env;
1356
+ }
1357
+ SetSessionId(sessionId) {
1358
+ this.sessionId = sessionId;
1359
+ for (const key in this.bruce) {
1360
+ this.bruce[key].SetSessionId(sessionId);
1361
+ }
1362
+ for (const key in this.idm) {
1363
+ this.idm[key].SetSessionId(sessionId);
1364
+ }
1365
+ for (const key in this.cam) {
1366
+ this.cam[key].SetSessionId(sessionId);
1367
+ }
1368
+ for (const key in this.global) {
1369
+ this.global[key].SetSessionId(sessionId);
1370
+ }
1371
+ }
1372
+ GetSessionId() {
1373
+ return this.sessionId;
1374
+ }
1375
+ GetBruceApi(params) {
1376
+ let { accountId, env } = params;
1377
+ accountId = accountId ? accountId : this.accountId;
1378
+ env = env ? env : this.env;
1379
+ const key = `${accountId}-${env}`;
1380
+ if (!this.bruce[key]) {
1381
+ this.bruce[key] = new exports.BruceApi.Api({
1382
+ accountId,
1383
+ env,
1384
+ loadRegionalBaseUrl: true
1385
+ });
1386
+ this.bruce[key].SetSessionId(this.sessionId);
1387
+ }
1388
+ return this.bruce[key];
1389
+ }
1390
+ GetBruceGetter() {
1391
+ return {
1392
+ accountId: this.accountId,
1393
+ env: this.env,
1394
+ getApi: (accountId, env) => {
1395
+ return this.GetBruceApi({ accountId, env });
1396
+ }
1397
+ };
1398
+ }
1399
+ GetIdmApi(params) {
1400
+ let { env } = params;
1401
+ env = env ? env : this.env;
1402
+ const key = `${env}`;
1403
+ if (!this.idm[key]) {
1404
+ this.idm[key] = new exports.IdmApi.Api({
1405
+ env
1406
+ });
1407
+ this.idm[key].SetSessionId(this.sessionId);
1408
+ }
1409
+ return this.idm[key];
1410
+ }
1411
+ GetIdmGetter() {
1412
+ return {
1413
+ env: this.env,
1414
+ getApi: (env) => {
1415
+ return this.GetIdmApi({ env });
1416
+ }
1417
+ };
1418
+ }
1419
+ GetCamApi(params) {
1420
+ let { env } = params;
1421
+ env = env ? env : this.env;
1422
+ const key = `${env}`;
1423
+ if (!this.cam[key]) {
1424
+ this.cam[key] = new exports.CamApi.Api({
1425
+ env
1426
+ });
1427
+ this.cam[key].SetSessionId(this.sessionId);
1428
+ }
1429
+ return this.cam[key];
1430
+ }
1431
+ GetCamGetter() {
1432
+ return {
1433
+ env: this.env,
1434
+ getApi: (env) => {
1435
+ return this.GetCamApi({ env });
1436
+ }
1437
+ };
1438
+ }
1439
+ GetGlobalApi(params) {
1440
+ let { env } = params;
1441
+ env = env ? env : this.env;
1442
+ const key = `${env}`;
1443
+ if (!this.global[key]) {
1444
+ this.global[key] = new exports.GlobalApi.Api({
1445
+ env
1446
+ });
1447
+ this.global[key].SetSessionId(this.sessionId);
1448
+ }
1449
+ return this.global[key];
1450
+ }
1451
+ GetGlobalGetter() {
1452
+ return {
1453
+ env: this.env,
1454
+ getApi: (env) => {
1455
+ return this.GetGlobalApi({ env });
1456
+ }
1457
+ };
1458
+ }
1459
+ }
1460
+
1335
1461
  (function (Color) {
1336
1462
  let EBlendMode;
1337
1463
  (function (EBlendMode) {
@@ -6754,6 +6880,7 @@
6754
6880
  })(exports.Markup || (exports.Markup = {}));
6755
6881
 
6756
6882
  exports.AbstractApi = AbstractApi;
6883
+ exports.ApiGetters = ApiGetters;
6757
6884
  exports.BruceEvent = BruceEvent;
6758
6885
  exports.CacheControl = CacheControl;
6759
6886
  exports.DelayQueue = DelayQueue;