@eclipse-glsp-examples/workflow-server 1.1.0-next.385269d.45 → 1.1.0-next.3bba361.48

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.
@@ -1,2 +1,18 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2022-2023 STMicroelectronics and others.
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the Eclipse Public License v. 2.0 which is available at
6
+ * http://www.eclipse.org/legal/epl-2.0.
7
+ *
8
+ * This Source Code may also be made available under the following Secondary
9
+ * Licenses when the conditions for such availability set forth in the Eclipse
10
+ * Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ * with the GNU Classpath Exception which is available at
12
+ * https://www.gnu.org/software/classpath/license.html.
13
+ *
14
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
+ ********************************************************************************/
16
+ import 'reflect-metadata';
1
17
  export declare function launch(argv?: string[]): Promise<void>;
2
18
  //# sourceMappingURL=app.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../src/browser/app.ts"],"names":[],"mappings":"AAsBA,wBAAsB,MAAM,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAsB3D"}
1
+ {"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../src/browser/app.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,kBAAkB,CAAC;AAS1B,wBAAsB,MAAM,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAe3D"}
@@ -16,6 +16,7 @@ exports.launch = void 0;
16
16
  *
17
17
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
18
18
  ********************************************************************************/
19
+ require("reflect-metadata");
19
20
  const layout_elk_1 = require("@eclipse-glsp/layout-elk");
20
21
  const browser_1 = require("@eclipse-glsp/server/browser");
21
22
  const inversify_1 = require("inversify");
@@ -23,20 +24,14 @@ const workflow_layout_configurator_1 = require("../common/layout/workflow-layout
23
24
  const workflow_diagram_module_1 = require("../common/workflow-diagram-module");
24
25
  const mock_model_storage_1 = require("./mock-model-storage");
25
26
  async function launch(argv) {
26
- let logger;
27
- try {
28
- const appContainer = new inversify_1.Container();
29
- appContainer.load((0, browser_1.createAppModule)({ logLevel: browser_1.LogLevel.info }));
30
- logger = appContainer.get(browser_1.LoggerFactory)('WorkflowServerApp');
31
- const launcher = appContainer.resolve(browser_1.WorkerServerLauncher);
32
- const elkLayoutModule = (0, layout_elk_1.configureELKLayoutModule)({ algorithms: ['layered'], layoutConfigurator: workflow_layout_configurator_1.WorkflowLayoutConfigurator });
33
- const serverModule = new workflow_diagram_module_1.WorkflowServerModule().configureDiagramModule(new workflow_diagram_module_1.WorkflowDiagramModule(() => mock_model_storage_1.WorkflowMockModelStorage), elkLayoutModule);
34
- launcher.configure(serverModule);
35
- await launcher.start();
36
- }
37
- catch (error) {
38
- (logger !== null && logger !== void 0 ? logger : console).error('Error in workflow server launcher:', error);
39
- }
27
+ const appContainer = new inversify_1.Container();
28
+ appContainer.load((0, browser_1.createAppModule)({ logLevel: browser_1.LogLevel.info }));
29
+ const launcher = appContainer.resolve(browser_1.WorkerServerLauncher);
30
+ const elkLayoutModule = (0, layout_elk_1.configureELKLayoutModule)({ algorithms: ['layered'], layoutConfigurator: workflow_layout_configurator_1.WorkflowLayoutConfigurator });
31
+ const serverModule = new workflow_diagram_module_1.WorkflowServerModule().configureDiagramModule(new workflow_diagram_module_1.WorkflowDiagramModule(() => mock_model_storage_1.WorkflowMockModelStorage), elkLayoutModule);
32
+ launcher.configure(serverModule);
33
+ await launcher.start({});
40
34
  }
41
35
  exports.launch = launch;
36
+ launch().catch(error => console.error('Error in workflow server launcher:', error));
42
37
  //# sourceMappingURL=app.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"app.js","sourceRoot":"","sources":["../../src/browser/app.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,yDAAoE;AACpE,0DAAsH;AACtH,yCAAsC;AACtC,gGAA2F;AAC3F,+EAAgG;AAChG,6DAAgE;AAEzD,KAAK,UAAU,MAAM,CAAC,IAAe;IACxC,IAAI,MAA0B,CAAC;IAE/B,IAAI;QACA,MAAM,YAAY,GAAG,IAAI,qBAAS,EAAE,CAAC;QACrC,YAAY,CAAC,IAAI,CAAC,IAAA,yBAAe,EAAC,EAAE,QAAQ,EAAE,kBAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;QAEhE,MAAM,GAAG,YAAY,CAAC,GAAG,CAAgB,uBAAa,CAAC,CAAC,mBAAmB,CAAC,CAAC;QAC7E,MAAM,QAAQ,GAAG,YAAY,CAAC,OAAO,CAAC,8BAAoB,CAAC,CAAC;QAC5D,MAAM,eAAe,GAAG,IAAA,qCAAwB,EAAC,EAAE,UAAU,EAAE,CAAC,SAAS,CAAC,EAAE,kBAAkB,EAAE,yDAA0B,EAAE,CAAC,CAAC;QAE9H,MAAM,YAAY,GAAG,IAAI,8CAAoB,EAAE,CAAC,sBAAsB,CAClE,IAAI,+CAAqB,CAAC,GAAG,EAAE,CAAC,6CAAwB,CAAC,EACzD,eAAe,CAClB,CAAC;QAEF,QAAQ,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;QAEjC,MAAM,QAAQ,CAAC,KAAK,EAAE,CAAC;KAC1B;IAAC,OAAO,KAAK,EAAE;QACZ,CAAC,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,OAAO,CAAC,CAAC,KAAK,CAAC,oCAAoC,EAAE,KAAK,CAAC,CAAC;KAC1E;AACL,CAAC;AAtBD,wBAsBC"}
1
+ {"version":3,"file":"app.js","sourceRoot":"","sources":["../../src/browser/app.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,4BAA0B;AAE1B,yDAAoE;AACpE,0DAA+F;AAC/F,yCAAsC;AACtC,gGAA2F;AAC3F,+EAAgG;AAChG,6DAAgE;AAEzD,KAAK,UAAU,MAAM,CAAC,IAAe;IACxC,MAAM,YAAY,GAAG,IAAI,qBAAS,EAAE,CAAC;IACrC,YAAY,CAAC,IAAI,CAAC,IAAA,yBAAe,EAAC,EAAE,QAAQ,EAAE,kBAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IAEhE,MAAM,QAAQ,GAAG,YAAY,CAAC,OAAO,CAAC,8BAAoB,CAAC,CAAC;IAC5D,MAAM,eAAe,GAAG,IAAA,qCAAwB,EAAC,EAAE,UAAU,EAAE,CAAC,SAAS,CAAC,EAAE,kBAAkB,EAAE,yDAA0B,EAAE,CAAC,CAAC;IAE9H,MAAM,YAAY,GAAG,IAAI,8CAAoB,EAAE,CAAC,sBAAsB,CAClE,IAAI,+CAAqB,CAAC,GAAG,EAAE,CAAC,6CAAwB,CAAC,EACzD,eAAe,CAClB,CAAC;IAEF,QAAQ,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;IAEjC,MAAM,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;AAC7B,CAAC;AAfD,wBAeC;AAED,MAAM,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,oCAAoC,EAAE,KAAK,CAAC,CAAC,CAAC"}
@@ -13,5 +13,6 @@
13
13
  *
14
14
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
15
  ********************************************************************************/
16
- import 'reflect-metadata';
16
+ export * from '../common/index';
17
+ export * from './mock-model-storage';
17
18
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/browser/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/browser/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC"}
@@ -1,4 +1,18 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
2
16
  Object.defineProperty(exports, "__esModule", { value: true });
3
17
  /********************************************************************************
4
18
  * Copyright (c) 2022-2023 EclipseSource and others.
@@ -15,7 +29,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
15
29
  *
16
30
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
17
31
  ********************************************************************************/
18
- require("reflect-metadata");
19
- const app_1 = require("./app");
20
- (0, app_1.launch)();
32
+ __exportStar(require("../common/index"), exports);
33
+ __exportStar(require("./mock-model-storage"), exports);
21
34
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/browser/index.ts"],"names":[],"mappings":";;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,4BAA0B;AAC1B,+BAA+B;AAE/B,IAAA,YAAM,GAAE,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/browser/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,kDAAgC;AAChC,uDAAqC"}
@@ -0,0 +1,50 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2023 STMicroelectronics and others.
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the Eclipse Public License v. 2.0 which is available at
6
+ * http://www.eclipse.org/legal/epl-2.0.
7
+ *
8
+ * This Source Code may also be made available under the following Secondary
9
+ * Licenses when the conditions for such availability set forth in the Eclipse
10
+ * Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ * with the GNU Classpath Exception which is available at
12
+ * https://www.gnu.org/software/classpath/license.html.
13
+ *
14
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
+ ********************************************************************************/
16
+ export * from './graph-extension';
17
+ export * from './handler/create-activity-node-handler';
18
+ export * from './handler/create-automated-task-handler';
19
+ export * from './handler/create-category-handler';
20
+ export * from './handler/create-decision-node-handler';
21
+ export * from './handler/create-edge-handler';
22
+ export * from './handler/create-fork-node-handler';
23
+ export * from './handler/create-fork-or-join-node-handler';
24
+ export * from './handler/create-join-node-handler';
25
+ export * from './handler/create-manual-task-handler';
26
+ export * from './handler/create-merge-node-handler';
27
+ export * from './handler/create-task-handler';
28
+ export * from './handler/create-weighted-edge-handler';
29
+ export * from './handler/create-workflow-node-operation-handler';
30
+ export * from './handler/grid-snapper';
31
+ export * from './index';
32
+ export * from './labeledit/workflow-label-edit-validator';
33
+ export * from './layout/workflow-layout-configurator';
34
+ export * from './marker/workflow-model-validator';
35
+ export * from './model/workflow-navigation-target-resolver';
36
+ export * from './provider/abstract-next-or-previous-navigation-target-provider';
37
+ export * from './provider/next-node-navigation-target-provider';
38
+ export * from './provider/node-documentation-navigation-target-provider';
39
+ export * from './provider/previous-node-navigation-target-provider';
40
+ export * from './provider/workflow-command-palette-action-provider';
41
+ export * from './provider/workflow-context-menu-item-provider';
42
+ export * from './taskedit/edit-task-operation-handler';
43
+ export * from './taskedit/task-edit-context-provider';
44
+ export * from './taskedit/task-edit-validator';
45
+ export * from './util/model-types';
46
+ export * from './workflow-diagram-configuration';
47
+ export * from './workflow-diagram-module';
48
+ export * from './workflow-glsp-server';
49
+ export * from './workflow-popup-factory';
50
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,cAAc,mBAAmB,CAAC;AAClC,cAAc,wCAAwC,CAAC;AACvD,cAAc,yCAAyC,CAAC;AACxD,cAAc,mCAAmC,CAAC;AAClD,cAAc,wCAAwC,CAAC;AACvD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,oCAAoC,CAAC;AACnD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,oCAAoC,CAAC;AACnD,cAAc,sCAAsC,CAAC;AACrD,cAAc,qCAAqC,CAAC;AACpD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,wCAAwC,CAAC;AACvD,cAAc,kDAAkD,CAAC;AACjE,cAAc,wBAAwB,CAAC;AACvC,cAAc,SAAS,CAAC;AACxB,cAAc,2CAA2C,CAAC;AAC1D,cAAc,uCAAuC,CAAC;AACtD,cAAc,mCAAmC,CAAC;AAClD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,iEAAiE,CAAC;AAChF,cAAc,iDAAiD,CAAC;AAChE,cAAc,0DAA0D,CAAC;AACzE,cAAc,qDAAqD,CAAC;AACpE,cAAc,qDAAqD,CAAC;AACpE,cAAc,gDAAgD,CAAC;AAC/D,cAAc,wCAAwC,CAAC;AACvD,cAAc,uCAAuC,CAAC;AACtD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,oBAAoB,CAAC;AACnC,cAAc,kCAAkC,CAAC;AACjD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC"}
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+ /********************************************************************************
3
+ * Copyright (c) 2023 STMicroelectronics and others.
4
+ *
5
+ * This program and the accompanying materials are made available under the
6
+ * terms of the Eclipse Public License v. 2.0 which is available at
7
+ * http://www.eclipse.org/legal/epl-2.0.
8
+ *
9
+ * This Source Code may also be made available under the following Secondary
10
+ * Licenses when the conditions for such availability set forth in the Eclipse
11
+ * Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
+ * with the GNU Classpath Exception which is available at
13
+ * https://www.gnu.org/software/classpath/license.html.
14
+ *
15
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
16
+ ********************************************************************************/
17
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
18
+ if (k2 === undefined) k2 = k;
19
+ var desc = Object.getOwnPropertyDescriptor(m, k);
20
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
21
+ desc = { enumerable: true, get: function() { return m[k]; } };
22
+ }
23
+ Object.defineProperty(o, k2, desc);
24
+ }) : (function(o, m, k, k2) {
25
+ if (k2 === undefined) k2 = k;
26
+ o[k2] = m[k];
27
+ }));
28
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
29
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
30
+ };
31
+ Object.defineProperty(exports, "__esModule", { value: true });
32
+ __exportStar(require("./graph-extension"), exports);
33
+ __exportStar(require("./handler/create-activity-node-handler"), exports);
34
+ __exportStar(require("./handler/create-automated-task-handler"), exports);
35
+ __exportStar(require("./handler/create-category-handler"), exports);
36
+ __exportStar(require("./handler/create-decision-node-handler"), exports);
37
+ __exportStar(require("./handler/create-edge-handler"), exports);
38
+ __exportStar(require("./handler/create-fork-node-handler"), exports);
39
+ __exportStar(require("./handler/create-fork-or-join-node-handler"), exports);
40
+ __exportStar(require("./handler/create-join-node-handler"), exports);
41
+ __exportStar(require("./handler/create-manual-task-handler"), exports);
42
+ __exportStar(require("./handler/create-merge-node-handler"), exports);
43
+ __exportStar(require("./handler/create-task-handler"), exports);
44
+ __exportStar(require("./handler/create-weighted-edge-handler"), exports);
45
+ __exportStar(require("./handler/create-workflow-node-operation-handler"), exports);
46
+ __exportStar(require("./handler/grid-snapper"), exports);
47
+ __exportStar(require("./index"), exports);
48
+ __exportStar(require("./labeledit/workflow-label-edit-validator"), exports);
49
+ __exportStar(require("./layout/workflow-layout-configurator"), exports);
50
+ __exportStar(require("./marker/workflow-model-validator"), exports);
51
+ __exportStar(require("./model/workflow-navigation-target-resolver"), exports);
52
+ __exportStar(require("./provider/abstract-next-or-previous-navigation-target-provider"), exports);
53
+ __exportStar(require("./provider/next-node-navigation-target-provider"), exports);
54
+ __exportStar(require("./provider/node-documentation-navigation-target-provider"), exports);
55
+ __exportStar(require("./provider/previous-node-navigation-target-provider"), exports);
56
+ __exportStar(require("./provider/workflow-command-palette-action-provider"), exports);
57
+ __exportStar(require("./provider/workflow-context-menu-item-provider"), exports);
58
+ __exportStar(require("./taskedit/edit-task-operation-handler"), exports);
59
+ __exportStar(require("./taskedit/task-edit-context-provider"), exports);
60
+ __exportStar(require("./taskedit/task-edit-validator"), exports);
61
+ __exportStar(require("./util/model-types"), exports);
62
+ __exportStar(require("./workflow-diagram-configuration"), exports);
63
+ __exportStar(require("./workflow-diagram-module"), exports);
64
+ __exportStar(require("./workflow-glsp-server"), exports);
65
+ __exportStar(require("./workflow-popup-factory"), exports);
66
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;;;;;;;;;;;;;;AAElF,oDAAkC;AAClC,yEAAuD;AACvD,0EAAwD;AACxD,oEAAkD;AAClD,yEAAuD;AACvD,gEAA8C;AAC9C,qEAAmD;AACnD,6EAA2D;AAC3D,qEAAmD;AACnD,uEAAqD;AACrD,sEAAoD;AACpD,gEAA8C;AAC9C,yEAAuD;AACvD,mFAAiE;AACjE,yDAAuC;AACvC,0CAAwB;AACxB,4EAA0D;AAC1D,wEAAsD;AACtD,oEAAkD;AAClD,8EAA4D;AAC5D,kGAAgF;AAChF,kFAAgE;AAChE,2FAAyE;AACzE,sFAAoE;AACpE,sFAAoE;AACpE,iFAA+D;AAC/D,yEAAuD;AACvD,wEAAsD;AACtD,iEAA+C;AAC/C,qDAAmC;AACnC,mEAAiD;AACjD,4DAA0C;AAC1C,yDAAuC;AACvC,2DAAyC"}
package/lib/node/app.d.ts CHANGED
@@ -1,2 +1,17 @@
1
- export declare function launch(argv?: string[]): Promise<void>;
1
+ /********************************************************************************
2
+ * Copyright (c) 2022-2023 STMicroelectronics and others.
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the Eclipse Public License v. 2.0 which is available at
6
+ * http://www.eclipse.org/legal/epl-2.0.
7
+ *
8
+ * This Source Code may also be made available under the following Secondary
9
+ * Licenses when the conditions for such availability set forth in the Eclipse
10
+ * Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ * with the GNU Classpath Exception which is available at
12
+ * https://www.gnu.org/software/classpath/license.html.
13
+ *
14
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
+ ********************************************************************************/
16
+ import 'reflect-metadata';
2
17
  //# sourceMappingURL=app.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../src/node/app.ts"],"names":[],"mappings":"AA4BA,wBAAsB,MAAM,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAqB3D"}
1
+ {"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../src/node/app.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,kBAAkB,CAAC"}
package/lib/node/app.js CHANGED
@@ -1,6 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.launch = void 0;
4
3
  /********************************************************************************
5
4
  * Copyright (c) 2022-2023 STMicroelectronics and others.
6
5
  *
@@ -16,27 +15,29 @@ exports.launch = void 0;
16
15
  *
17
16
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
18
17
  ********************************************************************************/
18
+ require("reflect-metadata");
19
19
  const layout_elk_1 = require("@eclipse-glsp/layout-elk");
20
20
  const node_1 = require("@eclipse-glsp/server/node");
21
21
  const inversify_1 = require("inversify");
22
22
  const workflow_layout_configurator_1 = require("../common/layout/workflow-layout-configurator");
23
23
  const workflow_diagram_module_1 = require("../common/workflow-diagram-module");
24
+ const workflow_cli_parser_1 = require("./workflow-cli-parser");
24
25
  async function launch(argv) {
25
- let logger;
26
- try {
27
- const options = (0, node_1.createSocketCliParser)().parse(argv);
28
- const appContainer = new inversify_1.Container();
29
- appContainer.load((0, node_1.createAppModule)(options));
30
- logger = appContainer.get(node_1.LoggerFactory)('WorkflowServerApp');
26
+ const options = (0, workflow_cli_parser_1.createWorkflowCliParser)().parse(argv);
27
+ const appContainer = new inversify_1.Container();
28
+ appContainer.load((0, node_1.createAppModule)(options));
29
+ const elkLayoutModule = (0, layout_elk_1.configureELKLayoutModule)({ algorithms: ['layered'], layoutConfigurator: workflow_layout_configurator_1.WorkflowLayoutConfigurator });
30
+ const serverModule = new workflow_diagram_module_1.WorkflowServerModule().configureDiagramModule(new workflow_diagram_module_1.WorkflowDiagramModule(() => node_1.GModelStorage), elkLayoutModule);
31
+ if (options.webSocket) {
32
+ const launcher = appContainer.resolve(node_1.WebSocketServerLauncher);
33
+ launcher.configure(serverModule);
34
+ launcher.start({ port: options.port, host: options.host, path: 'workflow' });
35
+ }
36
+ else {
31
37
  const launcher = appContainer.resolve(node_1.SocketServerLauncher);
32
- const elkLayoutModule = (0, layout_elk_1.configureELKLayoutModule)({ algorithms: ['layered'], layoutConfigurator: workflow_layout_configurator_1.WorkflowLayoutConfigurator });
33
- const serverModule = new workflow_diagram_module_1.WorkflowServerModule().configureDiagramModule(new workflow_diagram_module_1.WorkflowDiagramModule(() => node_1.GModelStorage), elkLayoutModule);
34
38
  launcher.configure(serverModule);
35
39
  launcher.start({ port: options.port, host: options.host });
36
40
  }
37
- catch (error) {
38
- (logger !== null && logger !== void 0 ? logger : console).error('Error in workflow server launcher:', error);
39
- }
40
41
  }
41
- exports.launch = launch;
42
+ launch(process.argv).catch(error => console.error('Error in workflow server launcher:', error));
42
43
  //# sourceMappingURL=app.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"app.js","sourceRoot":"","sources":["../../src/node/app.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,yDAAoE;AACpE,oDAOmC;AACnC,yCAAsC;AACtC,gGAA2F;AAC3F,+EAAgG;AAEzF,KAAK,UAAU,MAAM,CAAC,IAAe;IACxC,IAAI,MAA0B,CAAC;IAC/B,IAAI;QACA,MAAM,OAAO,GAAG,IAAA,4BAAqB,GAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACpD,MAAM,YAAY,GAAG,IAAI,qBAAS,EAAE,CAAC;QACrC,YAAY,CAAC,IAAI,CAAC,IAAA,sBAAe,EAAC,OAAO,CAAC,CAAC,CAAC;QAE5C,MAAM,GAAG,YAAY,CAAC,GAAG,CAAgB,oBAAa,CAAC,CAAC,mBAAmB,CAAC,CAAC;QAC7E,MAAM,QAAQ,GAAG,YAAY,CAAC,OAAO,CAAC,2BAAoB,CAAC,CAAC;QAC5D,MAAM,eAAe,GAAG,IAAA,qCAAwB,EAAC,EAAE,UAAU,EAAE,CAAC,SAAS,CAAC,EAAE,kBAAkB,EAAE,yDAA0B,EAAE,CAAC,CAAC;QAC9H,MAAM,YAAY,GAAG,IAAI,8CAAoB,EAAE,CAAC,sBAAsB,CAClE,IAAI,+CAAqB,CAAC,GAAG,EAAE,CAAC,oBAAa,CAAC,EAC9C,eAAe,CAClB,CAAC;QAEF,QAAQ,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;QAEjC,QAAQ,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;KAC9D;IAAC,OAAO,KAAK,EAAE;QACZ,CAAC,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,OAAO,CAAC,CAAC,KAAK,CAAC,oCAAoC,EAAE,KAAK,CAAC,CAAC;KAC1E;AACL,CAAC;AArBD,wBAqBC"}
1
+ {"version":3,"file":"app.js","sourceRoot":"","sources":["../../src/node/app.ts"],"names":[],"mappings":";;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,4BAA0B;AAE1B,yDAAoE;AACpE,oDAA0H;AAC1H,yCAAsC;AAEtC,gGAA2F;AAC3F,+EAAgG;AAChG,+DAAgE;AAEhE,KAAK,UAAU,MAAM,CAAC,IAAe;IACjC,MAAM,OAAO,GAAG,IAAA,6CAAuB,GAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACtD,MAAM,YAAY,GAAG,IAAI,qBAAS,EAAE,CAAC;IACrC,YAAY,CAAC,IAAI,CAAC,IAAA,sBAAe,EAAC,OAAO,CAAC,CAAC,CAAC;IAE5C,MAAM,eAAe,GAAG,IAAA,qCAAwB,EAAC,EAAE,UAAU,EAAE,CAAC,SAAS,CAAC,EAAE,kBAAkB,EAAE,yDAA0B,EAAE,CAAC,CAAC;IAC9H,MAAM,YAAY,GAAG,IAAI,8CAAoB,EAAE,CAAC,sBAAsB,CAAC,IAAI,+CAAqB,CAAC,GAAG,EAAE,CAAC,oBAAa,CAAC,EAAE,eAAe,CAAC,CAAC;IAExI,IAAI,OAAO,CAAC,SAAS,EAAE;QACnB,MAAM,QAAQ,GAAG,YAAY,CAAC,OAAO,CAAC,8BAAuB,CAAC,CAAC;QAC/D,QAAQ,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;QACjC,QAAQ,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC;KAChF;SAAM;QACH,MAAM,QAAQ,GAAG,YAAY,CAAC,OAAO,CAAC,2BAAoB,CAAC,CAAC;QAC5D,QAAQ,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;QACjC,QAAQ,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;KAC9D;AACL,CAAC;AAED,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,oCAAoC,EAAE,KAAK,CAAC,CAAC,CAAC"}
@@ -13,5 +13,6 @@
13
13
  *
14
14
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
15
  ********************************************************************************/
16
- import 'reflect-metadata';
16
+ export * from '../common/index';
17
+ export * from './workflow-cli-parser';
17
18
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/node/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/node/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC"}
package/lib/node/index.js CHANGED
@@ -1,4 +1,18 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
2
16
  Object.defineProperty(exports, "__esModule", { value: true });
3
17
  /********************************************************************************
4
18
  * Copyright (c) 2022-2023 EclipseSource and others.
@@ -15,7 +29,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
15
29
  *
16
30
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
17
31
  ********************************************************************************/
18
- require("reflect-metadata");
19
- const app_1 = require("./app");
20
- (0, app_1.launch)(process.argv);
32
+ __exportStar(require("../common/index"), exports);
33
+ __exportStar(require("./workflow-cli-parser"), exports);
21
34
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/node/index.ts"],"names":[],"mappings":";;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,4BAA0B;AAC1B,+BAA+B;AAE/B,IAAA,YAAM,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/node/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,kDAAgC;AAChC,wDAAsC"}
@@ -0,0 +1,21 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2023 EclipseSource and others.
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the Eclipse Public License v. 2.0 which is available at
6
+ * http://www.eclipse.org/legal/epl-2.0.
7
+ *
8
+ * This Source Code may also be made available under the following Secondary
9
+ * Licenses when the conditions for such availability set forth in the Eclipse
10
+ * Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ * with the GNU Classpath Exception which is available at
12
+ * https://www.gnu.org/software/classpath/license.html.
13
+ *
14
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
+ ********************************************************************************/
16
+ import { CliParser, SocketLaunchOptions } from '@eclipse-glsp/server/node';
17
+ export interface WorkflowLaunchOptions extends SocketLaunchOptions {
18
+ webSocket: boolean;
19
+ }
20
+ export declare function createWorkflowCliParser<O extends WorkflowLaunchOptions = WorkflowLaunchOptions>(defaultOptions?: WorkflowLaunchOptions): CliParser<O>;
21
+ //# sourceMappingURL=workflow-cli-parser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflow-cli-parser.d.ts","sourceRoot":"","sources":["../../src/node/workflow-cli-parser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,OAAO,EAAE,SAAS,EAAqD,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAE9H,MAAM,WAAW,qBAAsB,SAAQ,mBAAmB;IAC9D,SAAS,EAAE,OAAO,CAAC;CACtB;AAED,wBAAgB,uBAAuB,CAAC,CAAC,SAAS,qBAAqB,GAAG,qBAAqB,EAC3F,cAAc,GAAE,qBAA2E,GAC5F,SAAS,CAAC,CAAC,CAAC,CAId"}
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ /********************************************************************************
3
+ * Copyright (c) 2023 EclipseSource and others.
4
+ *
5
+ * This program and the accompanying materials are made available under the
6
+ * terms of the Eclipse Public License v. 2.0 which is available at
7
+ * http://www.eclipse.org/legal/epl-2.0.
8
+ *
9
+ * This Source Code may also be made available under the following Secondary
10
+ * Licenses when the conditions for such availability set forth in the Eclipse
11
+ * Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
+ * with the GNU Classpath Exception which is available at
13
+ * https://www.gnu.org/software/classpath/license.html.
14
+ *
15
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
16
+ ********************************************************************************/
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.createWorkflowCliParser = void 0;
19
+ const node_1 = require("@eclipse-glsp/server/node");
20
+ function createWorkflowCliParser(defaultOptions = Object.assign({ webSocket: false }, node_1.defaultSocketLaunchOptions)) {
21
+ const parser = (0, node_1.createSocketCliParser)(defaultOptions);
22
+ parser.command.option('-w , --webSocket', 'Flag to use websocket launcher instead of default launcher', false);
23
+ return parser;
24
+ }
25
+ exports.createWorkflowCliParser = createWorkflowCliParser;
26
+ //# sourceMappingURL=workflow-cli-parser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflow-cli-parser.js","sourceRoot":"","sources":["../../src/node/workflow-cli-parser.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;AAElF,oDAA8H;AAM9H,SAAgB,uBAAuB,CACnC,iCAA0C,SAAS,EAAE,KAAK,IAAK,iCAA0B,CAAE;IAE3F,MAAM,MAAM,GAAG,IAAA,4BAAqB,EAAI,cAAc,CAAC,CAAC;IACxD,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,kBAAkB,EAAE,4DAA4D,EAAE,KAAK,CAAC,CAAC;IAC/G,OAAO,MAAM,CAAC;AAClB,CAAC;AAND,0DAMC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eclipse-glsp-examples/workflow-server",
3
- "version": "1.1.0-next.385269d.45+385269d",
3
+ "version": "1.1.0-next.3bba361.48+3bba361",
4
4
  "description": "GLSP node server for the workflow example",
5
5
  "keywords": [
6
6
  "eclipse",
@@ -49,12 +49,13 @@
49
49
  "lint": "eslint --ext .ts,.tsx ./src",
50
50
  "lint:ci": "yarn lint -o eslint.xml -f checkstyle",
51
51
  "prepare": "yarn clean && yarn build",
52
- "start": "node --enable-source-maps bundle/wf-glsp-server-node.js",
52
+ "start": "node --enable-source-maps bundle/wf-glsp-server-node.js --port 5007",
53
+ "start:websocket": "node --enable-source-maps bundle/wf-glsp-server-node.js -w --port 8081",
53
54
  "watch": "tsc -w"
54
55
  },
55
56
  "dependencies": {
56
- "@eclipse-glsp/layout-elk": "1.1.0-next.385269d.45+385269d",
57
- "@eclipse-glsp/server": "1.1.0-next.385269d.45+385269d"
57
+ "@eclipse-glsp/layout-elk": "1.1.0-next.3bba361.48+3bba361",
58
+ "@eclipse-glsp/server": "1.1.0-next.3bba361.48+3bba361"
58
59
  },
59
60
  "devDependencies": {
60
61
  "source-map-loader": "^4.0.1",
@@ -64,5 +65,5 @@
64
65
  "publishConfig": {
65
66
  "access": "public"
66
67
  },
67
- "gitHead": "385269d513176d37f7ff77a4ae170f4f288d36b2"
68
+ "gitHead": "3bba3614b06db8416b04f226a97b1d7d8962460b"
68
69
  }
@@ -13,33 +13,30 @@
13
13
  *
14
14
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
15
  ********************************************************************************/
16
+ import 'reflect-metadata';
17
+
16
18
  import { configureELKLayoutModule } from '@eclipse-glsp/layout-elk';
17
- import { createAppModule, Logger, LoggerFactory, LogLevel, WorkerServerLauncher } from '@eclipse-glsp/server/browser';
19
+ import { createAppModule, LogLevel, WorkerServerLauncher } from '@eclipse-glsp/server/browser';
18
20
  import { Container } from 'inversify';
19
21
  import { WorkflowLayoutConfigurator } from '../common/layout/workflow-layout-configurator';
20
22
  import { WorkflowDiagramModule, WorkflowServerModule } from '../common/workflow-diagram-module';
21
23
  import { WorkflowMockModelStorage } from './mock-model-storage';
22
24
 
23
25
  export async function launch(argv?: string[]): Promise<void> {
24
- let logger: Logger | undefined;
25
-
26
- try {
27
- const appContainer = new Container();
28
- appContainer.load(createAppModule({ logLevel: LogLevel.info }));
26
+ const appContainer = new Container();
27
+ appContainer.load(createAppModule({ logLevel: LogLevel.info }));
29
28
 
30
- logger = appContainer.get<LoggerFactory>(LoggerFactory)('WorkflowServerApp');
31
- const launcher = appContainer.resolve(WorkerServerLauncher);
32
- const elkLayoutModule = configureELKLayoutModule({ algorithms: ['layered'], layoutConfigurator: WorkflowLayoutConfigurator });
29
+ const launcher = appContainer.resolve(WorkerServerLauncher);
30
+ const elkLayoutModule = configureELKLayoutModule({ algorithms: ['layered'], layoutConfigurator: WorkflowLayoutConfigurator });
33
31
 
34
- const serverModule = new WorkflowServerModule().configureDiagramModule(
35
- new WorkflowDiagramModule(() => WorkflowMockModelStorage),
36
- elkLayoutModule
37
- );
32
+ const serverModule = new WorkflowServerModule().configureDiagramModule(
33
+ new WorkflowDiagramModule(() => WorkflowMockModelStorage),
34
+ elkLayoutModule
35
+ );
38
36
 
39
- launcher.configure(serverModule);
37
+ launcher.configure(serverModule);
40
38
 
41
- await launcher.start();
42
- } catch (error) {
43
- (logger ?? console).error('Error in workflow server launcher:', error);
44
- }
39
+ await launcher.start({});
45
40
  }
41
+
42
+ launch().catch(error => console.error('Error in workflow server launcher:', error));
@@ -13,7 +13,5 @@
13
13
  *
14
14
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
15
  ********************************************************************************/
16
- import 'reflect-metadata';
17
- import { launch } from './app';
18
-
19
- launch();
16
+ export * from '../common/index';
17
+ export * from './mock-model-storage';
@@ -0,0 +1,50 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2023 STMicroelectronics and others.
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the Eclipse Public License v. 2.0 which is available at
6
+ * http://www.eclipse.org/legal/epl-2.0.
7
+ *
8
+ * This Source Code may also be made available under the following Secondary
9
+ * Licenses when the conditions for such availability set forth in the Eclipse
10
+ * Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ * with the GNU Classpath Exception which is available at
12
+ * https://www.gnu.org/software/classpath/license.html.
13
+ *
14
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
+ ********************************************************************************/
16
+
17
+ export * from './graph-extension';
18
+ export * from './handler/create-activity-node-handler';
19
+ export * from './handler/create-automated-task-handler';
20
+ export * from './handler/create-category-handler';
21
+ export * from './handler/create-decision-node-handler';
22
+ export * from './handler/create-edge-handler';
23
+ export * from './handler/create-fork-node-handler';
24
+ export * from './handler/create-fork-or-join-node-handler';
25
+ export * from './handler/create-join-node-handler';
26
+ export * from './handler/create-manual-task-handler';
27
+ export * from './handler/create-merge-node-handler';
28
+ export * from './handler/create-task-handler';
29
+ export * from './handler/create-weighted-edge-handler';
30
+ export * from './handler/create-workflow-node-operation-handler';
31
+ export * from './handler/grid-snapper';
32
+ export * from './index';
33
+ export * from './labeledit/workflow-label-edit-validator';
34
+ export * from './layout/workflow-layout-configurator';
35
+ export * from './marker/workflow-model-validator';
36
+ export * from './model/workflow-navigation-target-resolver';
37
+ export * from './provider/abstract-next-or-previous-navigation-target-provider';
38
+ export * from './provider/next-node-navigation-target-provider';
39
+ export * from './provider/node-documentation-navigation-target-provider';
40
+ export * from './provider/previous-node-navigation-target-provider';
41
+ export * from './provider/workflow-command-palette-action-provider';
42
+ export * from './provider/workflow-context-menu-item-provider';
43
+ export * from './taskedit/edit-task-operation-handler';
44
+ export * from './taskedit/task-edit-context-provider';
45
+ export * from './taskedit/task-edit-validator';
46
+ export * from './util/model-types';
47
+ export * from './workflow-diagram-configuration';
48
+ export * from './workflow-diagram-module';
49
+ export * from './workflow-glsp-server';
50
+ export * from './workflow-popup-factory';
package/src/node/app.ts CHANGED
@@ -13,38 +13,33 @@
13
13
  *
14
14
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
15
  ********************************************************************************/
16
+ import 'reflect-metadata';
17
+
16
18
  import { configureELKLayoutModule } from '@eclipse-glsp/layout-elk';
17
- import {
18
- createAppModule,
19
- createSocketCliParser,
20
- GModelStorage,
21
- Logger,
22
- LoggerFactory,
23
- SocketServerLauncher
24
- } from '@eclipse-glsp/server/node';
19
+ import { createAppModule, GModelStorage, SocketServerLauncher, WebSocketServerLauncher } from '@eclipse-glsp/server/node';
25
20
  import { Container } from 'inversify';
21
+
26
22
  import { WorkflowLayoutConfigurator } from '../common/layout/workflow-layout-configurator';
27
23
  import { WorkflowDiagramModule, WorkflowServerModule } from '../common/workflow-diagram-module';
24
+ import { createWorkflowCliParser } from './workflow-cli-parser';
28
25
 
29
- export async function launch(argv?: string[]): Promise<void> {
30
- let logger: Logger | undefined;
31
- try {
32
- const options = createSocketCliParser().parse(argv);
33
- const appContainer = new Container();
34
- appContainer.load(createAppModule(options));
26
+ async function launch(argv?: string[]): Promise<void> {
27
+ const options = createWorkflowCliParser().parse(argv);
28
+ const appContainer = new Container();
29
+ appContainer.load(createAppModule(options));
35
30
 
36
- logger = appContainer.get<LoggerFactory>(LoggerFactory)('WorkflowServerApp');
37
- const launcher = appContainer.resolve(SocketServerLauncher);
38
- const elkLayoutModule = configureELKLayoutModule({ algorithms: ['layered'], layoutConfigurator: WorkflowLayoutConfigurator });
39
- const serverModule = new WorkflowServerModule().configureDiagramModule(
40
- new WorkflowDiagramModule(() => GModelStorage),
41
- elkLayoutModule
42
- );
31
+ const elkLayoutModule = configureELKLayoutModule({ algorithms: ['layered'], layoutConfigurator: WorkflowLayoutConfigurator });
32
+ const serverModule = new WorkflowServerModule().configureDiagramModule(new WorkflowDiagramModule(() => GModelStorage), elkLayoutModule);
43
33
 
34
+ if (options.webSocket) {
35
+ const launcher = appContainer.resolve(WebSocketServerLauncher);
36
+ launcher.configure(serverModule);
37
+ launcher.start({ port: options.port, host: options.host, path: 'workflow' });
38
+ } else {
39
+ const launcher = appContainer.resolve(SocketServerLauncher);
44
40
  launcher.configure(serverModule);
45
-
46
41
  launcher.start({ port: options.port, host: options.host });
47
- } catch (error) {
48
- (logger ?? console).error('Error in workflow server launcher:', error);
49
42
  }
50
43
  }
44
+
45
+ launch(process.argv).catch(error => console.error('Error in workflow server launcher:', error));
package/src/node/index.ts CHANGED
@@ -13,7 +13,5 @@
13
13
  *
14
14
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
15
  ********************************************************************************/
16
- import 'reflect-metadata';
17
- import { launch } from './app';
18
-
19
- launch(process.argv);
16
+ export * from '../common/index';
17
+ export * from './workflow-cli-parser';
@@ -0,0 +1,29 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2023 EclipseSource and others.
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the Eclipse Public License v. 2.0 which is available at
6
+ * http://www.eclipse.org/legal/epl-2.0.
7
+ *
8
+ * This Source Code may also be made available under the following Secondary
9
+ * Licenses when the conditions for such availability set forth in the Eclipse
10
+ * Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ * with the GNU Classpath Exception which is available at
12
+ * https://www.gnu.org/software/classpath/license.html.
13
+ *
14
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
+ ********************************************************************************/
16
+
17
+ import { CliParser, createSocketCliParser, defaultSocketLaunchOptions, SocketLaunchOptions } from '@eclipse-glsp/server/node';
18
+
19
+ export interface WorkflowLaunchOptions extends SocketLaunchOptions {
20
+ webSocket: boolean;
21
+ }
22
+
23
+ export function createWorkflowCliParser<O extends WorkflowLaunchOptions = WorkflowLaunchOptions>(
24
+ defaultOptions: WorkflowLaunchOptions = { webSocket: false, ...defaultSocketLaunchOptions }
25
+ ): CliParser<O> {
26
+ const parser = createSocketCliParser<O>(defaultOptions);
27
+ parser.command.option('-w , --webSocket', 'Flag to use websocket launcher instead of default launcher', false);
28
+ return parser;
29
+ }