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