@mindline/sync 1.0.111 → 1.0.112

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