cueloop 0.1.0-alpha.26 → 0.1.0-alpha.28
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cueloop",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.28",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
".": "./src/main.ts"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@cueloop/schema": "0.1.0-alpha.
|
|
14
|
-
"@cueloop/daemon": "0.1.0-alpha.
|
|
15
|
-
"@cueloop/client": "0.1.0-alpha.
|
|
13
|
+
"@cueloop/schema": "0.1.0-alpha.28",
|
|
14
|
+
"@cueloop/daemon": "0.1.0-alpha.28",
|
|
15
|
+
"@cueloop/client": "0.1.0-alpha.28"
|
|
16
16
|
},
|
|
17
17
|
"publishConfig": {
|
|
18
18
|
"access": "public"
|
|
@@ -33,10 +33,10 @@ function fakeClient(sessions: ReviewSession[]): SessionClient {
|
|
|
33
33
|
session.shareId = shareId;
|
|
34
34
|
return session;
|
|
35
35
|
}),
|
|
36
|
-
|
|
36
|
+
sessionMergeShared: mock(async (id: string, incoming: { annotations: Annotation[] }) => {
|
|
37
37
|
const session = sessions.find((candidate) => candidate.id === id)!;
|
|
38
38
|
const known = new Set(session.annotations.map((annotation) => annotation.id));
|
|
39
|
-
for (const annotation of incoming) if (!known.has(annotation.id)) session.annotations.push(annotation);
|
|
39
|
+
for (const annotation of incoming.annotations) if (!known.has(annotation.id)) session.annotations.push(annotation);
|
|
40
40
|
return session;
|
|
41
41
|
}),
|
|
42
42
|
} as unknown as SessionClient;
|
package/src/share-command.ts
CHANGED
|
@@ -77,7 +77,10 @@ export async function pullSession(client: SessionClient, params: ShareParams, de
|
|
|
77
77
|
}
|
|
78
78
|
const remote = await deps.pull(session.shareId!, { host: params.host, port: params.port });
|
|
79
79
|
const before = session.annotations.length;
|
|
80
|
-
const merged = await client.
|
|
80
|
+
const merged = await client.sessionMergeShared(session.id, {
|
|
81
|
+
annotations: collaboratorAnnotations(remote),
|
|
82
|
+
participants: remote.participants,
|
|
83
|
+
});
|
|
81
84
|
const added = merged.annotations.length - before;
|
|
82
85
|
deps.out(added > 0 ? `pulled ${added} new annotation${added === 1 ? "" : "s"}` : "no new annotations");
|
|
83
86
|
return 0;
|