@mindline/sync 1.0.99 → 1.0.100

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