@lionweb/delta-protocol-test-cli 0.7.0-beta.12 → 0.7.0-beta.14

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/dist/tasks.js CHANGED
@@ -14,26 +14,26 @@
14
14
  //
15
15
  // SPDX-FileCopyrightText: 2025 TRUMPF Laser SE and other contributors
16
16
  // SPDX-License-Identifier: Apache-2.0
17
- import { ClientAppliedEvent } from "@lionweb/delta-protocol-impl/dist/semantic-logging.js";
18
- import { withStylesApplied } from "@lionweb/delta-protocol-impl/dist/utils/ansi.js";
17
+ import { lastOfArray } from "@lionweb/ts-utils";
18
+ import { ClientReceivedMessage } from "@lionweb/delta-protocol-impl/dist/semantic-logging.js";
19
+ import { clientInfo, genericWarning } from "@lionweb/delta-protocol-impl/dist/utils/ansi.js";
19
20
  import { waitUntil } from "@lionweb/delta-protocol-impl/dist/utils/async.js";
20
- import { ShapesBase } from "./gen/Shapes.g.js";
21
21
  import { TestLanguageBase } from "./gen/TestLanguage.g.js";
22
- const lastOf = (ts) => {
23
- if (ts.length === 0) {
24
- throw new Error(`empty array doesn't have a last element`);
25
- }
26
- return ts[ts.length - 1];
27
- };
22
+ /**
23
+ * **DEV note**: run
24
+ *
25
+ * $ node src/code-reading/tasks-from-csharp.js
26
+ *
27
+ * inside the build package to generate the contents of the following object.
28
+ */
28
29
  export const recognizedTasks = {
29
30
  "SignOn": true,
30
31
  "SignOff": true,
31
32
  "Wait": true,
32
- "AddDocs": true,
33
- "SetDocsText": true,
34
33
  "AddStringValue_0_1": true,
35
34
  "SetStringValue_0_1": true,
36
35
  "DeleteStringValue_0_1": true,
36
+ "AddName_Containment_0_1": true,
37
37
  "AddAnnotation": true,
38
38
  "AddAnnotations": true,
39
39
  "AddAnnotation_to_Containment_0_1": true,
@@ -50,6 +50,7 @@ export const recognizedTasks = {
50
50
  "AddContainment_0_1_Containment_0_1": true,
51
51
  "AddContainment_1_Containment_0_1": true,
52
52
  "AddContainment_0_n": true,
53
+ "AddContainment_0_n_Containment_0_n": true,
53
54
  "AddContainment_1_n": true,
54
55
  "MoveAndReplaceChildFromOtherContainment_Single": true,
55
56
  "MoveAndReplaceChildFromOtherContainmentInSameParent_Single": true,
@@ -58,133 +59,138 @@ export const recognizedTasks = {
58
59
  "MoveChildFromOtherContainment_Single": true,
59
60
  "MoveChildFromOtherContainment_Multiple": true,
60
61
  "MoveChildFromOtherContainmentInSameParent_Single": true,
61
- "MoveChildFromOtherContainmentInSameParent_Multiple": true,
62
- "AddPartition": true
62
+ "AddPartition": true,
63
+ "MoveChildFromOtherContainmentInSameParent_Multiple": true
63
64
  };
64
- const shapesLanguageBase = ShapesBase.INSTANCE;
65
65
  const testLanguageBase = TestLanguageBase.INSTANCE;
66
66
  export const taskExecutor = (lionWebClient, partition, semanticLogItems) => {
67
- const numberOfAppliedEvents = () => semanticLogItems.filter((item) => item instanceof ClientAppliedEvent).length;
68
- const waitForReceived = async (delta) => {
69
- const expectedNumber = numberOfAppliedEvents() + delta; // (precompute here)
70
- return waitUntil(10, () => numberOfAppliedEvents() >= expectedNumber)
67
+ const numberOfReceivedMessages = () => semanticLogItems.filter((item) => item instanceof ClientReceivedMessage).length;
68
+ const waitForReceivedMessages = async (numberOfMessagesToReceive) => {
69
+ const expectedNumber = numberOfReceivedMessages() + numberOfMessagesToReceive; // (precompute here)
70
+ return waitUntil(10, () => numberOfReceivedMessages() >= expectedNumber)
71
71
  .then(() => {
72
- console.log(withStylesApplied("italic")(`(client applied (the deltas from) a total of ${numberOfAppliedEvents()} events so far)`));
72
+ console.log(clientInfo(`(client "${lionWebClient.clientId}" received a total of ${numberOfReceivedMessages()} messages so far)`));
73
73
  });
74
74
  };
75
- const annotation = (id) => lionWebClient.factory(testLanguageBase.TestAnnotation, id);
75
+ const annotation = (id) => lionWebClient.createNode(testLanguageBase.TestAnnotation, id);
76
76
  const linkTestConcept = (id) => id === undefined
77
77
  ? partition
78
- : lionWebClient.factory(testLanguageBase.LinkTestConcept, id);
78
+ : lionWebClient.createNode(testLanguageBase.LinkTestConcept, id);
79
79
  return async (task, queryId) => {
80
+ console.log(clientInfo(`client "${lionWebClient.clientId}" is executing task "${task}"`));
80
81
  switch (task) {
81
82
  case "SignOn":
82
- return await lionWebClient.signOn(queryId);
83
+ return await lionWebClient.signOn(queryId, "myRepo");
83
84
  case "SignOff":
84
85
  return await lionWebClient.signOff(queryId);
85
86
  case "Wait": {
86
- return waitForReceived(1);
87
- }
88
- case "AddDocs": {
89
- partition.documentation = lionWebClient.factory(shapesLanguageBase.Documentation, "documentation");
90
- return waitForReceived(1);
91
- }
92
- case "SetDocsText": {
93
- partition.documentation.text = "hello there";
94
- return waitForReceived(1);
87
+ return waitForReceivedMessages(1);
95
88
  }
96
89
  case "AddStringValue_0_1":
97
90
  partition.stringValue_0_1 = "new property";
98
- return waitForReceived(1);
91
+ return waitForReceivedMessages(1);
99
92
  case "SetStringValue_0_1":
100
93
  partition.stringValue_0_1 = "changed property";
101
- return waitForReceived(1);
94
+ return waitForReceivedMessages(1);
102
95
  case "DeleteStringValue_0_1":
103
96
  partition.stringValue_0_1 = undefined;
104
- return waitForReceived(1);
97
+ return waitForReceivedMessages(1);
98
+ case "AddName_Containment_0_1":
99
+ linkTestConcept().containment_0_1.name = "my name";
100
+ return waitForReceivedMessages(1);
105
101
  case "AddAnnotation":
106
102
  linkTestConcept().addAnnotation(annotation("annotation"));
107
- return waitForReceived(1);
103
+ return waitForReceivedMessages(1);
108
104
  case "AddAnnotations":
109
105
  linkTestConcept().addAnnotation(annotation("annotation0")); // (keep ;!)
110
106
  linkTestConcept().addAnnotation(annotation("annotation1"));
111
- return waitForReceived(2);
107
+ return waitForReceivedMessages(2);
112
108
  case "AddAnnotation_to_Containment_0_1":
113
109
  linkTestConcept().containment_0_1.addAnnotation(annotation("annotation"));
114
- return waitForReceived(1);
110
+ return waitForReceivedMessages(1);
115
111
  case "DeleteAnnotation":
116
112
  linkTestConcept().removeAnnotation(linkTestConcept().annotations[0]);
117
- return waitForReceived(1);
113
+ return waitForReceivedMessages(1);
118
114
  case "MoveAnnotationInSameParent":
119
- linkTestConcept().insertAnnotationAtIndex(lastOf(linkTestConcept().annotations), 0);
120
- return waitForReceived(1);
115
+ linkTestConcept().insertAnnotationAtIndex(lastOfArray(linkTestConcept().annotations), 0);
116
+ return waitForReceivedMessages(1);
121
117
  case "MoveAnnotationFromOtherParent":
122
118
  linkTestConcept().addAnnotation(linkTestConcept().containment_0_1.annotations[0]);
123
- return waitForReceived(1);
119
+ return waitForReceivedMessages(1);
124
120
  case "AddReference_0_1_to_Containment_0_1":
125
121
  linkTestConcept().reference_0_1 = linkTestConcept().containment_0_1;
126
- return waitForReceived(1);
122
+ return waitForReceivedMessages(1);
127
123
  case "AddReference_0_1_to_Containment_1":
128
124
  linkTestConcept().reference_0_1 = linkTestConcept().containment_1;
129
- return waitForReceived(1);
125
+ return waitForReceivedMessages(1);
130
126
  case "DeleteReference_0_1":
131
127
  linkTestConcept().reference_0_1 = undefined;
132
- return waitForReceived(1);
128
+ return waitForReceivedMessages(1);
133
129
  case "AddContainment_0_1":
134
130
  linkTestConcept().containment_0_1 = linkTestConcept("containment_0_1");
135
- return waitForReceived(1);
131
+ return waitForReceivedMessages(1);
136
132
  case "AddContainment_1":
137
133
  linkTestConcept().containment_1 = linkTestConcept("containment_1");
138
- return waitForReceived(1);
134
+ return waitForReceivedMessages(1);
139
135
  case "ReplaceContainment_0_1":
140
- linkTestConcept().containment_0_1 = linkTestConcept("substitute");
141
- return waitForReceived(1);
136
+ linkTestConcept().replaceContainment_0_1With(linkTestConcept("substitute"));
137
+ return waitForReceivedMessages(1);
142
138
  case "DeleteContainment_0_1":
143
139
  linkTestConcept().containment_0_1 = undefined;
144
- return waitForReceived(1);
140
+ return waitForReceivedMessages(1);
145
141
  case "AddContainment_0_1_Containment_0_1":
146
142
  linkTestConcept().containment_0_1.containment_0_1 = linkTestConcept("containment_0_1_containment_0_1");
147
- return waitForReceived(1);
143
+ return waitForReceivedMessages(1);
148
144
  case "AddContainment_1_Containment_0_1":
149
145
  linkTestConcept().containment_1.containment_0_1 = linkTestConcept("containment_1_containment_0_1");
150
- return waitForReceived(1);
146
+ return waitForReceivedMessages(1);
151
147
  case "AddContainment_0_n":
152
148
  linkTestConcept().addContainment_0_n(linkTestConcept("containment_0_n_child0")); // (keep ;!)
153
149
  linkTestConcept().addContainment_0_n(linkTestConcept("containment_0_n_child1"));
154
- return waitForReceived(2);
150
+ return waitForReceivedMessages(2);
151
+ case "AddContainment_0_n_Containment_0_n": {
152
+ const outerChild = linkTestConcept("containment_0_n_child0");
153
+ outerChild.addContainment_0_n(linkTestConcept("containment_0_n_containment_0_n_child0"));
154
+ linkTestConcept().addContainment_0_n(outerChild);
155
+ return waitForReceivedMessages(1);
156
+ }
155
157
  case "AddContainment_1_n":
156
158
  linkTestConcept().addContainment_1_n(linkTestConcept("containment_1_n_child0")); // (keep ;!)
157
159
  linkTestConcept().addContainment_1_n(linkTestConcept("containment_1_n_child1"));
158
- return waitForReceived(2);
160
+ return waitForReceivedMessages(2);
159
161
  case "MoveAndReplaceChildFromOtherContainment_Single":
160
162
  linkTestConcept().containment_1.replaceContainment_0_1With(linkTestConcept().containment_0_1.containment_0_1);
161
- return waitForReceived(1);
163
+ return waitForReceivedMessages(1);
162
164
  case "MoveAndReplaceChildFromOtherContainmentInSameParent_Single":
163
165
  linkTestConcept().replaceContainment_1With(linkTestConcept().containment_0_1);
164
- return waitForReceived(1);
166
+ return waitForReceivedMessages(1);
165
167
  case "MoveAndReplaceChildFromOtherContainment_Multiple":
166
- linkTestConcept().replaceContainment_1_nAtIndex(lastOf(linkTestConcept().containment_0_n), linkTestConcept().containment_1_n.length - 1);
167
- return waitForReceived(1);
168
+ if (linkTestConcept().containment_1_n.length === 0) {
169
+ throw new Error(`can't replace an item of an array with no items`);
170
+ }
171
+ linkTestConcept().replaceContainment_1_nAtIndex(lastOfArray(lastOfArray(linkTestConcept().containment_0_n).containment_0_n), linkTestConcept().containment_1_n.length - 1);
172
+ return waitForReceivedMessages(1);
168
173
  case "MoveChildInSameContainment":
169
- linkTestConcept().addContainment_0_nAtIndex(lastOf(linkTestConcept().containment_0_n), 0);
170
- return waitForReceived(1);
174
+ linkTestConcept().addContainment_0_nAtIndex(lastOfArray(linkTestConcept().containment_0_n), 0);
175
+ // Note: this is effectively a move rather than an insert — hence the name of the task.
176
+ return waitForReceivedMessages(1);
171
177
  case "MoveChildFromOtherContainment_Single":
172
178
  linkTestConcept().containment_1 = linkTestConcept().containment_0_1.containment_0_1;
173
- return waitForReceived(1);
179
+ return waitForReceivedMessages(1);
174
180
  case "MoveChildFromOtherContainment_Multiple":
175
- linkTestConcept().addContainment_1_nAtIndex(lastOf(linkTestConcept().containment_0_n).containment_0_n[0], 1);
176
- return waitForReceived(1);
181
+ linkTestConcept().addContainment_1_nAtIndex(lastOfArray(linkTestConcept().containment_0_n).containment_0_n[0], 1);
182
+ return waitForReceivedMessages(1);
177
183
  case "MoveChildFromOtherContainmentInSameParent_Single":
178
184
  linkTestConcept().containment_1 = linkTestConcept().containment_0_1;
179
- return waitForReceived(1);
185
+ return waitForReceivedMessages(1);
180
186
  case "MoveChildFromOtherContainmentInSameParent_Multiple":
181
- linkTestConcept().addContainment_1_nAtIndex(lastOf(linkTestConcept().containment_0_n), 1);
182
- return waitForReceived(1);
187
+ linkTestConcept().addContainment_1_nAtIndex(lastOfArray(linkTestConcept().containment_0_n), 1);
188
+ return waitForReceivedMessages(1);
183
189
  case "AddPartition":
184
190
  lionWebClient.addPartition(linkTestConcept("partition"));
185
- return waitForReceived(1);
191
+ return waitForReceivedMessages(1);
186
192
  default: {
187
- console.log(withStylesApplied("italic", "red")(`task "${task}" is unknown => ignored`));
193
+ console.log(genericWarning(`task "${task}" is unknown => ignored`));
188
194
  return Promise.resolve();
189
195
  }
190
196
  }
package/dist/tasks.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"tasks.js","sourceRoot":"","sources":["../src/tasks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AAoD;gBACrD,eAAe,EAAE,CAAC,yBAAyB,CAAC,WAAW,CAAC,eAAe,EAAE,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC,CAAA;gBAC9F,OAAO,uBAAuB,CAAC,CAAC,CAAC,CAAA;YACrC,KAAK,cAAc;gBACf,aAAa,CAAC,YAAY,CAAC,eAAe,CAAC,WAAW,CAAC,CAAC,CAAA;gBACxD,OAAO,uBAAuB,CAAC,CAAC,CAAC,CAAA;YAErC,OAAO,CAAC,CAAC,CAAC;gBACN,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,SAAS,IAAI,yBAAyB,CAAC,CAAC,CAAA;gBACnE,OAAO,OAAO,CAAC,OAAO,EAAE,CAAA;YAC5B,CAAC;QACL,CAAC;IACL,CAAC,CAAA;AACL,CAAC,CAAA"}
package/package.json CHANGED
@@ -1,41 +1,39 @@
1
1
  {
2
- "name": "@lionweb/delta-protocol-test-cli",
3
- "version": "0.7.0-beta.12",
4
- "description": "CLI programs for testing the delta protocol",
5
- "main": "dist/index.js",
6
- "types": "dist/index.d.ts",
7
- "typings": "dist/index.d.ts",
8
- "type": "module",
9
- "license": "Apache-2.0",
10
- "repository": {
11
- "type": "git",
12
- "url": "git+https://github.com/LionWeb-io/lionweb-typescript.git"
13
- },
14
- "bugs": {
15
- "url": "https://github.com/LionWeb-io/lionweb-typescript/issues"
16
- },
17
- "bin": {
18
- "cli-client": "dist/cli-client.js",
19
- "cli-repository": "dist/cli-repository.js"
20
- },
21
- "scripts": {
22
- "clean": "npx rimraf dist node_modules delta-protocol-test-cli-*.tgz",
23
- "build": "tsc",
24
- "lint": "eslint src",
25
- "start-client": "npm run build && node --trace-uncaught dist/cli-client.js 40000 client-A LinkTestConcept Bogus,SignOn,AddDocs,SetDocs,SignOff,Wait",
26
- "start-repository": "npm run build && node --trace-uncaught dist/cli-repository.js 40000",
27
- "prep:pre-release": "npm run clean && npm install && npm run build",
28
- "prerelease-alpha": "npm run prep:pre-release",
29
- "release-alpha": "npm publish --tag alpha",
30
- "prerelease-beta": "npm run prep:pre-release",
31
- "release-beta": "npm publish --tag beta",
32
- "prerelease": "npm run prep:pre-release",
33
- "release": "npm publish"
34
- },
35
- "dependencies": {
36
- "@lionweb/class-core": "0.7.0-beta.12",
37
- "@lionweb/core": "0.7.0-beta.12",
38
- "@lionweb/delta-protocol-impl": "0.7.0-beta.12",
39
- "@lionweb/json": "0.7.0-beta.12"
40
- }
2
+ "name": "@lionweb/delta-protocol-test-cli",
3
+ "version": "0.7.0-beta.14",
4
+ "description": "CLI programs for testing the delta protocol",
5
+ "type": "module",
6
+ "license": "Apache-2.0",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/LionWeb-io/lionweb-typescript.git"
10
+ },
11
+ "bugs": {
12
+ "url": "https://github.com/LionWeb-io/lionweb-typescript/issues"
13
+ },
14
+ "bin": {
15
+ "cli-client": "dist/cli-client.js",
16
+ "cli-repository": "dist/cli-repository.js"
17
+ },
18
+ "scripts": {
19
+ "clean": "npx rimraf dist node_modules -g delta-protocol-test-cli-*.tgz",
20
+ "build": "tsc",
21
+ "lint": "eslint src",
22
+ "start-client": "npm run build && node --trace-uncaught dist/cli-client.js 40000 client-A LinkTestConcept Bogus,SignOn,AddDocs,SetDocs,SignOff,Wait",
23
+ "start-repository": "npm run build && node --trace-uncaught dist/cli-repository.js 40000",
24
+ "prep:pre-release": "npm run clean && npm install && npm run build",
25
+ "prerelease-alpha": "npm run prep:pre-release",
26
+ "release-alpha": "npm publish --tag alpha",
27
+ "prerelease-beta": "npm run prep:pre-release",
28
+ "release-beta": "npm publish --tag beta",
29
+ "prerelease": "npm run prep:pre-release",
30
+ "release": "npm publish"
31
+ },
32
+ "dependencies": {
33
+ "@lionweb/class-core": "0.7.0-beta.14",
34
+ "@lionweb/core": "0.7.0-beta.14",
35
+ "@lionweb/delta-protocol-impl": "0.7.0-beta.14",
36
+ "@lionweb/json": "0.7.0-beta.14",
37
+ "@lionweb/utilities": "0.7.0-beta.14"
38
+ }
41
39
  }
package/src/cli-client.ts CHANGED
@@ -19,36 +19,50 @@
19
19
 
20
20
  import { argv, exit } from "process"
21
21
  import { Concept } from "@lionweb/core"
22
- import { LionWebClient, wsLocalhostUrl } from "@lionweb/delta-protocol-impl"
22
+ import {
23
+ Command,
24
+ createWebSocketClient,
25
+ Event,
26
+ LionWebClient,
27
+ QueryMessage,
28
+ wsLocalhostUrl
29
+ } from "@lionweb/delta-protocol-impl"
30
+ import { writeJsonAsFile } from "@lionweb/utilities"
23
31
  import { runAsApp, tryParseInteger } from "./common.js"
24
32
  import { recognizedTasks, taskExecutor } from "./tasks.js"
25
- import { clientInfo, withStylesApplied } from "@lionweb/delta-protocol-impl/dist/utils/ansi.js"
33
+ import { clientInfo, genericError } from "@lionweb/delta-protocol-impl/dist/utils/ansi.js"
26
34
  import { combine } from "@lionweb/delta-protocol-impl/dist/utils/procedure.js"
27
- import { ShapesBase } from "./gen/Shapes.g.js"
28
35
  import { TestLanguageBase } from "./gen/TestLanguage.g.js"
29
36
  import { semanticConsoleLogger, semanticLogItemStorer } from "@lionweb/delta-protocol-impl/dist/semantic-logging.js"
30
37
 
31
- const shapesLanguageBase = ShapesBase.INSTANCE
32
38
  const testLanguageBase = TestLanguageBase.INSTANCE
33
- const languageBases = [shapesLanguageBase, testLanguageBase]
39
+ const languageBases = [testLanguageBase]
34
40
 
35
41
  const boldRedIf = (apply: boolean, text: string) =>
36
- apply ? withStylesApplied("bold", "red")(text) : text
42
+ apply ? genericError(text) : text
37
43
 
38
44
  const partitionConcepts: Record<string, Concept> = Object.fromEntries(
39
- [testLanguageBase.DataTypeTestConcept, shapesLanguageBase.Geometry, testLanguageBase.LinkTestConcept]
45
+ [testLanguageBase.DataTypeTestConcept, testLanguageBase.LinkTestConcept]
40
46
  .map((concept) => [concept.name, concept])
41
47
  )
42
48
 
43
- if (argv.length < 5) { // $ node dist/cli-client.js <port> <clientID> <partitionConcept> [tasks]
49
+ // $ node dist/cli-client.js <port> <clientID> <partitionConcept> [tasks] [--${protocolLogOptionPrefix}=<path>]
50
+
51
+ const protocolLogOptionPrefix = "--protocol-log="
52
+ const protocolLogPathIndex = argv.findIndex((argument) => argument.startsWith(protocolLogOptionPrefix))
53
+ // arguments without "node" (index=0), "dist/cli-client.js" (index=1), and `${protocolLogOptionPrefix}=<path>` (optional)
54
+ const trueArguments = argv.filter((_, index) => !(index === 0 || index === 1 || index === protocolLogPathIndex))
55
+
56
+ if (trueArguments.length < 3) {
44
57
  console.log(
45
58
  `A Node.js-based app that implements a LionWeb delta protocol client.
46
59
 
47
60
  Parameters (${boldRedIf(true, "bold red")} are missing):
48
- - ${boldRedIf(argv.length < 3, `<port>: the port of the WebSocket where the LionWeb delta protocol repository is running on localhost`)}
49
- - ${boldRedIf(argv.length < 4, `<clientID>: the ID that the client identifies itself with at the repository`)}
50
- - ${boldRedIf(argv.length < 5, `<partitionConcept>: the name of a partition concept that gets instantiated as the model's primary partition — one of: ${Object.keys(partitionConcepts).join(", ")}`)}
51
- - ${boldRedIf(argv.length < 6, `[tasks]: a comma-separated list of tasks — one of ${Object.keys(recognizedTasks).sort().join(", ")}`)}
61
+ - ${boldRedIf(trueArguments.length < 1, `<port>: the port of the WebSocket where the LionWeb delta protocol repository is running on localhost`)}
62
+ - ${boldRedIf(trueArguments.length < 2, `<clientID>: the ID that the client identifies itself with at the repository`)}
63
+ - ${boldRedIf(trueArguments.length < 3, `<partitionConcept>: the name of a partition concept that gets instantiated as the model's primary partition — one of: ${Object.keys(partitionConcepts).join(", ")}`)}
64
+ - ${boldRedIf(trueArguments.length < 4, `[tasks]: a comma-separated list of tasks — one of ${Object.keys(recognizedTasks).sort().join(", ")}`)}
65
+ - ${boldRedIf(protocolLogPathIndex === -1, `${protocolLogOptionPrefix}=<path>: option to configure that the client logs all messages exchanged with the repository to a file with the given path`)}
52
66
 
53
67
  ASSUMPTION: the initial (states of the models) on client(s) and repository are identical!
54
68
  `)
@@ -69,17 +83,27 @@ await runAsApp(async () => {
69
83
  const url = wsLocalhostUrl(port)
70
84
 
71
85
  const [storingLogger, semanticLogItems] = semanticLogItemStorer()
86
+ const protocolMessages: unknown[] = []
72
87
 
73
88
  const lionWebClient = await LionWebClient.create({
74
89
  clientId,
75
90
  url,
76
91
  languageBases,
77
- semanticLogger: combine(semanticConsoleLogger, storingLogger)
92
+ semanticLogger: combine(semanticConsoleLogger, storingLogger),
93
+ lowLevelClientInstantiator: async (lowLevelClientParameters) =>
94
+ await createWebSocketClient<(Event | QueryMessage), (Command | QueryMessage)>(
95
+ lowLevelClientParameters,
96
+ {
97
+ messageLogger: (message) => {
98
+ protocolMessages.push(message)
99
+ }
100
+ }
101
+ )
78
102
  })
79
103
 
80
104
  console.log(clientInfo(`LionWeb delta protocol client (with ID=${clientId}) connecting to repository on ${url} - press Ctrl+C to terminate`))
81
105
 
82
- const partition = lionWebClient.factory(partitionConcepts[partitionConcept], "a")
106
+ const partition = lionWebClient.createNode(partitionConcepts[partitionConcept], "a")
83
107
  lionWebClient.setModel([partition])
84
108
 
85
109
  const executeTask = taskExecutor(lionWebClient, partition, semanticLogItems)
@@ -91,6 +115,10 @@ await runAsApp(async () => {
91
115
  await executeTask(task, queryId())
92
116
  }
93
117
 
118
+ if (protocolLogPathIndex > -1) {
119
+ writeJsonAsFile(argv[protocolLogPathIndex].substring(protocolLogOptionPrefix.length), protocolMessages)
120
+ }
121
+
94
122
  return () => {
95
123
  return lionWebClient.disconnect()
96
124
  }
@@ -38,7 +38,7 @@ Parameter (missing):
38
38
  const port = tryParseInteger(argv[2])
39
39
 
40
40
  await runAsApp(async () => {
41
- const lionWebRepository = await LionWebRepository.setUp({
41
+ const lionWebRepository = await LionWebRepository.create({
42
42
  port,
43
43
  semanticLogger: semanticConsoleLogger
44
44
  })
@@ -46,7 +46,7 @@ import {
46
46
 
47
47
  import {
48
48
  ContainmentValueManager,
49
- DeltaHandler,
49
+ DeltaReceiver,
50
50
  ILanguageBase,
51
51
  INamed,
52
52
  INodeBase,
@@ -247,12 +247,12 @@ export class TestLanguageBase implements ILanguageBase {
247
247
  this._wiredUp = true;
248
248
  }
249
249
 
250
- factory(handleDelta?: DeltaHandler): NodeBaseFactory {
250
+ factory(receiveDelta?: DeltaReceiver): NodeBaseFactory {
251
251
  return (classifier: Classifier, id: LionWebId) => {
252
252
  switch (classifier.key) {
253
- case this._DataTypeTestConcept.key: return DataTypeTestConcept.create(id, handleDelta);
254
- case this._LinkTestConcept.key: return LinkTestConcept.create(id, handleDelta);
255
- case this._TestAnnotation.key: return TestAnnotation.create(id, handleDelta);
253
+ case this._DataTypeTestConcept.key: return DataTypeTestConcept.create(id, receiveDelta);
254
+ case this._LinkTestConcept.key: return LinkTestConcept.create(id, receiveDelta);
255
+ case this._TestAnnotation.key: return TestAnnotation.create(id, receiveDelta);
256
256
  default: {
257
257
  const {language} = classifier;
258
258
  throw new Error(`can't instantiate ${classifier.name} (key=${classifier.key}): classifier is not known in language ${language.name} (key=${language.key}, version=${language.version})`);
@@ -290,8 +290,8 @@ export enum SecondTestEnumeration {
290
290
  }
291
291
 
292
292
  export class DataTypeTestConcept extends NodeBase {
293
- static create(id: LionWebId, handleDelta?: DeltaHandler, parentInfo?: Parentage): DataTypeTestConcept {
294
- return new DataTypeTestConcept(TestLanguageBase.INSTANCE.DataTypeTestConcept, id, handleDelta, parentInfo);
293
+ static create(id: LionWebId, receiveDelta?: DeltaReceiver, parentInfo?: Parentage): DataTypeTestConcept {
294
+ return new DataTypeTestConcept(TestLanguageBase.INSTANCE.DataTypeTestConcept, id, receiveDelta, parentInfo);
295
295
  }
296
296
 
297
297
  private readonly _booleanValue_1: RequiredPropertyValueManager<boolean>;
@@ -358,8 +358,8 @@ export class DataTypeTestConcept extends NodeBase {
358
358
  this._enumValue_0_1.set(newValue);
359
359
  }
360
360
 
361
- public constructor(classifier: Classifier, id: LionWebId, handleDelta?: DeltaHandler, parentInfo?: Parentage) {
362
- super(classifier, id, handleDelta, parentInfo);
361
+ public constructor(classifier: Classifier, id: LionWebId, receiveDelta?: DeltaReceiver, parentInfo?: Parentage) {
362
+ super(classifier, id, receiveDelta, parentInfo);
363
363
  this._booleanValue_1 = new RequiredPropertyValueManager<boolean>(TestLanguageBase.INSTANCE.DataTypeTestConcept_booleanValue_1, this);
364
364
  this._integerValue_1 = new RequiredPropertyValueManager<number>(TestLanguageBase.INSTANCE.DataTypeTestConcept_integerValue_1, this);
365
365
  this._stringValue_1 = new RequiredPropertyValueManager<string>(TestLanguageBase.INSTANCE.DataTypeTestConcept_stringValue_1, this);
@@ -386,8 +386,8 @@ export class DataTypeTestConcept extends NodeBase {
386
386
  }
387
387
 
388
388
  export class LinkTestConcept extends NodeBase implements INamed {
389
- static create(id: LionWebId, handleDelta?: DeltaHandler, parentInfo?: Parentage): LinkTestConcept {
390
- return new LinkTestConcept(TestLanguageBase.INSTANCE.LinkTestConcept, id, handleDelta, parentInfo);
389
+ static create(id: LionWebId, receiveDelta?: DeltaReceiver, parentInfo?: Parentage): LinkTestConcept {
390
+ return new LinkTestConcept(TestLanguageBase.INSTANCE.LinkTestConcept, id, receiveDelta, parentInfo);
391
391
  }
392
392
 
393
393
  private readonly _containment_0_1: OptionalSingleContainmentValueManager<LinkTestConcept>;
@@ -510,8 +510,8 @@ export class LinkTestConcept extends NodeBase implements INamed {
510
510
  this._name.set(newValue);
511
511
  }
512
512
 
513
- public constructor(classifier: Classifier, id: LionWebId, handleDelta?: DeltaHandler, parentInfo?: Parentage) {
514
- super(classifier, id, handleDelta, parentInfo);
513
+ public constructor(classifier: Classifier, id: LionWebId, receiveDelta?: DeltaReceiver, parentInfo?: Parentage) {
514
+ super(classifier, id, receiveDelta, parentInfo);
515
515
  this._containment_0_1 = new OptionalSingleContainmentValueManager<LinkTestConcept>(TestLanguageBase.INSTANCE.LinkTestConcept_containment_0_1, this);
516
516
  this._containment_1 = new RequiredSingleContainmentValueManager<LinkTestConcept>(TestLanguageBase.INSTANCE.LinkTestConcept_containment_1, this);
517
517
  this._containment_0_n = new OptionalMultiContainmentValueManager<LinkTestConcept>(TestLanguageBase.INSTANCE.LinkTestConcept_containment_0_n, this);
@@ -552,8 +552,8 @@ export class LinkTestConcept extends NodeBase implements INamed {
552
552
  }
553
553
 
554
554
  export class TestAnnotation extends NodeBase {
555
- static create(id: LionWebId, handleDelta?: DeltaHandler, parentInfo?: Parentage): TestAnnotation {
556
- return new TestAnnotation(TestLanguageBase.INSTANCE.TestAnnotation, id, handleDelta, parentInfo);
555
+ static create(id: LionWebId, receiveDelta?: DeltaReceiver, parentInfo?: Parentage): TestAnnotation {
556
+ return new TestAnnotation(TestLanguageBase.INSTANCE.TestAnnotation, id, receiveDelta, parentInfo);
557
557
  }
558
558
  }
559
559