@mindline/sync 1.0.100 → 1.0.102

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/sync.es.js CHANGED
@@ -1,11 +1,11 @@
1
- var Ae = Object.defineProperty;
1
+ var $e = Object.defineProperty;
2
2
  var ge = (a) => {
3
3
  throw TypeError(a);
4
4
  };
5
- var $e = (a, e, r) => e in a ? Ae(a, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : a[e] = r;
6
- var l = (a, e, r) => $e(a, typeof e != "symbol" ? e + "" : e, r), ke = (a, e, r) => e.has(a) || ge("Cannot " + r);
7
- var j = (a, e, r) => e.has(a) ? ge("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(a) : e.set(a, r);
8
- var G = (a, e, r) => (ke(a, e, "access private method"), r);
5
+ var Ae = (a, t, r) => t in a ? $e(a, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : a[t] = r;
6
+ var l = (a, t, r) => Ae(a, typeof t != "symbol" ? t + "" : t, r), ke = (a, t, r) => t.has(a) || ge("Cannot " + r);
7
+ var j = (a, t, r) => t.has(a) ? ge("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(a) : t.set(a, r);
8
+ var G = (a, t, r) => (ke(a, t, "access private method"), r);
9
9
  import * as H from "@microsoft/signalr";
10
10
  import { deserializeArray as W } from "class-transformer";
11
11
  const De = [
@@ -30,7 +30,7 @@ const De = [
30
30
  sel: !0,
31
31
  graphSP: ""
32
32
  }
33
- ], Re = [], Pe = [
33
+ ], Pe = [], Re = [
34
34
  {
35
35
  id: "1",
36
36
  name: "",
@@ -140,16 +140,16 @@ const De = [
140
140
  resources: []
141
141
  }
142
142
  ], O = "workspaceIDs";
143
- function Tt(a, e) {
144
- return a + e;
143
+ function bt(a, t) {
144
+ return a + t;
145
145
  }
146
- function St() {
146
+ function It() {
147
147
  return "hello NPM";
148
148
  }
149
149
  function F() {
150
- return "1.0.100";
150
+ return "1.0.102";
151
151
  }
152
- class y {
152
+ class m {
153
153
  constructor() {
154
154
  l(this, "result");
155
155
  l(this, "status");
@@ -163,70 +163,73 @@ class U {
163
163
  }
164
164
  // azure graph REST API endpoints
165
165
  l(U, "azureElevateAccess", "https://management.azure.com/providers/Microsoft.Authorization/elevateAccess?api-version=2016-07-01"), l(U, "azureListRootAssignments", "https://management.azure.com/providers/Microsoft.Authorization/roleAssignments?api-version=2022-04-01&$filter=principalId+eq+");
166
- const A = class A {
166
+ const $ = class $ {
167
167
  // config API endpoints
168
168
  static adminEndpoint() {
169
- return `https://${A.environmentTag}-configurationapi-westus.azurewebsites.net/api/v1/admin`;
169
+ return `https://${$.environmentTag}-configurationapi-westus.azurewebsites.net/api/v1/admin`;
170
170
  }
171
171
  static adminIncompleteEndpoint() {
172
- return `https://${A.environmentTag}-configurationapi-westus.azurewebsites.net/api/v1/incomplete-admin`;
172
+ return `https://${$.environmentTag}-configurationapi-westus.azurewebsites.net/api/v1/incomplete-admin`;
173
173
  }
174
174
  static adminsEndpoint() {
175
- return `https://${A.environmentTag}-configurationapi-westus.azurewebsites.net/api/v1/admins`;
175
+ return `https://${$.environmentTag}-configurationapi-westus.azurewebsites.net/api/v1/admins`;
176
+ }
177
+ static auditConfigEndpoint() {
178
+ return `https://${$.environmentTag}-configurationapi-westus.azurewebsites.net/api/v1/audit-configuration`;
176
179
  }
177
180
  static auditEventsEndpoint() {
178
- return `https://${A.environmentTag}-configurationapi-westus.azurewebsites.net/api/v1/audit-events`;
181
+ return `https://${$.environmentTag}-configurationapi-westus.azurewebsites.net/api/v1/audit-events`;
179
182
  }
180
183
  static configConsentEndpoint() {
181
- return `https://${A.environmentTag}-configurationapi-westus.azurewebsites.net/api/v1/configuration/consent`;
184
+ return `https://${$.environmentTag}-configurationapi-westus.azurewebsites.net/api/v1/configuration/consent`;
182
185
  }
183
186
  static configEnabledEndpoint() {
184
- return `https://${A.environmentTag}-configurationapi-westus.azurewebsites.net/api/v1/configuration/status`;
187
+ return `https://${$.environmentTag}-configurationapi-westus.azurewebsites.net/api/v1/configuration/status`;
185
188
  }
186
189
  static configEndpoint() {
187
- return `https://${A.environmentTag}-configurationapi-westus.azurewebsites.net/api/v1/configuration`;
190
+ return `https://${$.environmentTag}-configurationapi-westus.azurewebsites.net/api/v1/configuration`;
188
191
  }
189
192
  static configsEndpoint() {
190
- return `https://${A.environmentTag}-configurationapi-westus.azurewebsites.net/api/v1/configurations`;
193
+ return `https://${$.environmentTag}-configurationapi-westus.azurewebsites.net/api/v1/configurations`;
191
194
  }
192
195
  static initEndpoint() {
193
- return `https://${A.environmentTag}-configurationapi-westus.azurewebsites.net/api/v1/configuration/init`;
196
+ return `https://${$.environmentTag}-configurationapi-westus.azurewebsites.net/api/v1/configuration/init`;
194
197
  }
195
198
  static readerStartSyncEndpoint() {
196
- return `https://${A.environmentTag}-configurationapi-westus.azurewebsites.net/api/v1/startSync`;
199
+ return `https://${$.environmentTag}-configurationapi-westus.azurewebsites.net/api/v1/startSync`;
197
200
  }
198
201
  static tenantEndpoint() {
199
- return `https://${A.environmentTag}-configurationapi-westus.azurewebsites.net/api/v1/tenant`;
202
+ return `https://${$.environmentTag}-configurationapi-westus.azurewebsites.net/api/v1/tenant`;
200
203
  }
201
204
  static tenantsEndpoint() {
202
- return `https://${A.environmentTag}-configurationapi-westus.azurewebsites.net/api/v1/tenants`;
205
+ return `https://${$.environmentTag}-configurationapi-westus.azurewebsites.net/api/v1/tenants`;
203
206
  }
204
207
  static workspaceEndpoint() {
205
- return `https://${A.environmentTag}-configurationapi-westus.azurewebsites.net/api/v1/workspace`;
208
+ return `https://${$.environmentTag}-configurationapi-westus.azurewebsites.net/api/v1/workspace`;
206
209
  }
207
210
  static workspacesEndpoint() {
208
- return `https://${A.environmentTag}-configurationapi-westus.azurewebsites.net/api/v1/workspaces`;
211
+ return `https://${$.environmentTag}-configurationapi-westus.azurewebsites.net/api/v1/workspaces`;
209
212
  }
210
213
  // SignalR endpoint
211
214
  static signalREndpoint() {
212
- return `https://${A.environmentTag}-signalrdispatcher-westus.azurewebsites.net/statsHub`;
215
+ return `https://${$.environmentTag}-signalrdispatcher-westus.azurewebsites.net/statsHub`;
213
216
  }
214
217
  };
215
- l(A, "environmentTag", "dev");
216
- let T = A;
218
+ l($, "environmentTag", "dev");
219
+ let T = $;
217
220
  class p {
218
221
  }
219
222
  // graph API predicates
220
223
  l(p, "graphGroupsPredicate", "v1.0/groups"), l(p, "graphMailPredicate", "v1.0/me/messages"), l(p, "graphMePredicate", "v1.0/me"), l(p, "graphOauth2PermissionGrantsPredicate", "v1.0/oauth2PermissionGrants"), l(p, "graphServicePrincipalsPredicate", "v1.0/servicePrincipals"), l(p, "graphUsersPredicate", "v1.0/users"), l(p, "graphTenantByDomainPredicate", "beta/tenantRelationships/findTenantInformationByDomainName"), l(p, "graphTenantByIdPredicate", "beta/tenantRelationships/findTenantInformationByTenantId"), // authority values are based on the well-known OIDC auth endpoints
221
224
  l(p, "authorityWW", "https://login.microsoftonline.com/"), l(p, "authorityWWRegex", /^(https:\/\/login\.microsoftonline\.com\/)([\dA-Fa-f]{8}-[\dA-Fa-f]{4}-[\dA-Fa-f]{4}-[\dA-Fa-f]{4}-[\dA-Fa-f]{12})\/oauth2\/authorize$/), l(p, "authorityUS", "https://login.microsoftonline.us/"), l(p, "authorityUSRegex", /^(https:\/\/login\.microsoftonline\.us\/)([\dA-Fa-f]{8}-[\dA-Fa-f]{4}-[\dA-Fa-f]{4}-[\dA-Fa-f]{4}-[\dA-Fa-f]{12})\/oauth2\/authorize$/), l(p, "authorityCN", "https://login.partner.microsoftonline.cn/"), l(p, "authorityCNRegex", /^(https:\/\/login\.partner\.microsoftonline\.cn\/)([\dA-Fa-f]{8}-[\dA-Fa-f]{4}-[\dA-Fa-f]{4}-[\dA-Fa-f]{4}-[\dA-Fa-f]{12})\/oauth2\/authorize$/);
222
- class bt {
225
+ class $t {
223
226
  constructor() {
224
227
  l(this, "id", "");
225
228
  l(this, "displayName", "");
226
229
  l(this, "description", "");
227
230
  }
228
231
  }
229
- class It {
232
+ class At {
230
233
  constructor() {
231
234
  l(this, "group", "");
232
235
  l(this, "value", "");
@@ -234,11 +237,11 @@ class It {
234
237
  l(this, "removable", !1);
235
238
  l(this, "expanded", "");
236
239
  }
237
- static compareByValue(e, r) {
238
- return e.value.localeCompare(r.value);
240
+ static compareByValue(t, r) {
241
+ return t.value.localeCompare(r.value);
239
242
  }
240
- static compareByGroup(e, r) {
241
- return e.group.localeCompare(r.group);
243
+ static compareByGroup(t, r) {
244
+ return t.group.localeCompare(r.group);
242
245
  }
243
246
  }
244
247
  class X {
@@ -274,7 +277,7 @@ class X {
274
277
  this.oid = "", this.name = "", this.mail = "", this.authority = "", this.tid = "", this.companyName = "", this.companyDomain = "", this.workspaceIDs = "", this.session = "Sign In", this.spacode = "", this.graphAccessToken = "", this.mindlineAccessToken = "", this.azureAccessToken = "", this.loginHint = "", this.scopes = new Array(), this.authTS = /* @__PURE__ */ new Date(0), this.sel = !1, this.loggingIn = !1;
275
278
  }
276
279
  }
277
- var Ne = /* @__PURE__ */ ((a) => (a[a.invalid = 0] = "invalid", a[a.aad = 1] = "aad", a[a.ad = 2] = "ad", a[a.googleworkspace = 3] = "googleworkspace", a))(Ne || {}), Ce = /* @__PURE__ */ ((a) => (a[a.read = 1] = "read", a[a.write = 2] = "write", a[a.notassigned = 3] = "notassigned", a))(Ce || {});
280
+ var Ce = /* @__PURE__ */ ((a) => (a[a.invalid = 0] = "invalid", a[a.aad = 1] = "aad", a[a.ad = 2] = "ad", a[a.googleworkspace = 3] = "googleworkspace", a))(Ce || {}), Ne = /* @__PURE__ */ ((a) => (a[a.read = 1] = "read", a[a.write = 2] = "write", a[a.notassigned = 3] = "notassigned", a))(Ne || {});
278
281
  class L {
279
282
  // are we validating by TID or by domain? "Domain" | "Tenant ID"
280
283
  constructor() {
@@ -292,20 +295,20 @@ class L {
292
295
  this.tid = "", this.name = "", this.domain = "", this.tenantType = "aad", this.authority = "", this.workspaceIDs = "", this.sel = !1, this.graphSP = "", this.lookupfield = "Domain";
293
296
  }
294
297
  }
295
- function Oe(a, e) {
298
+ function Oe(a, t) {
296
299
  switch (a) {
297
300
  case p.authorityWW:
298
- return e === 1 ? "85d35da2-4118-4b03-aa05-605cedd7f2f8" : "63100afe-506e-4bb2-8ff7-d8d5ab373129";
301
+ return t === 1 ? "85d35da2-4118-4b03-aa05-605cedd7f2f8" : "63100afe-506e-4bb2-8ff7-d8d5ab373129";
299
302
  case p.authorityUS:
300
- return e === 1 ? "b08630c7-e227-4215-9746-afc9286fb864" : "17aa5d5a-f09f-4cec-87a6-28596f9fa513";
303
+ return t === 1 ? "b08630c7-e227-4215-9746-afc9286fb864" : "17aa5d5a-f09f-4cec-87a6-28596f9fa513";
301
304
  case p.authorityCN:
302
- return e === 1 ? "7db7293b-add9-4a3f-8562-1a20bfe27d5e" : "debd015b-1154-4111-a4cb-fc220a537697";
305
+ return t === 1 ? "7db7293b-add9-4a3f-8562-1a20bfe27d5e" : "debd015b-1154-4111-a4cb-fc220a537697";
303
306
  default:
304
307
  debugger;
305
308
  return "";
306
309
  }
307
310
  }
308
- function C(a) {
311
+ function N(a) {
309
312
  switch (a) {
310
313
  case p.authorityWW:
311
314
  return "https://graph.microsoft.com/";
@@ -363,6 +366,20 @@ class Y {
363
366
  this.id = "", this.name = "", this.workspaceId = "", this.description = "", this.tenants = new Array(), this.isEnabled = !1, this.workspaceIDs = "", this.sel = !1;
364
367
  }
365
368
  }
369
+ class kt {
370
+ // selection state
371
+ constructor() {
372
+ l(this, "id");
373
+ l(this, "workspaceId");
374
+ l(this, "name");
375
+ l(this, "description");
376
+ l(this, "isEnabled");
377
+ l(this, "email");
378
+ l(this, "tenantId");
379
+ l(this, "sel");
380
+ this.id = "", this.name = "", this.workspaceId = "", this.description = "", this.isEnabled = !1, this.email = "", this.tenantId = "", this.sel = !1;
381
+ }
382
+ }
366
383
  class ee {
367
384
  // selection state
368
385
  constructor() {
@@ -380,21 +397,21 @@ function x() {
380
397
  let a;
381
398
  try {
382
399
  a = window.localStorage;
383
- const e = "__storage_test__";
384
- return a.setItem(e, e), a.removeItem(e), !0;
385
- } catch (e) {
386
- return e instanceof DOMException && // everything except Firefox
387
- (e.code === 22 || // Firefox
388
- e.code === 1014 || // test name field too, because code might not be present
400
+ const t = "__storage_test__";
401
+ return a.setItem(t, t), a.removeItem(t), !0;
402
+ } catch (t) {
403
+ return t instanceof DOMException && // everything except Firefox
404
+ (t.code === 22 || // Firefox
405
+ t.code === 1014 || // test name field too, because code might not be present
389
406
  // everything except Firefox
390
- e.name === "QuotaExceededError" || // Firefox
391
- e.name === "NS_ERROR_DOM_QUOTA_REACHED") && // acknowledge QuotaExceededError only if there's something already stored
407
+ t.name === "QuotaExceededError" || // Firefox
408
+ t.name === "NS_ERROR_DOM_QUOTA_REACHED") && // acknowledge QuotaExceededError only if there's something already stored
392
409
  a && a.length !== 0;
393
410
  }
394
411
  }
395
412
  var q, ye;
396
- class At {
397
- constructor(e = !1) {
413
+ class Dt {
414
+ constructor(t = !1) {
398
415
  j(this, q);
399
416
  l(this, "version", F());
400
417
  l(this, "tab", 0);
@@ -404,16 +421,16 @@ class At {
404
421
  l(this, "ws", []);
405
422
  l(this, "configlevelconsent_configid", "");
406
423
  l(this, "configlevelconsent_access", 3);
407
- this.init(e);
424
+ this.init(t);
408
425
  }
409
426
  // get initial data from localStorage or file
410
- init(e) {
411
- if (console.log(`Calling InitInfo::init(bClearLocalStorage: ${e ? "true" : "false"})`), x()) {
427
+ init(t) {
428
+ if (console.log(`Calling InitInfo::init(bClearLocalStorage: ${t ? "true" : "false"})`), x()) {
412
429
  let o = localStorage.getItem("InitInfo");
413
430
  if (o != null && typeof o == "string" && o !== "") {
414
431
  let i = JSON.parse(o);
415
432
  if (i.us.length !== 0)
416
- if (e)
433
+ if (t)
417
434
  localStorage.removeItem("InitInfo");
418
435
  else {
419
436
  G(this, q, ye).call(this, i);
@@ -422,38 +439,38 @@ class At {
422
439
  }
423
440
  }
424
441
  this.tab = 0, this.version = F(), this.configlevelconsent_configid = "", this.configlevelconsent_access = 3;
425
- var r = JSON.stringify(De), s = JSON.stringify(ve), t = JSON.stringify(Re), n = JSON.stringify(Pe);
442
+ var r = JSON.stringify(De), s = JSON.stringify(ve), e = JSON.stringify(Pe), n = JSON.stringify(Re);
426
443
  try {
427
- this.us = W(X, r), this.ts = W(L, s), this.cs = W(Y, t), this.ws = W(ee, n), this.tagWithWorkspaces();
444
+ this.us = W(X, r), this.ts = W(L, s), this.cs = W(Y, e), this.ws = W(ee, n), this.tagWithWorkspaces();
428
445
  } catch {
429
446
  debugger;
430
447
  }
431
448
  }
432
449
  save() {
433
- let e = JSON.stringify(this);
434
- localStorage.setItem("InitInfo", e);
450
+ let t = JSON.stringify(this);
451
+ localStorage.setItem("InitInfo", t);
435
452
  }
436
453
  tagWithWorkspaces() {
437
- this.us.map((e) => e.workspaceIDs = ""), this.ts.map((e) => e.workspaceIDs = ""), this.cs.map((e) => e.workspaceIDs = "");
438
- for (let e of this.ws) {
439
- for (let r of e.associatedUsers) {
440
- let s = this.us.find((t) => t.oid === r);
454
+ this.us.map((t) => t.workspaceIDs = ""), this.ts.map((t) => t.workspaceIDs = ""), this.cs.map((t) => t.workspaceIDs = "");
455
+ for (let t of this.ws) {
456
+ for (let r of t.associatedUsers) {
457
+ let s = this.us.find((e) => e.oid === r);
441
458
  if (s !== void 0)
442
- s[O] += e.id, s[O] += " ";
459
+ s[O] += t.id, s[O] += " ";
443
460
  else
444
461
  debugger;
445
462
  }
446
- for (let r of e.associatedTenants) {
447
- let s = this.ts.find((t) => t.tid === r);
463
+ for (let r of t.associatedTenants) {
464
+ let s = this.ts.find((e) => e.tid === r);
448
465
  if (s !== void 0)
449
- s[O] += e.id, s[O] += " ";
466
+ s[O] += t.id, s[O] += " ";
450
467
  else
451
468
  debugger;
452
469
  }
453
- for (let r of e.associatedConfigs) {
454
- let s = this.cs.find((t) => t.id === r);
470
+ for (let r of t.associatedConfigs) {
471
+ let s = this.cs.find((e) => e.id === r);
455
472
  if (s !== void 0)
456
- s[O] += e.id, s[O] += " ";
473
+ s[O] += t.id, s[O] += " ";
457
474
  else
458
475
  debugger;
459
476
  }
@@ -461,17 +478,17 @@ class At {
461
478
  return !0;
462
479
  }
463
480
  }
464
- q = new WeakSet(), ye = function(e) {
465
- this.tab = e.tab, this.version = F(), this.configlevelconsent_configid = e.configlevelconsent_configid, this.configlevelconsent_access = e.configlevelconsent_access, typeof e.us > "u" ? this.us = new Array() : this.us = e.us.map((r) => {
481
+ q = new WeakSet(), ye = function(t) {
482
+ this.tab = t.tab, this.version = F(), this.configlevelconsent_configid = t.configlevelconsent_configid, this.configlevelconsent_access = t.configlevelconsent_access, typeof t.us > "u" ? this.us = new Array() : this.us = t.us.map((r) => {
466
483
  let s = new X();
467
484
  return s.oid = r.oid, s.name = r.name, s.mail = r.mail, s.authority = r.authority, s.tid = r.tid, s.companyName = r.companyName, s.companyDomain = r.companyDomain, s.workspaceIDs = r.workspaceIDs, s.session = r.session, s.spacode = r.spacode, s.graphAccessToken = r.graphAccessToken, s.mindlineAccessToken = r.mindlineAccessToken, s.azureAccessToken = r.azureAccessToken, s.loginHint = r.loginHint, s.scopes = r.scopes, s.authTS = new Date(r.authTS), s.sel = r.sel, s.loggingIn = r.loggingIn, s;
468
- }), typeof e.ts > "u" ? this.ts = new Array() : this.ts = e.ts.map((r) => {
485
+ }), typeof t.ts > "u" ? this.ts = new Array() : this.ts = t.ts.map((r) => {
469
486
  let s = new L();
470
487
  return s.tid = r.tid, s.name = r.name, s.domain = r.domain, s.tenantType = r.tenantType, s.authority = r.authority, s.workspaceIDs = r.workspaceIDs, s.sel = r.sel, s.lookupfield = r.lookupfield, s;
471
- }), typeof e.cs > "u" ? this.cs = new Array() : this.cs = e.cs.map((r) => {
488
+ }), typeof t.cs > "u" ? this.cs = new Array() : this.cs = t.cs.map((r) => {
472
489
  let s = new Y();
473
490
  return s.id = r.id, s.workspaceId = r.workspaceId, s.name = r.name, s.description = r.description, s.tenants = r.tenants, s.isEnabled = r.isEnabled, s.workspaceIDs = r.workspaceIDs, s.sel = r.sel, s;
474
- }), typeof e.ws > "u" ? this.ws = new Array() : this.ws = e.ws.map((r) => {
491
+ }), typeof t.ws > "u" ? this.ws = new Array() : this.ws = t.ws.map((r) => {
475
492
  let s = new ee();
476
493
  return s.id = r.id, s.name = r.name, s.ownerid = r.ownerid, s.associatedUsers = r.associatedUsers, s.associatedTenants = r.associatedTenants, s.associatedConfigs = r.associatedConfigs, s.sel = r.sel, s;
477
494
  });
@@ -529,63 +546,63 @@ const Be = [
529
546
  ]
530
547
  }
531
548
  ];
532
- var P, te, se, re;
533
- class $t {
534
- constructor(e) {
535
- j(this, P);
549
+ var R, te, se, re;
550
+ class vt {
551
+ constructor(t) {
552
+ j(this, R);
536
553
  l(this, "tasks");
537
- this.tasks = [new Q()], this.init(e);
554
+ this.tasks = [new Q()], this.init(t);
538
555
  }
539
556
  // get initial data from localStorage or file
540
- init(e) {
541
- if (console.log(`Calling TaskArray::init(bClearLocalStorage: ${e ? "true" : "false"})`), this.tasks.length = 0, e && x() && localStorage.removeItem("Tasks"), x()) {
557
+ init(t) {
558
+ if (console.log(`Calling TaskArray::init(bClearLocalStorage: ${t ? "true" : "false"})`), this.tasks.length = 0, t && x() && localStorage.removeItem("Tasks"), x()) {
542
559
  let r = localStorage.getItem("Tasks");
543
560
  if (r != null && typeof r == "string" && r !== "") {
544
- let t = JSON.parse(r);
545
- if (this.tasks = G(this, P, se).call(this, t.tasks), this.tasks.length !== 0) return;
561
+ let e = JSON.parse(r);
562
+ if (this.tasks = G(this, R, se).call(this, e.tasks), this.tasks.length !== 0) return;
546
563
  }
547
564
  }
548
- this.tasks = G(this, P, se).call(this, Be);
565
+ this.tasks = G(this, R, se).call(this, Be);
549
566
  }
550
567
  // set start time for a task
551
- setTaskStart(e, r) {
552
- let s = G(this, P, te).call(this, e);
568
+ setTaskStart(t, r) {
569
+ let s = G(this, R, te).call(this, t);
553
570
  if (s != null && s != null)
554
- s.setStart(r), s.status = "in progress", G(this, P, re).call(this);
571
+ s.setStart(r), s.status = "in progress", G(this, R, re).call(this);
555
572
  else
556
573
  debugger;
557
574
  }
558
575
  // set end time for a task
559
- setTaskEnd(e, r, s) {
560
- let t = G(this, P, te).call(this, e);
561
- if (t != null && t != null)
562
- t.setEnd(r), t.status = s, G(this, P, re).call(this);
576
+ setTaskEnd(t, r, s) {
577
+ let e = G(this, R, te).call(this, t);
578
+ if (e != null && e != null)
579
+ e.setEnd(r), e.status = s, G(this, R, re).call(this);
563
580
  else
564
581
  debugger;
565
582
  }
566
583
  }
567
- P = new WeakSet(), //
584
+ R = new WeakSet(), //
568
585
  // private
569
586
  //
570
- te = function(e) {
571
- let r = this.tasks.find((s) => s.task == e);
587
+ te = function(t) {
588
+ let r = this.tasks.find((s) => s.task == t);
572
589
  if (r == null || r == null) {
573
590
  for (r of this.tasks)
574
- if (r.subtasks != null && r.subtasks != null && (r = r.subtasks.find((s) => s.task == e), r != null && r != null))
591
+ if (r.subtasks != null && r.subtasks != null && (r = r.subtasks.find((s) => s.task == t), r != null && r != null))
575
592
  break;
576
593
  }
577
594
  return r;
578
- }, se = function(e) {
579
- return e.map((r) => {
595
+ }, se = function(t) {
596
+ return t.map((r) => {
580
597
  let s = new Q();
581
- return s.id = r.id, s.task = r.task, s.setStart(new Date(r.start)), s.setEnd(new Date(r.end)), s.expected = r.expected, s.status = r.status, s.expanded = r.expanded, typeof r.subtasks < "u" && r.subtasks != null && (s.subtasks = r.subtasks.map((t) => {
598
+ return s.id = r.id, s.task = r.task, s.setStart(new Date(r.start)), s.setEnd(new Date(r.end)), s.expected = r.expected, s.status = r.status, s.expanded = r.expanded, typeof r.subtasks < "u" && r.subtasks != null && (s.subtasks = r.subtasks.map((e) => {
582
599
  let n = new Q();
583
- return n.id = t.id, n.task = t.task, n.setStart(new Date(t.start)), n.setEnd(new Date(t.end)), n.expected = t.expected, n.status = t.status, n.expanded = t.expanded, n;
600
+ return n.id = e.id, n.task = e.task, n.setStart(new Date(e.start)), n.setEnd(new Date(e.end)), n.expected = e.expected, n.status = e.status, n.expanded = e.expanded, n;
584
601
  })), s;
585
602
  });
586
603
  }, re = function() {
587
- let e = JSON.stringify(this);
588
- x() && localStorage.setItem("Tasks", e);
604
+ let t = JSON.stringify(this);
605
+ x() && localStorage.setItem("Tasks", t);
589
606
  };
590
607
  class Q {
591
608
  constructor() {
@@ -601,19 +618,19 @@ class Q {
601
618
  l(this, "expanded", !1);
602
619
  l(this, "subtasks", []);
603
620
  }
604
- setEnd(e) {
605
- this.end = e, this.endDisplay = `${this.end.getMinutes().toString().padStart(2, "0")}:${this.end.getSeconds().toString().padStart(2, "0")}`;
621
+ setEnd(t) {
622
+ this.end = t, this.endDisplay = `${this.end.getMinutes().toString().padStart(2, "0")}:${this.end.getSeconds().toString().padStart(2, "0")}`;
606
623
  let r = 0, s = this.end.getSeconds() - this.start.getSeconds();
607
624
  s < 0 && (s += 60, r = -1);
608
- let t = this.end.getMinutes() - this.start.getMinutes() + r;
609
- t < 0 && (t += 60), this.elapsedDisplay = `${t.toString().padStart(2, "0")}:${s.toString().padStart(2, "0")}`;
625
+ let e = this.end.getMinutes() - this.start.getMinutes() + r;
626
+ e < 0 && (e += 60), this.elapsedDisplay = `${e.toString().padStart(2, "0")}:${s.toString().padStart(2, "0")}`;
610
627
  }
611
- setStart(e) {
612
- this.start = e, this.startDisplay = `${this.start.getMinutes().toString().padStart(2, "0")}:${this.start.getSeconds().toString().padStart(2, "0")}`;
628
+ setStart(t) {
629
+ this.start = t, this.startDisplay = `${this.start.getMinutes().toString().padStart(2, "0")}:${this.start.getSeconds().toString().padStart(2, "0")}`;
613
630
  }
614
631
  }
615
632
  class B {
616
- constructor(e) {
633
+ constructor(t) {
617
634
  l(this, "Run", 0);
618
635
  l(this, "Start", /* @__PURE__ */ new Date());
619
636
  l(this, "startDisplay", "");
@@ -625,38 +642,38 @@ class B {
625
642
  l(this, "writeDisplay");
626
643
  l(this, "Duration");
627
644
  l(this, "durationDisplay");
628
- this.Run = e, this.start(""), this.POST = /* @__PURE__ */ new Date(), this.postDisplay = "", this.Read = /* @__PURE__ */ new Date(), this.readDisplay = "", this.Write = /* @__PURE__ */ new Date(), this.writeDisplay = "", this.Duration = /* @__PURE__ */ new Date(), this.durationDisplay = "";
645
+ this.Run = t, this.start(""), this.POST = /* @__PURE__ */ new Date(), this.postDisplay = "", this.Read = /* @__PURE__ */ new Date(), this.readDisplay = "", this.Write = /* @__PURE__ */ new Date(), this.writeDisplay = "", this.Duration = /* @__PURE__ */ new Date(), this.durationDisplay = "";
629
646
  }
630
- start(e) {
631
- e == "" ? this.Start = /* @__PURE__ */ new Date() : this.Start = new Date(e), this.startDisplay = `${this.Start.getMinutes().toString().padStart(2, "0")}:${this.Start.getSeconds().toString().padStart(2, "0")}`;
647
+ start(t) {
648
+ t == "" ? this.Start = /* @__PURE__ */ new Date() : this.Start = new Date(t), this.startDisplay = `${this.Start.getMinutes().toString().padStart(2, "0")}:${this.Start.getSeconds().toString().padStart(2, "0")}`;
632
649
  }
633
- post(e) {
634
- e == "" ? this.POST = /* @__PURE__ */ new Date() : this.POST = new Date(e), this.postDisplay = `${this.POST.getMinutes().toString().padStart(2, "0")}:${this.POST.getSeconds().toString().padStart(2, "0")}`;
650
+ post(t) {
651
+ t == "" ? this.POST = /* @__PURE__ */ new Date() : this.POST = new Date(t), this.postDisplay = `${this.POST.getMinutes().toString().padStart(2, "0")}:${this.POST.getSeconds().toString().padStart(2, "0")}`;
635
652
  }
636
- read(e) {
637
- e == "" ? this.Read = /* @__PURE__ */ new Date() : this.Read = new Date(e), this.readDisplay = `${this.Read.getMinutes().toString().padStart(2, "0")}:${this.Read.getSeconds().toString().padStart(2, "0")}`;
653
+ read(t) {
654
+ t == "" ? this.Read = /* @__PURE__ */ new Date() : this.Read = new Date(t), this.readDisplay = `${this.Read.getMinutes().toString().padStart(2, "0")}:${this.Read.getSeconds().toString().padStart(2, "0")}`;
638
655
  }
639
- write(e) {
640
- e == "" ? this.Write = /* @__PURE__ */ new Date() : this.Write = new Date(e), this.writeDisplay = `${this.Write.getMinutes().toString().padStart(2, "0")}:${this.Write.getSeconds().toString().padStart(2, "0")}`, this.Duration = new Date(this.Write.getTime() - this.Start.getTime()), this.durationDisplay = `${this.Duration.getMinutes().toString().padStart(2, "0")}:${this.Duration.getSeconds().toString().padStart(2, "0")}`;
656
+ write(t) {
657
+ t == "" ? this.Write = /* @__PURE__ */ new Date() : this.Write = new Date(t), this.writeDisplay = `${this.Write.getMinutes().toString().padStart(2, "0")}:${this.Write.getSeconds().toString().padStart(2, "0")}`, this.Duration = new Date(this.Write.getTime() - this.Start.getTime()), this.durationDisplay = `${this.Duration.getMinutes().toString().padStart(2, "0")}:${this.Duration.getSeconds().toString().padStart(2, "0")}`;
641
658
  }
642
659
  }
643
660
  var z, ne;
644
661
  class Ue {
645
- constructor(e) {
662
+ constructor(t) {
646
663
  j(this, z);
647
664
  l(this, "milestones", []);
648
- this.init(e);
665
+ this.init(t);
649
666
  }
650
- init(e) {
667
+ init(t) {
651
668
  if (x()) {
652
669
  let r = localStorage.getItem("syncmilestones");
653
670
  if (r != null && typeof r == "string" && r !== "") {
654
- let t = JSON.parse(r);
655
- if (t.length !== 0)
656
- if (e)
671
+ let e = JSON.parse(r);
672
+ if (e.length !== 0)
673
+ if (t)
657
674
  localStorage.removeItem("syncmilestones");
658
675
  else {
659
- G(this, z, ne).call(this, t);
676
+ G(this, z, ne).call(this, e);
660
677
  return;
661
678
  }
662
679
  }
@@ -664,47 +681,47 @@ class Ue {
664
681
  G(this, z, ne).call(this, Ee);
665
682
  }
666
683
  save() {
667
- let e = JSON.stringify(this.milestones);
668
- x() && localStorage.setItem("syncmilestones", e);
684
+ let t = JSON.stringify(this.milestones);
685
+ x() && localStorage.setItem("syncmilestones", t);
669
686
  }
670
687
  // milestone tracking during a sync
671
- start(e) {
688
+ start(t) {
672
689
  if (this.milestones == null || this.milestones.length < 1) {
673
690
  debugger;
674
691
  return;
675
692
  }
676
693
  let r = Number(this.milestones[0].Run), s = new B(r + 1);
677
- this.milestones.unshift(s), this.milestones = this.milestones.map((t) => {
678
- let n = new B(t.Run);
679
- return n.Start = t.Start, n.startDisplay = t.startDisplay, n.POST = t.POST, n.postDisplay = t.postDisplay, n.Read = t.Read, n.readDisplay = t.readDisplay, n.Write = t.Write, n.writeDisplay = t.writeDisplay, n.Duration = t.Duration, n.durationDisplay = t.durationDisplay, n;
680
- }), e(this.milestones), console.log(`Start milestone: ${this.milestones[0].Run}:${this.milestones[0].Start}`);
694
+ this.milestones.unshift(s), this.milestones = this.milestones.map((e) => {
695
+ let n = new B(e.Run);
696
+ return n.Start = e.Start, n.startDisplay = e.startDisplay, n.POST = e.POST, n.postDisplay = e.postDisplay, n.Read = e.Read, n.readDisplay = e.readDisplay, n.Write = e.Write, n.writeDisplay = e.writeDisplay, n.Duration = e.Duration, n.durationDisplay = e.durationDisplay, n;
697
+ }), t(this.milestones), console.log(`Start milestone: ${this.milestones[0].Run}:${this.milestones[0].Start}`);
681
698
  }
682
- unstart(e) {
699
+ unstart(t) {
683
700
  if (this.milestones == null || this.milestones.length < 1) {
684
701
  debugger;
685
702
  return;
686
703
  }
687
704
  let r = this.milestones.shift();
688
705
  this.milestones = this.milestones.map((s) => {
689
- let t = new B(s.Run);
690
- return t.Start = s.Start, t.startDisplay = s.startDisplay, t.POST = s.POST, t.postDisplay = s.postDisplay, t.Read = s.Read, t.readDisplay = s.readDisplay, t.Write = s.Write, t.writeDisplay = s.writeDisplay, t.Duration = s.Duration, t.durationDisplay = s.durationDisplay, t;
691
- }), e(this.milestones), console.log(`Unstart removed first milestone: ${r.Run}:${r.Start}`);
706
+ let e = new B(s.Run);
707
+ return e.Start = s.Start, e.startDisplay = s.startDisplay, e.POST = s.POST, e.postDisplay = s.postDisplay, e.Read = s.Read, e.readDisplay = s.readDisplay, e.Write = s.Write, e.writeDisplay = s.writeDisplay, e.Duration = s.Duration, e.durationDisplay = s.durationDisplay, e;
708
+ }), t(this.milestones), console.log(`Unstart removed first milestone: ${r.Run}:${r.Start}`);
692
709
  }
693
- post(e) {
710
+ post(t) {
694
711
  if (this.milestones == null || this.milestones.length < 1) {
695
712
  debugger;
696
713
  return;
697
714
  }
698
- this.milestones[0].post(""), e(this.milestones), console.log(`POST milestone: ${this.milestones[0].Run}:${this.milestones[0].POST}`);
715
+ this.milestones[0].post(""), t(this.milestones), console.log(`POST milestone: ${this.milestones[0].Run}:${this.milestones[0].POST}`);
699
716
  }
700
- read(e) {
717
+ read(t) {
701
718
  if (this.milestones == null || this.milestones.length < 1) {
702
719
  debugger;
703
720
  return;
704
721
  }
705
- this.milestones[0].read(""), e(this.milestones), console.log(`Read milestone: ${this.milestones[0].Run}:${this.milestones[0].Read}`);
722
+ this.milestones[0].read(""), t(this.milestones), console.log(`Read milestone: ${this.milestones[0].Run}:${this.milestones[0].Read}`);
706
723
  }
707
- write(e) {
724
+ write(t) {
708
725
  if (this.milestones == null || this.milestones.length < 1) {
709
726
  debugger;
710
727
  return;
@@ -716,17 +733,17 @@ class Ue {
716
733
  this.save(), this.milestones = this.milestones.map((r) => {
717
734
  let s = new B(r.Run);
718
735
  return s.Start = r.Start, s.startDisplay = r.startDisplay, s.POST = r.POST, s.postDisplay = r.postDisplay, s.Read = r.Read, s.readDisplay = r.readDisplay, s.Write = r.Write, s.writeDisplay = r.writeDisplay, s.Duration = r.Duration, s.durationDisplay = r.durationDisplay, s;
719
- }), e(this.milestones);
736
+ }), t(this.milestones);
720
737
  }
721
738
  }
722
- z = new WeakSet(), ne = function(e) {
723
- e == null ? this.milestones = new Array() : this.milestones = e.map((r) => {
739
+ z = new WeakSet(), ne = function(t) {
740
+ t == null ? this.milestones = new Array() : this.milestones = t.map((r) => {
724
741
  let s = new B(Number(r.Run));
725
742
  return s.start(r.Start), s.post(r.POST), s.read(r.Read), s.write(r.Write), s;
726
743
  });
727
744
  };
728
- class kt {
729
- constructor(e, r, s) {
745
+ class Pt {
746
+ constructor(t, r, s) {
730
747
  l(this, "tenantNodes");
731
748
  l(this, "pb_startTS");
732
749
  l(this, "pb_progress");
@@ -736,35 +753,35 @@ class kt {
736
753
  l(this, "pb_total");
737
754
  l(this, "pb_timer");
738
755
  l(this, "milestoneArray");
739
- this.tenantNodes = new Array(), this.init(e, r, s), this.pb_startTS = 0, this.pb_progress = 0, this.pb_increment = 0, this.pb_timer = null, this.pb_idle = 0, this.pb_idleMax = 0, this.pb_total = 0, this.milestoneArray = new Ue(!1);
756
+ this.tenantNodes = new Array(), this.init(t, r, s), this.pb_startTS = 0, this.pb_progress = 0, this.pb_increment = 0, this.pb_timer = null, this.pb_idle = 0, this.pb_idleMax = 0, this.pb_total = 0, this.milestoneArray = new Ue(!1);
740
757
  }
741
758
  // populate tenantNodes based on config tenants
742
- init(e, r, s) {
759
+ init(t, r, s) {
743
760
  console.log(
744
- `Calling BatchArray::init(config: "${e ? e.name : "null"}", bClearLocalStorage: ${s ? "true" : "false"})`
745
- ), s && x() && (localStorage.removeItem(e.name), this.milestoneArray.init(s)), e != null && e.tenants != null && r != null && (this.tenantNodes.length = 0, e.tenants.map((t) => {
746
- if (t.configurationTenantType === "source" || t.configurationTenantType === "sourcetarget") {
761
+ `Calling BatchArray::init(config: "${t ? t.name : "null"}", bClearLocalStorage: ${s ? "true" : "false"})`
762
+ ), s && x() && (localStorage.removeItem(t.name), this.milestoneArray.init(s)), t != null && t.tenants != null && r != null && (this.tenantNodes.length = 0, t.tenants.map((e) => {
763
+ if (e.configurationTenantType === "source" || e.configurationTenantType === "sourcetarget") {
747
764
  let n = r.ts.find(
748
- (o) => o.tid === t.tid
765
+ (o) => o.tid === e.tid
749
766
  );
750
767
  if (n != null) {
751
768
  let o = new me(
752
- t.tid,
769
+ e.tid,
753
770
  n.name,
754
- t.batchId
771
+ e.batchId
755
772
  );
756
773
  this.tenantNodes.push(o);
757
774
  } else {
758
775
  console.log(
759
- `Error: no tenant found for config source tenant ${e.name}`
776
+ `Error: no tenant found for config source tenant ${t.name}`
760
777
  );
761
778
  debugger;
762
779
  return;
763
780
  }
764
781
  }
765
- }), this.tenantNodes.map((t) => {
766
- e.tenants.map((n) => {
767
- if ((n.configurationTenantType === "target" || n.configurationTenantType === "sourcetarget") && n.tid !== t.tid) {
782
+ }), this.tenantNodes.map((e) => {
783
+ t.tenants.map((n) => {
784
+ if ((n.configurationTenantType === "target" || n.configurationTenantType === "sourcetarget") && n.tid !== e.tid) {
768
785
  let o = r.ts.find(
769
786
  (d) => d.tid === n.tid
770
787
  );
@@ -774,10 +791,10 @@ class kt {
774
791
  o.name,
775
792
  n.batchId
776
793
  );
777
- t.targets.push(d), t.expanded = !0;
794
+ e.targets.push(d), e.expanded = !0;
778
795
  } else {
779
796
  console.log(
780
- `Error: no tenant found for config target tenant ${e.name}`
797
+ `Error: no tenant found for config target tenant ${t.name}`
781
798
  );
782
799
  debugger;
783
800
  return;
@@ -786,16 +803,16 @@ class kt {
786
803
  });
787
804
  }));
788
805
  }
789
- initializeProgressBar(e, r, s, t) {
806
+ initializeProgressBar(t, r, s, e) {
790
807
  this.pb_startTS = Date.now(), this.pb_progress = 0, this.pb_increment = 0.25, this.pb_idle = 0, this.pb_idleMax = 0, this.pb_total = 0, this.pb_timer = setInterval(() => {
791
- this.milestoneArray.milestones[0].Write != null ? (clearInterval(this.pb_timer), this.pb_timer = null, this.pb_progress = 100, e(this.pb_progress), s(`Complete. [max idle: ${this.pb_idleMax}]`)) : (this.pb_total = this.pb_total + 1, this.pb_idle = this.pb_idle + 1, this.pb_idleMax = Math.max(this.pb_idle, this.pb_idleMax), s(`${this.pb_total} seconds elapsed. Last update ${this.pb_idle} seconds ago. [max idle: ${this.pb_idleMax}/60]`), this.pb_idle >= 60 && this.milestoneArray.milestones[0].Write == null && r(`sync continuing, but no update for ${this.pb_idle} seconds`), this.pb_progress < 100 && (this.pb_progress = Math.min(100, this.pb_progress + this.pb_increment), e(this.pb_progress)));
792
- }, 1e3), this.milestoneArray.start(t);
808
+ this.milestoneArray.milestones[0].Write != null ? (clearInterval(this.pb_timer), this.pb_timer = null, this.pb_progress = 100, t(this.pb_progress), s(`Complete. [max idle: ${this.pb_idleMax}]`)) : (this.pb_total = this.pb_total + 1, this.pb_idle = this.pb_idle + 1, this.pb_idleMax = Math.max(this.pb_idle, this.pb_idleMax), s(`${this.pb_total} seconds elapsed. Last update ${this.pb_idle} seconds ago. [max idle: ${this.pb_idleMax}/60]`), this.pb_idle >= 60 && this.milestoneArray.milestones[0].Write == null && r(`sync continuing, but no update for ${this.pb_idle} seconds`), this.pb_progress < 100 && (this.pb_progress = Math.min(100, this.pb_progress + this.pb_increment), t(this.pb_progress)));
809
+ }, 1e3), this.milestoneArray.start(e);
793
810
  }
794
- uninitializeProgressBar(e, r, s, t) {
795
- this.pb_startTS = 0, this.pb_progress = 0, e(this.pb_progress), r("sync failed to execute"), this.pb_increment = 0, clearInterval(this.pb_timer), this.pb_timer = null, this.pb_idle = 0, this.pb_idleMax = 0, s(`No updates seen for ${this.pb_idle} seconds. [max idle: ${this.pb_idleMax}]`), this.milestoneArray.unstart(t);
811
+ uninitializeProgressBar(t, r, s, e) {
812
+ this.pb_startTS = 0, this.pb_progress = 0, t(this.pb_progress), r("sync failed to execute"), this.pb_increment = 0, clearInterval(this.pb_timer), this.pb_timer = null, this.pb_idle = 0, this.pb_idleMax = 0, s(`No updates seen for ${this.pb_idle} seconds. [max idle: ${this.pb_idleMax}]`), this.milestoneArray.unstart(e);
796
813
  }
797
- initializeSignalR(e, r, s, t, n, o, d, i, c, u, f) {
798
- this.milestoneArray.post(c), u("started sync, waiting for updates..."), this.init(e, r, !1);
814
+ initializeSignalR(t, r, s, e, n, o, d, i, c, u, f) {
815
+ this.milestoneArray.post(c), u("started sync, waiting for updates..."), this.init(t, r, !1);
799
816
  let b = (I) => {
800
817
  console.log(I);
801
818
  let v = JSON.parse(I);
@@ -813,24 +830,24 @@ class kt {
813
830
  return;
814
831
  }
815
832
  h.batchId = D.BatchId;
816
- let k = v.Stats, m = Object.keys(k), R = Object.values(k), oe = !1, ie = !1;
817
- for (let g = 0; g < m.length; g++) {
818
- let E = m[g].endsWith("TotalCount"), M = m[g].endsWith("CurrentCount"), _ = m[g].endsWith("DeferredCount"), V = m[g].endsWith("RescheduledCount");
819
- if (m[g].startsWith("Reader")) {
820
- let N = /Reader\/TID:(.+)\/TotalCount/;
821
- if (M && (N = /Reader\/TID:(.+)\/CurrentCount/), _ && (N = /Reader\/TID:(.+)\/DeferredCount/), V && (N = /Reader\/TID:(.+)\/RescheduledCount/), m[g].match(N) == null) {
822
- console.log(`tid not found in ${m[g]}.`);
833
+ let k = v.Stats, y = Object.keys(k), P = Object.values(k), oe = !1, ie = !1;
834
+ for (let g = 0; g < y.length; g++) {
835
+ let E = y[g].endsWith("TotalCount"), M = y[g].endsWith("CurrentCount"), _ = y[g].endsWith("DeferredCount"), V = y[g].endsWith("RescheduledCount");
836
+ if (y[g].startsWith("Reader")) {
837
+ let C = /Reader\/TID:(.+)\/TotalCount/;
838
+ if (M && (C = /Reader\/TID:(.+)\/CurrentCount/), _ && (C = /Reader\/TID:(.+)\/DeferredCount/), V && (C = /Reader\/TID:(.+)\/RescheduledCount/), y[g].match(C) == null) {
839
+ console.log(`tid not found in ${y[g]}.`);
823
840
  debugger;
824
841
  return;
825
842
  }
826
- E ? (oe = Number(R[g]) == 0, h.total = Math.max(Number(R[g]), h.total), console.log(`----- ${h.name} TID: ${h.tid} batchId: ${h.batchId}`), console.log(`----- ${h.name} Total To Read: ${h.total}`)) : (ie = Number(R[g]) == 0, h.read = Math.max(Number(R[g]), h.read), console.log(`----- ${h.name} Currently Read: ${h.read}`));
843
+ E ? (oe = Number(P[g]) == 0, h.total = Math.max(Number(P[g]), h.total), console.log(`----- ${h.name} TID: ${h.tid} batchId: ${h.batchId}`), console.log(`----- ${h.name} Total To Read: ${h.total}`)) : (ie = Number(P[g]) == 0, h.read = Math.max(Number(P[g]), h.read), console.log(`----- ${h.name} Currently Read: ${h.read}`));
827
844
  }
828
- if (h.nothingtosync = oe && ie, m[g].startsWith("Writer")) {
829
- let N = /Writer\/TID:(.+)\/TotalCount/;
830
- M && (N = /Writer\/TID:(.+)\/CurrentCount/), _ && (N = /Writer\/TID:(.+)\/DeferredCount/), V && (N = /Writer\/TID:(.+)\/RescheduledCount/);
831
- let Z = m[g].match(N);
845
+ if (h.nothingtosync = oe && ie, y[g].startsWith("Writer")) {
846
+ let C = /Writer\/TID:(.+)\/TotalCount/;
847
+ M && (C = /Writer\/TID:(.+)\/CurrentCount/), _ && (C = /Writer\/TID:(.+)\/DeferredCount/), V && (C = /Writer\/TID:(.+)\/RescheduledCount/);
848
+ let Z = y[g].match(C);
832
849
  if (Z == null) {
833
- console.log(`tid not found in ${m[g]}.`);
850
+ console.log(`tid not found in ${y[g]}.`);
834
851
  debugger;
835
852
  return;
836
853
  }
@@ -841,11 +858,11 @@ class kt {
841
858
  return;
842
859
  }
843
860
  if (w.batchId = D.BatchId, E)
844
- w.total = Math.max(Number(R[g]), w.total), console.log(`----- ${w.name} TID: ${w.tid} batchId: ${w.batchId}`), console.log(`----- ${w.name} Total To Write: ${w.total}`);
861
+ w.total = Math.max(Number(P[g]), w.total), console.log(`----- ${w.name} TID: ${w.tid} batchId: ${w.batchId}`), console.log(`----- ${w.name} Total To Write: ${w.total}`);
845
862
  else if (M)
846
- w.written = Math.max(Number(R[g]), w.written), console.log(`----- ${w.name} Total Written: ${w.written}`);
863
+ w.written = Math.max(Number(P[g]), w.written), console.log(`----- ${w.name} Total Written: ${w.written}`);
847
864
  else if (_ || V)
848
- w.deferred = Math.max(Number(R[g]), w.deferred), console.log(`----- ${w.name} Total Deferred: ${w.deferred}`);
865
+ w.deferred = Math.max(Number(P[g]), w.deferred), console.log(`----- ${w.name} Total Deferred: ${w.deferred}`);
849
866
  else {
850
867
  console.log("unknown writer type");
851
868
  debugger;
@@ -864,7 +881,7 @@ class kt {
864
881
  this.milestoneArray.write(c), u("nothing to sync"), console.log('Setting config sync result: "nothing to sync"');
865
882
  else {
866
883
  if (le && this.milestoneArray.milestones[0].Read == null) {
867
- this.milestoneArray.read(c), u("reading complete"), console.log('Setting config sync result: "reading complete"'), t(e.workspaceId);
884
+ this.milestoneArray.read(c), u("reading complete"), console.log('Setting config sync result: "reading complete"'), e(t.workspaceId);
868
885
  let _ = (Date.now() - this.pb_startTS) / 1e3 / 8.5;
869
886
  this.pb_increment = _, console.log(`Setting increment: ${this.pb_increment}% per second`);
870
887
  }
@@ -886,17 +903,17 @@ class kt {
886
903
  });
887
904
  }
888
905
  // start a sync cycle
889
- async startSync(e, r, s) {
890
- let t = new y();
906
+ async startSync(t, r, s) {
907
+ let e = new m();
891
908
  if (this.tenantNodes == null || this.tenantNodes.length == 0) {
892
909
  debugger;
893
- return t.result = !1, t.error = "startSync: invalid parameters", t.status = 500, t;
910
+ return e.result = !1, e.error = "startSync: invalid parameters", e.status = 500, e;
894
911
  }
895
- return t = await mt(e, r, s), t;
912
+ return e = await wt(t, r, s), e;
896
913
  }
897
914
  }
898
915
  class me {
899
- constructor(e, r, s) {
916
+ constructor(t, r, s) {
900
917
  l(this, "expanded");
901
918
  l(this, "status", "");
902
919
  l(this, "name");
@@ -908,23 +925,23 @@ class me {
908
925
  l(this, "deferred", 0);
909
926
  l(this, "nothingtosync");
910
927
  l(this, "targets");
911
- this.expanded = !1, this.name = r, this.tid = e, this.batchId = s, this.nothingtosync = !1, this.targets = new Array(), this.update(0, 0, 0, 0);
928
+ this.expanded = !1, this.name = r, this.tid = t, this.batchId = s, this.nothingtosync = !1, this.targets = new Array(), this.update(0, 0, 0, 0);
912
929
  }
913
- update(e, r, s, t) {
914
- this.total = e, this.read = r, this.written = s, this.deferred = t, this.read === 0 && this.written === 0 && (this.status = "not started"), this.read > 0 ? this.read < this.total ? this.status = "in progress" : this.read === this.total && (this.status = "complete") : this.written > 0 && (this.written + this.deferred < this.total ? this.status = "in progress" : this.written === this.total ? this.status = "complete" : this.written + this.deferred >= this.total && (this.status = "failed"));
930
+ update(t, r, s, e) {
931
+ this.total = t, this.read = r, this.written = s, this.deferred = e, this.read === 0 && this.written === 0 && (this.status = "not started"), this.read > 0 ? this.read < this.total ? this.status = "in progress" : this.read === this.total && (this.status = "complete") : this.written > 0 && (this.written + this.deferred < this.total ? this.status = "in progress" : this.written === this.total ? this.status = "complete" : this.written + this.deferred >= this.total && (this.status = "failed"));
915
932
  }
916
933
  }
917
934
  class we {
918
- constructor(e, r) {
935
+ constructor(t, r) {
919
936
  l(this, "resourceNodes");
920
- this.resourceNodes = new Array(), e && this.init(r);
937
+ this.resourceNodes = new Array(), t && this.init(r);
921
938
  }
922
939
  // get resource data from localStorage or file
923
- init(e) {
924
- if (console.log(`Calling ResourceArray::init(bClearLocalStorage: ${e ? "true" : "false"})`), x()) {
940
+ init(t) {
941
+ if (console.log(`Calling ResourceArray::init(bClearLocalStorage: ${t ? "true" : "false"})`), x()) {
925
942
  let s = localStorage.getItem("ResourceArray");
926
943
  if (s != null && typeof s == "string" && s !== "")
927
- if (e)
944
+ if (t)
928
945
  localStorage.removeItem("ResourceArray");
929
946
  else {
930
947
  let n = JSON.parse(s);
@@ -940,39 +957,39 @@ class we {
940
957
  }
941
958
  }
942
959
  // read
943
- async read(e, r) {
960
+ async read(t, r) {
944
961
  let s = new we(!1, !1);
945
- return s.resourceNodes = await Xe(e, r), s;
962
+ return s.resourceNodes = await Xe(t, r), s;
946
963
  }
947
964
  // save resource data to localstorage
948
965
  save() {
949
966
  if (x()) {
950
- let e = JSON.stringify(this);
951
- localStorage.setItem("ResourceArray", e);
967
+ let t = JSON.stringify(this);
968
+ localStorage.setItem("ResourceArray", t);
952
969
  }
953
970
  }
954
971
  }
955
972
  class Le {
956
- constructor(e, r, s) {
973
+ constructor(t, r, s) {
957
974
  l(this, "type");
958
975
  l(this, "resource");
959
976
  l(this, "cost");
960
977
  l(this, "expanded");
961
978
  l(this, "resources");
962
- this.type = e, this.resource = r, this.cost = s, this.expanded = !1, this.resources = new Array();
979
+ this.type = t, this.resource = r, this.cost = s, this.expanded = !1, this.resources = new Array();
963
980
  }
964
981
  }
965
- class Dt {
966
- constructor(e) {
982
+ class Rt {
983
+ constructor(t) {
967
984
  l(this, "actorNodes");
968
- this.actorNodes = new Array(), this.init(e);
985
+ this.actorNodes = new Array(), this.init(t);
969
986
  }
970
987
  // get initial data from localStorage or file
971
- init(e) {
972
- if (console.log(`Calling ResourceArray::init(bClearLocalStorage: ${e ? "true" : "false"})`), x()) {
988
+ init(t) {
989
+ if (console.log(`Calling ResourceArray::init(bClearLocalStorage: ${t ? "true" : "false"})`), x()) {
973
990
  let s = localStorage.getItem("RBACActors");
974
991
  if (s != null && typeof s == "string" && s !== "")
975
- if (e)
992
+ if (t)
976
993
  localStorage.removeItem("RBACActors");
977
994
  else {
978
995
  let n = JSON.parse(s);
@@ -989,7 +1006,7 @@ class Dt {
989
1006
  }
990
1007
  }
991
1008
  class ze {
992
- constructor(e, r, s, t, n, o) {
1009
+ constructor(t, r, s, e, n, o) {
993
1010
  l(this, "type");
994
1011
  l(this, "actor");
995
1012
  l(this, "resource");
@@ -997,39 +1014,39 @@ class ze {
997
1014
  l(this, "updatedby");
998
1015
  l(this, "updatedon");
999
1016
  l(this, "actors");
1000
- this.type = e, this.actor = r, this.resource = s, this.role = t, this.updatedby = n, this.updatedon = o, this.actors = new Array();
1017
+ this.type = t, this.actor = r, this.resource = s, this.role = e, this.updatedby = n, this.updatedon = o, this.actors = new Array();
1001
1018
  }
1002
1019
  }
1003
1020
  function Me(a) {
1004
1021
  return "Group.Read.All User.Read.All openid profile offline_access User.Read Contacts.Read CrossTenantInformation.ReadBasic.All";
1005
1022
  }
1006
- async function J(a, e) {
1023
+ async function J(a, t) {
1007
1024
  const r = new Headers();
1008
1025
  r.append("Content-Type", "application/json"), r.append("accept", "*/*");
1009
1026
  const s = Me();
1010
- if (e.graphAccessToken == null || e.graphAccessToken === "")
1027
+ if (t.graphAccessToken == null || t.graphAccessToken === "")
1011
1028
  try {
1012
- let t = await a.acquireTokenByCode({
1013
- code: e.spacode
1029
+ let e = await a.acquireTokenByCode({
1030
+ code: t.spacode
1014
1031
  });
1015
- e.graphAccessToken = t.accessToken, console.log("Front end token acquired by code: " + e.graphAccessToken.slice(0, 20));
1016
- } catch (t) {
1017
- console.log("Front end token failure: " + t);
1032
+ t.graphAccessToken = e.accessToken, console.log("Front end token acquired by code: " + t.graphAccessToken.slice(0, 20));
1033
+ } catch (e) {
1034
+ console.log("Front end token failure: " + e);
1018
1035
  }
1019
1036
  else
1020
1037
  try {
1021
- let t = a.getAllAccounts(), n = e.oid + "." + e.tid, o = null;
1022
- for (let i = 0; i < t.length; i++)
1023
- t[i].homeAccountId == n && (o = t[i]);
1038
+ let e = a.getAllAccounts(), n = t.oid + "." + t.tid, o = null;
1039
+ for (let i = 0; i < e.length; i++)
1040
+ e[i].homeAccountId == n && (o = e[i]);
1024
1041
  let d = await a.acquireTokenSilent({
1025
1042
  scopes: [s],
1026
1043
  account: o
1027
1044
  });
1028
- e.graphAccessToken = d.accessToken, console.log("Front end token graph acquired silently: " + e.graphAccessToken.slice(0, 20));
1029
- } catch (t) {
1045
+ t.graphAccessToken = d.accessToken, console.log("Front end token graph acquired silently: " + t.graphAccessToken.slice(0, 20));
1046
+ } catch (e) {
1030
1047
  try {
1031
- console.log("Front end graph token silent acquisition failure: " + t);
1032
- let n = a.getAllAccounts(), o = e.oid + "." + e.tid, d = null;
1048
+ console.log("Front end graph token silent acquisition failure: " + e);
1049
+ let n = a.getAllAccounts(), o = t.oid + "." + t.tid, d = null;
1033
1050
  for (let i = 0; i < n.length; i++)
1034
1051
  n[i].homeAccountId == o && (d = n[i]);
1035
1052
  a.acquireTokenRedirect({
@@ -1040,24 +1057,24 @@ async function J(a, e) {
1040
1057
  console.log("Front end graph token redirect acquisition failure: " + n);
1041
1058
  }
1042
1059
  }
1043
- return r.append("Authorization", `Bearer ${e.graphAccessToken}`), r;
1060
+ return r.append("Authorization", `Bearer ${t.graphAccessToken}`), r;
1044
1061
  }
1045
- async function vt(a, e, r) {
1046
- if (e == null || e.spacode == "")
1062
+ async function Et(a, t, r) {
1063
+ if (t == null || t.spacode == "")
1047
1064
  return { groups: [], error: "500: invalid user passed to groupsGet" };
1048
- let t = { method: "GET", headers: await J(a, e) };
1065
+ let e = { method: "GET", headers: await J(a, t) };
1049
1066
  try {
1050
- let n = C(e.authority) + p.graphGroupsPredicate;
1067
+ let n = N(t.authority) + p.graphGroupsPredicate;
1051
1068
  n += `/?$filter=startsWith(displayName, '${r}')`;
1052
- let d = await (await fetch(n, t)).json();
1069
+ let d = await (await fetch(n, e)).json();
1053
1070
  return typeof d.error < "u" ? { groups: [], error: `${d.error.code}: ${d.error.message}` } : { groups: d.value, error: "" };
1054
1071
  } catch (n) {
1055
1072
  return console.log(n), { groups: [], error: `Exception: ${n}` };
1056
1073
  }
1057
1074
  }
1058
- async function je(a, e, r, s) {
1075
+ async function je(a, t, r, s) {
1059
1076
  try {
1060
- let t = C(e.authority) + p.graphOauth2PermissionGrantsPredicate, n = new URL(t);
1077
+ let e = N(t.authority) + p.graphOauth2PermissionGrantsPredicate, n = new URL(e);
1061
1078
  n.searchParams.append("$filter", `resourceId eq '${r}' and consentType eq 'Principal' and principalId eq '${s}'`);
1062
1079
  let d = await (await fetch(n.href, a)).json();
1063
1080
  if (typeof d.error < "u")
@@ -1067,49 +1084,49 @@ async function je(a, e, r, s) {
1067
1084
  return { grants: null, id: null, error: "oauth2PermissionGrantsGet: more than one matching delegated consent grant." };
1068
1085
  }
1069
1086
  return { grants: d.value[0].scope, id: d.value[0].id, error: "" };
1070
- } catch (t) {
1071
- return console.log(t), { grants: null, id: null, error: `Exception: ${t}` };
1087
+ } catch (e) {
1088
+ return console.log(e), { grants: null, id: null, error: `Exception: ${e}` };
1072
1089
  }
1073
1090
  }
1074
- async function He(a, e, r, s) {
1075
- if (e == null || e.spacode == "")
1091
+ async function He(a, t, r, s) {
1092
+ if (t == null || t.spacode == "")
1076
1093
  return !1;
1077
1094
  try {
1078
- let t = C(e.authority);
1079
- t += p.graphOauth2PermissionGrantsPredicate + `/${r}`;
1080
- let n = `{ "scope": "${s}" }`, d = { method: "PATCH", headers: await J(a, e), body: n }, i = await fetch(t, d), c = await i.json();
1095
+ let e = N(t.authority);
1096
+ e += p.graphOauth2PermissionGrantsPredicate + `/${r}`;
1097
+ let n = `{ "scope": "${s}" }`, d = { method: "PATCH", headers: await J(a, t), body: n }, i = await fetch(e, d), c = await i.json();
1081
1098
  if (i.status == 204 && i.statusText == "No Content")
1082
1099
  return !0;
1083
1100
  debugger;
1084
1101
  return console.log(`oauth2PermissionGrantsSet: PATCH failed ${c.error.code}: ${c.error.message}`), !1;
1085
- } catch (t) {
1102
+ } catch (e) {
1086
1103
  debugger;
1087
- return console.log(t), !1;
1104
+ return console.log(e), !1;
1088
1105
  }
1089
1106
  }
1090
- function Rt(a, e) {
1107
+ function Gt(a, t) {
1091
1108
  let r = We(a.authority);
1092
1109
  r += a.tid, r += "/adminconsent";
1093
- let s = new URL(r), t = Oe(a.authority, e);
1094
- s.searchParams.append("client_id", t), s.searchParams.append("redirect_uri", window.location.origin), s.searchParams.append("domain_hint", a.companyDomain), s.searchParams.append("login_hint", a.mail), window.location.assign(s.href);
1110
+ let s = new URL(r), e = Oe(a.authority, t);
1111
+ s.searchParams.append("client_id", e), s.searchParams.append("redirect_uri", window.location.origin), s.searchParams.append("domain_hint", a.companyDomain), s.searchParams.append("login_hint", a.mail), window.location.assign(s.href);
1095
1112
  }
1096
- async function qe(a, e, r) {
1113
+ async function qe(a, t, r) {
1097
1114
  try {
1098
- let s = C(e.authority);
1115
+ let s = N(t.authority);
1099
1116
  s += p.graphServicePrincipalsPredicate, s += `(appId='${r}')`;
1100
- let t = new URL(s);
1101
- t.searchParams.append("$select", "id,appId,displayName");
1102
- let o = await (await fetch(t.href, a)).json();
1117
+ let e = new URL(s);
1118
+ e.searchParams.append("$select", "id,appId,displayName");
1119
+ let o = await (await fetch(e.href, a)).json();
1103
1120
  return typeof o.error < "u" ? { spid: "", error: `${o.error.code}: ${o.error.message}` } : { spid: o.id, error: "" };
1104
1121
  } catch (s) {
1105
1122
  return console.log(s), { spid: "", error: `Exception: ${s}` };
1106
1123
  }
1107
1124
  }
1108
- async function Pt(a, e) {
1125
+ async function xt(a, t) {
1109
1126
  if (a.authority == "") {
1110
- let t = new L();
1111
- if (t.domain = a.tid, await Te(t, !1))
1112
- a.authority = t.authority;
1127
+ let e = new L();
1128
+ if (e.domain = a.tid, await Te(e, !1))
1129
+ a.authority = e.authority;
1113
1130
  else {
1114
1131
  debugger;
1115
1132
  return !1;
@@ -1132,14 +1149,14 @@ async function Pt(a, e) {
1132
1149
  let s = new URL(r);
1133
1150
  if (s.searchParams.append("redirectUri", window.location.origin), a.oid !== "1") {
1134
1151
  s.searchParams.append("loginHint", a.mail);
1135
- const t = /@([a-zA-Z0-9.-]+\.[a-zA-Z]{2,})$/, n = a.mail.match(t);
1152
+ const e = /@([a-zA-Z0-9.-]+\.[a-zA-Z]{2,})$/, n = a.mail.match(e);
1136
1153
  let o = n ? n[1] : "organizations";
1137
1154
  s.searchParams.append("domainHint", o);
1138
1155
  } else
1139
1156
  s.searchParams.append("domainHint", "organizations");
1140
- return e.setTaskStart("initialization", /* @__PURE__ */ new Date()), e.setTaskStart("authenticate user", /* @__PURE__ */ new Date()), window.location.assign(s.href), !0;
1157
+ return t.setTaskStart("initialization", /* @__PURE__ */ new Date()), t.setTaskStart("authenticate user", /* @__PURE__ */ new Date()), window.location.assign(s.href), !0;
1141
1158
  }
1142
- function Et(a, e) {
1159
+ function Ct(a, t) {
1143
1160
  debugger;
1144
1161
  if (a.oid == "1") return;
1145
1162
  let r = window.location.href;
@@ -1157,16 +1174,16 @@ function Et(a, e) {
1157
1174
  return;
1158
1175
  }
1159
1176
  let s = new URL(r);
1160
- s.searchParams.append("redirectUri", window.location.origin), s.searchParams.append("scope", e), s.searchParams.append("domainHint", "organizations"), s.searchParams.append("loginHint", a.mail), window.location.assign(s.href);
1177
+ s.searchParams.append("redirectUri", window.location.origin), s.searchParams.append("scope", t), s.searchParams.append("domainHint", "organizations"), s.searchParams.append("loginHint", a.mail), window.location.assign(s.href);
1161
1178
  }
1162
- async function Gt(a) {
1179
+ async function Nt(a) {
1163
1180
  if (a.oid == "1") return !1;
1164
- let e = window.location.href;
1165
- e += "user";
1166
- let r = new URL(e);
1181
+ let t = window.location.href;
1182
+ t += "user";
1183
+ let r = new URL(t);
1167
1184
  r.searchParams.append("oid", a.oid), r.searchParams.append("tid", a.tid), r.searchParams.append("loginHint", a.loginHint), r.searchParams.append("verb", "LOGOUT");
1168
- let s = { method: "PATCH" }, t = await fetch(r.href, s);
1169
- if (t.status == 200 && t.statusText == "OK")
1185
+ let s = { method: "PATCH" }, e = await fetch(r.href, s);
1186
+ if (e.status == 200 && e.statusText == "OK")
1170
1187
  console.log(`Successfully set admin ${a.mail} logout_hint`);
1171
1188
  else
1172
1189
  return console.log(`Failed to set admin ${a.mail} logout_hint`), !1;
@@ -1186,9 +1203,9 @@ async function Gt(a) {
1186
1203
  }
1187
1204
  return r = new URL(n), r.searchParams.append("redirectUri", window.location.origin), window.location.assign(r.href), !0;
1188
1205
  }
1189
- async function xt(a, e, r, s) {
1206
+ async function Ot(a, t, r, s) {
1190
1207
  if (s) debugger;
1191
- if (e.name != null && e.name !== "") return !1;
1208
+ if (t.name != null && t.name !== "") return !1;
1192
1209
  if (a.graphAccessToken != null && a.graphAccessToken === "") {
1193
1210
  console.log(`tenantRelationshipsGetByDomain called with invalid logged in user: ${a.name}`);
1194
1211
  try {
@@ -1198,12 +1215,12 @@ async function xt(a, e, r, s) {
1198
1215
  return console.log("tenantRelationshipsGetByDomain: Front end token failure: " + i), !1;
1199
1216
  }
1200
1217
  }
1201
- const t = new Headers(), n = `Bearer ${a.graphAccessToken}`;
1202
- t.append("Authorization", n);
1203
- let o = { method: "GET", headers: t };
1218
+ const e = new Headers(), n = `Bearer ${a.graphAccessToken}`;
1219
+ e.append("Authorization", n);
1220
+ let o = { method: "GET", headers: e };
1204
1221
  try {
1205
- var d = C(e.authority) + p.graphTenantByDomainPredicate;
1206
- d += "(domainName='", d += e.domain, d += "')", console.log("tenantRelationshipsGetByDomain: Attempting GET from /findTenantInformationByDomainName:", d);
1222
+ var d = N(t.authority) + p.graphTenantByDomainPredicate;
1223
+ d += "(domainName='", d += t.domain, d += "')", console.log("tenantRelationshipsGetByDomain: Attempting GET from /findTenantInformationByDomainName:", d);
1207
1224
  let i = await fetch(d, o);
1208
1225
  if (i.status == 200) {
1209
1226
  let c = await i.json();
@@ -1212,7 +1229,7 @@ async function xt(a, e, r, s) {
1212
1229
  debugger;
1213
1230
  return console.log("tenantRelationshipsGetByDomain: Failed GET from /findTenantInformationByDomainName: ", c.error.message), !1;
1214
1231
  } else if (c.displayName != null && c.displayName !== "")
1215
- return e.tid = c.tenantId, e.name = c.displayName, console.log("tenantRelationshipsGetByDomain: Successful GET from /findTenantInformationByDomainName: ", c.displayName), !0;
1232
+ return t.tid = c.tenantId, t.name = c.displayName, console.log("tenantRelationshipsGetByDomain: Successful GET from /findTenantInformationByDomainName: ", c.displayName), !0;
1216
1233
  } else
1217
1234
  console.log("tenantRelationshipsGetByDomain: Failed to GET from /findTenantInformationByDomainName: ", d);
1218
1235
  }
@@ -1221,8 +1238,8 @@ async function xt(a, e, r, s) {
1221
1238
  }
1222
1239
  return !1;
1223
1240
  }
1224
- async function Je(a, e, r, s, t) {
1225
- if (console.log("**** tenantRelationshipsGetById"), t) debugger;
1241
+ async function Je(a, t, r, s, e) {
1242
+ if (console.log("**** tenantRelationshipsGetById"), e) debugger;
1226
1243
  if (a.graphAccessToken === "")
1227
1244
  try {
1228
1245
  let c = await s.acquireTokenByCode({ code: a.spacode, scopes: ["user.read", "contacts.read", "CrossTenantInformation.ReadBasic.All"] });
@@ -1234,12 +1251,12 @@ async function Je(a, e, r, s, t) {
1234
1251
  n.append("Authorization", o);
1235
1252
  let d = { method: "GET", headers: n };
1236
1253
  try {
1237
- var i = C(a.authority) + p.graphTenantByIdPredicate;
1238
- i += "(tenantId='", i += e.tid, i += "')", console.log("tenantRelationshipsGetById: Attempting GET from /findTenantInformationByTenantId:", i);
1254
+ var i = N(a.authority) + p.graphTenantByIdPredicate;
1255
+ i += "(tenantId='", i += t.tid, i += "')", console.log("tenantRelationshipsGetById: Attempting GET from /findTenantInformationByTenantId:", i);
1239
1256
  let u = await (await fetch(i, d)).json();
1240
1257
  if (u && typeof u.displayName !== void 0 && u.displayName !== "") {
1241
- if (e !== void 0)
1242
- e.name = u.displayName, e.domain = u.defaultDomainName;
1258
+ if (t !== void 0)
1259
+ t.name = u.displayName, t.domain = u.defaultDomainName;
1243
1260
  else {
1244
1261
  console.log("tenantRelationshipsGetById: missing associated tenant for logged in user.");
1245
1262
  debugger;
@@ -1252,14 +1269,14 @@ async function Je(a, e, r, s, t) {
1252
1269
  }
1253
1270
  return !1;
1254
1271
  }
1255
- async function Te(a, e) {
1256
- if (e) debugger;
1257
- let r = [p.authorityWW, p.authorityUS, p.authorityCN], s = [p.authorityWWRegex, p.authorityUSRegex, p.authorityCNRegex], t = null;
1272
+ async function Te(a, t) {
1273
+ if (t) debugger;
1274
+ let r = [p.authorityWW, p.authorityUS, p.authorityCN], s = [p.authorityWWRegex, p.authorityUSRegex, p.authorityCNRegex], e = null;
1258
1275
  try {
1259
1276
  for (let i = 0; i < 3; i++) {
1260
1277
  var n = r[i];
1261
- if (a.lookupfield == "Domain" ? n += a.domain : a.lookupfield == "Tenant ID" && (n += a.tid), n += "/.well-known/openid-configuration", console.log("Attempting GET from openid well-known endpoint: ", n), t = await fetch(n), t.status == 200) {
1262
- let c = await t.json();
1278
+ if (a.lookupfield == "Domain" ? n += a.domain : a.lookupfield == "Tenant ID" && (n += a.tid), n += "/.well-known/openid-configuration", console.log("Attempting GET from openid well-known endpoint: ", n), e = await fetch(n), e.status == 200) {
1279
+ let c = await e.json();
1263
1280
  if (c) {
1264
1281
  var o = c.authorization_endpoint;
1265
1282
  for (let u = 0; u < 3; u++) {
@@ -1275,24 +1292,24 @@ async function Te(a, e) {
1275
1292
  } catch (i) {
1276
1293
  console.log("Failed to GET from openid well-known endpoint: ", i);
1277
1294
  }
1278
- return (a.tid == "" || a.authority == "") && console.log(`GET from openid well-known endpoint failed to find tenant: ${t ? t.statusText : "unknown"}`), !1;
1295
+ return (a.tid == "" || a.authority == "") && console.log(`GET from openid well-known endpoint failed to find tenant: ${e ? e.statusText : "unknown"}`), !1;
1279
1296
  }
1280
- async function Ke(a, e, r) {
1281
- if (e == null || e.spacode == "" || r == null) {
1297
+ async function Ke(a, t, r) {
1298
+ if (t == null || t.spacode == "" || r == null) {
1282
1299
  debugger;
1283
1300
  return { scopes: null, id: null, error: "500: invalid parameter(s) passed to getUserDelegatedScopes" };
1284
1301
  }
1285
- let t = { method: "GET", headers: await J(a, e) };
1302
+ let e = { method: "GET", headers: await J(a, t) };
1286
1303
  try {
1287
1304
  if (r.graphSP == "") {
1288
- let { spid: i, error: c } = await qe(t, e, "00000003-0000-0000-c000-000000000000");
1305
+ let { spid: i, error: c } = await qe(e, t, "00000003-0000-0000-c000-000000000000");
1289
1306
  if (c != "") {
1290
1307
  debugger;
1291
1308
  return { scopes: null, id: null, error: `${c}` };
1292
1309
  }
1293
1310
  r.graphSP = i;
1294
1311
  }
1295
- let { grants: n, id: o, error: d } = await je(t, e, r.graphSP, e.oid);
1312
+ let { grants: n, id: o, error: d } = await je(e, t, r.graphSP, t.oid);
1296
1313
  if (d != "") {
1297
1314
  debugger;
1298
1315
  return { scopes: null, id: null, error: `${d}` };
@@ -1303,31 +1320,31 @@ async function Ke(a, e, r) {
1303
1320
  return console.log(n), { scopes: null, id: null, error: `Exception: ${n}` };
1304
1321
  }
1305
1322
  }
1306
- async function Nt(a, e, r, s) {
1307
- if (e == null || e.spacode == "" || r == null) {
1323
+ async function Wt(a, t, r, s) {
1324
+ if (t == null || t.spacode == "" || r == null) {
1308
1325
  debugger;
1309
1326
  return !1;
1310
1327
  }
1311
- let { scopes: t, id: n, error: o } = await Ke(a, e, r);
1328
+ let { scopes: e, id: n, error: o } = await Ke(a, t, r);
1312
1329
  if (o != "") {
1313
1330
  debugger;
1314
- return console.log(`userDelegatedScopesRemove: cannot find userDelegatedScopes for ${e.mail}: ${o}`), !1;
1331
+ return console.log(`userDelegatedScopesRemove: cannot find userDelegatedScopes for ${t.mail}: ${o}`), !1;
1315
1332
  }
1316
- t = t.replace(s, "");
1317
- let d = await He(a, e, n, t);
1333
+ e = e.replace(s, "");
1334
+ let d = await He(a, t, n, e);
1318
1335
  if (!d) {
1319
1336
  debugger;
1320
- return console.log(`userDelegatedScopesRemove: cannot set oauth2PermissionGrants for ${e.mail}: ${o}`), !1;
1337
+ return console.log(`userDelegatedScopesRemove: cannot set oauth2PermissionGrants for ${t.mail}: ${o}`), !1;
1321
1338
  }
1322
- return e.scopes = t.split(" "), d;
1339
+ return t.scopes = e.split(" "), d;
1323
1340
  }
1324
- async function Ct(a, e) {
1325
- if (e == null || e.spacode == "")
1341
+ async function Ft(a, t) {
1342
+ if (t == null || t.spacode == "")
1326
1343
  return { users: [], error: "500: invalid user passed to usersGet" };
1327
1344
  try {
1328
- let s = { method: "GET", headers: await J(a, e) }, t = C(e.authority);
1329
- t += p.graphUsersPredicate;
1330
- let o = await (await fetch(t, s)).json();
1345
+ let s = { method: "GET", headers: await J(a, t) }, e = N(t.authority);
1346
+ e += p.graphUsersPredicate;
1347
+ let o = await (await fetch(e, s)).json();
1331
1348
  if (typeof o.error < "u")
1332
1349
  return { users: [], error: `${o.error.code}: ${o.error.message}` };
1333
1350
  let d = new Array();
@@ -1338,41 +1355,47 @@ async function Ct(a, e) {
1338
1355
  return console.log(r), { users: [], error: `Exception: ${r}` };
1339
1356
  }
1340
1357
  }
1341
- async function Ot(a, e, r) {
1342
- return rt(a, e, r);
1358
+ async function _t(a, t, r, s) {
1359
+ return rt(a, t, r, s);
1343
1360
  }
1344
- async function Wt(a, e, r, s, t, n, o, d) {
1345
- let i = new y();
1361
+ async function Bt(a, t, r) {
1362
+ return nt();
1363
+ }
1364
+ async function Ut(a, t, r) {
1365
+ return at(a, t, r);
1366
+ }
1367
+ async function Lt(a, t, r, s, e, n, o, d) {
1368
+ let i = new m();
1346
1369
  if (r.id === "1") {
1347
- if (i = await lt(a, e, r, n.id, d), i.result) {
1370
+ if (i = await dt(a, t, r, n.id, d), i.result) {
1348
1371
  s && s(r.id);
1349
1372
  const c = {};
1350
- Object.defineProperty(c, r.id, { value: !0, writable: !0, enumerable: !0 }), t(c);
1373
+ Object.defineProperty(c, r.id, { value: !0, writable: !0, enumerable: !0 }), e(c);
1351
1374
  let u = n.associatedConfigs.findIndex((f) => f == "1");
1352
1375
  u !== -1 && (n.associatedConfigs.splice(u, 1), n.associatedConfigs.push(r.id));
1353
1376
  }
1354
1377
  } else
1355
- i = await ct(a, e, r, d);
1378
+ i = await ut(a, t, r, d);
1356
1379
  return o.save(), i;
1357
1380
  }
1358
- async function Ft(a, e, r, s, t) {
1359
- let n = new y();
1360
- return n = await it(a, e, r, s, t), n;
1381
+ async function zt(a, t, r, s, e) {
1382
+ let n = new m();
1383
+ return n = await ct(a, t, r, s, e), n;
1361
1384
  }
1362
- async function _t(a, e, r, s, t) {
1363
- return nt(a, e, r, s, t);
1385
+ async function Mt(a, t, r, s, e) {
1386
+ return ot(a, t, r, s, e);
1364
1387
  }
1365
- async function Bt(a, e, r, s, t) {
1366
- return at(a, e, r, s, t);
1388
+ async function jt(a, t, r, s, e) {
1389
+ return it(a, t, r, s, e);
1367
1390
  }
1368
- async function Ut(a, e, r, s, t) {
1369
- let n = new y();
1370
- if (t) debugger;
1391
+ async function Ht(a, t, r, s, e) {
1392
+ let n = new m();
1393
+ if (e) debugger;
1371
1394
  try {
1372
1395
  let o = s.ws.find((d) => d.id === r);
1373
1396
  if (o != null) {
1374
1397
  o.associatedConfigs.length = 0;
1375
- let d = await be(a, e, o.id, t);
1398
+ let d = await be(a, t, o.id, e);
1376
1399
  if (!d.result) return d;
1377
1400
  let i = "";
1378
1401
  for (let c of o.associatedConfigs) {
@@ -1387,134 +1410,134 @@ async function Ut(a, e, r, s, t) {
1387
1410
  }
1388
1411
  return n.result = !1, n.status = 500, n;
1389
1412
  }
1390
- async function Lt(a, e, r, s, t) {
1391
- return ot(a, e, r, s);
1413
+ async function qt(a, t, r, s, e) {
1414
+ return lt(a, t, r, s);
1392
1415
  }
1393
- async function zt(a, e, r, s, t) {
1416
+ async function Jt(a, t, r, s, e) {
1394
1417
  console.log(">>>>>> initGet");
1395
- let n = new y();
1396
- if (t)
1418
+ let n = new m();
1419
+ if (e)
1397
1420
  debugger;
1398
1421
  let o = new L();
1399
- return o.tid = e.tid, o.domain = e.tid, await Te(o, t) ? (e.authority = o.authority, s.setTaskStart("GET tenant details", /* @__PURE__ */ new Date()), n.result = await Je(e, o, r, a, t), s.setTaskEnd("GET tenant details", /* @__PURE__ */ new Date(), "complete"), n.result && (e.companyName = o.name, e.companyDomain = o.domain, s.setTaskStart("POST config init", /* @__PURE__ */ new Date()), n = await dt(a, e, t), s.setTaskEnd("POST config init", /* @__PURE__ */ new Date(), n.result ? "complete" : "failed")), n.result && (s.setTaskStart("GET workspaces", /* @__PURE__ */ new Date()), n = await Qe(a, e, r, t), s.setTaskEnd("GET workspaces", /* @__PURE__ */ new Date(), n.result ? "complete" : "failed")), console.log("initGet complete. Version: " + F()), n) : (n.error = `Failed to retrieve authority for user "${e.mail}" TID ${e.tid}.`, n.result = !1, n);
1422
+ return o.tid = t.tid, o.domain = t.tid, await Te(o, e) ? (t.authority = o.authority, s.setTaskStart("GET tenant details", /* @__PURE__ */ new Date()), n.result = await Je(t, o, r, a, e), s.setTaskEnd("GET tenant details", /* @__PURE__ */ new Date(), "complete"), n.result && (t.companyName = o.name, t.companyDomain = o.domain, s.setTaskStart("POST config init", /* @__PURE__ */ new Date()), n = await pt(a, t, e), s.setTaskEnd("POST config init", /* @__PURE__ */ new Date(), n.result ? "complete" : "failed")), n.result && (s.setTaskStart("GET workspaces", /* @__PURE__ */ new Date()), n = await Qe(a, t, r, e), s.setTaskEnd("GET workspaces", /* @__PURE__ */ new Date(), n.result ? "complete" : "failed")), console.log("initGet complete. Version: " + F()), n) : (n.error = `Failed to retrieve authority for user "${t.mail}" TID ${t.tid}.`, n.result = !1, n);
1400
1423
  }
1401
- async function Mt(a, e, r, s) {
1402
- return ft(a, e, r, s);
1424
+ async function Kt(a, t, r, s) {
1425
+ return gt(a, t, r, s);
1403
1426
  }
1404
- async function jt(a, e, r, s, t) {
1405
- return ut(a, e, r, s);
1427
+ async function Vt(a, t, r, s, e) {
1428
+ return ft(a, t, r, s);
1406
1429
  }
1407
- async function Ht(a, e, r, s) {
1408
- return st(a, e, r, s);
1430
+ async function Zt(a, t, r, s) {
1431
+ return st(a, t, r, s);
1409
1432
  }
1410
- async function qt(a, e, r, s) {
1411
- return et(a, e, r, s);
1433
+ async function Qt(a, t, r, s) {
1434
+ return et(a, t, r, s);
1412
1435
  }
1413
- async function Jt(a, e, r, s) {
1414
- return await ht(a, e, r, s);
1436
+ async function Xt(a, t, r, s) {
1437
+ return await mt(a, t, r, s);
1415
1438
  }
1416
- function Ve(a, e, r, s) {
1417
- r.map((t) => {
1418
- let n = null, o = e.us.findIndex((c) => c.oid === t.userId || c.oid === t.email);
1439
+ function Ve(a, t, r, s) {
1440
+ r.map((e) => {
1441
+ let n = null, o = t.us.findIndex((c) => c.oid === e.userId || c.oid === e.email);
1419
1442
  if (o === -1) {
1420
- let c = e.us.findIndex((u) => u.oid === "1");
1443
+ let c = t.us.findIndex((u) => u.oid === "1");
1421
1444
  if (c !== -1) {
1422
- n = e.us.at(c);
1445
+ n = t.us.at(c);
1423
1446
  let u = a.associatedUsers.findIndex((f) => f == "1");
1424
- u !== -1 && (a.associatedUsers.splice(u, 1), a.associatedUsers.push(t.userId));
1447
+ u !== -1 && (a.associatedUsers.splice(u, 1), a.associatedUsers.push(e.userId));
1425
1448
  } else
1426
- n = new X(), e.us.push(n);
1449
+ n = new X(), t.us.push(n);
1427
1450
  } else
1428
- n = e.us.at(o);
1429
- n.sel = s === t.userId, n.oid = t.userId ? t.userId : t.email, n.name = t.firstName ?? n.name, n.mail = t.email, n.tid = t.tenantId;
1430
- let d = e.ts.find((c) => c.tid === n.tid);
1451
+ n = t.us.at(o);
1452
+ n.sel = s === e.userId, n.oid = e.userId ? e.userId : e.email, n.name = e.firstName ?? n.name, n.mail = e.email, n.tid = e.tenantId;
1453
+ let d = t.ts.find((c) => c.tid === n.tid);
1431
1454
  d != null && (n.authority = d.authority, n.companyName = d.name, n.companyDomain = d.domain), a.associatedUsers.findIndex((c) => c === n.oid) == -1 && a.associatedUsers.push(n.oid);
1432
- }), e.save();
1455
+ }), t.save();
1433
1456
  }
1434
- function Ze(a, e, r, s) {
1435
- r.map((t) => {
1436
- let n = null, o = e.ts.findIndex((u) => u.tid === t.tenantId);
1457
+ function Ze(a, t, r, s) {
1458
+ r.map((e) => {
1459
+ let n = null, o = t.ts.findIndex((u) => u.tid === e.tenantId);
1437
1460
  if (o === -1) {
1438
- let u = e.ts.findIndex((f) => f.tid === "1");
1461
+ let u = t.ts.findIndex((f) => f.tid === "1");
1439
1462
  if (u !== -1) {
1440
- n = e.ts.at(u);
1463
+ n = t.ts.at(u);
1441
1464
  let f = a.associatedTenants.findIndex((b) => b == "1");
1442
- f !== -1 && (a.associatedTenants.splice(f, 1), a.associatedTenants.push(t.tenantId));
1465
+ f !== -1 && (a.associatedTenants.splice(f, 1), a.associatedTenants.push(e.tenantId));
1443
1466
  } else
1444
- n = new L(), e.ts.push(n);
1467
+ n = new L(), t.ts.push(n);
1445
1468
  } else
1446
- n = e.ts.at(o);
1447
- n.sel = s === t.tenantId, n.tid = t.tenantId, n.name = t.name, n.domain = t.domain, n.tenantType = t.type.toLowerCase();
1448
- const d = /^(https:\/\/login.microsoftonline.(?:us|com)\/)organizations\/v2.0$/, i = t.authority.match(d);
1449
- n.authority = i ? i[1] : t.authority, a.associatedTenants.findIndex((u) => u === t.tenantId) == -1 && a.associatedTenants.push(t.tenantId);
1450
- }), e.save();
1451
- }
1452
- function Se(a, e, r, s) {
1453
- r.map((t) => {
1454
- let n = null, o = e.cs.findIndex((i) => i.id === t.id);
1469
+ n = t.ts.at(o);
1470
+ n.sel = s === e.tenantId, n.tid = e.tenantId, n.name = e.name, n.domain = e.domain, n.tenantType = e.type.toLowerCase();
1471
+ const d = /^(https:\/\/login.microsoftonline.(?:us|com)\/)organizations\/v2.0$/, i = e.authority.match(d);
1472
+ n.authority = i ? i[1] : e.authority, a.associatedTenants.findIndex((u) => u === e.tenantId) == -1 && a.associatedTenants.push(e.tenantId);
1473
+ }), t.save();
1474
+ }
1475
+ function Se(a, t, r, s) {
1476
+ r.map((e) => {
1477
+ let n = null, o = t.cs.findIndex((i) => i.id === e.id);
1455
1478
  if (o === -1) {
1456
- let i = e.cs.findIndex((c) => c.id === "1");
1479
+ let i = t.cs.findIndex((c) => c.id === "1");
1457
1480
  if (i !== -1) {
1458
- n = e.cs.at(i);
1481
+ n = t.cs.at(i);
1459
1482
  let c = a.associatedConfigs.findIndex((u) => u == "1");
1460
- c !== -1 && (a.associatedConfigs.splice(c, 1), a.associatedConfigs.push(t.id));
1483
+ c !== -1 && (a.associatedConfigs.splice(c, 1), a.associatedConfigs.push(e.id));
1461
1484
  } else
1462
- n = new Y(), e.cs.push(n);
1485
+ n = new Y(), t.cs.push(n);
1463
1486
  } else
1464
- n = e.cs.at(o);
1465
- n.sel = s === t.id, n.id = t.id, n.workspaceId = t.workspaceId, n.name = t.name, n.description = t.description, n.isEnabled = t.isEnabled, n.tenants.length = 0, t.tenants.map((i) => {
1487
+ n = t.cs.at(o);
1488
+ n.sel = s === e.id, n.id = e.id, n.workspaceId = e.workspaceId, n.name = e.name, n.description = e.description, n.isEnabled = e.isEnabled, n.tenants.length = 0, e.tenants.map((i) => {
1466
1489
  let c = new _e();
1467
1490
  c.tid = i.tenantId, c.sourceGroupId = i.sourceGroupId ?? "", c.sourceGroupName = i.sourceGroupName ?? "", c.targetGroupId = i.targetGroupId ?? "", c.targetGroupName = i.targetGroupName ?? "", c.configurationTenantType = i.configurationTenantType.toLowerCase(), c.deltaToken = i.deltaToken ?? "", c.configId = n.id, c.batchId = i.batchId ?? "", c.isReadPermissionConsented = i.isReadPermissionConsented, c.isWritePermissionConsented = i.isWritePermissionConsented, n.tenants.push(c);
1468
- }), a.associatedConfigs.findIndex((i) => i === t.id) == -1 && a.associatedConfigs.push(t.id);
1469
- }), e.save();
1491
+ }), a.associatedConfigs.findIndex((i) => i === e.id) == -1 && a.associatedConfigs.push(e.id);
1492
+ }), t.save();
1470
1493
  }
1471
- async function Qe(a, e, r, s) {
1472
- let t = new y();
1494
+ async function Qe(a, t, r, s) {
1495
+ let e = new m();
1473
1496
  if (s) debugger;
1474
1497
  try {
1475
- if (t = await gt(a, e, s), t.result) {
1476
- for (let n of t.array) {
1498
+ if (e = await yt(a, t, s), e.result) {
1499
+ for (let n of e.array) {
1477
1500
  let o = null, d = r.ws.findIndex((k) => k.id === n.id);
1478
1501
  if (d === -1) {
1479
- let k = r.ws.findIndex((m) => m.id === "1");
1502
+ let k = r.ws.findIndex((y) => y.id === "1");
1480
1503
  k !== -1 ? o = r.ws.at(k) : (o = new ee(), r.ws.push(o));
1481
1504
  } else
1482
1505
  o = r.ws.at(d);
1483
1506
  let i = "";
1484
1507
  for (let k of o.associatedUsers) {
1485
- let m = r.us.find((R) => R.oid === k);
1486
- m != null && m.sel && (i = m.oid);
1508
+ let y = r.us.find((P) => P.oid === k);
1509
+ y != null && y.sel && (i = y.oid);
1487
1510
  }
1488
1511
  let c = "";
1489
1512
  for (let k of o.associatedTenants) {
1490
- let m = r.ts.find((R) => R.tid === k);
1491
- m != null && m.sel && (c = m.tid);
1513
+ let y = r.ts.find((P) => P.tid === k);
1514
+ y != null && y.sel && (c = y.tid);
1492
1515
  }
1493
1516
  let u = "";
1494
1517
  for (let k of o.associatedConfigs) {
1495
- let m = r.cs.find((R) => R.id === k);
1496
- m != null && m.sel && (u = m.id);
1518
+ let y = r.cs.find((P) => P.id === k);
1519
+ y != null && y.sel && (u = y.id);
1497
1520
  }
1498
1521
  o.associatedUsers.length = 0, o.associatedTenants.length = 0, o.associatedConfigs.length = 0, o.id = n.id, o.name = n.name, o.ownerid = n.workspaceOwnerUserId;
1499
- let f = tt(a, e, o.id, s), b = pt(a, e, o.id, s), I = be(a, e, o.id, s), [v, D, h] = await Promise.all([f, b, I]);
1522
+ let f = tt(a, t, o.id, s), b = ht(a, t, o.id, s), I = be(a, t, o.id, s), [v, D, h] = await Promise.all([f, b, I]);
1500
1523
  if (!v.result) return v;
1501
1524
  if (!D.result) return D;
1502
1525
  if (!h.result) return h;
1503
1526
  Ze(o, r, D.array, c), Ve(o, r, v.array, i), Se(o, r, h.array, u), r.tagWithWorkspaces();
1504
1527
  }
1505
- return t;
1528
+ return e;
1506
1529
  }
1507
1530
  } catch (n) {
1508
- console.log(n.message), t.error = n.message;
1531
+ console.log(n.message), e.error = n.message;
1509
1532
  }
1510
- return t.result = !1, t.status = 500, t;
1533
+ return e.result = !1, e.status = 500, e;
1511
1534
  }
1512
- async function Kt(a, e) {
1535
+ async function Yt(a, t) {
1513
1536
  let r = "", s = F();
1514
1537
  try {
1515
- let t = a.getAllAccounts(), n = e.oid + "." + e.tid, o = null;
1516
- for (let i = 0; i < t.length; i++)
1517
- t[i].homeAccountId == n && (o = t[i]);
1538
+ let e = a.getAllAccounts(), n = t.oid + "." + t.tid, o = null;
1539
+ for (let i = 0; i < e.length; i++)
1540
+ e[i].homeAccountId == n && (o = e[i]);
1518
1541
  r = (await a.acquireTokenSilent({
1519
1542
  scopes: [
1520
1543
  "https://analysis.windows.net/powerbi/api/App.Read.All",
@@ -1529,41 +1552,41 @@ async function Kt(a, e) {
1529
1552
  }
1530
1553
  return console.log(s), r;
1531
1554
  }
1532
- async function ae(a, e) {
1555
+ async function ae(a, t) {
1533
1556
  const r = new Headers();
1534
- if (r.append("Content-Type", "application/json"), r.append("accept", "*/*"), e.azureAccessToken == null || e.azureAccessToken === "")
1557
+ if (r.append("Content-Type", "application/json"), r.append("accept", "*/*"), t.azureAccessToken == null || t.azureAccessToken === "")
1535
1558
  try {
1536
- let s = a.getAllAccounts(), t = e.oid + "." + e.tid, n = null;
1559
+ let s = a.getAllAccounts(), e = t.oid + "." + t.tid, n = null;
1537
1560
  for (let d = 0; d < s.length; d++)
1538
- s[d].homeAccountId == t && (n = s[d]);
1561
+ s[d].homeAccountId == e && (n = s[d]);
1539
1562
  let o = await a.acquireTokenSilent({
1540
1563
  scopes: ["https://management.azure.com/user_impersonation"],
1541
1564
  account: n
1542
1565
  });
1543
- e.azureAccessToken = o.accessToken, console.log("Front end token acquired silently: " + e.azureAccessToken.slice(0, 20));
1566
+ t.azureAccessToken = o.accessToken, console.log("Front end token acquired silently: " + t.azureAccessToken.slice(0, 20));
1544
1567
  } catch (s) {
1545
1568
  try {
1546
1569
  console.log("Front end token silent acquisition failure: " + s);
1547
- let t = a.getAllAccounts(), n = e.oid + "." + e.tid, o = null;
1548
- for (let d = 0; d < t.length; d++)
1549
- t[d].homeAccountId == n && (o = t[d]);
1570
+ let e = a.getAllAccounts(), n = t.oid + "." + t.tid, o = null;
1571
+ for (let d = 0; d < e.length; d++)
1572
+ e[d].homeAccountId == n && (o = e[d]);
1550
1573
  a.acquireTokenRedirect({
1551
1574
  scopes: ["https://management.azure.com/user_impersonation"],
1552
1575
  account: o
1553
1576
  });
1554
- } catch (t) {
1555
- console.log("Front end token popup acquisition failure: " + t);
1577
+ } catch (e) {
1578
+ console.log("Front end token popup acquisition failure: " + e);
1556
1579
  }
1557
1580
  }
1558
- return r.append("Authorization", `Bearer ${e.azureAccessToken}`), r;
1581
+ return r.append("Authorization", `Bearer ${t.azureAccessToken}`), r;
1559
1582
  }
1560
- async function Vt(a, e) {
1561
- if (e == null || e.spacode == "")
1583
+ async function es(a, t) {
1584
+ if (t == null || t.spacode == "")
1562
1585
  return !1;
1563
1586
  try {
1564
- let s = { method: "GET", headers: await ae(a, e) }, t = U.azureListRootAssignments;
1565
- t += "'", t += e.oid, t += "'";
1566
- let n = await fetch(t, s);
1587
+ let s = { method: "GET", headers: await ae(a, t) }, e = U.azureListRootAssignments;
1588
+ e += "'", e += t.oid, e += "'";
1589
+ let n = await fetch(e, s);
1567
1590
  if (n.status == 200) {
1568
1591
  let o = await n.json();
1569
1592
  o = o;
@@ -1576,11 +1599,11 @@ async function Vt(a, e) {
1576
1599
  }
1577
1600
  return !0;
1578
1601
  }
1579
- async function Zt(a, e) {
1580
- if (e == null || e.spacode == "")
1602
+ async function ts(a, t) {
1603
+ if (t == null || t.spacode == "")
1581
1604
  return !1;
1582
1605
  try {
1583
- let s = { method: "POST", headers: await ae(a, e) }, t = U.azureElevateAccess, n = await fetch(t, s);
1606
+ let s = { method: "POST", headers: await ae(a, t) }, e = U.azureElevateAccess, n = await fetch(e, s);
1584
1607
  if (n.status == 200)
1585
1608
  console.log("Successful call to Azure Resource Graph list root assignments");
1586
1609
  else
@@ -1590,14 +1613,14 @@ async function Zt(a, e) {
1590
1613
  }
1591
1614
  return !0;
1592
1615
  }
1593
- async function Xe(a, e) {
1616
+ async function Xe(a, t) {
1594
1617
  let r = new Array();
1595
- if (e == null || e.spacode == "")
1618
+ if (t == null || t.spacode == "")
1596
1619
  return r;
1597
1620
  try {
1598
- let t = { method: "GET", headers: await ae(a, e) }, n = U.azureListRootAssignments;
1599
- n += "'", n += e.oid, n += "'";
1600
- let o = await fetch(n, t);
1621
+ let e = { method: "GET", headers: await ae(a, t) }, n = U.azureListRootAssignments;
1622
+ n += "'", n += t.oid, n += "'";
1623
+ let o = await fetch(n, e);
1601
1624
  if (o.status == 200) {
1602
1625
  let d = await o.json();
1603
1626
  d = d;
@@ -1611,26 +1634,26 @@ async function Xe(a, e) {
1611
1634
  return r;
1612
1635
  }
1613
1636
  function Ye(a) {
1614
- let e = "8d95d21c-c378-4bb0-9f52-88c30d271e7a", r = a.authority.toLowerCase();
1615
- return r.startsWith("https://login.microsoftonline.com/") ? e = "8d95d21c-c378-4bb0-9f52-88c30d271e7a" : r.startsWith("https://login.microsoftonline.us/") ? e = "48da942e-ea3d-49e4-a054-81649012f8f2" : r.startsWith("https://login.partner.microsoftonline.cn/") && (e = "c91d32e4-dcc5-4d77-826a-16e93ffce666"), `api://${e}/Config.Write`;
1637
+ let t = "8d95d21c-c378-4bb0-9f52-88c30d271e7a", r = a.authority.toLowerCase();
1638
+ return r.startsWith("https://login.microsoftonline.com/") ? t = "8d95d21c-c378-4bb0-9f52-88c30d271e7a" : r.startsWith("https://login.microsoftonline.us/") ? t = "48da942e-ea3d-49e4-a054-81649012f8f2" : r.startsWith("https://login.partner.microsoftonline.cn/") && (t = "c91d32e4-dcc5-4d77-826a-16e93ffce666"), `api://${t}/Config.Write`;
1616
1639
  }
1617
- async function $(a, e) {
1640
+ async function A(a, t) {
1618
1641
  const r = new Headers();
1619
1642
  r.append("Content-Type", "application/json"), r.append("accept", "*/*");
1620
- const s = Ye(e);
1643
+ const s = Ye(t);
1621
1644
  try {
1622
- let t = a.getAllAccounts(), n = e.oid + "." + e.tid, o = null;
1623
- for (let i = 0; i < t.length; i++)
1624
- t[i].homeAccountId == n && (o = t[i]);
1645
+ let e = a.getAllAccounts(), n = t.oid + "." + t.tid, o = null;
1646
+ for (let i = 0; i < e.length; i++)
1647
+ e[i].homeAccountId == n && (o = e[i]);
1625
1648
  let d = await a.acquireTokenSilent({
1626
1649
  scopes: [s],
1627
1650
  account: o
1628
1651
  });
1629
- e.mindlineAccessToken = d.accessToken, console.log("Front end mindline token acquired silently: " + e.mindlineAccessToken.slice(0, 20));
1630
- } catch (t) {
1652
+ t.mindlineAccessToken = d.accessToken, console.log("Front end mindline token acquired silently: " + t.mindlineAccessToken.slice(0, 20));
1653
+ } catch (e) {
1631
1654
  try {
1632
- console.log("Front end mindline token silent acquisition failure, triggering redirect: " + t);
1633
- let n = a.getAllAccounts(), o = e.oid + "." + e.tid, d = null;
1655
+ console.log("Front end mindline token silent acquisition failure, triggering redirect: " + e);
1656
+ let n = a.getAllAccounts(), o = t.oid + "." + t.tid, d = null;
1634
1657
  for (let i = 0; i < n.length; i++)
1635
1658
  n[i].homeAccountId == o && (d = n[i]);
1636
1659
  a.acquireTokenRedirect({
@@ -1641,69 +1664,69 @@ async function $(a, e) {
1641
1664
  console.log("Front end mindline token redirect acquisition failure: " + n);
1642
1665
  }
1643
1666
  }
1644
- return r.append("Authorization", `Bearer ${e.mindlineAccessToken}`), r;
1667
+ return r.append("Authorization", `Bearer ${t.mindlineAccessToken}`), r;
1645
1668
  }
1646
1669
  async function S(a) {
1647
- let e = "";
1648
- if (a.status === 401 && (e = a.statusText, e != ""))
1649
- return e;
1670
+ let t = "";
1671
+ if (a.status === 401 && (t = a.statusText, t != ""))
1672
+ return t;
1650
1673
  let r = await a.json();
1651
1674
  if (r.error !== void 0)
1652
- e = `Error: ${r.error} Message: ${r.message}`;
1675
+ t = `Error: ${r.error} Message: ${r.message}`;
1653
1676
  else if (r.errors !== void 0)
1654
- e = Object.keys(r.errors).reduce(
1677
+ t = Object.keys(r.errors).reduce(
1655
1678
  (n, o) => n + o + ": " + r.errors[o] + " ",
1656
1679
  ""
1657
1680
  );
1658
1681
  else if (r.title !== void 0)
1659
- e = r.title;
1682
+ t = r.title;
1660
1683
  else
1661
1684
  debugger;
1662
- return e;
1685
+ return t;
1663
1686
  }
1664
- async function et(a, e, r, s) {
1665
- let t = new y();
1687
+ async function et(a, t, r, s) {
1688
+ let e = new m();
1666
1689
  if (r.oid == "" && r.mail == "" || s == "")
1667
- return t.result = !1, t.error = "adminDelete: invalid parameters", t.status = 500, t;
1690
+ return e.result = !1, e.error = "adminDelete: invalid parameters", e.status = 500, e;
1668
1691
  let n = null;
1669
1692
  n = new URL(T.adminEndpoint()), n.searchParams.append("workspaceId", s), n.searchParams.append("email", r.mail);
1670
- let d = { method: "DELETE", headers: await $(a, e) };
1693
+ let d = { method: "DELETE", headers: await A(a, t) };
1671
1694
  try {
1672
1695
  console.log("Attempting DELETE from /admin: " + n.href);
1673
1696
  let i = await fetch(n.href, d);
1674
- return i.status === 200 && i.statusText === "OK" ? (console.log(`Successful DELETE from /admin: ${n.href}`), t) : (t.error = await S(i), console.log(`Failed DELETE from /admin: ${n.href}`), console.log(t.error), t.status = 500, t.result = !1, t);
1697
+ return i.status === 200 && i.statusText === "OK" ? (console.log(`Successful DELETE from /admin: ${n.href}`), e) : (e.error = await S(i), console.log(`Failed DELETE from /admin: ${n.href}`), console.log(e.error), e.status = 500, e.result = !1, e);
1675
1698
  } catch (i) {
1676
- t.error = i.message, t.status = 500, t.result = !1, console.log(i.message);
1699
+ e.error = i.message, e.status = 500, e.result = !1, console.log(i.message);
1677
1700
  }
1678
- return t;
1701
+ return e;
1679
1702
  }
1680
- async function tt(a, e, r, s) {
1681
- let t = new y();
1703
+ async function tt(a, t, r, s) {
1704
+ let e = new m();
1682
1705
  if (r === "")
1683
- return t.result = !1, t.status = 500, t.error = "adminsGet: no workspace provided", t;
1706
+ return e.result = !1, e.status = 500, e.error = "adminsGet: no workspace provided", e;
1684
1707
  let n = T.adminsEndpoint(), o = new URL(n);
1685
1708
  o.searchParams.append("workspaceId", r);
1686
- let i = { method: "GET", headers: await $(a, e) };
1709
+ let i = { method: "GET", headers: await A(a, t) };
1687
1710
  try {
1688
1711
  if (s) debugger;
1689
1712
  console.log("Attempting GET from /admins: " + o.href);
1690
1713
  let c = await fetch(o.href, i);
1691
1714
  if (c.status === 200 && c.statusText === "OK") {
1692
1715
  let u = await c.json();
1693
- return u != null ? (t.array = u, console.log(`Successful GET from /admins: ${t.array.reduce((b, I) => b + I.email + " ", "")}`), t) : (t.error = "Failed GET from /admins: failed to JSON-parse response", console.log(t.error), t.status = 500, t.result = !1, t);
1716
+ return u != null ? (e.array = u, console.log(`Successful GET from /admins: ${e.array.reduce((b, I) => b + I.email + " ", "")}`), e) : (e.error = "Failed GET from /admins: failed to JSON-parse response", console.log(e.error), e.status = 500, e.result = !1, e);
1694
1717
  } else
1695
- return console.log(`Failed GET from /admins: ${o.href}`), t.error = await S(c), t.status = 500, t.result = !1, console.log(t.error), t;
1718
+ return console.log(`Failed GET from /admins: ${o.href}`), e.error = await S(c), e.status = 500, e.result = !1, console.log(e.error), e;
1696
1719
  } catch (c) {
1697
- t.error = c.message, t.status = 500, t.result = !1, console.log(c.message);
1720
+ e.error = c.message, e.status = 500, e.result = !1, console.log(c.message);
1698
1721
  }
1699
- return t;
1722
+ return e;
1700
1723
  }
1701
- async function st(a, e, r, s) {
1702
- let t = new y();
1724
+ async function st(a, t, r, s) {
1725
+ let e = new m();
1703
1726
  if (r.mail == "" || r.authority == "" || r.tid === "")
1704
- return t.result = !1, t.error = "adminPost: invalid argument", t.status = 500, t;
1727
+ return e.result = !1, e.error = "adminPost: invalid argument", e.status = 500, e;
1705
1728
  let n = T.adminEndpoint();
1706
- const o = await $(a, e);
1729
+ const o = await A(a, t);
1707
1730
  let d = `
1708
1731
  {"email": "${r.mail}",
1709
1732
  "tenantId": "${r.tid}",
@@ -1712,17 +1735,52 @@ async function st(a, e, r, s) {
1712
1735
  try {
1713
1736
  console.log("Attempting POST to /admin: " + n);
1714
1737
  let c = await fetch(n, i);
1715
- return c.status === 200 && c.statusText === "OK" ? (console.log(`Successful POST to /admin: ${d}`), t) : (t.error = await S(c), console.log(`Failed POST to /admin: ${d}`), console.log(t.error), t.status = 500, t.result = !1, t);
1738
+ return c.status === 200 && c.statusText === "OK" ? (console.log(`Successful POST to /admin: ${d}`), e) : (e.error = await S(c), console.log(`Failed POST to /admin: ${d}`), console.log(e.error), e.status = 500, e.result = !1, e);
1716
1739
  } catch (c) {
1717
- t.error = c.message, t.status = 500, t.result = !1, console.log(c.message);
1740
+ e.error = c.message, e.status = 500, e.result = !1, console.log(c.message);
1718
1741
  }
1719
- return t;
1742
+ return e;
1743
+ }
1744
+ async function rt(a, t, r, s) {
1745
+ a = a, t = t, s = s;
1746
+ let e = new m();
1747
+ if (r.id === "")
1748
+ return e.result = !1, e.error = "auditConfigPost: invalid config ID", e.status = 500, e;
1749
+ let n = T.auditConfigEndpoint();
1750
+ const o = await A(a, t);
1751
+ let d = `
1752
+ {
1753
+ "workspaceId": "${r.workspaceId}",
1754
+ "name": "${r.name}",
1755
+ "description": "${r.description}",
1756
+ "isEnabled": ${r.isEnabled},
1757
+ "email": "${r.email}",
1758
+ "tenantId": "${r.tenantId}"
1759
+ }`, i = { method: "POST", headers: o, body: d };
1760
+ try {
1761
+ if (s) debugger;
1762
+ console.log("Attempting POST to /audit-configuration: " + n);
1763
+ let c = await fetch(n, i);
1764
+ if (c.status === 200 && c.statusText === "OK") {
1765
+ let u = await c.json();
1766
+ return r.id = u, console.log(
1767
+ `Successful AuditConfigID: ${u} from POST to /audit-configuration: ${d}`
1768
+ ), e;
1769
+ } else
1770
+ return e.error = await S(c), console.log(`Failed POST to /audit-configuration: ${d}`), console.log(e.error), e.status = 500, e.result = !1, e;
1771
+ } catch (c) {
1772
+ return e.status = 500, e.result = !1, e.error = c.message, console.log(e.error), e;
1773
+ }
1774
+ return e;
1775
+ }
1776
+ async function nt(a, t, r) {
1777
+ return new m();
1720
1778
  }
1721
- async function rt(a, e, r) {
1722
- let s = new y();
1723
- if (e.mail == null || e.mail == "")
1779
+ async function at(a, t, r) {
1780
+ let s = new m();
1781
+ if (t.mail == null || t.mail == "")
1724
1782
  return s.result = !1, s.status = 500, s.error = "auditEventsGet: no user provided", s;
1725
- let t = T.auditEventsEndpoint(), n = new URL(t), d = { method: "GET", headers: await $(a, e) };
1783
+ let e = T.auditEventsEndpoint(), n = new URL(e), d = { method: "GET", headers: await A(a, t) };
1726
1784
  try {
1727
1785
  if (r) debugger;
1728
1786
  console.log("Attempting GET from /audit-events endpoint: " + n.href);
@@ -1742,14 +1800,14 @@ async function rt(a, e, r) {
1742
1800
  }
1743
1801
  return s;
1744
1802
  }
1745
- async function nt(a, e, r, s, t) {
1746
- let n = new y(), o = T.configConsentEndpoint(), d = new URL(o);
1803
+ async function ot(a, t, r, s, e) {
1804
+ let n = new m(), o = T.configConsentEndpoint(), d = new URL(o);
1747
1805
  d.searchParams.append("configurationId", r);
1748
- const i = await $(a, e);
1806
+ const i = await A(a, t);
1749
1807
  let c = `
1750
1808
  {
1751
1809
  "tenantId": "${s}",
1752
- "isReadPermissionConsented": ${t ? "true" : "false"}
1810
+ "isReadPermissionConsented": ${e ? "true" : "false"}
1753
1811
  }`, u = { method: "PUT", headers: i, body: c };
1754
1812
  try {
1755
1813
  console.log("Attempting PUT read consent to /configuration/consent: " + d.href);
@@ -1760,14 +1818,14 @@ async function nt(a, e, r, s, t) {
1760
1818
  }
1761
1819
  return n;
1762
1820
  }
1763
- async function at(a, e, r, s, t) {
1764
- let n = new y(), o = T.configConsentEndpoint(), d = new URL(o);
1821
+ async function it(a, t, r, s, e) {
1822
+ let n = new m(), o = T.configConsentEndpoint(), d = new URL(o);
1765
1823
  d.searchParams.append("configurationId", r);
1766
- const i = await $(a, e);
1824
+ const i = await A(a, t);
1767
1825
  let c = `
1768
1826
  {
1769
1827
  "tenantId": "${s}",
1770
- "isWritePermissionConsented": ${t ? "true" : "false"}
1828
+ "isWritePermissionConsented": ${e ? "true" : "false"}
1771
1829
  }`, u = { method: "PUT", headers: i, body: c };
1772
1830
  try {
1773
1831
  console.log("Attempting PUT read consent to /configuration/consent: " + d.href);
@@ -1778,13 +1836,13 @@ async function at(a, e, r, s, t) {
1778
1836
  }
1779
1837
  return n;
1780
1838
  }
1781
- async function ot(a, e, r, s, t) {
1782
- let n = new y();
1839
+ async function lt(a, t, r, s, e) {
1840
+ let n = new m();
1783
1841
  if (r.id === "" || s == "")
1784
1842
  return n.result = !1, n.error = "configPost: invalid config ID", n.status = 500, n;
1785
1843
  let o = null;
1786
1844
  o = new URL(T.configEndpoint()), o.searchParams.append("configurationId", r.id);
1787
- let i = { method: "DELETE", headers: await $(a, e) };
1845
+ let i = { method: "DELETE", headers: await A(a, t) };
1788
1846
  try {
1789
1847
  console.log("Attempting DELETE from /config: " + o.href);
1790
1848
  let c = await fetch(o.href, i);
@@ -1794,15 +1852,15 @@ async function ot(a, e, r, s, t) {
1794
1852
  }
1795
1853
  return n;
1796
1854
  }
1797
- async function it(a, e, r, s, t) {
1798
- let n = new y();
1855
+ async function ct(a, t, r, s, e) {
1856
+ let n = new m();
1799
1857
  if (r === "")
1800
1858
  return n.result = !1, n.error = "configPatch: invalid config ID", n.status = 500, n;
1801
1859
  let o = T.configEnabledEndpoint(), d = new URL(o);
1802
1860
  d.searchParams.append("configurationId", r), d.searchParams.append("isEnabled", s.toString());
1803
- let c = { method: "PATCH", headers: await $(a, e) };
1861
+ let c = { method: "PATCH", headers: await A(a, t) };
1804
1862
  try {
1805
- if (t) debugger;
1863
+ if (e) debugger;
1806
1864
  console.log("Attempting PATCH to /config: " + d.href);
1807
1865
  let u = await fetch(d.href, c);
1808
1866
  return u.status === 200 && u.statusText === "OK" ? (console.log(`Successful PATCH to ${d.href}: ${s.toString()}`), n) : (n.error = await S(u), console.log(`Failed PATCH to ${d.href}: ${s.toString()}`), console.log(n.error), n.status = 500, n.result = !1, n);
@@ -1811,12 +1869,12 @@ async function it(a, e, r, s, t) {
1811
1869
  }
1812
1870
  return n;
1813
1871
  }
1814
- async function lt(a, e, r, s, t) {
1815
- let n = new y();
1872
+ async function dt(a, t, r, s, e) {
1873
+ let n = new m();
1816
1874
  if (r.id === "")
1817
1875
  return n.result = !1, n.error = "configPost: invalid config ID", n.status = 500, n;
1818
1876
  let o = T.configEndpoint();
1819
- const d = await $(a, e);
1877
+ const d = await A(a, t);
1820
1878
  let i = `
1821
1879
  {
1822
1880
  "workspaceId": "${s}",
@@ -1837,7 +1895,7 @@ async function lt(a, e, r, s, t) {
1837
1895
  }), i += "]}";
1838
1896
  let c = { method: "POST", headers: d, body: i };
1839
1897
  try {
1840
- if (t) debugger;
1898
+ if (e) debugger;
1841
1899
  console.log("Attempting POST to /config: " + o);
1842
1900
  let u = await fetch(o, c);
1843
1901
  if (u.status === 200 && u.statusText === "OK") {
@@ -1851,13 +1909,13 @@ async function lt(a, e, r, s, t) {
1851
1909
  return n.status = 500, n.result = !1, n.error = u.message, console.log(n.error), n;
1852
1910
  }
1853
1911
  }
1854
- async function ct(a, e, r, s) {
1855
- let t = new y();
1912
+ async function ut(a, t, r, s) {
1913
+ let e = new m();
1856
1914
  if (r.id === "")
1857
- return t.result = !1, t.error = "configPost: invalid config ID", t.status = 500, t;
1915
+ return e.result = !1, e.error = "configPost: invalid config ID", e.status = 500, e;
1858
1916
  let n = T.configEndpoint(), o = new URL(n);
1859
1917
  o.searchParams.append("configurationId", r.id);
1860
- const d = await $(a, e);
1918
+ const d = await A(a, t);
1861
1919
  let i = `
1862
1920
  {
1863
1921
  "name": "${r.name}",
@@ -1881,66 +1939,66 @@ async function ct(a, e, r, s) {
1881
1939
  if (s) debugger;
1882
1940
  console.log("Attempting PUT to /config: " + o.href);
1883
1941
  let u = await fetch(o.href, c);
1884
- return u.status === 200 && u.statusText === "OK" ? (console.log(`Successful PUT to ${o.href}: ${i}`), t) : (t.error = await S(u), console.log(`Failed PUT to ${o.href}: ${i}`), console.log(t.error), t.status = 500, t.result = !1, t);
1942
+ return u.status === 200 && u.statusText === "OK" ? (console.log(`Successful PUT to ${o.href}: ${i}`), e) : (e.error = await S(u), console.log(`Failed PUT to ${o.href}: ${i}`), console.log(e.error), e.status = 500, e.result = !1, e);
1885
1943
  } catch (u) {
1886
- t.error = u.message, t.status = 500, t.result = !1, console.log(u.message);
1944
+ e.error = u.message, e.status = 500, e.result = !1, console.log(u.message);
1887
1945
  }
1888
- return t;
1946
+ return e;
1889
1947
  }
1890
- async function be(a, e, r, s) {
1891
- let t = new y();
1948
+ async function be(a, t, r, s) {
1949
+ let e = new m();
1892
1950
  if (r === "")
1893
- return t.result = !1, t.status = 500, t.error = "configsGet: no workspace provided", t;
1951
+ return e.result = !1, e.status = 500, e.error = "configsGet: no workspace provided", e;
1894
1952
  let n = T.configsEndpoint(), o = new URL(n);
1895
1953
  o.searchParams.append("workspaceId", r);
1896
- let i = { method: "GET", headers: await $(a, e) };
1954
+ let i = { method: "GET", headers: await A(a, t) };
1897
1955
  try {
1898
1956
  if (s) debugger;
1899
1957
  console.log("Attempting GET from /configurations: " + o.href);
1900
1958
  let c = await fetch(o.href, i);
1901
1959
  if (c.status === 200 && c.statusText === "OK") {
1902
1960
  let u = await c.json();
1903
- return u != null ? (t.array = u, console.log(`Successful GET from /configurations: ${t.array.reduce((b, I) => b + I.name + " ", "")}`), t) : (t.error = "Failed GET from /configurations: failed to JSON-parse response", console.log(t.error), t.status = 500, t.result = !1, t);
1961
+ return u != null ? (e.array = u, console.log(`Successful GET from /configurations: ${e.array.reduce((b, I) => b + I.name + " ", "")}`), e) : (e.error = "Failed GET from /configurations: failed to JSON-parse response", console.log(e.error), e.status = 500, e.result = !1, e);
1904
1962
  } else
1905
- return console.log(`Failed GET from /configurations: ${o.href}`), t.error = await S(c), t.status = 500, t.result = !1, console.log(t.error), t;
1963
+ return console.log(`Failed GET from /configurations: ${o.href}`), e.error = await S(c), e.status = 500, e.result = !1, console.log(e.error), e;
1906
1964
  } catch (c) {
1907
- t.error = c.message, t.status = 500, t.result = !1, console.log(c.message);
1965
+ e.error = c.message, e.status = 500, e.result = !1, console.log(c.message);
1908
1966
  }
1909
- return t;
1967
+ return e;
1910
1968
  }
1911
- async function dt(a, e, r) {
1912
- let s = new y();
1913
- if (e.companyName === "" || e.companyDomain === "")
1969
+ async function pt(a, t, r) {
1970
+ let s = new m();
1971
+ if (t.companyName === "" || t.companyDomain === "")
1914
1972
  return s.result = !1, s.error = "initPost: invalid company name or domain", s.status = 500, s;
1915
- let t = T.initEndpoint();
1916
- const n = await $(a, e);
1973
+ let e = T.initEndpoint();
1974
+ const n = await A(a, t);
1917
1975
  let o = `
1918
1976
  {
1919
1977
  "tenantCreateModel": {
1920
- "tenantId": "${e.tid}",
1921
- "name": "${e.companyName}",
1922
- "domain": "${e.companyDomain}",
1978
+ "tenantId": "${t.tid}",
1979
+ "name": "${t.companyName}",
1980
+ "domain": "${t.companyDomain}",
1923
1981
  "type": "aad",
1924
- "authority": "${e.authority}"
1982
+ "authority": "${t.authority}"
1925
1983
  }
1926
1984
  }`, d = { method: "POST", headers: n, body: o };
1927
1985
  try {
1928
1986
  if (r) debugger;
1929
- console.log("Attempting POST to /configuration/init: " + t);
1930
- let i = await fetch(t, d);
1987
+ console.log("Attempting POST to /configuration/init: " + e);
1988
+ let i = await fetch(e, d);
1931
1989
  return i.status === 200 && i.statusText === "OK" ? (console.log(`Successful POST to /configuration/init: ${o}`), s) : (s.error = await S(i), s.status = 500, s.result = !1, console.log(`Failed POST to /configuration/init: ${o}`), console.log(s.error), s);
1932
1990
  } catch (i) {
1933
1991
  s.error = i.message, console.log(s.error);
1934
1992
  }
1935
1993
  return s.status = 500, s.result = !1, s;
1936
1994
  }
1937
- async function ut(a, e, r, s, t) {
1938
- let n = new y();
1995
+ async function ft(a, t, r, s, e) {
1996
+ let n = new m();
1939
1997
  if (r.tid === "" || s === "")
1940
1998
  return n.result = !1, n.error = "tenantDelete: invalid tid, workspaceId", n.status = 500, n;
1941
1999
  let o = new URL(T.tenantEndpoint());
1942
2000
  o.searchParams.append("tenantId", r.tid), o.searchParams.append("workspaceId", s);
1943
- let i = { method: "DELETE", headers: await $(a, e) };
2001
+ let i = { method: "DELETE", headers: await A(a, t) };
1944
2002
  try {
1945
2003
  console.log("Attempting DELETE from /tenant: " + o.href);
1946
2004
  let c = await fetch(o.href, i);
@@ -1950,34 +2008,34 @@ async function ut(a, e, r, s, t) {
1950
2008
  }
1951
2009
  return n;
1952
2010
  }
1953
- async function pt(a, e, r, s) {
1954
- let t = new y();
2011
+ async function ht(a, t, r, s) {
2012
+ let e = new m();
1955
2013
  if (r === "")
1956
- return t.result = !1, t.status = 500, t.error = "tenantsGet: no workspace provided", t;
2014
+ return e.result = !1, e.status = 500, e.error = "tenantsGet: no workspace provided", e;
1957
2015
  let n = T.tenantsEndpoint(), o = new URL(n);
1958
2016
  o.searchParams.append("workspaceId", r);
1959
- let i = { method: "GET", headers: await $(a, e) };
2017
+ let i = { method: "GET", headers: await A(a, t) };
1960
2018
  try {
1961
2019
  if (s) debugger;
1962
2020
  console.log(`Attempting GET from /tenants: ${o.href}`);
1963
2021
  let c = await fetch(o.href, i);
1964
2022
  if (c.status === 200 && c.statusText === "OK") {
1965
2023
  let u = await c.json();
1966
- return u != null ? (t.array = u, console.log(`Successful GET from /tenants: ${t.array.reduce((b, I) => b + I.domain + " ", "")}`), t) : (t.error = "Failed GET from /tenants: failed to JSON-parse response", console.log(t.error), t.status = 500, t.result = !1, t);
2024
+ return u != null ? (e.array = u, console.log(`Successful GET from /tenants: ${e.array.reduce((b, I) => b + I.domain + " ", "")}`), e) : (e.error = "Failed GET from /tenants: failed to JSON-parse response", console.log(e.error), e.status = 500, e.result = !1, e);
1967
2025
  } else
1968
- return console.log(`Failed GET from /tenants: ${o.href}`), t.error = await S(c), t.status = 500, t.result = !1, console.log(t.error), t;
2026
+ return console.log(`Failed GET from /tenants: ${o.href}`), e.error = await S(c), e.status = 500, e.result = !1, console.log(e.error), e;
1969
2027
  } catch (c) {
1970
- t.error = c.message, t.status = 500, t.result = !1, console.log(c.message);
2028
+ e.error = c.message, e.status = 500, e.result = !1, console.log(c.message);
1971
2029
  }
1972
- return t;
2030
+ return e;
1973
2031
  }
1974
- async function ft(a, e, r, s) {
1975
- let t = new y();
2032
+ async function gt(a, t, r, s) {
2033
+ let e = new m();
1976
2034
  if (r.tid === "" || r.name === "" || r.domain === "")
1977
- return t.result = !1, t.error = "tenantPost: invalid tid, name, domain", t.status = 500, t;
2035
+ return e.result = !1, e.error = "tenantPost: invalid tid, name, domain", e.status = 500, e;
1978
2036
  let n = T.tenantEndpoint(), o = new URL(n);
1979
2037
  o.searchParams.append("workspaceId", s);
1980
- const d = await $(a, e);
2038
+ const d = await A(a, t);
1981
2039
  let i = `
1982
2040
  {"tenantId": "${r.tid}",
1983
2041
  "name": "${r.name}",
@@ -1988,33 +2046,33 @@ async function ft(a, e, r, s) {
1988
2046
  try {
1989
2047
  console.log(`Attempting POST to ${o.href}: ${i}`);
1990
2048
  let u = await fetch(o.href, c);
1991
- return u.status === 200 && u.statusText === "OK" ? (console.log(`Successful POST to ${o.href}: ${i}`), t) : (console.log(`Failed POST to ${o.href}: ${i}`), t.error = await S(u), console.log(t.error), t.status = 500, t.result = !1, t);
2049
+ return u.status === 200 && u.statusText === "OK" ? (console.log(`Successful POST to ${o.href}: ${i}`), e) : (console.log(`Failed POST to ${o.href}: ${i}`), e.error = await S(u), console.log(e.error), e.status = 500, e.result = !1, e);
1992
2050
  } catch (u) {
1993
- t.error = u.message, t.status = 500, t.result = !1, console.log(t.error);
2051
+ e.error = u.message, e.status = 500, e.result = !1, console.log(e.error);
1994
2052
  }
1995
- return t;
2053
+ return e;
1996
2054
  }
1997
- async function ht(a, e, r, s) {
1998
- let t = new y();
2055
+ async function mt(a, t, r, s) {
2056
+ let e = new m();
1999
2057
  if (r == "" || s == "")
2000
- return t.result = !1, t.error = "workspacePut: invalid workspace ID or name", t.status = 500, t;
2058
+ return e.result = !1, e.error = "workspacePut: invalid workspace ID or name", e.status = 500, e;
2001
2059
  let n = T.workspaceEndpoint(), o = new URL(n);
2002
2060
  o.searchParams.append("workspaceId", r), o.searchParams.append("workspaceName", s);
2003
- let i = { method: "PUT", headers: await $(a, e) };
2061
+ let i = { method: "PUT", headers: await A(a, t) };
2004
2062
  try {
2005
2063
  console.log("Attempting PUT to /workspace: " + o.href);
2006
2064
  let c = await fetch(o.href, i);
2007
- return c.status === 200 && c.statusText === "OK" ? (console.log(`Successful PUT to ${o.href}`), t) : (t.error = await S(c), console.log(`Failed PUT to ${o.href}`), console.log(t.error), t.status = 500, t.result = !1, t);
2065
+ return c.status === 200 && c.statusText === "OK" ? (console.log(`Successful PUT to ${o.href}`), e) : (e.error = await S(c), console.log(`Failed PUT to ${o.href}`), console.log(e.error), e.status = 500, e.result = !1, e);
2008
2066
  } catch (c) {
2009
- t.error = c.message, t.status = 500, t.result = !1, console.log(c.message);
2067
+ e.error = c.message, e.status = 500, e.result = !1, console.log(c.message);
2010
2068
  }
2011
- return t;
2069
+ return e;
2012
2070
  }
2013
- async function gt(a, e, r) {
2014
- let s = new y();
2015
- if (e.mail == null || e.mail == "")
2071
+ async function yt(a, t, r) {
2072
+ let s = new m();
2073
+ if (t.mail == null || t.mail == "")
2016
2074
  return s.result = !1, s.status = 500, s.error = "adminsGet: no workspace provided", s;
2017
- let t = T.workspacesEndpoint(), n = new URL(t), d = { method: "GET", headers: await $(a, e) };
2075
+ let e = T.workspacesEndpoint(), n = new URL(e), d = { method: "GET", headers: await A(a, t) };
2018
2076
  try {
2019
2077
  if (r) debugger;
2020
2078
  console.log("Attempting GET from /workspaces endpoint: " + n.href);
@@ -2029,104 +2087,109 @@ async function gt(a, e, r) {
2029
2087
  }
2030
2088
  return s;
2031
2089
  }
2032
- async function mt(a, e, r) {
2033
- let s = new y();
2034
- if (a == null || e == null)
2090
+ async function wt(a, t, r) {
2091
+ let s = new m();
2092
+ if (a == null || t == null)
2035
2093
  return s.result = !1, s.error = "readerPost: invalid parameters", s.status = 500, s;
2036
- let t = T.readerStartSyncEndpoint(), n = new URL(t);
2094
+ let e = T.readerStartSyncEndpoint(), n = new URL(e);
2037
2095
  n.searchParams.append("configurationId", r.id);
2038
- let d = { method: "POST", headers: await $(a, e) };
2096
+ let d = { method: "POST", headers: await A(a, t) };
2039
2097
  try {
2040
2098
  console.log("Attempting POST to /startSync: " + n.href);
2041
2099
  let i = await fetch(n.href, d);
2042
2100
  if (i.status === 200 && i.statusText === "OK") {
2043
- console.log(`Successful POST to /startSync: ${t}`);
2101
+ console.log(`Successful POST to /startSync: ${e}`);
2044
2102
  let c = await i.json();
2045
2103
  return c.PayloadStr != "" ? s.array = JSON.parse(c.PayloadStr) : (s.result = !1, s.error = "readerPost: blank payload returned, sync may be disabled on back end", s.status = 500), s;
2046
2104
  } else
2047
- return s.error = await S(i), console.log(`Failed POST to /startSync: ${t}`), console.log(s.error), s.status = 500, s.result = !1, s;
2105
+ return s.error = await S(i), console.log(`Failed POST to /startSync: ${e}`), console.log(s.error), s.status = 500, s.result = !1, s;
2048
2106
  } catch (i) {
2049
2107
  s.error = i.message, s.status = 500, s.result = !1, console.log(i.message);
2050
2108
  }
2051
2109
  return s;
2052
2110
  }
2053
2111
  export {
2054
- y as APIResult,
2055
- Dt as ActorArray,
2112
+ m as APIResult,
2113
+ Rt as ActorArray,
2056
2114
  ze as ActorNode,
2057
- kt as BatchArray,
2115
+ kt as AuditConfig,
2116
+ Pt as BatchArray,
2058
2117
  Y as Config,
2059
- bt as Group,
2060
- At as InitInfo,
2118
+ $t as Group,
2119
+ Dt as InitInfo,
2061
2120
  B as Milestone,
2062
2121
  Ue as MilestoneArray,
2063
2122
  we as ResourceArray,
2064
2123
  Le as ResourceNode,
2065
2124
  Q as Task,
2066
- $t as TaskArray,
2125
+ vt as TaskArray,
2067
2126
  L as Tenant,
2068
2127
  _e as TenantConfigInfo,
2069
2128
  Fe as TenantConfigType,
2070
2129
  me as TenantNode,
2071
- Ce as TenantPermissionType,
2072
- Ne as TenantType,
2130
+ Ne as TenantPermissionType,
2131
+ Ce as TenantType,
2073
2132
  X as User,
2074
- It as UserScope,
2133
+ At as UserScope,
2075
2134
  ee as Workspace,
2076
2135
  et as adminDelete,
2077
2136
  st as adminPost,
2078
2137
  tt as adminsGet,
2079
- rt as auditEventsGet,
2080
- Ot as auditEventsRetrieve,
2138
+ _t as auditConfigAdd,
2139
+ nt as auditConfigGet,
2140
+ rt as auditConfigPost,
2141
+ Bt as auditConfigRetrieve,
2142
+ at as auditEventsGet,
2143
+ Ut as auditEventsRetrieve,
2081
2144
  U as azureConfig,
2082
- Vt as canListRootAssignments,
2083
- _t as configConsentForRead,
2084
- Bt as configConsentForWrite,
2085
- nt as configConsentReadPut,
2086
- at as configConsentWritePut,
2087
- ot as configDelete,
2088
- Wt as configEdit,
2089
- Ft as configEnable,
2090
- it as configPatch,
2091
- lt as configPost,
2092
- ct as configPut,
2093
- Lt as configRemove,
2145
+ es as canListRootAssignments,
2146
+ Mt as configConsentForRead,
2147
+ jt as configConsentForWrite,
2148
+ ot as configConsentReadPut,
2149
+ it as configConsentWritePut,
2150
+ lt as configDelete,
2151
+ Lt as configEdit,
2152
+ zt as configEnable,
2153
+ ct as configPatch,
2154
+ dt as configPost,
2155
+ ut as configPut,
2156
+ qt as configRemove,
2094
2157
  be as configsGet,
2095
- Ut as configsRefresh,
2096
- Zt as elevateGlobalAdminToUserAccessAdmin,
2097
- Kt as getPowerBIAccessToken,
2158
+ Ht as configsRefresh,
2159
+ ts as elevateGlobalAdminToUserAccessAdmin,
2160
+ Yt as getPowerBIAccessToken,
2098
2161
  F as getSyncVersion,
2099
2162
  p as graphConfig,
2100
- vt as groupsGet,
2101
- St as helloNpm,
2102
- zt as initGet,
2103
- dt as initPost,
2163
+ Et as groupsGet,
2164
+ It as helloNpm,
2165
+ Jt as initGet,
2166
+ pt as initPost,
2104
2167
  T as mindlineConfig,
2105
2168
  je as oauth2PermissionGrantsGet,
2106
2169
  He as oauth2PermissionGrantsSet,
2107
2170
  S as processErrors,
2108
- mt as readerPost,
2109
- Rt as requestAdminConsent,
2171
+ wt as readerPost,
2172
+ Gt as requestAdminConsent,
2110
2173
  qe as servicePrincipalGet,
2111
- Pt as signIn,
2112
- Et as signInIncrementally,
2113
- Gt as signOut,
2114
- Tt as sum,
2115
- Mt as tenantAdd,
2116
- ut as tenantDelete,
2117
- ft as tenantPost,
2118
- xt as tenantRelationshipsGetByDomain,
2174
+ xt as signIn,
2175
+ Ct as signInIncrementally,
2176
+ Nt as signOut,
2177
+ bt as sum,
2178
+ Kt as tenantAdd,
2179
+ ft as tenantDelete,
2180
+ gt as tenantPost,
2181
+ Ot as tenantRelationshipsGetByDomain,
2119
2182
  Je as tenantRelationshipsGetById,
2120
- jt as tenantRemove,
2183
+ Vt as tenantRemove,
2121
2184
  Te as tenantUnauthenticatedLookup,
2122
- pt as tenantsGet,
2123
- Ht as userAdd,
2185
+ ht as tenantsGet,
2186
+ Zt as userAdd,
2124
2187
  Ke as userDelegatedScopesGet,
2125
- Nt as userDelegatedScopesRemove,
2126
- qt as userRemove,
2127
- Ct as usersGet,
2128
- Jt as workspaceEdit,
2129
- ht as workspacePut,
2130
- gt as workspacesGet
2188
+ Wt as userDelegatedScopesRemove,
2189
+ Qt as userRemove,
2190
+ Ft as usersGet,
2191
+ Xt as workspaceEdit,
2192
+ mt as workspacePut,
2193
+ yt as workspacesGet
2131
2194
  };
2132
2195
  //# sourceMappingURL=sync.es.js.map