@mindline/sync 1.0.106 → 1.0.108

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 (33) 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 +9 -5
  22. package/dist/sync.es.js +849 -789
  23. package/dist/sync.es.js.map +1 -1
  24. package/dist/sync.umd.js +25 -21
  25. package/dist/sync.umd.js.map +1 -1
  26. package/package.json +1 -1
  27. package/src/index.d.ts +14 -14
  28. package/src/index.ts +231 -60
  29. package/.vs/sync/FileContentIndex/0d08f64f-8fd9-4bd4-90fc-8322cb33dd00.vsidx +0 -0
  30. package/.vs/sync/FileContentIndex/5d404a65-c534-43ee-beba-a5efbe6a49b0.vsidx +0 -0
  31. package/.vs/sync/FileContentIndex/63524bf8-437e-4a1c-951f-7a78da75a1bc.vsidx +0 -0
  32. package/.vs/sync/FileContentIndex/f95b6302-8444-443b-9e3b-a41d3483c73a.vsidx +0 -0
  33. /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) => {
1
+ var Pe = Object.defineProperty;
2
+ var Ie = (a) => {
3
3
  throw TypeError(a);
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 ve = (a, s, r) => s in a ? Pe(a, s, { enumerable: !0, configurable: !0, writable: !0, value: r }) : a[s] = r;
6
+ var c = (a, s, r) => ve(a, typeof s != "symbol" ? s + "" : s, r), Re = (a, s, r) => s.has(a) || Ie("Cannot " + r);
7
+ var J = (a, s, r) => s.has(a) ? Ie("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(a) : s.set(a, r);
8
+ var O = (a, s, r) => (Re(a, s, "access private method"), r);
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(a, s) {
144
+ return a + 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.108";
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__ */ ((a) => (a[a.invalid = 0] = "invalid", a[a.aad = 1] = "aad", a[a.ad = 2] = "ad", a[a.googleworkspace = 3] = "googleworkspace", a))(Be || {}), Ue = /* @__PURE__ */ ((a) => (a[a.read = 1] = "read", a[a.write = 2] = "write", a[a.notassigned = 3] = "notassigned", a))(Ue || {});
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,20 +301,20 @@ 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) {
304
+ function _e(a, s) {
302
305
  switch (a) {
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) {
317
+ function F(a) {
315
318
  switch (a) {
316
319
  case p.authorityWW:
317
320
  return "https://graph.microsoft.com/";
@@ -324,7 +327,7 @@ function N(a) {
324
327
  return "";
325
328
  }
326
329
  }
327
- function Oe(a) {
330
+ function Le(a) {
328
331
  switch (a) {
329
332
  case p.authorityWW:
330
333
  return "https://login.microsoftonline.com/";
@@ -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__ */ ((a) => (a[a.source = 1] = "source", a[a.target = 2] = "target", a[a.sourcetarget = 3] = "sourcetarget", a))(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 ne {
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 ae {
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() {
403
+ function N() {
401
404
  let a;
402
405
  try {
403
406
  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
407
+ const s = "__storage_test__";
408
+ return a.setItem(s, s), a.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
414
+ s.name === "QuotaExceededError" || // Firefox
415
+ s.name === "NS_ERROR_DOM_QUOTA_REACHED") && // acknowledge QuotaExceededError only if there's something already stored
413
416
  a && a.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), n = 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(ne, e), this.ws = U(ae, n), 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 ne();
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 ae();
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();
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 n = new se();
605
608
  return n.id = e.id, n.task = e.task, n.setStart(new Date(e.start)), n.setEnd(new Date(e.end)), n.expected = e.expected, n.status = e.status, n.expanded = e.expanded, n;
606
- })), s;
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
+ 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 n = new M(e.Run);
701
704
  return n.Start = e.Start, n.startDisplay = e.startDisplay, n.POST = e.POST, n.postDisplay = e.postDisplay, n.Read = e.Read, n.readDisplay = e.readDisplay, n.Write = e.Write, n.writeDisplay = e.writeDisplay, n.Duration = e.Duration, n.durationDisplay = e.durationDisplay, n;
702
- }), t(this.milestones), console.log(`Start milestone: ${this.milestones[0].Run}:${this.milestones[0].Start}`);
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,19 +761,19 @@ 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
772
  let n = r.ts.find(
770
773
  (o) => o.tid === e.tid
771
774
  );
772
775
  if (n != null) {
773
- let o = new me(
776
+ let o = new $e(
774
777
  e.tid,
775
778
  n.name,
776
779
  e.batchId
@@ -778,20 +781,20 @@ class Gt {
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) => {
791
+ s.tenants.map((n) => {
789
792
  if ((n.configurationTenantType === "target" || n.configurationTenantType === "sourcetarget") && n.tid !== e.tid) {
790
793
  let o = r.ts.find(
791
794
  (d) => d.tid === n.tid
792
795
  );
793
796
  if (o != null) {
794
- let d = new me(
797
+ let d = new $e(
795
798
  n.tid,
796
799
  o.name,
797
800
  n.batchId
@@ -799,7 +802,7 @@ class Gt {
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, n, 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, v = Object.keys(ue), C = Object.values(ue), X = !1, fe = !1;
842
+ for (let g = 0; g < v.length; g++) {
843
+ let P = v[g].endsWith("TotalCount"), L = v[g].endsWith("CurrentCount"), z = v[g].endsWith("ExtCount"), K = v[g].endsWith("DeferredCount"), ee = v[g].endsWith("RescheduledCount");
844
+ if (z && (h.excluded = Math.max(Number(C[g]), h.excluded), h.targets.map((T) => {
845
+ T.excluded = h.excluded, T.update(T.total, T.read, T.excluded, T.written, T.deferred);
846
+ })), P && (X = Number(C[g]) == 0, h.total = Math.max(Number(C[g]), h.total), h.targets.map((T) => {
847
+ T.total = h.total, T.update(T.total, T.read, T.excluded, T.written, T.deferred);
848
+ })), v[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/), v[g].match(T) == null) {
851
+ console.log(`tid not found in ${v[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
+ P ? (X = Number(C[g]) == 0, h.total = Math.max(Number(C[g]), h.total), console.log(`----- ${h.name} TID: ${h.tid} batchId: ${h.batchId}`), console.log(`----- ${h.name} Total To Read: ${h.total}`)) : (fe = Number(C[g]) == 0, L ? (h.read = Math.max(Number(C[g]), h.read), console.log(`----- ${h.name} Currently Read: ${h.read}`)) : K && (h.deferred = Math.max(Number(C[g]), h.deferred), console.log(`----- ${h.name} Deferred: ${h.deferred}`)));
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, v[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 = v[g].match(T);
861
+ if (te == null) {
862
+ console.log(`tid not found in ${v[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, P)
873
+ S.total = Math.max(Number(P), S.total), console.log(`----- ${S.name} TID: ${S.tid} batchId: ${S.batchId}`), console.log(`----- ${S.name} Total To Write: ${S.total}`);
874
+ 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((P) => {
890
+ he && (he = P.status == "complete" || P.status == "failed"), ge || (ge = P.total > 0 || P.status != "not started"), Te += Math.max(P.total, g.total), Se += P.written, be += P.excluded;
891
+ }), me && (me = g.nothingtosync), pe && (pe = g.status == "complete" || g.status == "failed"), Y += g.total, ye += g.read, we += g.excluded;
892
+ }), n(Y), d(ye), o(we), i(Math.max(Te, Y)), u(Se), l(be), me)
893
+ this.milestoneArray.write(f), x.stop(), I("nothing to sync"), console.log('Setting config sync result: "nothing to sync"');
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 Pt(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, n) {
944
+ this.total = s, this.read = r, this.excluded = t, this.written = e, this.deferred = n, this.read === 0 && this.written === 0 && (this.status = "not started"), this.read > 0 ? this.read + this.excluded < this.total ? this.status = "in progress" : this.read + this.excluded === this.total && (this.status = "complete") : this.written > 0 && (this.written + this.deferred + this.excluded < this.total ? this.status = "in progress" : this.written + this.deferred + this.excluded === this.total ? this.status = "complete" : this.written + this.deferred + this.excluded >= this.total && (this.status = "failed"));
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);
960
+ let n = JSON.parse(t);
953
961
  this.resourceNodes = n.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 nt(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);
1008
+ let n = JSON.parse(t);
1001
1009
  this.actorNodes = n.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, n, o) {
1015
1023
  c(this, "type");
1016
1024
  c(this, "actor");
1017
1025
  c(this, "resource");
@@ -1019,57 +1027,57 @@ 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 = n, this.updatedon = o, this.actors = new Array();
1023
1031
  }
1024
1032
  }
1025
- function ze(a) {
1033
+ function Je(a) {
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(a, 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
1042
  let e = await a.acquireTokenByCode({
1035
- code: t.spacode
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 = a.getAllAccounts(), n = s.oid + "." + s.tid, o = null;
1044
1052
  for (let i = 0; i < e.length; i++)
1045
1053
  e[i].homeAccountId == n && (o = e[i]);
1046
1054
  let d = await a.acquireTokenSilent({
1047
- scopes: [s],
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;
1062
+ let n = a.getAllAccounts(), o = s.oid + "." + s.tid, d = null;
1055
1063
  for (let i = 0; i < n.length; i++)
1056
1064
  n[i].homeAccountId == o && (d = n[i]);
1057
1065
  a.acquireTokenRedirect({
1058
- scopes: [s],
1066
+ scopes: [t],
1059
1067
  account: d
1060
1068
  });
1061
1069
  } catch (n) {
1062
1070
  console.log("Front end graph token redirect acquisition failure: " + n);
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(a, 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(a, s) };
1071
1079
  try {
1072
- let n = N(t.authority) + p.graphGroupsPredicate;
1080
+ let n = F(s.authority) + p.graphGroupsPredicate;
1073
1081
  n += `/?$filter=startsWith(displayName, '${r}')`;
1074
1082
  let d = await (await fetch(n, e)).json();
1075
1083
  return typeof d.error < "u" ? { groups: [], error: `${d.error.code}: ${d.error.message}` } : { groups: d.value, error: "" };
@@ -1077,10 +1085,10 @@ async function xt(a, t, r) {
1077
1085
  return console.log(n), { groups: [], error: `Exception: ${n}` };
1078
1086
  }
1079
1087
  }
1080
- async function Me(a, t, r, s) {
1088
+ async function Ve(a, 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}'`);
1090
+ let e = F(s.authority) + p.graphOauth2PermissionGrantsPredicate, n = new URL(e);
1091
+ n.searchParams.append("$filter", `resourceId eq '${r}' and consentType eq 'Principal' and principalId eq '${t}'`);
1084
1092
  let d = await (await fetch(n.href, a)).json();
1085
1093
  if (typeof d.error < "u")
1086
1094
  return { grants: null, id: null, error: `${d.error.code}: ${d.error.message}` };
@@ -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(a, 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 n = `{ "scope": "${t}" }`, d = { method: "PATCH", headers: await Q(a, s), body: n }, 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,28 +1117,28 @@ 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);
1120
+ function Lt(a, s) {
1121
+ let r = Le(a.authority);
1114
1122
  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);
1123
+ let t = new URL(r), e = _e(a.authority, s);
1124
+ t.searchParams.append("client_id", e), t.searchParams.append("redirect_uri", window.location.origin), t.searchParams.append("domain_hint", a.companyDomain), t.searchParams.append("login_hint", a.mail), window.location.assign(t.href);
1117
1125
  }
1118
- async function He(a, t, r) {
1126
+ async function Qe(a, 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
1132
  let o = await (await fetch(e.href, a)).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) {
1138
+ async function zt(a, s) {
1131
1139
  if (a.authority == "") {
1132
- let e = new L();
1133
- if (e.domain = a.tid, await Te(e, !1))
1140
+ let e = new H();
1141
+ if (e.domain = a.tid, await Ee(e, !1))
1134
1142
  a.authority = e.authority;
1135
1143
  else {
1136
1144
  debugger;
@@ -1151,17 +1159,17 @@ 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);
1162
+ let t = new URL(r);
1163
+ if (t.searchParams.append("redirectUri", window.location.origin), a.oid !== "1") {
1164
+ t.searchParams.append("loginHint", a.mail);
1157
1165
  const e = /@([a-zA-Z0-9.-]+\.[a-zA-Z]{2,})$/, n = a.mail.match(e);
1158
1166
  let o = n ? n[1] : "organizations";
1159
- s.searchParams.append("domainHint", o);
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(a, s) {
1165
1173
  debugger;
1166
1174
  if (a.oid == "1") return;
1167
1175
  let r = window.location.href;
@@ -1178,16 +1186,16 @@ 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", a.mail), window.location.assign(t.href);
1183
1191
  }
1184
- async function Ft(a) {
1192
+ async function jt(a) {
1185
1193
  if (a.oid == "1") return !1;
1186
- let t = window.location.href;
1187
- t += "user";
1188
- let r = new URL(t);
1194
+ let s = window.location.href;
1195
+ s += "user";
1196
+ let r = new URL(s);
1189
1197
  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);
1198
+ let t = { method: "PATCH" }, e = await fetch(r.href, t);
1191
1199
  if (e.status == 200 && e.statusText == "OK")
1192
1200
  console.log(`Successfully set admin ${a.mail} logout_hint`);
1193
1201
  else
@@ -1208,9 +1216,9 @@ async function Ft(a) {
1208
1216
  }
1209
1217
  return r = new URL(n), 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;
1219
+ async function Ht(a, s, r, t) {
1220
+ if (t) debugger;
1221
+ if (s.name != null && s.name !== "") return !1;
1214
1222
  if (a.graphAccessToken != null && a.graphAccessToken === "") {
1215
1223
  console.log(`tenantRelationshipsGetByDomain called with invalid logged in user: ${a.name}`);
1216
1224
  try {
@@ -1224,8 +1232,8 @@ async function Bt(a, t, r, s) {
1224
1232
  e.append("Authorization", n);
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,11 +1251,11 @@ 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(a, s, r, t, e) {
1247
1255
  if (console.log("**** tenantRelationshipsGetById"), e) debugger;
1248
1256
  if (a.graphAccessToken === "")
1249
1257
  try {
1250
- let l = await s.acquireTokenByCode({ code: a.spacode, scopes: ["user.read", "contacts.read", "CrossTenantInformation.ReadBasic.All"] });
1258
+ let l = await t.acquireTokenByCode({ code: a.spacode, scopes: ["user.read", "contacts.read", "CrossTenantInformation.ReadBasic.All"] });
1251
1259
  a.graphAccessToken = l.accessToken, console.log("tenantRelationshipsGetById: Front end token acquired: " + a.graphAccessToken.slice(0, 20));
1252
1260
  } catch (l) {
1253
1261
  return console.log("tenantRelationshipsGetById: Front end token failure: " + l), !1;
@@ -1256,12 +1264,12 @@ async function qe(a, t, r, s, e) {
1256
1264
  n.append("Authorization", o);
1257
1265
  let d = { method: "GET", headers: n };
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(a.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,9 +1282,9 @@ 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(a, 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
1290
  var n = r[i];
@@ -1285,7 +1293,7 @@ async function Te(a, t) {
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
1298
  return a.tid = d[2], a.authority = d[1], console.log(`Successful GET from openid well-known endpoint: tid: ${a.tid} authority: ${a.authority}`), !0;
1291
1299
  }
@@ -1299,22 +1307,22 @@ async function Te(a, t) {
1299
1307
  }
1300
1308
  return (a.tid == "" || a.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(a, 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(a, 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: n, 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}` };
@@ -1325,31 +1333,31 @@ async function Ke(a, t, r) {
1325
1333
  return console.log(n), { scopes: null, id: null, error: `Exception: ${n}` };
1326
1334
  }
1327
1335
  }
1328
- async function Ut(a, t, r, s) {
1329
- if (t == null || t.spacode == "" || r == null) {
1336
+ async function qt(a, 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: n, error: o } = await Ye(a, 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(a, s, n, 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(a, 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(a, 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,180 +1368,176 @@ 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(a, s, r, t) {
1372
+ return ct(a, s, r, t);
1365
1373
  }
1366
- async function zt(a, t, r, s) {
1367
- return rt(a, t, r, s);
1374
+ async function Vt(a, s, r, t) {
1375
+ return dt(a, 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(a, s, r, t, e) {
1378
+ return ut(a, 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(a, s, r, t) {
1381
+ return ft(a, s, r, t);
1374
1382
  }
1375
- async function Ht(a, t, r) {
1376
- return ot(a, t, r);
1383
+ async function Xt(a, s, r) {
1384
+ return pt(a, s, r);
1377
1385
  }
1378
- async function qt(a, t, r, s, e, n, o, d) {
1386
+ async function Yt(a, s, r, t, e, n, 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(a, s, r, n.id, d), i.result) {
1390
+ r.tenants.forEach((f) => {
1391
+ (f.configId === "1" || f.configId === "") && (f.configId = r.id);
1392
+ }), t && t(r.id);
1383
1393
  const l = {};
1384
1394
  Object.defineProperty(l, r.id, { value: !0, writable: !0, enumerable: !0 }), e(l);
1385
1395
  let u = n.associatedConfigs.findIndex((f) => f == "1");
1386
1396
  u !== -1 && (n.associatedConfigs.splice(u, 1), n.associatedConfigs.push(r.id));
1387
1397
  }
1388
1398
  } else
1389
- i = await ft(a, t, r, d);
1399
+ i = await St(a, s, r, d);
1390
1400
  return o.save(), i;
1391
1401
  }
1392
- async function Kt(a, t, r, s, e) {
1402
+ async function es(a, s, r, t, e) {
1393
1403
  let n = new m();
1394
- return n = await dt(a, t, r, s, e), n;
1404
+ return n = await wt(a, s, r, t, e), n;
1395
1405
  }
1396
- async function Jt(a, t, r, s, e) {
1397
- return it(a, t, r, s, e);
1406
+ async function ts(a, s, r, t, e) {
1407
+ return ht(a, s, r, t, e);
1398
1408
  }
1399
- async function Vt(a, t, r, s, e) {
1400
- return lt(a, t, r, s, e);
1409
+ async function ss(a, s, r, t, e) {
1410
+ return gt(a, s, r, t, e);
1401
1411
  }
1402
- async function Zt(a, t, r, s, e) {
1403
- let n = new m();
1412
+ async function rs(a, s, r, t, e, n) {
1413
+ let o = new m();
1404
1414
  if (e) debugger;
1405
1415
  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;
1416
+ let d = t.ws.find((i) => i.id === r);
1417
+ if (d != null) {
1418
+ d.associatedConfigs.length = 0;
1419
+ let i = await mt(a, s, n, d.id, e);
1420
+ return i.result && (t.tagWithWorkspaces(), localStorage.setItem("BatchIdArray", "{}")), i;
1417
1421
  } 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;
1422
+ return o.result = !1, o.error = "Workspace not found.", o.status = 404, o;
1423
+ } catch (d) {
1424
+ return console.log(d.message), o.error = d.message, o.result = !1, o.status = 500, o;
1421
1425
  }
1422
1426
  }
1423
- async function Qt(a, t, r, s, e) {
1424
- return ct(a, t, r, s);
1427
+ async function ns(a, s, r, t, e) {
1428
+ return yt(a, s, r, t);
1425
1429
  }
1426
- async function Xt(a, t, r, s, e) {
1430
+ async function as(a, s, r, t, e) {
1427
1431
  console.log(">>>>>> initGet");
1428
1432
  let n = new m();
1429
1433
  if (e)
1430
1434
  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);
1435
+ let o = new H();
1436
+ return o.tid = s.tid, o.domain = s.tid, await Ee(o, e) ? (s.authority = o.authority, t.setTaskStart("GET tenant details", /* @__PURE__ */ new Date()), n.result = await Xe(s, o, r, a, e), t.setTaskEnd("GET tenant details", /* @__PURE__ */ new Date(), "complete"), n.result && (s.companyName = o.name, s.companyDomain = o.domain, t.setTaskStart("POST config init", /* @__PURE__ */ new Date()), n = await It(a, s, e), t.setTaskEnd("POST config init", /* @__PURE__ */ new Date(), n.result ? "complete" : "failed")), n.result && (t.setTaskStart("GET workspaces", /* @__PURE__ */ new Date()), n = await rt(a, s, r, e), t.setTaskEnd("GET workspaces", /* @__PURE__ */ new Date(), n.result ? "complete" : "failed")), console.log("initGet complete. Version: " + _()), n) : (n.error = `Failed to retrieve authority for user "${s.mail}" TID ${s.tid}.`, n.result = !1, n);
1433
1437
  }
1434
- async function Yt(a, t, r, s) {
1435
- return wt(a, t, r, s);
1438
+ async function os(a, s, r, t) {
1439
+ return kt(a, s, r, t);
1436
1440
  }
1437
- async function es(a, t, r, s, e) {
1438
- return mt(a, t, r, s);
1441
+ async function is(a, s, r, t, e) {
1442
+ return $t(a, s, r, t);
1439
1443
  }
1440
- async function ts(a, t, r, s) {
1441
- return tt(a, t, r, s);
1444
+ async function ls(a, s, r, t) {
1445
+ return lt(a, s, r, t);
1442
1446
  }
1443
- async function ss(a, t, r, s) {
1444
- return Ye(a, t, r, s);
1447
+ async function cs(a, s, r, t) {
1448
+ return ot(a, s, r, t);
1445
1449
  }
1446
- async function rs(a, t, r, s) {
1447
- return await Tt(a, t, r, s);
1450
+ async function ds(a, s, r, t) {
1451
+ return await Et(a, s, r, t);
1448
1452
  }
1449
- function Je(a, t, r, s) {
1453
+ function et(a, s, r, t) {
1450
1454
  r.map((e) => {
1451
- let n = null, o = t.us.findIndex((l) => l.oid === e.userId || l.oid === e.email);
1455
+ let n = null, o = s.us.findIndex((l) => l.oid === e.userId || l.oid === e.email);
1452
1456
  if (o === -1) {
1453
- let l = t.us.findIndex((u) => u.oid === "1");
1457
+ let l = s.us.findIndex((u) => u.oid === "1");
1454
1458
  if (l !== -1) {
1455
- n = t.us.at(l);
1459
+ n = s.us.at(l);
1456
1460
  let u = a.associatedUsers.findIndex((f) => f == "1");
1457
1461
  u !== -1 && (a.associatedUsers.splice(u, 1), a.associatedUsers.push(e.userId));
1458
1462
  } else
1459
- n = new X(), t.us.push(n);
1463
+ n = new re(), s.us.push(n);
1460
1464
  } 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);
1465
+ n = s.us.at(o);
1466
+ n.sel = t === e.userId, n.oid = e.userId ? e.userId : e.email, n.name = e.firstName ?? n.name, n.mail = e.email, n.tid = e.tenantId;
1467
+ let d = s.ts.find((l) => l.tid === n.tid);
1464
1468
  d != null && (n.authority = d.authority, n.companyName = d.name, n.companyDomain = d.domain), a.associatedUsers.findIndex((l) => l === n.oid) == -1 && a.associatedUsers.push(n.oid);
1465
- }), t.save();
1469
+ }), s.save();
1466
1470
  }
1467
- function Ve(a, t, r, s) {
1471
+ function tt(a, s, r, t) {
1468
1472
  r.map((e) => {
1469
- let n = null, o = t.ts.findIndex((u) => u.tid === e.tenantId);
1473
+ let n = null, o = s.ts.findIndex((u) => u.tid === e.tenantId);
1470
1474
  if (o === -1) {
1471
- let u = t.ts.findIndex((f) => f.tid === "1");
1475
+ let u = s.ts.findIndex((f) => f.tid === "1");
1472
1476
  if (u !== -1) {
1473
- n = t.ts.at(u);
1474
- let f = a.associatedTenants.findIndex(($) => $ == "1");
1477
+ n = s.ts.at(u);
1478
+ let f = a.associatedTenants.findIndex((I) => I == "1");
1475
1479
  f !== -1 && (a.associatedTenants.splice(f, 1), a.associatedTenants.push(e.tenantId));
1476
1480
  } else
1477
- n = new L(), t.ts.push(n);
1481
+ n = new H(), s.ts.push(n);
1478
1482
  } 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();
1483
+ n = s.ts.at(o);
1484
+ n.sel = t === e.tenantId, n.tid = e.tenantId, n.name = e.name, n.domain = e.domain, n.tenantType = e.type.toLowerCase();
1481
1485
  const d = /^(https:\/\/login.microsoftonline.(?:us|com)\/)organizations\/v2.0$/, i = e.authority.match(d);
1482
1486
  n.authority = i ? i[1] : e.authority, a.associatedTenants.findIndex((u) => u === e.tenantId) == -1 && a.associatedTenants.push(e.tenantId);
1483
- }), t.save();
1487
+ }), s.save();
1484
1488
  }
1485
- function Se(a, t, r, s) {
1489
+ function st(a, s, r, t) {
1486
1490
  r.map((e) => {
1487
- let n = null, o = t.cs.findIndex((i) => i.id === e.id);
1491
+ let n = null, o = s.cs.findIndex((i) => i.id === e.id);
1488
1492
  if (o === -1) {
1489
- let i = t.cs.findIndex((l) => l.id === "1");
1493
+ let i = s.cs.findIndex((l) => l.id === "1");
1490
1494
  if (i !== -1) {
1491
- n = t.cs.at(i);
1495
+ n = s.cs.at(i);
1492
1496
  let l = a.associatedConfigs.findIndex((u) => u == "1");
1493
1497
  l !== -1 && (a.associatedConfigs.splice(l, 1), a.associatedConfigs.push(e.id));
1494
1498
  } else
1495
- n = new Y(), t.cs.push(n);
1499
+ n = new ne(), s.cs.push(n);
1496
1500
  } 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();
1501
+ n = s.cs.at(o);
1502
+ n.sel = t === e.id, n.id = e.id, n.workspaceId = e.workspaceId, n.name = e.name, n.description = e.description, n.isEnabled = e.isEnabled, n.tenants.length = 0, e.tenants.map((i) => {
1503
+ let l = new Me();
1500
1504
  l.tid = i.tenantId, l.sourceGroupId = i.sourceGroupId ?? "", l.sourceGroupName = i.sourceGroupName ?? "", l.targetGroupId = i.targetGroupId ?? "", l.targetGroupName = i.targetGroupName ?? "", l.configurationTenantType = i.configurationTenantType.toLowerCase(), l.deltaToken = i.deltaToken ?? "", l.configId = n.id, l.batchId = i.batchId ?? "", l.isReadPermissionConsented = i.isReadPermissionConsented, l.isWritePermissionConsented = i.isWritePermissionConsented, n.tenants.push(l);
1501
1505
  }), a.associatedConfigs.findIndex((i) => i === e.id) == -1 && a.associatedConfigs.push(e.id);
1502
- }), t.save();
1506
+ }), console.log("--------------ii-----------", s), s.save();
1503
1507
  }
1504
- async function Ze(a, t, r, s) {
1508
+ async function rt(a, s, r, t) {
1505
1509
  let e = new m();
1506
- if (s) debugger;
1510
+ if (t) debugger;
1507
1511
  try {
1508
- if (e = await St(a, t, s), e.result) {
1512
+ if (e = await Dt(a, s, t), e.result) {
1509
1513
  for (let n of e.array) {
1510
- let o = null, d = r.ws.findIndex((k) => k.id === n.id);
1514
+ let o = null, d = r.ws.findIndex((E) => E.id === n.id);
1511
1515
  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));
1516
+ let E = r.ws.findIndex((A) => A.id === "1");
1517
+ E !== -1 ? o = r.ws.at(E) : (o = new ae(), r.ws.push(o));
1514
1518
  } else
1515
1519
  o = r.ws.at(d);
1516
1520
  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);
1521
+ for (let E of o.associatedUsers) {
1522
+ let A = r.us.find(($) => $.oid === E);
1523
+ A != null && A.sel && (i = A.oid);
1520
1524
  }
1521
1525
  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);
1526
+ for (let E of o.associatedTenants) {
1527
+ let A = r.ts.find(($) => $.tid === E);
1528
+ A != null && A.sel && (l = A.tid);
1525
1529
  }
1526
1530
  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);
1531
+ for (let E of o.associatedConfigs) {
1532
+ let A = r.cs.find(($) => $.id === E);
1533
+ A != null && A.sel && (u = A.id);
1530
1534
  }
1531
1535
  o.associatedUsers.length = 0, o.associatedTenants.length = 0, o.associatedConfigs.length = 0, o.id = n.id, o.name = n.name, o.ownerid = n.workspaceOwnerUserId;
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();
1536
+ let f = it(a, s, o.id, t), I = At(a, s, o.id, t), D = bt(a, s, o.id, t), [R, W, x] = await Promise.all([f, I, D]);
1537
+ if (!R.result) return R;
1538
+ if (!W.result) return W;
1539
+ if (!x.result) return x;
1540
+ tt(o, r, W.array, l), et(o, r, R.array, i), st(o, r, x.array, u), r.tagWithWorkspaces();
1537
1541
  }
1538
1542
  return e;
1539
1543
  }
@@ -1542,10 +1546,10 @@ async function Ze(a, t, r, s) {
1542
1546
  }
1543
1547
  return e.result = !1, e.status = 500, e;
1544
1548
  }
1545
- async function ns(a, t) {
1546
- let r = "", s = F();
1549
+ async function us(a, s) {
1550
+ let r = "", t = _();
1547
1551
  try {
1548
- let e = a.getAllAccounts(), n = t.oid + "." + t.tid, o = null;
1552
+ let e = a.getAllAccounts(), n = s.oid + "." + s.tid, o = null;
1549
1553
  for (let i = 0; i < e.length; i++)
1550
1554
  e[i].homeAccountId == n && (o = e[i]);
1551
1555
  r = (await a.acquireTokenSilent({
@@ -1560,24 +1564,24 @@ async function ns(a, t) {
1560
1564
  } catch {
1561
1565
  console.log("PowerBI token failed to be acquired silently");
1562
1566
  }
1563
- return console.log(s), r;
1567
+ return console.log(t), r;
1564
1568
  }
1565
- async function ae(a, t) {
1569
+ async function de(a, s) {
1566
1570
  const r = new Headers();
1567
- if (r.append("Content-Type", "application/json"), r.append("accept", "*/*"), t.azureAccessToken == null || t.azureAccessToken === "")
1571
+ if (r.append("Content-Type", "application/json"), r.append("accept", "*/*"), s.azureAccessToken == null || s.azureAccessToken === "")
1568
1572
  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]);
1573
+ let t = a.getAllAccounts(), e = s.oid + "." + s.tid, n = null;
1574
+ for (let d = 0; d < t.length; d++)
1575
+ t[d].homeAccountId == e && (n = t[d]);
1572
1576
  let o = await a.acquireTokenSilent({
1573
1577
  scopes: ["https://management.azure.com/user_impersonation"],
1574
1578
  account: n
1575
1579
  });
1576
- t.azureAccessToken = o.accessToken, console.log("Front end token acquired silently: " + t.azureAccessToken.slice(0, 20));
1577
- } catch (s) {
1580
+ s.azureAccessToken = o.accessToken, console.log("Front end token acquired silently: " + s.azureAccessToken.slice(0, 20));
1581
+ } catch (t) {
1578
1582
  try {
1579
- console.log("Front end token silent acquisition failure: " + s);
1580
- let e = a.getAllAccounts(), n = t.oid + "." + t.tid, o = null;
1583
+ console.log("Front end token silent acquisition failure: " + t);
1584
+ let e = a.getAllAccounts(), n = s.oid + "." + s.tid, o = null;
1581
1585
  for (let d = 0; d < e.length; d++)
1582
1586
  e[d].homeAccountId == n && (o = e[d]);
1583
1587
  a.acquireTokenRedirect({
@@ -1588,48 +1592,48 @@ async function ae(a, t) {
1588
1592
  console.log("Front end token popup acquisition failure: " + e);
1589
1593
  }
1590
1594
  }
1591
- return r.append("Authorization", `Bearer ${t.azureAccessToken}`), r;
1595
+ return r.append("Authorization", `Bearer ${s.azureAccessToken}`), r;
1592
1596
  }
1593
- async function as(a, t) {
1594
- if (t == null || t.spacode == "")
1597
+ async function fs(a, s) {
1598
+ if (s == null || s.spacode == "")
1595
1599
  return !1;
1596
1600
  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);
1601
+ let t = { method: "GET", headers: await de(a, s) }, e = j.azureListRootAssignments;
1602
+ e += "'", e += s.oid, e += "'";
1603
+ let n = await fetch(e, t);
1600
1604
  if (n.status == 200) {
1601
1605
  let o = await n.json();
1602
1606
  o = o;
1603
1607
  debugger;
1604
1608
  console.log("Successful call to Azure Resource Graph list root assignments");
1605
1609
  } else
1606
- return console.log(await w(n)), !1;
1610
+ return console.log(await y(n)), !1;
1607
1611
  } catch (r) {
1608
1612
  return console.log(r), !1;
1609
1613
  }
1610
1614
  return !0;
1611
1615
  }
1612
- async function os(a, t) {
1613
- if (t == null || t.spacode == "")
1616
+ async function ps(a, s) {
1617
+ if (s == null || s.spacode == "")
1614
1618
  return !1;
1615
1619
  try {
1616
- let s = { method: "POST", headers: await ae(a, t) }, e = _.azureElevateAccess, n = await fetch(e, s);
1620
+ let t = { method: "POST", headers: await de(a, s) }, e = j.azureElevateAccess, n = await fetch(e, t);
1617
1621
  if (n.status == 200)
1618
1622
  console.log("Successful call to Azure Resource Graph list root assignments");
1619
1623
  else
1620
- return console.log(await w(n)), !1;
1624
+ return console.log(await y(n)), !1;
1621
1625
  } catch (r) {
1622
1626
  return console.log(r), !1;
1623
1627
  }
1624
1628
  return !0;
1625
1629
  }
1626
- async function Qe(a, t) {
1630
+ async function nt(a, s) {
1627
1631
  let r = new Array();
1628
- if (t == null || t.spacode == "")
1632
+ if (s == null || s.spacode == "")
1629
1633
  return r;
1630
1634
  try {
1631
- let e = { method: "GET", headers: await ae(a, t) }, n = _.azureListRootAssignments;
1632
- n += "'", n += t.oid, n += "'";
1635
+ let e = { method: "GET", headers: await de(a, s) }, n = j.azureListRootAssignments;
1636
+ n += "'", n += s.oid, n += "'";
1633
1637
  let o = await fetch(n, e);
1634
1638
  if (o.status == 200) {
1635
1639
  let d = await o.json();
@@ -1637,127 +1641,127 @@ async function Qe(a, t) {
1637
1641
  debugger;
1638
1642
  console.log("Successful call to Azure Resource Graph list root assignments");
1639
1643
  } else
1640
- return console.log(await w(o)), r;
1641
- } catch (s) {
1642
- return console.log(s), r;
1644
+ return console.log(await y(o)), r;
1645
+ } catch (t) {
1646
+ return console.log(t), r;
1643
1647
  }
1644
1648
  return r;
1645
1649
  }
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`;
1650
+ function at(a) {
1651
+ let s = "8d95d21c-c378-4bb0-9f52-88c30d271e7a", r = a.authority.toLowerCase();
1652
+ 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
1653
  }
1650
- async function S(a, t) {
1654
+ async function b(a, s) {
1651
1655
  const r = new Headers();
1652
1656
  r.append("Content-Type", "application/json"), r.append("accept", "*/*");
1653
- const s = Xe(t);
1657
+ const t = at(s);
1654
1658
  try {
1655
- let e = a.getAllAccounts(), n = t.oid + "." + t.tid, o = null;
1659
+ let e = a.getAllAccounts(), n = s.oid + "." + s.tid, o = null;
1656
1660
  for (let i = 0; i < e.length; i++)
1657
1661
  e[i].homeAccountId == n && (o = e[i]);
1658
1662
  let d = await a.acquireTokenSilent({
1659
- scopes: [s],
1663
+ scopes: [t],
1660
1664
  account: o
1661
1665
  });
1662
- t.mindlineAccessToken = d.accessToken, console.log("Front end mindline token acquired silently: " + t.mindlineAccessToken.slice(0, 20));
1666
+ s.mindlineAccessToken = d.accessToken, console.log("Front end mindline token acquired silently: " + s.mindlineAccessToken.slice(0, 20));
1663
1667
  } catch (e) {
1664
1668
  try {
1665
1669
  console.log("Front end mindline token silent acquisition failure, triggering redirect: " + e);
1666
- let n = a.getAllAccounts(), o = t.oid + "." + t.tid, d = null;
1670
+ let n = a.getAllAccounts(), o = s.oid + "." + s.tid, d = null;
1667
1671
  for (let i = 0; i < n.length; i++)
1668
1672
  n[i].homeAccountId == o && (d = n[i]);
1669
1673
  a.acquireTokenRedirect({
1670
- scopes: [s],
1674
+ scopes: [t],
1671
1675
  account: d
1672
1676
  });
1673
1677
  } catch (n) {
1674
1678
  console.log("Front end mindline token redirect acquisition failure: " + n);
1675
1679
  }
1676
1680
  }
1677
- return r.append("Authorization", `Bearer ${t.mindlineAccessToken}`), r;
1681
+ return r.append("Authorization", `Bearer ${s.mindlineAccessToken}`), r;
1678
1682
  }
1679
- async function w(a) {
1680
- let t = "";
1681
- if (a.status === 401 && (t = a.statusText, t != ""))
1682
- return t;
1683
+ async function y(a) {
1684
+ let s = "";
1685
+ if (a.status === 401 && (s = a.statusText, s != ""))
1686
+ return s;
1683
1687
  let r = await a.json();
1684
1688
  if (r.error !== void 0)
1685
- t = `Error: ${r.error} Message: ${r.message}`;
1689
+ s = `Error: ${r.error} Message: ${r.message}`;
1686
1690
  else if (r.errors !== void 0)
1687
- t = Object.keys(r.errors).reduce(
1691
+ s = Object.keys(r.errors).reduce(
1688
1692
  (n, o) => n + o + ": " + r.errors[o] + " ",
1689
1693
  ""
1690
1694
  );
1691
1695
  else if (r.title !== void 0)
1692
- t = r.title;
1696
+ s = r.title;
1693
1697
  else
1694
1698
  debugger;
1695
- return t;
1699
+ return s;
1696
1700
  }
1697
- async function Ye(a, t, r, s) {
1701
+ async function ot(a, s, r, t) {
1698
1702
  let e = new m();
1699
- if (r.oid == "" && r.mail == "" || s == "")
1703
+ if (r.oid == "" && r.mail == "" || t == "")
1700
1704
  return e.result = !1, e.error = "adminDelete: invalid parameters", e.status = 500, e;
1701
1705
  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) };
1706
+ n = new URL(w.adminEndpoint()), n.searchParams.append("workspaceId", t), n.searchParams.append("email", r.mail);
1707
+ let d = { method: "DELETE", headers: await b(a, s) };
1704
1708
  try {
1705
1709
  console.log("Attempting DELETE from /admin: " + n.href);
1706
1710
  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);
1711
+ return i.status === 200 && i.statusText === "OK" ? (console.log(`Successful DELETE from /admin: ${n.href}`), e) : (e.error = await y(i), console.log(`Failed DELETE from /admin: ${n.href}`), console.log(e.error), e.status = 500, e.result = !1, e);
1708
1712
  } catch (i) {
1709
1713
  e.error = i.message, e.status = 500, e.result = !1, console.log(i.message);
1710
1714
  }
1711
1715
  return e;
1712
1716
  }
1713
- async function et(a, t, r, s) {
1717
+ async function it(a, s, r, t) {
1714
1718
  let e = new m();
1715
1719
  if (r === "")
1716
1720
  return e.result = !1, e.status = 500, e.error = "adminsGet: no workspace provided", e;
1717
- let n = y.adminsEndpoint(), o = new URL(n);
1721
+ let n = w.adminsEndpoint(), o = new URL(n);
1718
1722
  o.searchParams.append("workspaceId", r);
1719
- let i = { method: "GET", headers: await S(a, t) };
1723
+ let i = { method: "GET", headers: await b(a, s) };
1720
1724
  try {
1721
- if (s) debugger;
1725
+ if (t) debugger;
1722
1726
  console.log("Attempting GET from /admins: " + o.href);
1723
1727
  let l = await fetch(o.href, i);
1724
1728
  if (l.status === 200 && l.statusText === "OK") {
1725
1729
  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);
1730
+ 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
1731
  } 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;
1732
+ 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
1733
  } catch (l) {
1730
1734
  e.error = l.message, e.status = 500, e.result = !1, console.log(l.message);
1731
1735
  }
1732
1736
  return e;
1733
1737
  }
1734
- async function tt(a, t, r, s) {
1738
+ async function lt(a, s, r, t) {
1735
1739
  let e = new m();
1736
1740
  if (r.mail == "" || r.authority == "" || r.tid === "")
1737
1741
  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);
1742
+ let n = w.adminEndpoint();
1743
+ const o = await b(a, s);
1740
1744
  let d = `
1741
1745
  {"email": "${r.mail}",
1742
1746
  "tenantId": "${r.tid}",
1743
- "workspaceId": "${s}"
1747
+ "workspaceId": "${t}"
1744
1748
  }`, i = { method: "POST", headers: o, body: d };
1745
1749
  try {
1746
1750
  console.log("Attempting POST to /admin: " + n);
1747
1751
  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);
1752
+ 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
1753
  } catch (l) {
1750
1754
  e.error = l.message, e.status = 500, e.result = !1, console.log(l.message);
1751
1755
  }
1752
1756
  return e;
1753
1757
  }
1754
- async function st(a, t, r, s) {
1755
- a = a, t = t, s = s;
1758
+ async function ct(a, s, r, t) {
1759
+ a = a, s = s, t = t;
1756
1760
  let e = new m();
1757
1761
  if (r.id === "")
1758
1762
  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);
1763
+ let n = w.auditConfigEndpoint();
1764
+ const o = await b(a, s);
1761
1765
  let d = `
1762
1766
  {
1763
1767
  "workspaceId": "${r.workspaceId}",
@@ -1768,7 +1772,7 @@ async function st(a, t, r, s) {
1768
1772
  "tenantId": "${r.tenantId}"
1769
1773
  }`, i = { method: "POST", headers: o, body: d };
1770
1774
  try {
1771
- if (s) debugger;
1775
+ if (t) debugger;
1772
1776
  console.log("Attempting POST to /audit-configuration: " + n);
1773
1777
  let l = await fetch(n, i);
1774
1778
  if (l.status === 200 && l.statusText === "OK") {
@@ -1777,83 +1781,83 @@ async function st(a, t, r, s) {
1777
1781
  `Successful AuditConfigID: ${u} from POST to /audit-configuration: ${d}`
1778
1782
  ), e;
1779
1783
  } 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;
1784
+ 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
1785
  } catch (l) {
1782
1786
  return e.status = 500, e.result = !1, e.error = l.message, console.log(e.error), e;
1783
1787
  }
1784
1788
  return e;
1785
1789
  }
1786
- async function rt(a, t, r, s) {
1787
- a = a, t = t, s = s;
1790
+ async function dt(a, s, r, t) {
1791
+ a = a, s = s, t = t;
1788
1792
  let e = new m();
1789
- if (t.mail == null || t.mail == "")
1793
+ if (s.mail == null || s.mail == "")
1790
1794
  return e.result = !1, e.status = 500, e.error = "auditConfigGet: no user provided", e;
1791
1795
  if (!r || r.trim() === "")
1792
1796
  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) };
1797
+ let n = w.auditConfigEndpoint(), o = new URL(`${n}/${r}`), i = { method: "GET", headers: await b(a, s) };
1794
1798
  try {
1795
- if (s) debugger;
1799
+ if (t) debugger;
1796
1800
  console.log("Attempting GET to /audit-configuration: " + o.href);
1797
1801
  const l = await fetch(o.href, i);
1798
1802
  if (l.status === 200 && l.statusText === "OK") {
1799
1803
  let u = await l.json();
1800
1804
  e.result = !0, e.status = l.status, console.log("Successful GET from /audit-configuration:", u);
1801
1805
  } 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;
1806
+ 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
1807
  } catch (l) {
1804
1808
  e.status = 500, e.result = !1, e.error = l.message, console.log("Error during auditConfigGet:", l.message);
1805
1809
  }
1806
1810
  return e;
1807
1811
  }
1808
- async function nt(a, t, r, s, e) {
1812
+ async function ut(a, s, r, t, e) {
1809
1813
  let n = new m();
1810
1814
  if (!r || r.trim() === "")
1811
1815
  return n.result = !1, n.error = "auditConfigPut: invalid configuration ID", n.status = 500, n;
1812
- let o = y.auditConfigEndpoint(), d = new URL(o);
1816
+ let o = w.auditConfigEndpoint(), d = new URL(o);
1813
1817
  d.searchParams.append("configurationId", r);
1814
- const i = await S(a, t);
1818
+ const i = await b(a, s);
1815
1819
  let l = `
1816
1820
  {
1817
- "name": "${s.name}",
1818
- "description": "${s.description}",
1819
- "isEnabled": ${s.isEnabled},
1820
- "isReadPermissionConsented": ${s.isReadPermissionConsented},
1821
- "email": "${s.email}"
1821
+ "name": "${t.name}",
1822
+ "description": "${t.description}",
1823
+ "isEnabled": ${t.isEnabled},
1824
+ "isReadPermissionConsented": ${t.isReadPermissionConsented},
1825
+ "email": "${t.email}"
1822
1826
  }`, u = { method: "PUT", headers: i, body: l };
1823
1827
  try {
1824
1828
  if (e) debugger;
1825
1829
  console.log("Attempting PUT to /audit-configuration: " + d.href);
1826
1830
  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);
1831
+ f.status === 200 && f.statusText === "OK" ? (n.result = !0, console.log(`Successful PUT to ${d.href}: ${l}`)) : (n.error = await y(f), console.error(`Failed PUT to ${d.href}: ${l}`), n.status = f.status, n.result = !1);
1828
1832
  } catch (f) {
1829
1833
  n.error = f.message, n.status = 500, n.result = !1, console.error("Error during auditConfigPut:", f.message);
1830
1834
  }
1831
1835
  return n;
1832
1836
  }
1833
- async function at(a, t, r, s) {
1837
+ async function ft(a, s, r, t) {
1834
1838
  let e = new m();
1835
- if (!t.mail)
1839
+ if (!s.mail)
1836
1840
  return e.result = !1, e.status = 500, e.error = "auditConfigDelete: no user provided", e;
1837
1841
  if (!r || r.trim() === "")
1838
1842
  return e.result = !1, e.status = 500, e.error = "auditConfigDelete: configurationId is required", e;
1839
- let n = y.auditConfigEndpoint(), o = new URL(n);
1843
+ let n = w.auditConfigEndpoint(), o = new URL(n);
1840
1844
  o.searchParams.append("configurationId", r);
1841
- const i = { method: "DELETE", headers: await S(a, t) };
1845
+ const i = { method: "DELETE", headers: await b(a, s) };
1842
1846
  try {
1843
- if (s) debugger;
1847
+ if (t) debugger;
1844
1848
  console.log(`Attempting DELETE to /audit-configuration: ${o.href}`);
1845
1849
  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}`));
1850
+ 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
1851
  } catch (l) {
1848
1852
  e.status = 500, e.result = !1, e.error = l.message, console.error("Error during auditConfigDelete:", l.message);
1849
1853
  }
1850
1854
  return e;
1851
1855
  }
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) };
1856
+ async function pt(a, s, r) {
1857
+ let t = new m();
1858
+ if (s.mail == null || s.mail == "")
1859
+ return t.result = !1, t.status = 500, t.error = "auditEventsGet: no user provided", t;
1860
+ let e = w.auditEventsEndpoint(), n = new URL(e), d = { method: "GET", headers: await b(a, s) };
1857
1861
  try {
1858
1862
  if (r) debugger;
1859
1863
  console.log("Attempting GET from /audit-events endpoint: " + n.href);
@@ -1863,107 +1867,133 @@ async function ot(a, t, r) {
1863
1867
  if (Array.isArray(l.data)) {
1864
1868
  let u = l.data;
1865
1869
  if (u != null)
1866
- return s.array = u, console.log(`Successful GET from /audit-events: ${s.array.reduce(($, A) => $ + A.initiatedByUser + " ", "")}`), s;
1870
+ return t.array = u, console.log(`Successful GET from /audit-events: ${t.array.reduce((I, D) => I + D.initiatedByUser + " ", "")}`), t;
1867
1871
  }
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;
1872
+ 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
1873
  } 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;
1874
+ return console.log(`Failed GET from /audit-events: ${n.href}`), t.error = await y(i), t.status = 500, t.result = !1, console.log(t.error), t;
1871
1875
  } catch (i) {
1872
- s.error = i.message, s.status = 500, s.result = !1, console.log(i.message);
1876
+ t.error = i.message, t.status = 500, t.result = !1, console.log(i.message);
1873
1877
  }
1874
- return s;
1878
+ return t;
1875
1879
  }
1876
- async function it(a, t, r, s, e) {
1877
- let n = new m(), o = y.configConsentEndpoint(), d = new URL(o);
1880
+ async function ht(a, s, r, t, e) {
1881
+ let n = new m(), o = w.configConsentEndpoint(), d = new URL(o);
1878
1882
  d.searchParams.append("configurationId", r);
1879
- const i = await S(a, t);
1883
+ const i = await b(a, s);
1880
1884
  let l = `
1881
1885
  {
1882
- "tenantId": "${s}",
1886
+ "tenantId": "${t}",
1883
1887
  "isReadPermissionConsented": ${e ? "true" : "false"}
1884
1888
  }`, u = { method: "PUT", headers: i, body: l };
1885
1889
  try {
1886
1890
  console.log("Attempting PUT read consent to /configuration/consent: " + d.href);
1887
1891
  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);
1892
+ return f.status === 200 && f.statusText === "OK" ? (console.log(`Successful PUT to ${d.href}`), n) : (n.error = await y(f), console.log(`Failed PUT to ${d.href}`), console.log(n.error), n.status = 500, n.result = !1, n);
1889
1893
  } catch (f) {
1890
1894
  n.error = f.message, n.status = 500, n.result = !1, console.log(f.message);
1891
1895
  }
1892
1896
  return n;
1893
1897
  }
1894
- async function lt(a, t, r, s, e) {
1895
- let n = new m(), o = y.configConsentEndpoint(), d = new URL(o);
1898
+ async function gt(a, s, r, t, e) {
1899
+ let n = new m(), o = w.configConsentEndpoint(), d = new URL(o);
1896
1900
  d.searchParams.append("configurationId", r);
1897
- const i = await S(a, t);
1901
+ const i = await b(a, s);
1898
1902
  let l = `
1899
1903
  {
1900
- "tenantId": "${s}",
1904
+ "tenantId": "${t}",
1901
1905
  "isWritePermissionConsented": ${e ? "true" : "false"}
1902
1906
  }`, u = { method: "PUT", headers: i, body: l };
1903
1907
  try {
1904
1908
  console.log("Attempting PUT read consent to /configuration/consent: " + d.href);
1905
1909
  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);
1910
+ return f.status === 200 && f.statusText === "OK" ? (console.log(`Successful PUT to ${d.href}`), n) : (n.error = await y(f), console.log(`Failed PUT to ${d.href}`), console.log(n.error), n.status = 500, n.result = !1, n);
1907
1911
  } catch (f) {
1908
1912
  n.error = f.message, n.status = 500, n.result = !1, console.log(f.message);
1909
1913
  }
1910
1914
  return n;
1911
1915
  }
1912
- async function ct(a, t, r, s, e) {
1916
+ async function mt(a, s, r, t, e) {
1913
1917
  let n = new m();
1914
- if (r.id === "" || s == "")
1918
+ if (r.id === "" || t == "")
1919
+ return n.result = !1, n.error = "configGet: invalid config ID", n.status = 500, n;
1920
+ let o = null;
1921
+ o = new URL(w.configEndpoint());
1922
+ let i = { method: "GET", headers: await b(a, s) };
1923
+ try {
1924
+ console.log("Attempting GET from /config: " + o.href);
1925
+ let l = await fetch(`${o.href}/${r.id}`, i);
1926
+ if (l.status === 200 && l.statusText === "OK") {
1927
+ console.log("Successful GET from /config");
1928
+ let u = await l.json();
1929
+ return {
1930
+ ...n,
1931
+ array: [u]
1932
+ };
1933
+ } else
1934
+ return n.error = await y(l), console.log(`Failed GET from ${o.href}`), console.log(n.error), n.status = 500, n.result = !1, n;
1935
+ } catch (l) {
1936
+ n.error = l.message, n.status = 500, n.result = !1, console.log(l.message);
1937
+ }
1938
+ return n;
1939
+ }
1940
+ async function yt(a, s, r, t, e) {
1941
+ let n = new m();
1942
+ if (r.id === "" || t == "")
1915
1943
  return n.result = !1, n.error = "configPost: invalid config ID", n.status = 500, n;
1916
1944
  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) };
1945
+ o = new URL(w.configEndpoint()), o.searchParams.append("configurationId", r.id);
1946
+ let i = { method: "DELETE", headers: await b(a, s) };
1919
1947
  try {
1920
1948
  console.log("Attempting DELETE from /config: " + o.href);
1921
1949
  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);
1950
+ return l.status === 200 && l.statusText === "OK" ? (console.log("Successful DELETE from /config"), n) : (n.error = await y(l), console.log(`Failed DELETE from ${o.href}`), console.log(n.error), n.status = 500, n.result = !1, n);
1923
1951
  } catch (l) {
1924
1952
  n.error = l.message, n.status = 500, n.result = !1, console.log(l.message);
1925
1953
  }
1926
1954
  return n;
1927
1955
  }
1928
- async function dt(a, t, r, s, e) {
1956
+ async function wt(a, s, r, t, e) {
1929
1957
  let n = new m();
1930
1958
  if (r === "")
1931
1959
  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) };
1960
+ let o = w.configEnabledEndpoint(), d = new URL(o);
1961
+ d.searchParams.append("configurationId", r), d.searchParams.append("isEnabled", t.toString());
1962
+ let l = { method: "PATCH", headers: await b(a, s) };
1935
1963
  try {
1936
1964
  if (e) debugger;
1937
1965
  console.log("Attempting PATCH to /config: " + d.href);
1938
1966
  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);
1967
+ return u.status === 200 && u.statusText === "OK" ? (console.log(`Successful PATCH to ${d.href}: ${t.toString()}`), n) : (n.error = await y(u), console.log(`Failed PATCH to ${d.href}: ${t.toString()}`), console.log(n.error), n.status = 500, n.result = !1, n);
1940
1968
  } catch (u) {
1941
1969
  n.error = u.message, n.status = 500, n.result = !1, console.log(u.message);
1942
1970
  }
1943
1971
  return n;
1944
1972
  }
1945
- async function ut(a, t, r, s, e) {
1973
+ async function Tt(a, s, r, t, e) {
1946
1974
  let n = new m();
1947
1975
  if (r.id === "")
1948
1976
  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);
1977
+ let o = w.configEndpoint();
1978
+ const d = await b(a, s);
1951
1979
  let i = `
1952
1980
  {
1953
- "workspaceId": "${s}",
1981
+ "workspaceId": "${t}",
1954
1982
  "name": "${r.name}",
1955
1983
  "description": "${r.description}",
1956
1984
  "isEnabled": ${r.isEnabled},
1957
1985
  "tenants": [`;
1958
1986
  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";
1987
+ 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
1988
  i.slice(-1) === "}" && (i += ","), i += `{
1961
1989
  "tenantId": "${u.tid}",
1962
1990
  "sourceGroupId": ${f},
1963
- "sourceGroupName": ${$},
1964
- "targetGroupId": ${A},
1965
- "targetGroupName": ${E},
1966
- "configurationTenantType": "${u.configurationTenantType}"
1991
+ "sourceGroupName": ${I},
1992
+ "targetGroupId": ${D},
1993
+ "targetGroupName": ${R},
1994
+ "configurationTenantType": "${u.configurationTenantType}",
1995
+ "isReadPermissionConsented": ${u.isReadPermissionConsented},
1996
+ "isWritePermissionConsented": ${u.isWritePermissionConsented}
1967
1997
  }`;
1968
1998
  }), i += "]}";
1969
1999
  let l = { method: "POST", headers: d, body: i };
@@ -1973,22 +2003,22 @@ async function ut(a, t, r, s, e) {
1973
2003
  let u = await fetch(o, l);
1974
2004
  if (u.status === 200 && u.statusText === "OK") {
1975
2005
  let f = await u.json();
1976
- return r.id = f, console.log(
1977
- `Successful ConfigID: ${f} from POST to /config: ${i}`
2006
+ return r.id = typeof f == "object" && f !== null && f.id ? f.id : f, console.log(
2007
+ `Successful ConfigID: ${r.id} from POST to /config: ${i}`
1978
2008
  ), n;
1979
2009
  } 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;
2010
+ return n.error = await y(u), console.log(`Failed PUT to /config: ${i}`), console.log(n.error), n.status = 500, n.result = !1, n;
1981
2011
  } catch (u) {
1982
2012
  return n.status = 500, n.result = !1, n.error = u.message, console.log(n.error), n;
1983
2013
  }
1984
2014
  }
1985
- async function ft(a, t, r, s) {
2015
+ async function St(a, s, r, t) {
1986
2016
  let e = new m();
1987
2017
  if (r.id === "")
1988
2018
  return e.result = !1, e.error = "configPost: invalid config ID", e.status = 500, e;
1989
- let n = y.configEndpoint(), o = new URL(n);
2019
+ let n = w.configEndpoint(), o = new URL(n);
1990
2020
  o.searchParams.append("configurationId", r.id);
1991
- const d = await S(a, t);
2021
+ const d = await b(a, s);
1992
2022
  let i = `
1993
2023
  {
1994
2024
  "name": "${r.name}",
@@ -1996,58 +2026,68 @@ async function ft(a, t, r, s) {
1996
2026
  "tenants": [`;
1997
2027
  r.tenants.map((u) => {
1998
2028
  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";
2029
+ 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
2030
  i += `{
2001
2031
  "tenantId": "${u.tid}",
2002
- "sourceGroupId": ${$},
2003
- "sourceGroupName": ${A},
2004
- "targetGroupId": ${E},
2005
- "targetGroupName": ${D},
2032
+ "sourceGroupId": ${I},
2033
+ "sourceGroupName": ${D},
2034
+ "targetGroupId": ${R},
2035
+ "targetGroupName": ${W},
2006
2036
  "configurationTenantType": "${u.configurationTenantType}",
2007
- "deltaToken": "${u.deltaToken}"
2037
+ "deltaToken": "${u.deltaToken}",
2038
+ "isReadPermissionConsented": ${u.isReadPermissionConsented},
2039
+ "isWritePermissionConsented": ${u.isWritePermissionConsented}
2008
2040
  }`;
2009
2041
  }), i += "]}";
2010
2042
  let l = { method: "PUT", headers: d, body: i };
2011
2043
  try {
2012
- if (s) debugger;
2044
+ if (t) debugger;
2013
2045
  console.log("Attempting PUT to /config: " + o.href);
2014
2046
  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);
2047
+ if (u.status === 200 && u.statusText === "OK") {
2048
+ console.log(`Successful PUT to ${o.href}: ${i}`);
2049
+ let f = await u.json();
2050
+ return {
2051
+ ...e,
2052
+ array: [f]
2053
+ };
2054
+ } else
2055
+ 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
2056
  } catch (u) {
2017
2057
  e.error = u.message, e.status = 500, e.result = !1, console.log(u.message);
2018
2058
  }
2019
2059
  return e;
2020
2060
  }
2021
- async function pt(a, t, r, s) {
2061
+ async function bt(a, s, r, t) {
2022
2062
  let e = new m();
2023
2063
  if (r === "")
2024
2064
  return e.result = !1, e.status = 500, e.error = "configsGet: no workspace provided", e;
2025
- let n = y.configsEndpoint(), o = new URL(n);
2065
+ let n = w.configsEndpoint(), o = new URL(n);
2026
2066
  o.searchParams.append("workspaceId", r);
2027
- let i = { method: "GET", headers: await S(a, t) };
2067
+ let i = { method: "GET", headers: await b(a, s) };
2028
2068
  try {
2029
- if (s) debugger;
2069
+ if (t) debugger;
2030
2070
  console.log("Attempting GET from /configurations: " + o.href);
2031
2071
  let l = await fetch(o.href, i);
2032
2072
  if (l.status === 200 && l.statusText === "OK") {
2033
2073
  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);
2074
+ 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
2075
  } 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;
2076
+ 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
2077
  } catch (l) {
2038
2078
  e.error = l.message, e.status = 500, e.result = !1, console.log(l.message);
2039
2079
  }
2040
2080
  return e;
2041
2081
  }
2042
- async function ht(a, t, r, s) {
2082
+ async function hs(a, s, r, t) {
2043
2083
  let e = new m();
2044
2084
  if (!r)
2045
2085
  return e.result = !1, e.status = 500, e.error = "workspaceConfigsGet: no workspace provided", e;
2046
- let n = y.workspaceConfigsEndpoint(), o = new URL(n);
2086
+ let n = w.workspaceConfigsEndpoint(), o = new URL(n);
2047
2087
  o.searchParams.append("workspaceId", r);
2048
- let i = { method: "GET", headers: await S(a, t) };
2088
+ let i = { method: "GET", headers: await b(a, s) };
2049
2089
  try {
2050
- if (s) debugger;
2090
+ if (t) debugger;
2051
2091
  console.log("Attempting GET from /workspaceConfigs: " + o.href);
2052
2092
  const l = await fetch(o.href, i);
2053
2093
  if (l.status === 200 && l.statusText === "OK") {
@@ -2064,82 +2104,82 @@ async function ht(a, t, r, s) {
2064
2104
  ), e;
2065
2105
  e.error = "workspaceConfigsGet: failed to parse returned configs", e.result = !1, e.status = 500;
2066
2106
  } else
2067
- e.error = await w(l), e.result = !1, e.status = l.status, console.log(e.error);
2107
+ e.error = await y(l), e.result = !1, e.status = l.status, console.log(e.error);
2068
2108
  } catch (l) {
2069
2109
  e.error = l.message, e.result = !1, e.status = 500;
2070
2110
  }
2071
2111
  return e;
2072
2112
  }
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);
2113
+ async function It(a, s, r) {
2114
+ let t = new m();
2115
+ if (s.companyName === "" || s.companyDomain === "")
2116
+ return t.result = !1, t.error = "initPost: invalid company name or domain", t.status = 500, t;
2117
+ let e = w.initEndpoint();
2118
+ const n = await b(a, s);
2079
2119
  let o = `
2080
2120
  {
2081
2121
  "tenantCreateModel": {
2082
- "tenantId": "${t.tid}",
2083
- "name": "${t.companyName}",
2084
- "domain": "${t.companyDomain}",
2122
+ "tenantId": "${s.tid}",
2123
+ "name": "${s.companyName}",
2124
+ "domain": "${s.companyDomain}",
2085
2125
  "type": "aad",
2086
- "authority": "${t.authority}"
2126
+ "authority": "${s.authority}"
2087
2127
  }
2088
2128
  }`, d = { method: "POST", headers: n, body: o };
2089
2129
  try {
2090
2130
  if (r) debugger;
2091
2131
  console.log("Attempting POST to /configuration/init: " + e);
2092
2132
  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);
2133
+ 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
2134
  } catch (i) {
2095
- s.error = i.message, console.log(s.error);
2135
+ t.error = i.message, console.log(t.error);
2096
2136
  }
2097
- return s.status = 500, s.result = !1, s;
2137
+ return t.status = 500, t.result = !1, t;
2098
2138
  }
2099
- async function mt(a, t, r, s, e) {
2139
+ async function $t(a, s, r, t, e) {
2100
2140
  let n = new m();
2101
- if (r.tid === "" || s === "")
2141
+ if (r.tid === "" || t === "")
2102
2142
  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) };
2143
+ let o = new URL(w.tenantEndpoint());
2144
+ o.searchParams.append("tenantId", r.tid), o.searchParams.append("workspaceId", t);
2145
+ let i = { method: "DELETE", headers: await b(a, s) };
2106
2146
  try {
2107
2147
  console.log("Attempting DELETE from /tenant: " + o.href);
2108
2148
  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);
2149
+ return l.status === 200 && l.statusText === "OK" ? (console.log(`Successful DELETE from /tenant: ${o.href}`), n) : (console.log(`Failed DELETE from /tenant: ${o.href}`), n.error = await y(l), console.log(n.error), n.status = 500, n.result = !1, n);
2110
2150
  } catch (l) {
2111
2151
  n.error = l.message, n.status = 500, n.result = !1, console.log(n.error);
2112
2152
  }
2113
2153
  return n;
2114
2154
  }
2115
- async function yt(a, t, r, s) {
2155
+ async function At(a, s, r, t) {
2116
2156
  let e = new m();
2117
2157
  if (r === "")
2118
2158
  return e.result = !1, e.status = 500, e.error = "tenantsGet: no workspace provided", e;
2119
- let n = y.tenantsEndpoint(), o = new URL(n);
2159
+ let n = w.tenantsEndpoint(), o = new URL(n);
2120
2160
  o.searchParams.append("workspaceId", r);
2121
- let i = { method: "GET", headers: await S(a, t) };
2161
+ let i = { method: "GET", headers: await b(a, s) };
2122
2162
  try {
2123
- if (s) debugger;
2163
+ if (t) debugger;
2124
2164
  console.log(`Attempting GET from /tenants: ${o.href}`);
2125
2165
  let l = await fetch(o.href, i);
2126
2166
  if (l.status === 200 && l.statusText === "OK") {
2127
2167
  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);
2168
+ 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
2169
  } 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;
2170
+ 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
2171
  } catch (l) {
2132
2172
  e.error = l.message, e.status = 500, e.result = !1, console.log(l.message);
2133
2173
  }
2134
2174
  return e;
2135
2175
  }
2136
- async function wt(a, t, r, s) {
2176
+ async function kt(a, s, r, t) {
2137
2177
  let e = new m();
2138
2178
  if (r.tid === "" || r.name === "" || r.domain === "")
2139
2179
  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);
2180
+ let n = w.tenantEndpoint(), o = new URL(n);
2181
+ o.searchParams.append("workspaceId", t);
2182
+ const d = await b(a, s);
2143
2183
  let i = `
2144
2184
  {"tenantId": "${r.tid}",
2145
2185
  "name": "${r.name}",
@@ -2150,155 +2190,175 @@ async function wt(a, t, r, s) {
2150
2190
  try {
2151
2191
  console.log(`Attempting POST to ${o.href}: ${i}`);
2152
2192
  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);
2193
+ 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
2194
  } catch (u) {
2155
2195
  e.error = u.message, e.status = 500, e.result = !1, console.log(e.error);
2156
2196
  }
2157
2197
  return e;
2158
2198
  }
2159
- async function Tt(a, t, r, s) {
2199
+ async function Et(a, s, r, t) {
2160
2200
  let e = new m();
2161
- if (r == "" || s == "")
2201
+ if (r == "" || t == "")
2162
2202
  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) };
2203
+ let n = w.workspaceEndpoint(), o = new URL(n);
2204
+ o.searchParams.append("workspaceId", r), o.searchParams.append("workspaceName", t);
2205
+ let i = { method: "PUT", headers: await b(a, s) };
2166
2206
  try {
2167
2207
  console.log("Attempting PUT to /workspace: " + o.href);
2168
2208
  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);
2209
+ 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
2210
  } catch (l) {
2171
2211
  e.error = l.message, e.status = 500, e.result = !1, console.log(l.message);
2172
2212
  }
2173
2213
  return e;
2174
2214
  }
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) };
2215
+ async function Dt(a, s, r) {
2216
+ let t = new m();
2217
+ if (s.mail == null || s.mail == "")
2218
+ return t.result = !1, t.status = 500, t.error = "adminsGet: no workspace provided", t;
2219
+ let e = w.workspacesEndpoint(), n = new URL(e), d = { method: "GET", headers: await b(a, s) };
2180
2220
  try {
2181
2221
  if (r) debugger;
2182
2222
  console.log("Attempting GET from /workspaces endpoint: " + n.href);
2183
2223
  let i = await fetch(n.href, d);
2184
2224
  if (i.status === 200 && i.statusText === "OK") {
2185
2225
  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);
2226
+ 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
2227
  } 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;
2228
+ return console.log(`Failed GET from /workspaces: ${n.href}`), t.error = await y(i), t.status = 500, t.result = !1, console.log(t.error), t;
2189
2229
  } catch (i) {
2190
- s.error = i.message, s.status = 500, s.result = !1, console.log(i.message);
2230
+ t.error = i.message, t.status = 500, t.result = !1, console.log(i.message);
2191
2231
  }
2192
- return s;
2232
+ return t;
2193
2233
  }
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);
2234
+ async function Pt(a, s, r) {
2235
+ let t = new m();
2236
+ if (a == null || s == null)
2237
+ return t.result = !1, t.error = "readerPost: invalid parameters", t.status = 500, t;
2238
+ let e = w.readerStartSyncEndpoint(), n = new URL(e);
2199
2239
  n.searchParams.append("configurationId", r.id);
2200
- let d = { method: "POST", headers: await S(a, t) };
2240
+ let d = { method: "POST", headers: await b(a, s) };
2201
2241
  try {
2202
2242
  console.log("Attempting POST to /startSync: " + n.href);
2203
2243
  let i = await fetch(n.href, d);
2204
2244
  if (i.status === 200 && i.statusText === "OK") {
2205
2245
  console.log(`Successful POST to /startSync: ${e}`);
2206
2246
  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;
2247
+ 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
2248
  } 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;
2249
+ 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
2250
  } catch (i) {
2211
- s.error = i.message, s.status = 500, s.result = !1, console.log(i.message);
2251
+ t.error = i.message, t.status = 500, t.result = !1, console.log(i.message);
2212
2252
  }
2213
- return s;
2253
+ return t;
2254
+ }
2255
+ async function gs(a, s, r) {
2256
+ let t = new m();
2257
+ if (a == null || s == null)
2258
+ return t.result = !1, t.error = "readerPost: invalid parameters", t.status = 500, t;
2259
+ let e = w.statsEndpoint(), n = new URL(`${e}/${r}`), d = { method: "GET", headers: await b(a, s) };
2260
+ try {
2261
+ console.log("Attempting GET to /stats: " + n.href);
2262
+ let i = await fetch(n.href, d);
2263
+ if (i.status === 200 && i.statusText === "OK") {
2264
+ console.log(`Successful GET to /stats: ${e}`);
2265
+ let l = await i.json();
2266
+ return t.array = [l], t;
2267
+ } 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);
2268
+ } catch (i) {
2269
+ t.error = i.message, t.status = 500, t.result = !1, console.log(i.message);
2270
+ }
2271
+ return t;
2214
2272
  }
2215
2273
  export {
2216
2274
  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,
2275
+ Ut as ActorArray,
2276
+ Ke as ActorNode,
2277
+ Nt as AuditConfig,
2278
+ Bt as BatchArray,
2279
+ Ct as Group,
2280
+ Wt as InitInfo,
2281
+ M as Milestone,
2282
+ He as MilestoneArray,
2283
+ ke as ResourceArray,
2284
+ qe as ResourceNode,
2285
+ ne as SyncConfig,
2286
+ se as Task,
2287
+ Ft as TaskArray,
2288
+ H as Tenant,
2289
+ Me as TenantConfigInfo,
2290
+ ze as TenantConfigType,
2291
+ $e as TenantNode,
2292
+ Ue as TenantPermissionType,
2293
+ Be as TenantType,
2294
+ re as User,
2295
+ Ot as UserScope,
2296
+ ae as Workspace,
2297
+ ot as adminDelete,
2298
+ lt as adminPost,
2299
+ it as adminsGet,
2300
+ Jt as auditConfigAdd,
2301
+ ft as auditConfigDelete,
2302
+ Zt as auditConfigEdit,
2303
+ dt as auditConfigGet,
2304
+ ct as auditConfigPost,
2305
+ ut as auditConfigPut,
2306
+ Qt as auditConfigRemove,
2307
+ Vt as auditConfigRetrieve,
2308
+ pt as auditEventsGet,
2309
+ Xt as auditEventsRetrieve,
2310
+ j as azureConfig,
2311
+ fs as canListRootAssignments,
2312
+ ts as configConsentForRead,
2313
+ ss as configConsentForWrite,
2314
+ ht as configConsentReadPut,
2315
+ gt as configConsentWritePut,
2316
+ yt as configDelete,
2317
+ Yt as configEdit,
2318
+ es as configEnable,
2319
+ mt as configGet,
2320
+ wt as configPatch,
2321
+ Tt as configPost,
2322
+ St as configPut,
2323
+ ns as configRemove,
2324
+ bt as configsGet,
2325
+ rs as configsRefresh,
2326
+ ps as elevateGlobalAdminToUserAccessAdmin,
2327
+ us as getPowerBIAccessToken,
2328
+ _ as getSyncVersion,
2270
2329
  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
2330
+ _t as groupsGet,
2331
+ xt as helloNpm,
2332
+ as as initGet,
2333
+ It as initPost,
2334
+ w as mindlineConfig,
2335
+ Ve as oauth2PermissionGrantsGet,
2336
+ Ze as oauth2PermissionGrantsSet,
2337
+ y as processErrors,
2338
+ Pt as readerPost,
2339
+ gs as readerStats,
2340
+ Lt as requestAdminConsent,
2341
+ Qe as servicePrincipalGet,
2342
+ zt as signIn,
2343
+ Mt as signInIncrementally,
2344
+ jt as signOut,
2345
+ Gt as sum,
2346
+ os as tenantAdd,
2347
+ $t as tenantDelete,
2348
+ kt as tenantPost,
2349
+ Ht as tenantRelationshipsGetByDomain,
2350
+ Xe as tenantRelationshipsGetById,
2351
+ is as tenantRemove,
2352
+ Ee as tenantUnauthenticatedLookup,
2353
+ At as tenantsGet,
2354
+ ls as userAdd,
2355
+ Ye as userDelegatedScopesGet,
2356
+ qt as userDelegatedScopesRemove,
2357
+ cs as userRemove,
2358
+ Kt as usersGet,
2359
+ hs as workspaceConfigsGet,
2360
+ ds as workspaceEdit,
2361
+ Et as workspacePut,
2362
+ Dt as workspacesGet
2303
2363
  };
2304
2364
  //# sourceMappingURL=sync.es.js.map