@mindline/sync 1.0.34 → 1.0.35
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 -1
- package/.vs/slnx.sqlite +0 -0
- package/.vs/sync/FileContentIndex/1fe38d21-0fca-4d45-9e42-8c354c1a37f7.vsidx +0 -0
- package/.vs/sync/v17/.wsuo +0 -0
- package/README.md +11 -7
- package/hybridspa.ts +8 -9
- package/index.d.ts +7 -5
- package/index.ts +7 -2
- package/package.json +1 -1
- package/.vs/sync/FileContentIndex/d66b84a1-9161-4980-846d-006358a14cf0.vsidx +0 -0
package/.vs/slnx.sqlite
CHANGED
|
Binary file
|
package/.vs/sync/v17/.wsuo
CHANGED
|
Binary file
|
package/README.md
CHANGED
|
@@ -17,13 +17,17 @@ npm install @azure/msal-browser --save
|
|
|
17
17
|
# 2. Latest releases
|
|
18
18
|
# 3. API references
|
|
19
19
|
# 4. Unit Test
|
|
20
|
-
|
|
20
|
+
|
|
21
|
+
npm test
|
|
21
22
|
# 6. Publish
|
|
22
|
-
|
|
23
|
-
username, password, OTP code required
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
|
|
24
|
+
username, password, OTP code required to publish package
|
|
25
|
+
|
|
26
|
+
npm login
|
|
27
|
+
npm version patch
|
|
28
|
+
npm publish --access=public --otp=XXXXXX
|
|
29
|
+
npm publish --dry-run
|
|
30
|
+
|
|
31
|
+
|
|
28
32
|
# 7. Contribute
|
|
29
33
|
TODO: Explain how other users and developers can contribute to make your code better.
|
package/hybridspa.ts
CHANGED
|
@@ -112,7 +112,6 @@ export async function adminDelete(
|
|
|
112
112
|
let url: URL | null = null;
|
|
113
113
|
if (user.oid !== user.mail) {
|
|
114
114
|
url = new URL(graphConfig.adminEndpoint);
|
|
115
|
-
url.searchParams.append("userId", user.oid);
|
|
116
115
|
url.searchParams.append("workspaceId", workspaceId);
|
|
117
116
|
}
|
|
118
117
|
// or of an incomplete admin?
|
|
@@ -414,13 +413,14 @@ export async function configPut(
|
|
|
414
413
|
// if last character is } we need a comma first
|
|
415
414
|
let needComma: boolean = configBody.slice(-1) === "}";
|
|
416
415
|
if (needComma) configBody += ",";
|
|
417
|
-
//
|
|
416
|
+
// TODO: more sophisticated source tenant user filtering
|
|
418
417
|
configBody += `{
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
418
|
+
"tenantId": "${tci.tid}",
|
|
419
|
+
"sourceGroupId": "${tci.sourceGroupId}",
|
|
420
|
+
"sourceGroupName": "${tci.sourceGroupName}",
|
|
421
|
+
"configurationTenantType": "${tci.configurationTenantType}",
|
|
422
|
+
"deltaToken": "${tci.deltaToken}"
|
|
423
|
+
}`;
|
|
424
424
|
});
|
|
425
425
|
configBody += `]}`;
|
|
426
426
|
let options = { method: "PUT", headers: headers, body: configBody };
|
|
@@ -805,9 +805,8 @@ export async function workspacesGet(
|
|
|
805
805
|
}
|
|
806
806
|
// create workspaces endpoint
|
|
807
807
|
let workspaceEndpoint: string = graphConfig.workspaceEndpoint;
|
|
808
|
-
//
|
|
808
|
+
// create workspace endpoint
|
|
809
809
|
let url: URL = new URL(workspaceEndpoint);
|
|
810
|
-
url.searchParams.append("userEmail", user.mail);
|
|
811
810
|
// create workspace headers
|
|
812
811
|
const headers = await defineHeaders(instance, authorizedUser);
|
|
813
812
|
// make workspace endpoint call
|
package/index.d.ts
CHANGED
|
@@ -63,10 +63,12 @@ declare module "@mindline/sync" {
|
|
|
63
63
|
}
|
|
64
64
|
export type TenantConfigTypeStrings = keyof typeof TenantConfigType;
|
|
65
65
|
export class TenantConfigInfo {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
66
|
+
tid: string; // tenant identifier
|
|
67
|
+
sourceGroupId: string; // source group - we can configure source group for reading
|
|
68
|
+
sourceGroupName: string; // source group - we can configure source group for reading
|
|
69
|
+
configurationTenantType: TenantConfigTypeStrings;
|
|
70
|
+
deltaToken: string;
|
|
71
|
+
filesWritten: number;
|
|
70
72
|
}
|
|
71
73
|
export class Config {
|
|
72
74
|
id: string;
|
|
@@ -136,7 +138,7 @@ declare module "@mindline/sync" {
|
|
|
136
138
|
constructor(config: Config|null, syncPortalGlobalState: InitInfo|null, bClearLocalStorage: boolean);
|
|
137
139
|
// populate tenantNodes based on config tenants
|
|
138
140
|
init(config: Config|null, syncPortalGlobalState: InitInfo|null, bClearLocalStorage: boolean): void;
|
|
139
|
-
startSync(instance: IPublicClientApplication, authorizedUser: User|undefined, config: Config|null|undefined): void;
|
|
141
|
+
startSync(instance: IPublicClientApplication, authorizedUser: User|null|undefined, config: Config|null|undefined): void;
|
|
140
142
|
}
|
|
141
143
|
export class TenantNode {
|
|
142
144
|
expanded: boolean;
|
package/index.ts
CHANGED
|
@@ -104,11 +104,15 @@ export class TenantConfigInfo {
|
|
|
104
104
|
sourceGroupId: string;
|
|
105
105
|
sourceGroupName: string;
|
|
106
106
|
configurationTenantType: TenantConfigTypeStrings;
|
|
107
|
+
deltaToken: string;
|
|
108
|
+
filesWritten: number;
|
|
107
109
|
constructor() {
|
|
108
110
|
this.tid = "";
|
|
109
111
|
this.sourceGroupId = "";
|
|
110
112
|
this.sourceGroupName = "";
|
|
111
113
|
this.configurationTenantType = "source";
|
|
114
|
+
this.deltaToken = "";
|
|
115
|
+
this.filesWritten = 0;
|
|
112
116
|
}
|
|
113
117
|
}
|
|
114
118
|
export class Config {
|
|
@@ -644,7 +648,7 @@ export class BatchArray {
|
|
|
644
648
|
}
|
|
645
649
|
*/
|
|
646
650
|
// cycle through test state machine
|
|
647
|
-
startSync(instance: IPublicClientApplication, authorizedUser: User | undefined, config: Config | null | undefined): void {
|
|
651
|
+
startSync(instance: IPublicClientApplication, authorizedUser: User | null | undefined, config: Config | null | undefined): void {
|
|
648
652
|
if (this.tenantNodes == null || this.tenantNodes.length == 0) {
|
|
649
653
|
// we should not have an empty batch array for a test
|
|
650
654
|
debugger;
|
|
@@ -982,7 +986,7 @@ export async function initGet(instance: IPublicClientApplication, authorizedUser
|
|
|
982
986
|
if (result.result) {
|
|
983
987
|
tasks.setTaskStart("GET workspaces", new Date());
|
|
984
988
|
result = await workspaceInfoGet(instance, authorizedUser, user, ii, debug);
|
|
985
|
-
tasks.setTaskEnd("GET workspaces", new Date(), result ? "complete" : "failed");
|
|
989
|
+
tasks.setTaskEnd("GET workspaces", new Date(), result.result ? "complete" : "failed");
|
|
986
990
|
}
|
|
987
991
|
if (result.result) result.error = version;
|
|
988
992
|
return result;
|
|
@@ -1104,6 +1108,7 @@ function processReturnedConfigs(workspace: Workspace, ii: InitInfo, returnedConf
|
|
|
1104
1108
|
tenantConfigInfo.sourceGroupId = tci.sourceGroupId;
|
|
1105
1109
|
tenantConfigInfo.sourceGroupName = tci.sourceGroupName;
|
|
1106
1110
|
tenantConfigInfo.configurationTenantType = tci.configurationTenantType.toLowerCase();
|
|
1111
|
+
tenantConfigInfo.deltaToken = tci.deltaToken ?? "";
|
|
1107
1112
|
config!.tenants.push(tenantConfigInfo);
|
|
1108
1113
|
});
|
|
1109
1114
|
// ensure this workspace tracks this config
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mindline/sync",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.35",
|
|
5
5
|
"types": "index.d.ts",
|
|
6
6
|
"exports": "./index.ts",
|
|
7
7
|
"description": "sync is a node.js package encapsulating javscript classes required for configuring Mindline sync service.",
|
|
Binary file
|