@mindline/sync 1.0.93 → 1.0.96
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 +1 -2
- package/.vs/slnx.sqlite +0 -0
- package/.vs/sync/CopilotIndices/17.14.260.54502/CodeChunks.db +0 -0
- package/.vs/sync/CopilotIndices/17.14.260.54502/SemanticSymbols.db +0 -0
- package/.vs/sync/FileContentIndex/267c956b-8e64-4ecf-8c7d-0d6e5c331215.vsidx +0 -0
- package/.vs/sync/FileContentIndex/2a74359a-b10f-4718-8feb-e05354e12eed.vsidx +0 -0
- package/.vs/sync/FileContentIndex/3ed24be5-ed12-4df5-a2f2-e78b9b8077e3.vsidx +0 -0
- package/.vs/sync/FileContentIndex/5fc42aa4-5090-4944-85e6-55a5c3f853b9.vsidx +0 -0
- package/.vs/sync/v17/.wsuo +0 -0
- package/.vs/sync/v17/DocumentLayout.backup.json +118 -8
- package/.vs/sync/v17/DocumentLayout.json +101 -7
- package/dist/index.d.ts +2 -348
- package/dist/src/index.d.ts +349 -0
- package/dist/sync.es.js +40 -36
- package/dist/sync.es.js.map +1 -1
- package/dist/sync.umd.js +2 -2
- package/dist/sync.umd.js.map +1 -1
- package/index.test.ts +1 -1
- package/package.json +3 -2
- package/src/index.d.ts +1 -0
- package/src/index.ts +13 -8
- package/tsconfig.json +1 -1
- package/vite.config.ts +24 -1
- package/.vs/sync/FileContentIndex/37cf3ba8-be62-4549-89ef-f092c9f43d47.vsidx +0 -0
- package/.vs/sync/FileContentIndex/b22d6a63-ec64-479e-b70a-dd1a66299e4c.vsidx +0 -0
- package/.vs/sync/FileContentIndex/d5a4b6e4-5645-45e1-8135-648e002a306d.vsidx +0 -0
- package/.vs/sync/FileContentIndex/f1c0dd18-8f11-493d-b452-9a59ff91ffb8.vsidx +0 -0
- /package/.vs/sync/FileContentIndex/{fee90bf7-9f86-4fc9-a06e-ccbbe7777bfe.vsidx → ab8f086b-3a2c-4783-bc6d-540828d1e0e1.vsidx} +0 -0
- /package/dist/{actors.json.d.ts → src/actors.json.d.ts} +0 -0
- /package/dist/{configs.json.d.ts → src/configs.json.d.ts} +0 -0
- /package/dist/{resources.json.d.ts → src/resources.json.d.ts} +0 -0
- /package/dist/{syncmilestones.json.d.ts → src/syncmilestones.json.d.ts} +0 -0
- /package/dist/{tenants.json.d.ts → src/tenants.json.d.ts} +0 -0
- /package/dist/{users.json.d.ts → src/users.json.d.ts} +0 -0
- /package/dist/{workspaces.json.d.ts → src/workspaces.json.d.ts} +0 -0
|
@@ -0,0 +1,349 @@
|
|
|
1
|
+
import { IPublicClientApplication } from '@azure/msal-browser';
|
|
2
|
+
export declare function sum(a: number, b: number): number;
|
|
3
|
+
export declare function helloNpm(): string;
|
|
4
|
+
export declare function getSyncVersion(): string;
|
|
5
|
+
export declare class APIResult {
|
|
6
|
+
result: boolean;
|
|
7
|
+
status: number;
|
|
8
|
+
error: string;
|
|
9
|
+
version: string;
|
|
10
|
+
array: Array<Object> | null;
|
|
11
|
+
constructor();
|
|
12
|
+
}
|
|
13
|
+
export declare class azureConfig {
|
|
14
|
+
static azureElevateAccess: string;
|
|
15
|
+
static azureListRootAssignments: string;
|
|
16
|
+
}
|
|
17
|
+
export declare class mindlineConfig {
|
|
18
|
+
static environmentTag: string;
|
|
19
|
+
static adminEndpoint(): string;
|
|
20
|
+
static adminIncompleteEndpoint(): string;
|
|
21
|
+
static adminsEndpoint(): string;
|
|
22
|
+
static configConsentEndpoint(): string;
|
|
23
|
+
static configEnabledEndpoint(): string;
|
|
24
|
+
static configEndpoint(): string;
|
|
25
|
+
static configsEndpoint(): string;
|
|
26
|
+
static initEndpoint(): string;
|
|
27
|
+
static readerStartSyncEndpoint(): string;
|
|
28
|
+
static tenantEndpoint(): string;
|
|
29
|
+
static tenantsEndpoint(): string;
|
|
30
|
+
static workspaceEndpoint(): string;
|
|
31
|
+
static workspacesEndpoint(): string;
|
|
32
|
+
static signalREndpoint(): string;
|
|
33
|
+
}
|
|
34
|
+
export declare class graphConfig {
|
|
35
|
+
static graphGroupsPredicate: string;
|
|
36
|
+
static graphMailPredicate: string;
|
|
37
|
+
static graphMePredicate: string;
|
|
38
|
+
static graphOauth2PermissionGrantsPredicate: string;
|
|
39
|
+
static graphServicePrincipalsPredicate: string;
|
|
40
|
+
static graphUsersPredicate: string;
|
|
41
|
+
static graphTenantByDomainPredicate: string;
|
|
42
|
+
static graphTenantByIdPredicate: string;
|
|
43
|
+
static authorityWW: string;
|
|
44
|
+
static authorityWWRegex: RegExp;
|
|
45
|
+
static authorityUS: string;
|
|
46
|
+
static authorityUSRegex: RegExp;
|
|
47
|
+
static authorityCN: string;
|
|
48
|
+
static authorityCNRegex: RegExp;
|
|
49
|
+
}
|
|
50
|
+
export declare class Group {
|
|
51
|
+
id: string;
|
|
52
|
+
displayName: string;
|
|
53
|
+
description: string;
|
|
54
|
+
}
|
|
55
|
+
export declare class UserScope {
|
|
56
|
+
group: string;
|
|
57
|
+
value: string;
|
|
58
|
+
consented: boolean;
|
|
59
|
+
removable: boolean;
|
|
60
|
+
expanded: string;
|
|
61
|
+
static compareByValue(a: UserScope, b: UserScope): number;
|
|
62
|
+
static compareByGroup(a: UserScope, b: UserScope): number;
|
|
63
|
+
}
|
|
64
|
+
export declare class User {
|
|
65
|
+
oid: string;
|
|
66
|
+
name: string;
|
|
67
|
+
mail: string;
|
|
68
|
+
authority: string;
|
|
69
|
+
tid: string;
|
|
70
|
+
companyName: string;
|
|
71
|
+
companyDomain: string;
|
|
72
|
+
workspaceIDs: string;
|
|
73
|
+
session: string;
|
|
74
|
+
spacode: string;
|
|
75
|
+
graphAccessToken: string;
|
|
76
|
+
mindlineAccessToken: string;
|
|
77
|
+
azureAccessToken: string;
|
|
78
|
+
loginHint: string;
|
|
79
|
+
scopes: string[];
|
|
80
|
+
authTS: Date;
|
|
81
|
+
sel: boolean;
|
|
82
|
+
loggingIn: boolean;
|
|
83
|
+
constructor();
|
|
84
|
+
}
|
|
85
|
+
export declare enum TenantType {
|
|
86
|
+
invalid = 0,
|
|
87
|
+
aad = 1,
|
|
88
|
+
ad = 2,
|
|
89
|
+
googleworkspace = 3
|
|
90
|
+
}
|
|
91
|
+
type TenantTypeStrings = keyof typeof TenantType;
|
|
92
|
+
export declare enum TenantPermissionType {
|
|
93
|
+
read = 1,
|
|
94
|
+
write = 2,
|
|
95
|
+
notassigned = 3
|
|
96
|
+
}
|
|
97
|
+
export type TenantPermissionTypeStrings = keyof typeof TenantPermissionType;
|
|
98
|
+
export declare class Tenant {
|
|
99
|
+
tid: string;
|
|
100
|
+
name: string;
|
|
101
|
+
domain: string;
|
|
102
|
+
tenantType: TenantTypeStrings;
|
|
103
|
+
authority: string;
|
|
104
|
+
workspaceIDs: string;
|
|
105
|
+
sel: boolean;
|
|
106
|
+
graphSP: string;
|
|
107
|
+
lookupfield: string;
|
|
108
|
+
constructor();
|
|
109
|
+
}
|
|
110
|
+
export declare enum TenantConfigType {
|
|
111
|
+
source = 1,
|
|
112
|
+
target = 2,
|
|
113
|
+
sourcetarget = 3
|
|
114
|
+
}
|
|
115
|
+
export type TenantConfigTypeStrings = keyof typeof TenantConfigType;
|
|
116
|
+
export declare class TenantConfigInfo {
|
|
117
|
+
tid: string;
|
|
118
|
+
sourceGroupId: string;
|
|
119
|
+
sourceGroupName: string;
|
|
120
|
+
targetGroupId: string;
|
|
121
|
+
targetGroupName: string;
|
|
122
|
+
configurationTenantType: TenantConfigTypeStrings;
|
|
123
|
+
deltaToken: string;
|
|
124
|
+
usersWritten: number;
|
|
125
|
+
configId: string;
|
|
126
|
+
batchId: string;
|
|
127
|
+
isReadPermissionConsented: boolean;
|
|
128
|
+
isWritePermissionConsented: boolean;
|
|
129
|
+
constructor();
|
|
130
|
+
}
|
|
131
|
+
export declare class Config {
|
|
132
|
+
id: string;
|
|
133
|
+
workspaceId: string;
|
|
134
|
+
name: string;
|
|
135
|
+
description: string;
|
|
136
|
+
tenants: TenantConfigInfo[];
|
|
137
|
+
isEnabled: boolean;
|
|
138
|
+
workspaceIDs: string;
|
|
139
|
+
sel: boolean;
|
|
140
|
+
constructor();
|
|
141
|
+
}
|
|
142
|
+
export declare class Workspace {
|
|
143
|
+
id: string;
|
|
144
|
+
name: string;
|
|
145
|
+
ownerid: string;
|
|
146
|
+
associatedUsers: string[];
|
|
147
|
+
associatedTenants: string[];
|
|
148
|
+
associatedConfigs: string[];
|
|
149
|
+
sel: boolean;
|
|
150
|
+
constructor();
|
|
151
|
+
}
|
|
152
|
+
export declare class InitInfo {
|
|
153
|
+
#private;
|
|
154
|
+
version: string;
|
|
155
|
+
tab: number;
|
|
156
|
+
us: User[];
|
|
157
|
+
ts: Tenant[];
|
|
158
|
+
cs: Config[];
|
|
159
|
+
ws: Workspace[];
|
|
160
|
+
configlevelconsent_configid: string;
|
|
161
|
+
configlevelconsent_access: TenantConfigType;
|
|
162
|
+
constructor(bClearLocalStorage?: boolean);
|
|
163
|
+
init(bClearLocalStorage: boolean): void;
|
|
164
|
+
save(): void;
|
|
165
|
+
tagWithWorkspaces(): boolean;
|
|
166
|
+
}
|
|
167
|
+
export type TaskType = "initialization" | "authenticate user" | "reload React" | "GET tenant details" | "POST config init" | "GET workspaces";
|
|
168
|
+
export declare class TaskArray {
|
|
169
|
+
#private;
|
|
170
|
+
tasks: Task[];
|
|
171
|
+
constructor(bClearLocalStorage: boolean);
|
|
172
|
+
init(bClearLocalStorage: boolean): void;
|
|
173
|
+
setTaskStart(taskType: TaskType, startDate: Date): void;
|
|
174
|
+
setTaskEnd(taskType: TaskType, endDate: Date, status: string): void;
|
|
175
|
+
}
|
|
176
|
+
export declare class Task {
|
|
177
|
+
id: number;
|
|
178
|
+
task: string;
|
|
179
|
+
start: Date;
|
|
180
|
+
startDisplay: string;
|
|
181
|
+
end: Date;
|
|
182
|
+
endDisplay: string;
|
|
183
|
+
elapsedDisplay: string;
|
|
184
|
+
expected: number;
|
|
185
|
+
status: string;
|
|
186
|
+
expanded: boolean;
|
|
187
|
+
subtasks: Task[];
|
|
188
|
+
setEnd(endDate: Date): void;
|
|
189
|
+
setStart(startDate: Date): void;
|
|
190
|
+
}
|
|
191
|
+
export declare class Milestone {
|
|
192
|
+
Run: number;
|
|
193
|
+
Start: Date;
|
|
194
|
+
startDisplay: string;
|
|
195
|
+
POST: Date;
|
|
196
|
+
postDisplay: string;
|
|
197
|
+
Read: Date;
|
|
198
|
+
readDisplay: string;
|
|
199
|
+
Write: Date;
|
|
200
|
+
writeDisplay: string;
|
|
201
|
+
Duration: Date;
|
|
202
|
+
durationDisplay: string;
|
|
203
|
+
constructor(run: number);
|
|
204
|
+
start(start: string): void;
|
|
205
|
+
post(post: string): void;
|
|
206
|
+
read(read: string): void;
|
|
207
|
+
write(write: string): void;
|
|
208
|
+
}
|
|
209
|
+
export declare class MilestoneArray {
|
|
210
|
+
#private;
|
|
211
|
+
milestones: Milestone[];
|
|
212
|
+
constructor(bClearLocalStorage: boolean);
|
|
213
|
+
init(bClearLocalStorage: boolean): void;
|
|
214
|
+
save(): void;
|
|
215
|
+
start(setMilestones: (milestones: Milestone[]) => void): void;
|
|
216
|
+
unstart(setMilestones: (milestones: Milestone[]) => void): void;
|
|
217
|
+
post(setMilestones: (milestones: Milestone[]) => void): void;
|
|
218
|
+
read(setMilestones: (milestones: Milestone[]) => void): void;
|
|
219
|
+
write(setMilestones: (milestones: Milestone[]) => void): void;
|
|
220
|
+
}
|
|
221
|
+
export declare class BatchArray {
|
|
222
|
+
tenantNodes: TenantNode[];
|
|
223
|
+
pb_startTS: number;
|
|
224
|
+
pb_progress: number;
|
|
225
|
+
pb_increment: number;
|
|
226
|
+
pb_idle: number;
|
|
227
|
+
pb_idleMax: number;
|
|
228
|
+
pb_total: number;
|
|
229
|
+
pb_timer: NodeJS.Timeout | null;
|
|
230
|
+
milestoneArray: MilestoneArray;
|
|
231
|
+
constructor(config: Config | null, syncPortalGlobalState: InitInfo | null, bClearLocalStorage: boolean);
|
|
232
|
+
init(config: Config | null | undefined, syncPortalGlobalState: InitInfo | null, bClearLocalStorage: boolean): void;
|
|
233
|
+
initializeProgressBar(setSyncProgress: (progress: number) => void, setConfigSyncResult: (result: string) => void, setIdleText: (idleText: string) => void, setMilestones: (milestones: Milestone[]) => void): void;
|
|
234
|
+
uninitializeProgressBar(setSyncProgress: (progress: number) => void, setConfigSyncResult: (result: string) => void, setIdleText: (idleText: string) => void, setMilestones: (milestones: Milestone[]) => void): void;
|
|
235
|
+
initializeSignalR(config: Config | null | undefined, syncPortalGlobalState: InitInfo | null, batchIdArray: Array<Object>, setRefreshDeltaTrigger: (workspace: string) => void, setReadersTotal: (readersTotal: number) => void, setReadersCurrent: (readersCurrent: number) => void, setWritersTotal: (writersTotal: number) => void, setWritersCurrent: (writersCurrent: number) => void, setMilestones: (milestones: Milestone[]) => void, setConfigSyncResult: (result: string) => void, bClearLocalStorage: boolean): void;
|
|
236
|
+
startSync(instance: IPublicClientApplication, authorizedUser: User | null | undefined, config: Config | null | undefined): Promise<APIResult>;
|
|
237
|
+
}
|
|
238
|
+
export declare class TenantNode {
|
|
239
|
+
expanded: boolean;
|
|
240
|
+
status: string;
|
|
241
|
+
name: string;
|
|
242
|
+
tid: string;
|
|
243
|
+
batchId: string;
|
|
244
|
+
total: number;
|
|
245
|
+
read: number;
|
|
246
|
+
written: number;
|
|
247
|
+
deferred: number;
|
|
248
|
+
nothingtosync: boolean;
|
|
249
|
+
targets: TenantNode[];
|
|
250
|
+
constructor(tid: string, name: string, batchId: string);
|
|
251
|
+
update(total: number, read: number, written: number, deferred: number): void;
|
|
252
|
+
}
|
|
253
|
+
export declare class ResourceArray {
|
|
254
|
+
resourceNodes: ResourceNode[];
|
|
255
|
+
constructor(bInitialize: boolean, bClearLocalStorage: boolean);
|
|
256
|
+
init(bClearLocalStorage: boolean): void;
|
|
257
|
+
read(instance: IPublicClientApplication, user: User): Promise<ResourceArray>;
|
|
258
|
+
save(): void;
|
|
259
|
+
}
|
|
260
|
+
export declare class ResourceNode {
|
|
261
|
+
type: string;
|
|
262
|
+
resource: string;
|
|
263
|
+
cost: number;
|
|
264
|
+
expanded: boolean;
|
|
265
|
+
resources: ResourceNode[];
|
|
266
|
+
constructor(type: string, resource: string, cost: number);
|
|
267
|
+
}
|
|
268
|
+
export declare class ActorArray {
|
|
269
|
+
actorNodes: ActorNode[];
|
|
270
|
+
constructor(bClearLocalStorage: boolean);
|
|
271
|
+
init(bClearLocalStorage: boolean): void;
|
|
272
|
+
}
|
|
273
|
+
export declare class ActorNode {
|
|
274
|
+
type: string;
|
|
275
|
+
actor: string;
|
|
276
|
+
resource: string;
|
|
277
|
+
role: string;
|
|
278
|
+
updatedby: string;
|
|
279
|
+
updatedon: string;
|
|
280
|
+
actors: ActorNode[];
|
|
281
|
+
constructor(type: string, actor: string, resource: string, role: string, updatedby: string, updatedon: string);
|
|
282
|
+
}
|
|
283
|
+
export declare function groupsGet(instance: IPublicClientApplication, user: User | undefined, groupSearchString: string): Promise<{
|
|
284
|
+
groups: Group[];
|
|
285
|
+
error: string;
|
|
286
|
+
}>;
|
|
287
|
+
export declare function oauth2PermissionGrantsGet(options: RequestInit, user: User, spid: string, oid: string): Promise<{
|
|
288
|
+
grants: string | null;
|
|
289
|
+
id: string | null;
|
|
290
|
+
error: string;
|
|
291
|
+
}>;
|
|
292
|
+
export declare function oauth2PermissionGrantsSet(instance: IPublicClientApplication, loggedInUser: User, id: string, scopes: string): Promise<boolean>;
|
|
293
|
+
export declare function requestAdminConsent(admin: User, tct: TenantConfigType): void;
|
|
294
|
+
export declare function servicePrincipalGet(options: RequestInit, user: User, appid: string): Promise<{
|
|
295
|
+
spid: string;
|
|
296
|
+
error: string;
|
|
297
|
+
}>;
|
|
298
|
+
export declare function signIn(user: User, tasks: TaskArray): Promise<boolean>;
|
|
299
|
+
export declare function signInIncrementally(user: User, scope: string): void;
|
|
300
|
+
export declare function signOut(user: User): Promise<boolean>;
|
|
301
|
+
export declare function tenantRelationshipsGetByDomain(loggedInUser: User, tenant: Tenant, instance: IPublicClientApplication, debug: boolean): Promise<boolean>;
|
|
302
|
+
export declare function tenantRelationshipsGetById(loggedInUser: User, tenant: Tenant, ii: InitInfo, instance: IPublicClientApplication, debug: boolean): Promise<boolean>;
|
|
303
|
+
export declare function tenantUnauthenticatedLookup(tenant: Tenant, debug: boolean): Promise<boolean>;
|
|
304
|
+
export declare function userDelegatedScopesGet(instance: IPublicClientApplication, loggedInUser: User, tenant: Tenant): Promise<{
|
|
305
|
+
scopes: string | null;
|
|
306
|
+
id: string | null;
|
|
307
|
+
error: string;
|
|
308
|
+
}>;
|
|
309
|
+
export declare function userDelegatedScopesRemove(instance: IPublicClientApplication, loggedInUser: User, tenant: Tenant, scope: string): Promise<boolean>;
|
|
310
|
+
export declare function usersGet(instance: IPublicClientApplication, user: User | undefined): Promise<{
|
|
311
|
+
users: string[];
|
|
312
|
+
error: string;
|
|
313
|
+
}>;
|
|
314
|
+
export declare function configEdit(instance: IPublicClientApplication, authorizedUser: User, config: Config, setConfigId: (id: string) => void, setSelectedConfigs: (selectedConfigs: {
|
|
315
|
+
[id: string]: boolean | number[];
|
|
316
|
+
}) => void, workspace: Workspace, ii: InitInfo, debug: boolean): Promise<APIResult>;
|
|
317
|
+
export declare function configEnable(instance: IPublicClientApplication, authorizedUser: User, configurationId: string, enabled: boolean, debug: boolean): Promise<APIResult>;
|
|
318
|
+
export declare function configRemove(instance: IPublicClientApplication, authorizedUser: User, config: Config, workspaceId: string, debug: boolean): Promise<APIResult>;
|
|
319
|
+
export declare function configConsentForRead(instance: IPublicClientApplication, authorizedUser: User, configId: string, tid: string, consent: boolean): Promise<APIResult>;
|
|
320
|
+
export declare function configConsentForWrite(instance: IPublicClientApplication, authorizedUser: User, configId: string, tid: string, consent: boolean): Promise<APIResult>;
|
|
321
|
+
export declare function configsRefresh(instance: IPublicClientApplication, authorizedUser: User, workspaceId: string, ii: InitInfo, debug: boolean): Promise<APIResult>;
|
|
322
|
+
export declare function initGet(instance: IPublicClientApplication, user: User, ii: InitInfo, tasks: TaskArray, debug: boolean): Promise<APIResult>;
|
|
323
|
+
export declare function tenantAdd(instance: IPublicClientApplication, authorizedUser: User, tenant: Tenant, workspaceId: string): Promise<APIResult>;
|
|
324
|
+
export declare function tenantRemove(instance: IPublicClientApplication, authorizedUser: User, tenant: Tenant, workspaceId: string, debug: boolean): Promise<APIResult>;
|
|
325
|
+
export declare function userAdd(instance: IPublicClientApplication, authorizedUser: User, user: User, workspaceId: string): Promise<APIResult>;
|
|
326
|
+
export declare function userRemove(instance: IPublicClientApplication, authorizedUser: User, user: User, workspaceId: string): Promise<APIResult>;
|
|
327
|
+
export declare function workspaceEdit(instance: IPublicClientApplication, authorizedUser: User, workspaceId: string, workspaceName: string): Promise<APIResult>;
|
|
328
|
+
export declare function getPowerBIAccessToken(instance: IPublicClientApplication, user: User): Promise<string>;
|
|
329
|
+
export declare function canListRootAssignments(instance: IPublicClientApplication, user: User): Promise<boolean>;
|
|
330
|
+
export declare function elevateGlobalAdminToUserAccessAdmin(instance: IPublicClientApplication, user: User): Promise<boolean>;
|
|
331
|
+
export declare function processErrors(response: Response): Promise<string>;
|
|
332
|
+
export declare function adminDelete(instance: IPublicClientApplication, authorizedUser: User, user: User, workspaceId: string): Promise<APIResult>;
|
|
333
|
+
export declare function adminsGet(instance: IPublicClientApplication, user: User, workspaceID: string, debug: boolean): Promise<APIResult>;
|
|
334
|
+
export declare function adminPost(instance: IPublicClientApplication, authorizedUser: User, user: User, workspaceId: string): Promise<APIResult>;
|
|
335
|
+
export declare function configConsentReadPut(instance: IPublicClientApplication, authorizedUser: User, configId: string, tid: string, consent: boolean): Promise<APIResult>;
|
|
336
|
+
export declare function configConsentWritePut(instance: IPublicClientApplication, authorizedUser: User, configId: string, tid: string, consent: boolean): Promise<APIResult>;
|
|
337
|
+
export declare function configDelete(instance: IPublicClientApplication, authorizedUser: User, config: Config, workspaceId: string, debug: boolean): Promise<APIResult>;
|
|
338
|
+
export declare function configPatch(instance: IPublicClientApplication, authorizedUser: User, configurationId: string, enabled: boolean, debug: boolean): Promise<APIResult>;
|
|
339
|
+
export declare function configPost(instance: IPublicClientApplication, authorizedUser: User, config: Config, workspaceId: string, debug: boolean): Promise<APIResult>;
|
|
340
|
+
export declare function configPut(instance: IPublicClientApplication, authorizedUser: User, config: Config, debug: boolean): Promise<APIResult>;
|
|
341
|
+
export declare function configsGet(instance: IPublicClientApplication, user: User, workspaceID: string, debug: boolean): Promise<APIResult>;
|
|
342
|
+
export declare function initPost(instance: IPublicClientApplication, user: User, debug: boolean): Promise<APIResult>;
|
|
343
|
+
export declare function tenantDelete(instance: IPublicClientApplication, authorizedUser: User, tenant: Tenant, workspaceId: string, debug: boolean): Promise<APIResult>;
|
|
344
|
+
export declare function tenantsGet(instance: IPublicClientApplication, user: User, workspaceID: string, debug: boolean): Promise<APIResult>;
|
|
345
|
+
export declare function tenantPost(instance: IPublicClientApplication, addingUser: User, tenant: Tenant, workspaceId: string): Promise<APIResult>;
|
|
346
|
+
export declare function workspacePut(instance: IPublicClientApplication, authorizedUser: User, workspaceId: string, workspaceName: string): Promise<APIResult>;
|
|
347
|
+
export declare function workspacesGet(instance: IPublicClientApplication, user: User, debug: boolean): Promise<APIResult>;
|
|
348
|
+
export declare function readerPost(instance: IPublicClientApplication, authorizedUser: User, config: Config): Promise<APIResult>;
|
|
349
|
+
export {};
|
package/dist/sync.es.js
CHANGED
|
@@ -4,11 +4,11 @@ var ge = (a) => {
|
|
|
4
4
|
};
|
|
5
5
|
var $e = (a, t, s) => t in a ? Ae(a, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : a[t] = s;
|
|
6
6
|
var l = (a, t, s) => $e(a, typeof t != "symbol" ? t + "" : t, s), ke = (a, t, s) => t.has(a) || ge("Cannot " + s);
|
|
7
|
-
var
|
|
7
|
+
var j = (a, t, s) => t.has(a) ? ge("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(a) : t.set(a, s);
|
|
8
8
|
var E = (a, t, s) => (ke(a, t, "access private method"), s);
|
|
9
|
-
import * as
|
|
9
|
+
import * as H from "@microsoft/signalr";
|
|
10
10
|
import { deserializeArray as W } from "class-transformer";
|
|
11
|
-
const
|
|
11
|
+
const De = [
|
|
12
12
|
{
|
|
13
13
|
oid: "1",
|
|
14
14
|
name: "",
|
|
@@ -146,6 +146,9 @@ function wt(a, t) {
|
|
|
146
146
|
function Tt() {
|
|
147
147
|
return "hello NPM";
|
|
148
148
|
}
|
|
149
|
+
function B() {
|
|
150
|
+
return "1.0.95";
|
|
151
|
+
}
|
|
149
152
|
class y {
|
|
150
153
|
constructor() {
|
|
151
154
|
l(this, "result");
|
|
@@ -153,13 +156,13 @@ class y {
|
|
|
153
156
|
l(this, "error");
|
|
154
157
|
l(this, "version");
|
|
155
158
|
l(this, "array");
|
|
156
|
-
this.result = !0, this.status = 200, this.error = "", this.version =
|
|
159
|
+
this.result = !0, this.status = 200, this.error = "", this.version = B(), this.array = null;
|
|
157
160
|
}
|
|
158
161
|
}
|
|
159
|
-
class
|
|
162
|
+
class U {
|
|
160
163
|
}
|
|
161
164
|
// azure graph REST API endpoints
|
|
162
|
-
l(
|
|
165
|
+
l(U, "azureElevateAccess", "https://management.azure.com/providers/Microsoft.Authorization/elevateAccess?api-version=2016-07-01"), l(U, "azureListRootAssignments", "https://management.azure.com/providers/Microsoft.Authorization/roleAssignments?api-version=2022-04-01&$filter=principalId+eq+");
|
|
163
166
|
const $ = class $ {
|
|
164
167
|
// config API endpoints
|
|
165
168
|
static adminEndpoint() {
|
|
@@ -269,7 +272,7 @@ class X {
|
|
|
269
272
|
}
|
|
270
273
|
}
|
|
271
274
|
var Ne = /* @__PURE__ */ ((a) => (a[a.invalid = 0] = "invalid", a[a.aad = 1] = "aad", a[a.ad = 2] = "ad", a[a.googleworkspace = 3] = "googleworkspace", a))(Ne || {}), Ce = /* @__PURE__ */ ((a) => (a[a.read = 1] = "read", a[a.write = 2] = "write", a[a.notassigned = 3] = "notassigned", a))(Ce || {});
|
|
272
|
-
class
|
|
275
|
+
class L {
|
|
273
276
|
// are we validating by TID or by domain? "Domain" | "Tenant ID"
|
|
274
277
|
constructor() {
|
|
275
278
|
l(this, "tid");
|
|
@@ -389,8 +392,8 @@ function x() {
|
|
|
389
392
|
var q, ye;
|
|
390
393
|
class It {
|
|
391
394
|
constructor(t = !1) {
|
|
392
|
-
|
|
393
|
-
l(this, "version",
|
|
395
|
+
j(this, q);
|
|
396
|
+
l(this, "version", B());
|
|
394
397
|
l(this, "tab", 0);
|
|
395
398
|
l(this, "us", []);
|
|
396
399
|
l(this, "ts", []);
|
|
@@ -415,10 +418,10 @@ class It {
|
|
|
415
418
|
}
|
|
416
419
|
}
|
|
417
420
|
}
|
|
418
|
-
this.tab = 0, this.version =
|
|
421
|
+
this.tab = 0, this.version = B(), this.configlevelconsent_configid = "", this.configlevelconsent_access = 3;
|
|
419
422
|
var s = JSON.stringify(De), r = JSON.stringify(Re), e = JSON.stringify(Pe), n = JSON.stringify(ve);
|
|
420
423
|
try {
|
|
421
|
-
this.us = W(X, s), this.ts = W(
|
|
424
|
+
this.us = W(X, s), this.ts = W(L, r), this.cs = W(Y, e), this.ws = W(ee, n), this.tagWithWorkspaces();
|
|
422
425
|
} catch {
|
|
423
426
|
debugger;
|
|
424
427
|
}
|
|
@@ -456,11 +459,11 @@ class It {
|
|
|
456
459
|
}
|
|
457
460
|
}
|
|
458
461
|
q = new WeakSet(), ye = function(t) {
|
|
459
|
-
this.tab = t.tab, this.configlevelconsent_configid = t.configlevelconsent_configid, this.configlevelconsent_access = t.configlevelconsent_access, typeof t.us > "u" ? this.us = new Array() : this.us = t.us.map((s) => {
|
|
462
|
+
this.tab = t.tab, this.version = B(), this.configlevelconsent_configid = t.configlevelconsent_configid, this.configlevelconsent_access = t.configlevelconsent_access, typeof t.us > "u" ? this.us = new Array() : this.us = t.us.map((s) => {
|
|
460
463
|
let r = new X();
|
|
461
464
|
return r.oid = s.oid, r.name = s.name, r.mail = s.mail, r.authority = s.authority, r.tid = s.tid, r.companyName = s.companyName, r.companyDomain = s.companyDomain, r.workspaceIDs = s.workspaceIDs, r.session = s.session, r.spacode = s.spacode, r.graphAccessToken = s.graphAccessToken, r.mindlineAccessToken = s.mindlineAccessToken, r.azureAccessToken = s.azureAccessToken, r.loginHint = s.loginHint, r.scopes = s.scopes, r.authTS = new Date(s.authTS), r.sel = s.sel, r.loggingIn = s.loggingIn, r;
|
|
462
465
|
}), typeof t.ts > "u" ? this.ts = new Array() : this.ts = t.ts.map((s) => {
|
|
463
|
-
let r = new
|
|
466
|
+
let r = new L();
|
|
464
467
|
return r.tid = s.tid, r.name = s.name, r.domain = s.domain, r.tenantType = s.tenantType, r.authority = s.authority, r.workspaceIDs = s.workspaceIDs, r.sel = s.sel, r.lookupfield = s.lookupfield, r;
|
|
465
468
|
}), typeof t.cs > "u" ? this.cs = new Array() : this.cs = t.cs.map((s) => {
|
|
466
469
|
let r = new Y();
|
|
@@ -526,7 +529,7 @@ const Be = [
|
|
|
526
529
|
var v, te, se, re;
|
|
527
530
|
class At {
|
|
528
531
|
constructor(t) {
|
|
529
|
-
|
|
532
|
+
j(this, v);
|
|
530
533
|
l(this, "tasks");
|
|
531
534
|
this.tasks = [new Q()], this.init(t);
|
|
532
535
|
}
|
|
@@ -634,10 +637,10 @@ class _ {
|
|
|
634
637
|
t == "" ? this.Write = /* @__PURE__ */ new Date() : this.Write = new Date(t), 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")}`;
|
|
635
638
|
}
|
|
636
639
|
}
|
|
637
|
-
var
|
|
640
|
+
var z, ne;
|
|
638
641
|
class Ue {
|
|
639
642
|
constructor(t) {
|
|
640
|
-
|
|
643
|
+
j(this, z);
|
|
641
644
|
l(this, "milestones", []);
|
|
642
645
|
this.init(t);
|
|
643
646
|
}
|
|
@@ -650,12 +653,12 @@ class Ue {
|
|
|
650
653
|
if (t)
|
|
651
654
|
localStorage.removeItem("syncmilestones");
|
|
652
655
|
else {
|
|
653
|
-
E(this,
|
|
656
|
+
E(this, z, ne).call(this, e);
|
|
654
657
|
return;
|
|
655
658
|
}
|
|
656
659
|
}
|
|
657
660
|
}
|
|
658
|
-
E(this,
|
|
661
|
+
E(this, z, ne).call(this, Ge);
|
|
659
662
|
}
|
|
660
663
|
save() {
|
|
661
664
|
let t = JSON.stringify(this.milestones);
|
|
@@ -713,7 +716,7 @@ class Ue {
|
|
|
713
716
|
}), t(this.milestones);
|
|
714
717
|
}
|
|
715
718
|
}
|
|
716
|
-
|
|
719
|
+
z = new WeakSet(), ne = function(t) {
|
|
717
720
|
t == null ? this.milestones = new Array() : this.milestones = t.map((s) => {
|
|
718
721
|
let r = new _(Number(s.Run));
|
|
719
722
|
return r.start(s.Start), r.post(s.POST), r.read(s.Read), r.write(s.Write), r;
|
|
@@ -809,10 +812,10 @@ class $t {
|
|
|
809
812
|
h.batchId = D.BatchId;
|
|
810
813
|
let A = R.Stats, m = Object.keys(A), P = Object.values(A), oe = !1, ie = !1;
|
|
811
814
|
for (let g = 0; g < m.length; g++) {
|
|
812
|
-
let G = m[g].endsWith("TotalCount"),
|
|
815
|
+
let G = m[g].endsWith("TotalCount"), M = m[g].endsWith("CurrentCount"), F = m[g].endsWith("DeferredCount"), V = m[g].endsWith("RescheduledCount");
|
|
813
816
|
if (m[g].startsWith("Reader")) {
|
|
814
817
|
let N = /Reader\/TID:(.+)\/TotalCount/;
|
|
815
|
-
if (
|
|
818
|
+
if (M && (N = /Reader\/TID:(.+)\/CurrentCount/), F && (N = /Reader\/TID:(.+)\/DeferredCount/), V && (N = /Reader\/TID:(.+)\/RescheduledCount/), m[g].match(N) == null) {
|
|
816
819
|
console.log(`tid not found in ${m[g]}.`);
|
|
817
820
|
debugger;
|
|
818
821
|
return;
|
|
@@ -821,7 +824,7 @@ class $t {
|
|
|
821
824
|
}
|
|
822
825
|
if (h.nothingtosync = oe && ie, m[g].startsWith("Writer")) {
|
|
823
826
|
let N = /Writer\/TID:(.+)\/TotalCount/;
|
|
824
|
-
|
|
827
|
+
M && (N = /Writer\/TID:(.+)\/CurrentCount/), F && (N = /Writer\/TID:(.+)\/DeferredCount/), V && (N = /Writer\/TID:(.+)\/RescheduledCount/);
|
|
825
828
|
let Z = m[g].match(N);
|
|
826
829
|
if (Z == null) {
|
|
827
830
|
console.log(`tid not found in ${m[g]}.`);
|
|
@@ -836,7 +839,7 @@ class $t {
|
|
|
836
839
|
}
|
|
837
840
|
if (w.batchId = D.BatchId, G)
|
|
838
841
|
w.total = Math.max(Number(P[g]), w.total), console.log(`----- ${w.name} TID: ${w.tid} batchId: ${w.batchId}`), console.log(`----- ${w.name} Total To Write: ${w.total}`);
|
|
839
|
-
else if (
|
|
842
|
+
else if (M)
|
|
840
843
|
w.written = Math.max(Number(P[g]), w.written), console.log(`----- ${w.name} Total Written: ${w.written}`);
|
|
841
844
|
else if (F || V)
|
|
842
845
|
w.deferred = Math.max(Number(P[g]), w.deferred), console.log(`----- ${w.name} Total Deferred: ${w.deferred}`);
|
|
@@ -869,11 +872,11 @@ class $t {
|
|
|
869
872
|
const R = T.signalREndpoint();
|
|
870
873
|
let D = new URL(R);
|
|
871
874
|
D.searchParams.append("statsId", I.BatchId), console.log(`Creating SignalR Hub for TID: ${I.SourceId} ${D.href}`);
|
|
872
|
-
const h = new
|
|
875
|
+
const h = new H.HubConnectionBuilder().withUrl(D.href).withAutomaticReconnect().configureLogging(H.LogLevel.Information).build();
|
|
873
876
|
h.on("newMessage", b), h.onreconnecting((A) => {
|
|
874
|
-
console.assert(h.state ===
|
|
877
|
+
console.assert(h.state === H.HubConnectionState.Reconnecting), console.log(`Connection lost due to error "${A}". Reconnecting.`);
|
|
875
878
|
}), h.onreconnected((A) => {
|
|
876
|
-
console.assert(h.state ===
|
|
879
|
+
console.assert(h.state === H.HubConnectionState.Connected), console.log(`Connection reestablished. Connected with connectionId "${A}".`);
|
|
877
880
|
}), h.onclose(async () => {
|
|
878
881
|
console.log("Connection closing. Attempting restart."), await h.start();
|
|
879
882
|
}), h.start().catch(console.error);
|
|
@@ -1101,7 +1104,7 @@ async function qe(a, t, s) {
|
|
|
1101
1104
|
}
|
|
1102
1105
|
async function Pt(a, t) {
|
|
1103
1106
|
if (a.authority == "") {
|
|
1104
|
-
let e = new
|
|
1107
|
+
let e = new L();
|
|
1105
1108
|
if (e.domain = a.tid, await Te(e, !1))
|
|
1106
1109
|
a.authority = e.authority;
|
|
1107
1110
|
else {
|
|
@@ -1386,8 +1389,8 @@ async function Ut(a, t, s, r, e) {
|
|
|
1386
1389
|
let n = new y();
|
|
1387
1390
|
if (e)
|
|
1388
1391
|
debugger;
|
|
1389
|
-
let o = new
|
|
1390
|
-
return o.tid = t.tid, o.domain = t.tid, await Te(o, e) ? (t.authority = o.authority, r.setTaskStart("GET tenant details", /* @__PURE__ */ new Date()), n.result = await Je(t, o, s, a, e), r.setTaskEnd("GET tenant details", /* @__PURE__ */ new Date(), "complete"), n.result && (t.companyName = o.name, t.companyDomain = o.domain, r.setTaskStart("POST config init", /* @__PURE__ */ new Date()), n = await ct(a, t, e), r.setTaskEnd("POST config init", /* @__PURE__ */ new Date(), n.result ? "complete" : "failed")), n.result && (r.setTaskStart("GET workspaces", /* @__PURE__ */ new Date()), n = await Qe(a, t, s, e), r.setTaskEnd("GET workspaces", /* @__PURE__ */ new Date(), n.result ? "complete" : "failed")), console.log("initGet complete. Version: " +
|
|
1392
|
+
let o = new L();
|
|
1393
|
+
return o.tid = t.tid, o.domain = t.tid, await Te(o, e) ? (t.authority = o.authority, r.setTaskStart("GET tenant details", /* @__PURE__ */ new Date()), n.result = await Je(t, o, s, a, e), r.setTaskEnd("GET tenant details", /* @__PURE__ */ new Date(), "complete"), n.result && (t.companyName = o.name, t.companyDomain = o.domain, r.setTaskStart("POST config init", /* @__PURE__ */ new Date()), n = await ct(a, t, e), r.setTaskEnd("POST config init", /* @__PURE__ */ new Date(), n.result ? "complete" : "failed")), n.result && (r.setTaskStart("GET workspaces", /* @__PURE__ */ new Date()), n = await Qe(a, t, s, e), r.setTaskEnd("GET workspaces", /* @__PURE__ */ new Date(), n.result ? "complete" : "failed")), console.log("initGet complete. Version: " + B()), n) : (n.error = `Failed to retrieve authority for user "${t.mail}" TID ${t.tid}.`, n.result = !1, n);
|
|
1391
1394
|
}
|
|
1392
1395
|
async function Lt(a, t, s, r) {
|
|
1393
1396
|
return pt(a, t, s, r);
|
|
@@ -1432,7 +1435,7 @@ function Ze(a, t, s, r) {
|
|
|
1432
1435
|
let f = a.associatedTenants.findIndex((b) => b == "1");
|
|
1433
1436
|
f !== -1 && (a.associatedTenants.splice(f, 1), a.associatedTenants.push(e.tenantId));
|
|
1434
1437
|
} else
|
|
1435
|
-
n = new
|
|
1438
|
+
n = new L(), t.ts.push(n);
|
|
1436
1439
|
} else
|
|
1437
1440
|
n = t.ts.at(o);
|
|
1438
1441
|
n.sel = r === e.tenantId, n.tid = e.tenantId, n.name = e.name, n.domain = e.domain, n.tenantType = e.type.toLowerCase();
|
|
@@ -1486,7 +1489,7 @@ async function Qe(a, t, s, r) {
|
|
|
1486
1489
|
let m = s.cs.find((P) => P.id === A);
|
|
1487
1490
|
m != null && m.sel && (u = m.id);
|
|
1488
1491
|
}
|
|
1489
|
-
o.associatedUsers.length = 0, o.associatedTenants.length = 0, o.associatedConfigs.length = 0, o.id = n.id, o.name = n.name, o.ownerid = n.
|
|
1492
|
+
o.associatedUsers.length = 0, o.associatedTenants.length = 0, o.associatedConfigs.length = 0, o.id = n.id, o.name = n.name, o.ownerid = n.workspaceOwnerUserId;
|
|
1490
1493
|
let f = tt(a, t, o.id, r), b = ut(a, t, o.id, r), I = be(a, t, o.id, r), [R, D, h] = await Promise.all([f, b, I]);
|
|
1491
1494
|
if (!R.result) return R;
|
|
1492
1495
|
if (!D.result) return D;
|
|
@@ -1552,7 +1555,7 @@ async function Jt(a, t) {
|
|
|
1552
1555
|
if (t == null || t.spacode == "")
|
|
1553
1556
|
return !1;
|
|
1554
1557
|
try {
|
|
1555
|
-
let r = { method: "GET", headers: await ae(a, t) }, e =
|
|
1558
|
+
let r = { method: "GET", headers: await ae(a, t) }, e = U.azureListRootAssignments;
|
|
1556
1559
|
e += "'", e += t.oid, e += "'";
|
|
1557
1560
|
let n = await fetch(e, r);
|
|
1558
1561
|
if (n.status == 200) {
|
|
@@ -1571,7 +1574,7 @@ async function Kt(a, t) {
|
|
|
1571
1574
|
if (t == null || t.spacode == "")
|
|
1572
1575
|
return !1;
|
|
1573
1576
|
try {
|
|
1574
|
-
let r = { method: "POST", headers: await ae(a, t) }, e =
|
|
1577
|
+
let r = { method: "POST", headers: await ae(a, t) }, e = U.azureElevateAccess, n = await fetch(e, r);
|
|
1575
1578
|
if (n.status == 200)
|
|
1576
1579
|
console.log("Successful call to Azure Resource Graph list root assignments");
|
|
1577
1580
|
else
|
|
@@ -1586,7 +1589,7 @@ async function Xe(a, t) {
|
|
|
1586
1589
|
if (t == null || t.spacode == "")
|
|
1587
1590
|
return s;
|
|
1588
1591
|
try {
|
|
1589
|
-
let e = { method: "GET", headers: await ae(a, t) }, n =
|
|
1592
|
+
let e = { method: "GET", headers: await ae(a, t) }, n = U.azureListRootAssignments;
|
|
1590
1593
|
n += "'", n += t.oid, n += "'";
|
|
1591
1594
|
let o = await fetch(n, e);
|
|
1592
1595
|
if (o.status == 200) {
|
|
@@ -2031,7 +2034,7 @@ export {
|
|
|
2031
2034
|
Le as ResourceNode,
|
|
2032
2035
|
Q as Task,
|
|
2033
2036
|
At as TaskArray,
|
|
2034
|
-
|
|
2037
|
+
L as Tenant,
|
|
2035
2038
|
_e as TenantConfigInfo,
|
|
2036
2039
|
Fe as TenantConfigType,
|
|
2037
2040
|
me as TenantNode,
|
|
@@ -2043,7 +2046,7 @@ export {
|
|
|
2043
2046
|
et as adminDelete,
|
|
2044
2047
|
st as adminPost,
|
|
2045
2048
|
tt as adminsGet,
|
|
2046
|
-
|
|
2049
|
+
U as azureConfig,
|
|
2047
2050
|
Jt as canListRootAssignments,
|
|
2048
2051
|
Ft as configConsentForRead,
|
|
2049
2052
|
_t as configConsentForWrite,
|
|
@@ -2060,6 +2063,7 @@ export {
|
|
|
2060
2063
|
Bt as configsRefresh,
|
|
2061
2064
|
Kt as elevateGlobalAdminToUserAccessAdmin,
|
|
2062
2065
|
qt as getPowerBIAccessToken,
|
|
2066
|
+
B as getSyncVersion,
|
|
2063
2067
|
p as graphConfig,
|
|
2064
2068
|
Dt as groupsGet,
|
|
2065
2069
|
Tt as helloNpm,
|