@mindline/sync 1.0.108 → 1.0.109

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
1
  var Pe = Object.defineProperty;
2
- var Ie = (a) => {
3
- throw TypeError(a);
2
+ var Ie = (n) => {
3
+ throw TypeError(n);
4
4
  };
5
- var ve = (a, s, r) => s in a ? Pe(a, s, { enumerable: !0, configurable: !0, writable: !0, value: r }) : a[s] = r;
6
- var c = (a, s, r) => ve(a, typeof s != "symbol" ? s + "" : s, r), Re = (a, s, r) => s.has(a) || Ie("Cannot " + r);
7
- var J = (a, s, r) => s.has(a) ? Ie("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(a) : s.set(a, r);
8
- var O = (a, s, r) => (Re(a, s, "access private method"), r);
5
+ var ve = (n, s, r) => s in n ? Pe(n, s, { enumerable: !0, configurable: !0, writable: !0, value: r }) : n[s] = r;
6
+ var c = (n, s, r) => ve(n, typeof s != "symbol" ? s + "" : s, r), Re = (n, s, r) => s.has(n) || Ie("Cannot " + r);
7
+ var J = (n, s, r) => s.has(n) ? Ie("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(n) : s.set(n, r);
8
+ var N = (n, s, r) => (Re(n, s, "access private method"), r);
9
9
  import * as V from "@microsoft/signalr";
10
10
  import { deserializeArray as U } from "class-transformer";
11
11
  const Ge = [
@@ -140,14 +140,14 @@ const Ge = [
140
140
  resources: []
141
141
  }
142
142
  ], B = "workspaceIDs";
143
- function Gt(a, s) {
144
- return a + s;
143
+ function Gt(n, s) {
144
+ return n + s;
145
145
  }
146
146
  function xt() {
147
147
  return "hello NPM";
148
148
  }
149
149
  function _() {
150
- return "1.0.108";
150
+ return "1.0.109";
151
151
  }
152
152
  class m {
153
153
  constructor() {
@@ -283,7 +283,7 @@ class re {
283
283
  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;
284
284
  }
285
285
  }
286
- var Be = /* @__PURE__ */ ((a) => (a[a.invalid = 0] = "invalid", a[a.aad = 1] = "aad", a[a.ad = 2] = "ad", a[a.googleworkspace = 3] = "googleworkspace", a))(Be || {}), Ue = /* @__PURE__ */ ((a) => (a[a.read = 1] = "read", a[a.write = 2] = "write", a[a.notassigned = 3] = "notassigned", a))(Ue || {});
286
+ var Be = /* @__PURE__ */ ((n) => (n[n.invalid = 0] = "invalid", n[n.aad = 1] = "aad", n[n.ad = 2] = "ad", n[n.googleworkspace = 3] = "googleworkspace", n))(Be || {}), Ue = /* @__PURE__ */ ((n) => (n[n.read = 1] = "read", n[n.write = 2] = "write", n[n.notassigned = 3] = "notassigned", n))(Ue || {});
287
287
  class H {
288
288
  // are we validating by TID or by domain? "Domain" | "Tenant ID"
289
289
  constructor() {
@@ -301,8 +301,8 @@ class H {
301
301
  this.tid = "", this.name = "", this.domain = "", this.tenantType = "aad", this.authority = "", this.workspaceIDs = "", this.sel = !1, this.graphSP = "", this.lookupfield = "Domain";
302
302
  }
303
303
  }
304
- function _e(a, s) {
305
- switch (a) {
304
+ function _e(n, s) {
305
+ switch (n) {
306
306
  case p.authorityWW:
307
307
  return s === 1 ? "85d35da2-4118-4b03-aa05-605cedd7f2f8" : "63100afe-506e-4bb2-8ff7-d8d5ab373129";
308
308
  case p.authorityUS:
@@ -314,8 +314,8 @@ function _e(a, s) {
314
314
  return "";
315
315
  }
316
316
  }
317
- function F(a) {
318
- switch (a) {
317
+ function F(n) {
318
+ switch (n) {
319
319
  case p.authorityWW:
320
320
  return "https://graph.microsoft.com/";
321
321
  case p.authorityUS:
@@ -327,8 +327,8 @@ function F(a) {
327
327
  return "";
328
328
  }
329
329
  }
330
- function Le(a) {
331
- switch (a) {
330
+ function Le(n) {
331
+ switch (n) {
332
332
  case p.authorityWW:
333
333
  return "https://login.microsoftonline.com/";
334
334
  case p.authorityUS:
@@ -340,7 +340,7 @@ function Le(a) {
340
340
  return "";
341
341
  }
342
342
  }
343
- var ze = /* @__PURE__ */ ((a) => (a[a.source = 1] = "source", a[a.target = 2] = "target", a[a.sourcetarget = 3] = "sourcetarget", a))(ze || {});
343
+ var ze = /* @__PURE__ */ ((n) => (n[n.source = 1] = "source", n[n.target = 2] = "target", n[n.sourcetarget = 3] = "sourcetarget", n))(ze || {});
344
344
  class Me {
345
345
  constructor() {
346
346
  c(this, "tid");
@@ -358,7 +358,7 @@ class Me {
358
358
  this.tid = "", this.sourceGroupId = "", this.sourceGroupName = "", this.targetGroupId = "", this.targetGroupName = "", this.configurationTenantType = "source", this.deltaToken = "", this.usersWritten = 0, this.configId = "", this.batchId = "", this.isReadPermissionConsented = !1, this.isWritePermissionConsented = !1;
359
359
  }
360
360
  }
361
- class ne {
361
+ class ae {
362
362
  // selection state
363
363
  constructor() {
364
364
  c(this, "id");
@@ -387,7 +387,7 @@ class Nt {
387
387
  this.id = "", this.name = "", this.workspaceId = "", this.description = "", this.isEnabled = !1, this.isReadPermissionConsented = !1, this.email = "", this.tenantId = "", this.sel = !1;
388
388
  }
389
389
  }
390
- class ae {
390
+ class ne {
391
391
  // selection state
392
392
  constructor() {
393
393
  c(this, "id");
@@ -400,12 +400,12 @@ class ae {
400
400
  this.id = "", this.name = "", this.ownerid = "", this.associatedUsers = new Array(), this.associatedTenants = new Array(), this.associatedConfigs = new Array(), this.sel = !1;
401
401
  }
402
402
  }
403
- function N() {
404
- let a;
403
+ function G() {
404
+ let n;
405
405
  try {
406
- a = window.localStorage;
406
+ n = window.localStorage;
407
407
  const s = "__storage_test__";
408
- return a.setItem(s, s), a.removeItem(s), !0;
408
+ return n.setItem(s, s), n.removeItem(s), !0;
409
409
  } catch (s) {
410
410
  return s instanceof DOMException && // everything except Firefox
411
411
  (s.code === 22 || // Firefox
@@ -413,7 +413,7 @@ function N() {
413
413
  // everything except Firefox
414
414
  s.name === "QuotaExceededError" || // Firefox
415
415
  s.name === "NS_ERROR_DOM_QUOTA_REACHED") && // acknowledge QuotaExceededError only if there's something already stored
416
- a && a.length !== 0;
416
+ n && n.length !== 0;
417
417
  }
418
418
  }
419
419
  var Z, Ae;
@@ -433,7 +433,7 @@ class Wt {
433
433
  }
434
434
  // get initial data from localStorage or file
435
435
  init(s) {
436
- if (console.log(`Calling InitInfo::init(bClearLocalStorage: ${s ? "true" : "false"})`), N()) {
436
+ if (console.log(`Calling InitInfo::init(bClearLocalStorage: ${s ? "true" : "false"})`), G()) {
437
437
  let o = localStorage.getItem("InitInfo");
438
438
  if (o != null && typeof o == "string" && o !== "") {
439
439
  let i = JSON.parse(o);
@@ -441,15 +441,15 @@ class Wt {
441
441
  if (s)
442
442
  localStorage.removeItem("InitInfo");
443
443
  else {
444
- O(this, Z, Ae).call(this, i);
444
+ N(this, Z, Ae).call(this, i);
445
445
  return;
446
446
  }
447
447
  }
448
448
  }
449
449
  this.tab = 0, this.version = _(), this.configlevelconsent_configid = "", this.configlevelconsent_access = 3;
450
- var r = JSON.stringify(Ge), t = JSON.stringify(xe), e = JSON.stringify(Ce), n = JSON.stringify(Oe);
450
+ var r = JSON.stringify(Ge), t = JSON.stringify(xe), e = JSON.stringify(Ce), a = JSON.stringify(Oe);
451
451
  try {
452
- this.us = U(re, r), this.ts = U(H, t), this.cs = U(ne, e), this.ws = U(ae, n), this.tagWithWorkspaces();
452
+ this.us = U(re, r), this.ts = U(H, t), this.cs = U(ae, e), this.ws = U(ne, a), this.tagWithWorkspaces();
453
453
  } catch {
454
454
  debugger;
455
455
  }
@@ -494,10 +494,10 @@ Z = new WeakSet(), Ae = function(s) {
494
494
  let t = new H();
495
495
  return t.tid = r.tid, t.name = r.name, t.domain = r.domain, t.tenantType = r.tenantType, t.authority = r.authority, t.workspaceIDs = r.workspaceIDs, t.sel = r.sel, t.lookupfield = r.lookupfield, t;
496
496
  }), typeof s.cs > "u" ? this.cs = new Array() : this.cs = s.cs.map((r) => {
497
- let t = new ne();
497
+ let t = new ae();
498
498
  return t.id = r.id, t.workspaceId = r.workspaceId, t.name = r.name, t.description = r.description, t.tenants = r.tenants, t.isEnabled = r.isEnabled, t.workspaceIDs = r.workspaceIDs, t.sel = r.sel, t;
499
499
  }), typeof s.ws > "u" ? this.ws = new Array() : this.ws = s.ws.map((r) => {
500
- let t = new ae();
500
+ let t = new ne();
501
501
  return t.id = r.id, t.name = r.name, t.ownerid = r.ownerid, t.associatedUsers = r.associatedUsers, t.associatedTenants = r.associatedTenants, t.associatedConfigs = r.associatedConfigs, t.sel = r.sel, t;
502
502
  });
503
503
  };
@@ -554,42 +554,42 @@ const je = [
554
554
  ]
555
555
  }
556
556
  ];
557
- var G, oe, ie, le;
557
+ var x, oe, ie, le;
558
558
  class Ft {
559
559
  constructor(s) {
560
- J(this, G);
560
+ J(this, x);
561
561
  c(this, "tasks");
562
562
  this.tasks = [new se()], this.init(s);
563
563
  }
564
564
  // get initial data from localStorage or file
565
565
  init(s) {
566
- if (console.log(`Calling TaskArray::init(bClearLocalStorage: ${s ? "true" : "false"})`), this.tasks.length = 0, s && N() && localStorage.removeItem("Tasks"), N()) {
566
+ if (console.log(`Calling TaskArray::init(bClearLocalStorage: ${s ? "true" : "false"})`), this.tasks.length = 0, s && G() && localStorage.removeItem("Tasks"), G()) {
567
567
  let r = localStorage.getItem("Tasks");
568
568
  if (r != null && typeof r == "string" && r !== "") {
569
569
  let e = JSON.parse(r);
570
- if (this.tasks = O(this, G, ie).call(this, e.tasks), this.tasks.length !== 0) return;
570
+ if (this.tasks = N(this, x, ie).call(this, e.tasks), this.tasks.length !== 0) return;
571
571
  }
572
572
  }
573
- this.tasks = O(this, G, ie).call(this, je);
573
+ this.tasks = N(this, x, ie).call(this, je);
574
574
  }
575
575
  // set start time for a task
576
576
  setTaskStart(s, r) {
577
- let t = O(this, G, oe).call(this, s);
577
+ let t = N(this, x, oe).call(this, s);
578
578
  if (t != null && t != null)
579
- t.setStart(r), t.status = "in progress", O(this, G, le).call(this);
579
+ t.setStart(r), t.status = "in progress", N(this, x, le).call(this);
580
580
  else
581
581
  debugger;
582
582
  }
583
583
  // set end time for a task
584
584
  setTaskEnd(s, r, t) {
585
- let e = O(this, G, oe).call(this, s);
585
+ let e = N(this, x, oe).call(this, s);
586
586
  if (e != null && e != null)
587
- e.setEnd(r), e.status = t, O(this, G, le).call(this);
587
+ e.setEnd(r), e.status = t, N(this, x, le).call(this);
588
588
  else
589
589
  debugger;
590
590
  }
591
591
  }
592
- G = new WeakSet(), //
592
+ x = new WeakSet(), //
593
593
  // private
594
594
  //
595
595
  oe = function(s) {
@@ -604,13 +604,13 @@ oe = function(s) {
604
604
  return s.map((r) => {
605
605
  let t = new se();
606
606
  return t.id = r.id, t.task = r.task, t.setStart(new Date(r.start)), t.setEnd(new Date(r.end)), t.expected = r.expected, t.status = r.status, t.expanded = r.expanded, typeof r.subtasks < "u" && r.subtasks != null && (t.subtasks = r.subtasks.map((e) => {
607
- let n = new se();
608
- 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;
607
+ let a = new se();
608
+ return a.id = e.id, a.task = e.task, a.setStart(new Date(e.start)), a.setEnd(new Date(e.end)), a.expected = e.expected, a.status = e.status, a.expanded = e.expanded, a;
609
609
  })), t;
610
610
  });
611
611
  }, le = function() {
612
612
  let s = JSON.stringify(this);
613
- N() && localStorage.setItem("Tasks", s);
613
+ G() && localStorage.setItem("Tasks", s);
614
614
  };
615
615
  class se {
616
616
  constructor() {
@@ -673,7 +673,7 @@ class He {
673
673
  this.init(s);
674
674
  }
675
675
  init(s) {
676
- if (N()) {
676
+ if (G()) {
677
677
  let r = localStorage.getItem("syncmilestones");
678
678
  if (r != null && typeof r == "string" && r !== "") {
679
679
  let e = JSON.parse(r);
@@ -681,16 +681,16 @@ class He {
681
681
  if (s)
682
682
  localStorage.removeItem("syncmilestones");
683
683
  else {
684
- O(this, q, ce).call(this, e);
684
+ N(this, q, ce).call(this, e);
685
685
  return;
686
686
  }
687
687
  }
688
688
  }
689
- O(this, q, ce).call(this, Ne);
689
+ N(this, q, ce).call(this, Ne);
690
690
  }
691
691
  save() {
692
692
  let s = JSON.stringify(this.milestones);
693
- N() && localStorage.setItem("syncmilestones", s);
693
+ G() && localStorage.setItem("syncmilestones", s);
694
694
  }
695
695
  // milestone tracking during a sync
696
696
  start(s) {
@@ -700,8 +700,8 @@ class He {
700
700
  }
701
701
  let r = Number(this.milestones[0].Run), t = new M(r + 1);
702
702
  this.milestones.unshift(t), this.milestones = this.milestones.map((e) => {
703
- let n = new M(e.Run);
704
- 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;
703
+ let a = new M(e.Run);
704
+ return a.Start = e.Start, a.startDisplay = e.startDisplay, a.POST = e.POST, a.postDisplay = e.postDisplay, a.Read = e.Read, a.readDisplay = e.readDisplay, a.Write = e.Write, a.writeDisplay = e.writeDisplay, a.Duration = e.Duration, a.durationDisplay = e.durationDisplay, a;
705
705
  }), s(this.milestones), console.log(`Start milestone: ${this.milestones[0].Run}:${this.milestones[0].Start}`);
706
706
  }
707
707
  unstart(s) {
@@ -761,21 +761,24 @@ class Bt {
761
761
  c(this, "pb_total");
762
762
  c(this, "pb_timer");
763
763
  c(this, "milestoneArray");
764
- this.tenantNodes = new Array(), this.init(s, r, t), 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 He(!1);
764
+ this.tenantNodes = new Array(), this.init(s, r, t), this.pb_startTS = 0, this.pb_progress = 0, this.pb_increment = 0.25, this.pb_timer = null, this.pb_idle = 0, this.pb_idleMax = 0, this.pb_total = 0, this.milestoneArray = new He(!1);
765
+ }
766
+ clearStoredBatchIds() {
767
+ G() && localStorage.setItem("BatchIdArray", "[]");
765
768
  }
766
769
  // populate tenantNodes based on config tenants
767
770
  init(s, r, t) {
768
771
  console.log(
769
772
  `Calling BatchArray::init(config: "${s ? s.name : "null"}", bClearLocalStorage: ${t ? "true" : "false"})`
770
- ), t && N() && (localStorage.removeItem(s.name), this.milestoneArray.init(t)), s != null && s.tenants != null && r != null && (this.tenantNodes.length = 0, s.tenants.map((e) => {
773
+ ), t && G() && (localStorage.removeItem(s.name), this.milestoneArray.init(t)), s != null && s.tenants != null && r != null && (this.tenantNodes.length = 0, s.tenants.map((e) => {
771
774
  if (e.configurationTenantType === "source" || e.configurationTenantType === "sourcetarget") {
772
- let n = r.ts.find(
775
+ let a = r.ts.find(
773
776
  (o) => o.tid === e.tid
774
777
  );
775
- if (n != null) {
778
+ if (a != null) {
776
779
  let o = new $e(
777
780
  e.tid,
778
- n.name,
781
+ a.name,
779
782
  e.batchId
780
783
  );
781
784
  this.tenantNodes.push(o);
@@ -788,16 +791,16 @@ class Bt {
788
791
  }
789
792
  }
790
793
  }), this.tenantNodes.map((e) => {
791
- s.tenants.map((n) => {
792
- if ((n.configurationTenantType === "target" || n.configurationTenantType === "sourcetarget") && n.tid !== e.tid) {
794
+ s.tenants.map((a) => {
795
+ if ((a.configurationTenantType === "target" || a.configurationTenantType === "sourcetarget") && a.tid !== e.tid) {
793
796
  let o = r.ts.find(
794
- (d) => d.tid === n.tid
797
+ (d) => d.tid === a.tid
795
798
  );
796
799
  if (o != null) {
797
800
  let d = new $e(
798
- n.tid,
801
+ a.tid,
799
802
  o.name,
800
- n.batchId
803
+ a.batchId
801
804
  );
802
805
  e.targets.push(d), e.expanded = !0;
803
806
  } else {
@@ -813,15 +816,15 @@ class Bt {
813
816
  }
814
817
  initializeProgressBar(s, r, t, e) {
815
818
  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(() => {
816
- console.log("this.tenantNodes", this.tenantNodes), this.tenantNodes.map((o) => o.targets.map((d) => d.status === "complete" || o.nothingtosync).reduce((d, i) => d && i)).reduce((o, d) => o && d) ? (clearInterval(this.pb_timer), this.pb_timer = null, this.pb_progress = 100, s(this.pb_progress), t(`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), t(`${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), s(this.pb_progress)));
819
+ console.log("this.tenantNodes", this.tenantNodes), this.tenantNodes.map((o) => o.targets.map((d) => d.status === "complete" || o.nothingtosync).reduce((d, i) => d && i)).reduce((o, d) => o && d) ? (clearInterval(this.pb_timer), this.pb_timer = null, this.pb_progress = 100, s(this.pb_progress), t(`Complete. [max idle: ${this.pb_idleMax}]`), this.clearStoredBatchIds()) : (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), t(`${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), s(this.pb_progress)));
817
820
  }, 1e3), this.milestoneArray.start(e);
818
821
  }
819
822
  uninitializeProgressBar(s, r, t, e) {
820
823
  this.pb_startTS = 0, this.pb_progress = 0, s(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, t(`No updates seen for ${this.pb_idle} seconds. [max idle: ${this.pb_idleMax}]`), this.milestoneArray.unstart(e);
821
824
  }
822
- initializeSignalR(s, r, t, e, n, o, d, i, l, u, f, I, D, R) {
825
+ initializeSignalR(s, r, t, e, a, o, d, i, l, u, f, I, D, R) {
823
826
  this.milestoneArray.post(f), I("started sync, waiting for updates..."), this.init(s, r, !1);
824
- let W = (x) => (E) => {
827
+ let W = (C) => (E) => {
825
828
  console.log(E);
826
829
  let A = JSON.parse(E);
827
830
  this.pb_idle = 0;
@@ -838,12 +841,12 @@ class Bt {
838
841
  return;
839
842
  }
840
843
  h.batchId = $.BatchId;
841
- let ue = A.Stats, v = Object.keys(ue), C = Object.values(ue), X = !1, fe = !1;
844
+ let ue = A.Stats, v = Object.keys(ue), O = Object.values(ue), X = !1, fe = !1;
842
845
  for (let g = 0; g < v.length; g++) {
843
846
  let P = v[g].endsWith("TotalCount"), L = v[g].endsWith("CurrentCount"), z = v[g].endsWith("ExtCount"), K = v[g].endsWith("DeferredCount"), ee = v[g].endsWith("RescheduledCount");
844
- if (z && (h.excluded = Math.max(Number(C[g]), h.excluded), h.targets.map((T) => {
847
+ if (z && (h.excluded = Math.max(Number(O[g]), h.excluded), h.targets.map((T) => {
845
848
  T.excluded = h.excluded, T.update(T.total, T.read, T.excluded, T.written, T.deferred);
846
- })), P && (X = Number(C[g]) == 0, h.total = Math.max(Number(C[g]), h.total), h.targets.map((T) => {
849
+ })), P && (X = Number(O[g]) == 0, h.total = Math.max(Number(O[g]), h.total), h.targets.map((T) => {
847
850
  T.total = h.total, T.update(T.total, T.read, T.excluded, T.written, T.deferred);
848
851
  })), v[g].startsWith("Reader")) {
849
852
  let T = /Reader\/TID:(.+)\/TotalCount/;
@@ -852,7 +855,7 @@ class Bt {
852
855
  debugger;
853
856
  return;
854
857
  }
855
- P ? (X = Number(C[g]) == 0, h.total = Math.max(Number(C[g]), h.total), console.log(`----- ${h.name} TID: ${h.tid} batchId: ${h.batchId}`), console.log(`----- ${h.name} Total To Read: ${h.total}`)) : (fe = Number(C[g]) == 0, L ? (h.read = Math.max(Number(C[g]), h.read), console.log(`----- ${h.name} Currently Read: ${h.read}`)) : K && (h.deferred = Math.max(Number(C[g]), h.deferred), console.log(`----- ${h.name} Deferred: ${h.deferred}`)));
858
+ P ? (X = Number(O[g]) == 0, h.total = Math.max(Number(O[g]), h.total), console.log(`----- ${h.name} TID: ${h.tid} batchId: ${h.batchId}`), console.log(`----- ${h.name} Total To Read: ${h.total}`)) : (fe = Number(O[g]) == 0, L ? (h.read = Math.max(Number(O[g]), h.read), console.log(`----- ${h.name} Currently Read: ${h.read}`)) : K && (h.deferred = Math.max(Number(O[g]), h.deferred), console.log(`----- ${h.name} Deferred: ${h.deferred}`)));
856
859
  }
857
860
  if (h.nothingtosync = X && fe, v[g].startsWith("Writer")) {
858
861
  let T = /Reader\/TID:(.+)\/TotalCount/;
@@ -872,9 +875,9 @@ class Bt {
872
875
  if (S.total = Math.max(Number(h.total), S.total), S.total = Math.max(Number(h.total), S.total), S.batchId = $.BatchId, P)
873
876
  S.total = Math.max(Number(P), S.total), console.log(`----- ${S.name} TID: ${S.tid} batchId: ${S.batchId}`), console.log(`----- ${S.name} Total To Write: ${S.total}`);
874
877
  else if (L)
875
- S.written = Math.max(Number(C[g]), S.written), console.log(`----- ${S.name} Total Written: ${S.written}`);
878
+ S.written = Math.max(Number(O[g]), S.written), console.log(`----- ${S.name} Total Written: ${S.written}`);
876
879
  else if (K || ee)
877
- S.deferred = Math.max(Number(C[g]), S.deferred), console.log(`----- ${S.name} Total Deferred: ${S.deferred}`);
880
+ S.deferred = Math.max(Number(O[g]), S.deferred), console.log(`----- ${S.name} Total Deferred: ${S.deferred}`);
878
881
  else {
879
882
  console.log("unknown writer type");
880
883
  debugger;
@@ -889,23 +892,23 @@ class Bt {
889
892
  g.targets.map((P) => {
890
893
  he && (he = P.status == "complete" || P.status == "failed"), ge || (ge = P.total > 0 || P.status != "not started"), Te += Math.max(P.total, g.total), Se += P.written, be += P.excluded;
891
894
  }), me && (me = g.nothingtosync), pe && (pe = g.status == "complete" || g.status == "failed"), Y += g.total, ye += g.read, we += g.excluded;
892
- }), n(Y), d(ye), o(we), i(Math.max(Te, Y)), u(Se), l(be), me)
893
- this.milestoneArray.write(f), x.stop(), I("nothing to sync"), console.log('Setting config sync result: "nothing to sync"');
895
+ }), a(Y), d(ye), o(we), i(Math.max(Te, Y)), u(Se), l(be), me)
896
+ this.milestoneArray.write(f), C.stop(), I("nothing to sync"), this.clearStoredBatchIds(), console.log('Setting config sync result: "nothing to sync"');
894
897
  else {
895
898
  if (pe) {
896
899
  this.milestoneArray.read(f), I("reading complete"), console.log('Setting config sync result: "reading complete"'), e(s.workspaceId);
897
900
  let z = (Date.now() - this.pb_startTS) / 1e3 / 8.5;
898
901
  this.pb_increment = z, console.log(`Setting increment: ${this.pb_increment}% per second`);
899
902
  }
900
- he ? (this.milestoneArray.write(f), x.stop(), I("sync complete"), console.log('Setting config sync result: "complete"')) : ge ? (I("writing in progress"), console.log('Setting config sync result: "writing in progress"')) : this.milestoneArray.milestones[0].Read == null && (I("reading in progress"), console.log('Setting config sync result: "reading in progress"'));
903
+ he ? (this.milestoneArray.write(f), C.stop(), I("sync complete"), this.clearStoredBatchIds(), console.log('Setting config sync result: "complete"')) : ge ? (I("writing in progress"), console.log('Setting config sync result: "writing in progress"')) : this.milestoneArray.milestones[0].Read == null && (I("reading in progress"), console.log('Setting config sync result: "reading in progress"'));
901
904
  }
902
905
  };
903
- t.map((x) => {
906
+ t.map((C) => {
904
907
  const E = w.signalREndpoint();
905
908
  let A = new URL(E);
906
- A.searchParams.append("statsId", x.BatchId), console.log(`Creating SignalR Hub for TID: ${x.SourceId} ${A.href}`);
909
+ A.searchParams.append("statsId", C.BatchId), console.log(`Creating SignalR Hub for TID: ${C.SourceId} ${A.href}`);
907
910
  const $ = new V.HubConnectionBuilder().withUrl(A.href).withAutomaticReconnect().configureLogging(V.LogLevel.Information).build();
908
- R && JSON.parse(R).TargetID === x.BatchId && W($)(R), $.on("newMessage", W($)), $.onreconnecting((h) => {
911
+ R && JSON.parse(R).TargetID === C.BatchId && W($)(R), $.on("newMessage", W($)), $.onreconnecting((h) => {
909
912
  console.assert($.state === V.HubConnectionState.Reconnecting), console.log(`Connection lost due to error "${h}". Reconnecting.`);
910
913
  }), $.onreconnected((h) => {
911
914
  console.assert($.state === V.HubConnectionState.Connected), console.log(`Connection reestablished. Connected with connectionId "${h}".`);
@@ -940,8 +943,8 @@ class $e {
940
943
  c(this, "targets");
941
944
  this.expanded = !1, this.name = r, this.tid = s, this.batchId = t, this.nothingtosync = !1, this.targets = new Array(), this.update(0, 0, 0, 0, 0);
942
945
  }
943
- update(s, r, t, e, n) {
944
- this.total = s, this.read = r, this.excluded = t, this.written = e, this.deferred = n, this.read === 0 && this.written === 0 && (this.status = "not started"), this.read > 0 ? this.read + this.excluded < this.total ? this.status = "in progress" : this.read + this.excluded === this.total && (this.status = "complete") : this.written > 0 && (this.written + this.deferred + this.excluded < this.total ? this.status = "in progress" : this.written + this.deferred + this.excluded === this.total ? this.status = "complete" : this.written + this.deferred + this.excluded >= this.total && (this.status = "failed"));
946
+ update(s, r, t, e, a) {
947
+ this.total = s, this.read = r, this.excluded = t, this.written = e, this.deferred = a, this.read === 0 && this.written === 0 && (this.status = "not started"), this.read > 0 ? this.read + this.excluded < this.total ? this.status = "in progress" : this.read + this.excluded === this.total && (this.status = "complete") : this.written > 0 && (this.written + this.deferred + this.excluded < this.total ? this.status = "in progress" : this.written + this.deferred + this.excluded === this.total ? this.status = "complete" : this.written + this.deferred + this.excluded >= this.total && (this.status = "failed"));
945
948
  }
946
949
  }
947
950
  class ke {
@@ -951,14 +954,14 @@ class ke {
951
954
  }
952
955
  // get resource data from localStorage or file
953
956
  init(s) {
954
- if (console.log(`Calling ResourceArray::init(bClearLocalStorage: ${s ? "true" : "false"})`), N()) {
957
+ if (console.log(`Calling ResourceArray::init(bClearLocalStorage: ${s ? "true" : "false"})`), G()) {
955
958
  let t = localStorage.getItem("ResourceArray");
956
959
  if (t != null && typeof t == "string" && t !== "")
957
960
  if (s)
958
961
  localStorage.removeItem("ResourceArray");
959
962
  else {
960
- let n = JSON.parse(t);
961
- this.resourceNodes = n.resourceNodes;
963
+ let a = JSON.parse(t);
964
+ this.resourceNodes = a.resourceNodes;
962
965
  return;
963
966
  }
964
967
  }
@@ -972,11 +975,11 @@ class ke {
972
975
  // read
973
976
  async read(s, r) {
974
977
  let t = new ke(!1, !1);
975
- return t.resourceNodes = await nt(s, r), t;
978
+ return t.resourceNodes = await at(s, r), t;
976
979
  }
977
980
  // save resource data to localstorage
978
981
  save() {
979
- if (N()) {
982
+ if (G()) {
980
983
  let s = JSON.stringify(this);
981
984
  localStorage.setItem("ResourceArray", s);
982
985
  }
@@ -999,14 +1002,14 @@ class Ut {
999
1002
  }
1000
1003
  // get initial data from localStorage or file
1001
1004
  init(s) {
1002
- if (console.log(`Calling ResourceArray::init(bClearLocalStorage: ${s ? "true" : "false"})`), N()) {
1005
+ if (console.log(`Calling ResourceArray::init(bClearLocalStorage: ${s ? "true" : "false"})`), G()) {
1003
1006
  let t = localStorage.getItem("RBACActors");
1004
1007
  if (t != null && typeof t == "string" && t !== "")
1005
1008
  if (s)
1006
1009
  localStorage.removeItem("RBACActors");
1007
1010
  else {
1008
- let n = JSON.parse(t);
1009
- this.actorNodes = n.actorNodes;
1011
+ let a = JSON.parse(t);
1012
+ this.actorNodes = a.actorNodes;
1010
1013
  return;
1011
1014
  }
1012
1015
  }
@@ -1019,7 +1022,7 @@ class Ut {
1019
1022
  }
1020
1023
  }
1021
1024
  class Ke {
1022
- constructor(s, r, t, e, n, o) {
1025
+ constructor(s, r, t, e, a, o) {
1023
1026
  c(this, "type");
1024
1027
  c(this, "actor");
1025
1028
  c(this, "resource");
@@ -1027,19 +1030,19 @@ class Ke {
1027
1030
  c(this, "updatedby");
1028
1031
  c(this, "updatedon");
1029
1032
  c(this, "actors");
1030
- this.type = s, this.actor = r, this.resource = t, this.role = e, this.updatedby = n, this.updatedon = o, this.actors = new Array();
1033
+ this.type = s, this.actor = r, this.resource = t, this.role = e, this.updatedby = a, this.updatedon = o, this.actors = new Array();
1031
1034
  }
1032
1035
  }
1033
- function Je(a) {
1036
+ function Je(n) {
1034
1037
  return "Group.Read.All User.Read.All openid profile offline_access User.Read Contacts.Read CrossTenantInformation.ReadBasic.All";
1035
1038
  }
1036
- async function Q(a, s) {
1039
+ async function Q(n, s) {
1037
1040
  const r = new Headers();
1038
1041
  r.append("Content-Type", "application/json"), r.append("accept", "*/*");
1039
1042
  const t = Je();
1040
1043
  if (s.graphAccessToken == null || s.graphAccessToken === "")
1041
1044
  try {
1042
- let e = await a.acquireTokenByCode({
1045
+ let e = await n.acquireTokenByCode({
1043
1046
  code: s.spacode
1044
1047
  });
1045
1048
  s.graphAccessToken = e.accessToken, console.log("Front end token acquired by code: " + s.graphAccessToken.slice(0, 20));
@@ -1048,10 +1051,10 @@ async function Q(a, s) {
1048
1051
  }
1049
1052
  else
1050
1053
  try {
1051
- let e = a.getAllAccounts(), n = s.oid + "." + s.tid, o = null;
1054
+ let e = n.getAllAccounts(), a = s.oid + "." + s.tid, o = null;
1052
1055
  for (let i = 0; i < e.length; i++)
1053
- e[i].homeAccountId == n && (o = e[i]);
1054
- let d = await a.acquireTokenSilent({
1056
+ e[i].homeAccountId == a && (o = e[i]);
1057
+ let d = await n.acquireTokenSilent({
1055
1058
  scopes: [t],
1056
1059
  account: o
1057
1060
  });
@@ -1059,37 +1062,37 @@ async function Q(a, s) {
1059
1062
  } catch (e) {
1060
1063
  try {
1061
1064
  console.log("Front end graph token silent acquisition failure: " + e);
1062
- let n = a.getAllAccounts(), o = s.oid + "." + s.tid, d = null;
1063
- for (let i = 0; i < n.length; i++)
1064
- n[i].homeAccountId == o && (d = n[i]);
1065
- a.acquireTokenRedirect({
1065
+ let a = n.getAllAccounts(), o = s.oid + "." + s.tid, d = null;
1066
+ for (let i = 0; i < a.length; i++)
1067
+ a[i].homeAccountId == o && (d = a[i]);
1068
+ n.acquireTokenRedirect({
1066
1069
  scopes: [t],
1067
1070
  account: d
1068
1071
  });
1069
- } catch (n) {
1070
- console.log("Front end graph token redirect acquisition failure: " + n);
1072
+ } catch (a) {
1073
+ console.log("Front end graph token redirect acquisition failure: " + a);
1071
1074
  }
1072
1075
  }
1073
1076
  return r.append("Authorization", `Bearer ${s.graphAccessToken}`), r;
1074
1077
  }
1075
- async function _t(a, s, r) {
1078
+ async function _t(n, s, r) {
1076
1079
  if (s == null || s.spacode == "")
1077
1080
  return { groups: [], error: "500: invalid user passed to groupsGet" };
1078
- let e = { method: "GET", headers: await Q(a, s) };
1081
+ let e = { method: "GET", headers: await Q(n, s) };
1079
1082
  try {
1080
- let n = F(s.authority) + p.graphGroupsPredicate;
1081
- n += `/?$filter=startsWith(displayName, '${r}')`;
1082
- let d = await (await fetch(n, e)).json();
1083
+ let a = F(s.authority) + p.graphGroupsPredicate;
1084
+ a += `/?$filter=startsWith(displayName, '${r}')`;
1085
+ let d = await (await fetch(a, e)).json();
1083
1086
  return typeof d.error < "u" ? { groups: [], error: `${d.error.code}: ${d.error.message}` } : { groups: d.value, error: "" };
1084
- } catch (n) {
1085
- return console.log(n), { groups: [], error: `Exception: ${n}` };
1087
+ } catch (a) {
1088
+ return console.log(a), { groups: [], error: `Exception: ${a}` };
1086
1089
  }
1087
1090
  }
1088
- async function Ve(a, s, r, t) {
1091
+ async function Ve(n, s, r, t) {
1089
1092
  try {
1090
- let e = F(s.authority) + p.graphOauth2PermissionGrantsPredicate, n = new URL(e);
1091
- n.searchParams.append("$filter", `resourceId eq '${r}' and consentType eq 'Principal' and principalId eq '${t}'`);
1092
- let d = await (await fetch(n.href, a)).json();
1093
+ let e = F(s.authority) + p.graphOauth2PermissionGrantsPredicate, a = new URL(e);
1094
+ a.searchParams.append("$filter", `resourceId eq '${r}' and consentType eq 'Principal' and principalId eq '${t}'`);
1095
+ let d = await (await fetch(a.href, n)).json();
1093
1096
  if (typeof d.error < "u")
1094
1097
  return { grants: null, id: null, error: `${d.error.code}: ${d.error.message}` };
1095
1098
  if (d.value.length != 1) {
@@ -1101,13 +1104,13 @@ async function Ve(a, s, r, t) {
1101
1104
  return console.log(e), { grants: null, id: null, error: `Exception: ${e}` };
1102
1105
  }
1103
1106
  }
1104
- async function Ze(a, s, r, t) {
1107
+ async function Ze(n, s, r, t) {
1105
1108
  if (s == null || s.spacode == "")
1106
1109
  return !1;
1107
1110
  try {
1108
1111
  let e = F(s.authority);
1109
1112
  e += p.graphOauth2PermissionGrantsPredicate + `/${r}`;
1110
- let n = `{ "scope": "${t}" }`, d = { method: "PATCH", headers: await Q(a, s), body: n }, i = await fetch(e, d), l = await i.json();
1113
+ let a = `{ "scope": "${t}" }`, d = { method: "PATCH", headers: await Q(n, s), body: a }, i = await fetch(e, d), l = await i.json();
1111
1114
  if (i.status == 204 && i.statusText == "No Content")
1112
1115
  return !0;
1113
1116
  debugger;
@@ -1117,36 +1120,36 @@ async function Ze(a, s, r, t) {
1117
1120
  return console.log(e), !1;
1118
1121
  }
1119
1122
  }
1120
- function Lt(a, s) {
1121
- let r = Le(a.authority);
1122
- r += a.tid, r += "/adminconsent";
1123
- let t = new URL(r), e = _e(a.authority, s);
1124
- t.searchParams.append("client_id", e), t.searchParams.append("redirect_uri", window.location.origin), t.searchParams.append("domain_hint", a.companyDomain), t.searchParams.append("login_hint", a.mail), window.location.assign(t.href);
1123
+ function Lt(n, s) {
1124
+ let r = Le(n.authority);
1125
+ r += n.tid, r += "/adminconsent";
1126
+ let t = new URL(r), e = _e(n.authority, s);
1127
+ t.searchParams.append("client_id", e), t.searchParams.append("redirect_uri", window.location.origin), t.searchParams.append("domain_hint", n.companyDomain), t.searchParams.append("login_hint", n.mail), window.location.assign(t.href);
1125
1128
  }
1126
- async function Qe(a, s, r) {
1129
+ async function Qe(n, s, r) {
1127
1130
  try {
1128
1131
  let t = F(s.authority);
1129
1132
  t += p.graphServicePrincipalsPredicate, t += `(appId='${r}')`;
1130
1133
  let e = new URL(t);
1131
1134
  e.searchParams.append("$select", "id,appId,displayName");
1132
- let o = await (await fetch(e.href, a)).json();
1135
+ let o = await (await fetch(e.href, n)).json();
1133
1136
  return typeof o.error < "u" ? { spid: "", error: `${o.error.code}: ${o.error.message}` } : { spid: o.id, error: "" };
1134
1137
  } catch (t) {
1135
1138
  return console.log(t), { spid: "", error: `Exception: ${t}` };
1136
1139
  }
1137
1140
  }
1138
- async function zt(a, s) {
1139
- if (a.authority == "") {
1141
+ async function zt(n, s) {
1142
+ if (n.authority == "") {
1140
1143
  let e = new H();
1141
- if (e.domain = a.tid, await Ee(e, !1))
1142
- a.authority = e.authority;
1144
+ if (e.domain = n.tid, await Ee(e, !1))
1145
+ n.authority = e.authority;
1143
1146
  else {
1144
1147
  debugger;
1145
1148
  return !1;
1146
1149
  }
1147
1150
  }
1148
1151
  let r = window.location.href;
1149
- switch (a.authority) {
1152
+ switch (n.authority) {
1150
1153
  case p.authorityWW:
1151
1154
  r += "MicrosoftIdentity/Account/SignIn";
1152
1155
  break;
@@ -1160,20 +1163,20 @@ async function zt(a, s) {
1160
1163
  return !1;
1161
1164
  }
1162
1165
  let t = new URL(r);
1163
- if (t.searchParams.append("redirectUri", window.location.origin), a.oid !== "1") {
1164
- t.searchParams.append("loginHint", a.mail);
1165
- const e = /@([a-zA-Z0-9.-]+\.[a-zA-Z]{2,})$/, n = a.mail.match(e);
1166
- let o = n ? n[1] : "organizations";
1166
+ if (t.searchParams.append("redirectUri", window.location.origin), n.oid !== "1") {
1167
+ t.searchParams.append("loginHint", n.mail);
1168
+ const e = /@([a-zA-Z0-9.-]+\.[a-zA-Z]{2,})$/, a = n.mail.match(e);
1169
+ let o = a ? a[1] : "organizations";
1167
1170
  t.searchParams.append("domainHint", o);
1168
1171
  } else
1169
1172
  t.searchParams.append("domainHint", "organizations");
1170
1173
  return s.setTaskStart("initialization", /* @__PURE__ */ new Date()), s.setTaskStart("authenticate user", /* @__PURE__ */ new Date()), window.location.assign(t.href), !0;
1171
1174
  }
1172
- function Mt(a, s) {
1175
+ function Mt(n, s) {
1173
1176
  debugger;
1174
- if (a.oid == "1") return;
1177
+ if (n.oid == "1") return;
1175
1178
  let r = window.location.href;
1176
- switch (a.authority) {
1179
+ switch (n.authority) {
1177
1180
  case p.authorityWW:
1178
1181
  r += "MicrosoftIdentity/Account/Challenge";
1179
1182
  break;
@@ -1187,49 +1190,49 @@ function Mt(a, s) {
1187
1190
  return;
1188
1191
  }
1189
1192
  let t = new URL(r);
1190
- t.searchParams.append("redirectUri", window.location.origin), t.searchParams.append("scope", s), t.searchParams.append("domainHint", "organizations"), t.searchParams.append("loginHint", a.mail), window.location.assign(t.href);
1193
+ t.searchParams.append("redirectUri", window.location.origin), t.searchParams.append("scope", s), t.searchParams.append("domainHint", "organizations"), t.searchParams.append("loginHint", n.mail), window.location.assign(t.href);
1191
1194
  }
1192
- async function jt(a) {
1193
- if (a.oid == "1") return !1;
1195
+ async function jt(n) {
1196
+ if (n.oid == "1") return !1;
1194
1197
  let s = window.location.href;
1195
1198
  s += "user";
1196
1199
  let r = new URL(s);
1197
- r.searchParams.append("oid", a.oid), r.searchParams.append("tid", a.tid), r.searchParams.append("loginHint", a.loginHint), r.searchParams.append("verb", "LOGOUT");
1200
+ r.searchParams.append("oid", n.oid), r.searchParams.append("tid", n.tid), r.searchParams.append("loginHint", n.loginHint), r.searchParams.append("verb", "LOGOUT");
1198
1201
  let t = { method: "PATCH" }, e = await fetch(r.href, t);
1199
1202
  if (e.status == 200 && e.statusText == "OK")
1200
- console.log(`Successfully set admin ${a.mail} logout_hint`);
1203
+ console.log(`Successfully set admin ${n.mail} logout_hint`);
1201
1204
  else
1202
- return console.log(`Failed to set admin ${a.mail} logout_hint`), !1;
1203
- let n = window.location.href;
1204
- switch (a.authority) {
1205
+ return console.log(`Failed to set admin ${n.mail} logout_hint`), !1;
1206
+ let a = window.location.href;
1207
+ switch (n.authority) {
1205
1208
  case p.authorityWW:
1206
- n += "MicrosoftIdentity/Account/SignOut";
1209
+ a += "MicrosoftIdentity/Account/SignOut";
1207
1210
  break;
1208
1211
  case p.authorityUS:
1209
- n += "USGov/SignOut";
1212
+ a += "USGov/SignOut";
1210
1213
  break;
1211
1214
  case p.authorityCN:
1212
- n += "China/SignOut";
1215
+ a += "China/SignOut";
1213
1216
  break;
1214
1217
  default:
1215
1218
  return !1;
1216
1219
  }
1217
- return r = new URL(n), r.searchParams.append("redirectUri", window.location.origin), window.location.assign(r.href), !0;
1220
+ return r = new URL(a), r.searchParams.append("redirectUri", window.location.origin), window.location.assign(r.href), !0;
1218
1221
  }
1219
- async function Ht(a, s, r, t) {
1222
+ async function Ht(n, s, r, t) {
1220
1223
  if (t) debugger;
1221
1224
  if (s.name != null && s.name !== "") return !1;
1222
- if (a.graphAccessToken != null && a.graphAccessToken === "") {
1223
- console.log(`tenantRelationshipsGetByDomain called with invalid logged in user: ${a.name}`);
1225
+ if (n.graphAccessToken != null && n.graphAccessToken === "") {
1226
+ console.log(`tenantRelationshipsGetByDomain called with invalid logged in user: ${n.name}`);
1224
1227
  try {
1225
- let i = await r.acquireTokenByCode({ code: a.spacode, scopes: ["user.read", "contacts.read", "CrossTenantInformation.ReadBasic.All"] });
1226
- a.graphAccessToken = i.accessToken, console.log("tenantRelationshipsGetByDomain: Front end token acquired: " + a.graphAccessToken.slice(0, 20));
1228
+ let i = await r.acquireTokenByCode({ code: n.spacode, scopes: ["user.read", "contacts.read", "CrossTenantInformation.ReadBasic.All"] });
1229
+ n.graphAccessToken = i.accessToken, console.log("tenantRelationshipsGetByDomain: Front end token acquired: " + n.graphAccessToken.slice(0, 20));
1227
1230
  } catch (i) {
1228
1231
  return console.log("tenantRelationshipsGetByDomain: Front end token failure: " + i), !1;
1229
1232
  }
1230
1233
  }
1231
- const e = new Headers(), n = `Bearer ${a.graphAccessToken}`;
1232
- e.append("Authorization", n);
1234
+ const e = new Headers(), a = `Bearer ${n.graphAccessToken}`;
1235
+ e.append("Authorization", a);
1233
1236
  let o = { method: "GET", headers: e };
1234
1237
  try {
1235
1238
  var d = F(s.authority) + p.graphTenantByDomainPredicate;
@@ -1251,20 +1254,20 @@ async function Ht(a, s, r, t) {
1251
1254
  }
1252
1255
  return !1;
1253
1256
  }
1254
- async function Xe(a, s, r, t, e) {
1257
+ async function Xe(n, s, r, t, e) {
1255
1258
  if (console.log("**** tenantRelationshipsGetById"), e) debugger;
1256
- if (a.graphAccessToken === "")
1259
+ if (n.graphAccessToken === "")
1257
1260
  try {
1258
- let l = await t.acquireTokenByCode({ code: a.spacode, scopes: ["user.read", "contacts.read", "CrossTenantInformation.ReadBasic.All"] });
1259
- a.graphAccessToken = l.accessToken, console.log("tenantRelationshipsGetById: Front end token acquired: " + a.graphAccessToken.slice(0, 20));
1261
+ let l = await t.acquireTokenByCode({ code: n.spacode, scopes: ["user.read", "contacts.read", "CrossTenantInformation.ReadBasic.All"] });
1262
+ n.graphAccessToken = l.accessToken, console.log("tenantRelationshipsGetById: Front end token acquired: " + n.graphAccessToken.slice(0, 20));
1260
1263
  } catch (l) {
1261
1264
  return console.log("tenantRelationshipsGetById: Front end token failure: " + l), !1;
1262
1265
  }
1263
- const n = new Headers(), o = `Bearer ${a.graphAccessToken}`;
1264
- n.append("Authorization", o);
1265
- let d = { method: "GET", headers: n };
1266
+ const a = new Headers(), o = `Bearer ${n.graphAccessToken}`;
1267
+ a.append("Authorization", o);
1268
+ let d = { method: "GET", headers: a };
1266
1269
  try {
1267
- var i = F(a.authority) + p.graphTenantByIdPredicate;
1270
+ var i = F(n.authority) + p.graphTenantByIdPredicate;
1268
1271
  i += "(tenantId='", i += s.tid, i += "')", console.log("tenantRelationshipsGetById: Attempting GET from /findTenantInformationByTenantId:", i);
1269
1272
  let u = await (await fetch(i, d)).json();
1270
1273
  if (u && typeof u.displayName !== void 0 && u.displayName !== "") {
@@ -1282,37 +1285,37 @@ async function Xe(a, s, r, t, e) {
1282
1285
  }
1283
1286
  return !1;
1284
1287
  }
1285
- async function Ee(a, s) {
1288
+ async function Ee(n, s) {
1286
1289
  if (s) debugger;
1287
1290
  let r = [p.authorityWW, p.authorityUS, p.authorityCN], t = [p.authorityWWRegex, p.authorityUSRegex, p.authorityCNRegex], e = null;
1288
1291
  try {
1289
1292
  for (let i = 0; i < 3; i++) {
1290
- var n = r[i];
1291
- 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) {
1293
+ var a = r[i];
1294
+ if (n.lookupfield == "Domain" ? a += n.domain : n.lookupfield == "Tenant ID" && (a += n.tid), a += "/.well-known/openid-configuration", console.log("Attempting GET from openid well-known endpoint: ", a), e = await fetch(a), e.status == 200) {
1292
1295
  let l = await e.json();
1293
1296
  if (l) {
1294
1297
  var o = l.authorization_endpoint;
1295
1298
  for (let u = 0; u < 3; u++) {
1296
1299
  var d = o.match(t[u]);
1297
1300
  if (d != null)
1298
- return a.tid = d[2], a.authority = d[1], console.log(`Successful GET from openid well-known endpoint: tid: ${a.tid} authority: ${a.authority}`), !0;
1301
+ return n.tid = d[2], n.authority = d[1], console.log(`Successful GET from openid well-known endpoint: tid: ${n.tid} authority: ${n.authority}`), !0;
1299
1302
  }
1300
1303
  } else
1301
- console.log(`Failed JSON parse of openid well-known endpoint response ${n}.`);
1304
+ console.log(`Failed JSON parse of openid well-known endpoint response ${a}.`);
1302
1305
  } else
1303
- console.log(`Failed GET from ${n}.`);
1306
+ console.log(`Failed GET from ${a}.`);
1304
1307
  }
1305
1308
  } catch (i) {
1306
1309
  console.log("Failed to GET from openid well-known endpoint: ", i);
1307
1310
  }
1308
- return (a.tid == "" || a.authority == "") && console.log(`GET from openid well-known endpoint failed to find tenant: ${e ? e.statusText : "unknown"}`), !1;
1311
+ return (n.tid == "" || n.authority == "") && console.log(`GET from openid well-known endpoint failed to find tenant: ${e ? e.statusText : "unknown"}`), !1;
1309
1312
  }
1310
- async function Ye(a, s, r) {
1313
+ async function Ye(n, s, r) {
1311
1314
  if (s == null || s.spacode == "" || r == null) {
1312
1315
  debugger;
1313
1316
  return { scopes: null, id: null, error: "500: invalid parameter(s) passed to getUserDelegatedScopes" };
1314
1317
  }
1315
- let e = { method: "GET", headers: await Q(a, s) };
1318
+ let e = { method: "GET", headers: await Q(n, s) };
1316
1319
  try {
1317
1320
  if (r.graphSP == "") {
1318
1321
  let { spid: i, error: l } = await Qe(e, s, "00000003-0000-0000-c000-000000000000");
@@ -1322,40 +1325,40 @@ async function Ye(a, s, r) {
1322
1325
  }
1323
1326
  r.graphSP = i;
1324
1327
  }
1325
- let { grants: n, id: o, error: d } = await Ve(e, s, r.graphSP, s.oid);
1328
+ let { grants: a, id: o, error: d } = await Ve(e, s, r.graphSP, s.oid);
1326
1329
  if (d != "") {
1327
1330
  debugger;
1328
1331
  return { scopes: null, id: null, error: `${d}` };
1329
1332
  }
1330
- return { scopes: n, id: o, error: "" };
1331
- } catch (n) {
1333
+ return { scopes: a, id: o, error: "" };
1334
+ } catch (a) {
1332
1335
  debugger;
1333
- return console.log(n), { scopes: null, id: null, error: `Exception: ${n}` };
1336
+ return console.log(a), { scopes: null, id: null, error: `Exception: ${a}` };
1334
1337
  }
1335
1338
  }
1336
- async function qt(a, s, r, t) {
1339
+ async function qt(n, s, r, t) {
1337
1340
  if (s == null || s.spacode == "" || r == null) {
1338
1341
  debugger;
1339
1342
  return !1;
1340
1343
  }
1341
- let { scopes: e, id: n, error: o } = await Ye(a, s, r);
1344
+ let { scopes: e, id: a, error: o } = await Ye(n, s, r);
1342
1345
  if (o != "") {
1343
1346
  debugger;
1344
1347
  return console.log(`userDelegatedScopesRemove: cannot find userDelegatedScopes for ${s.mail}: ${o}`), !1;
1345
1348
  }
1346
1349
  e = e.replace(t, "");
1347
- let d = await Ze(a, s, n, e);
1350
+ let d = await Ze(n, s, a, e);
1348
1351
  if (!d) {
1349
1352
  debugger;
1350
1353
  return console.log(`userDelegatedScopesRemove: cannot set oauth2PermissionGrants for ${s.mail}: ${o}`), !1;
1351
1354
  }
1352
1355
  return s.scopes = e.split(" "), d;
1353
1356
  }
1354
- async function Kt(a, s) {
1357
+ async function Kt(n, s) {
1355
1358
  if (s == null || s.spacode == "")
1356
1359
  return { users: [], error: "500: invalid user passed to usersGet" };
1357
1360
  try {
1358
- let t = { method: "GET", headers: await Q(a, s) }, e = F(s.authority);
1361
+ let t = { method: "GET", headers: await Q(n, s) }, e = F(s.authority);
1359
1362
  e += p.graphUsersPredicate;
1360
1363
  let o = await (await fetch(e, t)).json();
1361
1364
  if (typeof o.error < "u")
@@ -1368,153 +1371,153 @@ async function Kt(a, s) {
1368
1371
  return console.log(r), { users: [], error: `Exception: ${r}` };
1369
1372
  }
1370
1373
  }
1371
- async function Jt(a, s, r, t) {
1372
- return ct(a, s, r, t);
1374
+ async function Jt(n, s, r, t) {
1375
+ return ct(n, s, r, t);
1373
1376
  }
1374
- async function Vt(a, s, r, t) {
1375
- return dt(a, s, r, t);
1377
+ async function Vt(n, s, r, t) {
1378
+ return dt(n, s, r, t);
1376
1379
  }
1377
- async function Zt(a, s, r, t, e) {
1378
- return ut(a, s, r, t, e);
1380
+ async function Zt(n, s, r, t, e) {
1381
+ return ut(n, s, r, t, e);
1379
1382
  }
1380
- async function Qt(a, s, r, t) {
1381
- return ft(a, s, r, t);
1383
+ async function Qt(n, s, r, t) {
1384
+ return ft(n, s, r, t);
1382
1385
  }
1383
- async function Xt(a, s, r) {
1384
- return pt(a, s, r);
1386
+ async function Xt(n, s, r) {
1387
+ return pt(n, s, r);
1385
1388
  }
1386
- async function Yt(a, s, r, t, e, n, o, d) {
1389
+ async function Yt(n, s, r, t, e, a, o, d) {
1387
1390
  let i = new m();
1388
1391
  if (r.id === "1") {
1389
- if (i = await Tt(a, s, r, n.id, d), i.result) {
1392
+ if (i = await Tt(n, s, r, a.id, d), i.result) {
1390
1393
  r.tenants.forEach((f) => {
1391
1394
  (f.configId === "1" || f.configId === "") && (f.configId = r.id);
1392
1395
  }), t && t(r.id);
1393
1396
  const l = {};
1394
1397
  Object.defineProperty(l, r.id, { value: !0, writable: !0, enumerable: !0 }), e(l);
1395
- let u = n.associatedConfigs.findIndex((f) => f == "1");
1396
- u !== -1 && (n.associatedConfigs.splice(u, 1), n.associatedConfigs.push(r.id));
1398
+ let u = a.associatedConfigs.findIndex((f) => f == "1");
1399
+ u !== -1 && (a.associatedConfigs.splice(u, 1), a.associatedConfigs.push(r.id));
1397
1400
  }
1398
1401
  } else
1399
- i = await St(a, s, r, d);
1402
+ i = await St(n, s, r, d);
1400
1403
  return o.save(), i;
1401
1404
  }
1402
- async function es(a, s, r, t, e) {
1403
- let n = new m();
1404
- return n = await wt(a, s, r, t, e), n;
1405
+ async function es(n, s, r, t, e) {
1406
+ let a = new m();
1407
+ return a = await wt(n, s, r, t, e), a;
1405
1408
  }
1406
- async function ts(a, s, r, t, e) {
1407
- return ht(a, s, r, t, e);
1409
+ async function ts(n, s, r, t, e) {
1410
+ return ht(n, s, r, t, e);
1408
1411
  }
1409
- async function ss(a, s, r, t, e) {
1410
- return gt(a, s, r, t, e);
1412
+ async function ss(n, s, r, t, e) {
1413
+ return gt(n, s, r, t, e);
1411
1414
  }
1412
- async function rs(a, s, r, t, e, n) {
1415
+ async function rs(n, s, r, t, e, a) {
1413
1416
  let o = new m();
1414
1417
  if (e) debugger;
1415
1418
  try {
1416
1419
  let d = t.ws.find((i) => i.id === r);
1417
1420
  if (d != null) {
1418
1421
  d.associatedConfigs.length = 0;
1419
- let i = await mt(a, s, n, d.id, e);
1420
- return i.result && (t.tagWithWorkspaces(), localStorage.setItem("BatchIdArray", "{}")), i;
1422
+ let i = await mt(n, s, a, d.id, e);
1423
+ return i.result && t.tagWithWorkspaces(), i;
1421
1424
  } else
1422
1425
  return o.result = !1, o.error = "Workspace not found.", o.status = 404, o;
1423
1426
  } catch (d) {
1424
1427
  return console.log(d.message), o.error = d.message, o.result = !1, o.status = 500, o;
1425
1428
  }
1426
1429
  }
1427
- async function ns(a, s, r, t, e) {
1428
- return yt(a, s, r, t);
1430
+ async function as(n, s, r, t, e) {
1431
+ return yt(n, s, r, t);
1429
1432
  }
1430
- async function as(a, s, r, t, e) {
1433
+ async function ns(n, s, r, t, e) {
1431
1434
  console.log(">>>>>> initGet");
1432
- let n = new m();
1435
+ let a = new m();
1433
1436
  if (e)
1434
1437
  debugger;
1435
1438
  let o = new H();
1436
- return o.tid = s.tid, o.domain = s.tid, await Ee(o, e) ? (s.authority = o.authority, t.setTaskStart("GET tenant details", /* @__PURE__ */ new Date()), n.result = await Xe(s, o, r, a, e), t.setTaskEnd("GET tenant details", /* @__PURE__ */ new Date(), "complete"), n.result && (s.companyName = o.name, s.companyDomain = o.domain, t.setTaskStart("POST config init", /* @__PURE__ */ new Date()), n = await It(a, s, e), t.setTaskEnd("POST config init", /* @__PURE__ */ new Date(), n.result ? "complete" : "failed")), n.result && (t.setTaskStart("GET workspaces", /* @__PURE__ */ new Date()), n = await rt(a, s, r, e), t.setTaskEnd("GET workspaces", /* @__PURE__ */ new Date(), n.result ? "complete" : "failed")), console.log("initGet complete. Version: " + _()), n) : (n.error = `Failed to retrieve authority for user "${s.mail}" TID ${s.tid}.`, n.result = !1, n);
1439
+ return o.tid = s.tid, o.domain = s.tid, await Ee(o, e) ? (s.authority = o.authority, t.setTaskStart("GET tenant details", /* @__PURE__ */ new Date()), a.result = await Xe(s, o, r, n, e), t.setTaskEnd("GET tenant details", /* @__PURE__ */ new Date(), "complete"), a.result && (s.companyName = o.name, s.companyDomain = o.domain, t.setTaskStart("POST config init", /* @__PURE__ */ new Date()), a = await It(n, s, e), t.setTaskEnd("POST config init", /* @__PURE__ */ new Date(), a.result ? "complete" : "failed")), a.result && (t.setTaskStart("GET workspaces", /* @__PURE__ */ new Date()), a = await rt(n, s, r, e), t.setTaskEnd("GET workspaces", /* @__PURE__ */ new Date(), a.result ? "complete" : "failed")), console.log("initGet complete. Version: " + _()), a) : (a.error = `Failed to retrieve authority for user "${s.mail}" TID ${s.tid}.`, a.result = !1, a);
1437
1440
  }
1438
- async function os(a, s, r, t) {
1439
- return kt(a, s, r, t);
1441
+ async function os(n, s, r, t) {
1442
+ return kt(n, s, r, t);
1440
1443
  }
1441
- async function is(a, s, r, t, e) {
1442
- return $t(a, s, r, t);
1444
+ async function is(n, s, r, t, e) {
1445
+ return $t(n, s, r, t);
1443
1446
  }
1444
- async function ls(a, s, r, t) {
1445
- return lt(a, s, r, t);
1447
+ async function ls(n, s, r, t) {
1448
+ return lt(n, s, r, t);
1446
1449
  }
1447
- async function cs(a, s, r, t) {
1448
- return ot(a, s, r, t);
1450
+ async function cs(n, s, r, t) {
1451
+ return ot(n, s, r, t);
1449
1452
  }
1450
- async function ds(a, s, r, t) {
1451
- return await Et(a, s, r, t);
1453
+ async function ds(n, s, r, t) {
1454
+ return await Et(n, s, r, t);
1452
1455
  }
1453
- function et(a, s, r, t) {
1456
+ function et(n, s, r, t) {
1454
1457
  r.map((e) => {
1455
- let n = null, o = s.us.findIndex((l) => l.oid === e.userId || l.oid === e.email);
1458
+ let a = null, o = s.us.findIndex((l) => l.oid === e.userId || l.oid === e.email);
1456
1459
  if (o === -1) {
1457
1460
  let l = s.us.findIndex((u) => u.oid === "1");
1458
1461
  if (l !== -1) {
1459
- n = s.us.at(l);
1460
- let u = a.associatedUsers.findIndex((f) => f == "1");
1461
- u !== -1 && (a.associatedUsers.splice(u, 1), a.associatedUsers.push(e.userId));
1462
+ a = s.us.at(l);
1463
+ let u = n.associatedUsers.findIndex((f) => f == "1");
1464
+ u !== -1 && (n.associatedUsers.splice(u, 1), n.associatedUsers.push(e.userId));
1462
1465
  } else
1463
- n = new re(), s.us.push(n);
1466
+ a = new re(), s.us.push(a);
1464
1467
  } else
1465
- n = s.us.at(o);
1466
- n.sel = t === e.userId, n.oid = e.userId ? e.userId : e.email, n.name = e.firstName ?? n.name, n.mail = e.email, n.tid = e.tenantId;
1467
- let d = s.ts.find((l) => l.tid === n.tid);
1468
- d != null && (n.authority = d.authority, n.companyName = d.name, n.companyDomain = d.domain), a.associatedUsers.findIndex((l) => l === n.oid) == -1 && a.associatedUsers.push(n.oid);
1468
+ a = s.us.at(o);
1469
+ a.sel = t === e.userId, a.oid = e.userId ? e.userId : e.email, a.name = e.firstName ?? a.name, a.mail = e.email, a.tid = e.tenantId;
1470
+ let d = s.ts.find((l) => l.tid === a.tid);
1471
+ d != null && (a.authority = d.authority, a.companyName = d.name, a.companyDomain = d.domain), n.associatedUsers.findIndex((l) => l === a.oid) == -1 && n.associatedUsers.push(a.oid);
1469
1472
  }), s.save();
1470
1473
  }
1471
- function tt(a, s, r, t) {
1474
+ function tt(n, s, r, t) {
1472
1475
  r.map((e) => {
1473
- let n = null, o = s.ts.findIndex((u) => u.tid === e.tenantId);
1476
+ let a = null, o = s.ts.findIndex((u) => u.tid === e.tenantId);
1474
1477
  if (o === -1) {
1475
1478
  let u = s.ts.findIndex((f) => f.tid === "1");
1476
1479
  if (u !== -1) {
1477
- n = s.ts.at(u);
1478
- let f = a.associatedTenants.findIndex((I) => I == "1");
1479
- f !== -1 && (a.associatedTenants.splice(f, 1), a.associatedTenants.push(e.tenantId));
1480
+ a = s.ts.at(u);
1481
+ let f = n.associatedTenants.findIndex((I) => I == "1");
1482
+ f !== -1 && (n.associatedTenants.splice(f, 1), n.associatedTenants.push(e.tenantId));
1480
1483
  } else
1481
- n = new H(), s.ts.push(n);
1484
+ a = new H(), s.ts.push(a);
1482
1485
  } else
1483
- n = s.ts.at(o);
1484
- n.sel = t === e.tenantId, n.tid = e.tenantId, n.name = e.name, n.domain = e.domain, n.tenantType = e.type.toLowerCase();
1486
+ a = s.ts.at(o);
1487
+ a.sel = t === e.tenantId, a.tid = e.tenantId, a.name = e.name, a.domain = e.domain, a.tenantType = e.type.toLowerCase();
1485
1488
  const d = /^(https:\/\/login.microsoftonline.(?:us|com)\/)organizations\/v2.0$/, i = e.authority.match(d);
1486
- n.authority = i ? i[1] : e.authority, a.associatedTenants.findIndex((u) => u === e.tenantId) == -1 && a.associatedTenants.push(e.tenantId);
1489
+ a.authority = i ? i[1] : e.authority, n.associatedTenants.findIndex((u) => u === e.tenantId) == -1 && n.associatedTenants.push(e.tenantId);
1487
1490
  }), s.save();
1488
1491
  }
1489
- function st(a, s, r, t) {
1492
+ function st(n, s, r, t) {
1490
1493
  r.map((e) => {
1491
- let n = null, o = s.cs.findIndex((i) => i.id === e.id);
1494
+ let a = null, o = s.cs.findIndex((i) => i.id === e.id);
1492
1495
  if (o === -1) {
1493
1496
  let i = s.cs.findIndex((l) => l.id === "1");
1494
1497
  if (i !== -1) {
1495
- n = s.cs.at(i);
1496
- let l = a.associatedConfigs.findIndex((u) => u == "1");
1497
- l !== -1 && (a.associatedConfigs.splice(l, 1), a.associatedConfigs.push(e.id));
1498
+ a = s.cs.at(i);
1499
+ let l = n.associatedConfigs.findIndex((u) => u == "1");
1500
+ l !== -1 && (n.associatedConfigs.splice(l, 1), n.associatedConfigs.push(e.id));
1498
1501
  } else
1499
- n = new ne(), s.cs.push(n);
1502
+ a = new ae(), s.cs.push(a);
1500
1503
  } else
1501
- n = s.cs.at(o);
1502
- n.sel = t === 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) => {
1504
+ a = s.cs.at(o);
1505
+ a.sel = t === e.id, a.id = e.id, a.workspaceId = e.workspaceId, a.name = e.name, a.description = e.description, a.isEnabled = e.isEnabled, a.tenants.length = 0, e.tenants.map((i) => {
1503
1506
  let l = new Me();
1504
- l.tid = i.tenantId, l.sourceGroupId = i.sourceGroupId ?? "", l.sourceGroupName = i.sourceGroupName ?? "", l.targetGroupId = i.targetGroupId ?? "", l.targetGroupName = i.targetGroupName ?? "", l.configurationTenantType = i.configurationTenantType.toLowerCase(), l.deltaToken = i.deltaToken ?? "", l.configId = n.id, l.batchId = i.batchId ?? "", l.isReadPermissionConsented = i.isReadPermissionConsented, l.isWritePermissionConsented = i.isWritePermissionConsented, n.tenants.push(l);
1505
- }), a.associatedConfigs.findIndex((i) => i === e.id) == -1 && a.associatedConfigs.push(e.id);
1507
+ l.tid = i.tenantId, l.sourceGroupId = i.sourceGroupId ?? "", l.sourceGroupName = i.sourceGroupName ?? "", l.targetGroupId = i.targetGroupId ?? "", l.targetGroupName = i.targetGroupName ?? "", l.configurationTenantType = i.configurationTenantType.toLowerCase(), l.deltaToken = i.deltaToken ?? "", l.configId = a.id, l.batchId = i.batchId ?? "", l.isReadPermissionConsented = i.isReadPermissionConsented, l.isWritePermissionConsented = i.isWritePermissionConsented, a.tenants.push(l);
1508
+ }), n.associatedConfigs.findIndex((i) => i === e.id) == -1 && n.associatedConfigs.push(e.id);
1506
1509
  }), console.log("--------------ii-----------", s), s.save();
1507
1510
  }
1508
- async function rt(a, s, r, t) {
1511
+ async function rt(n, s, r, t) {
1509
1512
  let e = new m();
1510
1513
  if (t) debugger;
1511
1514
  try {
1512
- if (e = await Dt(a, s, t), e.result) {
1513
- for (let n of e.array) {
1514
- let o = null, d = r.ws.findIndex((E) => E.id === n.id);
1515
+ if (e = await Dt(n, s, t), e.result) {
1516
+ for (let a of e.array) {
1517
+ let o = null, d = r.ws.findIndex((E) => E.id === a.id);
1515
1518
  if (d === -1) {
1516
1519
  let E = r.ws.findIndex((A) => A.id === "1");
1517
- E !== -1 ? o = r.ws.at(E) : (o = new ae(), r.ws.push(o));
1520
+ E !== -1 ? o = r.ws.at(E) : (o = new ne(), r.ws.push(o));
1518
1521
  } else
1519
1522
  o = r.ws.at(d);
1520
1523
  let i = "";
@@ -1532,27 +1535,27 @@ async function rt(a, s, r, t) {
1532
1535
  let A = r.cs.find(($) => $.id === E);
1533
1536
  A != null && A.sel && (u = A.id);
1534
1537
  }
1535
- o.associatedUsers.length = 0, o.associatedTenants.length = 0, o.associatedConfigs.length = 0, o.id = n.id, o.name = n.name, o.ownerid = n.workspaceOwnerUserId;
1536
- let f = it(a, s, o.id, t), I = At(a, s, o.id, t), D = bt(a, s, o.id, t), [R, W, x] = await Promise.all([f, I, D]);
1538
+ o.associatedUsers.length = 0, o.associatedTenants.length = 0, o.associatedConfigs.length = 0, o.id = a.id, o.name = a.name, o.ownerid = a.workspaceOwnerUserId;
1539
+ let f = it(n, s, o.id, t), I = At(n, s, o.id, t), D = bt(n, s, o.id, t), [R, W, C] = await Promise.all([f, I, D]);
1537
1540
  if (!R.result) return R;
1538
1541
  if (!W.result) return W;
1539
- if (!x.result) return x;
1540
- tt(o, r, W.array, l), et(o, r, R.array, i), st(o, r, x.array, u), r.tagWithWorkspaces();
1542
+ if (!C.result) return C;
1543
+ tt(o, r, W.array, l), et(o, r, R.array, i), st(o, r, C.array, u), r.tagWithWorkspaces();
1541
1544
  }
1542
1545
  return e;
1543
1546
  }
1544
- } catch (n) {
1545
- console.log(n.message), e.error = n.message;
1547
+ } catch (a) {
1548
+ console.log(a.message), e.error = a.message;
1546
1549
  }
1547
1550
  return e.result = !1, e.status = 500, e;
1548
1551
  }
1549
- async function us(a, s) {
1552
+ async function us(n, s) {
1550
1553
  let r = "", t = _();
1551
1554
  try {
1552
- let e = a.getAllAccounts(), n = s.oid + "." + s.tid, o = null;
1555
+ let e = n.getAllAccounts(), a = s.oid + "." + s.tid, o = null;
1553
1556
  for (let i = 0; i < e.length; i++)
1554
- e[i].homeAccountId == n && (o = e[i]);
1555
- r = (await a.acquireTokenSilent({
1557
+ e[i].homeAccountId == a && (o = e[i]);
1558
+ r = (await n.acquireTokenSilent({
1556
1559
  scopes: [
1557
1560
  "https://analysis.windows.net/powerbi/api/App.Read.All",
1558
1561
  "https://analysis.windows.net/powerbi/api/Dataset.ReadWrite.All",
@@ -1566,25 +1569,25 @@ async function us(a, s) {
1566
1569
  }
1567
1570
  return console.log(t), r;
1568
1571
  }
1569
- async function de(a, s) {
1572
+ async function de(n, s) {
1570
1573
  const r = new Headers();
1571
1574
  if (r.append("Content-Type", "application/json"), r.append("accept", "*/*"), s.azureAccessToken == null || s.azureAccessToken === "")
1572
1575
  try {
1573
- let t = a.getAllAccounts(), e = s.oid + "." + s.tid, n = null;
1576
+ let t = n.getAllAccounts(), e = s.oid + "." + s.tid, a = null;
1574
1577
  for (let d = 0; d < t.length; d++)
1575
- t[d].homeAccountId == e && (n = t[d]);
1576
- let o = await a.acquireTokenSilent({
1578
+ t[d].homeAccountId == e && (a = t[d]);
1579
+ let o = await n.acquireTokenSilent({
1577
1580
  scopes: ["https://management.azure.com/user_impersonation"],
1578
- account: n
1581
+ account: a
1579
1582
  });
1580
1583
  s.azureAccessToken = o.accessToken, console.log("Front end token acquired silently: " + s.azureAccessToken.slice(0, 20));
1581
1584
  } catch (t) {
1582
1585
  try {
1583
1586
  console.log("Front end token silent acquisition failure: " + t);
1584
- let e = a.getAllAccounts(), n = s.oid + "." + s.tid, o = null;
1587
+ let e = n.getAllAccounts(), a = s.oid + "." + s.tid, o = null;
1585
1588
  for (let d = 0; d < e.length; d++)
1586
- e[d].homeAccountId == n && (o = e[d]);
1587
- a.acquireTokenRedirect({
1589
+ e[d].homeAccountId == a && (o = e[d]);
1590
+ n.acquireTokenRedirect({
1588
1591
  scopes: ["https://management.azure.com/user_impersonation"],
1589
1592
  account: o
1590
1593
  });
@@ -1594,47 +1597,47 @@ async function de(a, s) {
1594
1597
  }
1595
1598
  return r.append("Authorization", `Bearer ${s.azureAccessToken}`), r;
1596
1599
  }
1597
- async function fs(a, s) {
1600
+ async function fs(n, s) {
1598
1601
  if (s == null || s.spacode == "")
1599
1602
  return !1;
1600
1603
  try {
1601
- let t = { method: "GET", headers: await de(a, s) }, e = j.azureListRootAssignments;
1604
+ let t = { method: "GET", headers: await de(n, s) }, e = j.azureListRootAssignments;
1602
1605
  e += "'", e += s.oid, e += "'";
1603
- let n = await fetch(e, t);
1604
- if (n.status == 200) {
1605
- let o = await n.json();
1606
+ let a = await fetch(e, t);
1607
+ if (a.status == 200) {
1608
+ let o = await a.json();
1606
1609
  o = o;
1607
1610
  debugger;
1608
1611
  console.log("Successful call to Azure Resource Graph list root assignments");
1609
1612
  } else
1610
- return console.log(await y(n)), !1;
1613
+ return console.log(await y(a)), !1;
1611
1614
  } catch (r) {
1612
1615
  return console.log(r), !1;
1613
1616
  }
1614
1617
  return !0;
1615
1618
  }
1616
- async function ps(a, s) {
1619
+ async function ps(n, s) {
1617
1620
  if (s == null || s.spacode == "")
1618
1621
  return !1;
1619
1622
  try {
1620
- let t = { method: "POST", headers: await de(a, s) }, e = j.azureElevateAccess, n = await fetch(e, t);
1621
- if (n.status == 200)
1623
+ let t = { method: "POST", headers: await de(n, s) }, e = j.azureElevateAccess, a = await fetch(e, t);
1624
+ if (a.status == 200)
1622
1625
  console.log("Successful call to Azure Resource Graph list root assignments");
1623
1626
  else
1624
- return console.log(await y(n)), !1;
1627
+ return console.log(await y(a)), !1;
1625
1628
  } catch (r) {
1626
1629
  return console.log(r), !1;
1627
1630
  }
1628
1631
  return !0;
1629
1632
  }
1630
- async function nt(a, s) {
1633
+ async function at(n, s) {
1631
1634
  let r = new Array();
1632
1635
  if (s == null || s.spacode == "")
1633
1636
  return r;
1634
1637
  try {
1635
- let e = { method: "GET", headers: await de(a, s) }, n = j.azureListRootAssignments;
1636
- n += "'", n += s.oid, n += "'";
1637
- let o = await fetch(n, e);
1638
+ let e = { method: "GET", headers: await de(n, s) }, a = j.azureListRootAssignments;
1639
+ a += "'", a += s.oid, a += "'";
1640
+ let o = await fetch(a, e);
1638
1641
  if (o.status == 200) {
1639
1642
  let d = await o.json();
1640
1643
  d = d;
@@ -1647,19 +1650,19 @@ async function nt(a, s) {
1647
1650
  }
1648
1651
  return r;
1649
1652
  }
1650
- function at(a) {
1651
- let s = "8d95d21c-c378-4bb0-9f52-88c30d271e7a", r = a.authority.toLowerCase();
1653
+ function nt(n) {
1654
+ let s = "8d95d21c-c378-4bb0-9f52-88c30d271e7a", r = n.authority.toLowerCase();
1652
1655
  return r.startsWith("https://login.microsoftonline.com/") ? s = "8d95d21c-c378-4bb0-9f52-88c30d271e7a" : r.startsWith("https://login.microsoftonline.us/") ? s = "48da942e-ea3d-49e4-a054-81649012f8f2" : r.startsWith("https://login.partner.microsoftonline.cn/") && (s = "c91d32e4-dcc5-4d77-826a-16e93ffce666"), `api://${s}/Config.Write`;
1653
1656
  }
1654
- async function b(a, s) {
1657
+ async function b(n, s) {
1655
1658
  const r = new Headers();
1656
1659
  r.append("Content-Type", "application/json"), r.append("accept", "*/*");
1657
- const t = at(s);
1660
+ const t = nt(s);
1658
1661
  try {
1659
- let e = a.getAllAccounts(), n = s.oid + "." + s.tid, o = null;
1662
+ let e = n.getAllAccounts(), a = s.oid + "." + s.tid, o = null;
1660
1663
  for (let i = 0; i < e.length; i++)
1661
- e[i].homeAccountId == n && (o = e[i]);
1662
- let d = await a.acquireTokenSilent({
1664
+ e[i].homeAccountId == a && (o = e[i]);
1665
+ let d = await n.acquireTokenSilent({
1663
1666
  scopes: [t],
1664
1667
  account: o
1665
1668
  });
@@ -1667,29 +1670,29 @@ async function b(a, s) {
1667
1670
  } catch (e) {
1668
1671
  try {
1669
1672
  console.log("Front end mindline token silent acquisition failure, triggering redirect: " + e);
1670
- let n = a.getAllAccounts(), o = s.oid + "." + s.tid, d = null;
1671
- for (let i = 0; i < n.length; i++)
1672
- n[i].homeAccountId == o && (d = n[i]);
1673
- a.acquireTokenRedirect({
1673
+ let a = n.getAllAccounts(), o = s.oid + "." + s.tid, d = null;
1674
+ for (let i = 0; i < a.length; i++)
1675
+ a[i].homeAccountId == o && (d = a[i]);
1676
+ n.acquireTokenRedirect({
1674
1677
  scopes: [t],
1675
1678
  account: d
1676
1679
  });
1677
- } catch (n) {
1678
- console.log("Front end mindline token redirect acquisition failure: " + n);
1680
+ } catch (a) {
1681
+ console.log("Front end mindline token redirect acquisition failure: " + a);
1679
1682
  }
1680
1683
  }
1681
1684
  return r.append("Authorization", `Bearer ${s.mindlineAccessToken}`), r;
1682
1685
  }
1683
- async function y(a) {
1686
+ async function y(n) {
1684
1687
  let s = "";
1685
- if (a.status === 401 && (s = a.statusText, s != ""))
1688
+ if (n.status === 401 && (s = n.statusText, s != ""))
1686
1689
  return s;
1687
- let r = await a.json();
1690
+ let r = await n.json();
1688
1691
  if (r.error !== void 0)
1689
1692
  s = `Error: ${r.error} Message: ${r.message}`;
1690
1693
  else if (r.errors !== void 0)
1691
1694
  s = Object.keys(r.errors).reduce(
1692
- (n, o) => n + o + ": " + r.errors[o] + " ",
1695
+ (a, o) => a + o + ": " + r.errors[o] + " ",
1693
1696
  ""
1694
1697
  );
1695
1698
  else if (r.title !== void 0)
@@ -1698,29 +1701,29 @@ async function y(a) {
1698
1701
  debugger;
1699
1702
  return s;
1700
1703
  }
1701
- async function ot(a, s, r, t) {
1704
+ async function ot(n, s, r, t) {
1702
1705
  let e = new m();
1703
1706
  if (r.oid == "" && r.mail == "" || t == "")
1704
1707
  return e.result = !1, e.error = "adminDelete: invalid parameters", e.status = 500, e;
1705
- let n = null;
1706
- n = new URL(w.adminEndpoint()), n.searchParams.append("workspaceId", t), n.searchParams.append("email", r.mail);
1707
- let d = { method: "DELETE", headers: await b(a, s) };
1708
+ let a = null;
1709
+ a = new URL(w.adminEndpoint()), a.searchParams.append("workspaceId", t), a.searchParams.append("email", r.mail);
1710
+ let d = { method: "DELETE", headers: await b(n, s) };
1708
1711
  try {
1709
- console.log("Attempting DELETE from /admin: " + n.href);
1710
- let i = await fetch(n.href, d);
1711
- return i.status === 200 && i.statusText === "OK" ? (console.log(`Successful DELETE from /admin: ${n.href}`), e) : (e.error = await y(i), console.log(`Failed DELETE from /admin: ${n.href}`), console.log(e.error), e.status = 500, e.result = !1, e);
1712
+ console.log("Attempting DELETE from /admin: " + a.href);
1713
+ let i = await fetch(a.href, d);
1714
+ return i.status === 200 && i.statusText === "OK" ? (console.log(`Successful DELETE from /admin: ${a.href}`), e) : (e.error = await y(i), console.log(`Failed DELETE from /admin: ${a.href}`), console.log(e.error), e.status = 500, e.result = !1, e);
1712
1715
  } catch (i) {
1713
1716
  e.error = i.message, e.status = 500, e.result = !1, console.log(i.message);
1714
1717
  }
1715
1718
  return e;
1716
1719
  }
1717
- async function it(a, s, r, t) {
1720
+ async function it(n, s, r, t) {
1718
1721
  let e = new m();
1719
1722
  if (r === "")
1720
1723
  return e.result = !1, e.status = 500, e.error = "adminsGet: no workspace provided", e;
1721
- let n = w.adminsEndpoint(), o = new URL(n);
1724
+ let a = w.adminsEndpoint(), o = new URL(a);
1722
1725
  o.searchParams.append("workspaceId", r);
1723
- let i = { method: "GET", headers: await b(a, s) };
1726
+ let i = { method: "GET", headers: await b(n, s) };
1724
1727
  try {
1725
1728
  if (t) debugger;
1726
1729
  console.log("Attempting GET from /admins: " + o.href);
@@ -1735,33 +1738,33 @@ async function it(a, s, r, t) {
1735
1738
  }
1736
1739
  return e;
1737
1740
  }
1738
- async function lt(a, s, r, t) {
1741
+ async function lt(n, s, r, t) {
1739
1742
  let e = new m();
1740
1743
  if (r.mail == "" || r.authority == "" || r.tid === "")
1741
1744
  return e.result = !1, e.error = "adminPost: invalid argument", e.status = 500, e;
1742
- let n = w.adminEndpoint();
1743
- const o = await b(a, s);
1745
+ let a = w.adminEndpoint();
1746
+ const o = await b(n, s);
1744
1747
  let d = `
1745
1748
  {"email": "${r.mail}",
1746
1749
  "tenantId": "${r.tid}",
1747
1750
  "workspaceId": "${t}"
1748
1751
  }`, i = { method: "POST", headers: o, body: d };
1749
1752
  try {
1750
- console.log("Attempting POST to /admin: " + n);
1751
- let l = await fetch(n, i);
1753
+ console.log("Attempting POST to /admin: " + a);
1754
+ let l = await fetch(a, i);
1752
1755
  return l.status === 200 && l.statusText === "OK" ? (console.log(`Successful POST to /admin: ${d}`), e) : (e.error = await y(l), console.log(`Failed POST to /admin: ${d}`), console.log(e.error), e.status = 500, e.result = !1, e);
1753
1756
  } catch (l) {
1754
1757
  e.error = l.message, e.status = 500, e.result = !1, console.log(l.message);
1755
1758
  }
1756
1759
  return e;
1757
1760
  }
1758
- async function ct(a, s, r, t) {
1759
- a = a, s = s, t = t;
1761
+ async function ct(n, s, r, t) {
1762
+ n = n, s = s, t = t;
1760
1763
  let e = new m();
1761
1764
  if (r.id === "")
1762
1765
  return e.result = !1, e.error = "auditConfigPost: invalid config ID", e.status = 500, e;
1763
- let n = w.auditConfigEndpoint();
1764
- const o = await b(a, s);
1766
+ let a = w.auditConfigEndpoint();
1767
+ const o = await b(n, s);
1765
1768
  let d = `
1766
1769
  {
1767
1770
  "workspaceId": "${r.workspaceId}",
@@ -1773,8 +1776,8 @@ async function ct(a, s, r, t) {
1773
1776
  }`, i = { method: "POST", headers: o, body: d };
1774
1777
  try {
1775
1778
  if (t) debugger;
1776
- console.log("Attempting POST to /audit-configuration: " + n);
1777
- let l = await fetch(n, i);
1779
+ console.log("Attempting POST to /audit-configuration: " + a);
1780
+ let l = await fetch(a, i);
1778
1781
  if (l.status === 200 && l.statusText === "OK") {
1779
1782
  let u = await l.json();
1780
1783
  return r.id = u, console.log(
@@ -1787,14 +1790,14 @@ async function ct(a, s, r, t) {
1787
1790
  }
1788
1791
  return e;
1789
1792
  }
1790
- async function dt(a, s, r, t) {
1791
- a = a, s = s, t = t;
1793
+ async function dt(n, s, r, t) {
1794
+ n = n, s = s, t = t;
1792
1795
  let e = new m();
1793
1796
  if (s.mail == null || s.mail == "")
1794
1797
  return e.result = !1, e.status = 500, e.error = "auditConfigGet: no user provided", e;
1795
1798
  if (!r || r.trim() === "")
1796
1799
  return e.result = !1, e.error = "auditConfigGet: configurationId is required", e.status = 500, e;
1797
- let n = w.auditConfigEndpoint(), o = new URL(`${n}/${r}`), i = { method: "GET", headers: await b(a, s) };
1800
+ let a = w.auditConfigEndpoint(), o = new URL(`${a}/${r}`), i = { method: "GET", headers: await b(n, s) };
1798
1801
  try {
1799
1802
  if (t) debugger;
1800
1803
  console.log("Attempting GET to /audit-configuration: " + o.href);
@@ -1809,13 +1812,13 @@ async function dt(a, s, r, t) {
1809
1812
  }
1810
1813
  return e;
1811
1814
  }
1812
- async function ut(a, s, r, t, e) {
1813
- let n = new m();
1815
+ async function ut(n, s, r, t, e) {
1816
+ let a = new m();
1814
1817
  if (!r || r.trim() === "")
1815
- return n.result = !1, n.error = "auditConfigPut: invalid configuration ID", n.status = 500, n;
1818
+ return a.result = !1, a.error = "auditConfigPut: invalid configuration ID", a.status = 500, a;
1816
1819
  let o = w.auditConfigEndpoint(), d = new URL(o);
1817
1820
  d.searchParams.append("configurationId", r);
1818
- const i = await b(a, s);
1821
+ const i = await b(n, s);
1819
1822
  let l = `
1820
1823
  {
1821
1824
  "name": "${t.name}",
@@ -1828,21 +1831,21 @@ async function ut(a, s, r, t, e) {
1828
1831
  if (e) debugger;
1829
1832
  console.log("Attempting PUT to /audit-configuration: " + d.href);
1830
1833
  const f = await fetch(d.href, u);
1831
- f.status === 200 && f.statusText === "OK" ? (n.result = !0, console.log(`Successful PUT to ${d.href}: ${l}`)) : (n.error = await y(f), console.error(`Failed PUT to ${d.href}: ${l}`), n.status = f.status, n.result = !1);
1834
+ f.status === 200 && f.statusText === "OK" ? (a.result = !0, console.log(`Successful PUT to ${d.href}: ${l}`)) : (a.error = await y(f), console.error(`Failed PUT to ${d.href}: ${l}`), a.status = f.status, a.result = !1);
1832
1835
  } catch (f) {
1833
- n.error = f.message, n.status = 500, n.result = !1, console.error("Error during auditConfigPut:", f.message);
1836
+ a.error = f.message, a.status = 500, a.result = !1, console.error("Error during auditConfigPut:", f.message);
1834
1837
  }
1835
- return n;
1838
+ return a;
1836
1839
  }
1837
- async function ft(a, s, r, t) {
1840
+ async function ft(n, s, r, t) {
1838
1841
  let e = new m();
1839
1842
  if (!s.mail)
1840
1843
  return e.result = !1, e.status = 500, e.error = "auditConfigDelete: no user provided", e;
1841
1844
  if (!r || r.trim() === "")
1842
1845
  return e.result = !1, e.status = 500, e.error = "auditConfigDelete: configurationId is required", e;
1843
- let n = w.auditConfigEndpoint(), o = new URL(n);
1846
+ let a = w.auditConfigEndpoint(), o = new URL(a);
1844
1847
  o.searchParams.append("configurationId", r);
1845
- const i = { method: "DELETE", headers: await b(a, s) };
1848
+ const i = { method: "DELETE", headers: await b(n, s) };
1846
1849
  try {
1847
1850
  if (t) debugger;
1848
1851
  console.log(`Attempting DELETE to /audit-configuration: ${o.href}`);
@@ -1853,15 +1856,15 @@ async function ft(a, s, r, t) {
1853
1856
  }
1854
1857
  return e;
1855
1858
  }
1856
- async function pt(a, s, r) {
1859
+ async function pt(n, s, r) {
1857
1860
  let t = new m();
1858
1861
  if (s.mail == null || s.mail == "")
1859
1862
  return t.result = !1, t.status = 500, t.error = "auditEventsGet: no user provided", t;
1860
- let e = w.auditEventsEndpoint(), n = new URL(e), d = { method: "GET", headers: await b(a, s) };
1863
+ let e = w.auditEventsEndpoint(), a = new URL(e), d = { method: "GET", headers: await b(n, s) };
1861
1864
  try {
1862
1865
  if (r) debugger;
1863
- console.log("Attempting GET from /audit-events endpoint: " + n.href);
1864
- let i = await fetch(n.href, d);
1866
+ console.log("Attempting GET from /audit-events endpoint: " + a.href);
1867
+ let i = await fetch(a.href, d);
1865
1868
  if (i.status === 200 && i.statusText === "OK") {
1866
1869
  let l = await i.json();
1867
1870
  if (Array.isArray(l.data)) {
@@ -1871,16 +1874,16 @@ async function pt(a, s, r) {
1871
1874
  }
1872
1875
  return t.error = "Failed GET from /audit-events: failed to JSON-parse response", console.log(t.error), t.status = 500, t.result = !1, t;
1873
1876
  } else
1874
- return console.log(`Failed GET from /audit-events: ${n.href}`), t.error = await y(i), t.status = 500, t.result = !1, console.log(t.error), t;
1877
+ return console.log(`Failed GET from /audit-events: ${a.href}`), t.error = await y(i), t.status = 500, t.result = !1, console.log(t.error), t;
1875
1878
  } catch (i) {
1876
1879
  t.error = i.message, t.status = 500, t.result = !1, console.log(i.message);
1877
1880
  }
1878
1881
  return t;
1879
1882
  }
1880
- async function ht(a, s, r, t, e) {
1881
- let n = new m(), o = w.configConsentEndpoint(), d = new URL(o);
1883
+ async function ht(n, s, r, t, e) {
1884
+ let a = new m(), o = w.configConsentEndpoint(), d = new URL(o);
1882
1885
  d.searchParams.append("configurationId", r);
1883
- const i = await b(a, s);
1886
+ const i = await b(n, s);
1884
1887
  let l = `
1885
1888
  {
1886
1889
  "tenantId": "${t}",
@@ -1889,16 +1892,16 @@ async function ht(a, s, r, t, e) {
1889
1892
  try {
1890
1893
  console.log("Attempting PUT read consent to /configuration/consent: " + d.href);
1891
1894
  let f = await fetch(d.href, u);
1892
- return f.status === 200 && f.statusText === "OK" ? (console.log(`Successful PUT to ${d.href}`), n) : (n.error = await y(f), console.log(`Failed PUT to ${d.href}`), console.log(n.error), n.status = 500, n.result = !1, n);
1895
+ return f.status === 200 && f.statusText === "OK" ? (console.log(`Successful PUT to ${d.href}`), a) : (a.error = await y(f), console.log(`Failed PUT to ${d.href}`), console.log(a.error), a.status = 500, a.result = !1, a);
1893
1896
  } catch (f) {
1894
- n.error = f.message, n.status = 500, n.result = !1, console.log(f.message);
1897
+ a.error = f.message, a.status = 500, a.result = !1, console.log(f.message);
1895
1898
  }
1896
- return n;
1899
+ return a;
1897
1900
  }
1898
- async function gt(a, s, r, t, e) {
1899
- let n = new m(), o = w.configConsentEndpoint(), d = new URL(o);
1901
+ async function gt(n, s, r, t, e) {
1902
+ let a = new m(), o = w.configConsentEndpoint(), d = new URL(o);
1900
1903
  d.searchParams.append("configurationId", r);
1901
- const i = await b(a, s);
1904
+ const i = await b(n, s);
1902
1905
  let l = `
1903
1906
  {
1904
1907
  "tenantId": "${t}",
@@ -1907,19 +1910,19 @@ async function gt(a, s, r, t, e) {
1907
1910
  try {
1908
1911
  console.log("Attempting PUT read consent to /configuration/consent: " + d.href);
1909
1912
  let f = await fetch(d.href, u);
1910
- return f.status === 200 && f.statusText === "OK" ? (console.log(`Successful PUT to ${d.href}`), n) : (n.error = await y(f), console.log(`Failed PUT to ${d.href}`), console.log(n.error), n.status = 500, n.result = !1, n);
1913
+ return f.status === 200 && f.statusText === "OK" ? (console.log(`Successful PUT to ${d.href}`), a) : (a.error = await y(f), console.log(`Failed PUT to ${d.href}`), console.log(a.error), a.status = 500, a.result = !1, a);
1911
1914
  } catch (f) {
1912
- n.error = f.message, n.status = 500, n.result = !1, console.log(f.message);
1915
+ a.error = f.message, a.status = 500, a.result = !1, console.log(f.message);
1913
1916
  }
1914
- return n;
1917
+ return a;
1915
1918
  }
1916
- async function mt(a, s, r, t, e) {
1917
- let n = new m();
1919
+ async function mt(n, s, r, t, e) {
1920
+ let a = new m();
1918
1921
  if (r.id === "" || t == "")
1919
- return n.result = !1, n.error = "configGet: invalid config ID", n.status = 500, n;
1922
+ return a.result = !1, a.error = "configGet: invalid config ID", a.status = 500, a;
1920
1923
  let o = null;
1921
1924
  o = new URL(w.configEndpoint());
1922
- let i = { method: "GET", headers: await b(a, s) };
1925
+ let i = { method: "GET", headers: await b(n, s) };
1923
1926
  try {
1924
1927
  console.log("Attempting GET from /config: " + o.href);
1925
1928
  let l = await fetch(`${o.href}/${r.id}`, i);
@@ -1927,55 +1930,55 @@ async function mt(a, s, r, t, e) {
1927
1930
  console.log("Successful GET from /config");
1928
1931
  let u = await l.json();
1929
1932
  return {
1930
- ...n,
1933
+ ...a,
1931
1934
  array: [u]
1932
1935
  };
1933
1936
  } else
1934
- return n.error = await y(l), console.log(`Failed GET from ${o.href}`), console.log(n.error), n.status = 500, n.result = !1, n;
1937
+ return a.error = await y(l), console.log(`Failed GET from ${o.href}`), console.log(a.error), a.status = 500, a.result = !1, a;
1935
1938
  } catch (l) {
1936
- n.error = l.message, n.status = 500, n.result = !1, console.log(l.message);
1939
+ a.error = l.message, a.status = 500, a.result = !1, console.log(l.message);
1937
1940
  }
1938
- return n;
1941
+ return a;
1939
1942
  }
1940
- async function yt(a, s, r, t, e) {
1941
- let n = new m();
1943
+ async function yt(n, s, r, t, e) {
1944
+ let a = new m();
1942
1945
  if (r.id === "" || t == "")
1943
- return n.result = !1, n.error = "configPost: invalid config ID", n.status = 500, n;
1946
+ return a.result = !1, a.error = "configPost: invalid config ID", a.status = 500, a;
1944
1947
  let o = null;
1945
1948
  o = new URL(w.configEndpoint()), o.searchParams.append("configurationId", r.id);
1946
- let i = { method: "DELETE", headers: await b(a, s) };
1949
+ let i = { method: "DELETE", headers: await b(n, s) };
1947
1950
  try {
1948
1951
  console.log("Attempting DELETE from /config: " + o.href);
1949
1952
  let l = await fetch(o.href, i);
1950
- return l.status === 200 && l.statusText === "OK" ? (console.log("Successful DELETE from /config"), n) : (n.error = await y(l), console.log(`Failed DELETE from ${o.href}`), console.log(n.error), n.status = 500, n.result = !1, n);
1953
+ return l.status === 200 && l.statusText === "OK" ? (console.log("Successful DELETE from /config"), a) : (a.error = await y(l), console.log(`Failed DELETE from ${o.href}`), console.log(a.error), a.status = 500, a.result = !1, a);
1951
1954
  } catch (l) {
1952
- n.error = l.message, n.status = 500, n.result = !1, console.log(l.message);
1955
+ a.error = l.message, a.status = 500, a.result = !1, console.log(l.message);
1953
1956
  }
1954
- return n;
1957
+ return a;
1955
1958
  }
1956
- async function wt(a, s, r, t, e) {
1957
- let n = new m();
1959
+ async function wt(n, s, r, t, e) {
1960
+ let a = new m();
1958
1961
  if (r === "")
1959
- return n.result = !1, n.error = "configPatch: invalid config ID", n.status = 500, n;
1962
+ return a.result = !1, a.error = "configPatch: invalid config ID", a.status = 500, a;
1960
1963
  let o = w.configEnabledEndpoint(), d = new URL(o);
1961
1964
  d.searchParams.append("configurationId", r), d.searchParams.append("isEnabled", t.toString());
1962
- let l = { method: "PATCH", headers: await b(a, s) };
1965
+ let l = { method: "PATCH", headers: await b(n, s) };
1963
1966
  try {
1964
1967
  if (e) debugger;
1965
1968
  console.log("Attempting PATCH to /config: " + d.href);
1966
1969
  let u = await fetch(d.href, l);
1967
- return u.status === 200 && u.statusText === "OK" ? (console.log(`Successful PATCH to ${d.href}: ${t.toString()}`), n) : (n.error = await y(u), console.log(`Failed PATCH to ${d.href}: ${t.toString()}`), console.log(n.error), n.status = 500, n.result = !1, n);
1970
+ return u.status === 200 && u.statusText === "OK" ? (console.log(`Successful PATCH to ${d.href}: ${t.toString()}`), a) : (a.error = await y(u), console.log(`Failed PATCH to ${d.href}: ${t.toString()}`), console.log(a.error), a.status = 500, a.result = !1, a);
1968
1971
  } catch (u) {
1969
- n.error = u.message, n.status = 500, n.result = !1, console.log(u.message);
1972
+ a.error = u.message, a.status = 500, a.result = !1, console.log(u.message);
1970
1973
  }
1971
- return n;
1974
+ return a;
1972
1975
  }
1973
- async function Tt(a, s, r, t, e) {
1974
- let n = new m();
1976
+ async function Tt(n, s, r, t, e) {
1977
+ let a = new m();
1975
1978
  if (r.id === "")
1976
- return n.result = !1, n.error = "configPost: invalid config ID", n.status = 500, n;
1979
+ return a.result = !1, a.error = "configPost: invalid config ID", a.status = 500, a;
1977
1980
  let o = w.configEndpoint();
1978
- const d = await b(a, s);
1981
+ const d = await b(n, s);
1979
1982
  let i = `
1980
1983
  {
1981
1984
  "workspaceId": "${t}",
@@ -2005,20 +2008,20 @@ async function Tt(a, s, r, t, e) {
2005
2008
  let f = await u.json();
2006
2009
  return r.id = typeof f == "object" && f !== null && f.id ? f.id : f, console.log(
2007
2010
  `Successful ConfigID: ${r.id} from POST to /config: ${i}`
2008
- ), n;
2011
+ ), a;
2009
2012
  } else
2010
- return n.error = await y(u), console.log(`Failed PUT to /config: ${i}`), console.log(n.error), n.status = 500, n.result = !1, n;
2013
+ return a.error = await y(u), console.log(`Failed PUT to /config: ${i}`), console.log(a.error), a.status = 500, a.result = !1, a;
2011
2014
  } catch (u) {
2012
- return n.status = 500, n.result = !1, n.error = u.message, console.log(n.error), n;
2015
+ return a.status = 500, a.result = !1, a.error = u.message, console.log(a.error), a;
2013
2016
  }
2014
2017
  }
2015
- async function St(a, s, r, t) {
2018
+ async function St(n, s, r, t) {
2016
2019
  let e = new m();
2017
2020
  if (r.id === "")
2018
2021
  return e.result = !1, e.error = "configPost: invalid config ID", e.status = 500, e;
2019
- let n = w.configEndpoint(), o = new URL(n);
2022
+ let a = w.configEndpoint(), o = new URL(a);
2020
2023
  o.searchParams.append("configurationId", r.id);
2021
- const d = await b(a, s);
2024
+ const d = await b(n, s);
2022
2025
  let i = `
2023
2026
  {
2024
2027
  "name": "${r.name}",
@@ -2058,13 +2061,13 @@ async function St(a, s, r, t) {
2058
2061
  }
2059
2062
  return e;
2060
2063
  }
2061
- async function bt(a, s, r, t) {
2064
+ async function bt(n, s, r, t) {
2062
2065
  let e = new m();
2063
2066
  if (r === "")
2064
2067
  return e.result = !1, e.status = 500, e.error = "configsGet: no workspace provided", e;
2065
- let n = w.configsEndpoint(), o = new URL(n);
2068
+ let a = w.configsEndpoint(), o = new URL(a);
2066
2069
  o.searchParams.append("workspaceId", r);
2067
- let i = { method: "GET", headers: await b(a, s) };
2070
+ let i = { method: "GET", headers: await b(n, s) };
2068
2071
  try {
2069
2072
  if (t) debugger;
2070
2073
  console.log("Attempting GET from /configurations: " + o.href);
@@ -2079,13 +2082,13 @@ async function bt(a, s, r, t) {
2079
2082
  }
2080
2083
  return e;
2081
2084
  }
2082
- async function hs(a, s, r, t) {
2085
+ async function hs(n, s, r, t) {
2083
2086
  let e = new m();
2084
2087
  if (!r)
2085
2088
  return e.result = !1, e.status = 500, e.error = "workspaceConfigsGet: no workspace provided", e;
2086
- let n = w.workspaceConfigsEndpoint(), o = new URL(n);
2089
+ let a = w.workspaceConfigsEndpoint(), o = new URL(a);
2087
2090
  o.searchParams.append("workspaceId", r);
2088
- let i = { method: "GET", headers: await b(a, s) };
2091
+ let i = { method: "GET", headers: await b(n, s) };
2089
2092
  try {
2090
2093
  if (t) debugger;
2091
2094
  console.log("Attempting GET from /workspaceConfigs: " + o.href);
@@ -2110,12 +2113,12 @@ async function hs(a, s, r, t) {
2110
2113
  }
2111
2114
  return e;
2112
2115
  }
2113
- async function It(a, s, r) {
2116
+ async function It(n, s, r) {
2114
2117
  let t = new m();
2115
2118
  if (s.companyName === "" || s.companyDomain === "")
2116
2119
  return t.result = !1, t.error = "initPost: invalid company name or domain", t.status = 500, t;
2117
2120
  let e = w.initEndpoint();
2118
- const n = await b(a, s);
2121
+ const a = await b(n, s);
2119
2122
  let o = `
2120
2123
  {
2121
2124
  "tenantCreateModel": {
@@ -2125,7 +2128,7 @@ async function It(a, s, r) {
2125
2128
  "type": "aad",
2126
2129
  "authority": "${s.authority}"
2127
2130
  }
2128
- }`, d = { method: "POST", headers: n, body: o };
2131
+ }`, d = { method: "POST", headers: a, body: o };
2129
2132
  try {
2130
2133
  if (r) debugger;
2131
2134
  console.log("Attempting POST to /configuration/init: " + e);
@@ -2136,29 +2139,29 @@ async function It(a, s, r) {
2136
2139
  }
2137
2140
  return t.status = 500, t.result = !1, t;
2138
2141
  }
2139
- async function $t(a, s, r, t, e) {
2140
- let n = new m();
2142
+ async function $t(n, s, r, t, e) {
2143
+ let a = new m();
2141
2144
  if (r.tid === "" || t === "")
2142
- return n.result = !1, n.error = "tenantDelete: invalid tid, workspaceId", n.status = 500, n;
2145
+ return a.result = !1, a.error = "tenantDelete: invalid tid, workspaceId", a.status = 500, a;
2143
2146
  let o = new URL(w.tenantEndpoint());
2144
2147
  o.searchParams.append("tenantId", r.tid), o.searchParams.append("workspaceId", t);
2145
- let i = { method: "DELETE", headers: await b(a, s) };
2148
+ let i = { method: "DELETE", headers: await b(n, s) };
2146
2149
  try {
2147
2150
  console.log("Attempting DELETE from /tenant: " + o.href);
2148
2151
  let l = await fetch(o.href, i);
2149
- return l.status === 200 && l.statusText === "OK" ? (console.log(`Successful DELETE from /tenant: ${o.href}`), n) : (console.log(`Failed DELETE from /tenant: ${o.href}`), n.error = await y(l), console.log(n.error), n.status = 500, n.result = !1, n);
2152
+ return l.status === 200 && l.statusText === "OK" ? (console.log(`Successful DELETE from /tenant: ${o.href}`), a) : (console.log(`Failed DELETE from /tenant: ${o.href}`), a.error = await y(l), console.log(a.error), a.status = 500, a.result = !1, a);
2150
2153
  } catch (l) {
2151
- n.error = l.message, n.status = 500, n.result = !1, console.log(n.error);
2154
+ a.error = l.message, a.status = 500, a.result = !1, console.log(a.error);
2152
2155
  }
2153
- return n;
2156
+ return a;
2154
2157
  }
2155
- async function At(a, s, r, t) {
2158
+ async function At(n, s, r, t) {
2156
2159
  let e = new m();
2157
2160
  if (r === "")
2158
2161
  return e.result = !1, e.status = 500, e.error = "tenantsGet: no workspace provided", e;
2159
- let n = w.tenantsEndpoint(), o = new URL(n);
2162
+ let a = w.tenantsEndpoint(), o = new URL(a);
2160
2163
  o.searchParams.append("workspaceId", r);
2161
- let i = { method: "GET", headers: await b(a, s) };
2164
+ let i = { method: "GET", headers: await b(n, s) };
2162
2165
  try {
2163
2166
  if (t) debugger;
2164
2167
  console.log(`Attempting GET from /tenants: ${o.href}`);
@@ -2173,13 +2176,13 @@ async function At(a, s, r, t) {
2173
2176
  }
2174
2177
  return e;
2175
2178
  }
2176
- async function kt(a, s, r, t) {
2179
+ async function kt(n, s, r, t) {
2177
2180
  let e = new m();
2178
2181
  if (r.tid === "" || r.name === "" || r.domain === "")
2179
2182
  return e.result = !1, e.error = "tenantPost: invalid tid, name, domain", e.status = 500, e;
2180
- let n = w.tenantEndpoint(), o = new URL(n);
2183
+ let a = w.tenantEndpoint(), o = new URL(a);
2181
2184
  o.searchParams.append("workspaceId", t);
2182
- const d = await b(a, s);
2185
+ const d = await b(n, s);
2183
2186
  let i = `
2184
2187
  {"tenantId": "${r.tid}",
2185
2188
  "name": "${r.name}",
@@ -2196,13 +2199,13 @@ async function kt(a, s, r, t) {
2196
2199
  }
2197
2200
  return e;
2198
2201
  }
2199
- async function Et(a, s, r, t) {
2202
+ async function Et(n, s, r, t) {
2200
2203
  let e = new m();
2201
2204
  if (r == "" || t == "")
2202
2205
  return e.result = !1, e.error = "workspacePut: invalid workspace ID or name", e.status = 500, e;
2203
- let n = w.workspaceEndpoint(), o = new URL(n);
2206
+ let a = w.workspaceEndpoint(), o = new URL(a);
2204
2207
  o.searchParams.append("workspaceId", r), o.searchParams.append("workspaceName", t);
2205
- let i = { method: "PUT", headers: await b(a, s) };
2208
+ let i = { method: "PUT", headers: await b(n, s) };
2206
2209
  try {
2207
2210
  console.log("Attempting PUT to /workspace: " + o.href);
2208
2211
  let l = await fetch(o.href, i);
@@ -2212,35 +2215,35 @@ async function Et(a, s, r, t) {
2212
2215
  }
2213
2216
  return e;
2214
2217
  }
2215
- async function Dt(a, s, r) {
2218
+ async function Dt(n, s, r) {
2216
2219
  let t = new m();
2217
2220
  if (s.mail == null || s.mail == "")
2218
2221
  return t.result = !1, t.status = 500, t.error = "adminsGet: no workspace provided", t;
2219
- let e = w.workspacesEndpoint(), n = new URL(e), d = { method: "GET", headers: await b(a, s) };
2222
+ let e = w.workspacesEndpoint(), a = new URL(e), d = { method: "GET", headers: await b(n, s) };
2220
2223
  try {
2221
2224
  if (r) debugger;
2222
- console.log("Attempting GET from /workspaces endpoint: " + n.href);
2223
- let i = await fetch(n.href, d);
2225
+ console.log("Attempting GET from /workspaces endpoint: " + a.href);
2226
+ let i = await fetch(a.href, d);
2224
2227
  if (i.status === 200 && i.statusText === "OK") {
2225
2228
  let l = await i.json();
2226
2229
  return l != null ? (t.array = l, console.log(`Successful GET from /workspaces: ${t.array.reduce((f, I) => f + I.name + " ", "")}`), t) : (t.error = "Failed GET from /workspaces: failed to JSON-parse response", console.log(t.error), t.status = 500, t.result = !1, t);
2227
2230
  } else
2228
- return console.log(`Failed GET from /workspaces: ${n.href}`), t.error = await y(i), t.status = 500, t.result = !1, console.log(t.error), t;
2231
+ return console.log(`Failed GET from /workspaces: ${a.href}`), t.error = await y(i), t.status = 500, t.result = !1, console.log(t.error), t;
2229
2232
  } catch (i) {
2230
2233
  t.error = i.message, t.status = 500, t.result = !1, console.log(i.message);
2231
2234
  }
2232
2235
  return t;
2233
2236
  }
2234
- async function Pt(a, s, r) {
2237
+ async function Pt(n, s, r) {
2235
2238
  let t = new m();
2236
- if (a == null || s == null)
2239
+ if (n == null || s == null)
2237
2240
  return t.result = !1, t.error = "readerPost: invalid parameters", t.status = 500, t;
2238
- let e = w.readerStartSyncEndpoint(), n = new URL(e);
2239
- n.searchParams.append("configurationId", r.id);
2240
- let d = { method: "POST", headers: await b(a, s) };
2241
+ let e = w.readerStartSyncEndpoint(), a = new URL(e);
2242
+ a.searchParams.append("configurationId", r.id);
2243
+ let d = { method: "POST", headers: await b(n, s) };
2241
2244
  try {
2242
- console.log("Attempting POST to /startSync: " + n.href);
2243
- let i = await fetch(n.href, d);
2245
+ console.log("Attempting POST to /startSync: " + a.href);
2246
+ let i = await fetch(a.href, d);
2244
2247
  if (i.status === 200 && i.statusText === "OK") {
2245
2248
  console.log(`Successful POST to /startSync: ${e}`);
2246
2249
  let l = await i.json();
@@ -2252,14 +2255,14 @@ async function Pt(a, s, r) {
2252
2255
  }
2253
2256
  return t;
2254
2257
  }
2255
- async function gs(a, s, r) {
2258
+ async function gs(n, s, r) {
2256
2259
  let t = new m();
2257
- if (a == null || s == null)
2260
+ if (n == null || s == null)
2258
2261
  return t.result = !1, t.error = "readerPost: invalid parameters", t.status = 500, t;
2259
- let e = w.statsEndpoint(), n = new URL(`${e}/${r}`), d = { method: "GET", headers: await b(a, s) };
2262
+ let e = w.statsEndpoint(), a = new URL(`${e}/${r}`), d = { method: "GET", headers: await b(n, s) };
2260
2263
  try {
2261
- console.log("Attempting GET to /stats: " + n.href);
2262
- let i = await fetch(n.href, d);
2264
+ console.log("Attempting GET to /stats: " + a.href);
2265
+ let i = await fetch(a.href, d);
2263
2266
  if (i.status === 200 && i.statusText === "OK") {
2264
2267
  console.log(`Successful GET to /stats: ${e}`);
2265
2268
  let l = await i.json();
@@ -2282,7 +2285,7 @@ export {
2282
2285
  He as MilestoneArray,
2283
2286
  ke as ResourceArray,
2284
2287
  qe as ResourceNode,
2285
- ne as SyncConfig,
2288
+ ae as SyncConfig,
2286
2289
  se as Task,
2287
2290
  Ft as TaskArray,
2288
2291
  H as Tenant,
@@ -2293,7 +2296,7 @@ export {
2293
2296
  Be as TenantType,
2294
2297
  re as User,
2295
2298
  Ot as UserScope,
2296
- ae as Workspace,
2299
+ ne as Workspace,
2297
2300
  ot as adminDelete,
2298
2301
  lt as adminPost,
2299
2302
  it as adminsGet,
@@ -2320,7 +2323,7 @@ export {
2320
2323
  wt as configPatch,
2321
2324
  Tt as configPost,
2322
2325
  St as configPut,
2323
- ns as configRemove,
2326
+ as as configRemove,
2324
2327
  bt as configsGet,
2325
2328
  rs as configsRefresh,
2326
2329
  ps as elevateGlobalAdminToUserAccessAdmin,
@@ -2329,7 +2332,7 @@ export {
2329
2332
  p as graphConfig,
2330
2333
  _t as groupsGet,
2331
2334
  xt as helloNpm,
2332
- as as initGet,
2335
+ ns as initGet,
2333
2336
  It as initPost,
2334
2337
  w as mindlineConfig,
2335
2338
  Ve as oauth2PermissionGrantsGet,