@mindline/sync 1.0.106 → 1.0.107

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