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