@mindline/sync 1.0.108 → 1.0.110

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