@mindline/sync 1.0.104 → 1.0.105
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/VSWorkspaceState.json +0 -1
- 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/069feaec-de6f-456e-9a9f-3a7edff9927d.vsidx +0 -0
- package/.vs/sync/FileContentIndex/3b17981b-603f-4e34-8b49-f18ef10f5f91.vsidx +0 -0
- package/.vs/sync/FileContentIndex/cce6d665-d5bc-4e83-b1ff-dabf19413432.vsidx +0 -0
- package/.vs/sync/v17/.wsuo +0 -0
- package/.vs/sync/v17/DocumentLayout.backup.json +3 -3
- package/.vs/sync/v17/DocumentLayout.json +9 -9
- package/dist/src/index.d.ts +9 -2
- package/dist/sync.es.js +705 -598
- package/dist/sync.es.js.map +1 -1
- package/dist/sync.umd.js +22 -15
- package/dist/sync.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/index.d.ts +4 -1
- package/src/index.ts +292 -15
- package/.vs/sync/FileContentIndex/3881c9ba-413d-444d-b9d4-43b79228192c.vsidx +0 -0
- package/.vs/sync/FileContentIndex/40eca9db-2eca-4bb1-b236-ef05624e799e.vsidx +0 -0
- package/.vs/sync/FileContentIndex/c2ebbf3f-6ffc-45f4-9e41-20101dcbfe33.vsidx +0 -0
- /package/.vs/sync/FileContentIndex/{00d0d744-d920-41f7-81bd-64419c4b96a9.vsidx → db560492-d007-4291-a6b3-50ccdcbd66b4.vsidx} +0 -0
package/dist/sync.es.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
var
|
|
1
|
+
var Ie = Object.defineProperty;
|
|
2
2
|
var ge = (a) => {
|
|
3
3
|
throw TypeError(a);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var
|
|
5
|
+
var $e = (a, t, r) => t in a ? Ie(a, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : a[t] = r;
|
|
6
|
+
var c = (a, t, r) => $e(a, typeof t != "symbol" ? t + "" : t, r), Ae = (a, t, r) => t.has(a) || ge("Cannot " + r);
|
|
7
7
|
var j = (a, t, r) => t.has(a) ? ge("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(a) : t.set(a, r);
|
|
8
|
-
var G = (a, t, r) => (
|
|
8
|
+
var G = (a, t, r) => (Ae(a, t, "access private method"), r);
|
|
9
9
|
import * as H from "@microsoft/signalr";
|
|
10
10
|
import { deserializeArray as W } from "class-transformer";
|
|
11
|
-
const
|
|
11
|
+
const ke = [
|
|
12
12
|
{
|
|
13
13
|
oid: "1",
|
|
14
14
|
name: "",
|
|
@@ -20,7 +20,7 @@ const De = [
|
|
|
20
20
|
session: "Sign In",
|
|
21
21
|
sel: !0
|
|
22
22
|
}
|
|
23
|
-
],
|
|
23
|
+
], De = [
|
|
24
24
|
{
|
|
25
25
|
tid: "1",
|
|
26
26
|
name: "",
|
|
@@ -30,7 +30,7 @@ const De = [
|
|
|
30
30
|
sel: !0,
|
|
31
31
|
graphSP: ""
|
|
32
32
|
}
|
|
33
|
-
],
|
|
33
|
+
], Ee = [], ve = [
|
|
34
34
|
{
|
|
35
35
|
id: "1",
|
|
36
36
|
name: "",
|
|
@@ -43,7 +43,7 @@ const De = [
|
|
|
43
43
|
associatedConfigs: [],
|
|
44
44
|
sel: !0
|
|
45
45
|
}
|
|
46
|
-
],
|
|
46
|
+
], Pe = [
|
|
47
47
|
{
|
|
48
48
|
Run: "3",
|
|
49
49
|
Start: "2023-09-17T12:00:00.000-07:00",
|
|
@@ -65,7 +65,7 @@ const De = [
|
|
|
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
|
+
], Re = [
|
|
69
69
|
{
|
|
70
70
|
type: "mg",
|
|
71
71
|
resource: "Tenant Root Group",
|
|
@@ -120,7 +120,7 @@ const De = [
|
|
|
120
120
|
}
|
|
121
121
|
]
|
|
122
122
|
}
|
|
123
|
-
],
|
|
123
|
+
], Ge = [
|
|
124
124
|
{
|
|
125
125
|
type: "user",
|
|
126
126
|
actor: "arvind@mindline.site",
|
|
@@ -140,102 +140,105 @@ const De = [
|
|
|
140
140
|
resources: []
|
|
141
141
|
}
|
|
142
142
|
], O = "workspaceIDs";
|
|
143
|
-
function
|
|
143
|
+
function At(a, t) {
|
|
144
144
|
return a + t;
|
|
145
145
|
}
|
|
146
|
-
function
|
|
146
|
+
function kt() {
|
|
147
147
|
return "hello NPM";
|
|
148
148
|
}
|
|
149
149
|
function F() {
|
|
150
|
-
return "1.0.
|
|
150
|
+
return "1.0.105";
|
|
151
151
|
}
|
|
152
152
|
class m {
|
|
153
153
|
constructor() {
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
154
|
+
c(this, "result");
|
|
155
|
+
c(this, "status");
|
|
156
|
+
c(this, "error");
|
|
157
|
+
c(this, "version");
|
|
158
|
+
c(this, "array");
|
|
159
159
|
this.result = !0, this.status = 200, this.error = "", this.version = F(), this.array = null;
|
|
160
160
|
}
|
|
161
161
|
}
|
|
162
|
-
class
|
|
162
|
+
class _ {
|
|
163
163
|
}
|
|
164
164
|
// azure graph REST API endpoints
|
|
165
|
-
|
|
166
|
-
const
|
|
165
|
+
c(_, "azureElevateAccess", "https://management.azure.com/providers/Microsoft.Authorization/elevateAccess?api-version=2016-07-01"), c(_, "azureListRootAssignments", "https://management.azure.com/providers/Microsoft.Authorization/roleAssignments?api-version=2022-04-01&$filter=principalId+eq+");
|
|
166
|
+
const I = class I {
|
|
167
167
|
// config API endpoints
|
|
168
168
|
static adminEndpoint() {
|
|
169
|
-
return `https://${
|
|
169
|
+
return `https://${I.environmentTag}-configurationapi-westus.azurewebsites.net/api/v1/admin`;
|
|
170
170
|
}
|
|
171
171
|
static adminIncompleteEndpoint() {
|
|
172
|
-
return `https://${
|
|
172
|
+
return `https://${I.environmentTag}-configurationapi-westus.azurewebsites.net/api/v1/incomplete-admin`;
|
|
173
173
|
}
|
|
174
174
|
static adminsEndpoint() {
|
|
175
|
-
return `https://${
|
|
175
|
+
return `https://${I.environmentTag}-configurationapi-westus.azurewebsites.net/api/v1/admins`;
|
|
176
176
|
}
|
|
177
177
|
static auditConfigEndpoint() {
|
|
178
|
-
return `https://${
|
|
178
|
+
return `https://${I.environmentTag}-configurationapi-westus.azurewebsites.net/api/v1/audit-configuration`;
|
|
179
179
|
}
|
|
180
180
|
static auditEventsEndpoint() {
|
|
181
|
-
return `https://${
|
|
181
|
+
return `https://${I.environmentTag}-configurationapi-westus.azurewebsites.net/api/v1/audit-events`;
|
|
182
182
|
}
|
|
183
183
|
static configConsentEndpoint() {
|
|
184
|
-
return `https://${
|
|
184
|
+
return `https://${I.environmentTag}-configurationapi-westus.azurewebsites.net/api/v1/configuration/consent`;
|
|
185
185
|
}
|
|
186
186
|
static configEnabledEndpoint() {
|
|
187
|
-
return `https://${
|
|
187
|
+
return `https://${I.environmentTag}-configurationapi-westus.azurewebsites.net/api/v1/configuration/status`;
|
|
188
188
|
}
|
|
189
189
|
static configEndpoint() {
|
|
190
|
-
return `https://${
|
|
190
|
+
return `https://${I.environmentTag}-configurationapi-westus.azurewebsites.net/api/v1/configuration`;
|
|
191
191
|
}
|
|
192
192
|
static configsEndpoint() {
|
|
193
|
-
return `https://${
|
|
193
|
+
return `https://${I.environmentTag}-configurationapi-westus.azurewebsites.net/api/v1/configurations`;
|
|
194
194
|
}
|
|
195
195
|
static initEndpoint() {
|
|
196
|
-
return `https://${
|
|
196
|
+
return `https://${I.environmentTag}-configurationapi-westus.azurewebsites.net/api/v1/configuration/init`;
|
|
197
197
|
}
|
|
198
198
|
static readerStartSyncEndpoint() {
|
|
199
|
-
return `https://${
|
|
199
|
+
return `https://${I.environmentTag}-configurationapi-westus.azurewebsites.net/api/v1/startSync`;
|
|
200
200
|
}
|
|
201
201
|
static tenantEndpoint() {
|
|
202
|
-
return `https://${
|
|
202
|
+
return `https://${I.environmentTag}-configurationapi-westus.azurewebsites.net/api/v1/tenant`;
|
|
203
203
|
}
|
|
204
204
|
static tenantsEndpoint() {
|
|
205
|
-
return `https://${
|
|
205
|
+
return `https://${I.environmentTag}-configurationapi-westus.azurewebsites.net/api/v1/tenants`;
|
|
206
206
|
}
|
|
207
207
|
static workspaceEndpoint() {
|
|
208
|
-
return `https://${
|
|
208
|
+
return `https://${I.environmentTag}-configurationapi-westus.azurewebsites.net/api/v1/workspace`;
|
|
209
209
|
}
|
|
210
210
|
static workspacesEndpoint() {
|
|
211
|
-
return `https://${
|
|
211
|
+
return `https://${I.environmentTag}-configurationapi-westus.azurewebsites.net/api/v1/workspaces`;
|
|
212
|
+
}
|
|
213
|
+
static workspaceConfigsEndpoint() {
|
|
214
|
+
return `https://${I.environmentTag}-configurationapi-westus.azurewebsites.net/api/v1/workspace-configurations`;
|
|
212
215
|
}
|
|
213
216
|
// SignalR endpoint
|
|
214
217
|
static signalREndpoint() {
|
|
215
|
-
return `https://${
|
|
218
|
+
return `https://${I.environmentTag}-signalrdispatcher-westus.azurewebsites.net/statsHub`;
|
|
216
219
|
}
|
|
217
220
|
};
|
|
218
|
-
|
|
219
|
-
let
|
|
221
|
+
c(I, "environmentTag", "dev");
|
|
222
|
+
let y = I;
|
|
220
223
|
class p {
|
|
221
224
|
}
|
|
222
225
|
// graph API predicates
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
class
|
|
226
|
+
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
|
+
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 Dt {
|
|
226
229
|
constructor() {
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
+
c(this, "id", "");
|
|
231
|
+
c(this, "displayName", "");
|
|
232
|
+
c(this, "description", "");
|
|
230
233
|
}
|
|
231
234
|
}
|
|
232
|
-
class
|
|
235
|
+
class Et {
|
|
233
236
|
constructor() {
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
237
|
+
c(this, "group", "");
|
|
238
|
+
c(this, "value", "");
|
|
239
|
+
c(this, "consented", !1);
|
|
240
|
+
c(this, "removable", !1);
|
|
241
|
+
c(this, "expanded", "");
|
|
239
242
|
}
|
|
240
243
|
static compareByValue(t, r) {
|
|
241
244
|
return t.value.localeCompare(r.value);
|
|
@@ -247,55 +250,55 @@ class At {
|
|
|
247
250
|
class X {
|
|
248
251
|
// set when the user is logging in to support spinner visibility
|
|
249
252
|
constructor() {
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
253
|
+
c(this, "oid");
|
|
254
|
+
c(this, "name");
|
|
255
|
+
c(this, "mail");
|
|
256
|
+
c(this, "authority");
|
|
257
|
+
c(this, "tid");
|
|
258
|
+
c(this, "companyName");
|
|
259
|
+
c(this, "companyDomain");
|
|
260
|
+
c(this, "workspaceIDs");
|
|
261
|
+
c(this, "session");
|
|
259
262
|
// button text
|
|
260
|
-
|
|
263
|
+
c(this, "spacode");
|
|
261
264
|
// to get front end access token
|
|
262
|
-
|
|
265
|
+
c(this, "graphAccessToken");
|
|
263
266
|
// front end graph access token
|
|
264
|
-
|
|
267
|
+
c(this, "mindlineAccessToken");
|
|
265
268
|
// front end mindline access token
|
|
266
|
-
|
|
269
|
+
c(this, "azureAccessToken");
|
|
267
270
|
// front end azure access token
|
|
268
|
-
|
|
271
|
+
c(this, "loginHint");
|
|
269
272
|
// to help sign out without prompt
|
|
270
|
-
|
|
273
|
+
c(this, "scopes");
|
|
271
274
|
// to detect if incremental consent has happened
|
|
272
|
-
|
|
275
|
+
c(this, "authTS");
|
|
273
276
|
// timestamp user was authenticated
|
|
274
|
-
|
|
277
|
+
c(this, "sel");
|
|
275
278
|
// selection state
|
|
276
|
-
|
|
279
|
+
c(this, "loggingIn");
|
|
277
280
|
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;
|
|
278
281
|
}
|
|
279
282
|
}
|
|
280
|
-
var Ce = /* @__PURE__ */ ((a) => (a[a.invalid = 0] = "invalid", a[a.aad = 1] = "aad", a[a.ad = 2] = "ad", a[a.googleworkspace = 3] = "googleworkspace", a))(Ce || {}),
|
|
283
|
+
var Ce = /* @__PURE__ */ ((a) => (a[a.invalid = 0] = "invalid", a[a.aad = 1] = "aad", a[a.ad = 2] = "ad", a[a.googleworkspace = 3] = "googleworkspace", a))(Ce || {}), xe = /* @__PURE__ */ ((a) => (a[a.read = 1] = "read", a[a.write = 2] = "write", a[a.notassigned = 3] = "notassigned", a))(xe || {});
|
|
281
284
|
class L {
|
|
282
285
|
// are we validating by TID or by domain? "Domain" | "Tenant ID"
|
|
283
286
|
constructor() {
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
287
|
+
c(this, "tid");
|
|
288
|
+
c(this, "name");
|
|
289
|
+
c(this, "domain");
|
|
290
|
+
c(this, "tenantType");
|
|
291
|
+
c(this, "authority");
|
|
292
|
+
c(this, "workspaceIDs");
|
|
293
|
+
c(this, "sel");
|
|
291
294
|
// selection state
|
|
292
|
-
|
|
295
|
+
c(this, "graphSP");
|
|
293
296
|
// graph resource ID (service principal) for this tenant
|
|
294
|
-
|
|
297
|
+
c(this, "lookupfield");
|
|
295
298
|
this.tid = "", this.name = "", this.domain = "", this.tenantType = "aad", this.authority = "", this.workspaceIDs = "", this.sel = !1, this.graphSP = "", this.lookupfield = "Domain";
|
|
296
299
|
}
|
|
297
300
|
}
|
|
298
|
-
function
|
|
301
|
+
function Ne(a, t) {
|
|
299
302
|
switch (a) {
|
|
300
303
|
case p.authorityWW:
|
|
301
304
|
return t === 1 ? "85d35da2-4118-4b03-aa05-605cedd7f2f8" : "63100afe-506e-4bb2-8ff7-d8d5ab373129";
|
|
@@ -321,7 +324,7 @@ function N(a) {
|
|
|
321
324
|
return "";
|
|
322
325
|
}
|
|
323
326
|
}
|
|
324
|
-
function
|
|
327
|
+
function Oe(a) {
|
|
325
328
|
switch (a) {
|
|
326
329
|
case p.authorityWW:
|
|
327
330
|
return "https://login.microsoftonline.com/";
|
|
@@ -334,67 +337,67 @@ function We(a) {
|
|
|
334
337
|
return "";
|
|
335
338
|
}
|
|
336
339
|
}
|
|
337
|
-
var
|
|
338
|
-
class
|
|
340
|
+
var We = /* @__PURE__ */ ((a) => (a[a.source = 1] = "source", a[a.target = 2] = "target", a[a.sourcetarget = 3] = "sourcetarget", a))(We || {});
|
|
341
|
+
class Fe {
|
|
339
342
|
constructor() {
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
343
|
+
c(this, "tid");
|
|
344
|
+
c(this, "sourceGroupId");
|
|
345
|
+
c(this, "sourceGroupName");
|
|
346
|
+
c(this, "targetGroupId");
|
|
347
|
+
c(this, "targetGroupName");
|
|
348
|
+
c(this, "configurationTenantType");
|
|
349
|
+
c(this, "deltaToken");
|
|
350
|
+
c(this, "usersWritten");
|
|
351
|
+
c(this, "configId");
|
|
352
|
+
c(this, "batchId");
|
|
353
|
+
c(this, "isReadPermissionConsented");
|
|
354
|
+
c(this, "isWritePermissionConsented");
|
|
352
355
|
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;
|
|
353
356
|
}
|
|
354
357
|
}
|
|
355
358
|
class Y {
|
|
356
359
|
// selection state
|
|
357
360
|
constructor() {
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
361
|
+
c(this, "id");
|
|
362
|
+
c(this, "workspaceId");
|
|
363
|
+
c(this, "name");
|
|
364
|
+
c(this, "description");
|
|
365
|
+
c(this, "tenants");
|
|
366
|
+
c(this, "isEnabled");
|
|
367
|
+
c(this, "workspaceIDs");
|
|
368
|
+
c(this, "sel");
|
|
366
369
|
this.id = "", this.name = "", this.workspaceId = "", this.description = "", this.tenants = new Array(), this.isEnabled = !1, this.workspaceIDs = "", this.sel = !1;
|
|
367
370
|
}
|
|
368
371
|
}
|
|
369
|
-
class
|
|
372
|
+
class vt {
|
|
370
373
|
// selection state
|
|
371
374
|
constructor() {
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
375
|
+
c(this, "id");
|
|
376
|
+
c(this, "workspaceId");
|
|
377
|
+
c(this, "name");
|
|
378
|
+
c(this, "description");
|
|
379
|
+
c(this, "isEnabled");
|
|
380
|
+
c(this, "isReadPermissionConsented");
|
|
381
|
+
c(this, "email");
|
|
382
|
+
c(this, "tenantId");
|
|
383
|
+
c(this, "sel");
|
|
381
384
|
this.id = "", this.name = "", this.workspaceId = "", this.description = "", this.isEnabled = !1, this.isReadPermissionConsented = !1, this.email = "", this.tenantId = "", this.sel = !1;
|
|
382
385
|
}
|
|
383
386
|
}
|
|
384
387
|
class ee {
|
|
385
388
|
// selection state
|
|
386
389
|
constructor() {
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
390
|
+
c(this, "id");
|
|
391
|
+
c(this, "name");
|
|
392
|
+
c(this, "ownerid");
|
|
393
|
+
c(this, "associatedUsers");
|
|
394
|
+
c(this, "associatedTenants");
|
|
395
|
+
c(this, "associatedConfigs");
|
|
396
|
+
c(this, "sel");
|
|
394
397
|
this.id = "", this.name = "", this.ownerid = "", this.associatedUsers = new Array(), this.associatedTenants = new Array(), this.associatedConfigs = new Array(), this.sel = !1;
|
|
395
398
|
}
|
|
396
399
|
}
|
|
397
|
-
function
|
|
400
|
+
function C() {
|
|
398
401
|
let a;
|
|
399
402
|
try {
|
|
400
403
|
a = window.localStorage;
|
|
@@ -411,23 +414,23 @@ function x() {
|
|
|
411
414
|
}
|
|
412
415
|
}
|
|
413
416
|
var q, ye;
|
|
414
|
-
class
|
|
417
|
+
class Pt {
|
|
415
418
|
constructor(t = !1) {
|
|
416
419
|
j(this, q);
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
420
|
+
c(this, "version", F());
|
|
421
|
+
c(this, "tab", 0);
|
|
422
|
+
c(this, "us", []);
|
|
423
|
+
c(this, "ts", []);
|
|
424
|
+
c(this, "cs", []);
|
|
425
|
+
c(this, "acs", []);
|
|
426
|
+
c(this, "ws", []);
|
|
427
|
+
c(this, "configlevelconsent_configid", "");
|
|
428
|
+
c(this, "configlevelconsent_access", 3);
|
|
426
429
|
this.init(t);
|
|
427
430
|
}
|
|
428
431
|
// get initial data from localStorage or file
|
|
429
432
|
init(t) {
|
|
430
|
-
if (console.log(`Calling InitInfo::init(bClearLocalStorage: ${t ? "true" : "false"})`),
|
|
433
|
+
if (console.log(`Calling InitInfo::init(bClearLocalStorage: ${t ? "true" : "false"})`), C()) {
|
|
431
434
|
let o = localStorage.getItem("InitInfo");
|
|
432
435
|
if (o != null && typeof o == "string" && o !== "") {
|
|
433
436
|
let i = JSON.parse(o);
|
|
@@ -441,7 +444,7 @@ class Dt {
|
|
|
441
444
|
}
|
|
442
445
|
}
|
|
443
446
|
this.tab = 0, this.version = F(), this.configlevelconsent_configid = "", this.configlevelconsent_access = 3;
|
|
444
|
-
var r = JSON.stringify(
|
|
447
|
+
var r = JSON.stringify(ke), s = JSON.stringify(De), e = JSON.stringify(Ee), n = JSON.stringify(ve);
|
|
445
448
|
try {
|
|
446
449
|
this.us = W(X, r), this.ts = W(L, s), this.cs = W(Y, e), this.ws = W(ee, n), this.tagWithWorkspaces();
|
|
447
450
|
} catch {
|
|
@@ -548,42 +551,42 @@ const Be = [
|
|
|
548
551
|
]
|
|
549
552
|
}
|
|
550
553
|
];
|
|
551
|
-
var
|
|
552
|
-
class
|
|
554
|
+
var P, te, se, re;
|
|
555
|
+
class Rt {
|
|
553
556
|
constructor(t) {
|
|
554
|
-
j(this,
|
|
555
|
-
|
|
557
|
+
j(this, P);
|
|
558
|
+
c(this, "tasks");
|
|
556
559
|
this.tasks = [new Q()], this.init(t);
|
|
557
560
|
}
|
|
558
561
|
// get initial data from localStorage or file
|
|
559
562
|
init(t) {
|
|
560
|
-
if (console.log(`Calling TaskArray::init(bClearLocalStorage: ${t ? "true" : "false"})`), this.tasks.length = 0, t &&
|
|
563
|
+
if (console.log(`Calling TaskArray::init(bClearLocalStorage: ${t ? "true" : "false"})`), this.tasks.length = 0, t && C() && localStorage.removeItem("Tasks"), C()) {
|
|
561
564
|
let r = localStorage.getItem("Tasks");
|
|
562
565
|
if (r != null && typeof r == "string" && r !== "") {
|
|
563
566
|
let e = JSON.parse(r);
|
|
564
|
-
if (this.tasks = G(this,
|
|
567
|
+
if (this.tasks = G(this, P, se).call(this, e.tasks), this.tasks.length !== 0) return;
|
|
565
568
|
}
|
|
566
569
|
}
|
|
567
|
-
this.tasks = G(this,
|
|
570
|
+
this.tasks = G(this, P, se).call(this, Be);
|
|
568
571
|
}
|
|
569
572
|
// set start time for a task
|
|
570
573
|
setTaskStart(t, r) {
|
|
571
|
-
let s = G(this,
|
|
574
|
+
let s = G(this, P, te).call(this, t);
|
|
572
575
|
if (s != null && s != null)
|
|
573
|
-
s.setStart(r), s.status = "in progress", G(this,
|
|
576
|
+
s.setStart(r), s.status = "in progress", G(this, P, re).call(this);
|
|
574
577
|
else
|
|
575
578
|
debugger;
|
|
576
579
|
}
|
|
577
580
|
// set end time for a task
|
|
578
581
|
setTaskEnd(t, r, s) {
|
|
579
|
-
let e = G(this,
|
|
582
|
+
let e = G(this, P, te).call(this, t);
|
|
580
583
|
if (e != null && e != null)
|
|
581
|
-
e.setEnd(r), e.status = s, G(this,
|
|
584
|
+
e.setEnd(r), e.status = s, G(this, P, re).call(this);
|
|
582
585
|
else
|
|
583
586
|
debugger;
|
|
584
587
|
}
|
|
585
588
|
}
|
|
586
|
-
|
|
589
|
+
P = new WeakSet(), //
|
|
587
590
|
// private
|
|
588
591
|
//
|
|
589
592
|
te = function(t) {
|
|
@@ -604,21 +607,21 @@ te = function(t) {
|
|
|
604
607
|
});
|
|
605
608
|
}, re = function() {
|
|
606
609
|
let t = JSON.stringify(this);
|
|
607
|
-
|
|
610
|
+
C() && localStorage.setItem("Tasks", t);
|
|
608
611
|
};
|
|
609
612
|
class Q {
|
|
610
613
|
constructor() {
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
614
|
+
c(this, "id", 0);
|
|
615
|
+
c(this, "task", "");
|
|
616
|
+
c(this, "start", /* @__PURE__ */ new Date());
|
|
617
|
+
c(this, "startDisplay", "");
|
|
618
|
+
c(this, "end", /* @__PURE__ */ new Date());
|
|
619
|
+
c(this, "endDisplay", "");
|
|
620
|
+
c(this, "elapsedDisplay", "");
|
|
621
|
+
c(this, "expected", 0);
|
|
622
|
+
c(this, "status", "");
|
|
623
|
+
c(this, "expanded", !1);
|
|
624
|
+
c(this, "subtasks", []);
|
|
622
625
|
}
|
|
623
626
|
setEnd(t) {
|
|
624
627
|
this.end = t, this.endDisplay = `${this.end.getMinutes().toString().padStart(2, "0")}:${this.end.getSeconds().toString().padStart(2, "0")}`;
|
|
@@ -631,19 +634,19 @@ class Q {
|
|
|
631
634
|
this.start = t, this.startDisplay = `${this.start.getMinutes().toString().padStart(2, "0")}:${this.start.getSeconds().toString().padStart(2, "0")}`;
|
|
632
635
|
}
|
|
633
636
|
}
|
|
634
|
-
class
|
|
637
|
+
class U {
|
|
635
638
|
constructor(t) {
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
639
|
+
c(this, "Run", 0);
|
|
640
|
+
c(this, "Start", /* @__PURE__ */ new Date());
|
|
641
|
+
c(this, "startDisplay", "");
|
|
642
|
+
c(this, "POST");
|
|
643
|
+
c(this, "postDisplay");
|
|
644
|
+
c(this, "Read");
|
|
645
|
+
c(this, "readDisplay");
|
|
646
|
+
c(this, "Write");
|
|
647
|
+
c(this, "writeDisplay");
|
|
648
|
+
c(this, "Duration");
|
|
649
|
+
c(this, "durationDisplay");
|
|
647
650
|
this.Run = t, 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 = "";
|
|
648
651
|
}
|
|
649
652
|
start(t) {
|
|
@@ -663,11 +666,11 @@ var z, ne;
|
|
|
663
666
|
class Ue {
|
|
664
667
|
constructor(t) {
|
|
665
668
|
j(this, z);
|
|
666
|
-
|
|
669
|
+
c(this, "milestones", []);
|
|
667
670
|
this.init(t);
|
|
668
671
|
}
|
|
669
672
|
init(t) {
|
|
670
|
-
if (
|
|
673
|
+
if (C()) {
|
|
671
674
|
let r = localStorage.getItem("syncmilestones");
|
|
672
675
|
if (r != null && typeof r == "string" && r !== "") {
|
|
673
676
|
let e = JSON.parse(r);
|
|
@@ -680,11 +683,11 @@ class Ue {
|
|
|
680
683
|
}
|
|
681
684
|
}
|
|
682
685
|
}
|
|
683
|
-
G(this, z, ne).call(this,
|
|
686
|
+
G(this, z, ne).call(this, Pe);
|
|
684
687
|
}
|
|
685
688
|
save() {
|
|
686
689
|
let t = JSON.stringify(this.milestones);
|
|
687
|
-
|
|
690
|
+
C() && localStorage.setItem("syncmilestones", t);
|
|
688
691
|
}
|
|
689
692
|
// milestone tracking during a sync
|
|
690
693
|
start(t) {
|
|
@@ -692,9 +695,9 @@ class Ue {
|
|
|
692
695
|
debugger;
|
|
693
696
|
return;
|
|
694
697
|
}
|
|
695
|
-
let r = Number(this.milestones[0].Run), s = new
|
|
698
|
+
let r = Number(this.milestones[0].Run), s = new U(r + 1);
|
|
696
699
|
this.milestones.unshift(s), this.milestones = this.milestones.map((e) => {
|
|
697
|
-
let n = new
|
|
700
|
+
let n = new U(e.Run);
|
|
698
701
|
return n.Start = e.Start, n.startDisplay = e.startDisplay, n.POST = e.POST, n.postDisplay = e.postDisplay, n.Read = e.Read, n.readDisplay = e.readDisplay, n.Write = e.Write, n.writeDisplay = e.writeDisplay, n.Duration = e.Duration, n.durationDisplay = e.durationDisplay, n;
|
|
699
702
|
}), t(this.milestones), console.log(`Start milestone: ${this.milestones[0].Run}:${this.milestones[0].Start}`);
|
|
700
703
|
}
|
|
@@ -705,7 +708,7 @@ class Ue {
|
|
|
705
708
|
}
|
|
706
709
|
let r = this.milestones.shift();
|
|
707
710
|
this.milestones = this.milestones.map((s) => {
|
|
708
|
-
let e = new
|
|
711
|
+
let e = new U(s.Run);
|
|
709
712
|
return e.Start = s.Start, e.startDisplay = s.startDisplay, e.POST = s.POST, e.postDisplay = s.postDisplay, e.Read = s.Read, e.readDisplay = s.readDisplay, e.Write = s.Write, e.writeDisplay = s.writeDisplay, e.Duration = s.Duration, e.durationDisplay = s.durationDisplay, e;
|
|
710
713
|
}), t(this.milestones), console.log(`Unstart removed first milestone: ${r.Run}:${r.Start}`);
|
|
711
714
|
}
|
|
@@ -733,35 +736,35 @@ class Ue {
|
|
|
733
736
|
console.log(`Removed milestone #${r.Run}: ${r.Start}`);
|
|
734
737
|
}
|
|
735
738
|
this.save(), this.milestones = this.milestones.map((r) => {
|
|
736
|
-
let s = new
|
|
739
|
+
let s = new U(r.Run);
|
|
737
740
|
return s.Start = r.Start, s.startDisplay = r.startDisplay, s.POST = r.POST, s.postDisplay = r.postDisplay, s.Read = r.Read, s.readDisplay = r.readDisplay, s.Write = r.Write, s.writeDisplay = r.writeDisplay, s.Duration = r.Duration, s.durationDisplay = r.durationDisplay, s;
|
|
738
741
|
}), t(this.milestones);
|
|
739
742
|
}
|
|
740
743
|
}
|
|
741
744
|
z = new WeakSet(), ne = function(t) {
|
|
742
745
|
t == null ? this.milestones = new Array() : this.milestones = t.map((r) => {
|
|
743
|
-
let s = new
|
|
746
|
+
let s = new U(Number(r.Run));
|
|
744
747
|
return s.start(r.Start), s.post(r.POST), s.read(r.Read), s.write(r.Write), s;
|
|
745
748
|
});
|
|
746
749
|
};
|
|
747
|
-
class
|
|
750
|
+
class Gt {
|
|
748
751
|
constructor(t, r, s) {
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
752
|
+
c(this, "tenantNodes");
|
|
753
|
+
c(this, "pb_startTS");
|
|
754
|
+
c(this, "pb_progress");
|
|
755
|
+
c(this, "pb_increment");
|
|
756
|
+
c(this, "pb_idle");
|
|
757
|
+
c(this, "pb_idleMax");
|
|
758
|
+
c(this, "pb_total");
|
|
759
|
+
c(this, "pb_timer");
|
|
760
|
+
c(this, "milestoneArray");
|
|
758
761
|
this.tenantNodes = new Array(), this.init(t, r, s), 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 Ue(!1);
|
|
759
762
|
}
|
|
760
763
|
// populate tenantNodes based on config tenants
|
|
761
764
|
init(t, r, s) {
|
|
762
765
|
console.log(
|
|
763
766
|
`Calling BatchArray::init(config: "${t ? t.name : "null"}", bClearLocalStorage: ${s ? "true" : "false"})`
|
|
764
|
-
), s &&
|
|
767
|
+
), s && C() && (localStorage.removeItem(t.name), this.milestoneArray.init(s)), t != null && t.tenants != null && r != null && (this.tenantNodes.length = 0, t.tenants.map((e) => {
|
|
765
768
|
if (e.configurationTenantType === "source" || e.configurationTenantType === "sourcetarget") {
|
|
766
769
|
let n = r.ts.find(
|
|
767
770
|
(o) => o.tid === e.tid
|
|
@@ -813,15 +816,15 @@ class Pt {
|
|
|
813
816
|
uninitializeProgressBar(t, r, s, e) {
|
|
814
817
|
this.pb_startTS = 0, this.pb_progress = 0, t(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, s(`No updates seen for ${this.pb_idle} seconds. [max idle: ${this.pb_idleMax}]`), this.milestoneArray.unstart(e);
|
|
815
818
|
}
|
|
816
|
-
initializeSignalR(t, r, s, e, n, o, d, i,
|
|
817
|
-
this.milestoneArray.post(
|
|
818
|
-
let
|
|
819
|
-
console.log(
|
|
820
|
-
let
|
|
819
|
+
initializeSignalR(t, r, s, e, n, o, d, i, l, u, f) {
|
|
820
|
+
this.milestoneArray.post(l), u("started sync, waiting for updates..."), this.init(t, r, !1);
|
|
821
|
+
let $ = (A) => {
|
|
822
|
+
console.log(A);
|
|
823
|
+
let E = JSON.parse(A);
|
|
821
824
|
this.pb_idle = 0;
|
|
822
|
-
let D = s.find((g) => g.BatchId ==
|
|
825
|
+
let D = s.find((g) => g.BatchId == E.TargetID);
|
|
823
826
|
if (D == null) {
|
|
824
|
-
console.log(`Batch ${
|
|
827
|
+
console.log(`Batch ${E.TargetID} not found in batchIdArray.`);
|
|
825
828
|
debugger;
|
|
826
829
|
return;
|
|
827
830
|
}
|
|
@@ -832,70 +835,70 @@ class Pt {
|
|
|
832
835
|
return;
|
|
833
836
|
}
|
|
834
837
|
h.batchId = D.BatchId;
|
|
835
|
-
let k =
|
|
836
|
-
for (let g = 0; g <
|
|
837
|
-
let
|
|
838
|
-
if (
|
|
839
|
-
let
|
|
840
|
-
if (M && (
|
|
841
|
-
console.log(`tid not found in ${
|
|
838
|
+
let k = E.Stats, T = Object.keys(k), v = Object.values(k), oe = !1, ie = !1;
|
|
839
|
+
for (let g = 0; g < T.length; g++) {
|
|
840
|
+
let R = T[g].endsWith("TotalCount"), M = T[g].endsWith("CurrentCount"), B = T[g].endsWith("DeferredCount"), V = T[g].endsWith("RescheduledCount");
|
|
841
|
+
if (T[g].startsWith("Reader")) {
|
|
842
|
+
let x = /Reader\/TID:(.+)\/TotalCount/;
|
|
843
|
+
if (M && (x = /Reader\/TID:(.+)\/CurrentCount/), B && (x = /Reader\/TID:(.+)\/DeferredCount/), V && (x = /Reader\/TID:(.+)\/RescheduledCount/), T[g].match(x) == null) {
|
|
844
|
+
console.log(`tid not found in ${T[g]}.`);
|
|
842
845
|
debugger;
|
|
843
846
|
return;
|
|
844
847
|
}
|
|
845
|
-
|
|
848
|
+
R ? (oe = Number(v[g]) == 0, h.total = Math.max(Number(v[g]), h.total), console.log(`----- ${h.name} TID: ${h.tid} batchId: ${h.batchId}`), console.log(`----- ${h.name} Total To Read: ${h.total}`)) : (ie = Number(v[g]) == 0, h.read = Math.max(Number(v[g]), h.read), console.log(`----- ${h.name} Currently Read: ${h.read}`));
|
|
846
849
|
}
|
|
847
|
-
if (h.nothingtosync = oe && ie,
|
|
848
|
-
let
|
|
849
|
-
M && (
|
|
850
|
-
let Z =
|
|
850
|
+
if (h.nothingtosync = oe && ie, T[g].startsWith("Writer")) {
|
|
851
|
+
let x = /Writer\/TID:(.+)\/TotalCount/;
|
|
852
|
+
M && (x = /Writer\/TID:(.+)\/CurrentCount/), B && (x = /Writer\/TID:(.+)\/DeferredCount/), V && (x = /Writer\/TID:(.+)\/RescheduledCount/);
|
|
853
|
+
let Z = T[g].match(x);
|
|
851
854
|
if (Z == null) {
|
|
852
|
-
console.log(`tid not found in ${
|
|
855
|
+
console.log(`tid not found in ${T[g]}.`);
|
|
853
856
|
debugger;
|
|
854
857
|
return;
|
|
855
858
|
}
|
|
856
|
-
let
|
|
857
|
-
if (
|
|
859
|
+
let b = h.targets.find((be) => be.tid === Z[1]);
|
|
860
|
+
if (b == null) {
|
|
858
861
|
console.log(`Writer ${h.name} not found under Reader ${h.name}.`);
|
|
859
862
|
debugger;
|
|
860
863
|
return;
|
|
861
864
|
}
|
|
862
|
-
if (
|
|
863
|
-
|
|
865
|
+
if (b.batchId = D.BatchId, R)
|
|
866
|
+
b.total = Math.max(Number(v[g]), b.total), console.log(`----- ${b.name} TID: ${b.tid} batchId: ${b.batchId}`), console.log(`----- ${b.name} Total To Write: ${b.total}`);
|
|
864
867
|
else if (M)
|
|
865
|
-
|
|
866
|
-
else if (
|
|
867
|
-
|
|
868
|
+
b.written = Math.max(Number(v[g]), b.written), console.log(`----- ${b.name} Total Written: ${b.written}`);
|
|
869
|
+
else if (B || V)
|
|
870
|
+
b.deferred = Math.max(Number(v[g]), b.deferred), console.log(`----- ${b.name} Total Deferred: ${b.deferred}`);
|
|
868
871
|
else {
|
|
869
872
|
console.log("unknown writer type");
|
|
870
873
|
debugger;
|
|
871
874
|
return;
|
|
872
875
|
}
|
|
873
|
-
|
|
876
|
+
b.update(b.total, b.read, b.written, b.deferred);
|
|
874
877
|
}
|
|
875
878
|
}
|
|
876
879
|
h.update(h.total, h.read, h.written, h.deferred);
|
|
877
|
-
let le = !0, ce = !0, de = !1, ue = !0,
|
|
880
|
+
let le = !0, ce = !0, de = !1, ue = !0, J = 0, fe = 0, pe = 0, he = 0;
|
|
878
881
|
if (this.tenantNodes.map((g) => {
|
|
879
|
-
g.targets.map((
|
|
880
|
-
ce && (ce =
|
|
881
|
-
}), ue && (ue = g.nothingtosync), le && (le = g.status == "complete" || g.status == "failed"),
|
|
882
|
-
}), n(
|
|
883
|
-
this.milestoneArray.write(
|
|
882
|
+
g.targets.map((R) => {
|
|
883
|
+
ce && (ce = R.status == "complete" || R.status == "failed"), de || (de = R.total > 0 || R.status != "not started"), pe += Math.max(R.total, g.total), he += R.written;
|
|
884
|
+
}), ue && (ue = g.nothingtosync), le && (le = g.status == "complete" || g.status == "failed"), J += g.total, fe += g.read;
|
|
885
|
+
}), n(J), o(fe), d(Math.max(pe, J)), i(he), ue)
|
|
886
|
+
this.milestoneArray.write(l), u("nothing to sync"), console.log('Setting config sync result: "nothing to sync"');
|
|
884
887
|
else {
|
|
885
888
|
if (le && this.milestoneArray.milestones[0].Read == null) {
|
|
886
|
-
this.milestoneArray.read(
|
|
887
|
-
let
|
|
888
|
-
this.pb_increment =
|
|
889
|
+
this.milestoneArray.read(l), u("reading complete"), console.log('Setting config sync result: "reading complete"'), e(t.workspaceId);
|
|
890
|
+
let B = (Date.now() - this.pb_startTS) / 1e3 / 8.5;
|
|
891
|
+
this.pb_increment = B, console.log(`Setting increment: ${this.pb_increment}% per second`);
|
|
889
892
|
}
|
|
890
|
-
ce ? (this.milestoneArray.write(
|
|
893
|
+
ce ? (this.milestoneArray.write(l), u("sync complete"), console.log('Setting config sync result: "complete"')) : de ? (u("writing in progress"), console.log('Setting config sync result: "writing in progress"')) : this.milestoneArray.milestones[0].Read == null && (u("reading in progress"), console.log('Setting config sync result: "reading in progress"'));
|
|
891
894
|
}
|
|
892
895
|
};
|
|
893
|
-
s.map((
|
|
894
|
-
const
|
|
895
|
-
let D = new URL(
|
|
896
|
-
D.searchParams.append("statsId",
|
|
896
|
+
s.map((A) => {
|
|
897
|
+
const E = y.signalREndpoint();
|
|
898
|
+
let D = new URL(E);
|
|
899
|
+
D.searchParams.append("statsId", A.BatchId), console.log(`Creating SignalR Hub for TID: ${A.SourceId} ${D.href}`);
|
|
897
900
|
const h = new H.HubConnectionBuilder().withUrl(D.href).withAutomaticReconnect().configureLogging(H.LogLevel.Information).build();
|
|
898
|
-
h.on("newMessage",
|
|
901
|
+
h.on("newMessage", $), h.onreconnecting((k) => {
|
|
899
902
|
console.assert(h.state === H.HubConnectionState.Reconnecting), console.log(`Connection lost due to error "${k}". Reconnecting.`);
|
|
900
903
|
}), h.onreconnected((k) => {
|
|
901
904
|
console.assert(h.state === H.HubConnectionState.Connected), console.log(`Connection reestablished. Connected with connectionId "${k}".`);
|
|
@@ -911,22 +914,22 @@ class Pt {
|
|
|
911
914
|
debugger;
|
|
912
915
|
return e.result = !1, e.error = "startSync: invalid parameters", e.status = 500, e;
|
|
913
916
|
}
|
|
914
|
-
return e = await
|
|
917
|
+
return e = await bt(t, r, s), e;
|
|
915
918
|
}
|
|
916
919
|
}
|
|
917
920
|
class me {
|
|
918
921
|
constructor(t, r, s) {
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
922
|
+
c(this, "expanded");
|
|
923
|
+
c(this, "status", "");
|
|
924
|
+
c(this, "name");
|
|
925
|
+
c(this, "tid");
|
|
926
|
+
c(this, "batchId");
|
|
927
|
+
c(this, "total", 0);
|
|
928
|
+
c(this, "read", 0);
|
|
929
|
+
c(this, "written", 0);
|
|
930
|
+
c(this, "deferred", 0);
|
|
931
|
+
c(this, "nothingtosync");
|
|
932
|
+
c(this, "targets");
|
|
930
933
|
this.expanded = !1, this.name = r, this.tid = t, this.batchId = s, this.nothingtosync = !1, this.targets = new Array(), this.update(0, 0, 0, 0);
|
|
931
934
|
}
|
|
932
935
|
update(t, r, s, e) {
|
|
@@ -935,12 +938,12 @@ class me {
|
|
|
935
938
|
}
|
|
936
939
|
class we {
|
|
937
940
|
constructor(t, r) {
|
|
938
|
-
|
|
941
|
+
c(this, "resourceNodes");
|
|
939
942
|
this.resourceNodes = new Array(), t && this.init(r);
|
|
940
943
|
}
|
|
941
944
|
// get resource data from localStorage or file
|
|
942
945
|
init(t) {
|
|
943
|
-
if (console.log(`Calling ResourceArray::init(bClearLocalStorage: ${t ? "true" : "false"})`),
|
|
946
|
+
if (console.log(`Calling ResourceArray::init(bClearLocalStorage: ${t ? "true" : "false"})`), C()) {
|
|
944
947
|
let s = localStorage.getItem("ResourceArray");
|
|
945
948
|
if (s != null && typeof s == "string" && s !== "")
|
|
946
949
|
if (t)
|
|
@@ -951,9 +954,9 @@ class we {
|
|
|
951
954
|
return;
|
|
952
955
|
}
|
|
953
956
|
}
|
|
954
|
-
var r = JSON.stringify(
|
|
957
|
+
var r = JSON.stringify(Re);
|
|
955
958
|
try {
|
|
956
|
-
this.resourceNodes = W(
|
|
959
|
+
this.resourceNodes = W(_e, r);
|
|
957
960
|
} catch {
|
|
958
961
|
debugger;
|
|
959
962
|
}
|
|
@@ -961,34 +964,34 @@ class we {
|
|
|
961
964
|
// read
|
|
962
965
|
async read(t, r) {
|
|
963
966
|
let s = new we(!1, !1);
|
|
964
|
-
return s.resourceNodes = await
|
|
967
|
+
return s.resourceNodes = await Qe(t, r), s;
|
|
965
968
|
}
|
|
966
969
|
// save resource data to localstorage
|
|
967
970
|
save() {
|
|
968
|
-
if (
|
|
971
|
+
if (C()) {
|
|
969
972
|
let t = JSON.stringify(this);
|
|
970
973
|
localStorage.setItem("ResourceArray", t);
|
|
971
974
|
}
|
|
972
975
|
}
|
|
973
976
|
}
|
|
974
|
-
class
|
|
977
|
+
class _e {
|
|
975
978
|
constructor(t, r, s) {
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
979
|
+
c(this, "type");
|
|
980
|
+
c(this, "resource");
|
|
981
|
+
c(this, "cost");
|
|
982
|
+
c(this, "expanded");
|
|
983
|
+
c(this, "resources");
|
|
981
984
|
this.type = t, this.resource = r, this.cost = s, this.expanded = !1, this.resources = new Array();
|
|
982
985
|
}
|
|
983
986
|
}
|
|
984
|
-
class
|
|
987
|
+
class Ct {
|
|
985
988
|
constructor(t) {
|
|
986
|
-
|
|
989
|
+
c(this, "actorNodes");
|
|
987
990
|
this.actorNodes = new Array(), this.init(t);
|
|
988
991
|
}
|
|
989
992
|
// get initial data from localStorage or file
|
|
990
993
|
init(t) {
|
|
991
|
-
if (console.log(`Calling ResourceArray::init(bClearLocalStorage: ${t ? "true" : "false"})`),
|
|
994
|
+
if (console.log(`Calling ResourceArray::init(bClearLocalStorage: ${t ? "true" : "false"})`), C()) {
|
|
992
995
|
let s = localStorage.getItem("RBACActors");
|
|
993
996
|
if (s != null && typeof s == "string" && s !== "")
|
|
994
997
|
if (t)
|
|
@@ -999,33 +1002,33 @@ class Rt {
|
|
|
999
1002
|
return;
|
|
1000
1003
|
}
|
|
1001
1004
|
}
|
|
1002
|
-
var r = JSON.stringify(
|
|
1005
|
+
var r = JSON.stringify(Ge);
|
|
1003
1006
|
try {
|
|
1004
|
-
this.actorNodes = W(
|
|
1007
|
+
this.actorNodes = W(Le, r);
|
|
1005
1008
|
} catch {
|
|
1006
1009
|
debugger;
|
|
1007
1010
|
}
|
|
1008
1011
|
}
|
|
1009
1012
|
}
|
|
1010
|
-
class
|
|
1013
|
+
class Le {
|
|
1011
1014
|
constructor(t, r, s, e, n, o) {
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1015
|
+
c(this, "type");
|
|
1016
|
+
c(this, "actor");
|
|
1017
|
+
c(this, "resource");
|
|
1018
|
+
c(this, "role");
|
|
1019
|
+
c(this, "updatedby");
|
|
1020
|
+
c(this, "updatedon");
|
|
1021
|
+
c(this, "actors");
|
|
1019
1022
|
this.type = t, this.actor = r, this.resource = s, this.role = e, this.updatedby = n, this.updatedon = o, this.actors = new Array();
|
|
1020
1023
|
}
|
|
1021
1024
|
}
|
|
1022
|
-
function
|
|
1025
|
+
function ze(a) {
|
|
1023
1026
|
return "Group.Read.All User.Read.All openid profile offline_access User.Read Contacts.Read CrossTenantInformation.ReadBasic.All";
|
|
1024
1027
|
}
|
|
1025
|
-
async function
|
|
1028
|
+
async function K(a, t) {
|
|
1026
1029
|
const r = new Headers();
|
|
1027
1030
|
r.append("Content-Type", "application/json"), r.append("accept", "*/*");
|
|
1028
|
-
const s =
|
|
1031
|
+
const s = ze();
|
|
1029
1032
|
if (t.graphAccessToken == null || t.graphAccessToken === "")
|
|
1030
1033
|
try {
|
|
1031
1034
|
let e = await a.acquireTokenByCode({
|
|
@@ -1061,10 +1064,10 @@ async function J(a, t) {
|
|
|
1061
1064
|
}
|
|
1062
1065
|
return r.append("Authorization", `Bearer ${t.graphAccessToken}`), r;
|
|
1063
1066
|
}
|
|
1064
|
-
async function
|
|
1067
|
+
async function xt(a, t, r) {
|
|
1065
1068
|
if (t == null || t.spacode == "")
|
|
1066
1069
|
return { groups: [], error: "500: invalid user passed to groupsGet" };
|
|
1067
|
-
let e = { method: "GET", headers: await
|
|
1070
|
+
let e = { method: "GET", headers: await K(a, t) };
|
|
1068
1071
|
try {
|
|
1069
1072
|
let n = N(t.authority) + p.graphGroupsPredicate;
|
|
1070
1073
|
n += `/?$filter=startsWith(displayName, '${r}')`;
|
|
@@ -1074,7 +1077,7 @@ async function Et(a, t, r) {
|
|
|
1074
1077
|
return console.log(n), { groups: [], error: `Exception: ${n}` };
|
|
1075
1078
|
}
|
|
1076
1079
|
}
|
|
1077
|
-
async function
|
|
1080
|
+
async function Me(a, t, r, s) {
|
|
1078
1081
|
try {
|
|
1079
1082
|
let e = N(t.authority) + p.graphOauth2PermissionGrantsPredicate, n = new URL(e);
|
|
1080
1083
|
n.searchParams.append("$filter", `resourceId eq '${r}' and consentType eq 'Principal' and principalId eq '${s}'`);
|
|
@@ -1090,29 +1093,29 @@ async function je(a, t, r, s) {
|
|
|
1090
1093
|
return console.log(e), { grants: null, id: null, error: `Exception: ${e}` };
|
|
1091
1094
|
}
|
|
1092
1095
|
}
|
|
1093
|
-
async function
|
|
1096
|
+
async function je(a, t, r, s) {
|
|
1094
1097
|
if (t == null || t.spacode == "")
|
|
1095
1098
|
return !1;
|
|
1096
1099
|
try {
|
|
1097
1100
|
let e = N(t.authority);
|
|
1098
1101
|
e += p.graphOauth2PermissionGrantsPredicate + `/${r}`;
|
|
1099
|
-
let n = `{ "scope": "${s}" }`, d = { method: "PATCH", headers: await
|
|
1102
|
+
let n = `{ "scope": "${s}" }`, d = { method: "PATCH", headers: await K(a, t), body: n }, i = await fetch(e, d), l = await i.json();
|
|
1100
1103
|
if (i.status == 204 && i.statusText == "No Content")
|
|
1101
1104
|
return !0;
|
|
1102
1105
|
debugger;
|
|
1103
|
-
return console.log(`oauth2PermissionGrantsSet: PATCH failed ${
|
|
1106
|
+
return console.log(`oauth2PermissionGrantsSet: PATCH failed ${l.error.code}: ${l.error.message}`), !1;
|
|
1104
1107
|
} catch (e) {
|
|
1105
1108
|
debugger;
|
|
1106
1109
|
return console.log(e), !1;
|
|
1107
1110
|
}
|
|
1108
1111
|
}
|
|
1109
|
-
function
|
|
1110
|
-
let r =
|
|
1112
|
+
function Nt(a, t) {
|
|
1113
|
+
let r = Oe(a.authority);
|
|
1111
1114
|
r += a.tid, r += "/adminconsent";
|
|
1112
|
-
let s = new URL(r), e =
|
|
1115
|
+
let s = new URL(r), e = Ne(a.authority, t);
|
|
1113
1116
|
s.searchParams.append("client_id", e), s.searchParams.append("redirect_uri", window.location.origin), s.searchParams.append("domain_hint", a.companyDomain), s.searchParams.append("login_hint", a.mail), window.location.assign(s.href);
|
|
1114
1117
|
}
|
|
1115
|
-
async function
|
|
1118
|
+
async function He(a, t, r) {
|
|
1116
1119
|
try {
|
|
1117
1120
|
let s = N(t.authority);
|
|
1118
1121
|
s += p.graphServicePrincipalsPredicate, s += `(appId='${r}')`;
|
|
@@ -1124,7 +1127,7 @@ async function qe(a, t, r) {
|
|
|
1124
1127
|
return console.log(s), { spid: "", error: `Exception: ${s}` };
|
|
1125
1128
|
}
|
|
1126
1129
|
}
|
|
1127
|
-
async function
|
|
1130
|
+
async function Ot(a, t) {
|
|
1128
1131
|
if (a.authority == "") {
|
|
1129
1132
|
let e = new L();
|
|
1130
1133
|
if (e.domain = a.tid, await Te(e, !1))
|
|
@@ -1158,7 +1161,7 @@ async function xt(a, t) {
|
|
|
1158
1161
|
s.searchParams.append("domainHint", "organizations");
|
|
1159
1162
|
return t.setTaskStart("initialization", /* @__PURE__ */ new Date()), t.setTaskStart("authenticate user", /* @__PURE__ */ new Date()), window.location.assign(s.href), !0;
|
|
1160
1163
|
}
|
|
1161
|
-
function
|
|
1164
|
+
function Wt(a, t) {
|
|
1162
1165
|
debugger;
|
|
1163
1166
|
if (a.oid == "1") return;
|
|
1164
1167
|
let r = window.location.href;
|
|
@@ -1178,7 +1181,7 @@ function Ct(a, t) {
|
|
|
1178
1181
|
let s = new URL(r);
|
|
1179
1182
|
s.searchParams.append("redirectUri", window.location.origin), s.searchParams.append("scope", t), s.searchParams.append("domainHint", "organizations"), s.searchParams.append("loginHint", a.mail), window.location.assign(s.href);
|
|
1180
1183
|
}
|
|
1181
|
-
async function
|
|
1184
|
+
async function Ft(a) {
|
|
1182
1185
|
if (a.oid == "1") return !1;
|
|
1183
1186
|
let t = window.location.href;
|
|
1184
1187
|
t += "user";
|
|
@@ -1205,7 +1208,7 @@ async function Nt(a) {
|
|
|
1205
1208
|
}
|
|
1206
1209
|
return r = new URL(n), r.searchParams.append("redirectUri", window.location.origin), window.location.assign(r.href), !0;
|
|
1207
1210
|
}
|
|
1208
|
-
async function
|
|
1211
|
+
async function Bt(a, t, r, s) {
|
|
1209
1212
|
if (s) debugger;
|
|
1210
1213
|
if (t.name != null && t.name !== "") return !1;
|
|
1211
1214
|
if (a.graphAccessToken != null && a.graphAccessToken === "") {
|
|
@@ -1225,13 +1228,13 @@ async function Ot(a, t, r, s) {
|
|
|
1225
1228
|
d += "(domainName='", d += t.domain, d += "')", console.log("tenantRelationshipsGetByDomain: Attempting GET from /findTenantInformationByDomainName:", d);
|
|
1226
1229
|
let i = await fetch(d, o);
|
|
1227
1230
|
if (i.status == 200) {
|
|
1228
|
-
let
|
|
1229
|
-
if (
|
|
1230
|
-
if (
|
|
1231
|
+
let l = await i.json();
|
|
1232
|
+
if (l) {
|
|
1233
|
+
if (l.error != null) {
|
|
1231
1234
|
debugger;
|
|
1232
|
-
return console.log("tenantRelationshipsGetByDomain: Failed GET from /findTenantInformationByDomainName: ",
|
|
1233
|
-
} else if (
|
|
1234
|
-
return t.tid =
|
|
1235
|
+
return console.log("tenantRelationshipsGetByDomain: Failed GET from /findTenantInformationByDomainName: ", l.error.message), !1;
|
|
1236
|
+
} else if (l.displayName != null && l.displayName !== "")
|
|
1237
|
+
return t.tid = l.tenantId, t.name = l.displayName, console.log("tenantRelationshipsGetByDomain: Successful GET from /findTenantInformationByDomainName: ", l.displayName), !0;
|
|
1235
1238
|
} else
|
|
1236
1239
|
console.log("tenantRelationshipsGetByDomain: Failed to GET from /findTenantInformationByDomainName: ", d);
|
|
1237
1240
|
}
|
|
@@ -1240,14 +1243,14 @@ async function Ot(a, t, r, s) {
|
|
|
1240
1243
|
}
|
|
1241
1244
|
return !1;
|
|
1242
1245
|
}
|
|
1243
|
-
async function
|
|
1246
|
+
async function qe(a, t, r, s, e) {
|
|
1244
1247
|
if (console.log("**** tenantRelationshipsGetById"), e) debugger;
|
|
1245
1248
|
if (a.graphAccessToken === "")
|
|
1246
1249
|
try {
|
|
1247
|
-
let
|
|
1248
|
-
a.graphAccessToken =
|
|
1249
|
-
} catch (
|
|
1250
|
-
return console.log("tenantRelationshipsGetById: Front end token failure: " +
|
|
1250
|
+
let l = await s.acquireTokenByCode({ code: a.spacode, scopes: ["user.read", "contacts.read", "CrossTenantInformation.ReadBasic.All"] });
|
|
1251
|
+
a.graphAccessToken = l.accessToken, console.log("tenantRelationshipsGetById: Front end token acquired: " + a.graphAccessToken.slice(0, 20));
|
|
1252
|
+
} catch (l) {
|
|
1253
|
+
return console.log("tenantRelationshipsGetById: Front end token failure: " + l), !1;
|
|
1251
1254
|
}
|
|
1252
1255
|
const n = new Headers(), o = `Bearer ${a.graphAccessToken}`;
|
|
1253
1256
|
n.append("Authorization", o);
|
|
@@ -1266,8 +1269,8 @@ async function Je(a, t, r, s, e) {
|
|
|
1266
1269
|
return console.log("tenantRelationshipsGetById: Successful GET from /findTenantInformationByTenantId: ", u.displayName), !0;
|
|
1267
1270
|
} else
|
|
1268
1271
|
console.log("tenantRelationshipsGetById: Failed to GET from /findTenantInformationByTenantId: ", i);
|
|
1269
|
-
} catch (
|
|
1270
|
-
return console.log("tenantRelationshipsGetById: Failed to GET from /findTenantInformationByTenantId: ",
|
|
1272
|
+
} catch (l) {
|
|
1273
|
+
return console.log("tenantRelationshipsGetById: Failed to GET from /findTenantInformationByTenantId: ", l), !1;
|
|
1271
1274
|
}
|
|
1272
1275
|
return !1;
|
|
1273
1276
|
}
|
|
@@ -1278,9 +1281,9 @@ async function Te(a, t) {
|
|
|
1278
1281
|
for (let i = 0; i < 3; i++) {
|
|
1279
1282
|
var n = r[i];
|
|
1280
1283
|
if (a.lookupfield == "Domain" ? n += a.domain : a.lookupfield == "Tenant ID" && (n += a.tid), n += "/.well-known/openid-configuration", console.log("Attempting GET from openid well-known endpoint: ", n), e = await fetch(n), e.status == 200) {
|
|
1281
|
-
let
|
|
1282
|
-
if (
|
|
1283
|
-
var o =
|
|
1284
|
+
let l = await e.json();
|
|
1285
|
+
if (l) {
|
|
1286
|
+
var o = l.authorization_endpoint;
|
|
1284
1287
|
for (let u = 0; u < 3; u++) {
|
|
1285
1288
|
var d = o.match(s[u]);
|
|
1286
1289
|
if (d != null)
|
|
@@ -1301,17 +1304,17 @@ async function Ke(a, t, r) {
|
|
|
1301
1304
|
debugger;
|
|
1302
1305
|
return { scopes: null, id: null, error: "500: invalid parameter(s) passed to getUserDelegatedScopes" };
|
|
1303
1306
|
}
|
|
1304
|
-
let e = { method: "GET", headers: await
|
|
1307
|
+
let e = { method: "GET", headers: await K(a, t) };
|
|
1305
1308
|
try {
|
|
1306
1309
|
if (r.graphSP == "") {
|
|
1307
|
-
let { spid: i, error:
|
|
1308
|
-
if (
|
|
1310
|
+
let { spid: i, error: l } = await He(e, t, "00000003-0000-0000-c000-000000000000");
|
|
1311
|
+
if (l != "") {
|
|
1309
1312
|
debugger;
|
|
1310
|
-
return { scopes: null, id: null, error: `${
|
|
1313
|
+
return { scopes: null, id: null, error: `${l}` };
|
|
1311
1314
|
}
|
|
1312
1315
|
r.graphSP = i;
|
|
1313
1316
|
}
|
|
1314
|
-
let { grants: n, id: o, error: d } = await
|
|
1317
|
+
let { grants: n, id: o, error: d } = await Me(e, t, r.graphSP, t.oid);
|
|
1315
1318
|
if (d != "") {
|
|
1316
1319
|
debugger;
|
|
1317
1320
|
return { scopes: null, id: null, error: `${d}` };
|
|
@@ -1322,7 +1325,7 @@ async function Ke(a, t, r) {
|
|
|
1322
1325
|
return console.log(n), { scopes: null, id: null, error: `Exception: ${n}` };
|
|
1323
1326
|
}
|
|
1324
1327
|
}
|
|
1325
|
-
async function
|
|
1328
|
+
async function Ut(a, t, r, s) {
|
|
1326
1329
|
if (t == null || t.spacode == "" || r == null) {
|
|
1327
1330
|
debugger;
|
|
1328
1331
|
return !1;
|
|
@@ -1333,18 +1336,18 @@ async function Wt(a, t, r, s) {
|
|
|
1333
1336
|
return console.log(`userDelegatedScopesRemove: cannot find userDelegatedScopes for ${t.mail}: ${o}`), !1;
|
|
1334
1337
|
}
|
|
1335
1338
|
e = e.replace(s, "");
|
|
1336
|
-
let d = await
|
|
1339
|
+
let d = await je(a, t, n, e);
|
|
1337
1340
|
if (!d) {
|
|
1338
1341
|
debugger;
|
|
1339
1342
|
return console.log(`userDelegatedScopesRemove: cannot set oauth2PermissionGrants for ${t.mail}: ${o}`), !1;
|
|
1340
1343
|
}
|
|
1341
1344
|
return t.scopes = e.split(" "), d;
|
|
1342
1345
|
}
|
|
1343
|
-
async function
|
|
1346
|
+
async function _t(a, t) {
|
|
1344
1347
|
if (t == null || t.spacode == "")
|
|
1345
1348
|
return { users: [], error: "500: invalid user passed to usersGet" };
|
|
1346
1349
|
try {
|
|
1347
|
-
let s = { method: "GET", headers: await
|
|
1350
|
+
let s = { method: "GET", headers: await K(a, t) }, e = N(t.authority);
|
|
1348
1351
|
e += p.graphUsersPredicate;
|
|
1349
1352
|
let o = await (await fetch(e, s)).json();
|
|
1350
1353
|
if (typeof o.error < "u")
|
|
@@ -1357,94 +1360,99 @@ async function Ft(a, t) {
|
|
|
1357
1360
|
return console.log(r), { users: [], error: `Exception: ${r}` };
|
|
1358
1361
|
}
|
|
1359
1362
|
}
|
|
1360
|
-
async function
|
|
1363
|
+
async function Lt(a, t, r, s) {
|
|
1364
|
+
return st(a, t, r, s);
|
|
1365
|
+
}
|
|
1366
|
+
async function zt(a, t, r, s) {
|
|
1361
1367
|
return rt(a, t, r, s);
|
|
1362
1368
|
}
|
|
1363
|
-
async function
|
|
1364
|
-
return nt();
|
|
1369
|
+
async function Mt(a, t, r, s, e) {
|
|
1370
|
+
return nt(a, t, r, s, e);
|
|
1371
|
+
}
|
|
1372
|
+
async function jt(a, t, r, s) {
|
|
1373
|
+
return at(a, t, r, s);
|
|
1365
1374
|
}
|
|
1366
|
-
async function
|
|
1367
|
-
return
|
|
1375
|
+
async function Ht(a, t, r) {
|
|
1376
|
+
return ot(a, t, r);
|
|
1368
1377
|
}
|
|
1369
|
-
async function
|
|
1378
|
+
async function qt(a, t, r, s, e, n, o, d) {
|
|
1370
1379
|
let i = new m();
|
|
1371
1380
|
if (r.id === "1") {
|
|
1372
|
-
if (i = await
|
|
1381
|
+
if (i = await ut(a, t, r, n.id, d), i.result) {
|
|
1373
1382
|
s && s(r.id);
|
|
1374
|
-
const
|
|
1375
|
-
Object.defineProperty(
|
|
1383
|
+
const l = {};
|
|
1384
|
+
Object.defineProperty(l, r.id, { value: !0, writable: !0, enumerable: !0 }), e(l);
|
|
1376
1385
|
let u = n.associatedConfigs.findIndex((f) => f == "1");
|
|
1377
1386
|
u !== -1 && (n.associatedConfigs.splice(u, 1), n.associatedConfigs.push(r.id));
|
|
1378
1387
|
}
|
|
1379
1388
|
} else
|
|
1380
|
-
i = await
|
|
1389
|
+
i = await ft(a, t, r, d);
|
|
1381
1390
|
return o.save(), i;
|
|
1382
1391
|
}
|
|
1383
|
-
async function
|
|
1392
|
+
async function Kt(a, t, r, s, e) {
|
|
1384
1393
|
let n = new m();
|
|
1385
|
-
return n = await
|
|
1394
|
+
return n = await dt(a, t, r, s, e), n;
|
|
1386
1395
|
}
|
|
1387
|
-
async function
|
|
1388
|
-
return ot(a, t, r, s, e);
|
|
1389
|
-
}
|
|
1390
|
-
async function jt(a, t, r, s, e) {
|
|
1396
|
+
async function Jt(a, t, r, s, e) {
|
|
1391
1397
|
return it(a, t, r, s, e);
|
|
1392
1398
|
}
|
|
1393
|
-
async function
|
|
1399
|
+
async function Vt(a, t, r, s, e) {
|
|
1400
|
+
return lt(a, t, r, s, e);
|
|
1401
|
+
}
|
|
1402
|
+
async function Zt(a, t, r, s, e) {
|
|
1394
1403
|
let n = new m();
|
|
1395
1404
|
if (e) debugger;
|
|
1396
1405
|
try {
|
|
1397
1406
|
let o = s.ws.find((d) => d.id === r);
|
|
1398
1407
|
if (o != null) {
|
|
1399
1408
|
o.associatedConfigs.length = 0;
|
|
1400
|
-
let d = await
|
|
1409
|
+
let d = await ht(a, t, o.id, e);
|
|
1401
1410
|
if (!d.result) return d;
|
|
1402
1411
|
let i = "";
|
|
1403
|
-
for (let
|
|
1404
|
-
let u = s.cs.find((f) => f.id ===
|
|
1405
|
-
u != null && u.sel && (i = u.id);
|
|
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();
|
|
1406
1415
|
}
|
|
1407
|
-
|
|
1408
|
-
}
|
|
1409
|
-
|
|
1416
|
+
return d;
|
|
1417
|
+
} else
|
|
1418
|
+
return n.result = !1, n.error = "Workspace not found.", n.status = 404, n;
|
|
1410
1419
|
} catch (o) {
|
|
1411
|
-
console.log(o.message), n.error = o.message;
|
|
1420
|
+
return console.log(o.message), n.error = o.message, n.result = !1, n.status = 500, n;
|
|
1412
1421
|
}
|
|
1413
|
-
return n.result = !1, n.status = 500, n;
|
|
1414
1422
|
}
|
|
1415
|
-
async function
|
|
1416
|
-
return
|
|
1423
|
+
async function Qt(a, t, r, s, e) {
|
|
1424
|
+
return ct(a, t, r, s);
|
|
1417
1425
|
}
|
|
1418
|
-
async function
|
|
1426
|
+
async function Xt(a, t, r, s, e) {
|
|
1419
1427
|
console.log(">>>>>> initGet");
|
|
1420
1428
|
let n = new m();
|
|
1421
1429
|
if (e)
|
|
1422
1430
|
debugger;
|
|
1423
1431
|
let o = new L();
|
|
1424
|
-
return o.tid = t.tid, o.domain = t.tid, await Te(o, e) ? (t.authority = o.authority, s.setTaskStart("GET tenant details", /* @__PURE__ */ new Date()), n.result = await
|
|
1432
|
+
return o.tid = t.tid, o.domain = t.tid, await Te(o, e) ? (t.authority = o.authority, s.setTaskStart("GET tenant details", /* @__PURE__ */ new Date()), n.result = await qe(t, o, r, a, e), s.setTaskEnd("GET tenant details", /* @__PURE__ */ new Date(), "complete"), n.result && (t.companyName = o.name, t.companyDomain = o.domain, s.setTaskStart("POST config init", /* @__PURE__ */ new Date()), n = await gt(a, t, e), s.setTaskEnd("POST config init", /* @__PURE__ */ new Date(), n.result ? "complete" : "failed")), n.result && (s.setTaskStart("GET workspaces", /* @__PURE__ */ new Date()), n = await Ze(a, t, r, e), s.setTaskEnd("GET workspaces", /* @__PURE__ */ new Date(), n.result ? "complete" : "failed")), console.log("initGet complete. Version: " + F()), n) : (n.error = `Failed to retrieve authority for user "${t.mail}" TID ${t.tid}.`, n.result = !1, n);
|
|
1425
1433
|
}
|
|
1426
|
-
async function
|
|
1427
|
-
return
|
|
1434
|
+
async function Yt(a, t, r, s) {
|
|
1435
|
+
return wt(a, t, r, s);
|
|
1428
1436
|
}
|
|
1429
|
-
async function
|
|
1430
|
-
return
|
|
1437
|
+
async function es(a, t, r, s, e) {
|
|
1438
|
+
return mt(a, t, r, s);
|
|
1431
1439
|
}
|
|
1432
|
-
async function
|
|
1433
|
-
return
|
|
1440
|
+
async function ts(a, t, r, s) {
|
|
1441
|
+
return tt(a, t, r, s);
|
|
1434
1442
|
}
|
|
1435
|
-
async function
|
|
1436
|
-
return
|
|
1443
|
+
async function ss(a, t, r, s) {
|
|
1444
|
+
return Ye(a, t, r, s);
|
|
1437
1445
|
}
|
|
1438
|
-
async function
|
|
1439
|
-
return await
|
|
1446
|
+
async function rs(a, t, r, s) {
|
|
1447
|
+
return await Tt(a, t, r, s);
|
|
1440
1448
|
}
|
|
1441
|
-
function
|
|
1449
|
+
function Je(a, t, r, s) {
|
|
1442
1450
|
r.map((e) => {
|
|
1443
|
-
let n = null, o = t.us.findIndex((
|
|
1451
|
+
let n = null, o = t.us.findIndex((l) => l.oid === e.userId || l.oid === e.email);
|
|
1444
1452
|
if (o === -1) {
|
|
1445
|
-
let
|
|
1446
|
-
if (
|
|
1447
|
-
n = t.us.at(
|
|
1453
|
+
let l = t.us.findIndex((u) => u.oid === "1");
|
|
1454
|
+
if (l !== -1) {
|
|
1455
|
+
n = t.us.at(l);
|
|
1448
1456
|
let u = a.associatedUsers.findIndex((f) => f == "1");
|
|
1449
1457
|
u !== -1 && (a.associatedUsers.splice(u, 1), a.associatedUsers.push(e.userId));
|
|
1450
1458
|
} else
|
|
@@ -1452,18 +1460,18 @@ function Ve(a, t, r, s) {
|
|
|
1452
1460
|
} else
|
|
1453
1461
|
n = t.us.at(o);
|
|
1454
1462
|
n.sel = s === e.userId, n.oid = e.userId ? e.userId : e.email, n.name = e.firstName ?? n.name, n.mail = e.email, n.tid = e.tenantId;
|
|
1455
|
-
let d = t.ts.find((
|
|
1456
|
-
d != null && (n.authority = d.authority, n.companyName = d.name, n.companyDomain = d.domain), a.associatedUsers.findIndex((
|
|
1463
|
+
let d = t.ts.find((l) => l.tid === n.tid);
|
|
1464
|
+
d != null && (n.authority = d.authority, n.companyName = d.name, n.companyDomain = d.domain), a.associatedUsers.findIndex((l) => l === n.oid) == -1 && a.associatedUsers.push(n.oid);
|
|
1457
1465
|
}), t.save();
|
|
1458
1466
|
}
|
|
1459
|
-
function
|
|
1467
|
+
function Ve(a, t, r, s) {
|
|
1460
1468
|
r.map((e) => {
|
|
1461
1469
|
let n = null, o = t.ts.findIndex((u) => u.tid === e.tenantId);
|
|
1462
1470
|
if (o === -1) {
|
|
1463
1471
|
let u = t.ts.findIndex((f) => f.tid === "1");
|
|
1464
1472
|
if (u !== -1) {
|
|
1465
1473
|
n = t.ts.at(u);
|
|
1466
|
-
let f = a.associatedTenants.findIndex((
|
|
1474
|
+
let f = a.associatedTenants.findIndex(($) => $ == "1");
|
|
1467
1475
|
f !== -1 && (a.associatedTenants.splice(f, 1), a.associatedTenants.push(e.tenantId));
|
|
1468
1476
|
} else
|
|
1469
1477
|
n = new L(), t.ts.push(n);
|
|
@@ -1478,54 +1486,54 @@ function Se(a, t, r, s) {
|
|
|
1478
1486
|
r.map((e) => {
|
|
1479
1487
|
let n = null, o = t.cs.findIndex((i) => i.id === e.id);
|
|
1480
1488
|
if (o === -1) {
|
|
1481
|
-
let i = t.cs.findIndex((
|
|
1489
|
+
let i = t.cs.findIndex((l) => l.id === "1");
|
|
1482
1490
|
if (i !== -1) {
|
|
1483
1491
|
n = t.cs.at(i);
|
|
1484
|
-
let
|
|
1485
|
-
|
|
1492
|
+
let l = a.associatedConfigs.findIndex((u) => u == "1");
|
|
1493
|
+
l !== -1 && (a.associatedConfigs.splice(l, 1), a.associatedConfigs.push(e.id));
|
|
1486
1494
|
} else
|
|
1487
1495
|
n = new Y(), t.cs.push(n);
|
|
1488
1496
|
} else
|
|
1489
1497
|
n = t.cs.at(o);
|
|
1490
1498
|
n.sel = s === e.id, n.id = e.id, n.workspaceId = e.workspaceId, n.name = e.name, n.description = e.description, n.isEnabled = e.isEnabled, n.tenants.length = 0, e.tenants.map((i) => {
|
|
1491
|
-
let
|
|
1492
|
-
|
|
1499
|
+
let l = new Fe();
|
|
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 = n.id, l.batchId = i.batchId ?? "", l.isReadPermissionConsented = i.isReadPermissionConsented, l.isWritePermissionConsented = i.isWritePermissionConsented, n.tenants.push(l);
|
|
1493
1501
|
}), a.associatedConfigs.findIndex((i) => i === e.id) == -1 && a.associatedConfigs.push(e.id);
|
|
1494
1502
|
}), t.save();
|
|
1495
1503
|
}
|
|
1496
|
-
async function
|
|
1504
|
+
async function Ze(a, t, r, s) {
|
|
1497
1505
|
let e = new m();
|
|
1498
1506
|
if (s) debugger;
|
|
1499
1507
|
try {
|
|
1500
|
-
if (e = await
|
|
1508
|
+
if (e = await St(a, t, s), e.result) {
|
|
1501
1509
|
for (let n of e.array) {
|
|
1502
1510
|
let o = null, d = r.ws.findIndex((k) => k.id === n.id);
|
|
1503
1511
|
if (d === -1) {
|
|
1504
|
-
let k = r.ws.findIndex((
|
|
1512
|
+
let k = r.ws.findIndex((T) => T.id === "1");
|
|
1505
1513
|
k !== -1 ? o = r.ws.at(k) : (o = new ee(), r.ws.push(o));
|
|
1506
1514
|
} else
|
|
1507
1515
|
o = r.ws.at(d);
|
|
1508
1516
|
let i = "";
|
|
1509
1517
|
for (let k of o.associatedUsers) {
|
|
1510
|
-
let
|
|
1511
|
-
|
|
1518
|
+
let T = r.us.find((v) => v.oid === k);
|
|
1519
|
+
T != null && T.sel && (i = T.oid);
|
|
1512
1520
|
}
|
|
1513
|
-
let
|
|
1521
|
+
let l = "";
|
|
1514
1522
|
for (let k of o.associatedTenants) {
|
|
1515
|
-
let
|
|
1516
|
-
|
|
1523
|
+
let T = r.ts.find((v) => v.tid === k);
|
|
1524
|
+
T != null && T.sel && (l = T.tid);
|
|
1517
1525
|
}
|
|
1518
1526
|
let u = "";
|
|
1519
1527
|
for (let k of o.associatedConfigs) {
|
|
1520
|
-
let
|
|
1521
|
-
|
|
1528
|
+
let T = r.cs.find((v) => v.id === k);
|
|
1529
|
+
T != null && T.sel && (u = T.id);
|
|
1522
1530
|
}
|
|
1523
1531
|
o.associatedUsers.length = 0, o.associatedTenants.length = 0, o.associatedConfigs.length = 0, o.id = n.id, o.name = n.name, o.ownerid = n.workspaceOwnerUserId;
|
|
1524
|
-
let f =
|
|
1525
|
-
if (!
|
|
1532
|
+
let f = et(a, t, o.id, s), $ = yt(a, t, o.id, s), A = pt(a, t, o.id, s), [E, D, h] = await Promise.all([f, $, A]);
|
|
1533
|
+
if (!E.result) return E;
|
|
1526
1534
|
if (!D.result) return D;
|
|
1527
1535
|
if (!h.result) return h;
|
|
1528
|
-
|
|
1536
|
+
Ve(o, r, D.array, l), Je(o, r, E.array, i), Se(o, r, h.array, u), r.tagWithWorkspaces();
|
|
1529
1537
|
}
|
|
1530
1538
|
return e;
|
|
1531
1539
|
}
|
|
@@ -1534,7 +1542,7 @@ async function Qe(a, t, r, s) {
|
|
|
1534
1542
|
}
|
|
1535
1543
|
return e.result = !1, e.status = 500, e;
|
|
1536
1544
|
}
|
|
1537
|
-
async function
|
|
1545
|
+
async function ns(a, t) {
|
|
1538
1546
|
let r = "", s = F();
|
|
1539
1547
|
try {
|
|
1540
1548
|
let e = a.getAllAccounts(), n = t.oid + "." + t.tid, o = null;
|
|
@@ -1582,11 +1590,11 @@ async function ae(a, t) {
|
|
|
1582
1590
|
}
|
|
1583
1591
|
return r.append("Authorization", `Bearer ${t.azureAccessToken}`), r;
|
|
1584
1592
|
}
|
|
1585
|
-
async function
|
|
1593
|
+
async function as(a, t) {
|
|
1586
1594
|
if (t == null || t.spacode == "")
|
|
1587
1595
|
return !1;
|
|
1588
1596
|
try {
|
|
1589
|
-
let s = { method: "GET", headers: await ae(a, t) }, e =
|
|
1597
|
+
let s = { method: "GET", headers: await ae(a, t) }, e = _.azureListRootAssignments;
|
|
1590
1598
|
e += "'", e += t.oid, e += "'";
|
|
1591
1599
|
let n = await fetch(e, s);
|
|
1592
1600
|
if (n.status == 200) {
|
|
@@ -1595,32 +1603,32 @@ async function es(a, t) {
|
|
|
1595
1603
|
debugger;
|
|
1596
1604
|
console.log("Successful call to Azure Resource Graph list root assignments");
|
|
1597
1605
|
} else
|
|
1598
|
-
return console.log(await
|
|
1606
|
+
return console.log(await w(n)), !1;
|
|
1599
1607
|
} catch (r) {
|
|
1600
1608
|
return console.log(r), !1;
|
|
1601
1609
|
}
|
|
1602
1610
|
return !0;
|
|
1603
1611
|
}
|
|
1604
|
-
async function
|
|
1612
|
+
async function os(a, t) {
|
|
1605
1613
|
if (t == null || t.spacode == "")
|
|
1606
1614
|
return !1;
|
|
1607
1615
|
try {
|
|
1608
|
-
let s = { method: "POST", headers: await ae(a, t) }, e =
|
|
1616
|
+
let s = { method: "POST", headers: await ae(a, t) }, e = _.azureElevateAccess, n = await fetch(e, s);
|
|
1609
1617
|
if (n.status == 200)
|
|
1610
1618
|
console.log("Successful call to Azure Resource Graph list root assignments");
|
|
1611
1619
|
else
|
|
1612
|
-
return console.log(await
|
|
1620
|
+
return console.log(await w(n)), !1;
|
|
1613
1621
|
} catch (r) {
|
|
1614
1622
|
return console.log(r), !1;
|
|
1615
1623
|
}
|
|
1616
1624
|
return !0;
|
|
1617
1625
|
}
|
|
1618
|
-
async function
|
|
1626
|
+
async function Qe(a, t) {
|
|
1619
1627
|
let r = new Array();
|
|
1620
1628
|
if (t == null || t.spacode == "")
|
|
1621
1629
|
return r;
|
|
1622
1630
|
try {
|
|
1623
|
-
let e = { method: "GET", headers: await ae(a, t) }, n =
|
|
1631
|
+
let e = { method: "GET", headers: await ae(a, t) }, n = _.azureListRootAssignments;
|
|
1624
1632
|
n += "'", n += t.oid, n += "'";
|
|
1625
1633
|
let o = await fetch(n, e);
|
|
1626
1634
|
if (o.status == 200) {
|
|
@@ -1629,20 +1637,20 @@ async function Xe(a, t) {
|
|
|
1629
1637
|
debugger;
|
|
1630
1638
|
console.log("Successful call to Azure Resource Graph list root assignments");
|
|
1631
1639
|
} else
|
|
1632
|
-
return console.log(await
|
|
1640
|
+
return console.log(await w(o)), r;
|
|
1633
1641
|
} catch (s) {
|
|
1634
1642
|
return console.log(s), r;
|
|
1635
1643
|
}
|
|
1636
1644
|
return r;
|
|
1637
1645
|
}
|
|
1638
|
-
function
|
|
1646
|
+
function Xe(a) {
|
|
1639
1647
|
let t = "8d95d21c-c378-4bb0-9f52-88c30d271e7a", r = a.authority.toLowerCase();
|
|
1640
1648
|
return r.startsWith("https://login.microsoftonline.com/") ? t = "8d95d21c-c378-4bb0-9f52-88c30d271e7a" : r.startsWith("https://login.microsoftonline.us/") ? t = "48da942e-ea3d-49e4-a054-81649012f8f2" : r.startsWith("https://login.partner.microsoftonline.cn/") && (t = "c91d32e4-dcc5-4d77-826a-16e93ffce666"), `api://${t}/Config.Write`;
|
|
1641
1649
|
}
|
|
1642
|
-
async function
|
|
1650
|
+
async function S(a, t) {
|
|
1643
1651
|
const r = new Headers();
|
|
1644
1652
|
r.append("Content-Type", "application/json"), r.append("accept", "*/*");
|
|
1645
|
-
const s =
|
|
1653
|
+
const s = Xe(t);
|
|
1646
1654
|
try {
|
|
1647
1655
|
let e = a.getAllAccounts(), n = t.oid + "." + t.tid, o = null;
|
|
1648
1656
|
for (let i = 0; i < e.length; i++)
|
|
@@ -1668,7 +1676,7 @@ async function A(a, t) {
|
|
|
1668
1676
|
}
|
|
1669
1677
|
return r.append("Authorization", `Bearer ${t.mindlineAccessToken}`), r;
|
|
1670
1678
|
}
|
|
1671
|
-
async function
|
|
1679
|
+
async function w(a) {
|
|
1672
1680
|
let t = "";
|
|
1673
1681
|
if (a.status === 401 && (t = a.statusText, t != ""))
|
|
1674
1682
|
return t;
|
|
@@ -1686,49 +1694,49 @@ async function S(a) {
|
|
|
1686
1694
|
debugger;
|
|
1687
1695
|
return t;
|
|
1688
1696
|
}
|
|
1689
|
-
async function
|
|
1697
|
+
async function Ye(a, t, r, s) {
|
|
1690
1698
|
let e = new m();
|
|
1691
1699
|
if (r.oid == "" && r.mail == "" || s == "")
|
|
1692
1700
|
return e.result = !1, e.error = "adminDelete: invalid parameters", e.status = 500, e;
|
|
1693
1701
|
let n = null;
|
|
1694
|
-
n = new URL(
|
|
1695
|
-
let d = { method: "DELETE", headers: await
|
|
1702
|
+
n = new URL(y.adminEndpoint()), n.searchParams.append("workspaceId", s), n.searchParams.append("email", r.mail);
|
|
1703
|
+
let d = { method: "DELETE", headers: await S(a, t) };
|
|
1696
1704
|
try {
|
|
1697
1705
|
console.log("Attempting DELETE from /admin: " + n.href);
|
|
1698
1706
|
let i = await fetch(n.href, d);
|
|
1699
|
-
return i.status === 200 && i.statusText === "OK" ? (console.log(`Successful DELETE from /admin: ${n.href}`), e) : (e.error = await
|
|
1707
|
+
return i.status === 200 && i.statusText === "OK" ? (console.log(`Successful DELETE from /admin: ${n.href}`), e) : (e.error = await w(i), console.log(`Failed DELETE from /admin: ${n.href}`), console.log(e.error), e.status = 500, e.result = !1, e);
|
|
1700
1708
|
} catch (i) {
|
|
1701
1709
|
e.error = i.message, e.status = 500, e.result = !1, console.log(i.message);
|
|
1702
1710
|
}
|
|
1703
1711
|
return e;
|
|
1704
1712
|
}
|
|
1705
|
-
async function
|
|
1713
|
+
async function et(a, t, r, s) {
|
|
1706
1714
|
let e = new m();
|
|
1707
1715
|
if (r === "")
|
|
1708
1716
|
return e.result = !1, e.status = 500, e.error = "adminsGet: no workspace provided", e;
|
|
1709
|
-
let n =
|
|
1717
|
+
let n = y.adminsEndpoint(), o = new URL(n);
|
|
1710
1718
|
o.searchParams.append("workspaceId", r);
|
|
1711
|
-
let i = { method: "GET", headers: await
|
|
1719
|
+
let i = { method: "GET", headers: await S(a, t) };
|
|
1712
1720
|
try {
|
|
1713
1721
|
if (s) debugger;
|
|
1714
1722
|
console.log("Attempting GET from /admins: " + o.href);
|
|
1715
|
-
let
|
|
1716
|
-
if (
|
|
1717
|
-
let u = await
|
|
1718
|
-
return u != null ? (e.array = u, console.log(`Successful GET from /admins: ${e.array.reduce((
|
|
1723
|
+
let l = await fetch(o.href, i);
|
|
1724
|
+
if (l.status === 200 && l.statusText === "OK") {
|
|
1725
|
+
let u = await l.json();
|
|
1726
|
+
return u != null ? (e.array = u, console.log(`Successful GET from /admins: ${e.array.reduce(($, A) => $ + A.email + " ", "")}`), e) : (e.error = "Failed GET from /admins: failed to JSON-parse response", console.log(e.error), e.status = 500, e.result = !1, e);
|
|
1719
1727
|
} else
|
|
1720
|
-
return console.log(`Failed GET from /admins: ${o.href}`), e.error = await
|
|
1721
|
-
} catch (
|
|
1722
|
-
e.error =
|
|
1728
|
+
return console.log(`Failed GET from /admins: ${o.href}`), e.error = await w(l), e.status = 500, e.result = !1, console.log(e.error), e;
|
|
1729
|
+
} catch (l) {
|
|
1730
|
+
e.error = l.message, e.status = 500, e.result = !1, console.log(l.message);
|
|
1723
1731
|
}
|
|
1724
1732
|
return e;
|
|
1725
1733
|
}
|
|
1726
|
-
async function
|
|
1734
|
+
async function tt(a, t, r, s) {
|
|
1727
1735
|
let e = new m();
|
|
1728
1736
|
if (r.mail == "" || r.authority == "" || r.tid === "")
|
|
1729
1737
|
return e.result = !1, e.error = "adminPost: invalid argument", e.status = 500, e;
|
|
1730
|
-
let n =
|
|
1731
|
-
const o = await
|
|
1738
|
+
let n = y.adminEndpoint();
|
|
1739
|
+
const o = await S(a, t);
|
|
1732
1740
|
let d = `
|
|
1733
1741
|
{"email": "${r.mail}",
|
|
1734
1742
|
"tenantId": "${r.tid}",
|
|
@@ -1736,20 +1744,20 @@ async function st(a, t, r, s) {
|
|
|
1736
1744
|
}`, i = { method: "POST", headers: o, body: d };
|
|
1737
1745
|
try {
|
|
1738
1746
|
console.log("Attempting POST to /admin: " + n);
|
|
1739
|
-
let
|
|
1740
|
-
return
|
|
1741
|
-
} catch (
|
|
1742
|
-
e.error =
|
|
1747
|
+
let l = await fetch(n, i);
|
|
1748
|
+
return l.status === 200 && l.statusText === "OK" ? (console.log(`Successful POST to /admin: ${d}`), e) : (e.error = await w(l), console.log(`Failed POST to /admin: ${d}`), console.log(e.error), e.status = 500, e.result = !1, e);
|
|
1749
|
+
} catch (l) {
|
|
1750
|
+
e.error = l.message, e.status = 500, e.result = !1, console.log(l.message);
|
|
1743
1751
|
}
|
|
1744
1752
|
return e;
|
|
1745
1753
|
}
|
|
1746
|
-
async function
|
|
1754
|
+
async function st(a, t, r, s) {
|
|
1747
1755
|
a = a, t = t, s = s;
|
|
1748
1756
|
let e = new m();
|
|
1749
1757
|
if (r.id === "")
|
|
1750
1758
|
return e.result = !1, e.error = "auditConfigPost: invalid config ID", e.status = 500, e;
|
|
1751
|
-
let n =
|
|
1752
|
-
const o = await
|
|
1759
|
+
let n = y.auditConfigEndpoint();
|
|
1760
|
+
const o = await S(a, t);
|
|
1753
1761
|
let d = `
|
|
1754
1762
|
{
|
|
1755
1763
|
"workspaceId": "${r.workspaceId}",
|
|
@@ -1762,121 +1770,184 @@ async function rt(a, t, r, s) {
|
|
|
1762
1770
|
try {
|
|
1763
1771
|
if (s) debugger;
|
|
1764
1772
|
console.log("Attempting POST to /audit-configuration: " + n);
|
|
1765
|
-
let
|
|
1766
|
-
if (
|
|
1767
|
-
let u = await
|
|
1773
|
+
let l = await fetch(n, i);
|
|
1774
|
+
if (l.status === 200 && l.statusText === "OK") {
|
|
1775
|
+
let u = await l.json();
|
|
1768
1776
|
return r.id = u, console.log(
|
|
1769
1777
|
`Successful AuditConfigID: ${u} from POST to /audit-configuration: ${d}`
|
|
1770
1778
|
), e;
|
|
1771
1779
|
} else
|
|
1772
|
-
return e.error = await
|
|
1773
|
-
} catch (
|
|
1774
|
-
return e.status = 500, e.result = !1, e.error =
|
|
1780
|
+
return e.error = await w(l), console.log(`Failed POST to /audit-configuration: ${d}`), console.log(e.error), e.status = 500, e.result = !1, e;
|
|
1781
|
+
} catch (l) {
|
|
1782
|
+
return e.status = 500, e.result = !1, e.error = l.message, console.log(e.error), e;
|
|
1783
|
+
}
|
|
1784
|
+
return e;
|
|
1785
|
+
}
|
|
1786
|
+
async function rt(a, t, r, s) {
|
|
1787
|
+
a = a, t = t, s = s;
|
|
1788
|
+
let e = new m();
|
|
1789
|
+
if (t.mail == null || t.mail == "")
|
|
1790
|
+
return e.result = !1, e.status = 500, e.error = "auditConfigGet: no user provided", e;
|
|
1791
|
+
if (!r || r.trim() === "")
|
|
1792
|
+
return e.result = !1, e.error = "auditConfigGet: configurationId is required", e.status = 500, e;
|
|
1793
|
+
let n = y.auditConfigEndpoint(), o = new URL(`${n}/${r}`), i = { method: "GET", headers: await S(a, t) };
|
|
1794
|
+
try {
|
|
1795
|
+
if (s) debugger;
|
|
1796
|
+
console.log("Attempting GET to /audit-configuration: " + o.href);
|
|
1797
|
+
const l = await fetch(o.href, i);
|
|
1798
|
+
if (l.status === 200 && l.statusText === "OK") {
|
|
1799
|
+
let u = await l.json();
|
|
1800
|
+
e.result = !0, e.status = l.status, console.log("Successful GET from /audit-configuration:", u);
|
|
1801
|
+
} else
|
|
1802
|
+
e.error = await w(l), console.log("Failed GET from /audit-configuration: " + o.href), console.log(e.error), e.status = l.status, e.result = !1;
|
|
1803
|
+
} catch (l) {
|
|
1804
|
+
e.status = 500, e.result = !1, e.error = l.message, console.log("Error during auditConfigGet:", l.message);
|
|
1775
1805
|
}
|
|
1776
1806
|
return e;
|
|
1777
1807
|
}
|
|
1778
|
-
async function nt(a, t, r) {
|
|
1779
|
-
|
|
1808
|
+
async function nt(a, t, r, s, e) {
|
|
1809
|
+
let n = new m();
|
|
1810
|
+
if (!r || r.trim() === "")
|
|
1811
|
+
return n.result = !1, n.error = "auditConfigPut: invalid configuration ID", n.status = 500, n;
|
|
1812
|
+
let o = y.auditConfigEndpoint(), d = new URL(o);
|
|
1813
|
+
d.searchParams.append("configurationId", r);
|
|
1814
|
+
const i = await S(a, t);
|
|
1815
|
+
let l = `
|
|
1816
|
+
{
|
|
1817
|
+
"name": "${s.name}",
|
|
1818
|
+
"description": "${s.description}",
|
|
1819
|
+
"isEnabled": ${s.isEnabled},
|
|
1820
|
+
"isReadPermissionConsented": ${s.isReadPermissionConsented},
|
|
1821
|
+
"email": "${s.email}"
|
|
1822
|
+
}`, u = { method: "PUT", headers: i, body: l };
|
|
1823
|
+
try {
|
|
1824
|
+
if (e) debugger;
|
|
1825
|
+
console.log("Attempting PUT to /audit-configuration: " + d.href);
|
|
1826
|
+
const f = await fetch(d.href, u);
|
|
1827
|
+
f.status === 200 && f.statusText === "OK" ? (n.result = !0, console.log(`Successful PUT to ${d.href}: ${l}`)) : (n.error = await w(f), console.error(`Failed PUT to ${d.href}: ${l}`), n.status = f.status, n.result = !1);
|
|
1828
|
+
} catch (f) {
|
|
1829
|
+
n.error = f.message, n.status = 500, n.result = !1, console.error("Error during auditConfigPut:", f.message);
|
|
1830
|
+
}
|
|
1831
|
+
return n;
|
|
1780
1832
|
}
|
|
1781
|
-
async function at(a, t, r) {
|
|
1833
|
+
async function at(a, t, r, s) {
|
|
1834
|
+
let e = new m();
|
|
1835
|
+
if (!t.mail)
|
|
1836
|
+
return e.result = !1, e.status = 500, e.error = "auditConfigDelete: no user provided", e;
|
|
1837
|
+
if (!r || r.trim() === "")
|
|
1838
|
+
return e.result = !1, e.status = 500, e.error = "auditConfigDelete: configurationId is required", e;
|
|
1839
|
+
let n = y.auditConfigEndpoint(), o = new URL(n);
|
|
1840
|
+
o.searchParams.append("configurationId", r);
|
|
1841
|
+
const i = { method: "DELETE", headers: await S(a, t) };
|
|
1842
|
+
try {
|
|
1843
|
+
if (s) debugger;
|
|
1844
|
+
console.log(`Attempting DELETE to /audit-configuration: ${o.href}`);
|
|
1845
|
+
const l = await fetch(o.href, i);
|
|
1846
|
+
l.ok ? (e.result = !0, console.log(`Successful DELETE for configurationId ${r}`)) : (e.error = await w(l), e.status = l.status, e.result = !1, console.error(`Failed DELETE for configurationId ${r}`));
|
|
1847
|
+
} catch (l) {
|
|
1848
|
+
e.status = 500, e.result = !1, e.error = l.message, console.error("Error during auditConfigDelete:", l.message);
|
|
1849
|
+
}
|
|
1850
|
+
return e;
|
|
1851
|
+
}
|
|
1852
|
+
async function ot(a, t, r) {
|
|
1782
1853
|
let s = new m();
|
|
1783
1854
|
if (t.mail == null || t.mail == "")
|
|
1784
1855
|
return s.result = !1, s.status = 500, s.error = "auditEventsGet: no user provided", s;
|
|
1785
|
-
let e =
|
|
1856
|
+
let e = y.auditEventsEndpoint(), n = new URL(e), d = { method: "GET", headers: await S(a, t) };
|
|
1786
1857
|
try {
|
|
1787
1858
|
if (r) debugger;
|
|
1788
1859
|
console.log("Attempting GET from /audit-events endpoint: " + n.href);
|
|
1789
1860
|
let i = await fetch(n.href, d);
|
|
1790
1861
|
if (i.status === 200 && i.statusText === "OK") {
|
|
1791
|
-
let
|
|
1792
|
-
if (Array.isArray(
|
|
1793
|
-
let u =
|
|
1862
|
+
let l = await i.json();
|
|
1863
|
+
if (Array.isArray(l.data)) {
|
|
1864
|
+
let u = l.data;
|
|
1794
1865
|
if (u != null)
|
|
1795
|
-
return s.array = u, console.log(`Successful GET from /audit-events: ${s.array.reduce((
|
|
1866
|
+
return s.array = u, console.log(`Successful GET from /audit-events: ${s.array.reduce(($, A) => $ + A.initiatedByUser + " ", "")}`), s;
|
|
1796
1867
|
}
|
|
1797
1868
|
return s.error = "Failed GET from /audit-events: failed to JSON-parse response", console.log(s.error), s.status = 500, s.result = !1, s;
|
|
1798
1869
|
} else
|
|
1799
|
-
return console.log(`Failed GET from /audit-events: ${n.href}`), s.error = await
|
|
1870
|
+
return console.log(`Failed GET from /audit-events: ${n.href}`), s.error = await w(i), s.status = 500, s.result = !1, console.log(s.error), s;
|
|
1800
1871
|
} catch (i) {
|
|
1801
1872
|
s.error = i.message, s.status = 500, s.result = !1, console.log(i.message);
|
|
1802
1873
|
}
|
|
1803
1874
|
return s;
|
|
1804
1875
|
}
|
|
1805
|
-
async function
|
|
1806
|
-
let n = new m(), o =
|
|
1876
|
+
async function it(a, t, r, s, e) {
|
|
1877
|
+
let n = new m(), o = y.configConsentEndpoint(), d = new URL(o);
|
|
1807
1878
|
d.searchParams.append("configurationId", r);
|
|
1808
|
-
const i = await
|
|
1809
|
-
let
|
|
1879
|
+
const i = await S(a, t);
|
|
1880
|
+
let l = `
|
|
1810
1881
|
{
|
|
1811
1882
|
"tenantId": "${s}",
|
|
1812
1883
|
"isReadPermissionConsented": ${e ? "true" : "false"}
|
|
1813
|
-
}`, u = { method: "PUT", headers: i, body:
|
|
1884
|
+
}`, u = { method: "PUT", headers: i, body: l };
|
|
1814
1885
|
try {
|
|
1815
1886
|
console.log("Attempting PUT read consent to /configuration/consent: " + d.href);
|
|
1816
1887
|
let f = await fetch(d.href, u);
|
|
1817
|
-
return f.status === 200 && f.statusText === "OK" ? (console.log(`Successful PUT to ${d.href}`), n) : (n.error = await
|
|
1888
|
+
return f.status === 200 && f.statusText === "OK" ? (console.log(`Successful PUT to ${d.href}`), n) : (n.error = await w(f), console.log(`Failed PUT to ${d.href}`), console.log(n.error), n.status = 500, n.result = !1, n);
|
|
1818
1889
|
} catch (f) {
|
|
1819
1890
|
n.error = f.message, n.status = 500, n.result = !1, console.log(f.message);
|
|
1820
1891
|
}
|
|
1821
1892
|
return n;
|
|
1822
1893
|
}
|
|
1823
|
-
async function
|
|
1824
|
-
let n = new m(), o =
|
|
1894
|
+
async function lt(a, t, r, s, e) {
|
|
1895
|
+
let n = new m(), o = y.configConsentEndpoint(), d = new URL(o);
|
|
1825
1896
|
d.searchParams.append("configurationId", r);
|
|
1826
|
-
const i = await
|
|
1827
|
-
let
|
|
1897
|
+
const i = await S(a, t);
|
|
1898
|
+
let l = `
|
|
1828
1899
|
{
|
|
1829
1900
|
"tenantId": "${s}",
|
|
1830
1901
|
"isWritePermissionConsented": ${e ? "true" : "false"}
|
|
1831
|
-
}`, u = { method: "PUT", headers: i, body:
|
|
1902
|
+
}`, u = { method: "PUT", headers: i, body: l };
|
|
1832
1903
|
try {
|
|
1833
1904
|
console.log("Attempting PUT read consent to /configuration/consent: " + d.href);
|
|
1834
1905
|
let f = await fetch(d.href, u);
|
|
1835
|
-
return f.status === 200 && f.statusText === "OK" ? (console.log(`Successful PUT to ${d.href}`), n) : (n.error = await
|
|
1906
|
+
return f.status === 200 && f.statusText === "OK" ? (console.log(`Successful PUT to ${d.href}`), n) : (n.error = await w(f), console.log(`Failed PUT to ${d.href}`), console.log(n.error), n.status = 500, n.result = !1, n);
|
|
1836
1907
|
} catch (f) {
|
|
1837
1908
|
n.error = f.message, n.status = 500, n.result = !1, console.log(f.message);
|
|
1838
1909
|
}
|
|
1839
1910
|
return n;
|
|
1840
1911
|
}
|
|
1841
|
-
async function
|
|
1912
|
+
async function ct(a, t, r, s, e) {
|
|
1842
1913
|
let n = new m();
|
|
1843
1914
|
if (r.id === "" || s == "")
|
|
1844
1915
|
return n.result = !1, n.error = "configPost: invalid config ID", n.status = 500, n;
|
|
1845
1916
|
let o = null;
|
|
1846
|
-
o = new URL(
|
|
1847
|
-
let i = { method: "DELETE", headers: await
|
|
1917
|
+
o = new URL(y.configEndpoint()), o.searchParams.append("configurationId", r.id);
|
|
1918
|
+
let i = { method: "DELETE", headers: await S(a, t) };
|
|
1848
1919
|
try {
|
|
1849
1920
|
console.log("Attempting DELETE from /config: " + o.href);
|
|
1850
|
-
let
|
|
1851
|
-
return
|
|
1852
|
-
} catch (
|
|
1853
|
-
n.error =
|
|
1921
|
+
let l = await fetch(o.href, i);
|
|
1922
|
+
return l.status === 200 && l.statusText === "OK" ? (console.log("Successful DELETE from /config"), n) : (n.error = await w(l), console.log(`Failed DELETE from ${o.href}`), console.log(n.error), n.status = 500, n.result = !1, n);
|
|
1923
|
+
} catch (l) {
|
|
1924
|
+
n.error = l.message, n.status = 500, n.result = !1, console.log(l.message);
|
|
1854
1925
|
}
|
|
1855
1926
|
return n;
|
|
1856
1927
|
}
|
|
1857
|
-
async function
|
|
1928
|
+
async function dt(a, t, r, s, e) {
|
|
1858
1929
|
let n = new m();
|
|
1859
1930
|
if (r === "")
|
|
1860
1931
|
return n.result = !1, n.error = "configPatch: invalid config ID", n.status = 500, n;
|
|
1861
|
-
let o =
|
|
1932
|
+
let o = y.configEnabledEndpoint(), d = new URL(o);
|
|
1862
1933
|
d.searchParams.append("configurationId", r), d.searchParams.append("isEnabled", s.toString());
|
|
1863
|
-
let
|
|
1934
|
+
let l = { method: "PATCH", headers: await S(a, t) };
|
|
1864
1935
|
try {
|
|
1865
1936
|
if (e) debugger;
|
|
1866
1937
|
console.log("Attempting PATCH to /config: " + d.href);
|
|
1867
|
-
let u = await fetch(d.href,
|
|
1868
|
-
return u.status === 200 && u.statusText === "OK" ? (console.log(`Successful PATCH to ${d.href}: ${s.toString()}`), n) : (n.error = await
|
|
1938
|
+
let u = await fetch(d.href, l);
|
|
1939
|
+
return u.status === 200 && u.statusText === "OK" ? (console.log(`Successful PATCH to ${d.href}: ${s.toString()}`), n) : (n.error = await w(u), console.log(`Failed PATCH to ${d.href}: ${s.toString()}`), console.log(n.error), n.status = 500, n.result = !1, n);
|
|
1869
1940
|
} catch (u) {
|
|
1870
1941
|
n.error = u.message, n.status = 500, n.result = !1, console.log(u.message);
|
|
1871
1942
|
}
|
|
1872
1943
|
return n;
|
|
1873
1944
|
}
|
|
1874
|
-
async function
|
|
1945
|
+
async function ut(a, t, r, s, e) {
|
|
1875
1946
|
let n = new m();
|
|
1876
1947
|
if (r.id === "")
|
|
1877
1948
|
return n.result = !1, n.error = "configPost: invalid config ID", n.status = 500, n;
|
|
1878
|
-
let o =
|
|
1879
|
-
const d = await
|
|
1949
|
+
let o = y.configEndpoint();
|
|
1950
|
+
const d = await S(a, t);
|
|
1880
1951
|
let i = `
|
|
1881
1952
|
{
|
|
1882
1953
|
"workspaceId": "${s}",
|
|
@@ -1885,39 +1956,39 @@ async function dt(a, t, r, s, e) {
|
|
|
1885
1956
|
"isEnabled": ${r.isEnabled},
|
|
1886
1957
|
"tenants": [`;
|
|
1887
1958
|
r.tenants.map((u) => {
|
|
1888
|
-
let f = u.sourceGroupId != "" ? `"${u.sourceGroupId}"` : "null",
|
|
1959
|
+
let f = u.sourceGroupId != "" ? `"${u.sourceGroupId}"` : "null", $ = u.sourceGroupName != "" ? `"${u.sourceGroupName}"` : "null", A = u.targetGroupId != "" ? `"${u.targetGroupId}"` : "null", E = u.targetGroupName != "" ? `"${u.targetGroupName}"` : "null";
|
|
1889
1960
|
i.slice(-1) === "}" && (i += ","), i += `{
|
|
1890
1961
|
"tenantId": "${u.tid}",
|
|
1891
1962
|
"sourceGroupId": ${f},
|
|
1892
|
-
"sourceGroupName": ${
|
|
1893
|
-
"targetGroupId": ${
|
|
1894
|
-
"targetGroupName": ${
|
|
1963
|
+
"sourceGroupName": ${$},
|
|
1964
|
+
"targetGroupId": ${A},
|
|
1965
|
+
"targetGroupName": ${E},
|
|
1895
1966
|
"configurationTenantType": "${u.configurationTenantType}"
|
|
1896
1967
|
}`;
|
|
1897
1968
|
}), i += "]}";
|
|
1898
|
-
let
|
|
1969
|
+
let l = { method: "POST", headers: d, body: i };
|
|
1899
1970
|
try {
|
|
1900
1971
|
if (e) debugger;
|
|
1901
1972
|
console.log("Attempting POST to /config: " + o);
|
|
1902
|
-
let u = await fetch(o,
|
|
1973
|
+
let u = await fetch(o, l);
|
|
1903
1974
|
if (u.status === 200 && u.statusText === "OK") {
|
|
1904
1975
|
let f = await u.json();
|
|
1905
1976
|
return r.id = f, console.log(
|
|
1906
1977
|
`Successful ConfigID: ${f} from POST to /config: ${i}`
|
|
1907
1978
|
), n;
|
|
1908
1979
|
} else
|
|
1909
|
-
return n.error = await
|
|
1980
|
+
return n.error = await w(u), console.log(`Failed PUT to /config: ${i}`), console.log(n.error), n.status = 500, n.result = !1, n;
|
|
1910
1981
|
} catch (u) {
|
|
1911
1982
|
return n.status = 500, n.result = !1, n.error = u.message, console.log(n.error), n;
|
|
1912
1983
|
}
|
|
1913
1984
|
}
|
|
1914
|
-
async function
|
|
1985
|
+
async function ft(a, t, r, s) {
|
|
1915
1986
|
let e = new m();
|
|
1916
1987
|
if (r.id === "")
|
|
1917
1988
|
return e.result = !1, e.error = "configPost: invalid config ID", e.status = 500, e;
|
|
1918
|
-
let n =
|
|
1989
|
+
let n = y.configEndpoint(), o = new URL(n);
|
|
1919
1990
|
o.searchParams.append("configurationId", r.id);
|
|
1920
|
-
const d = await
|
|
1991
|
+
const d = await S(a, t);
|
|
1921
1992
|
let i = `
|
|
1922
1993
|
{
|
|
1923
1994
|
"name": "${r.name}",
|
|
@@ -1925,55 +1996,86 @@ async function ut(a, t, r, s) {
|
|
|
1925
1996
|
"tenants": [`;
|
|
1926
1997
|
r.tenants.map((u) => {
|
|
1927
1998
|
i.slice(-1) === "}" && (i += ",");
|
|
1928
|
-
let
|
|
1999
|
+
let $ = u.sourceGroupId != "" ? `"${u.sourceGroupId}"` : "null", A = u.sourceGroupName != "" ? `"${u.sourceGroupName}"` : "null", E = u.targetGroupId != "" ? `"${u.targetGroupId}"` : "null", D = u.targetGroupName != "" ? `"${u.targetGroupName}"` : "null";
|
|
1929
2000
|
i += `{
|
|
1930
2001
|
"tenantId": "${u.tid}",
|
|
1931
|
-
"sourceGroupId": ${
|
|
1932
|
-
"sourceGroupName": ${
|
|
1933
|
-
"targetGroupId": ${
|
|
2002
|
+
"sourceGroupId": ${$},
|
|
2003
|
+
"sourceGroupName": ${A},
|
|
2004
|
+
"targetGroupId": ${E},
|
|
1934
2005
|
"targetGroupName": ${D},
|
|
1935
2006
|
"configurationTenantType": "${u.configurationTenantType}",
|
|
1936
2007
|
"deltaToken": "${u.deltaToken}"
|
|
1937
2008
|
}`;
|
|
1938
2009
|
}), i += "]}";
|
|
1939
|
-
let
|
|
2010
|
+
let l = { method: "PUT", headers: d, body: i };
|
|
1940
2011
|
try {
|
|
1941
2012
|
if (s) debugger;
|
|
1942
2013
|
console.log("Attempting PUT to /config: " + o.href);
|
|
1943
|
-
let u = await fetch(o.href,
|
|
1944
|
-
return u.status === 200 && u.statusText === "OK" ? (console.log(`Successful PUT to ${o.href}: ${i}`), e) : (e.error = await
|
|
2014
|
+
let u = await fetch(o.href, l);
|
|
2015
|
+
return u.status === 200 && u.statusText === "OK" ? (console.log(`Successful PUT to ${o.href}: ${i}`), e) : (e.error = await w(u), console.log(`Failed PUT to ${o.href}: ${i}`), console.log(e.error), e.status = 500, e.result = !1, e);
|
|
1945
2016
|
} catch (u) {
|
|
1946
2017
|
e.error = u.message, e.status = 500, e.result = !1, console.log(u.message);
|
|
1947
2018
|
}
|
|
1948
2019
|
return e;
|
|
1949
2020
|
}
|
|
1950
|
-
async function
|
|
2021
|
+
async function pt(a, t, r, s) {
|
|
1951
2022
|
let e = new m();
|
|
1952
2023
|
if (r === "")
|
|
1953
2024
|
return e.result = !1, e.status = 500, e.error = "configsGet: no workspace provided", e;
|
|
1954
|
-
let n =
|
|
2025
|
+
let n = y.configsEndpoint(), o = new URL(n);
|
|
1955
2026
|
o.searchParams.append("workspaceId", r);
|
|
1956
|
-
let i = { method: "GET", headers: await
|
|
2027
|
+
let i = { method: "GET", headers: await S(a, t) };
|
|
1957
2028
|
try {
|
|
1958
2029
|
if (s) debugger;
|
|
1959
2030
|
console.log("Attempting GET from /configurations: " + o.href);
|
|
1960
|
-
let
|
|
1961
|
-
if (
|
|
1962
|
-
let u = await
|
|
1963
|
-
return u != null ? (e.array = u, console.log(`Successful GET from /configurations: ${e.array.reduce((
|
|
2031
|
+
let l = await fetch(o.href, i);
|
|
2032
|
+
if (l.status === 200 && l.statusText === "OK") {
|
|
2033
|
+
let u = await l.json();
|
|
2034
|
+
return u != null ? (e.array = u, console.log(`Successful GET from /configurations: ${e.array.reduce(($, A) => $ + A.name + " ", "")}`), e) : (e.error = "Failed GET from /configurations: failed to JSON-parse response", console.log(e.error), e.status = 500, e.result = !1, e);
|
|
1964
2035
|
} else
|
|
1965
|
-
return console.log(`Failed GET from /configurations: ${o.href}`), e.error = await
|
|
1966
|
-
} catch (
|
|
1967
|
-
e.error =
|
|
2036
|
+
return console.log(`Failed GET from /configurations: ${o.href}`), e.error = await w(l), e.status = 500, e.result = !1, console.log(e.error), e;
|
|
2037
|
+
} catch (l) {
|
|
2038
|
+
e.error = l.message, e.status = 500, e.result = !1, console.log(l.message);
|
|
1968
2039
|
}
|
|
1969
2040
|
return e;
|
|
1970
2041
|
}
|
|
1971
|
-
async function
|
|
2042
|
+
async function ht(a, t, r, s) {
|
|
2043
|
+
let e = new m();
|
|
2044
|
+
if (!r)
|
|
2045
|
+
return e.result = !1, e.status = 500, e.error = "workspaceConfigsGet: no workspace provided", e;
|
|
2046
|
+
let n = y.workspaceConfigsEndpoint(), o = new URL(n);
|
|
2047
|
+
o.searchParams.append("workspaceId", r);
|
|
2048
|
+
let i = { method: "GET", headers: await S(a, t) };
|
|
2049
|
+
try {
|
|
2050
|
+
if (s) debugger;
|
|
2051
|
+
console.log("Attempting GET from /workspaceConfigs: " + o.href);
|
|
2052
|
+
const l = await fetch(o.href, i);
|
|
2053
|
+
if (l.status === 200 && l.statusText === "OK") {
|
|
2054
|
+
const u = await l.json();
|
|
2055
|
+
if (u)
|
|
2056
|
+
return e.array = u.map((f) => ({
|
|
2057
|
+
id: f.id,
|
|
2058
|
+
name: f.name,
|
|
2059
|
+
description: f.description,
|
|
2060
|
+
configurationType: f.configurationType,
|
|
2061
|
+
isEnabled: f.isEnabled
|
|
2062
|
+
})), console.log(
|
|
2063
|
+
`workspaceConfigsGet: found ${e.array.length} configs.`
|
|
2064
|
+
), e;
|
|
2065
|
+
e.error = "workspaceConfigsGet: failed to parse returned configs", e.result = !1, e.status = 500;
|
|
2066
|
+
} else
|
|
2067
|
+
e.error = await w(l), e.result = !1, e.status = l.status, console.log(e.error);
|
|
2068
|
+
} catch (l) {
|
|
2069
|
+
e.error = l.message, e.result = !1, e.status = 500;
|
|
2070
|
+
}
|
|
2071
|
+
return e;
|
|
2072
|
+
}
|
|
2073
|
+
async function gt(a, t, r) {
|
|
1972
2074
|
let s = new m();
|
|
1973
2075
|
if (t.companyName === "" || t.companyDomain === "")
|
|
1974
2076
|
return s.result = !1, s.error = "initPost: invalid company name or domain", s.status = 500, s;
|
|
1975
|
-
let e =
|
|
1976
|
-
const n = await
|
|
2077
|
+
let e = y.initEndpoint();
|
|
2078
|
+
const n = await S(a, t);
|
|
1977
2079
|
let o = `
|
|
1978
2080
|
{
|
|
1979
2081
|
"tenantCreateModel": {
|
|
@@ -1988,123 +2090,123 @@ async function pt(a, t, r) {
|
|
|
1988
2090
|
if (r) debugger;
|
|
1989
2091
|
console.log("Attempting POST to /configuration/init: " + e);
|
|
1990
2092
|
let i = await fetch(e, d);
|
|
1991
|
-
return i.status === 200 && i.statusText === "OK" ? (console.log(`Successful POST to /configuration/init: ${o}`), s) : (s.error = await
|
|
2093
|
+
return i.status === 200 && i.statusText === "OK" ? (console.log(`Successful POST to /configuration/init: ${o}`), s) : (s.error = await w(i), s.status = 500, s.result = !1, console.log(`Failed POST to /configuration/init: ${o}`), console.log(s.error), s);
|
|
1992
2094
|
} catch (i) {
|
|
1993
2095
|
s.error = i.message, console.log(s.error);
|
|
1994
2096
|
}
|
|
1995
2097
|
return s.status = 500, s.result = !1, s;
|
|
1996
2098
|
}
|
|
1997
|
-
async function
|
|
2099
|
+
async function mt(a, t, r, s, e) {
|
|
1998
2100
|
let n = new m();
|
|
1999
2101
|
if (r.tid === "" || s === "")
|
|
2000
2102
|
return n.result = !1, n.error = "tenantDelete: invalid tid, workspaceId", n.status = 500, n;
|
|
2001
|
-
let o = new URL(
|
|
2103
|
+
let o = new URL(y.tenantEndpoint());
|
|
2002
2104
|
o.searchParams.append("tenantId", r.tid), o.searchParams.append("workspaceId", s);
|
|
2003
|
-
let i = { method: "DELETE", headers: await
|
|
2105
|
+
let i = { method: "DELETE", headers: await S(a, t) };
|
|
2004
2106
|
try {
|
|
2005
2107
|
console.log("Attempting DELETE from /tenant: " + o.href);
|
|
2006
|
-
let
|
|
2007
|
-
return
|
|
2008
|
-
} catch (
|
|
2009
|
-
n.error =
|
|
2108
|
+
let l = await fetch(o.href, i);
|
|
2109
|
+
return l.status === 200 && l.statusText === "OK" ? (console.log(`Successful DELETE from /tenant: ${o.href}`), n) : (console.log(`Failed DELETE from /tenant: ${o.href}`), n.error = await w(l), console.log(n.error), n.status = 500, n.result = !1, n);
|
|
2110
|
+
} catch (l) {
|
|
2111
|
+
n.error = l.message, n.status = 500, n.result = !1, console.log(n.error);
|
|
2010
2112
|
}
|
|
2011
2113
|
return n;
|
|
2012
2114
|
}
|
|
2013
|
-
async function
|
|
2115
|
+
async function yt(a, t, r, s) {
|
|
2014
2116
|
let e = new m();
|
|
2015
2117
|
if (r === "")
|
|
2016
2118
|
return e.result = !1, e.status = 500, e.error = "tenantsGet: no workspace provided", e;
|
|
2017
|
-
let n =
|
|
2119
|
+
let n = y.tenantsEndpoint(), o = new URL(n);
|
|
2018
2120
|
o.searchParams.append("workspaceId", r);
|
|
2019
|
-
let i = { method: "GET", headers: await
|
|
2121
|
+
let i = { method: "GET", headers: await S(a, t) };
|
|
2020
2122
|
try {
|
|
2021
2123
|
if (s) debugger;
|
|
2022
2124
|
console.log(`Attempting GET from /tenants: ${o.href}`);
|
|
2023
|
-
let
|
|
2024
|
-
if (
|
|
2025
|
-
let u = await
|
|
2026
|
-
return u != null ? (e.array = u, console.log(`Successful GET from /tenants: ${e.array.reduce((
|
|
2125
|
+
let l = await fetch(o.href, i);
|
|
2126
|
+
if (l.status === 200 && l.statusText === "OK") {
|
|
2127
|
+
let u = await l.json();
|
|
2128
|
+
return u != null ? (e.array = u, console.log(`Successful GET from /tenants: ${e.array.reduce(($, A) => $ + A.domain + " ", "")}`), e) : (e.error = "Failed GET from /tenants: failed to JSON-parse response", console.log(e.error), e.status = 500, e.result = !1, e);
|
|
2027
2129
|
} else
|
|
2028
|
-
return console.log(`Failed GET from /tenants: ${o.href}`), e.error = await
|
|
2029
|
-
} catch (
|
|
2030
|
-
e.error =
|
|
2130
|
+
return console.log(`Failed GET from /tenants: ${o.href}`), e.error = await w(l), e.status = 500, e.result = !1, console.log(e.error), e;
|
|
2131
|
+
} catch (l) {
|
|
2132
|
+
e.error = l.message, e.status = 500, e.result = !1, console.log(l.message);
|
|
2031
2133
|
}
|
|
2032
2134
|
return e;
|
|
2033
2135
|
}
|
|
2034
|
-
async function
|
|
2136
|
+
async function wt(a, t, r, s) {
|
|
2035
2137
|
let e = new m();
|
|
2036
2138
|
if (r.tid === "" || r.name === "" || r.domain === "")
|
|
2037
2139
|
return e.result = !1, e.error = "tenantPost: invalid tid, name, domain", e.status = 500, e;
|
|
2038
|
-
let n =
|
|
2140
|
+
let n = y.tenantEndpoint(), o = new URL(n);
|
|
2039
2141
|
o.searchParams.append("workspaceId", s);
|
|
2040
|
-
const d = await
|
|
2142
|
+
const d = await S(a, t);
|
|
2041
2143
|
let i = `
|
|
2042
2144
|
{"tenantId": "${r.tid}",
|
|
2043
2145
|
"name": "${r.name}",
|
|
2044
2146
|
"domain": "${r.domain}",
|
|
2045
2147
|
"type": 1,
|
|
2046
2148
|
"authority": "${r.authority}"
|
|
2047
|
-
}`,
|
|
2149
|
+
}`, l = { method: "POST", headers: d, body: i };
|
|
2048
2150
|
try {
|
|
2049
2151
|
console.log(`Attempting POST to ${o.href}: ${i}`);
|
|
2050
|
-
let u = await fetch(o.href,
|
|
2051
|
-
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
|
|
2152
|
+
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 w(u), console.log(e.error), e.status = 500, e.result = !1, e);
|
|
2052
2154
|
} catch (u) {
|
|
2053
2155
|
e.error = u.message, e.status = 500, e.result = !1, console.log(e.error);
|
|
2054
2156
|
}
|
|
2055
2157
|
return e;
|
|
2056
2158
|
}
|
|
2057
|
-
async function
|
|
2159
|
+
async function Tt(a, t, r, s) {
|
|
2058
2160
|
let e = new m();
|
|
2059
2161
|
if (r == "" || s == "")
|
|
2060
2162
|
return e.result = !1, e.error = "workspacePut: invalid workspace ID or name", e.status = 500, e;
|
|
2061
|
-
let n =
|
|
2163
|
+
let n = y.workspaceEndpoint(), o = new URL(n);
|
|
2062
2164
|
o.searchParams.append("workspaceId", r), o.searchParams.append("workspaceName", s);
|
|
2063
|
-
let i = { method: "PUT", headers: await
|
|
2165
|
+
let i = { method: "PUT", headers: await S(a, t) };
|
|
2064
2166
|
try {
|
|
2065
2167
|
console.log("Attempting PUT to /workspace: " + o.href);
|
|
2066
|
-
let
|
|
2067
|
-
return
|
|
2068
|
-
} catch (
|
|
2069
|
-
e.error =
|
|
2168
|
+
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 w(l), console.log(`Failed PUT to ${o.href}`), console.log(e.error), e.status = 500, e.result = !1, e);
|
|
2170
|
+
} catch (l) {
|
|
2171
|
+
e.error = l.message, e.status = 500, e.result = !1, console.log(l.message);
|
|
2070
2172
|
}
|
|
2071
2173
|
return e;
|
|
2072
2174
|
}
|
|
2073
|
-
async function
|
|
2175
|
+
async function St(a, t, r) {
|
|
2074
2176
|
let s = new m();
|
|
2075
2177
|
if (t.mail == null || t.mail == "")
|
|
2076
2178
|
return s.result = !1, s.status = 500, s.error = "adminsGet: no workspace provided", s;
|
|
2077
|
-
let e =
|
|
2179
|
+
let e = y.workspacesEndpoint(), n = new URL(e), d = { method: "GET", headers: await S(a, t) };
|
|
2078
2180
|
try {
|
|
2079
2181
|
if (r) debugger;
|
|
2080
2182
|
console.log("Attempting GET from /workspaces endpoint: " + n.href);
|
|
2081
2183
|
let i = await fetch(n.href, d);
|
|
2082
2184
|
if (i.status === 200 && i.statusText === "OK") {
|
|
2083
|
-
let
|
|
2084
|
-
return
|
|
2185
|
+
let l = await i.json();
|
|
2186
|
+
return l != null ? (s.array = l, console.log(`Successful GET from /workspaces: ${s.array.reduce((f, $) => f + $.name + " ", "")}`), s) : (s.error = "Failed GET from /workspaces: failed to JSON-parse response", console.log(s.error), s.status = 500, s.result = !1, s);
|
|
2085
2187
|
} else
|
|
2086
|
-
return console.log(`Failed GET from /workspaces: ${n.href}`), s.error = await
|
|
2188
|
+
return console.log(`Failed GET from /workspaces: ${n.href}`), s.error = await w(i), s.status = 500, s.result = !1, console.log(s.error), s;
|
|
2087
2189
|
} catch (i) {
|
|
2088
2190
|
s.error = i.message, s.status = 500, s.result = !1, console.log(i.message);
|
|
2089
2191
|
}
|
|
2090
2192
|
return s;
|
|
2091
2193
|
}
|
|
2092
|
-
async function
|
|
2194
|
+
async function bt(a, t, r) {
|
|
2093
2195
|
let s = new m();
|
|
2094
2196
|
if (a == null || t == null)
|
|
2095
2197
|
return s.result = !1, s.error = "readerPost: invalid parameters", s.status = 500, s;
|
|
2096
|
-
let e =
|
|
2198
|
+
let e = y.readerStartSyncEndpoint(), n = new URL(e);
|
|
2097
2199
|
n.searchParams.append("configurationId", r.id);
|
|
2098
|
-
let d = { method: "POST", headers: await
|
|
2200
|
+
let d = { method: "POST", headers: await S(a, t) };
|
|
2099
2201
|
try {
|
|
2100
2202
|
console.log("Attempting POST to /startSync: " + n.href);
|
|
2101
2203
|
let i = await fetch(n.href, d);
|
|
2102
2204
|
if (i.status === 200 && i.statusText === "OK") {
|
|
2103
2205
|
console.log(`Successful POST to /startSync: ${e}`);
|
|
2104
|
-
let
|
|
2105
|
-
return
|
|
2206
|
+
let l = await i.json();
|
|
2207
|
+
return l.PayloadStr != "" ? s.array = JSON.parse(l.PayloadStr) : (s.result = !1, s.error = "readerPost: blank payload returned, sync may be disabled on back end", s.status = 500), s;
|
|
2106
2208
|
} else
|
|
2107
|
-
return s.error = await
|
|
2209
|
+
return s.error = await w(i), console.log(`Failed POST to /startSync: ${e}`), console.log(s.error), s.status = 500, s.result = !1, s;
|
|
2108
2210
|
} catch (i) {
|
|
2109
2211
|
s.error = i.message, s.status = 500, s.result = !1, console.log(i.message);
|
|
2110
2212
|
}
|
|
@@ -2112,86 +2214,91 @@ async function wt(a, t, r) {
|
|
|
2112
2214
|
}
|
|
2113
2215
|
export {
|
|
2114
2216
|
m as APIResult,
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2217
|
+
Ct as ActorArray,
|
|
2218
|
+
Le as ActorNode,
|
|
2219
|
+
vt as AuditConfig,
|
|
2220
|
+
Gt as BatchArray,
|
|
2221
|
+
Dt as Group,
|
|
2222
|
+
Pt as InitInfo,
|
|
2223
|
+
U as Milestone,
|
|
2122
2224
|
Ue as MilestoneArray,
|
|
2123
2225
|
we as ResourceArray,
|
|
2124
|
-
|
|
2226
|
+
_e as ResourceNode,
|
|
2125
2227
|
Y as SyncConfig,
|
|
2126
2228
|
Q as Task,
|
|
2127
|
-
|
|
2229
|
+
Rt as TaskArray,
|
|
2128
2230
|
L as Tenant,
|
|
2129
|
-
|
|
2130
|
-
|
|
2231
|
+
Fe as TenantConfigInfo,
|
|
2232
|
+
We as TenantConfigType,
|
|
2131
2233
|
me as TenantNode,
|
|
2132
|
-
|
|
2234
|
+
xe as TenantPermissionType,
|
|
2133
2235
|
Ce as TenantType,
|
|
2134
2236
|
X as User,
|
|
2135
|
-
|
|
2237
|
+
Et as UserScope,
|
|
2136
2238
|
ee as Workspace,
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2239
|
+
Ye as adminDelete,
|
|
2240
|
+
tt as adminPost,
|
|
2241
|
+
et as adminsGet,
|
|
2242
|
+
Lt as auditConfigAdd,
|
|
2243
|
+
at as auditConfigDelete,
|
|
2244
|
+
Mt as auditConfigEdit,
|
|
2245
|
+
rt as auditConfigGet,
|
|
2246
|
+
st as auditConfigPost,
|
|
2247
|
+
nt as auditConfigPut,
|
|
2248
|
+
jt as auditConfigRemove,
|
|
2249
|
+
zt as auditConfigRetrieve,
|
|
2250
|
+
ot as auditEventsGet,
|
|
2251
|
+
Ht as auditEventsRetrieve,
|
|
2252
|
+
_ as azureConfig,
|
|
2253
|
+
as as canListRootAssignments,
|
|
2254
|
+
Jt as configConsentForRead,
|
|
2255
|
+
Vt as configConsentForWrite,
|
|
2256
|
+
it as configConsentReadPut,
|
|
2257
|
+
lt as configConsentWritePut,
|
|
2258
|
+
ct as configDelete,
|
|
2259
|
+
qt as configEdit,
|
|
2260
|
+
Kt as configEnable,
|
|
2261
|
+
dt as configPatch,
|
|
2262
|
+
ut as configPost,
|
|
2263
|
+
ft as configPut,
|
|
2264
|
+
Qt as configRemove,
|
|
2265
|
+
pt as configsGet,
|
|
2266
|
+
Zt as configsRefresh,
|
|
2267
|
+
os as elevateGlobalAdminToUserAccessAdmin,
|
|
2268
|
+
ns as getPowerBIAccessToken,
|
|
2163
2269
|
F as getSyncVersion,
|
|
2164
2270
|
p as graphConfig,
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2271
|
+
xt as groupsGet,
|
|
2272
|
+
kt as helloNpm,
|
|
2273
|
+
Xt as initGet,
|
|
2274
|
+
gt as initPost,
|
|
2275
|
+
y as mindlineConfig,
|
|
2276
|
+
Me as oauth2PermissionGrantsGet,
|
|
2277
|
+
je as oauth2PermissionGrantsSet,
|
|
2278
|
+
w as processErrors,
|
|
2279
|
+
bt as readerPost,
|
|
2280
|
+
Nt as requestAdminConsent,
|
|
2281
|
+
He as servicePrincipalGet,
|
|
2282
|
+
Ot as signIn,
|
|
2283
|
+
Wt as signInIncrementally,
|
|
2284
|
+
Ft as signOut,
|
|
2285
|
+
At as sum,
|
|
2286
|
+
Yt as tenantAdd,
|
|
2287
|
+
mt as tenantDelete,
|
|
2288
|
+
wt as tenantPost,
|
|
2289
|
+
Bt as tenantRelationshipsGetByDomain,
|
|
2290
|
+
qe as tenantRelationshipsGetById,
|
|
2291
|
+
es as tenantRemove,
|
|
2186
2292
|
Te as tenantUnauthenticatedLookup,
|
|
2187
|
-
|
|
2188
|
-
|
|
2293
|
+
yt as tenantsGet,
|
|
2294
|
+
ts as userAdd,
|
|
2189
2295
|
Ke as userDelegatedScopesGet,
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2296
|
+
Ut as userDelegatedScopesRemove,
|
|
2297
|
+
ss as userRemove,
|
|
2298
|
+
_t as usersGet,
|
|
2299
|
+
ht as workspaceConfigsGet,
|
|
2300
|
+
rs as workspaceEdit,
|
|
2301
|
+
Tt as workspacePut,
|
|
2302
|
+
St as workspacesGet
|
|
2196
2303
|
};
|
|
2197
2304
|
//# sourceMappingURL=sync.es.js.map
|