@mindline/sync 1.0.103 → 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/{d6a9e023-f0ee-489b-8cfd-04fd4d8b476f.vsidx → 5c93d870-257a-4d35-93a3-48d299fa5b1a.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 +18 -11
- package/.vs/sync/v17/DocumentLayout.json +10 -11
- package/dist/src/index.d.ts +10 -2
- package/dist/sync.es.js +706 -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 +294 -15
- package/.vs/sync/FileContentIndex/46473787-3d20-4f5a-849d-a99c601ab90f.vsidx +0 -0
- package/.vs/sync/FileContentIndex/57cacc78-62f1-4670-a7de-ef5a5f15761c.vsidx +0 -0
- package/.vs/sync/FileContentIndex/ddd298b1-dee9-42b4-a705-1eeebff3ae8c.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,66 +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
|
-
this
|
|
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");
|
|
384
|
+
this.id = "", this.name = "", this.workspaceId = "", this.description = "", this.isEnabled = !1, this.isReadPermissionConsented = !1, this.email = "", this.tenantId = "", this.sel = !1;
|
|
381
385
|
}
|
|
382
386
|
}
|
|
383
387
|
class ee {
|
|
384
388
|
// selection state
|
|
385
389
|
constructor() {
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
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");
|
|
393
397
|
this.id = "", this.name = "", this.ownerid = "", this.associatedUsers = new Array(), this.associatedTenants = new Array(), this.associatedConfigs = new Array(), this.sel = !1;
|
|
394
398
|
}
|
|
395
399
|
}
|
|
396
|
-
function
|
|
400
|
+
function C() {
|
|
397
401
|
let a;
|
|
398
402
|
try {
|
|
399
403
|
a = window.localStorage;
|
|
@@ -410,23 +414,23 @@ function x() {
|
|
|
410
414
|
}
|
|
411
415
|
}
|
|
412
416
|
var q, ye;
|
|
413
|
-
class
|
|
417
|
+
class Pt {
|
|
414
418
|
constructor(t = !1) {
|
|
415
419
|
j(this, q);
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
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);
|
|
425
429
|
this.init(t);
|
|
426
430
|
}
|
|
427
431
|
// get initial data from localStorage or file
|
|
428
432
|
init(t) {
|
|
429
|
-
if (console.log(`Calling InitInfo::init(bClearLocalStorage: ${t ? "true" : "false"})`),
|
|
433
|
+
if (console.log(`Calling InitInfo::init(bClearLocalStorage: ${t ? "true" : "false"})`), C()) {
|
|
430
434
|
let o = localStorage.getItem("InitInfo");
|
|
431
435
|
if (o != null && typeof o == "string" && o !== "") {
|
|
432
436
|
let i = JSON.parse(o);
|
|
@@ -440,7 +444,7 @@ class Dt {
|
|
|
440
444
|
}
|
|
441
445
|
}
|
|
442
446
|
this.tab = 0, this.version = F(), this.configlevelconsent_configid = "", this.configlevelconsent_access = 3;
|
|
443
|
-
var r = JSON.stringify(
|
|
447
|
+
var r = JSON.stringify(ke), s = JSON.stringify(De), e = JSON.stringify(Ee), n = JSON.stringify(ve);
|
|
444
448
|
try {
|
|
445
449
|
this.us = W(X, r), this.ts = W(L, s), this.cs = W(Y, e), this.ws = W(ee, n), this.tagWithWorkspaces();
|
|
446
450
|
} catch {
|
|
@@ -547,42 +551,42 @@ const Be = [
|
|
|
547
551
|
]
|
|
548
552
|
}
|
|
549
553
|
];
|
|
550
|
-
var
|
|
551
|
-
class
|
|
554
|
+
var P, te, se, re;
|
|
555
|
+
class Rt {
|
|
552
556
|
constructor(t) {
|
|
553
|
-
j(this,
|
|
554
|
-
|
|
557
|
+
j(this, P);
|
|
558
|
+
c(this, "tasks");
|
|
555
559
|
this.tasks = [new Q()], this.init(t);
|
|
556
560
|
}
|
|
557
561
|
// get initial data from localStorage or file
|
|
558
562
|
init(t) {
|
|
559
|
-
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()) {
|
|
560
564
|
let r = localStorage.getItem("Tasks");
|
|
561
565
|
if (r != null && typeof r == "string" && r !== "") {
|
|
562
566
|
let e = JSON.parse(r);
|
|
563
|
-
if (this.tasks = G(this,
|
|
567
|
+
if (this.tasks = G(this, P, se).call(this, e.tasks), this.tasks.length !== 0) return;
|
|
564
568
|
}
|
|
565
569
|
}
|
|
566
|
-
this.tasks = G(this,
|
|
570
|
+
this.tasks = G(this, P, se).call(this, Be);
|
|
567
571
|
}
|
|
568
572
|
// set start time for a task
|
|
569
573
|
setTaskStart(t, r) {
|
|
570
|
-
let s = G(this,
|
|
574
|
+
let s = G(this, P, te).call(this, t);
|
|
571
575
|
if (s != null && s != null)
|
|
572
|
-
s.setStart(r), s.status = "in progress", G(this,
|
|
576
|
+
s.setStart(r), s.status = "in progress", G(this, P, re).call(this);
|
|
573
577
|
else
|
|
574
578
|
debugger;
|
|
575
579
|
}
|
|
576
580
|
// set end time for a task
|
|
577
581
|
setTaskEnd(t, r, s) {
|
|
578
|
-
let e = G(this,
|
|
582
|
+
let e = G(this, P, te).call(this, t);
|
|
579
583
|
if (e != null && e != null)
|
|
580
|
-
e.setEnd(r), e.status = s, G(this,
|
|
584
|
+
e.setEnd(r), e.status = s, G(this, P, re).call(this);
|
|
581
585
|
else
|
|
582
586
|
debugger;
|
|
583
587
|
}
|
|
584
588
|
}
|
|
585
|
-
|
|
589
|
+
P = new WeakSet(), //
|
|
586
590
|
// private
|
|
587
591
|
//
|
|
588
592
|
te = function(t) {
|
|
@@ -603,21 +607,21 @@ te = function(t) {
|
|
|
603
607
|
});
|
|
604
608
|
}, re = function() {
|
|
605
609
|
let t = JSON.stringify(this);
|
|
606
|
-
|
|
610
|
+
C() && localStorage.setItem("Tasks", t);
|
|
607
611
|
};
|
|
608
612
|
class Q {
|
|
609
613
|
constructor() {
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
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", []);
|
|
621
625
|
}
|
|
622
626
|
setEnd(t) {
|
|
623
627
|
this.end = t, this.endDisplay = `${this.end.getMinutes().toString().padStart(2, "0")}:${this.end.getSeconds().toString().padStart(2, "0")}`;
|
|
@@ -630,19 +634,19 @@ class Q {
|
|
|
630
634
|
this.start = t, this.startDisplay = `${this.start.getMinutes().toString().padStart(2, "0")}:${this.start.getSeconds().toString().padStart(2, "0")}`;
|
|
631
635
|
}
|
|
632
636
|
}
|
|
633
|
-
class
|
|
637
|
+
class U {
|
|
634
638
|
constructor(t) {
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
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");
|
|
646
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 = "";
|
|
647
651
|
}
|
|
648
652
|
start(t) {
|
|
@@ -662,11 +666,11 @@ var z, ne;
|
|
|
662
666
|
class Ue {
|
|
663
667
|
constructor(t) {
|
|
664
668
|
j(this, z);
|
|
665
|
-
|
|
669
|
+
c(this, "milestones", []);
|
|
666
670
|
this.init(t);
|
|
667
671
|
}
|
|
668
672
|
init(t) {
|
|
669
|
-
if (
|
|
673
|
+
if (C()) {
|
|
670
674
|
let r = localStorage.getItem("syncmilestones");
|
|
671
675
|
if (r != null && typeof r == "string" && r !== "") {
|
|
672
676
|
let e = JSON.parse(r);
|
|
@@ -679,11 +683,11 @@ class Ue {
|
|
|
679
683
|
}
|
|
680
684
|
}
|
|
681
685
|
}
|
|
682
|
-
G(this, z, ne).call(this,
|
|
686
|
+
G(this, z, ne).call(this, Pe);
|
|
683
687
|
}
|
|
684
688
|
save() {
|
|
685
689
|
let t = JSON.stringify(this.milestones);
|
|
686
|
-
|
|
690
|
+
C() && localStorage.setItem("syncmilestones", t);
|
|
687
691
|
}
|
|
688
692
|
// milestone tracking during a sync
|
|
689
693
|
start(t) {
|
|
@@ -691,9 +695,9 @@ class Ue {
|
|
|
691
695
|
debugger;
|
|
692
696
|
return;
|
|
693
697
|
}
|
|
694
|
-
let r = Number(this.milestones[0].Run), s = new
|
|
698
|
+
let r = Number(this.milestones[0].Run), s = new U(r + 1);
|
|
695
699
|
this.milestones.unshift(s), this.milestones = this.milestones.map((e) => {
|
|
696
|
-
let n = new
|
|
700
|
+
let n = new U(e.Run);
|
|
697
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;
|
|
698
702
|
}), t(this.milestones), console.log(`Start milestone: ${this.milestones[0].Run}:${this.milestones[0].Start}`);
|
|
699
703
|
}
|
|
@@ -704,7 +708,7 @@ class Ue {
|
|
|
704
708
|
}
|
|
705
709
|
let r = this.milestones.shift();
|
|
706
710
|
this.milestones = this.milestones.map((s) => {
|
|
707
|
-
let e = new
|
|
711
|
+
let e = new U(s.Run);
|
|
708
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;
|
|
709
713
|
}), t(this.milestones), console.log(`Unstart removed first milestone: ${r.Run}:${r.Start}`);
|
|
710
714
|
}
|
|
@@ -732,35 +736,35 @@ class Ue {
|
|
|
732
736
|
console.log(`Removed milestone #${r.Run}: ${r.Start}`);
|
|
733
737
|
}
|
|
734
738
|
this.save(), this.milestones = this.milestones.map((r) => {
|
|
735
|
-
let s = new
|
|
739
|
+
let s = new U(r.Run);
|
|
736
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;
|
|
737
741
|
}), t(this.milestones);
|
|
738
742
|
}
|
|
739
743
|
}
|
|
740
744
|
z = new WeakSet(), ne = function(t) {
|
|
741
745
|
t == null ? this.milestones = new Array() : this.milestones = t.map((r) => {
|
|
742
|
-
let s = new
|
|
746
|
+
let s = new U(Number(r.Run));
|
|
743
747
|
return s.start(r.Start), s.post(r.POST), s.read(r.Read), s.write(r.Write), s;
|
|
744
748
|
});
|
|
745
749
|
};
|
|
746
|
-
class
|
|
750
|
+
class Gt {
|
|
747
751
|
constructor(t, r, s) {
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
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");
|
|
757
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);
|
|
758
762
|
}
|
|
759
763
|
// populate tenantNodes based on config tenants
|
|
760
764
|
init(t, r, s) {
|
|
761
765
|
console.log(
|
|
762
766
|
`Calling BatchArray::init(config: "${t ? t.name : "null"}", bClearLocalStorage: ${s ? "true" : "false"})`
|
|
763
|
-
), 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) => {
|
|
764
768
|
if (e.configurationTenantType === "source" || e.configurationTenantType === "sourcetarget") {
|
|
765
769
|
let n = r.ts.find(
|
|
766
770
|
(o) => o.tid === e.tid
|
|
@@ -812,15 +816,15 @@ class Pt {
|
|
|
812
816
|
uninitializeProgressBar(t, r, s, e) {
|
|
813
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);
|
|
814
818
|
}
|
|
815
|
-
initializeSignalR(t, r, s, e, n, o, d, i,
|
|
816
|
-
this.milestoneArray.post(
|
|
817
|
-
let
|
|
818
|
-
console.log(
|
|
819
|
-
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);
|
|
820
824
|
this.pb_idle = 0;
|
|
821
|
-
let D = s.find((g) => g.BatchId ==
|
|
825
|
+
let D = s.find((g) => g.BatchId == E.TargetID);
|
|
822
826
|
if (D == null) {
|
|
823
|
-
console.log(`Batch ${
|
|
827
|
+
console.log(`Batch ${E.TargetID} not found in batchIdArray.`);
|
|
824
828
|
debugger;
|
|
825
829
|
return;
|
|
826
830
|
}
|
|
@@ -831,70 +835,70 @@ class Pt {
|
|
|
831
835
|
return;
|
|
832
836
|
}
|
|
833
837
|
h.batchId = D.BatchId;
|
|
834
|
-
let k =
|
|
835
|
-
for (let g = 0; g <
|
|
836
|
-
let
|
|
837
|
-
if (
|
|
838
|
-
let
|
|
839
|
-
if (M && (
|
|
840
|
-
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]}.`);
|
|
841
845
|
debugger;
|
|
842
846
|
return;
|
|
843
847
|
}
|
|
844
|
-
|
|
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}`));
|
|
845
849
|
}
|
|
846
|
-
if (h.nothingtosync = oe && ie,
|
|
847
|
-
let
|
|
848
|
-
M && (
|
|
849
|
-
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);
|
|
850
854
|
if (Z == null) {
|
|
851
|
-
console.log(`tid not found in ${
|
|
855
|
+
console.log(`tid not found in ${T[g]}.`);
|
|
852
856
|
debugger;
|
|
853
857
|
return;
|
|
854
858
|
}
|
|
855
|
-
let
|
|
856
|
-
if (
|
|
859
|
+
let b = h.targets.find((be) => be.tid === Z[1]);
|
|
860
|
+
if (b == null) {
|
|
857
861
|
console.log(`Writer ${h.name} not found under Reader ${h.name}.`);
|
|
858
862
|
debugger;
|
|
859
863
|
return;
|
|
860
864
|
}
|
|
861
|
-
if (
|
|
862
|
-
|
|
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}`);
|
|
863
867
|
else if (M)
|
|
864
|
-
|
|
865
|
-
else if (
|
|
866
|
-
|
|
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}`);
|
|
867
871
|
else {
|
|
868
872
|
console.log("unknown writer type");
|
|
869
873
|
debugger;
|
|
870
874
|
return;
|
|
871
875
|
}
|
|
872
|
-
|
|
876
|
+
b.update(b.total, b.read, b.written, b.deferred);
|
|
873
877
|
}
|
|
874
878
|
}
|
|
875
879
|
h.update(h.total, h.read, h.written, h.deferred);
|
|
876
|
-
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;
|
|
877
881
|
if (this.tenantNodes.map((g) => {
|
|
878
|
-
g.targets.map((
|
|
879
|
-
ce && (ce =
|
|
880
|
-
}), ue && (ue = g.nothingtosync), le && (le = g.status == "complete" || g.status == "failed"),
|
|
881
|
-
}), n(
|
|
882
|
-
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"');
|
|
883
887
|
else {
|
|
884
888
|
if (le && this.milestoneArray.milestones[0].Read == null) {
|
|
885
|
-
this.milestoneArray.read(
|
|
886
|
-
let
|
|
887
|
-
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`);
|
|
888
892
|
}
|
|
889
|
-
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"'));
|
|
890
894
|
}
|
|
891
895
|
};
|
|
892
|
-
s.map((
|
|
893
|
-
const
|
|
894
|
-
let D = new URL(
|
|
895
|
-
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}`);
|
|
896
900
|
const h = new H.HubConnectionBuilder().withUrl(D.href).withAutomaticReconnect().configureLogging(H.LogLevel.Information).build();
|
|
897
|
-
h.on("newMessage",
|
|
901
|
+
h.on("newMessage", $), h.onreconnecting((k) => {
|
|
898
902
|
console.assert(h.state === H.HubConnectionState.Reconnecting), console.log(`Connection lost due to error "${k}". Reconnecting.`);
|
|
899
903
|
}), h.onreconnected((k) => {
|
|
900
904
|
console.assert(h.state === H.HubConnectionState.Connected), console.log(`Connection reestablished. Connected with connectionId "${k}".`);
|
|
@@ -910,22 +914,22 @@ class Pt {
|
|
|
910
914
|
debugger;
|
|
911
915
|
return e.result = !1, e.error = "startSync: invalid parameters", e.status = 500, e;
|
|
912
916
|
}
|
|
913
|
-
return e = await
|
|
917
|
+
return e = await bt(t, r, s), e;
|
|
914
918
|
}
|
|
915
919
|
}
|
|
916
920
|
class me {
|
|
917
921
|
constructor(t, r, s) {
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
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");
|
|
929
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);
|
|
930
934
|
}
|
|
931
935
|
update(t, r, s, e) {
|
|
@@ -934,12 +938,12 @@ class me {
|
|
|
934
938
|
}
|
|
935
939
|
class we {
|
|
936
940
|
constructor(t, r) {
|
|
937
|
-
|
|
941
|
+
c(this, "resourceNodes");
|
|
938
942
|
this.resourceNodes = new Array(), t && this.init(r);
|
|
939
943
|
}
|
|
940
944
|
// get resource data from localStorage or file
|
|
941
945
|
init(t) {
|
|
942
|
-
if (console.log(`Calling ResourceArray::init(bClearLocalStorage: ${t ? "true" : "false"})`),
|
|
946
|
+
if (console.log(`Calling ResourceArray::init(bClearLocalStorage: ${t ? "true" : "false"})`), C()) {
|
|
943
947
|
let s = localStorage.getItem("ResourceArray");
|
|
944
948
|
if (s != null && typeof s == "string" && s !== "")
|
|
945
949
|
if (t)
|
|
@@ -950,9 +954,9 @@ class we {
|
|
|
950
954
|
return;
|
|
951
955
|
}
|
|
952
956
|
}
|
|
953
|
-
var r = JSON.stringify(
|
|
957
|
+
var r = JSON.stringify(Re);
|
|
954
958
|
try {
|
|
955
|
-
this.resourceNodes = W(
|
|
959
|
+
this.resourceNodes = W(_e, r);
|
|
956
960
|
} catch {
|
|
957
961
|
debugger;
|
|
958
962
|
}
|
|
@@ -960,34 +964,34 @@ class we {
|
|
|
960
964
|
// read
|
|
961
965
|
async read(t, r) {
|
|
962
966
|
let s = new we(!1, !1);
|
|
963
|
-
return s.resourceNodes = await
|
|
967
|
+
return s.resourceNodes = await Qe(t, r), s;
|
|
964
968
|
}
|
|
965
969
|
// save resource data to localstorage
|
|
966
970
|
save() {
|
|
967
|
-
if (
|
|
971
|
+
if (C()) {
|
|
968
972
|
let t = JSON.stringify(this);
|
|
969
973
|
localStorage.setItem("ResourceArray", t);
|
|
970
974
|
}
|
|
971
975
|
}
|
|
972
976
|
}
|
|
973
|
-
class
|
|
977
|
+
class _e {
|
|
974
978
|
constructor(t, r, s) {
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
979
|
+
c(this, "type");
|
|
980
|
+
c(this, "resource");
|
|
981
|
+
c(this, "cost");
|
|
982
|
+
c(this, "expanded");
|
|
983
|
+
c(this, "resources");
|
|
980
984
|
this.type = t, this.resource = r, this.cost = s, this.expanded = !1, this.resources = new Array();
|
|
981
985
|
}
|
|
982
986
|
}
|
|
983
|
-
class
|
|
987
|
+
class Ct {
|
|
984
988
|
constructor(t) {
|
|
985
|
-
|
|
989
|
+
c(this, "actorNodes");
|
|
986
990
|
this.actorNodes = new Array(), this.init(t);
|
|
987
991
|
}
|
|
988
992
|
// get initial data from localStorage or file
|
|
989
993
|
init(t) {
|
|
990
|
-
if (console.log(`Calling ResourceArray::init(bClearLocalStorage: ${t ? "true" : "false"})`),
|
|
994
|
+
if (console.log(`Calling ResourceArray::init(bClearLocalStorage: ${t ? "true" : "false"})`), C()) {
|
|
991
995
|
let s = localStorage.getItem("RBACActors");
|
|
992
996
|
if (s != null && typeof s == "string" && s !== "")
|
|
993
997
|
if (t)
|
|
@@ -998,33 +1002,33 @@ class Rt {
|
|
|
998
1002
|
return;
|
|
999
1003
|
}
|
|
1000
1004
|
}
|
|
1001
|
-
var r = JSON.stringify(
|
|
1005
|
+
var r = JSON.stringify(Ge);
|
|
1002
1006
|
try {
|
|
1003
|
-
this.actorNodes = W(
|
|
1007
|
+
this.actorNodes = W(Le, r);
|
|
1004
1008
|
} catch {
|
|
1005
1009
|
debugger;
|
|
1006
1010
|
}
|
|
1007
1011
|
}
|
|
1008
1012
|
}
|
|
1009
|
-
class
|
|
1013
|
+
class Le {
|
|
1010
1014
|
constructor(t, r, s, e, n, o) {
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
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");
|
|
1018
1022
|
this.type = t, this.actor = r, this.resource = s, this.role = e, this.updatedby = n, this.updatedon = o, this.actors = new Array();
|
|
1019
1023
|
}
|
|
1020
1024
|
}
|
|
1021
|
-
function
|
|
1025
|
+
function ze(a) {
|
|
1022
1026
|
return "Group.Read.All User.Read.All openid profile offline_access User.Read Contacts.Read CrossTenantInformation.ReadBasic.All";
|
|
1023
1027
|
}
|
|
1024
|
-
async function
|
|
1028
|
+
async function K(a, t) {
|
|
1025
1029
|
const r = new Headers();
|
|
1026
1030
|
r.append("Content-Type", "application/json"), r.append("accept", "*/*");
|
|
1027
|
-
const s =
|
|
1031
|
+
const s = ze();
|
|
1028
1032
|
if (t.graphAccessToken == null || t.graphAccessToken === "")
|
|
1029
1033
|
try {
|
|
1030
1034
|
let e = await a.acquireTokenByCode({
|
|
@@ -1060,10 +1064,10 @@ async function J(a, t) {
|
|
|
1060
1064
|
}
|
|
1061
1065
|
return r.append("Authorization", `Bearer ${t.graphAccessToken}`), r;
|
|
1062
1066
|
}
|
|
1063
|
-
async function
|
|
1067
|
+
async function xt(a, t, r) {
|
|
1064
1068
|
if (t == null || t.spacode == "")
|
|
1065
1069
|
return { groups: [], error: "500: invalid user passed to groupsGet" };
|
|
1066
|
-
let e = { method: "GET", headers: await
|
|
1070
|
+
let e = { method: "GET", headers: await K(a, t) };
|
|
1067
1071
|
try {
|
|
1068
1072
|
let n = N(t.authority) + p.graphGroupsPredicate;
|
|
1069
1073
|
n += `/?$filter=startsWith(displayName, '${r}')`;
|
|
@@ -1073,7 +1077,7 @@ async function Et(a, t, r) {
|
|
|
1073
1077
|
return console.log(n), { groups: [], error: `Exception: ${n}` };
|
|
1074
1078
|
}
|
|
1075
1079
|
}
|
|
1076
|
-
async function
|
|
1080
|
+
async function Me(a, t, r, s) {
|
|
1077
1081
|
try {
|
|
1078
1082
|
let e = N(t.authority) + p.graphOauth2PermissionGrantsPredicate, n = new URL(e);
|
|
1079
1083
|
n.searchParams.append("$filter", `resourceId eq '${r}' and consentType eq 'Principal' and principalId eq '${s}'`);
|
|
@@ -1089,29 +1093,29 @@ async function je(a, t, r, s) {
|
|
|
1089
1093
|
return console.log(e), { grants: null, id: null, error: `Exception: ${e}` };
|
|
1090
1094
|
}
|
|
1091
1095
|
}
|
|
1092
|
-
async function
|
|
1096
|
+
async function je(a, t, r, s) {
|
|
1093
1097
|
if (t == null || t.spacode == "")
|
|
1094
1098
|
return !1;
|
|
1095
1099
|
try {
|
|
1096
1100
|
let e = N(t.authority);
|
|
1097
1101
|
e += p.graphOauth2PermissionGrantsPredicate + `/${r}`;
|
|
1098
|
-
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();
|
|
1099
1103
|
if (i.status == 204 && i.statusText == "No Content")
|
|
1100
1104
|
return !0;
|
|
1101
1105
|
debugger;
|
|
1102
|
-
return console.log(`oauth2PermissionGrantsSet: PATCH failed ${
|
|
1106
|
+
return console.log(`oauth2PermissionGrantsSet: PATCH failed ${l.error.code}: ${l.error.message}`), !1;
|
|
1103
1107
|
} catch (e) {
|
|
1104
1108
|
debugger;
|
|
1105
1109
|
return console.log(e), !1;
|
|
1106
1110
|
}
|
|
1107
1111
|
}
|
|
1108
|
-
function
|
|
1109
|
-
let r =
|
|
1112
|
+
function Nt(a, t) {
|
|
1113
|
+
let r = Oe(a.authority);
|
|
1110
1114
|
r += a.tid, r += "/adminconsent";
|
|
1111
|
-
let s = new URL(r), e =
|
|
1115
|
+
let s = new URL(r), e = Ne(a.authority, t);
|
|
1112
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);
|
|
1113
1117
|
}
|
|
1114
|
-
async function
|
|
1118
|
+
async function He(a, t, r) {
|
|
1115
1119
|
try {
|
|
1116
1120
|
let s = N(t.authority);
|
|
1117
1121
|
s += p.graphServicePrincipalsPredicate, s += `(appId='${r}')`;
|
|
@@ -1123,7 +1127,7 @@ async function qe(a, t, r) {
|
|
|
1123
1127
|
return console.log(s), { spid: "", error: `Exception: ${s}` };
|
|
1124
1128
|
}
|
|
1125
1129
|
}
|
|
1126
|
-
async function
|
|
1130
|
+
async function Ot(a, t) {
|
|
1127
1131
|
if (a.authority == "") {
|
|
1128
1132
|
let e = new L();
|
|
1129
1133
|
if (e.domain = a.tid, await Te(e, !1))
|
|
@@ -1157,7 +1161,7 @@ async function xt(a, t) {
|
|
|
1157
1161
|
s.searchParams.append("domainHint", "organizations");
|
|
1158
1162
|
return t.setTaskStart("initialization", /* @__PURE__ */ new Date()), t.setTaskStart("authenticate user", /* @__PURE__ */ new Date()), window.location.assign(s.href), !0;
|
|
1159
1163
|
}
|
|
1160
|
-
function
|
|
1164
|
+
function Wt(a, t) {
|
|
1161
1165
|
debugger;
|
|
1162
1166
|
if (a.oid == "1") return;
|
|
1163
1167
|
let r = window.location.href;
|
|
@@ -1177,7 +1181,7 @@ function Ct(a, t) {
|
|
|
1177
1181
|
let s = new URL(r);
|
|
1178
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);
|
|
1179
1183
|
}
|
|
1180
|
-
async function
|
|
1184
|
+
async function Ft(a) {
|
|
1181
1185
|
if (a.oid == "1") return !1;
|
|
1182
1186
|
let t = window.location.href;
|
|
1183
1187
|
t += "user";
|
|
@@ -1204,7 +1208,7 @@ async function Nt(a) {
|
|
|
1204
1208
|
}
|
|
1205
1209
|
return r = new URL(n), r.searchParams.append("redirectUri", window.location.origin), window.location.assign(r.href), !0;
|
|
1206
1210
|
}
|
|
1207
|
-
async function
|
|
1211
|
+
async function Bt(a, t, r, s) {
|
|
1208
1212
|
if (s) debugger;
|
|
1209
1213
|
if (t.name != null && t.name !== "") return !1;
|
|
1210
1214
|
if (a.graphAccessToken != null && a.graphAccessToken === "") {
|
|
@@ -1224,13 +1228,13 @@ async function Ot(a, t, r, s) {
|
|
|
1224
1228
|
d += "(domainName='", d += t.domain, d += "')", console.log("tenantRelationshipsGetByDomain: Attempting GET from /findTenantInformationByDomainName:", d);
|
|
1225
1229
|
let i = await fetch(d, o);
|
|
1226
1230
|
if (i.status == 200) {
|
|
1227
|
-
let
|
|
1228
|
-
if (
|
|
1229
|
-
if (
|
|
1231
|
+
let l = await i.json();
|
|
1232
|
+
if (l) {
|
|
1233
|
+
if (l.error != null) {
|
|
1230
1234
|
debugger;
|
|
1231
|
-
return console.log("tenantRelationshipsGetByDomain: Failed GET from /findTenantInformationByDomainName: ",
|
|
1232
|
-
} else if (
|
|
1233
|
-
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;
|
|
1234
1238
|
} else
|
|
1235
1239
|
console.log("tenantRelationshipsGetByDomain: Failed to GET from /findTenantInformationByDomainName: ", d);
|
|
1236
1240
|
}
|
|
@@ -1239,14 +1243,14 @@ async function Ot(a, t, r, s) {
|
|
|
1239
1243
|
}
|
|
1240
1244
|
return !1;
|
|
1241
1245
|
}
|
|
1242
|
-
async function
|
|
1246
|
+
async function qe(a, t, r, s, e) {
|
|
1243
1247
|
if (console.log("**** tenantRelationshipsGetById"), e) debugger;
|
|
1244
1248
|
if (a.graphAccessToken === "")
|
|
1245
1249
|
try {
|
|
1246
|
-
let
|
|
1247
|
-
a.graphAccessToken =
|
|
1248
|
-
} catch (
|
|
1249
|
-
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;
|
|
1250
1254
|
}
|
|
1251
1255
|
const n = new Headers(), o = `Bearer ${a.graphAccessToken}`;
|
|
1252
1256
|
n.append("Authorization", o);
|
|
@@ -1265,8 +1269,8 @@ async function Je(a, t, r, s, e) {
|
|
|
1265
1269
|
return console.log("tenantRelationshipsGetById: Successful GET from /findTenantInformationByTenantId: ", u.displayName), !0;
|
|
1266
1270
|
} else
|
|
1267
1271
|
console.log("tenantRelationshipsGetById: Failed to GET from /findTenantInformationByTenantId: ", i);
|
|
1268
|
-
} catch (
|
|
1269
|
-
return console.log("tenantRelationshipsGetById: Failed to GET from /findTenantInformationByTenantId: ",
|
|
1272
|
+
} catch (l) {
|
|
1273
|
+
return console.log("tenantRelationshipsGetById: Failed to GET from /findTenantInformationByTenantId: ", l), !1;
|
|
1270
1274
|
}
|
|
1271
1275
|
return !1;
|
|
1272
1276
|
}
|
|
@@ -1277,9 +1281,9 @@ async function Te(a, t) {
|
|
|
1277
1281
|
for (let i = 0; i < 3; i++) {
|
|
1278
1282
|
var n = r[i];
|
|
1279
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) {
|
|
1280
|
-
let
|
|
1281
|
-
if (
|
|
1282
|
-
var o =
|
|
1284
|
+
let l = await e.json();
|
|
1285
|
+
if (l) {
|
|
1286
|
+
var o = l.authorization_endpoint;
|
|
1283
1287
|
for (let u = 0; u < 3; u++) {
|
|
1284
1288
|
var d = o.match(s[u]);
|
|
1285
1289
|
if (d != null)
|
|
@@ -1300,17 +1304,17 @@ async function Ke(a, t, r) {
|
|
|
1300
1304
|
debugger;
|
|
1301
1305
|
return { scopes: null, id: null, error: "500: invalid parameter(s) passed to getUserDelegatedScopes" };
|
|
1302
1306
|
}
|
|
1303
|
-
let e = { method: "GET", headers: await
|
|
1307
|
+
let e = { method: "GET", headers: await K(a, t) };
|
|
1304
1308
|
try {
|
|
1305
1309
|
if (r.graphSP == "") {
|
|
1306
|
-
let { spid: i, error:
|
|
1307
|
-
if (
|
|
1310
|
+
let { spid: i, error: l } = await He(e, t, "00000003-0000-0000-c000-000000000000");
|
|
1311
|
+
if (l != "") {
|
|
1308
1312
|
debugger;
|
|
1309
|
-
return { scopes: null, id: null, error: `${
|
|
1313
|
+
return { scopes: null, id: null, error: `${l}` };
|
|
1310
1314
|
}
|
|
1311
1315
|
r.graphSP = i;
|
|
1312
1316
|
}
|
|
1313
|
-
let { grants: n, id: o, error: d } = await
|
|
1317
|
+
let { grants: n, id: o, error: d } = await Me(e, t, r.graphSP, t.oid);
|
|
1314
1318
|
if (d != "") {
|
|
1315
1319
|
debugger;
|
|
1316
1320
|
return { scopes: null, id: null, error: `${d}` };
|
|
@@ -1321,7 +1325,7 @@ async function Ke(a, t, r) {
|
|
|
1321
1325
|
return console.log(n), { scopes: null, id: null, error: `Exception: ${n}` };
|
|
1322
1326
|
}
|
|
1323
1327
|
}
|
|
1324
|
-
async function
|
|
1328
|
+
async function Ut(a, t, r, s) {
|
|
1325
1329
|
if (t == null || t.spacode == "" || r == null) {
|
|
1326
1330
|
debugger;
|
|
1327
1331
|
return !1;
|
|
@@ -1332,18 +1336,18 @@ async function Wt(a, t, r, s) {
|
|
|
1332
1336
|
return console.log(`userDelegatedScopesRemove: cannot find userDelegatedScopes for ${t.mail}: ${o}`), !1;
|
|
1333
1337
|
}
|
|
1334
1338
|
e = e.replace(s, "");
|
|
1335
|
-
let d = await
|
|
1339
|
+
let d = await je(a, t, n, e);
|
|
1336
1340
|
if (!d) {
|
|
1337
1341
|
debugger;
|
|
1338
1342
|
return console.log(`userDelegatedScopesRemove: cannot set oauth2PermissionGrants for ${t.mail}: ${o}`), !1;
|
|
1339
1343
|
}
|
|
1340
1344
|
return t.scopes = e.split(" "), d;
|
|
1341
1345
|
}
|
|
1342
|
-
async function
|
|
1346
|
+
async function _t(a, t) {
|
|
1343
1347
|
if (t == null || t.spacode == "")
|
|
1344
1348
|
return { users: [], error: "500: invalid user passed to usersGet" };
|
|
1345
1349
|
try {
|
|
1346
|
-
let s = { method: "GET", headers: await
|
|
1350
|
+
let s = { method: "GET", headers: await K(a, t) }, e = N(t.authority);
|
|
1347
1351
|
e += p.graphUsersPredicate;
|
|
1348
1352
|
let o = await (await fetch(e, s)).json();
|
|
1349
1353
|
if (typeof o.error < "u")
|
|
@@ -1356,94 +1360,99 @@ async function Ft(a, t) {
|
|
|
1356
1360
|
return console.log(r), { users: [], error: `Exception: ${r}` };
|
|
1357
1361
|
}
|
|
1358
1362
|
}
|
|
1359
|
-
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) {
|
|
1360
1367
|
return rt(a, t, r, s);
|
|
1361
1368
|
}
|
|
1362
|
-
async function
|
|
1363
|
-
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);
|
|
1364
1374
|
}
|
|
1365
|
-
async function
|
|
1366
|
-
return
|
|
1375
|
+
async function Ht(a, t, r) {
|
|
1376
|
+
return ot(a, t, r);
|
|
1367
1377
|
}
|
|
1368
|
-
async function
|
|
1378
|
+
async function qt(a, t, r, s, e, n, o, d) {
|
|
1369
1379
|
let i = new m();
|
|
1370
1380
|
if (r.id === "1") {
|
|
1371
|
-
if (i = await
|
|
1381
|
+
if (i = await ut(a, t, r, n.id, d), i.result) {
|
|
1372
1382
|
s && s(r.id);
|
|
1373
|
-
const
|
|
1374
|
-
Object.defineProperty(
|
|
1383
|
+
const l = {};
|
|
1384
|
+
Object.defineProperty(l, r.id, { value: !0, writable: !0, enumerable: !0 }), e(l);
|
|
1375
1385
|
let u = n.associatedConfigs.findIndex((f) => f == "1");
|
|
1376
1386
|
u !== -1 && (n.associatedConfigs.splice(u, 1), n.associatedConfigs.push(r.id));
|
|
1377
1387
|
}
|
|
1378
1388
|
} else
|
|
1379
|
-
i = await
|
|
1389
|
+
i = await ft(a, t, r, d);
|
|
1380
1390
|
return o.save(), i;
|
|
1381
1391
|
}
|
|
1382
|
-
async function
|
|
1392
|
+
async function Kt(a, t, r, s, e) {
|
|
1383
1393
|
let n = new m();
|
|
1384
|
-
return n = await
|
|
1394
|
+
return n = await dt(a, t, r, s, e), n;
|
|
1385
1395
|
}
|
|
1386
|
-
async function
|
|
1387
|
-
return ot(a, t, r, s, e);
|
|
1388
|
-
}
|
|
1389
|
-
async function jt(a, t, r, s, e) {
|
|
1396
|
+
async function Jt(a, t, r, s, e) {
|
|
1390
1397
|
return it(a, t, r, s, e);
|
|
1391
1398
|
}
|
|
1392
|
-
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) {
|
|
1393
1403
|
let n = new m();
|
|
1394
1404
|
if (e) debugger;
|
|
1395
1405
|
try {
|
|
1396
1406
|
let o = s.ws.find((d) => d.id === r);
|
|
1397
1407
|
if (o != null) {
|
|
1398
1408
|
o.associatedConfigs.length = 0;
|
|
1399
|
-
let d = await
|
|
1409
|
+
let d = await ht(a, t, o.id, e);
|
|
1400
1410
|
if (!d.result) return d;
|
|
1401
1411
|
let i = "";
|
|
1402
|
-
for (let
|
|
1403
|
-
let u = s.cs.find((f) => f.id ===
|
|
1404
|
-
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();
|
|
1405
1415
|
}
|
|
1406
|
-
|
|
1407
|
-
}
|
|
1408
|
-
|
|
1416
|
+
return d;
|
|
1417
|
+
} else
|
|
1418
|
+
return n.result = !1, n.error = "Workspace not found.", n.status = 404, n;
|
|
1409
1419
|
} catch (o) {
|
|
1410
|
-
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;
|
|
1411
1421
|
}
|
|
1412
|
-
return n.result = !1, n.status = 500, n;
|
|
1413
1422
|
}
|
|
1414
|
-
async function
|
|
1415
|
-
return
|
|
1423
|
+
async function Qt(a, t, r, s, e) {
|
|
1424
|
+
return ct(a, t, r, s);
|
|
1416
1425
|
}
|
|
1417
|
-
async function
|
|
1426
|
+
async function Xt(a, t, r, s, e) {
|
|
1418
1427
|
console.log(">>>>>> initGet");
|
|
1419
1428
|
let n = new m();
|
|
1420
1429
|
if (e)
|
|
1421
1430
|
debugger;
|
|
1422
1431
|
let o = new L();
|
|
1423
|
-
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);
|
|
1424
1433
|
}
|
|
1425
|
-
async function
|
|
1426
|
-
return
|
|
1434
|
+
async function Yt(a, t, r, s) {
|
|
1435
|
+
return wt(a, t, r, s);
|
|
1427
1436
|
}
|
|
1428
|
-
async function
|
|
1429
|
-
return
|
|
1437
|
+
async function es(a, t, r, s, e) {
|
|
1438
|
+
return mt(a, t, r, s);
|
|
1430
1439
|
}
|
|
1431
|
-
async function
|
|
1432
|
-
return
|
|
1440
|
+
async function ts(a, t, r, s) {
|
|
1441
|
+
return tt(a, t, r, s);
|
|
1433
1442
|
}
|
|
1434
|
-
async function
|
|
1435
|
-
return
|
|
1443
|
+
async function ss(a, t, r, s) {
|
|
1444
|
+
return Ye(a, t, r, s);
|
|
1436
1445
|
}
|
|
1437
|
-
async function
|
|
1438
|
-
return await
|
|
1446
|
+
async function rs(a, t, r, s) {
|
|
1447
|
+
return await Tt(a, t, r, s);
|
|
1439
1448
|
}
|
|
1440
|
-
function
|
|
1449
|
+
function Je(a, t, r, s) {
|
|
1441
1450
|
r.map((e) => {
|
|
1442
|
-
let n = null, o = t.us.findIndex((
|
|
1451
|
+
let n = null, o = t.us.findIndex((l) => l.oid === e.userId || l.oid === e.email);
|
|
1443
1452
|
if (o === -1) {
|
|
1444
|
-
let
|
|
1445
|
-
if (
|
|
1446
|
-
n = t.us.at(
|
|
1453
|
+
let l = t.us.findIndex((u) => u.oid === "1");
|
|
1454
|
+
if (l !== -1) {
|
|
1455
|
+
n = t.us.at(l);
|
|
1447
1456
|
let u = a.associatedUsers.findIndex((f) => f == "1");
|
|
1448
1457
|
u !== -1 && (a.associatedUsers.splice(u, 1), a.associatedUsers.push(e.userId));
|
|
1449
1458
|
} else
|
|
@@ -1451,18 +1460,18 @@ function Ve(a, t, r, s) {
|
|
|
1451
1460
|
} else
|
|
1452
1461
|
n = t.us.at(o);
|
|
1453
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;
|
|
1454
|
-
let d = t.ts.find((
|
|
1455
|
-
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);
|
|
1456
1465
|
}), t.save();
|
|
1457
1466
|
}
|
|
1458
|
-
function
|
|
1467
|
+
function Ve(a, t, r, s) {
|
|
1459
1468
|
r.map((e) => {
|
|
1460
1469
|
let n = null, o = t.ts.findIndex((u) => u.tid === e.tenantId);
|
|
1461
1470
|
if (o === -1) {
|
|
1462
1471
|
let u = t.ts.findIndex((f) => f.tid === "1");
|
|
1463
1472
|
if (u !== -1) {
|
|
1464
1473
|
n = t.ts.at(u);
|
|
1465
|
-
let f = a.associatedTenants.findIndex((
|
|
1474
|
+
let f = a.associatedTenants.findIndex(($) => $ == "1");
|
|
1466
1475
|
f !== -1 && (a.associatedTenants.splice(f, 1), a.associatedTenants.push(e.tenantId));
|
|
1467
1476
|
} else
|
|
1468
1477
|
n = new L(), t.ts.push(n);
|
|
@@ -1477,54 +1486,54 @@ function Se(a, t, r, s) {
|
|
|
1477
1486
|
r.map((e) => {
|
|
1478
1487
|
let n = null, o = t.cs.findIndex((i) => i.id === e.id);
|
|
1479
1488
|
if (o === -1) {
|
|
1480
|
-
let i = t.cs.findIndex((
|
|
1489
|
+
let i = t.cs.findIndex((l) => l.id === "1");
|
|
1481
1490
|
if (i !== -1) {
|
|
1482
1491
|
n = t.cs.at(i);
|
|
1483
|
-
let
|
|
1484
|
-
|
|
1492
|
+
let l = a.associatedConfigs.findIndex((u) => u == "1");
|
|
1493
|
+
l !== -1 && (a.associatedConfigs.splice(l, 1), a.associatedConfigs.push(e.id));
|
|
1485
1494
|
} else
|
|
1486
1495
|
n = new Y(), t.cs.push(n);
|
|
1487
1496
|
} else
|
|
1488
1497
|
n = t.cs.at(o);
|
|
1489
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) => {
|
|
1490
|
-
let
|
|
1491
|
-
|
|
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);
|
|
1492
1501
|
}), a.associatedConfigs.findIndex((i) => i === e.id) == -1 && a.associatedConfigs.push(e.id);
|
|
1493
1502
|
}), t.save();
|
|
1494
1503
|
}
|
|
1495
|
-
async function
|
|
1504
|
+
async function Ze(a, t, r, s) {
|
|
1496
1505
|
let e = new m();
|
|
1497
1506
|
if (s) debugger;
|
|
1498
1507
|
try {
|
|
1499
|
-
if (e = await
|
|
1508
|
+
if (e = await St(a, t, s), e.result) {
|
|
1500
1509
|
for (let n of e.array) {
|
|
1501
1510
|
let o = null, d = r.ws.findIndex((k) => k.id === n.id);
|
|
1502
1511
|
if (d === -1) {
|
|
1503
|
-
let k = r.ws.findIndex((
|
|
1512
|
+
let k = r.ws.findIndex((T) => T.id === "1");
|
|
1504
1513
|
k !== -1 ? o = r.ws.at(k) : (o = new ee(), r.ws.push(o));
|
|
1505
1514
|
} else
|
|
1506
1515
|
o = r.ws.at(d);
|
|
1507
1516
|
let i = "";
|
|
1508
1517
|
for (let k of o.associatedUsers) {
|
|
1509
|
-
let
|
|
1510
|
-
|
|
1518
|
+
let T = r.us.find((v) => v.oid === k);
|
|
1519
|
+
T != null && T.sel && (i = T.oid);
|
|
1511
1520
|
}
|
|
1512
|
-
let
|
|
1521
|
+
let l = "";
|
|
1513
1522
|
for (let k of o.associatedTenants) {
|
|
1514
|
-
let
|
|
1515
|
-
|
|
1523
|
+
let T = r.ts.find((v) => v.tid === k);
|
|
1524
|
+
T != null && T.sel && (l = T.tid);
|
|
1516
1525
|
}
|
|
1517
1526
|
let u = "";
|
|
1518
1527
|
for (let k of o.associatedConfigs) {
|
|
1519
|
-
let
|
|
1520
|
-
|
|
1528
|
+
let T = r.cs.find((v) => v.id === k);
|
|
1529
|
+
T != null && T.sel && (u = T.id);
|
|
1521
1530
|
}
|
|
1522
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;
|
|
1523
|
-
let f =
|
|
1524
|
-
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;
|
|
1525
1534
|
if (!D.result) return D;
|
|
1526
1535
|
if (!h.result) return h;
|
|
1527
|
-
|
|
1536
|
+
Ve(o, r, D.array, l), Je(o, r, E.array, i), Se(o, r, h.array, u), r.tagWithWorkspaces();
|
|
1528
1537
|
}
|
|
1529
1538
|
return e;
|
|
1530
1539
|
}
|
|
@@ -1533,7 +1542,7 @@ async function Qe(a, t, r, s) {
|
|
|
1533
1542
|
}
|
|
1534
1543
|
return e.result = !1, e.status = 500, e;
|
|
1535
1544
|
}
|
|
1536
|
-
async function
|
|
1545
|
+
async function ns(a, t) {
|
|
1537
1546
|
let r = "", s = F();
|
|
1538
1547
|
try {
|
|
1539
1548
|
let e = a.getAllAccounts(), n = t.oid + "." + t.tid, o = null;
|
|
@@ -1581,11 +1590,11 @@ async function ae(a, t) {
|
|
|
1581
1590
|
}
|
|
1582
1591
|
return r.append("Authorization", `Bearer ${t.azureAccessToken}`), r;
|
|
1583
1592
|
}
|
|
1584
|
-
async function
|
|
1593
|
+
async function as(a, t) {
|
|
1585
1594
|
if (t == null || t.spacode == "")
|
|
1586
1595
|
return !1;
|
|
1587
1596
|
try {
|
|
1588
|
-
let s = { method: "GET", headers: await ae(a, t) }, e =
|
|
1597
|
+
let s = { method: "GET", headers: await ae(a, t) }, e = _.azureListRootAssignments;
|
|
1589
1598
|
e += "'", e += t.oid, e += "'";
|
|
1590
1599
|
let n = await fetch(e, s);
|
|
1591
1600
|
if (n.status == 200) {
|
|
@@ -1594,32 +1603,32 @@ async function es(a, t) {
|
|
|
1594
1603
|
debugger;
|
|
1595
1604
|
console.log("Successful call to Azure Resource Graph list root assignments");
|
|
1596
1605
|
} else
|
|
1597
|
-
return console.log(await
|
|
1606
|
+
return console.log(await w(n)), !1;
|
|
1598
1607
|
} catch (r) {
|
|
1599
1608
|
return console.log(r), !1;
|
|
1600
1609
|
}
|
|
1601
1610
|
return !0;
|
|
1602
1611
|
}
|
|
1603
|
-
async function
|
|
1612
|
+
async function os(a, t) {
|
|
1604
1613
|
if (t == null || t.spacode == "")
|
|
1605
1614
|
return !1;
|
|
1606
1615
|
try {
|
|
1607
|
-
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);
|
|
1608
1617
|
if (n.status == 200)
|
|
1609
1618
|
console.log("Successful call to Azure Resource Graph list root assignments");
|
|
1610
1619
|
else
|
|
1611
|
-
return console.log(await
|
|
1620
|
+
return console.log(await w(n)), !1;
|
|
1612
1621
|
} catch (r) {
|
|
1613
1622
|
return console.log(r), !1;
|
|
1614
1623
|
}
|
|
1615
1624
|
return !0;
|
|
1616
1625
|
}
|
|
1617
|
-
async function
|
|
1626
|
+
async function Qe(a, t) {
|
|
1618
1627
|
let r = new Array();
|
|
1619
1628
|
if (t == null || t.spacode == "")
|
|
1620
1629
|
return r;
|
|
1621
1630
|
try {
|
|
1622
|
-
let e = { method: "GET", headers: await ae(a, t) }, n =
|
|
1631
|
+
let e = { method: "GET", headers: await ae(a, t) }, n = _.azureListRootAssignments;
|
|
1623
1632
|
n += "'", n += t.oid, n += "'";
|
|
1624
1633
|
let o = await fetch(n, e);
|
|
1625
1634
|
if (o.status == 200) {
|
|
@@ -1628,20 +1637,20 @@ async function Xe(a, t) {
|
|
|
1628
1637
|
debugger;
|
|
1629
1638
|
console.log("Successful call to Azure Resource Graph list root assignments");
|
|
1630
1639
|
} else
|
|
1631
|
-
return console.log(await
|
|
1640
|
+
return console.log(await w(o)), r;
|
|
1632
1641
|
} catch (s) {
|
|
1633
1642
|
return console.log(s), r;
|
|
1634
1643
|
}
|
|
1635
1644
|
return r;
|
|
1636
1645
|
}
|
|
1637
|
-
function
|
|
1646
|
+
function Xe(a) {
|
|
1638
1647
|
let t = "8d95d21c-c378-4bb0-9f52-88c30d271e7a", r = a.authority.toLowerCase();
|
|
1639
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`;
|
|
1640
1649
|
}
|
|
1641
|
-
async function
|
|
1650
|
+
async function S(a, t) {
|
|
1642
1651
|
const r = new Headers();
|
|
1643
1652
|
r.append("Content-Type", "application/json"), r.append("accept", "*/*");
|
|
1644
|
-
const s =
|
|
1653
|
+
const s = Xe(t);
|
|
1645
1654
|
try {
|
|
1646
1655
|
let e = a.getAllAccounts(), n = t.oid + "." + t.tid, o = null;
|
|
1647
1656
|
for (let i = 0; i < e.length; i++)
|
|
@@ -1667,7 +1676,7 @@ async function A(a, t) {
|
|
|
1667
1676
|
}
|
|
1668
1677
|
return r.append("Authorization", `Bearer ${t.mindlineAccessToken}`), r;
|
|
1669
1678
|
}
|
|
1670
|
-
async function
|
|
1679
|
+
async function w(a) {
|
|
1671
1680
|
let t = "";
|
|
1672
1681
|
if (a.status === 401 && (t = a.statusText, t != ""))
|
|
1673
1682
|
return t;
|
|
@@ -1685,49 +1694,49 @@ async function S(a) {
|
|
|
1685
1694
|
debugger;
|
|
1686
1695
|
return t;
|
|
1687
1696
|
}
|
|
1688
|
-
async function
|
|
1697
|
+
async function Ye(a, t, r, s) {
|
|
1689
1698
|
let e = new m();
|
|
1690
1699
|
if (r.oid == "" && r.mail == "" || s == "")
|
|
1691
1700
|
return e.result = !1, e.error = "adminDelete: invalid parameters", e.status = 500, e;
|
|
1692
1701
|
let n = null;
|
|
1693
|
-
n = new URL(
|
|
1694
|
-
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) };
|
|
1695
1704
|
try {
|
|
1696
1705
|
console.log("Attempting DELETE from /admin: " + n.href);
|
|
1697
1706
|
let i = await fetch(n.href, d);
|
|
1698
|
-
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);
|
|
1699
1708
|
} catch (i) {
|
|
1700
1709
|
e.error = i.message, e.status = 500, e.result = !1, console.log(i.message);
|
|
1701
1710
|
}
|
|
1702
1711
|
return e;
|
|
1703
1712
|
}
|
|
1704
|
-
async function
|
|
1713
|
+
async function et(a, t, r, s) {
|
|
1705
1714
|
let e = new m();
|
|
1706
1715
|
if (r === "")
|
|
1707
1716
|
return e.result = !1, e.status = 500, e.error = "adminsGet: no workspace provided", e;
|
|
1708
|
-
let n =
|
|
1717
|
+
let n = y.adminsEndpoint(), o = new URL(n);
|
|
1709
1718
|
o.searchParams.append("workspaceId", r);
|
|
1710
|
-
let i = { method: "GET", headers: await
|
|
1719
|
+
let i = { method: "GET", headers: await S(a, t) };
|
|
1711
1720
|
try {
|
|
1712
1721
|
if (s) debugger;
|
|
1713
1722
|
console.log("Attempting GET from /admins: " + o.href);
|
|
1714
|
-
let
|
|
1715
|
-
if (
|
|
1716
|
-
let u = await
|
|
1717
|
-
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);
|
|
1718
1727
|
} else
|
|
1719
|
-
return console.log(`Failed GET from /admins: ${o.href}`), e.error = await
|
|
1720
|
-
} catch (
|
|
1721
|
-
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);
|
|
1722
1731
|
}
|
|
1723
1732
|
return e;
|
|
1724
1733
|
}
|
|
1725
|
-
async function
|
|
1734
|
+
async function tt(a, t, r, s) {
|
|
1726
1735
|
let e = new m();
|
|
1727
1736
|
if (r.mail == "" || r.authority == "" || r.tid === "")
|
|
1728
1737
|
return e.result = !1, e.error = "adminPost: invalid argument", e.status = 500, e;
|
|
1729
|
-
let n =
|
|
1730
|
-
const o = await
|
|
1738
|
+
let n = y.adminEndpoint();
|
|
1739
|
+
const o = await S(a, t);
|
|
1731
1740
|
let d = `
|
|
1732
1741
|
{"email": "${r.mail}",
|
|
1733
1742
|
"tenantId": "${r.tid}",
|
|
@@ -1735,20 +1744,20 @@ async function st(a, t, r, s) {
|
|
|
1735
1744
|
}`, i = { method: "POST", headers: o, body: d };
|
|
1736
1745
|
try {
|
|
1737
1746
|
console.log("Attempting POST to /admin: " + n);
|
|
1738
|
-
let
|
|
1739
|
-
return
|
|
1740
|
-
} catch (
|
|
1741
|
-
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);
|
|
1742
1751
|
}
|
|
1743
1752
|
return e;
|
|
1744
1753
|
}
|
|
1745
|
-
async function
|
|
1754
|
+
async function st(a, t, r, s) {
|
|
1746
1755
|
a = a, t = t, s = s;
|
|
1747
1756
|
let e = new m();
|
|
1748
1757
|
if (r.id === "")
|
|
1749
1758
|
return e.result = !1, e.error = "auditConfigPost: invalid config ID", e.status = 500, e;
|
|
1750
|
-
let n =
|
|
1751
|
-
const o = await
|
|
1759
|
+
let n = y.auditConfigEndpoint();
|
|
1760
|
+
const o = await S(a, t);
|
|
1752
1761
|
let d = `
|
|
1753
1762
|
{
|
|
1754
1763
|
"workspaceId": "${r.workspaceId}",
|
|
@@ -1761,121 +1770,184 @@ async function rt(a, t, r, s) {
|
|
|
1761
1770
|
try {
|
|
1762
1771
|
if (s) debugger;
|
|
1763
1772
|
console.log("Attempting POST to /audit-configuration: " + n);
|
|
1764
|
-
let
|
|
1765
|
-
if (
|
|
1766
|
-
let u = await
|
|
1773
|
+
let l = await fetch(n, i);
|
|
1774
|
+
if (l.status === 200 && l.statusText === "OK") {
|
|
1775
|
+
let u = await l.json();
|
|
1767
1776
|
return r.id = u, console.log(
|
|
1768
1777
|
`Successful AuditConfigID: ${u} from POST to /audit-configuration: ${d}`
|
|
1769
1778
|
), e;
|
|
1770
1779
|
} else
|
|
1771
|
-
return e.error = await
|
|
1772
|
-
} catch (
|
|
1773
|
-
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);
|
|
1774
1805
|
}
|
|
1775
1806
|
return e;
|
|
1776
1807
|
}
|
|
1777
|
-
async function nt(a, t, r) {
|
|
1778
|
-
|
|
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;
|
|
1779
1832
|
}
|
|
1780
|
-
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) {
|
|
1781
1853
|
let s = new m();
|
|
1782
1854
|
if (t.mail == null || t.mail == "")
|
|
1783
1855
|
return s.result = !1, s.status = 500, s.error = "auditEventsGet: no user provided", s;
|
|
1784
|
-
let e =
|
|
1856
|
+
let e = y.auditEventsEndpoint(), n = new URL(e), d = { method: "GET", headers: await S(a, t) };
|
|
1785
1857
|
try {
|
|
1786
1858
|
if (r) debugger;
|
|
1787
1859
|
console.log("Attempting GET from /audit-events endpoint: " + n.href);
|
|
1788
1860
|
let i = await fetch(n.href, d);
|
|
1789
1861
|
if (i.status === 200 && i.statusText === "OK") {
|
|
1790
|
-
let
|
|
1791
|
-
if (Array.isArray(
|
|
1792
|
-
let u =
|
|
1862
|
+
let l = await i.json();
|
|
1863
|
+
if (Array.isArray(l.data)) {
|
|
1864
|
+
let u = l.data;
|
|
1793
1865
|
if (u != null)
|
|
1794
|
-
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;
|
|
1795
1867
|
}
|
|
1796
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;
|
|
1797
1869
|
} else
|
|
1798
|
-
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;
|
|
1799
1871
|
} catch (i) {
|
|
1800
1872
|
s.error = i.message, s.status = 500, s.result = !1, console.log(i.message);
|
|
1801
1873
|
}
|
|
1802
1874
|
return s;
|
|
1803
1875
|
}
|
|
1804
|
-
async function
|
|
1805
|
-
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);
|
|
1806
1878
|
d.searchParams.append("configurationId", r);
|
|
1807
|
-
const i = await
|
|
1808
|
-
let
|
|
1879
|
+
const i = await S(a, t);
|
|
1880
|
+
let l = `
|
|
1809
1881
|
{
|
|
1810
1882
|
"tenantId": "${s}",
|
|
1811
1883
|
"isReadPermissionConsented": ${e ? "true" : "false"}
|
|
1812
|
-
}`, u = { method: "PUT", headers: i, body:
|
|
1884
|
+
}`, u = { method: "PUT", headers: i, body: l };
|
|
1813
1885
|
try {
|
|
1814
1886
|
console.log("Attempting PUT read consent to /configuration/consent: " + d.href);
|
|
1815
1887
|
let f = await fetch(d.href, u);
|
|
1816
|
-
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);
|
|
1817
1889
|
} catch (f) {
|
|
1818
1890
|
n.error = f.message, n.status = 500, n.result = !1, console.log(f.message);
|
|
1819
1891
|
}
|
|
1820
1892
|
return n;
|
|
1821
1893
|
}
|
|
1822
|
-
async function
|
|
1823
|
-
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);
|
|
1824
1896
|
d.searchParams.append("configurationId", r);
|
|
1825
|
-
const i = await
|
|
1826
|
-
let
|
|
1897
|
+
const i = await S(a, t);
|
|
1898
|
+
let l = `
|
|
1827
1899
|
{
|
|
1828
1900
|
"tenantId": "${s}",
|
|
1829
1901
|
"isWritePermissionConsented": ${e ? "true" : "false"}
|
|
1830
|
-
}`, u = { method: "PUT", headers: i, body:
|
|
1902
|
+
}`, u = { method: "PUT", headers: i, body: l };
|
|
1831
1903
|
try {
|
|
1832
1904
|
console.log("Attempting PUT read consent to /configuration/consent: " + d.href);
|
|
1833
1905
|
let f = await fetch(d.href, u);
|
|
1834
|
-
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);
|
|
1835
1907
|
} catch (f) {
|
|
1836
1908
|
n.error = f.message, n.status = 500, n.result = !1, console.log(f.message);
|
|
1837
1909
|
}
|
|
1838
1910
|
return n;
|
|
1839
1911
|
}
|
|
1840
|
-
async function
|
|
1912
|
+
async function ct(a, t, r, s, e) {
|
|
1841
1913
|
let n = new m();
|
|
1842
1914
|
if (r.id === "" || s == "")
|
|
1843
1915
|
return n.result = !1, n.error = "configPost: invalid config ID", n.status = 500, n;
|
|
1844
1916
|
let o = null;
|
|
1845
|
-
o = new URL(
|
|
1846
|
-
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) };
|
|
1847
1919
|
try {
|
|
1848
1920
|
console.log("Attempting DELETE from /config: " + o.href);
|
|
1849
|
-
let
|
|
1850
|
-
return
|
|
1851
|
-
} catch (
|
|
1852
|
-
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);
|
|
1853
1925
|
}
|
|
1854
1926
|
return n;
|
|
1855
1927
|
}
|
|
1856
|
-
async function
|
|
1928
|
+
async function dt(a, t, r, s, e) {
|
|
1857
1929
|
let n = new m();
|
|
1858
1930
|
if (r === "")
|
|
1859
1931
|
return n.result = !1, n.error = "configPatch: invalid config ID", n.status = 500, n;
|
|
1860
|
-
let o =
|
|
1932
|
+
let o = y.configEnabledEndpoint(), d = new URL(o);
|
|
1861
1933
|
d.searchParams.append("configurationId", r), d.searchParams.append("isEnabled", s.toString());
|
|
1862
|
-
let
|
|
1934
|
+
let l = { method: "PATCH", headers: await S(a, t) };
|
|
1863
1935
|
try {
|
|
1864
1936
|
if (e) debugger;
|
|
1865
1937
|
console.log("Attempting PATCH to /config: " + d.href);
|
|
1866
|
-
let u = await fetch(d.href,
|
|
1867
|
-
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);
|
|
1868
1940
|
} catch (u) {
|
|
1869
1941
|
n.error = u.message, n.status = 500, n.result = !1, console.log(u.message);
|
|
1870
1942
|
}
|
|
1871
1943
|
return n;
|
|
1872
1944
|
}
|
|
1873
|
-
async function
|
|
1945
|
+
async function ut(a, t, r, s, e) {
|
|
1874
1946
|
let n = new m();
|
|
1875
1947
|
if (r.id === "")
|
|
1876
1948
|
return n.result = !1, n.error = "configPost: invalid config ID", n.status = 500, n;
|
|
1877
|
-
let o =
|
|
1878
|
-
const d = await
|
|
1949
|
+
let o = y.configEndpoint();
|
|
1950
|
+
const d = await S(a, t);
|
|
1879
1951
|
let i = `
|
|
1880
1952
|
{
|
|
1881
1953
|
"workspaceId": "${s}",
|
|
@@ -1884,39 +1956,39 @@ async function dt(a, t, r, s, e) {
|
|
|
1884
1956
|
"isEnabled": ${r.isEnabled},
|
|
1885
1957
|
"tenants": [`;
|
|
1886
1958
|
r.tenants.map((u) => {
|
|
1887
|
-
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";
|
|
1888
1960
|
i.slice(-1) === "}" && (i += ","), i += `{
|
|
1889
1961
|
"tenantId": "${u.tid}",
|
|
1890
1962
|
"sourceGroupId": ${f},
|
|
1891
|
-
"sourceGroupName": ${
|
|
1892
|
-
"targetGroupId": ${
|
|
1893
|
-
"targetGroupName": ${
|
|
1963
|
+
"sourceGroupName": ${$},
|
|
1964
|
+
"targetGroupId": ${A},
|
|
1965
|
+
"targetGroupName": ${E},
|
|
1894
1966
|
"configurationTenantType": "${u.configurationTenantType}"
|
|
1895
1967
|
}`;
|
|
1896
1968
|
}), i += "]}";
|
|
1897
|
-
let
|
|
1969
|
+
let l = { method: "POST", headers: d, body: i };
|
|
1898
1970
|
try {
|
|
1899
1971
|
if (e) debugger;
|
|
1900
1972
|
console.log("Attempting POST to /config: " + o);
|
|
1901
|
-
let u = await fetch(o,
|
|
1973
|
+
let u = await fetch(o, l);
|
|
1902
1974
|
if (u.status === 200 && u.statusText === "OK") {
|
|
1903
1975
|
let f = await u.json();
|
|
1904
1976
|
return r.id = f, console.log(
|
|
1905
1977
|
`Successful ConfigID: ${f} from POST to /config: ${i}`
|
|
1906
1978
|
), n;
|
|
1907
1979
|
} else
|
|
1908
|
-
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;
|
|
1909
1981
|
} catch (u) {
|
|
1910
1982
|
return n.status = 500, n.result = !1, n.error = u.message, console.log(n.error), n;
|
|
1911
1983
|
}
|
|
1912
1984
|
}
|
|
1913
|
-
async function
|
|
1985
|
+
async function ft(a, t, r, s) {
|
|
1914
1986
|
let e = new m();
|
|
1915
1987
|
if (r.id === "")
|
|
1916
1988
|
return e.result = !1, e.error = "configPost: invalid config ID", e.status = 500, e;
|
|
1917
|
-
let n =
|
|
1989
|
+
let n = y.configEndpoint(), o = new URL(n);
|
|
1918
1990
|
o.searchParams.append("configurationId", r.id);
|
|
1919
|
-
const d = await
|
|
1991
|
+
const d = await S(a, t);
|
|
1920
1992
|
let i = `
|
|
1921
1993
|
{
|
|
1922
1994
|
"name": "${r.name}",
|
|
@@ -1924,55 +1996,86 @@ async function ut(a, t, r, s) {
|
|
|
1924
1996
|
"tenants": [`;
|
|
1925
1997
|
r.tenants.map((u) => {
|
|
1926
1998
|
i.slice(-1) === "}" && (i += ",");
|
|
1927
|
-
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";
|
|
1928
2000
|
i += `{
|
|
1929
2001
|
"tenantId": "${u.tid}",
|
|
1930
|
-
"sourceGroupId": ${
|
|
1931
|
-
"sourceGroupName": ${
|
|
1932
|
-
"targetGroupId": ${
|
|
2002
|
+
"sourceGroupId": ${$},
|
|
2003
|
+
"sourceGroupName": ${A},
|
|
2004
|
+
"targetGroupId": ${E},
|
|
1933
2005
|
"targetGroupName": ${D},
|
|
1934
2006
|
"configurationTenantType": "${u.configurationTenantType}",
|
|
1935
2007
|
"deltaToken": "${u.deltaToken}"
|
|
1936
2008
|
}`;
|
|
1937
2009
|
}), i += "]}";
|
|
1938
|
-
let
|
|
2010
|
+
let l = { method: "PUT", headers: d, body: i };
|
|
1939
2011
|
try {
|
|
1940
2012
|
if (s) debugger;
|
|
1941
2013
|
console.log("Attempting PUT to /config: " + o.href);
|
|
1942
|
-
let u = await fetch(o.href,
|
|
1943
|
-
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);
|
|
1944
2016
|
} catch (u) {
|
|
1945
2017
|
e.error = u.message, e.status = 500, e.result = !1, console.log(u.message);
|
|
1946
2018
|
}
|
|
1947
2019
|
return e;
|
|
1948
2020
|
}
|
|
1949
|
-
async function
|
|
2021
|
+
async function pt(a, t, r, s) {
|
|
1950
2022
|
let e = new m();
|
|
1951
2023
|
if (r === "")
|
|
1952
2024
|
return e.result = !1, e.status = 500, e.error = "configsGet: no workspace provided", e;
|
|
1953
|
-
let n =
|
|
2025
|
+
let n = y.configsEndpoint(), o = new URL(n);
|
|
1954
2026
|
o.searchParams.append("workspaceId", r);
|
|
1955
|
-
let i = { method: "GET", headers: await
|
|
2027
|
+
let i = { method: "GET", headers: await S(a, t) };
|
|
1956
2028
|
try {
|
|
1957
2029
|
if (s) debugger;
|
|
1958
2030
|
console.log("Attempting GET from /configurations: " + o.href);
|
|
1959
|
-
let
|
|
1960
|
-
if (
|
|
1961
|
-
let u = await
|
|
1962
|
-
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);
|
|
1963
2035
|
} else
|
|
1964
|
-
return console.log(`Failed GET from /configurations: ${o.href}`), e.error = await
|
|
1965
|
-
} catch (
|
|
1966
|
-
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);
|
|
1967
2039
|
}
|
|
1968
2040
|
return e;
|
|
1969
2041
|
}
|
|
1970
|
-
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) {
|
|
1971
2074
|
let s = new m();
|
|
1972
2075
|
if (t.companyName === "" || t.companyDomain === "")
|
|
1973
2076
|
return s.result = !1, s.error = "initPost: invalid company name or domain", s.status = 500, s;
|
|
1974
|
-
let e =
|
|
1975
|
-
const n = await
|
|
2077
|
+
let e = y.initEndpoint();
|
|
2078
|
+
const n = await S(a, t);
|
|
1976
2079
|
let o = `
|
|
1977
2080
|
{
|
|
1978
2081
|
"tenantCreateModel": {
|
|
@@ -1987,123 +2090,123 @@ async function pt(a, t, r) {
|
|
|
1987
2090
|
if (r) debugger;
|
|
1988
2091
|
console.log("Attempting POST to /configuration/init: " + e);
|
|
1989
2092
|
let i = await fetch(e, d);
|
|
1990
|
-
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);
|
|
1991
2094
|
} catch (i) {
|
|
1992
2095
|
s.error = i.message, console.log(s.error);
|
|
1993
2096
|
}
|
|
1994
2097
|
return s.status = 500, s.result = !1, s;
|
|
1995
2098
|
}
|
|
1996
|
-
async function
|
|
2099
|
+
async function mt(a, t, r, s, e) {
|
|
1997
2100
|
let n = new m();
|
|
1998
2101
|
if (r.tid === "" || s === "")
|
|
1999
2102
|
return n.result = !1, n.error = "tenantDelete: invalid tid, workspaceId", n.status = 500, n;
|
|
2000
|
-
let o = new URL(
|
|
2103
|
+
let o = new URL(y.tenantEndpoint());
|
|
2001
2104
|
o.searchParams.append("tenantId", r.tid), o.searchParams.append("workspaceId", s);
|
|
2002
|
-
let i = { method: "DELETE", headers: await
|
|
2105
|
+
let i = { method: "DELETE", headers: await S(a, t) };
|
|
2003
2106
|
try {
|
|
2004
2107
|
console.log("Attempting DELETE from /tenant: " + o.href);
|
|
2005
|
-
let
|
|
2006
|
-
return
|
|
2007
|
-
} catch (
|
|
2008
|
-
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);
|
|
2009
2112
|
}
|
|
2010
2113
|
return n;
|
|
2011
2114
|
}
|
|
2012
|
-
async function
|
|
2115
|
+
async function yt(a, t, r, s) {
|
|
2013
2116
|
let e = new m();
|
|
2014
2117
|
if (r === "")
|
|
2015
2118
|
return e.result = !1, e.status = 500, e.error = "tenantsGet: no workspace provided", e;
|
|
2016
|
-
let n =
|
|
2119
|
+
let n = y.tenantsEndpoint(), o = new URL(n);
|
|
2017
2120
|
o.searchParams.append("workspaceId", r);
|
|
2018
|
-
let i = { method: "GET", headers: await
|
|
2121
|
+
let i = { method: "GET", headers: await S(a, t) };
|
|
2019
2122
|
try {
|
|
2020
2123
|
if (s) debugger;
|
|
2021
2124
|
console.log(`Attempting GET from /tenants: ${o.href}`);
|
|
2022
|
-
let
|
|
2023
|
-
if (
|
|
2024
|
-
let u = await
|
|
2025
|
-
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);
|
|
2026
2129
|
} else
|
|
2027
|
-
return console.log(`Failed GET from /tenants: ${o.href}`), e.error = await
|
|
2028
|
-
} catch (
|
|
2029
|
-
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);
|
|
2030
2133
|
}
|
|
2031
2134
|
return e;
|
|
2032
2135
|
}
|
|
2033
|
-
async function
|
|
2136
|
+
async function wt(a, t, r, s) {
|
|
2034
2137
|
let e = new m();
|
|
2035
2138
|
if (r.tid === "" || r.name === "" || r.domain === "")
|
|
2036
2139
|
return e.result = !1, e.error = "tenantPost: invalid tid, name, domain", e.status = 500, e;
|
|
2037
|
-
let n =
|
|
2140
|
+
let n = y.tenantEndpoint(), o = new URL(n);
|
|
2038
2141
|
o.searchParams.append("workspaceId", s);
|
|
2039
|
-
const d = await
|
|
2142
|
+
const d = await S(a, t);
|
|
2040
2143
|
let i = `
|
|
2041
2144
|
{"tenantId": "${r.tid}",
|
|
2042
2145
|
"name": "${r.name}",
|
|
2043
2146
|
"domain": "${r.domain}",
|
|
2044
2147
|
"type": 1,
|
|
2045
2148
|
"authority": "${r.authority}"
|
|
2046
|
-
}`,
|
|
2149
|
+
}`, l = { method: "POST", headers: d, body: i };
|
|
2047
2150
|
try {
|
|
2048
2151
|
console.log(`Attempting POST to ${o.href}: ${i}`);
|
|
2049
|
-
let u = await fetch(o.href,
|
|
2050
|
-
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);
|
|
2051
2154
|
} catch (u) {
|
|
2052
2155
|
e.error = u.message, e.status = 500, e.result = !1, console.log(e.error);
|
|
2053
2156
|
}
|
|
2054
2157
|
return e;
|
|
2055
2158
|
}
|
|
2056
|
-
async function
|
|
2159
|
+
async function Tt(a, t, r, s) {
|
|
2057
2160
|
let e = new m();
|
|
2058
2161
|
if (r == "" || s == "")
|
|
2059
2162
|
return e.result = !1, e.error = "workspacePut: invalid workspace ID or name", e.status = 500, e;
|
|
2060
|
-
let n =
|
|
2163
|
+
let n = y.workspaceEndpoint(), o = new URL(n);
|
|
2061
2164
|
o.searchParams.append("workspaceId", r), o.searchParams.append("workspaceName", s);
|
|
2062
|
-
let i = { method: "PUT", headers: await
|
|
2165
|
+
let i = { method: "PUT", headers: await S(a, t) };
|
|
2063
2166
|
try {
|
|
2064
2167
|
console.log("Attempting PUT to /workspace: " + o.href);
|
|
2065
|
-
let
|
|
2066
|
-
return
|
|
2067
|
-
} catch (
|
|
2068
|
-
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);
|
|
2069
2172
|
}
|
|
2070
2173
|
return e;
|
|
2071
2174
|
}
|
|
2072
|
-
async function
|
|
2175
|
+
async function St(a, t, r) {
|
|
2073
2176
|
let s = new m();
|
|
2074
2177
|
if (t.mail == null || t.mail == "")
|
|
2075
2178
|
return s.result = !1, s.status = 500, s.error = "adminsGet: no workspace provided", s;
|
|
2076
|
-
let e =
|
|
2179
|
+
let e = y.workspacesEndpoint(), n = new URL(e), d = { method: "GET", headers: await S(a, t) };
|
|
2077
2180
|
try {
|
|
2078
2181
|
if (r) debugger;
|
|
2079
2182
|
console.log("Attempting GET from /workspaces endpoint: " + n.href);
|
|
2080
2183
|
let i = await fetch(n.href, d);
|
|
2081
2184
|
if (i.status === 200 && i.statusText === "OK") {
|
|
2082
|
-
let
|
|
2083
|
-
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);
|
|
2084
2187
|
} else
|
|
2085
|
-
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;
|
|
2086
2189
|
} catch (i) {
|
|
2087
2190
|
s.error = i.message, s.status = 500, s.result = !1, console.log(i.message);
|
|
2088
2191
|
}
|
|
2089
2192
|
return s;
|
|
2090
2193
|
}
|
|
2091
|
-
async function
|
|
2194
|
+
async function bt(a, t, r) {
|
|
2092
2195
|
let s = new m();
|
|
2093
2196
|
if (a == null || t == null)
|
|
2094
2197
|
return s.result = !1, s.error = "readerPost: invalid parameters", s.status = 500, s;
|
|
2095
|
-
let e =
|
|
2198
|
+
let e = y.readerStartSyncEndpoint(), n = new URL(e);
|
|
2096
2199
|
n.searchParams.append("configurationId", r.id);
|
|
2097
|
-
let d = { method: "POST", headers: await
|
|
2200
|
+
let d = { method: "POST", headers: await S(a, t) };
|
|
2098
2201
|
try {
|
|
2099
2202
|
console.log("Attempting POST to /startSync: " + n.href);
|
|
2100
2203
|
let i = await fetch(n.href, d);
|
|
2101
2204
|
if (i.status === 200 && i.statusText === "OK") {
|
|
2102
2205
|
console.log(`Successful POST to /startSync: ${e}`);
|
|
2103
|
-
let
|
|
2104
|
-
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;
|
|
2105
2208
|
} else
|
|
2106
|
-
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;
|
|
2107
2210
|
} catch (i) {
|
|
2108
2211
|
s.error = i.message, s.status = 500, s.result = !1, console.log(i.message);
|
|
2109
2212
|
}
|
|
@@ -2111,86 +2214,91 @@ async function wt(a, t, r) {
|
|
|
2111
2214
|
}
|
|
2112
2215
|
export {
|
|
2113
2216
|
m as APIResult,
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
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,
|
|
2121
2224
|
Ue as MilestoneArray,
|
|
2122
2225
|
we as ResourceArray,
|
|
2123
|
-
|
|
2226
|
+
_e as ResourceNode,
|
|
2124
2227
|
Y as SyncConfig,
|
|
2125
2228
|
Q as Task,
|
|
2126
|
-
|
|
2229
|
+
Rt as TaskArray,
|
|
2127
2230
|
L as Tenant,
|
|
2128
|
-
|
|
2129
|
-
|
|
2231
|
+
Fe as TenantConfigInfo,
|
|
2232
|
+
We as TenantConfigType,
|
|
2130
2233
|
me as TenantNode,
|
|
2131
|
-
|
|
2234
|
+
xe as TenantPermissionType,
|
|
2132
2235
|
Ce as TenantType,
|
|
2133
2236
|
X as User,
|
|
2134
|
-
|
|
2237
|
+
Et as UserScope,
|
|
2135
2238
|
ee as Workspace,
|
|
2136
|
-
|
|
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
|
-
|
|
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,
|
|
2162
2269
|
F as getSyncVersion,
|
|
2163
2270
|
p as graphConfig,
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
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,
|
|
2185
2292
|
Te as tenantUnauthenticatedLookup,
|
|
2186
|
-
|
|
2187
|
-
|
|
2293
|
+
yt as tenantsGet,
|
|
2294
|
+
ts as userAdd,
|
|
2188
2295
|
Ke as userDelegatedScopesGet,
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
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
|
|
2195
2303
|
};
|
|
2196
2304
|
//# sourceMappingURL=sync.es.js.map
|