@mindline/sync 1.0.110 → 1.0.111

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/sync.es.js CHANGED
@@ -1,13 +1,13 @@
1
- var Ne = Object.defineProperty;
2
- var Pe = (n) => {
1
+ var Oe = Object.defineProperty;
2
+ var De = (n) => {
3
3
  throw TypeError(n);
4
4
  };
5
- var Be = (n, s, r) => s in n ? Ne(n, s, { enumerable: !0, configurable: !0, writable: !0, value: r }) : n[s] = r;
6
- var u = (n, s, r) => Be(n, typeof s != "symbol" ? s + "" : s, r), We = (n, s, r) => s.has(n) || Pe("Cannot " + r);
7
- var J = (n, s, r) => s.has(n) ? Pe("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(n) : s.set(n, r);
8
- var x = (n, s, r) => (We(n, s, "access private method"), r);
5
+ var Ne = (n, s, r) => s in n ? Oe(n, s, { enumerable: !0, configurable: !0, writable: !0, value: r }) : n[s] = r;
6
+ var c = (n, s, r) => Ne(n, typeof s != "symbol" ? s + "" : s, r), Be = (n, s, r) => s.has(n) || De("Cannot " + r);
7
+ var Q = (n, s, r) => s.has(n) ? De("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(n) : s.set(n, r);
8
+ var x = (n, s, r) => (Be(n, s, "access private method"), r);
9
9
  import { deserializeArray as U } from "class-transformer";
10
- const Fe = [
10
+ const We = [
11
11
  {
12
12
  oid: "1",
13
13
  name: "",
@@ -19,7 +19,7 @@ const Fe = [
19
19
  session: "Sign In",
20
20
  sel: !0
21
21
  }
22
- ], Ue = [
22
+ ], Fe = [
23
23
  {
24
24
  tid: "1",
25
25
  name: "",
@@ -29,7 +29,7 @@ const Fe = [
29
29
  sel: !0,
30
30
  graphSP: ""
31
31
  }
32
- ], Le = [], ze = [
32
+ ], Ue = [], Le = [
33
33
  {
34
34
  id: "1",
35
35
  name: "",
@@ -42,7 +42,7 @@ const Fe = [
42
42
  associatedConfigs: [],
43
43
  sel: !0
44
44
  }
45
- ], _e = [
45
+ ], ze = [
46
46
  {
47
47
  Run: "3",
48
48
  Start: "2023-09-17T12:00:00.000-07:00",
@@ -64,7 +64,7 @@ const Fe = [
64
64
  Read: "2023-09-17T12:00:15.500-07:00",
65
65
  Write: "2023-09-17T12:01:30.000-07:00"
66
66
  }
67
- ], Me = [
67
+ ], _e = [
68
68
  {
69
69
  type: "mg",
70
70
  resource: "Tenant Root Group",
@@ -119,7 +119,7 @@ const Fe = [
119
119
  }
120
120
  ]
121
121
  }
122
- ], je = [
122
+ ], Me = [
123
123
  {
124
124
  type: "user",
125
125
  actor: "arvind@mindline.site",
@@ -139,29 +139,29 @@ const Fe = [
139
139
  resources: []
140
140
  }
141
141
  ], F = "workspaceIDs";
142
- function Ut(n, s) {
142
+ function Ft(n, s) {
143
143
  return n + s;
144
144
  }
145
- function Lt() {
145
+ function Ut() {
146
146
  return "hello NPM";
147
147
  }
148
148
  function L() {
149
- return "1.0.110";
149
+ return "1.0.111";
150
150
  }
151
151
  class m {
152
152
  constructor() {
153
- u(this, "result");
154
- u(this, "status");
155
- u(this, "error");
156
- u(this, "version");
157
- u(this, "array");
153
+ c(this, "result");
154
+ c(this, "status");
155
+ c(this, "error");
156
+ c(this, "version");
157
+ c(this, "array");
158
158
  this.result = !0, this.status = 200, this.error = "", this.version = L(), this.array = null;
159
159
  }
160
160
  }
161
- class M {
161
+ class j {
162
162
  }
163
163
  // azure graph REST API endpoints
164
- u(M, "azureElevateAccess", "https://management.azure.com/providers/Microsoft.Authorization/elevateAccess?api-version=2016-07-01"), u(M, "azureListRootAssignments", "https://management.azure.com/providers/Microsoft.Authorization/roleAssignments?api-version=2022-04-01&$filter=principalId+eq+");
164
+ 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+");
165
165
  const $ = class $ {
166
166
  // config API endpoints
167
167
  static adminEndpoint() {
@@ -220,27 +220,27 @@ const $ = class $ {
220
220
  return `https://${$.environmentTag}-signalrdispatcher-westus.azurewebsites.net/api/stats`;
221
221
  }
222
222
  };
223
- u($, "environmentTag", "dev");
223
+ c($, "environmentTag", "dev");
224
224
  let S = $;
225
- class h {
225
+ class p {
226
226
  }
227
227
  // graph API predicates
228
- u(h, "graphGroupsPredicate", "v1.0/groups"), u(h, "graphMailPredicate", "v1.0/me/messages"), u(h, "graphMePredicate", "v1.0/me"), u(h, "graphOauth2PermissionGrantsPredicate", "v1.0/oauth2PermissionGrants"), u(h, "graphServicePrincipalsPredicate", "v1.0/servicePrincipals"), u(h, "graphUsersPredicate", "v1.0/users"), u(h, "graphTenantByDomainPredicate", "beta/tenantRelationships/findTenantInformationByDomainName"), u(h, "graphTenantByIdPredicate", "beta/tenantRelationships/findTenantInformationByTenantId"), // authority values are based on the well-known OIDC auth endpoints
229
- u(h, "authorityWW", "https://login.microsoftonline.com/"), u(h, "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$/), u(h, "authorityUS", "https://login.microsoftonline.us/"), u(h, "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$/), u(h, "authorityCN", "https://login.partner.microsoftonline.cn/"), u(h, "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$/);
230
- class zt {
228
+ 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
229
+ 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$/);
230
+ class Lt {
231
231
  constructor() {
232
- u(this, "id", "");
233
- u(this, "displayName", "");
234
- u(this, "description", "");
232
+ c(this, "id", "");
233
+ c(this, "displayName", "");
234
+ c(this, "description", "");
235
235
  }
236
236
  }
237
- class _t {
237
+ class zt {
238
238
  constructor() {
239
- u(this, "group", "");
240
- u(this, "value", "");
241
- u(this, "consented", !1);
242
- u(this, "removable", !1);
243
- u(this, "expanded", "");
239
+ c(this, "group", "");
240
+ c(this, "value", "");
241
+ c(this, "consented", !1);
242
+ c(this, "removable", !1);
243
+ c(this, "expanded", "");
244
244
  }
245
245
  static compareByValue(s, r) {
246
246
  return s.value.localeCompare(r.value);
@@ -249,64 +249,64 @@ class _t {
249
249
  return s.group.localeCompare(r.group);
250
250
  }
251
251
  }
252
- class fe {
252
+ class de {
253
253
  // set when the user is logging in to support spinner visibility
254
254
  constructor() {
255
- u(this, "oid");
256
- u(this, "name");
257
- u(this, "mail");
258
- u(this, "authority");
259
- u(this, "tid");
260
- u(this, "companyName");
261
- u(this, "companyDomain");
262
- u(this, "workspaceIDs");
263
- u(this, "session");
255
+ c(this, "oid");
256
+ c(this, "name");
257
+ c(this, "mail");
258
+ c(this, "authority");
259
+ c(this, "tid");
260
+ c(this, "companyName");
261
+ c(this, "companyDomain");
262
+ c(this, "workspaceIDs");
263
+ c(this, "session");
264
264
  // button text
265
- u(this, "spacode");
265
+ c(this, "spacode");
266
266
  // to get front end access token
267
- u(this, "graphAccessToken");
267
+ c(this, "graphAccessToken");
268
268
  // front end graph access token
269
- u(this, "mindlineAccessToken");
269
+ c(this, "mindlineAccessToken");
270
270
  // front end mindline access token
271
- u(this, "azureAccessToken");
271
+ c(this, "azureAccessToken");
272
272
  // front end azure access token
273
- u(this, "loginHint");
273
+ c(this, "loginHint");
274
274
  // to help sign out without prompt
275
- u(this, "scopes");
275
+ c(this, "scopes");
276
276
  // to detect if incremental consent has happened
277
- u(this, "authTS");
277
+ c(this, "authTS");
278
278
  // timestamp user was authenticated
279
- u(this, "sel");
279
+ c(this, "sel");
280
280
  // selection state
281
- u(this, "loggingIn");
281
+ c(this, "loggingIn");
282
282
  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;
283
283
  }
284
284
  }
285
- var He = /* @__PURE__ */ ((n) => (n[n.invalid = 0] = "invalid", n[n.aad = 1] = "aad", n[n.ad = 2] = "ad", n[n.googleworkspace = 3] = "googleworkspace", n))(He || {}), qe = /* @__PURE__ */ ((n) => (n[n.read = 1] = "read", n[n.write = 2] = "write", n[n.notassigned = 3] = "notassigned", n))(qe || {});
286
- class j {
285
+ var je = /* @__PURE__ */ ((n) => (n[n.invalid = 0] = "invalid", n[n.aad = 1] = "aad", n[n.ad = 2] = "ad", n[n.googleworkspace = 3] = "googleworkspace", n))(je || {}), He = /* @__PURE__ */ ((n) => (n[n.read = 1] = "read", n[n.write = 2] = "write", n[n.notassigned = 3] = "notassigned", n))(He || {});
286
+ class H {
287
287
  // are we validating by TID or by domain? "Domain" | "Tenant ID"
288
288
  constructor() {
289
- u(this, "tid");
290
- u(this, "name");
291
- u(this, "domain");
292
- u(this, "tenantType");
293
- u(this, "authority");
294
- u(this, "workspaceIDs");
295
- u(this, "sel");
289
+ c(this, "tid");
290
+ c(this, "name");
291
+ c(this, "domain");
292
+ c(this, "tenantType");
293
+ c(this, "authority");
294
+ c(this, "workspaceIDs");
295
+ c(this, "sel");
296
296
  // selection state
297
- u(this, "graphSP");
297
+ c(this, "graphSP");
298
298
  // graph resource ID (service principal) for this tenant
299
- u(this, "lookupfield");
299
+ c(this, "lookupfield");
300
300
  this.tid = "", this.name = "", this.domain = "", this.tenantType = "aad", this.authority = "", this.workspaceIDs = "", this.sel = !1, this.graphSP = "", this.lookupfield = "Domain";
301
301
  }
302
302
  }
303
- function Qe(n, s) {
303
+ function qe(n, s) {
304
304
  switch (n) {
305
- case h.authorityWW:
305
+ case p.authorityWW:
306
306
  return s === 1 ? "85d35da2-4118-4b03-aa05-605cedd7f2f8" : "63100afe-506e-4bb2-8ff7-d8d5ab373129";
307
- case h.authorityUS:
307
+ case p.authorityUS:
308
308
  return s === 1 ? "b08630c7-e227-4215-9746-afc9286fb864" : "17aa5d5a-f09f-4cec-87a6-28596f9fa513";
309
- case h.authorityCN:
309
+ case p.authorityCN:
310
310
  return s === 1 ? "7db7293b-add9-4a3f-8562-1a20bfe27d5e" : "debd015b-1154-4111-a4cb-fc220a537697";
311
311
  default:
312
312
  debugger;
@@ -315,11 +315,11 @@ function Qe(n, s) {
315
315
  }
316
316
  function W(n) {
317
317
  switch (n) {
318
- case h.authorityWW:
318
+ case p.authorityWW:
319
319
  return "https://graph.microsoft.com/";
320
- case h.authorityUS:
320
+ case p.authorityUS:
321
321
  return "https://graph.microsoft.us/";
322
- case h.authorityCN:
322
+ case p.authorityCN:
323
323
  return "https://microsoftgraph.chinacloudapi.cn/";
324
324
  default:
325
325
  debugger;
@@ -328,11 +328,11 @@ function W(n) {
328
328
  }
329
329
  function Ke(n) {
330
330
  switch (n) {
331
- case h.authorityWW:
331
+ case p.authorityWW:
332
332
  return "https://login.microsoftonline.com/";
333
- case h.authorityUS:
333
+ case p.authorityUS:
334
334
  return "https://login.microsoftonline.us/";
335
- case h.authorityCN:
335
+ case p.authorityCN:
336
336
  return "https://login.partner.microsoftonline.cn/";
337
337
  default:
338
338
  debugger;
@@ -342,64 +342,64 @@ function Ke(n) {
342
342
  var Je = /* @__PURE__ */ ((n) => (n[n.source = 1] = "source", n[n.target = 2] = "target", n[n.sourcetarget = 3] = "sourcetarget", n))(Je || {});
343
343
  class Ve {
344
344
  constructor() {
345
- u(this, "tid");
346
- u(this, "sourceGroupId");
347
- u(this, "sourceGroupName");
348
- u(this, "targetGroupId");
349
- u(this, "targetGroupName");
350
- u(this, "configurationTenantType");
351
- u(this, "deltaToken");
352
- u(this, "usersWritten");
353
- u(this, "configId");
354
- u(this, "batchId");
355
- u(this, "isReadPermissionConsented");
356
- u(this, "isWritePermissionConsented");
345
+ c(this, "tid");
346
+ c(this, "sourceGroupId");
347
+ c(this, "sourceGroupName");
348
+ c(this, "targetGroupId");
349
+ c(this, "targetGroupName");
350
+ c(this, "configurationTenantType");
351
+ c(this, "deltaToken");
352
+ c(this, "usersWritten");
353
+ c(this, "configId");
354
+ c(this, "batchId");
355
+ c(this, "isReadPermissionConsented");
356
+ c(this, "isWritePermissionConsented");
357
357
  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;
358
358
  }
359
359
  }
360
- class pe {
360
+ class ue {
361
361
  // selection state
362
362
  constructor() {
363
- u(this, "id");
364
- u(this, "workspaceId");
365
- u(this, "name");
366
- u(this, "description");
367
- u(this, "tenants");
368
- u(this, "isEnabled");
369
- u(this, "workspaceIDs");
370
- u(this, "sel");
363
+ c(this, "id");
364
+ c(this, "workspaceId");
365
+ c(this, "name");
366
+ c(this, "description");
367
+ c(this, "tenants");
368
+ c(this, "isEnabled");
369
+ c(this, "workspaceIDs");
370
+ c(this, "sel");
371
371
  this.id = "", this.name = "", this.workspaceId = "", this.description = "", this.tenants = new Array(), this.isEnabled = !1, this.workspaceIDs = "", this.sel = !1;
372
372
  }
373
373
  }
374
- class Mt {
374
+ class _t {
375
375
  // selection state
376
376
  constructor() {
377
- u(this, "id");
378
- u(this, "workspaceId");
379
- u(this, "name");
380
- u(this, "description");
381
- u(this, "isEnabled");
382
- u(this, "isReadPermissionConsented");
383
- u(this, "email");
384
- u(this, "tenantId");
385
- u(this, "sel");
377
+ c(this, "id");
378
+ c(this, "workspaceId");
379
+ c(this, "name");
380
+ c(this, "description");
381
+ c(this, "isEnabled");
382
+ c(this, "isReadPermissionConsented");
383
+ c(this, "email");
384
+ c(this, "tenantId");
385
+ c(this, "sel");
386
386
  this.id = "", this.name = "", this.workspaceId = "", this.description = "", this.isEnabled = !1, this.isReadPermissionConsented = !1, this.email = "", this.tenantId = "", this.sel = !1;
387
387
  }
388
388
  }
389
- class he {
389
+ class fe {
390
390
  // selection state
391
391
  constructor() {
392
- u(this, "id");
393
- u(this, "name");
394
- u(this, "ownerid");
395
- u(this, "associatedUsers");
396
- u(this, "associatedTenants");
397
- u(this, "associatedConfigs");
398
- u(this, "sel");
392
+ c(this, "id");
393
+ c(this, "name");
394
+ c(this, "ownerid");
395
+ c(this, "associatedUsers");
396
+ c(this, "associatedTenants");
397
+ c(this, "associatedConfigs");
398
+ c(this, "sel");
399
399
  this.id = "", this.name = "", this.ownerid = "", this.associatedUsers = new Array(), this.associatedTenants = new Array(), this.associatedConfigs = new Array(), this.sel = !1;
400
400
  }
401
401
  }
402
- function R() {
402
+ function P() {
403
403
  let n;
404
404
  try {
405
405
  n = window.localStorage;
@@ -415,24 +415,24 @@ function R() {
415
415
  n && n.length !== 0;
416
416
  }
417
417
  }
418
- var V, Ge;
419
- class jt {
418
+ var X, Pe;
419
+ class Mt {
420
420
  constructor(s = !1) {
421
- J(this, V);
422
- u(this, "version", L());
423
- u(this, "tab", 0);
424
- u(this, "us", []);
425
- u(this, "ts", []);
426
- u(this, "cs", []);
427
- u(this, "acs", []);
428
- u(this, "ws", []);
429
- u(this, "configlevelconsent_configid", "");
430
- u(this, "configlevelconsent_access", 3);
421
+ Q(this, X);
422
+ c(this, "version", L());
423
+ c(this, "tab", 0);
424
+ c(this, "us", []);
425
+ c(this, "ts", []);
426
+ c(this, "cs", []);
427
+ c(this, "acs", []);
428
+ c(this, "ws", []);
429
+ c(this, "configlevelconsent_configid", "");
430
+ c(this, "configlevelconsent_access", 3);
431
431
  this.init(s);
432
432
  }
433
433
  // get initial data from localStorage or file
434
434
  init(s) {
435
- if (console.log(`Calling InitInfo::init(bClearLocalStorage: ${s ? "true" : "false"})`), R()) {
435
+ if (console.log(`Calling InitInfo::init(bClearLocalStorage: ${s ? "true" : "false"})`), P()) {
436
436
  let o = localStorage.getItem("InitInfo");
437
437
  if (o != null && typeof o == "string" && o !== "") {
438
438
  let i = JSON.parse(o);
@@ -440,15 +440,15 @@ class jt {
440
440
  if (s)
441
441
  localStorage.removeItem("InitInfo");
442
442
  else {
443
- x(this, V, Ge).call(this, i);
443
+ x(this, X, Pe).call(this, i);
444
444
  return;
445
445
  }
446
446
  }
447
447
  }
448
448
  this.tab = 0, this.version = L(), this.configlevelconsent_configid = "", this.configlevelconsent_access = 3;
449
- var r = JSON.stringify(Fe), t = JSON.stringify(Ue), e = JSON.stringify(Le), a = JSON.stringify(ze);
449
+ var r = JSON.stringify(We), t = JSON.stringify(Fe), e = JSON.stringify(Ue), a = JSON.stringify(Le);
450
450
  try {
451
- this.us = U(fe, r), this.ts = U(j, t), this.cs = U(pe, e), this.ws = U(he, a), this.tagWithWorkspaces();
451
+ this.us = U(de, r), this.ts = U(H, t), this.cs = U(ue, e), this.ws = U(fe, a), this.tagWithWorkspaces();
452
452
  } catch {
453
453
  debugger;
454
454
  }
@@ -485,18 +485,18 @@ class jt {
485
485
  return !0;
486
486
  }
487
487
  }
488
- V = new WeakSet(), Ge = function(s) {
488
+ X = new WeakSet(), Pe = function(s) {
489
489
  this.tab = s.tab, this.version = L(), 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) => {
490
- let t = new fe();
490
+ let t = new de();
491
491
  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;
492
492
  }), typeof s.ts > "u" ? this.ts = new Array() : this.ts = s.ts.map((r) => {
493
- let t = new j();
493
+ let t = new H();
494
494
  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;
495
495
  }), typeof s.cs > "u" ? this.cs = new Array() : this.cs = s.cs.map((r) => {
496
- let t = new pe();
496
+ let t = new ue();
497
497
  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;
498
498
  }), typeof s.ws > "u" ? this.ws = new Array() : this.ws = s.ws.map((r) => {
499
- let t = new he();
499
+ let t = new fe();
500
500
  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;
501
501
  });
502
502
  };
@@ -553,37 +553,37 @@ const Ze = [
553
553
  ]
554
554
  }
555
555
  ];
556
- var G, ge, me, ye;
557
- class Ht {
556
+ var G, pe, he, ge;
557
+ class jt {
558
558
  constructor(s) {
559
- J(this, G);
560
- u(this, "tasks");
559
+ Q(this, G);
560
+ c(this, "tasks");
561
561
  this.tasks = [new ce()], this.init(s);
562
562
  }
563
563
  // get initial data from localStorage or file
564
564
  init(s) {
565
- if (console.log(`Calling TaskArray::init(bClearLocalStorage: ${s ? "true" : "false"})`), this.tasks.length = 0, s && R() && localStorage.removeItem("Tasks"), R()) {
565
+ if (console.log(`Calling TaskArray::init(bClearLocalStorage: ${s ? "true" : "false"})`), this.tasks.length = 0, s && P() && localStorage.removeItem("Tasks"), P()) {
566
566
  let r = localStorage.getItem("Tasks");
567
567
  if (r != null && typeof r == "string" && r !== "") {
568
568
  let e = JSON.parse(r);
569
- if (this.tasks = x(this, G, me).call(this, e.tasks), this.tasks.length !== 0) return;
569
+ if (this.tasks = x(this, G, he).call(this, e.tasks), this.tasks.length !== 0) return;
570
570
  }
571
571
  }
572
- this.tasks = x(this, G, me).call(this, Ze);
572
+ this.tasks = x(this, G, he).call(this, Ze);
573
573
  }
574
574
  // set start time for a task
575
575
  setTaskStart(s, r) {
576
- let t = x(this, G, ge).call(this, s);
576
+ let t = x(this, G, pe).call(this, s);
577
577
  if (t != null && t != null)
578
- t.setStart(r), t.status = "in progress", x(this, G, ye).call(this);
578
+ t.setStart(r), t.status = "in progress", x(this, G, ge).call(this);
579
579
  else
580
580
  debugger;
581
581
  }
582
582
  // set end time for a task
583
583
  setTaskEnd(s, r, t) {
584
- let e = x(this, G, ge).call(this, s);
584
+ let e = x(this, G, pe).call(this, s);
585
585
  if (e != null && e != null)
586
- e.setEnd(r), e.status = t, x(this, G, ye).call(this);
586
+ e.setEnd(r), e.status = t, x(this, G, ge).call(this);
587
587
  else
588
588
  debugger;
589
589
  }
@@ -591,7 +591,7 @@ class Ht {
591
591
  G = new WeakSet(), //
592
592
  // private
593
593
  //
594
- ge = function(s) {
594
+ pe = function(s) {
595
595
  let r = this.tasks.find((t) => t.task == s);
596
596
  if (r == null || r == null) {
597
597
  for (r of this.tasks)
@@ -599,7 +599,7 @@ ge = function(s) {
599
599
  break;
600
600
  }
601
601
  return r;
602
- }, me = function(s) {
602
+ }, he = function(s) {
603
603
  return s.map((r) => {
604
604
  let t = new ce();
605
605
  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,23 +607,23 @@ ge = function(s) {
607
607
  return a.id = e.id, a.task = e.task, a.setStart(new Date(e.start)), a.setEnd(new Date(e.end)), a.expected = e.expected, a.status = e.status, a.expanded = e.expanded, a;
608
608
  })), t;
609
609
  });
610
- }, ye = function() {
610
+ }, ge = function() {
611
611
  let s = JSON.stringify(this);
612
- R() && localStorage.setItem("Tasks", s);
612
+ P() && localStorage.setItem("Tasks", s);
613
613
  };
614
614
  class ce {
615
615
  constructor() {
616
- u(this, "id", 0);
617
- u(this, "task", "");
618
- u(this, "start", /* @__PURE__ */ new Date());
619
- u(this, "startDisplay", "");
620
- u(this, "end", /* @__PURE__ */ new Date());
621
- u(this, "endDisplay", "");
622
- u(this, "elapsedDisplay", "");
623
- u(this, "expected", 0);
624
- u(this, "status", "");
625
- u(this, "expanded", !1);
626
- u(this, "subtasks", []);
616
+ c(this, "id", 0);
617
+ c(this, "task", "");
618
+ c(this, "start", /* @__PURE__ */ new Date());
619
+ c(this, "startDisplay", "");
620
+ c(this, "end", /* @__PURE__ */ new Date());
621
+ c(this, "endDisplay", "");
622
+ c(this, "elapsedDisplay", "");
623
+ c(this, "expected", 0);
624
+ c(this, "status", "");
625
+ c(this, "expanded", !1);
626
+ c(this, "subtasks", []);
627
627
  }
628
628
  setEnd(s) {
629
629
  this.end = s, this.endDisplay = `${this.end.getMinutes().toString().padStart(2, "0")}:${this.end.getSeconds().toString().padStart(2, "0")}`;
@@ -636,19 +636,19 @@ class ce {
636
636
  this.start = s, this.startDisplay = `${this.start.getMinutes().toString().padStart(2, "0")}:${this.start.getSeconds().toString().padStart(2, "0")}`;
637
637
  }
638
638
  }
639
- class _ {
639
+ class M {
640
640
  constructor(s) {
641
- u(this, "Run", 0);
642
- u(this, "Start", /* @__PURE__ */ new Date());
643
- u(this, "startDisplay", "");
644
- u(this, "POST");
645
- u(this, "postDisplay");
646
- u(this, "Read");
647
- u(this, "readDisplay");
648
- u(this, "Write");
649
- u(this, "writeDisplay");
650
- u(this, "Duration");
651
- u(this, "durationDisplay");
641
+ c(this, "Run", 0);
642
+ c(this, "Start", /* @__PURE__ */ new Date());
643
+ c(this, "startDisplay", "");
644
+ c(this, "POST");
645
+ c(this, "postDisplay");
646
+ c(this, "Read");
647
+ c(this, "readDisplay");
648
+ c(this, "Write");
649
+ c(this, "writeDisplay");
650
+ c(this, "Duration");
651
+ c(this, "durationDisplay");
652
652
  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 = "";
653
653
  }
654
654
  start(s) {
@@ -664,15 +664,15 @@ class _ {
664
664
  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")}`;
665
665
  }
666
666
  }
667
- var H, we;
668
- class Xe {
667
+ var q, me;
668
+ class Qe {
669
669
  constructor(s) {
670
- J(this, H);
671
- u(this, "milestones", []);
670
+ Q(this, q);
671
+ c(this, "milestones", []);
672
672
  this.init(s);
673
673
  }
674
674
  init(s) {
675
- if (R()) {
675
+ if (P()) {
676
676
  let r = localStorage.getItem("syncmilestones");
677
677
  if (r != null && typeof r == "string" && r !== "") {
678
678
  let e = JSON.parse(r);
@@ -680,16 +680,16 @@ class Xe {
680
680
  if (s)
681
681
  localStorage.removeItem("syncmilestones");
682
682
  else {
683
- x(this, H, we).call(this, e);
683
+ x(this, q, me).call(this, e);
684
684
  return;
685
685
  }
686
686
  }
687
687
  }
688
- x(this, H, we).call(this, _e);
688
+ x(this, q, me).call(this, ze);
689
689
  }
690
690
  save() {
691
691
  let s = JSON.stringify(this.milestones);
692
- R() && localStorage.setItem("syncmilestones", s);
692
+ P() && localStorage.setItem("syncmilestones", s);
693
693
  }
694
694
  // milestone tracking during a sync
695
695
  start(s) {
@@ -697,9 +697,9 @@ class Xe {
697
697
  debugger;
698
698
  return;
699
699
  }
700
- let r = Number(this.milestones[0].Run), t = new _(r + 1);
700
+ let r = Number(this.milestones[0].Run), t = new M(r + 1);
701
701
  this.milestones.unshift(t), this.milestones = this.milestones.map((e) => {
702
- let a = new _(e.Run);
702
+ let a = new M(e.Run);
703
703
  return a.Start = e.Start, a.startDisplay = e.startDisplay, a.POST = e.POST, a.postDisplay = e.postDisplay, a.Read = e.Read, a.readDisplay = e.readDisplay, a.Write = e.Write, a.writeDisplay = e.writeDisplay, a.Duration = e.Duration, a.durationDisplay = e.durationDisplay, a;
704
704
  }), s(this.milestones), console.log(`Start milestone: ${this.milestones[0].Run}:${this.milestones[0].Start}`);
705
705
  }
@@ -710,7 +710,7 @@ class Xe {
710
710
  }
711
711
  let r = this.milestones.shift();
712
712
  this.milestones = this.milestones.map((t) => {
713
- let e = new _(t.Run);
713
+ let e = new M(t.Run);
714
714
  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;
715
715
  }), s(this.milestones), console.log(`Unstart removed first milestone: ${r.Run}:${r.Start}`);
716
716
  }
@@ -738,60 +738,53 @@ class Xe {
738
738
  console.log(`Removed milestone #${r.Run}: ${r.Start}`);
739
739
  }
740
740
  this.save(), this.milestones = this.milestones.map((r) => {
741
- let t = new _(r.Run);
741
+ let t = new M(r.Run);
742
742
  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;
743
743
  }), s(this.milestones);
744
744
  }
745
745
  }
746
- H = new WeakSet(), we = function(s) {
746
+ q = new WeakSet(), me = function(s) {
747
747
  s == null ? this.milestones = new Array() : this.milestones = s.map((r) => {
748
- let t = new _(Number(r.Run));
748
+ let t = new M(Number(r.Run));
749
749
  return t.start(r.Start), t.post(r.POST), t.read(r.Read), t.write(r.Write), t;
750
750
  });
751
751
  };
752
- class qt {
752
+ class Ht {
753
753
  constructor(s, r, t) {
754
- u(this, "tenantNodes");
755
- u(this, "pb_startTS");
756
- u(this, "pb_progress");
757
- u(this, "pb_idle");
758
- u(this, "pb_total");
759
- u(this, "pb_timer");
754
+ c(this, "tenantNodes");
755
+ c(this, "pb_startTS");
756
+ c(this, "pb_progress");
757
+ c(this, "pb_idle");
758
+ c(this, "pb_total");
759
+ c(this, "pb_timer");
760
760
  // Polling: /api/stats is the single source of truth for hydration.
761
- u(this, "pollIntervalSeconds", 5);
762
- u(this, "pollTimer", null);
763
- u(this, "pollLastUpdatedByBatchId", {});
764
- u(this, "pollInstance", null);
765
- u(this, "pollAuthorizedUser", null);
766
- u(this, "pollBatchIdArray", []);
767
- // Last known backend queues (strongest completion signal)
768
- u(this, "lastQueues", {
769
- main: null,
770
- writer: null,
771
- deferred: null
772
- });
773
- u(this, "hasQueueInfo", !1);
761
+ c(this, "pollIntervalSeconds", 5);
762
+ c(this, "pollTimer", null);
763
+ c(this, "pollLastUpdatedByBatchId", {});
764
+ c(this, "pollInstance", null);
765
+ c(this, "pollAuthorizedUser", null);
766
+ c(this, "pollBatchIdArray", []);
774
767
  // Store UI callbacks so we can update the UI from poll/completion events.
775
- u(this, "setIdleText", null);
768
+ c(this, "setIdleText", null);
776
769
  // Handler used by polling: we reuse the same stats-processing logic.
777
- u(this, "statsHydrationHandler", null);
778
- u(this, "milestoneArray");
779
- this.tenantNodes = new Array(), this.init(s, r, t), this.pb_startTS = 0, this.pb_progress = 0, this.pb_timer = null, this.pb_idle = 0, this.pb_total = 0, this.milestoneArray = new Xe(!1);
770
+ c(this, "statsHydrationHandler", null);
771
+ c(this, "milestoneArray");
772
+ this.tenantNodes = new Array(), this.init(s, r, t), this.pb_startTS = 0, this.pb_progress = 0, this.pb_timer = null, this.pb_idle = 0, this.pb_total = 0, this.milestoneArray = new Qe(!1);
780
773
  }
781
774
  clearStoredBatchIds() {
782
- R() && (localStorage.setItem("BatchIdArray", "[]"), localStorage.removeItem("BatchIdArrayProgress"));
775
+ P() && (localStorage.setItem("BatchIdArray", "[]"), localStorage.removeItem("BatchIdArrayProgress"));
783
776
  }
784
777
  // populate tenantNodes based on config tenants
785
778
  init(s, r, t) {
786
779
  console.log(
787
780
  `Calling BatchArray::init(config: "${s ? s.name : "null"}", bClearLocalStorage: ${t ? "true" : "false"})`
788
- ), t && R() && (localStorage.removeItem(s.name), this.milestoneArray.init(t)), s != null && s.tenants != null && r != null && (this.tenantNodes.length = 0, s.tenants.map((e) => {
781
+ ), t && P() && (localStorage.removeItem(s.name), this.milestoneArray.init(t)), s != null && s.tenants != null && r != null && (this.tenantNodes.length = 0, s.tenants.map((e) => {
789
782
  if (e.configurationTenantType === "source" || e.configurationTenantType === "sourcetarget") {
790
783
  let a = r.ts.find(
791
784
  (o) => o.tid === e.tid
792
785
  );
793
786
  if (a != null) {
794
- let o = new Re(
787
+ let o = new ve(
795
788
  e.tid,
796
789
  a.name,
797
790
  e.batchId
@@ -812,7 +805,7 @@ class qt {
812
805
  (d) => d.tid === a.tid
813
806
  );
814
807
  if (o != null) {
815
- let d = new Re(
808
+ let d = new ve(
816
809
  a.tid,
817
810
  o.name,
818
811
  a.batchId
@@ -830,12 +823,8 @@ class qt {
830
823
  }));
831
824
  }
832
825
  initializeProgressBar(s, r, t, e) {
833
- this.setIdleText = t, this.hasQueueInfo = !1, this.lastQueues = { main: null, writer: null, deferred: null }, this.pb_startTS = Date.now(), this.pb_progress = 0, this.pb_idle = 0, this.pb_total = 0, s(this.pb_progress), t("Starting sync..."), this.pb_timer = setInterval(() => {
834
- console.log("this.tenantNodes", this.tenantNodes);
835
- let a = this.tenantNodes.every(
836
- (i) => i.nothingtosync || i.targets.every((l) => l.status === "complete" || l.status === "failed")
837
- );
838
- this.hasQueueInfo && this.lastQueues.main === 0 && this.lastQueues.writer === 0 && this.lastQueues.deferred === 0 || !this.hasQueueInfo && a ? (clearInterval(this.pb_timer), this.pb_timer = null, this.pb_progress = 100, s(this.pb_progress), t("Complete."), this.stopPolling(), this.clearStoredBatchIds()) : (this.pb_total = this.pb_total + 1, this.pb_idle = this.pb_idle + 1, t(`${this.pb_total} seconds elapsed. Last update ${this.pb_idle} seconds ago.`));
826
+ this.setIdleText = t, this.pb_startTS = Date.now(), this.pb_progress = 0, this.pb_idle = 0, this.pb_total = 0, s(this.pb_progress), t("Starting sync..."), this.pb_timer = setInterval(() => {
827
+ console.log("this.tenantNodes", this.tenantNodes), this.pb_total = this.pb_total + 1, this.pb_idle = this.pb_idle + 1, t(`${this.pb_total} seconds elapsed. Last update ${this.pb_idle} seconds ago.`);
839
828
  }, 1e3), this.milestoneArray.start(e);
840
829
  }
841
830
  stopPolling() {
@@ -846,7 +835,7 @@ class qt {
846
835
  for (const s of this.pollBatchIdArray) {
847
836
  const r = s == null ? void 0 : s.BatchId;
848
837
  if (!r) continue;
849
- const t = await Bt(this.pollInstance, this.pollAuthorizedUser, r);
838
+ const t = await Nt(this.pollInstance, this.pollAuthorizedUser, r);
850
839
  if (!t.result || !t.array || !t.array[0]) continue;
851
840
  const e = t.array[0], a = e.lastUpdated, o = this.pollLastUpdatedByBatchId[r];
852
841
  this.pollLastUpdatedByBatchId[r] = a ?? "", !(!a || a === o) && this.statsHydrationHandler(r, e.stats);
@@ -882,63 +871,63 @@ class qt {
882
871
  }
883
872
  updateProgressFromTotals(s, r, t, e, a, o) {
884
873
  const d = this.calculateProgress(s, r, t, e, a);
885
- this.pb_progress = Math.max(this.pb_progress, d), o(this.pb_progress), R() && localStorage.setItem("BatchIdArrayProgress", String(this.pb_progress));
874
+ this.pb_progress = Math.max(this.pb_progress, d), o(this.pb_progress), P() && localStorage.setItem("BatchIdArrayProgress", String(this.pb_progress));
886
875
  }
887
- initializeSignalR(s, r, t, e, a, o, d, i, l, c, f, b, A, C, N, B, v) {
888
- this.hasQueueInfo = !1, this.lastQueues = { main: null, writer: null, deferred: null }, this.milestoneArray.post(f), b("started sync, waiting for updates..."), this.init(s, r, !1);
889
- let k = (O, Se) => {
890
- var De, ve;
876
+ initializeSignalR(s, r, t, e, a, o, d, i, l, u, f, b, A, C, N, B, D) {
877
+ this.milestoneArray.post(f), b("started sync, waiting for updates..."), this.init(s, r, !1);
878
+ let k = (O, we) => {
879
+ var ke, Ee;
891
880
  this.pb_idle = 0;
892
- let z = t.find((p) => p.BatchId == O);
881
+ let z = t.find((h) => h.BatchId == O);
893
882
  if (z == null) {
894
883
  console.log(`Batch ${O} not found in batchIdArray.`);
895
884
  debugger;
896
885
  return;
897
886
  }
898
- let g = this.tenantNodes.find((p) => p.tid === z.SourceId);
887
+ let g = this.tenantNodes.find((h) => h.tid === z.SourceId);
899
888
  if (g == null) {
900
889
  console.log(`Tenant ${z.SourceId} not found in BatchArray.`);
901
890
  debugger;
902
891
  return;
903
892
  }
904
893
  g.batchId = z.BatchId;
905
- let E = Object.keys(Se), P = Object.values(Se), X = !1, Ie = !1, Y = null, ee = null, te = null;
906
- for (let p = 0; p < E.length; p++) {
907
- let D = E[p].endsWith("TotalCount"), Q = E[p].endsWith("CurrentCount"), le = E[p].endsWith("ExtCount"), K = E[p].endsWith("DeferredCount"), ue = E[p].endsWith("RescheduledCount");
908
- if (le && (g.excluded = Math.max(Number(P[p]), g.excluded), g.targets.map((w) => {
894
+ let v = Object.keys(we), R = Object.values(we), ee = !1, Te = !1;
895
+ for (let h = 0; h < v.length; h++) {
896
+ let E = v[h].endsWith("TotalCount"), V = v[h].endsWith("CurrentCount"), oe = v[h].endsWith("ExtCount"), Z = v[h].endsWith("DeferredCount"), ie = v[h].endsWith("RescheduledCount");
897
+ if (oe && (g.excluded = Math.max(Number(R[h]), g.excluded), g.targets.map((w) => {
909
898
  w.excluded = g.excluded, w.update(w.total, w.read, w.excluded, w.written, w.deferred);
910
- })), D && (X = Number(P[p]) == 0, g.total = Math.max(Number(P[p]), g.total), g.targets.map((w) => {
899
+ })), E && (ee = Number(R[h]) == 0, g.total = Math.max(Number(R[h]), g.total), g.targets.map((w) => {
911
900
  w.total = g.total, w.update(w.total, w.read, w.excluded, w.written, w.deferred);
912
- })), E[p].startsWith("Reader")) {
901
+ })), v[h].startsWith("Reader")) {
913
902
  let w = /Reader\/TID:(.+)\/TotalCount/;
914
- if (Q && (w = /Reader\/TID:(.+)\/CurrentCount/), le && (w = /Reader\/TID:(.+)\/ExtCount/), K && (w = /Reader\/TID:(.+)\/DeferredCount/), ue && (w = /Reader\/TID:(.+)\/RescheduledCount/), E[p].match(w) == null) {
915
- console.log(`tid not found in ${E[p]}.`);
903
+ if (V && (w = /Reader\/TID:(.+)\/CurrentCount/), oe && (w = /Reader\/TID:(.+)\/ExtCount/), Z && (w = /Reader\/TID:(.+)\/DeferredCount/), ie && (w = /Reader\/TID:(.+)\/RescheduledCount/), v[h].match(w) == null) {
904
+ console.log(`tid not found in ${v[h]}.`);
916
905
  debugger;
917
906
  return;
918
907
  }
919
- D ? (X = Number(P[p]) == 0, g.total = Math.max(Number(P[p]), g.total), console.log(`----- ${g.name} TID: ${g.tid} batchId: ${g.batchId}`), console.log(`----- ${g.name} Total To Read: ${g.total}`)) : (Ie = Number(P[p]) == 0, Q ? (g.read = Math.max(Number(P[p]), g.read), console.log(`----- ${g.name} Currently Read: ${g.read}`)) : K && (g.deferred = Math.max(Number(P[p]), g.deferred), console.log(`----- ${g.name} Deferred: ${g.deferred}`)));
908
+ E ? (ee = Number(R[h]) == 0, g.total = Math.max(Number(R[h]), g.total), console.log(`----- ${g.name} TID: ${g.tid} batchId: ${g.batchId}`), console.log(`----- ${g.name} Total To Read: ${g.total}`)) : (Te = Number(R[h]) == 0, V ? (g.read = Math.max(Number(R[h]), g.read), console.log(`----- ${g.name} Currently Read: ${g.read}`)) : Z && (g.deferred = Math.max(Number(R[h]), g.deferred), console.log(`----- ${g.name} Deferred: ${g.deferred}`)));
920
909
  }
921
- if (g.nothingtosync = X && Ie, E[p] === "TotalInMainQueue" && (Y = Number(P[p])), E[p] === "TotalInWriterQueue" && (ee = Number(P[p])), E[p] === "TotalInDeferredQueue" && (te = Number(P[p])), E[p].startsWith("Writer")) {
910
+ if (g.nothingtosync = ee && Te, v[h].startsWith("Writer")) {
922
911
  let w = /Writer\/TID:(.+)\/TotalCount/;
923
- Q && (w = /Writer\/TID:(.+)\/CurrentCount/), le && (w = /Writer\/TID:(.+)\/ExtCount/), K && (w = /Writer\/TID:(.+)\/DeferredCount/), ue && (w = /Writer\/TID:(.+)\/RescheduledCount/);
924
- let de = E[p].match(w);
925
- if (de == null) {
926
- console.log(`tid not found in ${E[p]}.`);
912
+ V && (w = /Writer\/TID:(.+)\/CurrentCount/), oe && (w = /Writer\/TID:(.+)\/ExtCount/), Z && (w = /Writer\/TID:(.+)\/DeferredCount/), ie && (w = /Writer\/TID:(.+)\/RescheduledCount/);
913
+ let le = v[h].match(w);
914
+ if (le == null) {
915
+ console.log(`tid not found in ${v[h]}.`);
927
916
  debugger;
928
917
  return;
929
918
  }
930
- let T = g.targets.find((Oe) => Oe.tid === de[1]);
919
+ let T = g.targets.find((Ce) => Ce.tid === le[1]);
931
920
  if (T == null) {
932
921
  console.log(`Writer ${g.name} not found under Reader ${g.name}.`);
933
922
  debugger;
934
923
  return;
935
924
  }
936
- if (T.total = Math.max(Number(g.total), T.total), T.total = Math.max(Number(g.total), T.total), T.batchId = z.BatchId, D)
937
- T.total = Math.max(Number(P[p]), T.total), console.log(`----- ${T.name} TID: ${T.tid} batchId: ${T.batchId}`), console.log(`----- ${T.name} Total To Write: ${T.total}`);
938
- else if (Q)
939
- T.written = Math.max(Number(P[p]), T.written), console.log(`----- ${T.name} Total Written: ${T.written}`);
940
- else if (K || ue)
941
- T.deferred = Math.max(Number(P[p]), T.deferred), console.log(`----- ${T.name} Total Deferred: ${T.deferred}`);
925
+ if (T.total = Math.max(Number(g.total), T.total), T.total = Math.max(Number(g.total), T.total), T.batchId = z.BatchId, E)
926
+ T.total = Math.max(Number(R[h]), T.total), console.log(`----- ${T.name} TID: ${T.tid} batchId: ${T.batchId}`), console.log(`----- ${T.name} Total To Write: ${T.total}`);
927
+ else if (V)
928
+ T.written = Math.max(Number(R[h]), T.written), console.log(`----- ${T.name} Total Written: ${T.written}`);
929
+ else if (Z || ie)
930
+ T.deferred = Math.max(Number(R[h]), T.deferred), console.log(`----- ${T.name} Total Deferred: ${T.deferred}`);
942
931
  else {
943
932
  console.log("unknown writer type");
944
933
  debugger;
@@ -948,28 +937,28 @@ class qt {
948
937
  }
949
938
  }
950
939
  g.update(g.total, g.read, g.excluded, g.written, g.deferred);
951
- let be = !0, se = !0, $e = !1, Ae = !0, q = 0, re = 0, ae = 0, ne = 0, oe = 0, ie = 0, ke = 0;
952
- this.tenantNodes.map((p) => {
953
- p.targets.map((D) => {
954
- se && (se = D.status == "complete" || D.status == "failed"), $e || ($e = D.total > 0 || D.status != "not started"), ne += Math.max(D.total, p.total), oe += D.written, ie += D.excluded, ke += D.deferred;
955
- }), Ae && (Ae = p.nothingtosync), be && (be = p.total > 0 && p.read + p.excluded >= p.total), q += p.total, re += p.read, ae += p.excluded;
956
- }), Y != null && (this.lastQueues.main = Y), ee != null && (this.lastQueues.writer = ee), te != null && (this.lastQueues.deferred = te), this.hasQueueInfo = this.lastQueues.main != null && this.lastQueues.writer != null && this.lastQueues.deferred != null;
957
- const Ee = this.hasQueueInfo && this.lastQueues.main === 0 && this.lastQueues.writer === 0 && this.lastQueues.deferred === 0;
958
- Ee && (se = !0, this.tenantNodes.forEach((p) => {
959
- p.targets.forEach((D) => {
960
- D.status !== "failed" && (D.status = "complete");
961
- }), p.status !== "failed" && (p.status = "complete");
962
- })), a(q), d(re), o(ae), i(Math.max(ne, q)), c(oe), l(ie), this.updateProgressFromTotals(
963
- Math.max(q, ne),
964
- re,
965
- oe,
966
- Math.max(ae, ie),
940
+ let Se = !0, te = !0, Ie = !1, be = !0, _ = 0, se = 0, K = 0, re = 0, J = 0, ae = 0, ne = 0;
941
+ this.tenantNodes.map((h) => {
942
+ h.targets.map((E) => {
943
+ te && (te = E.status == "complete" || E.status == "failed"), Ie || (Ie = E.total > 0 || E.status != "not started"), re += Math.max(E.total, h.total), J += E.written, ae += E.excluded, ne += E.deferred;
944
+ }), be && (be = h.nothingtosync), Se && (Se = h.total > 0 && h.read + h.excluded >= h.total), _ += h.total, se += h.read, K += h.excluded;
945
+ });
946
+ const $e = _ - K, xe = J + ne, Ae = $e > 0 && $e === xe;
947
+ Ae && (te = !0, this.tenantNodes.forEach((h) => {
948
+ h.targets.forEach((E) => {
949
+ E.status !== "failed" && (E.status = "complete");
950
+ }), h.status !== "failed" && (h.status = "complete");
951
+ })), a(_), d(se), o(K), i(Math.max(re, _)), u(J), l(ae), this.updateProgressFromTotals(
952
+ Math.max(_, re),
953
+ se,
954
+ J,
955
+ Math.max(K, ae),
967
956
  // Deferred users count as completed for write.
968
- ke,
957
+ ne,
969
958
  A
970
- ), Ae ? (this.milestoneArray.write(f), this.stopPolling(), b("nothing to sync"), this.pb_timer && (clearInterval(this.pb_timer), this.pb_timer = null), this.pb_progress = 100, A(this.pb_progress), (De = this.setIdleText) == null || De.call(this, "Complete (nothing to sync)."), this.clearStoredBatchIds(), console.log('Setting config sync result: "nothing to sync"')) : (be && (this.milestoneArray.read(f), b("reading complete"), console.log('Setting config sync result: "reading complete"'), e(s.workspaceId)), se && (Ee || !this.hasQueueInfo) ? (this.milestoneArray.write(f), this.stopPolling(), b("sync complete"), this.pb_timer && (clearInterval(this.pb_timer), this.pb_timer = null), this.pb_progress = 100, A(this.pb_progress), (ve = this.setIdleText) == null || ve.call(this, "Complete."), this.clearStoredBatchIds(), console.log('Setting config sync result: "complete"')) : $e ? (b("writing in progress"), console.log('Setting config sync result: "writing in progress"')) : this.milestoneArray.milestones[0].Read == null && (b("reading in progress"), console.log('Setting config sync result: "reading in progress"')));
959
+ ), be ? (this.milestoneArray.write(f), this.stopPolling(), b("nothing to sync"), this.pb_timer && (clearInterval(this.pb_timer), this.pb_timer = null), this.pb_progress = 100, A(this.pb_progress), (ke = this.setIdleText) == null || ke.call(this, "Complete (nothing to sync)."), this.clearStoredBatchIds(), console.log('Setting config sync result: "nothing to sync"')) : (Se && (this.milestoneArray.read(f), b("reading complete"), console.log('Setting config sync result: "reading complete"'), e(s.workspaceId)), te && Ae ? (this.milestoneArray.write(f), this.stopPolling(), b("sync complete"), this.pb_timer && (clearInterval(this.pb_timer), this.pb_timer = null), this.pb_progress = 100, A(this.pb_progress), (Ee = this.setIdleText) == null || Ee.call(this, "Complete."), this.clearStoredBatchIds(), console.log('Setting config sync result: "complete"')) : Ie ? (b("writing in progress"), console.log('Setting config sync result: "writing in progress"')) : this.milestoneArray.milestones[0].Read == null && (b("reading in progress"), console.log('Setting config sync result: "reading in progress"')));
971
960
  };
972
- this.statsHydrationHandler = k, B && v && (this.pollInstance = B, this.pollAuthorizedUser = v, this.pollBatchIdArray = t, this.stopPolling(), this.pollInstance = B, this.pollAuthorizedUser = v, this.pollBatchIdArray = t, this.pollStatsOnce(), this.pollTimer = setInterval(() => {
961
+ this.statsHydrationHandler = k, B && D && (this.pollInstance = B, this.pollAuthorizedUser = D, this.pollBatchIdArray = t, this.stopPolling(), this.pollInstance = B, this.pollAuthorizedUser = D, this.pollBatchIdArray = t, this.pollStatsOnce(), this.pollTimer = setInterval(() => {
973
962
  this.pollStatsOnce();
974
963
  }, this.pollIntervalSeconds * 1e3));
975
964
  }
@@ -980,23 +969,23 @@ class qt {
980
969
  debugger;
981
970
  return e.result = !1, e.error = "startSync: invalid parameters", e.status = 500, e;
982
971
  }
983
- return e = await Nt(s, r, t), e;
972
+ return e = await Ot(s, r, t), e;
984
973
  }
985
974
  }
986
- class Re {
975
+ class ve {
987
976
  constructor(s, r, t) {
988
- u(this, "expanded");
989
- u(this, "status", "");
990
- u(this, "name");
991
- u(this, "tid");
992
- u(this, "batchId");
993
- u(this, "total", 0);
994
- u(this, "read", 0);
995
- u(this, "excluded", 0);
996
- u(this, "written", 0);
997
- u(this, "deferred", 0);
998
- u(this, "nothingtosync");
999
- u(this, "targets");
977
+ c(this, "expanded");
978
+ c(this, "status", "");
979
+ c(this, "name");
980
+ c(this, "tid");
981
+ c(this, "batchId");
982
+ c(this, "total", 0);
983
+ c(this, "read", 0);
984
+ c(this, "excluded", 0);
985
+ c(this, "written", 0);
986
+ c(this, "deferred", 0);
987
+ c(this, "nothingtosync");
988
+ c(this, "targets");
1000
989
  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);
1001
990
  }
1002
991
  update(s, r, t, e, a) {
@@ -1012,14 +1001,14 @@ class Re {
1012
1001
  } else 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"));
1013
1002
  }
1014
1003
  }
1015
- class xe {
1004
+ class Re {
1016
1005
  constructor(s, r) {
1017
- u(this, "resourceNodes");
1006
+ c(this, "resourceNodes");
1018
1007
  this.resourceNodes = new Array(), s && this.init(r);
1019
1008
  }
1020
1009
  // get resource data from localStorage or file
1021
1010
  init(s) {
1022
- if (console.log(`Calling ResourceArray::init(bClearLocalStorage: ${s ? "true" : "false"})`), R()) {
1011
+ if (console.log(`Calling ResourceArray::init(bClearLocalStorage: ${s ? "true" : "false"})`), P()) {
1023
1012
  let t = localStorage.getItem("ResourceArray");
1024
1013
  if (t != null && typeof t == "string" && t !== "")
1025
1014
  if (s)
@@ -1030,44 +1019,44 @@ class xe {
1030
1019
  return;
1031
1020
  }
1032
1021
  }
1033
- var r = JSON.stringify(Me);
1022
+ var r = JSON.stringify(_e);
1034
1023
  try {
1035
- this.resourceNodes = U(Ye, r);
1024
+ this.resourceNodes = U(Xe, r);
1036
1025
  } catch {
1037
1026
  debugger;
1038
1027
  }
1039
1028
  }
1040
1029
  // read
1041
1030
  async read(s, r) {
1042
- let t = new xe(!1, !1);
1043
- return t.resourceNodes = await ct(s, r), t;
1031
+ let t = new Re(!1, !1);
1032
+ return t.resourceNodes = await dt(s, r), t;
1044
1033
  }
1045
1034
  // save resource data to localstorage
1046
1035
  save() {
1047
- if (R()) {
1036
+ if (P()) {
1048
1037
  let s = JSON.stringify(this);
1049
1038
  localStorage.setItem("ResourceArray", s);
1050
1039
  }
1051
1040
  }
1052
1041
  }
1053
- class Ye {
1042
+ class Xe {
1054
1043
  constructor(s, r, t) {
1055
- u(this, "type");
1056
- u(this, "resource");
1057
- u(this, "cost");
1058
- u(this, "expanded");
1059
- u(this, "resources");
1044
+ c(this, "type");
1045
+ c(this, "resource");
1046
+ c(this, "cost");
1047
+ c(this, "expanded");
1048
+ c(this, "resources");
1060
1049
  this.type = s, this.resource = r, this.cost = t, this.expanded = !1, this.resources = new Array();
1061
1050
  }
1062
1051
  }
1063
- class Qt {
1052
+ class qt {
1064
1053
  constructor(s) {
1065
- u(this, "actorNodes");
1054
+ c(this, "actorNodes");
1066
1055
  this.actorNodes = new Array(), this.init(s);
1067
1056
  }
1068
1057
  // get initial data from localStorage or file
1069
1058
  init(s) {
1070
- if (console.log(`Calling ResourceArray::init(bClearLocalStorage: ${s ? "true" : "false"})`), R()) {
1059
+ if (console.log(`Calling ResourceArray::init(bClearLocalStorage: ${s ? "true" : "false"})`), P()) {
1071
1060
  let t = localStorage.getItem("RBACActors");
1072
1061
  if (t != null && typeof t == "string" && t !== "")
1073
1062
  if (s)
@@ -1078,33 +1067,33 @@ class Qt {
1078
1067
  return;
1079
1068
  }
1080
1069
  }
1081
- var r = JSON.stringify(je);
1070
+ var r = JSON.stringify(Me);
1082
1071
  try {
1083
- this.actorNodes = U(et, r);
1072
+ this.actorNodes = U(Ye, r);
1084
1073
  } catch {
1085
1074
  debugger;
1086
1075
  }
1087
1076
  }
1088
1077
  }
1089
- class et {
1078
+ class Ye {
1090
1079
  constructor(s, r, t, e, a, o) {
1091
- u(this, "type");
1092
- u(this, "actor");
1093
- u(this, "resource");
1094
- u(this, "role");
1095
- u(this, "updatedby");
1096
- u(this, "updatedon");
1097
- u(this, "actors");
1080
+ c(this, "type");
1081
+ c(this, "actor");
1082
+ c(this, "resource");
1083
+ c(this, "role");
1084
+ c(this, "updatedby");
1085
+ c(this, "updatedon");
1086
+ c(this, "actors");
1098
1087
  this.type = s, this.actor = r, this.resource = t, this.role = e, this.updatedby = a, this.updatedon = o, this.actors = new Array();
1099
1088
  }
1100
1089
  }
1101
- function tt(n) {
1090
+ function et(n) {
1102
1091
  return "Group.Read.All User.Read.All openid profile offline_access User.Read Contacts.Read CrossTenantInformation.ReadBasic.All";
1103
1092
  }
1104
- async function Z(n, s) {
1093
+ async function Y(n, s) {
1105
1094
  const r = new Headers();
1106
1095
  r.append("Content-Type", "application/json"), r.append("accept", "*/*");
1107
- const t = tt();
1096
+ const t = et();
1108
1097
  if (s.graphAccessToken == null || s.graphAccessToken === "")
1109
1098
  try {
1110
1099
  let e = await n.acquireTokenByCode({
@@ -1143,9 +1132,9 @@ async function Z(n, s) {
1143
1132
  async function Kt(n, s, r) {
1144
1133
  if (s == null || s.spacode == "")
1145
1134
  return { groups: [], error: "500: invalid user passed to groupsGet" };
1146
- let e = { method: "GET", headers: await Z(n, s) };
1135
+ let e = { method: "GET", headers: await Y(n, s) };
1147
1136
  try {
1148
- let a = W(s.authority) + h.graphGroupsPredicate;
1137
+ let a = W(s.authority) + p.graphGroupsPredicate;
1149
1138
  a += `/?$filter=startsWith(displayName, '${r}')`;
1150
1139
  let d = await (await fetch(a, e)).json();
1151
1140
  return typeof d.error < "u" ? { groups: [], error: `${d.error.code}: ${d.error.message}` } : { groups: d.value, error: "" };
@@ -1153,9 +1142,9 @@ async function Kt(n, s, r) {
1153
1142
  return console.log(a), { groups: [], error: `Exception: ${a}` };
1154
1143
  }
1155
1144
  }
1156
- async function st(n, s, r, t) {
1145
+ async function tt(n, s, r, t) {
1157
1146
  try {
1158
- let e = W(s.authority) + h.graphOauth2PermissionGrantsPredicate, a = new URL(e);
1147
+ let e = W(s.authority) + p.graphOauth2PermissionGrantsPredicate, a = new URL(e);
1159
1148
  a.searchParams.append("$filter", `resourceId eq '${r}' and consentType eq 'Principal' and principalId eq '${t}'`);
1160
1149
  let d = await (await fetch(a.href, n)).json();
1161
1150
  if (typeof d.error < "u")
@@ -1169,13 +1158,13 @@ async function st(n, s, r, t) {
1169
1158
  return console.log(e), { grants: null, id: null, error: `Exception: ${e}` };
1170
1159
  }
1171
1160
  }
1172
- async function rt(n, s, r, t) {
1161
+ async function st(n, s, r, t) {
1173
1162
  if (s == null || s.spacode == "")
1174
1163
  return !1;
1175
1164
  try {
1176
1165
  let e = W(s.authority);
1177
- e += h.graphOauth2PermissionGrantsPredicate + `/${r}`;
1178
- let a = `{ "scope": "${t}" }`, d = { method: "PATCH", headers: await Z(n, s), body: a }, i = await fetch(e, d), l = await i.json();
1166
+ e += p.graphOauth2PermissionGrantsPredicate + `/${r}`;
1167
+ let a = `{ "scope": "${t}" }`, d = { method: "PATCH", headers: await Y(n, s), body: a }, i = await fetch(e, d), l = await i.json();
1179
1168
  if (i.status == 204 && i.statusText == "No Content")
1180
1169
  return !0;
1181
1170
  debugger;
@@ -1188,13 +1177,13 @@ async function rt(n, s, r, t) {
1188
1177
  function Jt(n, s) {
1189
1178
  let r = Ke(n.authority);
1190
1179
  r += n.tid, r += "/adminconsent";
1191
- let t = new URL(r), e = Qe(n.authority, s);
1180
+ let t = new URL(r), e = qe(n.authority, s);
1192
1181
  t.searchParams.append("client_id", e), t.searchParams.append("redirect_uri", window.location.origin), t.searchParams.append("domain_hint", n.companyDomain), t.searchParams.append("login_hint", n.mail), window.location.assign(t.href);
1193
1182
  }
1194
- async function at(n, s, r) {
1183
+ async function rt(n, s, r) {
1195
1184
  try {
1196
1185
  let t = W(s.authority);
1197
- t += h.graphServicePrincipalsPredicate, t += `(appId='${r}')`;
1186
+ t += p.graphServicePrincipalsPredicate, t += `(appId='${r}')`;
1198
1187
  let e = new URL(t);
1199
1188
  e.searchParams.append("$select", "id,appId,displayName");
1200
1189
  let o = await (await fetch(e.href, n)).json();
@@ -1205,8 +1194,8 @@ async function at(n, s, r) {
1205
1194
  }
1206
1195
  async function Vt(n, s) {
1207
1196
  if (n.authority == "") {
1208
- let e = new j();
1209
- if (e.domain = n.tid, await Ce(e, !1))
1197
+ let e = new H();
1198
+ if (e.domain = n.tid, await Ge(e, !1))
1210
1199
  n.authority = e.authority;
1211
1200
  else {
1212
1201
  debugger;
@@ -1215,13 +1204,13 @@ async function Vt(n, s) {
1215
1204
  }
1216
1205
  let r = window.location.href;
1217
1206
  switch (n.authority) {
1218
- case h.authorityWW:
1207
+ case p.authorityWW:
1219
1208
  r += "MicrosoftIdentity/Account/SignIn";
1220
1209
  break;
1221
- case h.authorityUS:
1210
+ case p.authorityUS:
1222
1211
  r += "USGov/SignIn";
1223
1212
  break;
1224
- case h.authorityCN:
1213
+ case p.authorityCN:
1225
1214
  r += "China/SignIn";
1226
1215
  break;
1227
1216
  default:
@@ -1242,13 +1231,13 @@ function Zt(n, s) {
1242
1231
  if (n.oid == "1") return;
1243
1232
  let r = window.location.href;
1244
1233
  switch (n.authority) {
1245
- case h.authorityWW:
1234
+ case p.authorityWW:
1246
1235
  r += "MicrosoftIdentity/Account/Challenge";
1247
1236
  break;
1248
- case h.authorityUS:
1237
+ case p.authorityUS:
1249
1238
  r += "USGov/Challenge";
1250
1239
  break;
1251
- case h.authorityCN:
1240
+ case p.authorityCN:
1252
1241
  r += "China/Challenge";
1253
1242
  break;
1254
1243
  default:
@@ -1257,7 +1246,7 @@ function Zt(n, s) {
1257
1246
  let t = new URL(r);
1258
1247
  t.searchParams.append("redirectUri", window.location.origin), t.searchParams.append("scope", s), t.searchParams.append("domainHint", "organizations"), t.searchParams.append("loginHint", n.mail), window.location.assign(t.href);
1259
1248
  }
1260
- async function Xt(n) {
1249
+ async function Qt(n) {
1261
1250
  if (n.oid == "1") return !1;
1262
1251
  let s = window.location.href;
1263
1252
  s += "user";
@@ -1270,13 +1259,13 @@ async function Xt(n) {
1270
1259
  return console.log(`Failed to set admin ${n.mail} logout_hint`), !1;
1271
1260
  let a = window.location.href;
1272
1261
  switch (n.authority) {
1273
- case h.authorityWW:
1262
+ case p.authorityWW:
1274
1263
  a += "MicrosoftIdentity/Account/SignOut";
1275
1264
  break;
1276
- case h.authorityUS:
1265
+ case p.authorityUS:
1277
1266
  a += "USGov/SignOut";
1278
1267
  break;
1279
- case h.authorityCN:
1268
+ case p.authorityCN:
1280
1269
  a += "China/SignOut";
1281
1270
  break;
1282
1271
  default:
@@ -1284,7 +1273,7 @@ async function Xt(n) {
1284
1273
  }
1285
1274
  return r = new URL(a), r.searchParams.append("redirectUri", window.location.origin), window.location.assign(r.href), !0;
1286
1275
  }
1287
- async function Yt(n, s, r, t) {
1276
+ async function Xt(n, s, r, t) {
1288
1277
  if (t) debugger;
1289
1278
  if (s.name != null && s.name !== "") return !1;
1290
1279
  if (n.graphAccessToken != null && n.graphAccessToken === "") {
@@ -1300,7 +1289,7 @@ async function Yt(n, s, r, t) {
1300
1289
  e.append("Authorization", a);
1301
1290
  let o = { method: "GET", headers: e };
1302
1291
  try {
1303
- var d = W(s.authority) + h.graphTenantByDomainPredicate;
1292
+ var d = W(s.authority) + p.graphTenantByDomainPredicate;
1304
1293
  d += "(domainName='", d += s.domain, d += "')", console.log("tenantRelationshipsGetByDomain: Attempting GET from /findTenantInformationByDomainName:", d);
1305
1294
  let i = await fetch(d, o);
1306
1295
  if (i.status == 200) {
@@ -1319,7 +1308,7 @@ async function Yt(n, s, r, t) {
1319
1308
  }
1320
1309
  return !1;
1321
1310
  }
1322
- async function nt(n, s, r, t, e) {
1311
+ async function at(n, s, r, t, e) {
1323
1312
  if (console.log("**** tenantRelationshipsGetById"), e) debugger;
1324
1313
  if (n.graphAccessToken === "")
1325
1314
  try {
@@ -1332,17 +1321,17 @@ async function nt(n, s, r, t, e) {
1332
1321
  a.append("Authorization", o);
1333
1322
  let d = { method: "GET", headers: a };
1334
1323
  try {
1335
- var i = W(n.authority) + h.graphTenantByIdPredicate;
1324
+ var i = W(n.authority) + p.graphTenantByIdPredicate;
1336
1325
  i += "(tenantId='", i += s.tid, i += "')", console.log("tenantRelationshipsGetById: Attempting GET from /findTenantInformationByTenantId:", i);
1337
- let c = await (await fetch(i, d)).json();
1338
- if (c && typeof c.displayName !== void 0 && c.displayName !== "") {
1326
+ let u = await (await fetch(i, d)).json();
1327
+ if (u && typeof u.displayName !== void 0 && u.displayName !== "") {
1339
1328
  if (s !== void 0)
1340
- s.name = c.displayName, s.domain = c.defaultDomainName;
1329
+ s.name = u.displayName, s.domain = u.defaultDomainName;
1341
1330
  else {
1342
1331
  console.log("tenantRelationshipsGetById: missing associated tenant for logged in user.");
1343
1332
  debugger;
1344
1333
  }
1345
- return console.log("tenantRelationshipsGetById: Successful GET from /findTenantInformationByTenantId: ", c.displayName), !0;
1334
+ return console.log("tenantRelationshipsGetById: Successful GET from /findTenantInformationByTenantId: ", u.displayName), !0;
1346
1335
  } else
1347
1336
  console.log("tenantRelationshipsGetById: Failed to GET from /findTenantInformationByTenantId: ", i);
1348
1337
  } catch (l) {
@@ -1350,9 +1339,9 @@ async function nt(n, s, r, t, e) {
1350
1339
  }
1351
1340
  return !1;
1352
1341
  }
1353
- async function Ce(n, s) {
1342
+ async function Ge(n, s) {
1354
1343
  if (s) debugger;
1355
- let r = [h.authorityWW, h.authorityUS, h.authorityCN], t = [h.authorityWWRegex, h.authorityUSRegex, h.authorityCNRegex], e = null;
1344
+ let r = [p.authorityWW, p.authorityUS, p.authorityCN], t = [p.authorityWWRegex, p.authorityUSRegex, p.authorityCNRegex], e = null;
1356
1345
  try {
1357
1346
  for (let i = 0; i < 3; i++) {
1358
1347
  var a = r[i];
@@ -1360,8 +1349,8 @@ async function Ce(n, s) {
1360
1349
  let l = await e.json();
1361
1350
  if (l) {
1362
1351
  var o = l.authorization_endpoint;
1363
- for (let c = 0; c < 3; c++) {
1364
- var d = o.match(t[c]);
1352
+ for (let u = 0; u < 3; u++) {
1353
+ var d = o.match(t[u]);
1365
1354
  if (d != null)
1366
1355
  return n.tid = d[2], n.authority = d[1], console.log(`Successful GET from openid well-known endpoint: tid: ${n.tid} authority: ${n.authority}`), !0;
1367
1356
  }
@@ -1375,22 +1364,22 @@ async function Ce(n, s) {
1375
1364
  }
1376
1365
  return (n.tid == "" || n.authority == "") && console.log(`GET from openid well-known endpoint failed to find tenant: ${e ? e.statusText : "unknown"}`), !1;
1377
1366
  }
1378
- async function ot(n, s, r) {
1367
+ async function nt(n, s, r) {
1379
1368
  if (s == null || s.spacode == "" || r == null) {
1380
1369
  debugger;
1381
1370
  return { scopes: null, id: null, error: "500: invalid parameter(s) passed to getUserDelegatedScopes" };
1382
1371
  }
1383
- let e = { method: "GET", headers: await Z(n, s) };
1372
+ let e = { method: "GET", headers: await Y(n, s) };
1384
1373
  try {
1385
1374
  if (r.graphSP == "") {
1386
- let { spid: i, error: l } = await at(e, s, "00000003-0000-0000-c000-000000000000");
1375
+ let { spid: i, error: l } = await rt(e, s, "00000003-0000-0000-c000-000000000000");
1387
1376
  if (l != "") {
1388
1377
  debugger;
1389
1378
  return { scopes: null, id: null, error: `${l}` };
1390
1379
  }
1391
1380
  r.graphSP = i;
1392
1381
  }
1393
- let { grants: a, id: o, error: d } = await st(e, s, r.graphSP, s.oid);
1382
+ let { grants: a, id: o, error: d } = await tt(e, s, r.graphSP, s.oid);
1394
1383
  if (d != "") {
1395
1384
  debugger;
1396
1385
  return { scopes: null, id: null, error: `${d}` };
@@ -1401,30 +1390,30 @@ async function ot(n, s, r) {
1401
1390
  return console.log(a), { scopes: null, id: null, error: `Exception: ${a}` };
1402
1391
  }
1403
1392
  }
1404
- async function es(n, s, r, t) {
1393
+ async function Yt(n, s, r, t) {
1405
1394
  if (s == null || s.spacode == "" || r == null) {
1406
1395
  debugger;
1407
1396
  return !1;
1408
1397
  }
1409
- let { scopes: e, id: a, error: o } = await ot(n, s, r);
1398
+ let { scopes: e, id: a, error: o } = await nt(n, s, r);
1410
1399
  if (o != "") {
1411
1400
  debugger;
1412
1401
  return console.log(`userDelegatedScopesRemove: cannot find userDelegatedScopes for ${s.mail}: ${o}`), !1;
1413
1402
  }
1414
1403
  e = e.replace(t, "");
1415
- let d = await rt(n, s, a, e);
1404
+ let d = await st(n, s, a, e);
1416
1405
  if (!d) {
1417
1406
  debugger;
1418
1407
  return console.log(`userDelegatedScopesRemove: cannot set oauth2PermissionGrants for ${s.mail}: ${o}`), !1;
1419
1408
  }
1420
1409
  return s.scopes = e.split(" "), d;
1421
1410
  }
1422
- async function ts(n, s) {
1411
+ async function es(n, s) {
1423
1412
  if (s == null || s.spacode == "")
1424
1413
  return { users: [], error: "500: invalid user passed to usersGet" };
1425
1414
  try {
1426
- let t = { method: "GET", headers: await Z(n, s) }, e = W(s.authority);
1427
- e += h.graphUsersPredicate;
1415
+ let t = { method: "GET", headers: await Y(n, s) }, e = W(s.authority);
1416
+ e += p.graphUsersPredicate;
1428
1417
  let o = await (await fetch(e, t)).json();
1429
1418
  if (typeof o.error < "u")
1430
1419
  return { users: [], error: `${o.error.code}: ${o.error.message}` };
@@ -1436,55 +1425,55 @@ async function ts(n, s) {
1436
1425
  return console.log(r), { users: [], error: `Exception: ${r}` };
1437
1426
  }
1438
1427
  }
1428
+ async function ts(n, s, r, t) {
1429
+ return gt(n, s, r, t);
1430
+ }
1439
1431
  async function ss(n, s, r, t) {
1440
1432
  return mt(n, s, r, t);
1441
1433
  }
1442
- async function rs(n, s, r, t) {
1443
- return yt(n, s, r, t);
1444
- }
1445
- async function as(n, s, r, t, e) {
1446
- return wt(n, s, r, t, e);
1434
+ async function rs(n, s, r, t, e) {
1435
+ return yt(n, s, r, t, e);
1447
1436
  }
1448
- async function ns(n, s, r, t) {
1449
- return Tt(n, s, r, t);
1437
+ async function as(n, s, r, t) {
1438
+ return wt(n, s, r, t);
1450
1439
  }
1451
- async function os(n, s, r) {
1452
- return St(n, s, r);
1440
+ async function ns(n, s, r) {
1441
+ return Tt(n, s, r);
1453
1442
  }
1454
- async function is(n, s, r, t, e, a, o, d) {
1443
+ async function os(n, s, r, t, e, a, o, d) {
1455
1444
  let i = new m();
1456
1445
  if (r.id === "1") {
1457
- if (i = await Et(n, s, r, a.id, d), i.result) {
1446
+ if (i = await kt(n, s, r, a.id, d), i.result) {
1458
1447
  r.tenants.forEach((f) => {
1459
1448
  (f.configId === "1" || f.configId === "") && (f.configId = r.id);
1460
1449
  }), t && t(r.id);
1461
1450
  const l = {};
1462
1451
  Object.defineProperty(l, r.id, { value: !0, writable: !0, enumerable: !0 }), e(l);
1463
- let c = a.associatedConfigs.findIndex((f) => f == "1");
1464
- c !== -1 && (a.associatedConfigs.splice(c, 1), a.associatedConfigs.push(r.id));
1452
+ let u = a.associatedConfigs.findIndex((f) => f == "1");
1453
+ u !== -1 && (a.associatedConfigs.splice(u, 1), a.associatedConfigs.push(r.id));
1465
1454
  }
1466
1455
  } else
1467
- i = await Dt(n, s, r, d);
1456
+ i = await Et(n, s, r, d);
1468
1457
  return o.save(), i;
1469
1458
  }
1470
- async function ls(n, s, r, t, e) {
1459
+ async function is(n, s, r, t, e) {
1471
1460
  let a = new m();
1472
- return a = await kt(n, s, r, t, e), a;
1461
+ return a = await At(n, s, r, t, e), a;
1473
1462
  }
1474
- async function us(n, s, r, t, e) {
1475
- return It(n, s, r, t, e);
1463
+ async function ls(n, s, r, t, e) {
1464
+ return St(n, s, r, t, e);
1476
1465
  }
1477
- async function ds(n, s, r, t, e) {
1478
- return bt(n, s, r, t, e);
1466
+ async function cs(n, s, r, t, e) {
1467
+ return It(n, s, r, t, e);
1479
1468
  }
1480
- async function cs(n, s, r, t, e, a) {
1469
+ async function ds(n, s, r, t, e, a) {
1481
1470
  let o = new m();
1482
1471
  if (e) debugger;
1483
1472
  try {
1484
1473
  let d = t.ws.find((i) => i.id === r);
1485
1474
  if (d != null) {
1486
1475
  d.associatedConfigs.length = 0;
1487
- let i = await $t(n, s, a, d.id, e);
1476
+ let i = await bt(n, s, a, d.id, e);
1488
1477
  return i.result && t.tagWithWorkspaces(), i;
1489
1478
  } else
1490
1479
  return o.result = !1, o.error = "Workspace not found.", o.status = 404, o;
@@ -1492,43 +1481,43 @@ async function cs(n, s, r, t, e, a) {
1492
1481
  return console.log(d.message), o.error = d.message, o.result = !1, o.status = 500, o;
1493
1482
  }
1494
1483
  }
1495
- async function fs(n, s, r, t, e) {
1496
- return At(n, s, r, t);
1484
+ async function us(n, s, r, t, e) {
1485
+ return $t(n, s, r, t);
1497
1486
  }
1498
- async function ps(n, s, r, t, e) {
1487
+ async function fs(n, s, r, t, e) {
1499
1488
  console.log(">>>>>> initGet");
1500
1489
  let a = new m();
1501
1490
  if (e)
1502
1491
  debugger;
1503
- let o = new j();
1504
- return o.tid = s.tid, o.domain = s.tid, await Ce(o, e) ? (s.authority = o.authority, t.setTaskStart("GET tenant details", /* @__PURE__ */ new Date()), a.result = await nt(s, o, r, n, e), t.setTaskEnd("GET tenant details", /* @__PURE__ */ new Date(), "complete"), a.result && (s.companyName = o.name, s.companyDomain = o.domain, t.setTaskStart("POST config init", /* @__PURE__ */ new Date()), a = await Pt(n, s, e), t.setTaskEnd("POST config init", /* @__PURE__ */ new Date(), a.result ? "complete" : "failed")), a.result && (t.setTaskStart("GET workspaces", /* @__PURE__ */ new Date()), a = await dt(n, s, r, e), t.setTaskEnd("GET workspaces", /* @__PURE__ */ new Date(), a.result ? "complete" : "failed")), console.log("initGet complete. Version: " + L()), a) : (a.error = `Failed to retrieve authority for user "${s.mail}" TID ${s.tid}.`, a.result = !1, a);
1492
+ let o = new H();
1493
+ return o.tid = s.tid, o.domain = s.tid, await Ge(o, e) ? (s.authority = o.authority, t.setTaskStart("GET tenant details", /* @__PURE__ */ new Date()), a.result = await at(s, o, r, n, e), t.setTaskEnd("GET tenant details", /* @__PURE__ */ new Date(), "complete"), a.result && (s.companyName = o.name, s.companyDomain = o.domain, t.setTaskStart("POST config init", /* @__PURE__ */ new Date()), a = await vt(n, s, e), t.setTaskEnd("POST config init", /* @__PURE__ */ new Date(), a.result ? "complete" : "failed")), a.result && (t.setTaskStart("GET workspaces", /* @__PURE__ */ new Date()), a = await ct(n, s, r, e), t.setTaskEnd("GET workspaces", /* @__PURE__ */ new Date(), a.result ? "complete" : "failed")), console.log("initGet complete. Version: " + L()), a) : (a.error = `Failed to retrieve authority for user "${s.mail}" TID ${s.tid}.`, a.result = !1, a);
1494
+ }
1495
+ async function ps(n, s, r, t) {
1496
+ return Gt(n, s, r, t);
1505
1497
  }
1506
- async function hs(n, s, r, t) {
1507
- return xt(n, s, r, t);
1498
+ async function hs(n, s, r, t, e) {
1499
+ return Pt(n, s, r, t);
1508
1500
  }
1509
- async function gs(n, s, r, t, e) {
1510
- return Rt(n, s, r, t);
1501
+ async function gs(n, s, r, t) {
1502
+ return ht(n, s, r, t);
1511
1503
  }
1512
1504
  async function ms(n, s, r, t) {
1513
- return gt(n, s, r, t);
1505
+ return ft(n, s, r, t);
1514
1506
  }
1515
1507
  async function ys(n, s, r, t) {
1516
- return pt(n, s, r, t);
1517
- }
1518
- async function ws(n, s, r, t) {
1519
- return await Ct(n, s, r, t);
1508
+ return await xt(n, s, r, t);
1520
1509
  }
1521
- function it(n, s, r, t) {
1510
+ function ot(n, s, r, t) {
1522
1511
  r.map((e) => {
1523
1512
  let a = null, o = s.us.findIndex((l) => l.oid === e.userId || l.oid === e.email);
1524
1513
  if (o === -1) {
1525
- let l = s.us.findIndex((c) => c.oid === "1");
1514
+ let l = s.us.findIndex((u) => u.oid === "1");
1526
1515
  if (l !== -1) {
1527
1516
  a = s.us.at(l);
1528
- let c = n.associatedUsers.findIndex((f) => f == "1");
1529
- c !== -1 && (n.associatedUsers.splice(c, 1), n.associatedUsers.push(e.userId));
1517
+ let u = n.associatedUsers.findIndex((f) => f == "1");
1518
+ u !== -1 && (n.associatedUsers.splice(u, 1), n.associatedUsers.push(e.userId));
1530
1519
  } else
1531
- a = new fe(), s.us.push(a);
1520
+ a = new de(), s.us.push(a);
1532
1521
  } else
1533
1522
  a = s.us.at(o);
1534
1523
  a.sel = t === e.userId, a.oid = e.userId ? e.userId : e.email, a.name = e.firstName ?? a.name, a.mail = e.email, a.tid = e.tenantId;
@@ -1536,35 +1525,35 @@ function it(n, s, r, t) {
1536
1525
  d != null && (a.authority = d.authority, a.companyName = d.name, a.companyDomain = d.domain), n.associatedUsers.findIndex((l) => l === a.oid) == -1 && n.associatedUsers.push(a.oid);
1537
1526
  }), s.save();
1538
1527
  }
1539
- function lt(n, s, r, t) {
1528
+ function it(n, s, r, t) {
1540
1529
  r.map((e) => {
1541
- let a = null, o = s.ts.findIndex((c) => c.tid === e.tenantId);
1530
+ let a = null, o = s.ts.findIndex((u) => u.tid === e.tenantId);
1542
1531
  if (o === -1) {
1543
- let c = s.ts.findIndex((f) => f.tid === "1");
1544
- if (c !== -1) {
1545
- a = s.ts.at(c);
1532
+ let u = s.ts.findIndex((f) => f.tid === "1");
1533
+ if (u !== -1) {
1534
+ a = s.ts.at(u);
1546
1535
  let f = n.associatedTenants.findIndex((b) => b == "1");
1547
1536
  f !== -1 && (n.associatedTenants.splice(f, 1), n.associatedTenants.push(e.tenantId));
1548
1537
  } else
1549
- a = new j(), s.ts.push(a);
1538
+ a = new H(), s.ts.push(a);
1550
1539
  } else
1551
1540
  a = s.ts.at(o);
1552
1541
  a.sel = t === e.tenantId, a.tid = e.tenantId, a.name = e.name, a.domain = e.domain, a.tenantType = e.type.toLowerCase();
1553
1542
  const d = /^(https:\/\/login.microsoftonline.(?:us|com)\/)organizations\/v2.0$/, i = e.authority.match(d);
1554
- a.authority = i ? i[1] : e.authority, n.associatedTenants.findIndex((c) => c === e.tenantId) == -1 && n.associatedTenants.push(e.tenantId);
1543
+ a.authority = i ? i[1] : e.authority, n.associatedTenants.findIndex((u) => u === e.tenantId) == -1 && n.associatedTenants.push(e.tenantId);
1555
1544
  }), s.save();
1556
1545
  }
1557
- function ut(n, s, r, t) {
1546
+ function lt(n, s, r, t) {
1558
1547
  r.map((e) => {
1559
1548
  let a = null, o = s.cs.findIndex((i) => i.id === e.id);
1560
1549
  if (o === -1) {
1561
1550
  let i = s.cs.findIndex((l) => l.id === "1");
1562
1551
  if (i !== -1) {
1563
1552
  a = s.cs.at(i);
1564
- let l = n.associatedConfigs.findIndex((c) => c == "1");
1553
+ let l = n.associatedConfigs.findIndex((u) => u == "1");
1565
1554
  l !== -1 && (n.associatedConfigs.splice(l, 1), n.associatedConfigs.push(e.id));
1566
1555
  } else
1567
- a = new pe(), s.cs.push(a);
1556
+ a = new ue(), s.cs.push(a);
1568
1557
  } else
1569
1558
  a = s.cs.at(o);
1570
1559
  a.sel = t === e.id, a.id = e.id, a.workspaceId = e.workspaceId, a.name = e.name, a.description = e.description, a.isEnabled = e.isEnabled, a.tenants.length = 0, e.tenants.map((i) => {
@@ -1573,39 +1562,39 @@ function ut(n, s, r, t) {
1573
1562
  }), n.associatedConfigs.findIndex((i) => i === e.id) == -1 && n.associatedConfigs.push(e.id);
1574
1563
  }), console.log("--------------ii-----------", s), s.save();
1575
1564
  }
1576
- async function dt(n, s, r, t) {
1565
+ async function ct(n, s, r, t) {
1577
1566
  let e = new m();
1578
1567
  if (t) debugger;
1579
1568
  try {
1580
- if (e = await Ot(n, s, t), e.result) {
1569
+ if (e = await Ct(n, s, t), e.result) {
1581
1570
  for (let a of e.array) {
1582
- let o = null, d = r.ws.findIndex((v) => v.id === a.id);
1571
+ let o = null, d = r.ws.findIndex((D) => D.id === a.id);
1583
1572
  if (d === -1) {
1584
- let v = r.ws.findIndex((k) => k.id === "1");
1585
- v !== -1 ? o = r.ws.at(v) : (o = new he(), r.ws.push(o));
1573
+ let D = r.ws.findIndex((k) => k.id === "1");
1574
+ D !== -1 ? o = r.ws.at(D) : (o = new fe(), r.ws.push(o));
1586
1575
  } else
1587
1576
  o = r.ws.at(d);
1588
1577
  let i = "";
1589
- for (let v of o.associatedUsers) {
1590
- let k = r.us.find((O) => O.oid === v);
1578
+ for (let D of o.associatedUsers) {
1579
+ let k = r.us.find((O) => O.oid === D);
1591
1580
  k != null && k.sel && (i = k.oid);
1592
1581
  }
1593
1582
  let l = "";
1594
- for (let v of o.associatedTenants) {
1595
- let k = r.ts.find((O) => O.tid === v);
1583
+ for (let D of o.associatedTenants) {
1584
+ let k = r.ts.find((O) => O.tid === D);
1596
1585
  k != null && k.sel && (l = k.tid);
1597
1586
  }
1598
- let c = "";
1599
- for (let v of o.associatedConfigs) {
1600
- let k = r.cs.find((O) => O.id === v);
1601
- k != null && k.sel && (c = k.id);
1587
+ let u = "";
1588
+ for (let D of o.associatedConfigs) {
1589
+ let k = r.cs.find((O) => O.id === D);
1590
+ k != null && k.sel && (u = k.id);
1602
1591
  }
1603
1592
  o.associatedUsers.length = 0, o.associatedTenants.length = 0, o.associatedConfigs.length = 0, o.id = a.id, o.name = a.name, o.ownerid = a.workspaceOwnerUserId;
1604
- let f = ht(n, s, o.id, t), b = Gt(n, s, o.id, t), A = vt(n, s, o.id, t), [C, N, B] = await Promise.all([f, b, A]);
1593
+ let f = pt(n, s, o.id, t), b = Rt(n, s, o.id, t), A = Dt(n, s, o.id, t), [C, N, B] = await Promise.all([f, b, A]);
1605
1594
  if (!C.result) return C;
1606
1595
  if (!N.result) return N;
1607
1596
  if (!B.result) return B;
1608
- lt(o, r, N.array, l), it(o, r, C.array, i), ut(o, r, B.array, c), r.tagWithWorkspaces();
1597
+ it(o, r, N.array, l), ot(o, r, C.array, i), lt(o, r, B.array, u), r.tagWithWorkspaces();
1609
1598
  }
1610
1599
  return e;
1611
1600
  }
@@ -1614,7 +1603,7 @@ async function dt(n, s, r, t) {
1614
1603
  }
1615
1604
  return e.result = !1, e.status = 500, e;
1616
1605
  }
1617
- async function Ts(n, s) {
1606
+ async function ws(n, s) {
1618
1607
  let r = "", t = L();
1619
1608
  try {
1620
1609
  let e = n.getAllAccounts(), a = s.oid + "." + s.tid, o = null;
@@ -1634,7 +1623,7 @@ async function Ts(n, s) {
1634
1623
  }
1635
1624
  return console.log(t), r;
1636
1625
  }
1637
- async function Te(n, s) {
1626
+ async function ye(n, s) {
1638
1627
  const r = new Headers();
1639
1628
  if (r.append("Content-Type", "application/json"), r.append("accept", "*/*"), s.azureAccessToken == null || s.azureAccessToken === "")
1640
1629
  try {
@@ -1662,11 +1651,11 @@ async function Te(n, s) {
1662
1651
  }
1663
1652
  return r.append("Authorization", `Bearer ${s.azureAccessToken}`), r;
1664
1653
  }
1665
- async function Ss(n, s) {
1654
+ async function Ts(n, s) {
1666
1655
  if (s == null || s.spacode == "")
1667
1656
  return !1;
1668
1657
  try {
1669
- let t = { method: "GET", headers: await Te(n, s) }, e = M.azureListRootAssignments;
1658
+ let t = { method: "GET", headers: await ye(n, s) }, e = j.azureListRootAssignments;
1670
1659
  e += "'", e += s.oid, e += "'";
1671
1660
  let a = await fetch(e, t);
1672
1661
  if (a.status == 200) {
@@ -1681,11 +1670,11 @@ async function Ss(n, s) {
1681
1670
  }
1682
1671
  return !0;
1683
1672
  }
1684
- async function Is(n, s) {
1673
+ async function Ss(n, s) {
1685
1674
  if (s == null || s.spacode == "")
1686
1675
  return !1;
1687
1676
  try {
1688
- let t = { method: "POST", headers: await Te(n, s) }, e = M.azureElevateAccess, a = await fetch(e, t);
1677
+ let t = { method: "POST", headers: await ye(n, s) }, e = j.azureElevateAccess, a = await fetch(e, t);
1689
1678
  if (a.status == 200)
1690
1679
  console.log("Successful call to Azure Resource Graph list root assignments");
1691
1680
  else
@@ -1695,12 +1684,12 @@ async function Is(n, s) {
1695
1684
  }
1696
1685
  return !0;
1697
1686
  }
1698
- async function ct(n, s) {
1687
+ async function dt(n, s) {
1699
1688
  let r = new Array();
1700
1689
  if (s == null || s.spacode == "")
1701
1690
  return r;
1702
1691
  try {
1703
- let e = { method: "GET", headers: await Te(n, s) }, a = M.azureListRootAssignments;
1692
+ let e = { method: "GET", headers: await ye(n, s) }, a = j.azureListRootAssignments;
1704
1693
  a += "'", a += s.oid, a += "'";
1705
1694
  let o = await fetch(a, e);
1706
1695
  if (o.status == 200) {
@@ -1715,14 +1704,14 @@ async function ct(n, s) {
1715
1704
  }
1716
1705
  return r;
1717
1706
  }
1718
- function ft(n) {
1707
+ function ut(n) {
1719
1708
  let s = "8d95d21c-c378-4bb0-9f52-88c30d271e7a", r = n.authority.toLowerCase();
1720
1709
  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`;
1721
1710
  }
1722
1711
  async function I(n, s) {
1723
1712
  const r = new Headers();
1724
1713
  r.append("Content-Type", "application/json"), r.append("accept", "*/*");
1725
- const t = ft(s);
1714
+ const t = ut(s);
1726
1715
  try {
1727
1716
  let e = n.getAllAccounts(), a = s.oid + "." + s.tid, o = null;
1728
1717
  for (let i = 0; i < e.length; i++)
@@ -1766,7 +1755,7 @@ async function y(n) {
1766
1755
  debugger;
1767
1756
  return s;
1768
1757
  }
1769
- async function pt(n, s, r, t) {
1758
+ async function ft(n, s, r, t) {
1770
1759
  let e = new m();
1771
1760
  if (r.oid == "" && r.mail == "" || t == "")
1772
1761
  return e.result = !1, e.error = "adminDelete: invalid parameters", e.status = 500, e;
@@ -1782,7 +1771,7 @@ async function pt(n, s, r, t) {
1782
1771
  }
1783
1772
  return e;
1784
1773
  }
1785
- async function ht(n, s, r, t) {
1774
+ async function pt(n, s, r, t) {
1786
1775
  let e = new m();
1787
1776
  if (r === "")
1788
1777
  return e.result = !1, e.status = 500, e.error = "adminsGet: no workspace provided", e;
@@ -1794,8 +1783,8 @@ async function ht(n, s, r, t) {
1794
1783
  console.log("Attempting GET from /admins: " + o.href);
1795
1784
  let l = await fetch(o.href, i);
1796
1785
  if (l.status === 200 && l.statusText === "OK") {
1797
- let c = await l.json();
1798
- return c != null ? (e.array = c, console.log(`Successful GET from /admins: ${e.array.reduce((b, A) => b + 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);
1786
+ let u = await l.json();
1787
+ return u != null ? (e.array = u, console.log(`Successful GET from /admins: ${e.array.reduce((b, A) => b + 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);
1799
1788
  } else
1800
1789
  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;
1801
1790
  } catch (l) {
@@ -1803,7 +1792,7 @@ async function ht(n, s, r, t) {
1803
1792
  }
1804
1793
  return e;
1805
1794
  }
1806
- async function gt(n, s, r, t) {
1795
+ async function ht(n, s, r, t) {
1807
1796
  let e = new m();
1808
1797
  if (r.mail == "" || r.authority == "" || r.tid === "")
1809
1798
  return e.result = !1, e.error = "adminPost: invalid argument", e.status = 500, e;
@@ -1823,7 +1812,7 @@ async function gt(n, s, r, t) {
1823
1812
  }
1824
1813
  return e;
1825
1814
  }
1826
- async function mt(n, s, r, t) {
1815
+ async function gt(n, s, r, t) {
1827
1816
  n = n, s = s, t = t;
1828
1817
  let e = new m();
1829
1818
  if (r.id === "")
@@ -1844,9 +1833,9 @@ async function mt(n, s, r, t) {
1844
1833
  console.log("Attempting POST to /audit-configuration: " + a);
1845
1834
  let l = await fetch(a, i);
1846
1835
  if (l.status === 200 && l.statusText === "OK") {
1847
- let c = await l.json();
1848
- return r.id = c, console.log(
1849
- `Successful AuditConfigID: ${c} from POST to /audit-configuration: ${d}`
1836
+ let u = await l.json();
1837
+ return r.id = u, console.log(
1838
+ `Successful AuditConfigID: ${u} from POST to /audit-configuration: ${d}`
1850
1839
  ), e;
1851
1840
  } else
1852
1841
  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;
@@ -1855,7 +1844,7 @@ async function mt(n, s, r, t) {
1855
1844
  }
1856
1845
  return e;
1857
1846
  }
1858
- async function yt(n, s, r, t) {
1847
+ async function mt(n, s, r, t) {
1859
1848
  n = n, s = s, t = t;
1860
1849
  let e = new m();
1861
1850
  if (s.mail == null || s.mail == "")
@@ -1868,8 +1857,8 @@ async function yt(n, s, r, t) {
1868
1857
  console.log("Attempting GET to /audit-configuration: " + o.href);
1869
1858
  const l = await fetch(o.href, i);
1870
1859
  if (l.status === 200 && l.statusText === "OK") {
1871
- let c = await l.json();
1872
- e.result = !0, e.status = l.status, console.log("Successful GET from /audit-configuration:", c);
1860
+ let u = await l.json();
1861
+ e.result = !0, e.status = l.status, console.log("Successful GET from /audit-configuration:", u);
1873
1862
  } else
1874
1863
  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;
1875
1864
  } catch (l) {
@@ -1877,7 +1866,7 @@ async function yt(n, s, r, t) {
1877
1866
  }
1878
1867
  return e;
1879
1868
  }
1880
- async function wt(n, s, r, t, e) {
1869
+ async function yt(n, s, r, t, e) {
1881
1870
  let a = new m();
1882
1871
  if (!r || r.trim() === "")
1883
1872
  return a.result = !1, a.error = "auditConfigPut: invalid configuration ID", a.status = 500, a;
@@ -1891,18 +1880,18 @@ async function wt(n, s, r, t, e) {
1891
1880
  "isEnabled": ${t.isEnabled},
1892
1881
  "isReadPermissionConsented": ${t.isReadPermissionConsented},
1893
1882
  "email": "${t.email}"
1894
- }`, c = { method: "PUT", headers: i, body: l };
1883
+ }`, u = { method: "PUT", headers: i, body: l };
1895
1884
  try {
1896
1885
  if (e) debugger;
1897
1886
  console.log("Attempting PUT to /audit-configuration: " + d.href);
1898
- const f = await fetch(d.href, c);
1887
+ const f = await fetch(d.href, u);
1899
1888
  f.status === 200 && f.statusText === "OK" ? (a.result = !0, console.log(`Successful PUT to ${d.href}: ${l}`)) : (a.error = await y(f), console.error(`Failed PUT to ${d.href}: ${l}`), a.status = f.status, a.result = !1);
1900
1889
  } catch (f) {
1901
1890
  a.error = f.message, a.status = 500, a.result = !1, console.error("Error during auditConfigPut:", f.message);
1902
1891
  }
1903
1892
  return a;
1904
1893
  }
1905
- async function Tt(n, s, r, t) {
1894
+ async function wt(n, s, r, t) {
1906
1895
  let e = new m();
1907
1896
  if (!s.mail)
1908
1897
  return e.result = !1, e.status = 500, e.error = "auditConfigDelete: no user provided", e;
@@ -1921,7 +1910,7 @@ async function Tt(n, s, r, t) {
1921
1910
  }
1922
1911
  return e;
1923
1912
  }
1924
- async function St(n, s, r) {
1913
+ async function Tt(n, s, r) {
1925
1914
  let t = new m();
1926
1915
  if (s.mail == null || s.mail == "")
1927
1916
  return t.result = !1, t.status = 500, t.error = "auditEventsGet: no user provided", t;
@@ -1933,9 +1922,9 @@ async function St(n, s, r) {
1933
1922
  if (i.status === 200 && i.statusText === "OK") {
1934
1923
  let l = await i.json();
1935
1924
  if (Array.isArray(l.data)) {
1936
- let c = l.data;
1937
- if (c != null)
1938
- return t.array = c, console.log(`Successful GET from /audit-events: ${t.array.reduce((b, A) => b + A.initiatedByUser + " ", "")}`), t;
1925
+ let u = l.data;
1926
+ if (u != null)
1927
+ return t.array = u, console.log(`Successful GET from /audit-events: ${t.array.reduce((b, A) => b + A.initiatedByUser + " ", "")}`), t;
1939
1928
  }
1940
1929
  return t.error = "Failed GET from /audit-events: failed to JSON-parse response", console.log(t.error), t.status = 500, t.result = !1, t;
1941
1930
  } else
@@ -1945,7 +1934,7 @@ async function St(n, s, r) {
1945
1934
  }
1946
1935
  return t;
1947
1936
  }
1948
- async function It(n, s, r, t, e) {
1937
+ async function St(n, s, r, t, e) {
1949
1938
  let a = new m(), o = S.configConsentEndpoint(), d = new URL(o);
1950
1939
  d.searchParams.append("configurationId", r);
1951
1940
  const i = await I(n, s);
@@ -1953,17 +1942,17 @@ async function It(n, s, r, t, e) {
1953
1942
  {
1954
1943
  "tenantId": "${t}",
1955
1944
  "isReadPermissionConsented": ${e ? "true" : "false"}
1956
- }`, c = { method: "PUT", headers: i, body: l };
1945
+ }`, u = { method: "PUT", headers: i, body: l };
1957
1946
  try {
1958
1947
  console.log("Attempting PUT read consent to /configuration/consent: " + d.href);
1959
- let f = await fetch(d.href, c);
1948
+ let f = await fetch(d.href, u);
1960
1949
  return f.status === 200 && f.statusText === "OK" ? (console.log(`Successful PUT to ${d.href}`), a) : (a.error = await y(f), console.log(`Failed PUT to ${d.href}`), console.log(a.error), a.status = 500, a.result = !1, a);
1961
1950
  } catch (f) {
1962
1951
  a.error = f.message, a.status = 500, a.result = !1, console.log(f.message);
1963
1952
  }
1964
1953
  return a;
1965
1954
  }
1966
- async function bt(n, s, r, t, e) {
1955
+ async function It(n, s, r, t, e) {
1967
1956
  let a = new m(), o = S.configConsentEndpoint(), d = new URL(o);
1968
1957
  d.searchParams.append("configurationId", r);
1969
1958
  const i = await I(n, s);
@@ -1971,17 +1960,17 @@ async function bt(n, s, r, t, e) {
1971
1960
  {
1972
1961
  "tenantId": "${t}",
1973
1962
  "isWritePermissionConsented": ${e ? "true" : "false"}
1974
- }`, c = { method: "PUT", headers: i, body: l };
1963
+ }`, u = { method: "PUT", headers: i, body: l };
1975
1964
  try {
1976
1965
  console.log("Attempting PUT read consent to /configuration/consent: " + d.href);
1977
- let f = await fetch(d.href, c);
1966
+ let f = await fetch(d.href, u);
1978
1967
  return f.status === 200 && f.statusText === "OK" ? (console.log(`Successful PUT to ${d.href}`), a) : (a.error = await y(f), console.log(`Failed PUT to ${d.href}`), console.log(a.error), a.status = 500, a.result = !1, a);
1979
1968
  } catch (f) {
1980
1969
  a.error = f.message, a.status = 500, a.result = !1, console.log(f.message);
1981
1970
  }
1982
1971
  return a;
1983
1972
  }
1984
- async function $t(n, s, r, t, e) {
1973
+ async function bt(n, s, r, t, e) {
1985
1974
  let a = new m();
1986
1975
  if (r.id === "" || t == "")
1987
1976
  return a.result = !1, a.error = "configGet: invalid config ID", a.status = 500, a;
@@ -1993,10 +1982,10 @@ async function $t(n, s, r, t, e) {
1993
1982
  let l = await fetch(`${o.href}/${r.id}`, i);
1994
1983
  if (l.status === 200 && l.statusText === "OK") {
1995
1984
  console.log("Successful GET from /config");
1996
- let c = await l.json();
1985
+ let u = await l.json();
1997
1986
  return {
1998
1987
  ...a,
1999
- array: [c]
1988
+ array: [u]
2000
1989
  };
2001
1990
  } else
2002
1991
  return a.error = await y(l), console.log(`Failed GET from ${o.href}`), console.log(a.error), a.status = 500, a.result = !1, a;
@@ -2005,7 +1994,7 @@ async function $t(n, s, r, t, e) {
2005
1994
  }
2006
1995
  return a;
2007
1996
  }
2008
- async function At(n, s, r, t, e) {
1997
+ async function $t(n, s, r, t, e) {
2009
1998
  let a = new m();
2010
1999
  if (r.id === "" || t == "")
2011
2000
  return a.result = !1, a.error = "configPost: invalid config ID", a.status = 500, a;
@@ -2021,7 +2010,7 @@ async function At(n, s, r, t, e) {
2021
2010
  }
2022
2011
  return a;
2023
2012
  }
2024
- async function kt(n, s, r, t, e) {
2013
+ async function At(n, s, r, t, e) {
2025
2014
  let a = new m();
2026
2015
  if (r === "")
2027
2016
  return a.result = !1, a.error = "configPatch: invalid config ID", a.status = 500, a;
@@ -2031,14 +2020,14 @@ async function kt(n, s, r, t, e) {
2031
2020
  try {
2032
2021
  if (e) debugger;
2033
2022
  console.log("Attempting PATCH to /config: " + d.href);
2034
- let c = await fetch(d.href, l);
2035
- return c.status === 200 && c.statusText === "OK" ? (console.log(`Successful PATCH to ${d.href}: ${t.toString()}`), a) : (a.error = await y(c), console.log(`Failed PATCH to ${d.href}: ${t.toString()}`), console.log(a.error), a.status = 500, a.result = !1, a);
2036
- } catch (c) {
2037
- a.error = c.message, a.status = 500, a.result = !1, console.log(c.message);
2023
+ let u = await fetch(d.href, l);
2024
+ return u.status === 200 && u.statusText === "OK" ? (console.log(`Successful PATCH to ${d.href}: ${t.toString()}`), a) : (a.error = await y(u), console.log(`Failed PATCH to ${d.href}: ${t.toString()}`), console.log(a.error), a.status = 500, a.result = !1, a);
2025
+ } catch (u) {
2026
+ a.error = u.message, a.status = 500, a.result = !1, console.log(u.message);
2038
2027
  }
2039
2028
  return a;
2040
2029
  }
2041
- async function Et(n, s, r, t, e) {
2030
+ async function kt(n, s, r, t, e) {
2042
2031
  let a = new m();
2043
2032
  if (r.id === "")
2044
2033
  return a.result = !1, a.error = "configPost: invalid config ID", a.status = 500, a;
@@ -2051,36 +2040,36 @@ async function Et(n, s, r, t, e) {
2051
2040
  "description": "${r.description}",
2052
2041
  "isEnabled": ${r.isEnabled},
2053
2042
  "tenants": [`;
2054
- r.tenants.map((c) => {
2055
- let f = c.sourceGroupId != "" ? `"${c.sourceGroupId}"` : "null", b = c.sourceGroupName != "" ? `"${c.sourceGroupName}"` : "null", A = c.targetGroupId != "" ? `"${c.targetGroupId}"` : "null", C = c.targetGroupName != "" ? `"${c.targetGroupName}"` : "null";
2043
+ r.tenants.map((u) => {
2044
+ let f = u.sourceGroupId != "" ? `"${u.sourceGroupId}"` : "null", b = u.sourceGroupName != "" ? `"${u.sourceGroupName}"` : "null", A = u.targetGroupId != "" ? `"${u.targetGroupId}"` : "null", C = u.targetGroupName != "" ? `"${u.targetGroupName}"` : "null";
2056
2045
  i.slice(-1) === "}" && (i += ","), i += `{
2057
- "tenantId": "${c.tid}",
2046
+ "tenantId": "${u.tid}",
2058
2047
  "sourceGroupId": ${f},
2059
2048
  "sourceGroupName": ${b},
2060
2049
  "targetGroupId": ${A},
2061
2050
  "targetGroupName": ${C},
2062
- "configurationTenantType": "${c.configurationTenantType}",
2063
- "isReadPermissionConsented": ${c.isReadPermissionConsented},
2064
- "isWritePermissionConsented": ${c.isWritePermissionConsented}
2051
+ "configurationTenantType": "${u.configurationTenantType}",
2052
+ "isReadPermissionConsented": ${u.isReadPermissionConsented},
2053
+ "isWritePermissionConsented": ${u.isWritePermissionConsented}
2065
2054
  }`;
2066
2055
  }), i += "]}";
2067
2056
  let l = { method: "POST", headers: d, body: i };
2068
2057
  try {
2069
2058
  if (e) debugger;
2070
2059
  console.log("Attempting POST to /config: " + o);
2071
- let c = await fetch(o, l);
2072
- if (c.status === 200 && c.statusText === "OK") {
2073
- let f = await c.json();
2060
+ let u = await fetch(o, l);
2061
+ if (u.status === 200 && u.statusText === "OK") {
2062
+ let f = await u.json();
2074
2063
  return r.id = typeof f == "object" && f !== null && f.id ? f.id : f, console.log(
2075
2064
  `Successful ConfigID: ${r.id} from POST to /config: ${i}`
2076
2065
  ), a;
2077
2066
  } else
2078
- return a.error = await y(c), console.log(`Failed PUT to /config: ${i}`), console.log(a.error), a.status = 500, a.result = !1, a;
2079
- } catch (c) {
2080
- return a.status = 500, a.result = !1, a.error = c.message, console.log(a.error), a;
2067
+ return a.error = await y(u), console.log(`Failed PUT to /config: ${i}`), console.log(a.error), a.status = 500, a.result = !1, a;
2068
+ } catch (u) {
2069
+ return a.status = 500, a.result = !1, a.error = u.message, console.log(a.error), a;
2081
2070
  }
2082
2071
  }
2083
- async function Dt(n, s, r, t) {
2072
+ async function Et(n, s, r, t) {
2084
2073
  let e = new m();
2085
2074
  if (r.id === "")
2086
2075
  return e.result = !1, e.error = "configPost: invalid config ID", e.status = 500, e;
@@ -2092,41 +2081,41 @@ async function Dt(n, s, r, t) {
2092
2081
  "name": "${r.name}",
2093
2082
  "description": "${r.description}",
2094
2083
  "tenants": [`;
2095
- r.tenants.map((c) => {
2084
+ r.tenants.map((u) => {
2096
2085
  i.slice(-1) === "}" && (i += ",");
2097
- let b = c.sourceGroupId != "" ? `"${c.sourceGroupId}"` : "null", A = c.sourceGroupName != "" ? `"${c.sourceGroupName}"` : "null", C = c.targetGroupId != "" ? `"${c.targetGroupId}"` : "null", N = c.targetGroupName != "" ? `"${c.targetGroupName}"` : "null";
2086
+ let b = u.sourceGroupId != "" ? `"${u.sourceGroupId}"` : "null", A = u.sourceGroupName != "" ? `"${u.sourceGroupName}"` : "null", C = u.targetGroupId != "" ? `"${u.targetGroupId}"` : "null", N = u.targetGroupName != "" ? `"${u.targetGroupName}"` : "null";
2098
2087
  i += `{
2099
- "tenantId": "${c.tid}",
2088
+ "tenantId": "${u.tid}",
2100
2089
  "sourceGroupId": ${b},
2101
2090
  "sourceGroupName": ${A},
2102
2091
  "targetGroupId": ${C},
2103
2092
  "targetGroupName": ${N},
2104
- "configurationTenantType": "${c.configurationTenantType}",
2105
- "deltaToken": "${c.deltaToken}",
2106
- "isReadPermissionConsented": ${c.isReadPermissionConsented},
2107
- "isWritePermissionConsented": ${c.isWritePermissionConsented}
2093
+ "configurationTenantType": "${u.configurationTenantType}",
2094
+ "deltaToken": "${u.deltaToken}",
2095
+ "isReadPermissionConsented": ${u.isReadPermissionConsented},
2096
+ "isWritePermissionConsented": ${u.isWritePermissionConsented}
2108
2097
  }`;
2109
2098
  }), i += "]}";
2110
2099
  let l = { method: "PUT", headers: d, body: i };
2111
2100
  try {
2112
2101
  if (t) debugger;
2113
2102
  console.log("Attempting PUT to /config: " + o.href);
2114
- let c = await fetch(o.href, l);
2115
- if (c.status === 200 && c.statusText === "OK") {
2103
+ let u = await fetch(o.href, l);
2104
+ if (u.status === 200 && u.statusText === "OK") {
2116
2105
  console.log(`Successful PUT to ${o.href}: ${i}`);
2117
- let f = await c.json();
2106
+ let f = await u.json();
2118
2107
  return {
2119
2108
  ...e,
2120
2109
  array: [f]
2121
2110
  };
2122
2111
  } else
2123
- return e.error = await y(c), console.log(`Failed PUT to ${o.href}: ${i}`), console.log(e.error), e.status = 500, e.result = !1, e;
2124
- } catch (c) {
2125
- e.error = c.message, e.status = 500, e.result = !1, console.log(c.message);
2112
+ 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;
2113
+ } catch (u) {
2114
+ e.error = u.message, e.status = 500, e.result = !1, console.log(u.message);
2126
2115
  }
2127
2116
  return e;
2128
2117
  }
2129
- async function vt(n, s, r, t) {
2118
+ async function Dt(n, s, r, t) {
2130
2119
  let e = new m();
2131
2120
  if (r === "")
2132
2121
  return e.result = !1, e.status = 500, e.error = "configsGet: no workspace provided", e;
@@ -2138,8 +2127,8 @@ async function vt(n, s, r, t) {
2138
2127
  console.log("Attempting GET from /configurations: " + o.href);
2139
2128
  let l = await fetch(o.href, i);
2140
2129
  if (l.status === 200 && l.statusText === "OK") {
2141
- let c = await l.json();
2142
- return c != null ? (e.array = c, console.log(`Successful GET from /configurations: ${e.array.reduce((b, A) => b + 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);
2130
+ let u = await l.json();
2131
+ return u != null ? (e.array = u, console.log(`Successful GET from /configurations: ${e.array.reduce((b, A) => b + 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);
2143
2132
  } else
2144
2133
  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;
2145
2134
  } catch (l) {
@@ -2147,7 +2136,7 @@ async function vt(n, s, r, t) {
2147
2136
  }
2148
2137
  return e;
2149
2138
  }
2150
- async function bs(n, s, r, t) {
2139
+ async function Is(n, s, r, t) {
2151
2140
  let e = new m();
2152
2141
  if (!r)
2153
2142
  return e.result = !1, e.status = 500, e.error = "workspaceConfigsGet: no workspace provided", e;
@@ -2159,9 +2148,9 @@ async function bs(n, s, r, t) {
2159
2148
  console.log("Attempting GET from /workspaceConfigs: " + o.href);
2160
2149
  const l = await fetch(o.href, i);
2161
2150
  if (l.status === 200 && l.statusText === "OK") {
2162
- const c = await l.json();
2163
- if (c)
2164
- return e.array = c.map((f) => ({
2151
+ const u = await l.json();
2152
+ if (u)
2153
+ return e.array = u.map((f) => ({
2165
2154
  id: f.id,
2166
2155
  name: f.name,
2167
2156
  description: f.description,
@@ -2178,7 +2167,7 @@ async function bs(n, s, r, t) {
2178
2167
  }
2179
2168
  return e;
2180
2169
  }
2181
- async function Pt(n, s, r) {
2170
+ async function vt(n, s, r) {
2182
2171
  let t = new m();
2183
2172
  if (s.companyName === "" || s.companyDomain === "")
2184
2173
  return t.result = !1, t.error = "initPost: invalid company name or domain", t.status = 500, t;
@@ -2204,7 +2193,7 @@ async function Pt(n, s, r) {
2204
2193
  }
2205
2194
  return t.status = 500, t.result = !1, t;
2206
2195
  }
2207
- async function Rt(n, s, r, t, e) {
2196
+ async function Pt(n, s, r, t, e) {
2208
2197
  let a = new m();
2209
2198
  if (r.tid === "" || t === "")
2210
2199
  return a.result = !1, a.error = "tenantDelete: invalid tid, workspaceId", a.status = 500, a;
@@ -2220,7 +2209,7 @@ async function Rt(n, s, r, t, e) {
2220
2209
  }
2221
2210
  return a;
2222
2211
  }
2223
- async function Gt(n, s, r, t) {
2212
+ async function Rt(n, s, r, t) {
2224
2213
  let e = new m();
2225
2214
  if (r === "")
2226
2215
  return e.result = !1, e.status = 500, e.error = "tenantsGet: no workspace provided", e;
@@ -2232,8 +2221,8 @@ async function Gt(n, s, r, t) {
2232
2221
  console.log(`Attempting GET from /tenants: ${o.href}`);
2233
2222
  let l = await fetch(o.href, i);
2234
2223
  if (l.status === 200 && l.statusText === "OK") {
2235
- let c = await l.json();
2236
- return c != null ? (e.array = c, console.log(`Successful GET from /tenants: ${e.array.reduce((b, A) => b + 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);
2224
+ let u = await l.json();
2225
+ return u != null ? (e.array = u, console.log(`Successful GET from /tenants: ${e.array.reduce((b, A) => b + 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);
2237
2226
  } else
2238
2227
  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;
2239
2228
  } catch (l) {
@@ -2241,7 +2230,7 @@ async function Gt(n, s, r, t) {
2241
2230
  }
2242
2231
  return e;
2243
2232
  }
2244
- async function xt(n, s, r, t) {
2233
+ async function Gt(n, s, r, t) {
2245
2234
  let e = new m();
2246
2235
  if (r.tid === "" || r.name === "" || r.domain === "")
2247
2236
  return e.result = !1, e.error = "tenantPost: invalid tid, name, domain", e.status = 500, e;
@@ -2257,14 +2246,14 @@ async function xt(n, s, r, t) {
2257
2246
  }`, l = { method: "POST", headers: d, body: i };
2258
2247
  try {
2259
2248
  console.log(`Attempting POST to ${o.href}: ${i}`);
2260
- let c = await fetch(o.href, l);
2261
- return c.status === 200 && c.statusText === "OK" ? (console.log(`Successful POST to ${o.href}: ${i}`), e) : (console.log(`Failed POST to ${o.href}: ${i}`), e.error = await y(c), console.log(e.error), e.status = 500, e.result = !1, e);
2262
- } catch (c) {
2263
- e.error = c.message, e.status = 500, e.result = !1, console.log(e.error);
2249
+ let u = await fetch(o.href, l);
2250
+ 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);
2251
+ } catch (u) {
2252
+ e.error = u.message, e.status = 500, e.result = !1, console.log(e.error);
2264
2253
  }
2265
2254
  return e;
2266
2255
  }
2267
- async function Ct(n, s, r, t) {
2256
+ async function xt(n, s, r, t) {
2268
2257
  let e = new m();
2269
2258
  if (r == "" || t == "")
2270
2259
  return e.result = !1, e.error = "workspacePut: invalid workspace ID or name", e.status = 500, e;
@@ -2280,7 +2269,7 @@ async function Ct(n, s, r, t) {
2280
2269
  }
2281
2270
  return e;
2282
2271
  }
2283
- async function Ot(n, s, r) {
2272
+ async function Ct(n, s, r) {
2284
2273
  let t = new m();
2285
2274
  if (s.mail == null || s.mail == "")
2286
2275
  return t.result = !1, t.status = 500, t.error = "adminsGet: no workspace provided", t;
@@ -2299,7 +2288,7 @@ async function Ot(n, s, r) {
2299
2288
  }
2300
2289
  return t;
2301
2290
  }
2302
- async function Nt(n, s, r) {
2291
+ async function Ot(n, s, r) {
2303
2292
  let t = new m();
2304
2293
  if (n == null || s == null)
2305
2294
  return t.result = !1, t.error = "readerPost: invalid parameters", t.status = 500, t;
@@ -2320,7 +2309,7 @@ async function Nt(n, s, r) {
2320
2309
  }
2321
2310
  return t;
2322
2311
  }
2323
- async function Bt(n, s, r) {
2312
+ async function Nt(n, s, r) {
2324
2313
  let t = new m();
2325
2314
  if (n == null || s == null)
2326
2315
  return t.result = !1, t.error = "readerPost: invalid parameters", t.status = 500, t;
@@ -2340,93 +2329,93 @@ async function Bt(n, s, r) {
2340
2329
  }
2341
2330
  export {
2342
2331
  m as APIResult,
2343
- Qt as ActorArray,
2344
- et as ActorNode,
2345
- Mt as AuditConfig,
2346
- qt as BatchArray,
2347
- zt as Group,
2348
- jt as InitInfo,
2349
- _ as Milestone,
2350
- Xe as MilestoneArray,
2351
- xe as ResourceArray,
2352
- Ye as ResourceNode,
2353
- pe as SyncConfig,
2332
+ qt as ActorArray,
2333
+ Ye as ActorNode,
2334
+ _t as AuditConfig,
2335
+ Ht as BatchArray,
2336
+ Lt as Group,
2337
+ Mt as InitInfo,
2338
+ M as Milestone,
2339
+ Qe as MilestoneArray,
2340
+ Re as ResourceArray,
2341
+ Xe as ResourceNode,
2342
+ ue as SyncConfig,
2354
2343
  ce as Task,
2355
- Ht as TaskArray,
2356
- j as Tenant,
2344
+ jt as TaskArray,
2345
+ H as Tenant,
2357
2346
  Ve as TenantConfigInfo,
2358
2347
  Je as TenantConfigType,
2359
- Re as TenantNode,
2360
- qe as TenantPermissionType,
2361
- He as TenantType,
2362
- fe as User,
2363
- _t as UserScope,
2364
- he as Workspace,
2365
- pt as adminDelete,
2366
- gt as adminPost,
2367
- ht as adminsGet,
2368
- ss as auditConfigAdd,
2369
- Tt as auditConfigDelete,
2370
- as as auditConfigEdit,
2371
- yt as auditConfigGet,
2372
- mt as auditConfigPost,
2373
- wt as auditConfigPut,
2374
- ns as auditConfigRemove,
2375
- rs as auditConfigRetrieve,
2376
- St as auditEventsGet,
2377
- os as auditEventsRetrieve,
2378
- M as azureConfig,
2379
- Ss as canListRootAssignments,
2380
- us as configConsentForRead,
2381
- ds as configConsentForWrite,
2382
- It as configConsentReadPut,
2383
- bt as configConsentWritePut,
2384
- At as configDelete,
2385
- is as configEdit,
2386
- ls as configEnable,
2387
- $t as configGet,
2388
- kt as configPatch,
2389
- Et as configPost,
2390
- Dt as configPut,
2391
- fs as configRemove,
2392
- vt as configsGet,
2393
- cs as configsRefresh,
2394
- Is as elevateGlobalAdminToUserAccessAdmin,
2395
- Ts as getPowerBIAccessToken,
2348
+ ve as TenantNode,
2349
+ He as TenantPermissionType,
2350
+ je as TenantType,
2351
+ de as User,
2352
+ zt as UserScope,
2353
+ fe as Workspace,
2354
+ ft as adminDelete,
2355
+ ht as adminPost,
2356
+ pt as adminsGet,
2357
+ ts as auditConfigAdd,
2358
+ wt as auditConfigDelete,
2359
+ rs as auditConfigEdit,
2360
+ mt as auditConfigGet,
2361
+ gt as auditConfigPost,
2362
+ yt as auditConfigPut,
2363
+ as as auditConfigRemove,
2364
+ ss as auditConfigRetrieve,
2365
+ Tt as auditEventsGet,
2366
+ ns as auditEventsRetrieve,
2367
+ j as azureConfig,
2368
+ Ts as canListRootAssignments,
2369
+ ls as configConsentForRead,
2370
+ cs as configConsentForWrite,
2371
+ St as configConsentReadPut,
2372
+ It as configConsentWritePut,
2373
+ $t as configDelete,
2374
+ os as configEdit,
2375
+ is as configEnable,
2376
+ bt as configGet,
2377
+ At as configPatch,
2378
+ kt as configPost,
2379
+ Et as configPut,
2380
+ us as configRemove,
2381
+ Dt as configsGet,
2382
+ ds as configsRefresh,
2383
+ Ss as elevateGlobalAdminToUserAccessAdmin,
2384
+ ws as getPowerBIAccessToken,
2396
2385
  L as getSyncVersion,
2397
- h as graphConfig,
2386
+ p as graphConfig,
2398
2387
  Kt as groupsGet,
2399
- Lt as helloNpm,
2400
- ps as initGet,
2401
- Pt as initPost,
2388
+ Ut as helloNpm,
2389
+ fs as initGet,
2390
+ vt as initPost,
2402
2391
  S as mindlineConfig,
2403
- st as oauth2PermissionGrantsGet,
2404
- rt as oauth2PermissionGrantsSet,
2392
+ tt as oauth2PermissionGrantsGet,
2393
+ st as oauth2PermissionGrantsSet,
2405
2394
  y as processErrors,
2406
- Nt as readerPost,
2407
- Bt as readerStats,
2395
+ Ot as readerPost,
2396
+ Nt as readerStats,
2408
2397
  Jt as requestAdminConsent,
2409
- at as servicePrincipalGet,
2398
+ rt as servicePrincipalGet,
2410
2399
  Vt as signIn,
2411
2400
  Zt as signInIncrementally,
2412
- Xt as signOut,
2413
- Ut as sum,
2414
- hs as tenantAdd,
2415
- Rt as tenantDelete,
2416
- xt as tenantPost,
2417
- Yt as tenantRelationshipsGetByDomain,
2418
- nt as tenantRelationshipsGetById,
2419
- gs as tenantRemove,
2420
- Ce as tenantUnauthenticatedLookup,
2421
- Gt as tenantsGet,
2422
- ms as userAdd,
2423
- ot as userDelegatedScopesGet,
2424
- es as userDelegatedScopesRemove,
2425
- ys as userRemove,
2426
- ts as usersGet,
2427
- bs as workspaceConfigsGet,
2428
- ws as workspaceEdit,
2429
- Ct as workspacePut,
2430
- Ot as workspacesGet
2401
+ Qt as signOut,
2402
+ Ft as sum,
2403
+ ps as tenantAdd,
2404
+ Pt as tenantDelete,
2405
+ Gt as tenantPost,
2406
+ Xt as tenantRelationshipsGetByDomain,
2407
+ at as tenantRelationshipsGetById,
2408
+ hs as tenantRemove,
2409
+ Ge as tenantUnauthenticatedLookup,
2410
+ Rt as tenantsGet,
2411
+ gs as userAdd,
2412
+ nt as userDelegatedScopesGet,
2413
+ Yt as userDelegatedScopesRemove,
2414
+ ms as userRemove,
2415
+ es as usersGet,
2416
+ Is as workspaceConfigsGet,
2417
+ ys as workspaceEdit,
2418
+ xt as workspacePut,
2419
+ Ct as workspacesGet
2431
2420
  };
2432
2421
  //# sourceMappingURL=sync.es.js.map