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