@eclipse-glsp/server 1.1.0-RC05
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/LICENSE +642 -0
- package/README.md +8 -0
- package/browser.d.ts +16 -0
- package/browser.js +18 -0
- package/lib/browser/di/app-module.d.ts +24 -0
- package/lib/browser/di/app-module.d.ts.map +1 -0
- package/lib/browser/di/app-module.js +55 -0
- package/lib/browser/di/app-module.js.map +1 -0
- package/lib/browser/di/console-logger.d.ts +29 -0
- package/lib/browser/di/console-logger.d.ts.map +1 -0
- package/lib/browser/di/console-logger.js +81 -0
- package/lib/browser/di/console-logger.js.map +1 -0
- package/lib/browser/index.d.ts +20 -0
- package/lib/browser/index.d.ts.map +1 -0
- package/lib/browser/index.js +36 -0
- package/lib/browser/index.js.map +1 -0
- package/lib/browser/launch/worker-server-launcher.d.ts +26 -0
- package/lib/browser/launch/worker-server-launcher.d.ts.map +1 -0
- package/lib/browser/launch/worker-server-launcher.js +65 -0
- package/lib/browser/launch/worker-server-launcher.js.map +1 -0
- package/lib/common/actions/action-dispatcher.d.ts +74 -0
- package/lib/common/actions/action-dispatcher.d.ts.map +1 -0
- package/lib/common/actions/action-dispatcher.js +128 -0
- package/lib/common/actions/action-dispatcher.js.map +1 -0
- package/lib/common/actions/action-dispatcher.spec.d.ts +2 -0
- package/lib/common/actions/action-dispatcher.spec.d.ts.map +1 -0
- package/lib/common/actions/action-dispatcher.spec.js +264 -0
- package/lib/common/actions/action-dispatcher.spec.js.map +1 -0
- package/lib/common/actions/action-handler-registry.d.ts +40 -0
- package/lib/common/actions/action-handler-registry.d.ts.map +1 -0
- package/lib/common/actions/action-handler-registry.js +65 -0
- package/lib/common/actions/action-handler-registry.js.map +1 -0
- package/lib/common/actions/action-handler-registry.spec.d.ts +2 -0
- package/lib/common/actions/action-handler-registry.spec.d.ts.map +1 -0
- package/lib/common/actions/action-handler-registry.spec.js +50 -0
- package/lib/common/actions/action-handler-registry.spec.js.map +1 -0
- package/lib/common/actions/action-handler.d.ts +55 -0
- package/lib/common/actions/action-handler.d.ts.map +1 -0
- package/lib/common/actions/action-handler.js +7 -0
- package/lib/common/actions/action-handler.js.map +1 -0
- package/lib/common/actions/client-action-handler.d.ts +30 -0
- package/lib/common/actions/client-action-handler.d.ts.map +1 -0
- package/lib/common/actions/client-action-handler.js +56 -0
- package/lib/common/actions/client-action-handler.js.map +1 -0
- package/lib/common/actions/global-action-provider.d.ts +30 -0
- package/lib/common/actions/global-action-provider.d.ts.map +1 -0
- package/lib/common/actions/global-action-provider.js +81 -0
- package/lib/common/actions/global-action-provider.js.map +1 -0
- package/lib/common/actions/global-action-provider.spec.d.ts +2 -0
- package/lib/common/actions/global-action-provider.spec.d.ts.map +1 -0
- package/lib/common/actions/global-action-provider.spec.js +70 -0
- package/lib/common/actions/global-action-provider.spec.js.map +1 -0
- package/lib/common/command/command-stack.d.ts +67 -0
- package/lib/common/command/command-stack.d.ts.map +1 -0
- package/lib/common/command/command-stack.js +117 -0
- package/lib/common/command/command-stack.js.map +1 -0
- package/lib/common/command/command-stack.spec.d.ts +2 -0
- package/lib/common/command/command-stack.spec.d.ts.map +1 -0
- package/lib/common/command/command-stack.spec.js +207 -0
- package/lib/common/command/command-stack.spec.js.map +1 -0
- package/lib/common/command/command.d.ts +63 -0
- package/lib/common/command/command.d.ts.map +1 -0
- package/lib/common/command/command.js +87 -0
- package/lib/common/command/command.js.map +1 -0
- package/lib/common/command/command.spec.d.ts +2 -0
- package/lib/common/command/command.spec.d.ts.map +1 -0
- package/lib/common/command/command.spec.js +86 -0
- package/lib/common/command/command.spec.js.map +1 -0
- package/lib/common/command/recording-command.d.ts +75 -0
- package/lib/common/command/recording-command.d.ts.map +1 -0
- package/lib/common/command/recording-command.js +99 -0
- package/lib/common/command/recording-command.js.map +1 -0
- package/lib/common/command/recording-command.spec.d.ts +17 -0
- package/lib/common/command/recording-command.spec.d.ts.map +1 -0
- package/lib/common/command/recording-command.spec.js +62 -0
- package/lib/common/command/recording-command.spec.js.map +1 -0
- package/lib/common/command/undo-redo-action-handler.d.ts +28 -0
- package/lib/common/command/undo-redo-action-handler.d.ts.map +1 -0
- package/lib/common/command/undo-redo-action-handler.js +72 -0
- package/lib/common/command/undo-redo-action-handler.js.map +1 -0
- package/lib/common/di/binding-target.d.ts +73 -0
- package/lib/common/di/binding-target.d.ts.map +1 -0
- package/lib/common/di/binding-target.js +143 -0
- package/lib/common/di/binding-target.js.map +1 -0
- package/lib/common/di/binding-target.spec.d.ts +2 -0
- package/lib/common/di/binding-target.spec.d.ts.map +1 -0
- package/lib/common/di/binding-target.spec.js +121 -0
- package/lib/common/di/binding-target.spec.js.map +1 -0
- package/lib/common/di/client-session-module.d.ts +19 -0
- package/lib/common/di/client-session-module.d.ts.map +1 -0
- package/lib/common/di/client-session-module.js +34 -0
- package/lib/common/di/client-session-module.js.map +1 -0
- package/lib/common/di/diagram-module.d.ts +130 -0
- package/lib/common/di/diagram-module.d.ts.map +1 -0
- package/lib/common/di/diagram-module.js +295 -0
- package/lib/common/di/diagram-module.js.map +1 -0
- package/lib/common/di/glsp-module.d.ts +47 -0
- package/lib/common/di/glsp-module.d.ts.map +1 -0
- package/lib/common/di/glsp-module.js +59 -0
- package/lib/common/di/glsp-module.js.map +1 -0
- package/lib/common/di/multi-binding.d.ts +41 -0
- package/lib/common/di/multi-binding.d.ts.map +1 -0
- package/lib/common/di/multi-binding.js +82 -0
- package/lib/common/di/multi-binding.js.map +1 -0
- package/lib/common/di/multi-bindings.spec.d.ts +2 -0
- package/lib/common/di/multi-bindings.spec.d.ts.map +1 -0
- package/lib/common/di/multi-bindings.spec.js +137 -0
- package/lib/common/di/multi-bindings.spec.js.map +1 -0
- package/lib/common/di/server-module.d.ts +73 -0
- package/lib/common/di/server-module.d.ts.map +1 -0
- package/lib/common/di/server-module.js +103 -0
- package/lib/common/di/server-module.js.map +1 -0
- package/lib/common/di/service-identifiers.d.ts +29 -0
- package/lib/common/di/service-identifiers.d.ts.map +1 -0
- package/lib/common/di/service-identifiers.js +14 -0
- package/lib/common/di/service-identifiers.js.map +1 -0
- package/lib/common/diagram/diagram-configuration.d.ts +89 -0
- package/lib/common/diagram/diagram-configuration.d.ts.map +1 -0
- package/lib/common/diagram/diagram-configuration.js +30 -0
- package/lib/common/diagram/diagram-configuration.js.map +1 -0
- package/lib/common/diagram/request-type-hints-action-handler.d.ts +25 -0
- package/lib/common/diagram/request-type-hints-action-handler.d.ts.map +1 -0
- package/lib/common/diagram/request-type-hints-action-handler.js +53 -0
- package/lib/common/diagram/request-type-hints-action-handler.js.map +1 -0
- package/lib/common/diagram/request-type-hints-action-handler.spec.d.ts +2 -0
- package/lib/common/diagram/request-type-hints-action-handler.spec.d.ts.map +1 -0
- package/lib/common/diagram/request-type-hints-action-handler.spec.js +57 -0
- package/lib/common/diagram/request-type-hints-action-handler.spec.js.map +1 -0
- package/lib/common/features/clipboard/request-clipboard-data-action-handler.d.ts +26 -0
- package/lib/common/features/clipboard/request-clipboard-data-action-handler.d.ts.map +1 -0
- package/lib/common/features/clipboard/request-clipboard-data-action-handler.js +61 -0
- package/lib/common/features/clipboard/request-clipboard-data-action-handler.js.map +1 -0
- package/lib/common/features/contextactions/command-palette-action-provider.d.ts +63 -0
- package/lib/common/features/contextactions/command-palette-action-provider.d.ts.map +1 -0
- package/lib/common/features/contextactions/command-palette-action-provider.js +72 -0
- package/lib/common/features/contextactions/command-palette-action-provider.js.map +1 -0
- package/lib/common/features/contextactions/context-actions-provider-registry.d.ts +12 -0
- package/lib/common/features/contextactions/context-actions-provider-registry.d.ts.map +1 -0
- package/lib/common/features/contextactions/context-actions-provider-registry.js +70 -0
- package/lib/common/features/contextactions/context-actions-provider-registry.js.map +1 -0
- package/lib/common/features/contextactions/context-actions-provider-registry.spec.d.ts +2 -0
- package/lib/common/features/contextactions/context-actions-provider-registry.spec.d.ts.map +1 -0
- package/lib/common/features/contextactions/context-actions-provider-registry.spec.js +34 -0
- package/lib/common/features/contextactions/context-actions-provider-registry.spec.js.map +1 -0
- package/lib/common/features/contextactions/context-actions-provider.d.ts +34 -0
- package/lib/common/features/contextactions/context-actions-provider.d.ts.map +1 -0
- package/lib/common/features/contextactions/context-actions-provider.js +5 -0
- package/lib/common/features/contextactions/context-actions-provider.js.map +1 -0
- package/lib/common/features/contextactions/context-menu-item-provider.d.ts +43 -0
- package/lib/common/features/contextactions/context-menu-item-provider.d.ts.map +1 -0
- package/lib/common/features/contextactions/context-menu-item-provider.js +36 -0
- package/lib/common/features/contextactions/context-menu-item-provider.js.map +1 -0
- package/lib/common/features/contextactions/request-context-actions-handler.d.ts +24 -0
- package/lib/common/features/contextactions/request-context-actions-handler.d.ts.map +1 -0
- package/lib/common/features/contextactions/request-context-actions-handler.js +53 -0
- package/lib/common/features/contextactions/request-context-actions-handler.js.map +1 -0
- package/lib/common/features/contextactions/request-context-actions-handler.spec.d.ts +2 -0
- package/lib/common/features/contextactions/request-context-actions-handler.spec.d.ts.map +1 -0
- package/lib/common/features/contextactions/request-context-actions-handler.spec.js +63 -0
- package/lib/common/features/contextactions/request-context-actions-handler.spec.js.map +1 -0
- package/lib/common/features/contextactions/tool-palette-item-provider.d.ts +50 -0
- package/lib/common/features/contextactions/tool-palette-item-provider.d.ts.map +1 -0
- package/lib/common/features/contextactions/tool-palette-item-provider.js +86 -0
- package/lib/common/features/contextactions/tool-palette-item-provider.js.map +1 -0
- package/lib/common/features/contextactions/tool-palette-item-provider.spec.d.ts +2 -0
- package/lib/common/features/contextactions/tool-palette-item-provider.spec.d.ts.map +1 -0
- package/lib/common/features/contextactions/tool-palette-item-provider.spec.js +48 -0
- package/lib/common/features/contextactions/tool-palette-item-provider.spec.js.map +1 -0
- package/lib/common/features/directediting/context-edit-validator-registry.d.ts +14 -0
- package/lib/common/features/directediting/context-edit-validator-registry.d.ts.map +1 -0
- package/lib/common/features/directediting/context-edit-validator-registry.js +57 -0
- package/lib/common/features/directediting/context-edit-validator-registry.js.map +1 -0
- package/lib/common/features/directediting/context-edit-validator-registry.spec.d.ts +2 -0
- package/lib/common/features/directediting/context-edit-validator-registry.spec.d.ts.map +1 -0
- package/lib/common/features/directediting/context-edit-validator-registry.spec.js +44 -0
- package/lib/common/features/directediting/context-edit-validator-registry.spec.js.map +1 -0
- package/lib/common/features/directediting/context-edit-validator.d.ts +25 -0
- package/lib/common/features/directediting/context-edit-validator.d.ts.map +1 -0
- package/lib/common/features/directediting/context-edit-validator.js +40 -0
- package/lib/common/features/directediting/context-edit-validator.js.map +1 -0
- package/lib/common/features/directediting/label-edit-validator.d.ts +32 -0
- package/lib/common/features/directediting/label-edit-validator.d.ts.map +1 -0
- package/lib/common/features/directediting/label-edit-validator.js +21 -0
- package/lib/common/features/directediting/label-edit-validator.js.map +1 -0
- package/lib/common/features/directediting/request-edit-validation-handler.d.ts +26 -0
- package/lib/common/features/directediting/request-edit-validation-handler.d.ts.map +1 -0
- package/lib/common/features/directediting/request-edit-validation-handler.js +61 -0
- package/lib/common/features/directediting/request-edit-validation-handler.js.map +1 -0
- package/lib/common/features/directediting/request-edit-validation-handler.spec.d.ts +2 -0
- package/lib/common/features/directediting/request-edit-validation-handler.spec.d.ts.map +1 -0
- package/lib/common/features/directediting/request-edit-validation-handler.spec.js +97 -0
- package/lib/common/features/directediting/request-edit-validation-handler.spec.js.map +1 -0
- package/lib/common/features/layout/computed-bounds-action-handler.d.ts +34 -0
- package/lib/common/features/layout/computed-bounds-action-handler.d.ts.map +1 -0
- package/lib/common/features/layout/computed-bounds-action-handler.js +55 -0
- package/lib/common/features/layout/computed-bounds-action-handler.js.map +1 -0
- package/lib/common/features/layout/layout-engine.d.ts +29 -0
- package/lib/common/features/layout/layout-engine.d.ts.map +1 -0
- package/lib/common/features/layout/layout-engine.js +20 -0
- package/lib/common/features/layout/layout-engine.js.map +1 -0
- package/lib/common/features/layout/layout-operation-handler.d.ts +37 -0
- package/lib/common/features/layout/layout-operation-handler.d.ts.map +1 -0
- package/lib/common/features/layout/layout-operation-handler.js +82 -0
- package/lib/common/features/layout/layout-operation-handler.js.map +1 -0
- package/lib/common/features/model/gmodel-factory.d.ts +39 -0
- package/lib/common/features/model/gmodel-factory.d.ts.map +1 -0
- package/lib/common/features/model/gmodel-factory.js +39 -0
- package/lib/common/features/model/gmodel-factory.js.map +1 -0
- package/lib/common/features/model/gmodel-index.d.ts +107 -0
- package/lib/common/features/model/gmodel-index.d.ts.map +1 -0
- package/lib/common/features/model/gmodel-index.js +193 -0
- package/lib/common/features/model/gmodel-index.js.map +1 -0
- package/lib/common/features/model/gmodel-serializer.d.ts +67 -0
- package/lib/common/features/model/gmodel-serializer.d.ts.map +1 -0
- package/lib/common/features/model/gmodel-serializer.js +143 -0
- package/lib/common/features/model/gmodel-serializer.js.map +1 -0
- package/lib/common/features/model/gmodel-serializer.spec.d.ts +2 -0
- package/lib/common/features/model/gmodel-serializer.spec.d.ts.map +1 -0
- package/lib/common/features/model/gmodel-serializer.spec.js +124 -0
- package/lib/common/features/model/gmodel-serializer.spec.js.map +1 -0
- package/lib/common/features/model/model-state.d.ts +51 -0
- package/lib/common/features/model/model-state.d.ts.map +1 -0
- package/lib/common/features/model/model-state.js +74 -0
- package/lib/common/features/model/model-state.js.map +1 -0
- package/lib/common/features/model/model-submission-handler.d.ts +58 -0
- package/lib/common/features/model/model-submission-handler.d.ts.map +1 -0
- package/lib/common/features/model/model-submission-handler.js +102 -0
- package/lib/common/features/model/model-submission-handler.js.map +1 -0
- package/lib/common/features/model/request-model-action-handler.d.ts +37 -0
- package/lib/common/features/model/request-model-action-handler.d.ts.map +1 -0
- package/lib/common/features/model/request-model-action-handler.js +83 -0
- package/lib/common/features/model/request-model-action-handler.js.map +1 -0
- package/lib/common/features/model/save-model-action-handler.d.ts +26 -0
- package/lib/common/features/model/save-model-action-handler.d.ts.map +1 -0
- package/lib/common/features/model/save-model-action-handler.js +54 -0
- package/lib/common/features/model/save-model-action-handler.js.map +1 -0
- package/lib/common/features/model/source-model-storage.d.ts +47 -0
- package/lib/common/features/model/source-model-storage.d.ts.map +1 -0
- package/lib/common/features/model/source-model-storage.js +5 -0
- package/lib/common/features/model/source-model-storage.js.map +1 -0
- package/lib/common/features/navigation/json-opener-options.d.ts +36 -0
- package/lib/common/features/navigation/json-opener-options.d.ts.map +1 -0
- package/lib/common/features/navigation/json-opener-options.js +60 -0
- package/lib/common/features/navigation/json-opener-options.js.map +1 -0
- package/lib/common/features/navigation/navigation-target-provider-registry.d.ts +12 -0
- package/lib/common/features/navigation/navigation-target-provider-registry.d.ts.map +1 -0
- package/lib/common/features/navigation/navigation-target-provider-registry.js +47 -0
- package/lib/common/features/navigation/navigation-target-provider-registry.js.map +1 -0
- package/lib/common/features/navigation/navigation-target-provider.d.ts +48 -0
- package/lib/common/features/navigation/navigation-target-provider.d.ts.map +1 -0
- package/lib/common/features/navigation/navigation-target-provider.js +5 -0
- package/lib/common/features/navigation/navigation-target-provider.js.map +1 -0
- package/lib/common/features/navigation/navigation-target-resolution.d.ts +23 -0
- package/lib/common/features/navigation/navigation-target-resolution.d.ts.map +1 -0
- package/lib/common/features/navigation/navigation-target-resolution.js +12 -0
- package/lib/common/features/navigation/navigation-target-resolution.js.map +1 -0
- package/lib/common/features/navigation/navigation-target-resolver.d.ts +31 -0
- package/lib/common/features/navigation/navigation-target-resolver.d.ts.map +1 -0
- package/lib/common/features/navigation/navigation-target-resolver.js +49 -0
- package/lib/common/features/navigation/navigation-target-resolver.js.map +1 -0
- package/lib/common/features/navigation/request-navigation-targets-action-handler.d.ts +24 -0
- package/lib/common/features/navigation/request-navigation-targets-action-handler.d.ts.map +1 -0
- package/lib/common/features/navigation/request-navigation-targets-action-handler.js +55 -0
- package/lib/common/features/navigation/request-navigation-targets-action-handler.js.map +1 -0
- package/lib/common/features/navigation/resolve-navigation-targets-action-handler.d.ts +26 -0
- package/lib/common/features/navigation/resolve-navigation-targets-action-handler.d.ts.map +1 -0
- package/lib/common/features/navigation/resolve-navigation-targets-action-handler.js +59 -0
- package/lib/common/features/navigation/resolve-navigation-targets-action-handler.js.map +1 -0
- package/lib/common/features/popup/popup-model-factory.d.ts +36 -0
- package/lib/common/features/popup/popup-model-factory.d.ts.map +1 -0
- package/lib/common/features/popup/popup-model-factory.js +20 -0
- package/lib/common/features/popup/popup-model-factory.js.map +1 -0
- package/lib/common/features/popup/request-popup-model-action-handler.d.ts +31 -0
- package/lib/common/features/popup/request-popup-model-action-handler.d.ts.map +1 -0
- package/lib/common/features/popup/request-popup-model-action-handler.js +77 -0
- package/lib/common/features/popup/request-popup-model-action-handler.js.map +1 -0
- package/lib/common/features/validation/model-validator.d.ts +33 -0
- package/lib/common/features/validation/model-validator.d.ts.map +1 -0
- package/lib/common/features/validation/model-validator.js +5 -0
- package/lib/common/features/validation/model-validator.js.map +1 -0
- package/lib/common/features/validation/request-markers-handler.d.ts +11 -0
- package/lib/common/features/validation/request-markers-handler.d.ts.map +1 -0
- package/lib/common/features/validation/request-markers-handler.js +70 -0
- package/lib/common/features/validation/request-markers-handler.js.map +1 -0
- package/lib/common/gmodel/apply-label-edit-operation-handler.d.ts +8 -0
- package/lib/common/gmodel/apply-label-edit-operation-handler.d.ts.map +1 -0
- package/lib/common/gmodel/apply-label-edit-operation-handler.js +46 -0
- package/lib/common/gmodel/apply-label-edit-operation-handler.js.map +1 -0
- package/lib/common/gmodel/change-bounds-operation-handler.d.ts +13 -0
- package/lib/common/gmodel/change-bounds-operation-handler.d.ts.map +1 -0
- package/lib/common/gmodel/change-bounds-operation-handler.js +71 -0
- package/lib/common/gmodel/change-bounds-operation-handler.js.map +1 -0
- package/lib/common/gmodel/change-routing-points-operation-handler.d.ts +24 -0
- package/lib/common/gmodel/change-routing-points-operation-handler.d.ts.map +1 -0
- package/lib/common/gmodel/change-routing-points-operation-handler.js +50 -0
- package/lib/common/gmodel/change-routing-points-operation-handler.js.map +1 -0
- package/lib/common/gmodel/cut-operation-handler.d.ts +26 -0
- package/lib/common/gmodel/cut-operation-handler.d.ts.map +1 -0
- package/lib/common/gmodel/cut-operation-handler.js +55 -0
- package/lib/common/gmodel/cut-operation-handler.js.map +1 -0
- package/lib/common/gmodel/delete-operation-handler.d.ts +32 -0
- package/lib/common/gmodel/delete-operation-handler.d.ts.map +1 -0
- package/lib/common/gmodel/delete-operation-handler.js +119 -0
- package/lib/common/gmodel/delete-operation-handler.js.map +1 -0
- package/lib/common/gmodel/gmodel-create-edge-operation-handler.d.ts +35 -0
- package/lib/common/gmodel/gmodel-create-edge-operation-handler.d.ts.map +1 -0
- package/lib/common/gmodel/gmodel-create-edge-operation-handler.js +64 -0
- package/lib/common/gmodel/gmodel-create-edge-operation-handler.js.map +1 -0
- package/lib/common/gmodel/gmodel-create-node-operation-handler.d.ts +58 -0
- package/lib/common/gmodel/gmodel-create-node-operation-handler.d.ts.map +1 -0
- package/lib/common/gmodel/gmodel-create-node-operation-handler.js +100 -0
- package/lib/common/gmodel/gmodel-create-node-operation-handler.js.map +1 -0
- package/lib/common/gmodel/gmodel-diagram-module.d.ts +31 -0
- package/lib/common/gmodel/gmodel-diagram-module.d.ts.map +1 -0
- package/lib/common/gmodel/gmodel-diagram-module.js +80 -0
- package/lib/common/gmodel/gmodel-diagram-module.js.map +1 -0
- package/lib/common/gmodel/gmodel-operation-handler.d.ts +23 -0
- package/lib/common/gmodel/gmodel-operation-handler.d.ts.map +1 -0
- package/lib/common/gmodel/gmodel-operation-handler.js +43 -0
- package/lib/common/gmodel/gmodel-operation-handler.js.map +1 -0
- package/lib/common/gmodel/index.d.ts +27 -0
- package/lib/common/gmodel/index.d.ts.map +1 -0
- package/lib/common/gmodel/index.js +43 -0
- package/lib/common/gmodel/index.js.map +1 -0
- package/lib/common/gmodel/paste-operation-handler.d.ts +36 -0
- package/lib/common/gmodel/paste-operation-handler.d.ts.map +1 -0
- package/lib/common/gmodel/paste-operation-handler.js +136 -0
- package/lib/common/gmodel/paste-operation-handler.js.map +1 -0
- package/lib/common/gmodel/reconnect-edge-operation-handler.d.ts +9 -0
- package/lib/common/gmodel/reconnect-edge-operation-handler.d.ts.map +1 -0
- package/lib/common/gmodel/reconnect-edge-operation-handler.js +64 -0
- package/lib/common/gmodel/reconnect-edge-operation-handler.js.map +1 -0
- package/lib/common/index.d.ts +89 -0
- package/lib/common/index.d.ts.map +1 -0
- package/lib/common/index.js +105 -0
- package/lib/common/index.js.map +1 -0
- package/lib/common/launch/glsp-server-launcher.d.ts +34 -0
- package/lib/common/launch/glsp-server-launcher.d.ts.map +1 -0
- package/lib/common/launch/glsp-server-launcher.js +64 -0
- package/lib/common/launch/glsp-server-launcher.js.map +1 -0
- package/lib/common/operations/compound-operation-handler.d.ts +25 -0
- package/lib/common/operations/compound-operation-handler.d.ts.map +1 -0
- package/lib/common/operations/compound-operation-handler.js +82 -0
- package/lib/common/operations/compound-operation-handler.js.map +1 -0
- package/lib/common/operations/create-operation-handler.d.ts +32 -0
- package/lib/common/operations/create-operation-handler.d.ts.map +1 -0
- package/lib/common/operations/create-operation-handler.js +31 -0
- package/lib/common/operations/create-operation-handler.js.map +1 -0
- package/lib/common/operations/operation-action-handler.d.ts +42 -0
- package/lib/common/operations/operation-action-handler.d.ts.map +1 -0
- package/lib/common/operations/operation-action-handler.js +109 -0
- package/lib/common/operations/operation-action-handler.js.map +1 -0
- package/lib/common/operations/operation-handler-registry.d.ts +38 -0
- package/lib/common/operations/operation-handler-registry.d.ts.map +1 -0
- package/lib/common/operations/operation-handler-registry.js +87 -0
- package/lib/common/operations/operation-handler-registry.js.map +1 -0
- package/lib/common/operations/operation-handler-registry.spec.d.ts +2 -0
- package/lib/common/operations/operation-handler-registry.spec.d.ts.map +1 -0
- package/lib/common/operations/operation-handler-registry.spec.js +50 -0
- package/lib/common/operations/operation-handler-registry.spec.js.map +1 -0
- package/lib/common/operations/operation-handler.d.ts +67 -0
- package/lib/common/operations/operation-handler.d.ts.map +1 -0
- package/lib/common/operations/operation-handler.js +56 -0
- package/lib/common/operations/operation-handler.js.map +1 -0
- package/lib/common/protocol/glsp-client-proxy.d.ts +45 -0
- package/lib/common/protocol/glsp-client-proxy.d.ts.map +1 -0
- package/lib/common/protocol/glsp-client-proxy.js +53 -0
- package/lib/common/protocol/glsp-client-proxy.js.map +1 -0
- package/lib/common/protocol/glsp-server-listener.d.ts +37 -0
- package/lib/common/protocol/glsp-server-listener.d.ts.map +1 -0
- package/lib/common/protocol/glsp-server-listener.js +5 -0
- package/lib/common/protocol/glsp-server-listener.js.map +1 -0
- package/lib/common/protocol/glsp-server.d.ts +150 -0
- package/lib/common/protocol/glsp-server.d.ts.map +1 -0
- package/lib/common/protocol/glsp-server.js +188 -0
- package/lib/common/protocol/glsp-server.js.map +1 -0
- package/lib/common/protocol/glsp-server.spec.d.ts +2 -0
- package/lib/common/protocol/glsp-server.spec.d.ts.map +1 -0
- package/lib/common/protocol/glsp-server.spec.js +119 -0
- package/lib/common/protocol/glsp-server.spec.js.map +1 -0
- package/lib/common/session/client-session-factory.d.ts +42 -0
- package/lib/common/session/client-session-factory.d.ts.map +1 -0
- package/lib/common/session/client-session-factory.js +54 -0
- package/lib/common/session/client-session-factory.js.map +1 -0
- package/lib/common/session/client-session-factory.spec.d.ts +2 -0
- package/lib/common/session/client-session-factory.spec.d.ts.map +1 -0
- package/lib/common/session/client-session-factory.spec.js +56 -0
- package/lib/common/session/client-session-factory.spec.js.map +1 -0
- package/lib/common/session/client-session-initializer.d.ts +26 -0
- package/lib/common/session/client-session-initializer.d.ts.map +1 -0
- package/lib/common/session/client-session-initializer.js +5 -0
- package/lib/common/session/client-session-initializer.js.map +1 -0
- package/lib/common/session/client-session-listener.d.ts +40 -0
- package/lib/common/session/client-session-listener.d.ts.map +1 -0
- package/lib/common/session/client-session-listener.js +3 -0
- package/lib/common/session/client-session-listener.js.map +1 -0
- package/lib/common/session/client-session-manager.d.ts +102 -0
- package/lib/common/session/client-session-manager.d.ts.map +1 -0
- package/lib/common/session/client-session-manager.js +116 -0
- package/lib/common/session/client-session-manager.js.map +1 -0
- package/lib/common/session/client-session-manager.spec.d.ts +2 -0
- package/lib/common/session/client-session-manager.spec.d.ts.map +1 -0
- package/lib/common/session/client-session-manager.spec.js +74 -0
- package/lib/common/session/client-session-manager.spec.js.map +1 -0
- package/lib/common/session/client-session.d.ts +52 -0
- package/lib/common/session/client-session.d.ts.map +1 -0
- package/lib/common/session/client-session.js +34 -0
- package/lib/common/session/client-session.js.map +1 -0
- package/lib/common/test/mock-util.d.ts +117 -0
- package/lib/common/test/mock-util.d.ts.map +1 -0
- package/lib/common/test/mock-util.js +194 -0
- package/lib/common/test/mock-util.js.map +1 -0
- package/lib/common/utils/args-util.d.ts +38 -0
- package/lib/common/utils/args-util.d.ts.map +1 -0
- package/lib/common/utils/args-util.js +81 -0
- package/lib/common/utils/args-util.js.map +1 -0
- package/lib/common/utils/client-options-util.d.ts +20 -0
- package/lib/common/utils/client-options-util.d.ts.map +1 -0
- package/lib/common/utils/client-options-util.js +26 -0
- package/lib/common/utils/client-options-util.js.map +1 -0
- package/lib/common/utils/glsp-server-error.d.ts +21 -0
- package/lib/common/utils/glsp-server-error.d.ts.map +1 -0
- package/lib/common/utils/glsp-server-error.js +33 -0
- package/lib/common/utils/glsp-server-error.js.map +1 -0
- package/lib/common/utils/layout-util.d.ts +74 -0
- package/lib/common/utils/layout-util.d.ts.map +1 -0
- package/lib/common/utils/layout-util.js +166 -0
- package/lib/common/utils/layout-util.js.map +1 -0
- package/lib/common/utils/logger.d.ts +27 -0
- package/lib/common/utils/logger.d.ts.map +1 -0
- package/lib/common/utils/logger.js +67 -0
- package/lib/common/utils/logger.js.map +1 -0
- package/lib/common/utils/promise-queue.d.ts +48 -0
- package/lib/common/utils/promise-queue.d.ts.map +1 -0
- package/lib/common/utils/promise-queue.js +93 -0
- package/lib/common/utils/promise-queue.js.map +1 -0
- package/lib/common/utils/promise-queue.spec.d.ts +2 -0
- package/lib/common/utils/promise-queue.spec.d.ts.map +1 -0
- package/lib/common/utils/promise-queue.spec.js +117 -0
- package/lib/common/utils/promise-queue.spec.js.map +1 -0
- package/lib/common/utils/registry.d.ts +73 -0
- package/lib/common/utils/registry.d.ts.map +1 -0
- package/lib/common/utils/registry.js +160 -0
- package/lib/common/utils/registry.js.map +1 -0
- package/lib/common/utils/registry.spec.d.ts +2 -0
- package/lib/common/utils/registry.spec.d.ts.map +1 -0
- package/lib/common/utils/registry.spec.js +199 -0
- package/lib/common/utils/registry.spec.js.map +1 -0
- package/lib/node/abstract-json-model-storage.d.ts +45 -0
- package/lib/node/abstract-json-model-storage.d.ts.map +1 -0
- package/lib/node/abstract-json-model-storage.js +103 -0
- package/lib/node/abstract-json-model-storage.js.map +1 -0
- package/lib/node/di/app-module.d.ts +36 -0
- package/lib/node/di/app-module.d.ts.map +1 -0
- package/lib/node/di/app-module.js +91 -0
- package/lib/node/di/app-module.js.map +1 -0
- package/lib/node/di/winston-logger.d.ts +32 -0
- package/lib/node/di/winston-logger.d.ts.map +1 -0
- package/lib/node/di/winston-logger.js +57 -0
- package/lib/node/di/winston-logger.js.map +1 -0
- package/lib/node/gmodel/gmodel-storage.d.ts +34 -0
- package/lib/node/gmodel/gmodel-storage.d.ts.map +1 -0
- package/lib/node/gmodel/gmodel-storage.js +68 -0
- package/lib/node/gmodel/gmodel-storage.js.map +1 -0
- package/lib/node/index.d.ts +24 -0
- package/lib/node/index.d.ts.map +1 -0
- package/lib/node/index.js +40 -0
- package/lib/node/index.js.map +1 -0
- package/lib/node/launch/cli-parser.d.ts +34 -0
- package/lib/node/launch/cli-parser.d.ts.map +1 -0
- package/lib/node/launch/cli-parser.js +71 -0
- package/lib/node/launch/cli-parser.js.map +1 -0
- package/lib/node/launch/cli-parser.spec.d.ts +2 -0
- package/lib/node/launch/cli-parser.spec.d.ts.map +1 -0
- package/lib/node/launch/cli-parser.spec.js +56 -0
- package/lib/node/launch/cli-parser.spec.js.map +1 -0
- package/lib/node/launch/socket-cli-parser.d.ts +9 -0
- package/lib/node/launch/socket-cli-parser.d.ts.map +1 -0
- package/lib/node/launch/socket-cli-parser.js +43 -0
- package/lib/node/launch/socket-cli-parser.js.map +1 -0
- package/lib/node/launch/socket-cli-parser.spec.d.ts +2 -0
- package/lib/node/launch/socket-cli-parser.spec.d.ts.map +1 -0
- package/lib/node/launch/socket-cli-parser.spec.js +66 -0
- package/lib/node/launch/socket-cli-parser.spec.js.map +1 -0
- package/lib/node/launch/socket-server-launcher.d.ts +34 -0
- package/lib/node/launch/socket-server-launcher.d.ts.map +1 -0
- package/lib/node/launch/socket-server-launcher.js +104 -0
- package/lib/node/launch/socket-server-launcher.js.map +1 -0
- package/lib/node/launch/socket-server-launcher.spec.d.ts +17 -0
- package/lib/node/launch/socket-server-launcher.spec.d.ts.map +1 -0
- package/lib/node/launch/socket-server-launcher.spec.js +70 -0
- package/lib/node/launch/socket-server-launcher.spec.js.map +1 -0
- package/node.d.ts +16 -0
- package/node.js +18 -0
- package/package.json +77 -0
- package/src/browser/di/app-module.ts +55 -0
- package/src/browser/di/console-logger.ts +71 -0
- package/src/browser/index.ts +19 -0
- package/src/browser/launch/worker-server-launcher.ts +58 -0
- package/src/common/actions/action-dispatcher.spec.ts +290 -0
- package/src/common/actions/action-dispatcher.ts +152 -0
- package/src/common/actions/action-handler-registry.spec.ts +52 -0
- package/src/common/actions/action-handler-registry.ts +60 -0
- package/src/common/actions/action-handler.ts +62 -0
- package/src/common/actions/client-action-handler.ts +50 -0
- package/src/common/actions/global-action-provider.spec.ts +79 -0
- package/src/common/actions/global-action-provider.ts +72 -0
- package/src/common/command/command-stack.spec.ts +239 -0
- package/src/common/command/command-stack.ts +159 -0
- package/src/common/command/command.spec.ts +93 -0
- package/src/common/command/command.ts +124 -0
- package/src/common/command/recording-command.spec.ts +74 -0
- package/src/common/command/recording-command.ts +119 -0
- package/src/common/command/undo-redo-action-handler.ts +57 -0
- package/src/common/di/binding-target.spec.ts +147 -0
- package/src/common/di/binding-target.ts +188 -0
- package/src/common/di/client-session-module.ts +29 -0
- package/src/common/di/diagram-module.ts +410 -0
- package/src/common/di/glsp-module.ts +66 -0
- package/src/common/di/multi-binding.ts +89 -0
- package/src/common/di/multi-bindings.spec.ts +133 -0
- package/src/common/di/server-module.ts +131 -0
- package/src/common/di/service-identifiers.ts +39 -0
- package/src/common/diagram/diagram-configuration.ts +97 -0
- package/src/common/diagram/request-type-hints-action-handler.spec.ts +59 -0
- package/src/common/diagram/request-type-hints-action-handler.ts +36 -0
- package/src/common/features/clipboard/request-clipboard-data-action-handler.ts +51 -0
- package/src/common/features/contextactions/command-palette-action-provider.ts +94 -0
- package/src/common/features/contextactions/context-actions-provider-registry.spec.ts +69 -0
- package/src/common/features/contextactions/context-actions-provider-registry.ts +47 -0
- package/src/common/features/contextactions/context-actions-provider.ts +36 -0
- package/src/common/features/contextactions/context-menu-item-provider.ts +52 -0
- package/src/common/features/contextactions/request-context-actions-handler.spec.ts +75 -0
- package/src/common/features/contextactions/request-context-actions-handler.ts +37 -0
- package/src/common/features/contextactions/tool-palette-item-provider.spec.ts +46 -0
- package/src/common/features/contextactions/tool-palette-item-provider.ts +88 -0
- package/src/common/features/directediting/context-edit-validator-registry.spec.ts +54 -0
- package/src/common/features/directediting/context-edit-validator-registry.ts +43 -0
- package/src/common/features/directediting/context-edit-validator.ts +55 -0
- package/src/common/features/directediting/label-edit-validator.ts +35 -0
- package/src/common/features/directediting/request-edit-validation-handler.spec.ts +131 -0
- package/src/common/features/directediting/request-edit-validation-handler.ts +43 -0
- package/src/common/features/layout/computed-bounds-action-handler.ts +56 -0
- package/src/common/features/layout/layout-engine.ts +31 -0
- package/src/common/features/layout/layout-operation-handler.ts +62 -0
- package/src/common/features/model/gmodel-factory.ts +60 -0
- package/src/common/features/model/gmodel-index.ts +195 -0
- package/src/common/features/model/gmodel-serializer.spec.ts +141 -0
- package/src/common/features/model/gmodel-serializer.ts +175 -0
- package/src/common/features/model/model-state.ts +98 -0
- package/src/common/features/model/model-submission-handler.ts +110 -0
- package/src/common/features/model/request-model-action-handler.ts +67 -0
- package/src/common/features/model/save-model-action-handler.ts +37 -0
- package/src/common/features/model/source-model-storage.ts +49 -0
- package/src/common/features/navigation/json-opener-options.ts +69 -0
- package/src/common/features/navigation/navigation-target-provider-registry.ts +36 -0
- package/src/common/features/navigation/navigation-target-provider.ts +50 -0
- package/src/common/features/navigation/navigation-target-resolution.ts +22 -0
- package/src/common/features/navigation/navigation-target-resolver.ts +61 -0
- package/src/common/features/navigation/request-navigation-targets-action-handler.ts +39 -0
- package/src/common/features/navigation/resolve-navigation-targets-action-handler.ts +42 -0
- package/src/common/features/popup/popup-model-factory.ts +38 -0
- package/src/common/features/popup/request-popup-model-action-handler.ts +60 -0
- package/src/common/features/validation/model-validator.ts +34 -0
- package/src/common/features/validation/request-markers-handler.ts +51 -0
- package/src/common/gmodel/README.md +7 -0
- package/src/common/gmodel/apply-label-edit-operation-handler.ts +36 -0
- package/src/common/gmodel/change-bounds-operation-handler.ts +62 -0
- package/src/common/gmodel/change-routing-points-operation-handler.ts +40 -0
- package/src/common/gmodel/cut-operation-handler.ts +39 -0
- package/src/common/gmodel/delete-operation-handler.ts +121 -0
- package/src/common/gmodel/gmodel-create-edge-operation-handler.ts +64 -0
- package/src/common/gmodel/gmodel-create-node-operation-handler.ts +95 -0
- package/src/common/gmodel/gmodel-diagram-module.ts +76 -0
- package/src/common/gmodel/gmodel-operation-handler.ts +31 -0
- package/src/common/gmodel/index.ts +27 -0
- package/src/common/gmodel/paste-operation-handler.ts +127 -0
- package/src/common/gmodel/reconnect-edge-operation-handler.ts +56 -0
- package/src/common/index.ts +89 -0
- package/src/common/launch/glsp-server-launcher.ts +70 -0
- package/src/common/operations/compound-operation-handler.ts +40 -0
- package/src/common/operations/create-operation-handler.ts +49 -0
- package/src/common/operations/operation-action-handler.ts +93 -0
- package/src/common/operations/operation-handler-registry.spec.ts +50 -0
- package/src/common/operations/operation-handler-registry.ts +66 -0
- package/src/common/operations/operation-handler.ts +82 -0
- package/src/common/protocol/glsp-client-proxy.ts +65 -0
- package/src/common/protocol/glsp-server-listener.ts +39 -0
- package/src/common/protocol/glsp-server.spec.ts +150 -0
- package/src/common/protocol/glsp-server.ts +320 -0
- package/src/common/session/client-session-factory.spec.ts +60 -0
- package/src/common/session/client-session-factory.ts +70 -0
- package/src/common/session/client-session-initializer.ts +27 -0
- package/src/common/session/client-session-listener.ts +41 -0
- package/src/common/session/client-session-manager.spec.ts +82 -0
- package/src/common/session/client-session-manager.ts +182 -0
- package/src/common/session/client-session.ts +62 -0
- package/src/common/test/mock-util.ts +241 -0
- package/src/common/utils/args-util.ts +98 -0
- package/src/common/utils/client-options-util.ts +22 -0
- package/src/common/utils/glsp-server-error.ts +27 -0
- package/src/common/utils/layout-util.ts +164 -0
- package/src/common/utils/logger.ts +72 -0
- package/src/common/utils/promise-queue.spec.ts +138 -0
- package/src/common/utils/promise-queue.ts +103 -0
- package/src/common/utils/registry.spec.ts +223 -0
- package/src/common/utils/registry.ts +154 -0
- package/src/node/abstract-json-model-storage.ts +114 -0
- package/src/node/di/app-module.ts +102 -0
- package/src/node/di/winston-logger.ts +76 -0
- package/src/node/gmodel/gmodel-storage.ts +53 -0
- package/src/node/index.ts +23 -0
- package/src/node/launch/cli-parser.spec.ts +61 -0
- package/src/node/launch/cli-parser.ts +86 -0
- package/src/node/launch/socket-cli-parser.spec.ts +73 -0
- package/src/node/launch/socket-cli-parser.ts +52 -0
- package/src/node/launch/socket-server-launcher.spec.ts +68 -0
- package/src/node/launch/socket-server-launcher.ts +90 -0
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.configureWinstonLogger = exports.createWinstonInstance = exports.createAppModule = void 0;
|
|
4
|
+
/********************************************************************************
|
|
5
|
+
* Copyright (c) 2022-2023 STMicroelectronics and others.
|
|
6
|
+
*
|
|
7
|
+
* This program and the accompanying materials are made available under the
|
|
8
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
9
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
10
|
+
*
|
|
11
|
+
* This Source Code may also be made available under the following Secondary
|
|
12
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
13
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
14
|
+
* with the GNU Classpath Exception which is available at
|
|
15
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
16
|
+
*
|
|
17
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
18
|
+
********************************************************************************/
|
|
19
|
+
const inversify_1 = require("inversify");
|
|
20
|
+
const winston = require("winston");
|
|
21
|
+
const index_1 = require("../../common/index");
|
|
22
|
+
const winston_logger_1 = require("./winston-logger");
|
|
23
|
+
function createAppModule(options) {
|
|
24
|
+
return new inversify_1.ContainerModule((bind, unbind, isBound, rebind) => {
|
|
25
|
+
bind(index_1.InjectionContainer).toDynamicValue(dynamicContext => dynamicContext.container);
|
|
26
|
+
const context = { bind, unbind, isBound, rebind };
|
|
27
|
+
configureWinstonLogger(context, options);
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
exports.createAppModule = createAppModule;
|
|
31
|
+
/**
|
|
32
|
+
* Creates the global {@link winston.Logger} instance is used internally by all instances of {@link WinstonLogger}. Can be configured with
|
|
33
|
+
* the given {@link LaunchOptions}.
|
|
34
|
+
* @param options The {@link LaunchOptions}
|
|
35
|
+
* @returns the configured winston instance.
|
|
36
|
+
*/
|
|
37
|
+
function createWinstonInstance(options) {
|
|
38
|
+
const level = index_1.LogLevel[options.logLevel];
|
|
39
|
+
const transports = [];
|
|
40
|
+
const printf = winston.format.printf(({ level, message, timestamp }) => `${timestamp} ${level} - ${message}`);
|
|
41
|
+
const timestamp = winston.format.timestamp({ format: () => new Date().toLocaleTimeString() });
|
|
42
|
+
const consoleLogFormat = winston.format.combine(winston.format.colorize(), timestamp, printf);
|
|
43
|
+
const fileLogFormat = winston.format.combine(timestamp, printf);
|
|
44
|
+
if (options.consoleLog) {
|
|
45
|
+
transports.push(new winston.transports.Console({ format: consoleLogFormat }));
|
|
46
|
+
}
|
|
47
|
+
if (options.fileLog) {
|
|
48
|
+
const date = new Date();
|
|
49
|
+
const dateString = `${date.getDate()}-${date.getMonth() + 1}-${date.getFullYear()}_${date.getHours()}-${date.getMinutes()}-${date.getSeconds()}`;
|
|
50
|
+
const filename = `GLSP-Server_${dateString}.log`;
|
|
51
|
+
transports.push(new winston.transports.File({ dirname: options.logDir, filename, format: fileLogFormat }));
|
|
52
|
+
}
|
|
53
|
+
return winston.createLogger({ level, transports });
|
|
54
|
+
}
|
|
55
|
+
exports.createWinstonInstance = createWinstonInstance;
|
|
56
|
+
/**
|
|
57
|
+
* Configures the binding for {@link WinstonLogger} in the given {@link ModuleContext} with the given {@link LaunchOptions}.
|
|
58
|
+
* @param context The module context.
|
|
59
|
+
* @param options The launch options.
|
|
60
|
+
* @param rebind Flag to determine wether an existing {@link Logger} binding in the context should be rebound. Default is `true`.
|
|
61
|
+
* @param baseLoggerCreator The underling global {@link winston.Logger} instance.
|
|
62
|
+
*/
|
|
63
|
+
function configureWinstonLogger(context, options, rebind = true, baseLoggerCreator = createWinstonInstance) {
|
|
64
|
+
const baseLogger = baseLoggerCreator(options);
|
|
65
|
+
if (rebind) {
|
|
66
|
+
if (context.isBound(index_1.Logger)) {
|
|
67
|
+
context.unbind(index_1.Logger);
|
|
68
|
+
}
|
|
69
|
+
if (context.isBound(index_1.LoggerFactory)) {
|
|
70
|
+
context.unbind(index_1.LoggerFactory);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
context.bind(index_1.Logger).toDynamicValue(dynamicContext => new winston_logger_1.WinstonLogger(baseLogger, getRequestParentName(dynamicContext)));
|
|
74
|
+
context.bind(index_1.LoggerFactory).toFactory(dynamicContext => (caller) => {
|
|
75
|
+
const logger = dynamicContext.container.get(index_1.Logger);
|
|
76
|
+
logger.caller = caller;
|
|
77
|
+
return logger;
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
exports.configureWinstonLogger = configureWinstonLogger;
|
|
81
|
+
function getRequestParentName(context) {
|
|
82
|
+
var _a;
|
|
83
|
+
if (context.currentRequest.parentRequest) {
|
|
84
|
+
const bindings = context.currentRequest.parentRequest.bindings;
|
|
85
|
+
if (bindings.length > 0) {
|
|
86
|
+
return (_a = bindings[0].implementationType) === null || _a === void 0 ? void 0 : _a.name;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
return undefined;
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=app-module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-module.js","sourceRoot":"","sources":["../../../src/node/di/app-module.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,yCAAwD;AACxD,mCAAmC;AACnC,8CAAwG;AAExG,qDAAiD;AAEjD,SAAgB,eAAe,CAAC,OAAsB;IAClD,OAAO,IAAI,2BAAe,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE;QACzD,IAAI,CAAC,0BAAkB,CAAC,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC;QACpF,MAAM,OAAO,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;QAClD,sBAAsB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC7C,CAAC,CAAC,CAAC;AACP,CAAC;AAND,0CAMC;AAED;;;;;GAKG;AACH,SAAgB,qBAAqB,CAA0B,OAAU;IACrE,MAAM,KAAK,GAAG,gBAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACzC,MAAM,UAAU,GAAwB,EAAE,CAAC;IAE3C,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,GAAG,SAAS,IAAI,KAAK,OAAO,OAAO,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/********************************************************************************
|
|
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 * as winston from 'winston';
|
|
17
|
+
import { Logger, LogLevel } from '../../common/utils/logger';
|
|
18
|
+
export declare class WinstonLogger extends Logger {
|
|
19
|
+
protected baseLogger: winston.Logger;
|
|
20
|
+
caller?: string | undefined;
|
|
21
|
+
constructor(baseLogger: winston.Logger, caller?: string | undefined);
|
|
22
|
+
info(message: string, ...params: any): void;
|
|
23
|
+
warn(message: string, ...params: any[]): void;
|
|
24
|
+
error(message: string, ...params: any[]): void;
|
|
25
|
+
debug(message: string, ...params: any[]): void;
|
|
26
|
+
get logLevel(): LogLevel;
|
|
27
|
+
set logLevel(level: LogLevel);
|
|
28
|
+
combinedMessage(message: string, ...params: any[]): string;
|
|
29
|
+
logAdditionals(...params: any[]): string;
|
|
30
|
+
toString(param: unknown): string;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=winston-logger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"winston-logger.d.ts","sourceRoot":"","sources":["../../../src/node/di/winston-logger.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AACnC,OAAO,EAAc,MAAM,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAEzE,qBAAa,aAAc,SAAQ,MAAM;IACzB,SAAS,CAAC,UAAU,EAAE,OAAO,CAAC,MAAM;IAAS,MAAM,CAAC;gBAA1C,UAAU,EAAE,OAAO,CAAC,MAAM,EAAS,MAAM,CAAC,oBAAQ;IAIxE,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,GAAG,GAAG,IAAI;IAM3C,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,GAAG,EAAE,GAAG,IAAI;IAM7C,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,GAAG,EAAE,GAAG,IAAI;IAM9C,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,GAAG,EAAE,GAAG,IAAI;IAM9C,IAAI,QAAQ,IAAI,QAAQ,CAEvB;IAED,IAAI,QAAQ,CAAC,KAAK,EAAE,QAAQ,EAE3B;IAED,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,GAAG,EAAE,GAAG,MAAM;IAM1D,cAAc,CAAC,GAAG,MAAM,EAAE,GAAG,EAAE,GAAG,MAAM;IAO/B,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM;CAO5C"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WinstonLogger = void 0;
|
|
4
|
+
const logger_1 = require("../../common/utils/logger");
|
|
5
|
+
class WinstonLogger extends logger_1.Logger {
|
|
6
|
+
constructor(baseLogger, caller) {
|
|
7
|
+
super();
|
|
8
|
+
this.baseLogger = baseLogger;
|
|
9
|
+
this.caller = caller;
|
|
10
|
+
}
|
|
11
|
+
info(message, ...params) {
|
|
12
|
+
if (this.logLevel !== logger_1.LogLevel.none) {
|
|
13
|
+
this.baseLogger.info(this.combinedMessage(message, ...params));
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
warn(message, ...params) {
|
|
17
|
+
if (this.logLevel !== logger_1.LogLevel.none) {
|
|
18
|
+
this.baseLogger.warn(this.combinedMessage(message, ...params));
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
error(message, ...params) {
|
|
22
|
+
if (this.logLevel !== logger_1.LogLevel.none) {
|
|
23
|
+
this.baseLogger.error(this.combinedMessage(message, ...params));
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
debug(message, ...params) {
|
|
27
|
+
if (this.logLevel !== logger_1.LogLevel.none) {
|
|
28
|
+
this.baseLogger.debug(this.combinedMessage(message, ...params));
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
get logLevel() {
|
|
32
|
+
return (0, logger_1.asLogLevel)(this.baseLogger.level) || logger_1.LogLevel.none;
|
|
33
|
+
}
|
|
34
|
+
set logLevel(level) {
|
|
35
|
+
this.baseLogger.level = logger_1.LogLevel[level];
|
|
36
|
+
}
|
|
37
|
+
combinedMessage(message, ...params) {
|
|
38
|
+
const caller = this.caller ? `[${this.caller}]` : '';
|
|
39
|
+
const additional = this.logAdditionals(...params);
|
|
40
|
+
return `${caller} ${message} ${additional}`;
|
|
41
|
+
}
|
|
42
|
+
logAdditionals(...params) {
|
|
43
|
+
if (!params || params.length === 0) {
|
|
44
|
+
return '';
|
|
45
|
+
}
|
|
46
|
+
return params.map(param => this.toString(param)).join(',\n');
|
|
47
|
+
}
|
|
48
|
+
toString(param) {
|
|
49
|
+
if (param instanceof Error) {
|
|
50
|
+
return `${param.message}
|
|
51
|
+
${param.stack || ''}`;
|
|
52
|
+
}
|
|
53
|
+
return JSON.stringify(param, undefined, 4);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
exports.WinstonLogger = WinstonLogger;
|
|
57
|
+
//# sourceMappingURL=winston-logger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,iBAAQ,CAAC,IAAI,CAAC;IAC9D,CAAC;IAED,IAAI,QAAQ,CAAC,KAAe;QACxB,IAAI,CAAC,UAAU,CAAC,KAAK,GAAG,iBAAQ,CAAC,KAAK,CAAC,CAAC;IAC5C,CAAC;IAED,eAAe,CAAC,OAAe,EAAE,GAAG,MAAa;QAC7C,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;QACrD,MAAM,UAAU,GAAG,IAAI,CAAC,cAAc,CAAC,GAAG,MAAM,CAAC,CAAC;QAClD,OAAO,GAAG,MAAM,IAAI,OAAO,IAAI,UAAU,EAAE,CAAC;IAChD,CAAC;IAED,cAAc,CAAC,GAAG,MAAa;QAC3B,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE;YAChC,OAAO,EAAE,CAAC;SACb;QACD,OAAO,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACjE,CAAC;IAEQ,QAAQ,CAAC,KAAc;QAC5B,IAAI,KAAK,YAAY,KAAK,EAAE;YACxB,OAAO,GAAG,KAAK,CAAC,OAAO;cACrB,KAAK,CAAC,KAAK,IAAI,EAAE,EAAE,CAAC;SACzB;QACD,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC;IAC/C,CAAC;CACJ;AAzDD,sCAyDC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
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 { GGraph } from '@eclipse-glsp/graph';
|
|
17
|
+
import { MaybePromise, RequestModelAction, SaveModelAction } from '@eclipse-glsp/protocol';
|
|
18
|
+
import { GModelSerializer } from '../../common/features/model/gmodel-serializer';
|
|
19
|
+
import { ModelState } from '../../common/features/model/model-state';
|
|
20
|
+
import { Logger } from '../../common/utils/logger';
|
|
21
|
+
import { AbstractJsonModelStorage } from '../abstract-json-model-storage';
|
|
22
|
+
export declare const EMPTY_ROOT: GGraph;
|
|
23
|
+
/**
|
|
24
|
+
* A {@link SourceModelStorage} that reads and writes the graph model directly from / into
|
|
25
|
+
* a JSON file and uses it as source model.
|
|
26
|
+
*/
|
|
27
|
+
export declare class GModelStorage extends AbstractJsonModelStorage {
|
|
28
|
+
protected logger: Logger;
|
|
29
|
+
protected modelSerializer: GModelSerializer;
|
|
30
|
+
protected modelState: ModelState;
|
|
31
|
+
loadSourceModel(action: RequestModelAction): MaybePromise<void>;
|
|
32
|
+
saveSourceModel(action: SaveModelAction): MaybePromise<void>;
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=gmodel-storage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gmodel-storage.d.ts","sourceRoot":"","sources":["../../../src/node/gmodel/gmodel-storage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAAE,MAAM,EAAuB,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAE3F,OAAO,EAAE,gBAAgB,EAAE,MAAM,+CAA+C,CAAC;AACjF,OAAO,EAAE,UAAU,EAAE,MAAM,yCAAyC,CAAC;AACrE,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACnD,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAE1E,eAAO,MAAM,UAAU,QAAuC,CAAC;AAE/D;;;GAGG;AACH,qBACa,aAAc,SAAQ,wBAAwB;IAEvD,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC;IAGzB,SAAS,CAAC,eAAe,EAAE,gBAAgB,CAAC;IAE5C,UACmB,UAAU,EAAE,UAAU,CAAC;IAE1C,eAAe,CAAC,MAAM,EAAE,kBAAkB,GAAG,YAAY,CAAC,IAAI,CAAC;IAO/D,eAAe,CAAC,MAAM,EAAE,eAAe,GAAG,YAAY,CAAC,IAAI,CAAC;CAK/D"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.GModelStorage = exports.EMPTY_ROOT = void 0;
|
|
13
|
+
/********************************************************************************
|
|
14
|
+
* Copyright (c) 2022-2023 STMicroelectronics and others.
|
|
15
|
+
*
|
|
16
|
+
* This program and the accompanying materials are made available under the
|
|
17
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
18
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
19
|
+
*
|
|
20
|
+
* This Source Code may also be made available under the following Secondary
|
|
21
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
22
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
23
|
+
* with the GNU Classpath Exception which is available at
|
|
24
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
25
|
+
*
|
|
26
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
27
|
+
********************************************************************************/
|
|
28
|
+
const graph_1 = require("@eclipse-glsp/graph");
|
|
29
|
+
const inversify_1 = require("inversify");
|
|
30
|
+
const gmodel_serializer_1 = require("../../common/features/model/gmodel-serializer");
|
|
31
|
+
const model_state_1 = require("../../common/features/model/model-state");
|
|
32
|
+
const logger_1 = require("../../common/utils/logger");
|
|
33
|
+
const abstract_json_model_storage_1 = require("../abstract-json-model-storage");
|
|
34
|
+
exports.EMPTY_ROOT = graph_1.GGraph.builder().id('empty').build();
|
|
35
|
+
/**
|
|
36
|
+
* A {@link SourceModelStorage} that reads and writes the graph model directly from / into
|
|
37
|
+
* a JSON file and uses it as source model.
|
|
38
|
+
*/
|
|
39
|
+
let GModelStorage = class GModelStorage extends abstract_json_model_storage_1.AbstractJsonModelStorage {
|
|
40
|
+
loadSourceModel(action) {
|
|
41
|
+
const sourceUri = this.getSourceUri(action);
|
|
42
|
+
const rootSchema = this.loadFromFile(sourceUri, graph_1.GModelElementSchema.is);
|
|
43
|
+
const root = this.modelSerializer.createRoot(rootSchema);
|
|
44
|
+
this.modelState.updateRoot(root);
|
|
45
|
+
}
|
|
46
|
+
saveSourceModel(action) {
|
|
47
|
+
const fileUri = this.getFileUri(action);
|
|
48
|
+
const schema = this.modelSerializer.createSchema(this.modelState.root);
|
|
49
|
+
this.writeFile(fileUri, schema);
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
__decorate([
|
|
53
|
+
(0, inversify_1.inject)(logger_1.Logger),
|
|
54
|
+
__metadata("design:type", logger_1.Logger)
|
|
55
|
+
], GModelStorage.prototype, "logger", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
(0, inversify_1.inject)(gmodel_serializer_1.GModelSerializer),
|
|
58
|
+
__metadata("design:type", Object)
|
|
59
|
+
], GModelStorage.prototype, "modelSerializer", void 0);
|
|
60
|
+
__decorate([
|
|
61
|
+
(0, inversify_1.inject)(model_state_1.ModelState),
|
|
62
|
+
__metadata("design:type", Object)
|
|
63
|
+
], GModelStorage.prototype, "modelState", void 0);
|
|
64
|
+
GModelStorage = __decorate([
|
|
65
|
+
(0, inversify_1.injectable)()
|
|
66
|
+
], GModelStorage);
|
|
67
|
+
exports.GModelStorage = GModelStorage;
|
|
68
|
+
//# sourceMappingURL=gmodel-storage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gmodel-storage.js","sourceRoot":"","sources":["../../../src/node/gmodel/gmodel-storage.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,+CAAkE;AAElE,yCAA+C;AAC/C,qFAAiF;AACjF,yEAAqE;AACrE,sDAAmD;AACnD,gFAA0E;AAE7D,QAAA,UAAU,GAAG,cAAM,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,CAAC;AAE/D;;;GAGG;AAEI,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,sDAAwB;IAUvD,eAAe,CAAC,MAA0B;QACtC,MAAM,SAAS,GAAG,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;QAC5C,MAAM,UAAU,GAAG,IAAI,CAAC,YAAY,CAAC,SAAS,EAAE,2BAAmB,CAAC,EAAE,CAAC,CAAC;QACxE,MAAM,IAAI,GAAG,IAAI,CAAC,eAAe,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;QACzD,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IACrC,CAAC;IAED,eAAe,CAAC,MAAuB;QACnC,MAAM,OAAO,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QACxC,MAAM,MAAM,GAAG,IAAI,CAAC,eAAe,CAAC,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QACvE,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IACpC,CAAC;CACJ,CAAA;AArBG;IAAC,IAAA,kBAAM,EAAC,eAAM,CAAC;8BACG,eAAM;6CAAC;AAEzB;IAAC,IAAA,kBAAM,EAAC,oCAAgB,CAAC;;sDACmB;AAE5C;IAAC,IAAA,kBAAM,EAAC,wBAAU,CAAC;;iDACuB;AARjC,aAAa;IADzB,IAAA,sBAAU,GAAE;GACA,aAAa,CAsBzB;AAtBY,sCAAa"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2022-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
|
+
export * from '../common/index';
|
|
17
|
+
export * from './abstract-json-model-storage';
|
|
18
|
+
export * from './di/app-module';
|
|
19
|
+
export * from './di/winston-logger';
|
|
20
|
+
export * from './gmodel/gmodel-storage';
|
|
21
|
+
export * from './launch/cli-parser';
|
|
22
|
+
export * from './launch/socket-cli-parser';
|
|
23
|
+
export * from './launch/socket-server-launcher';
|
|
24
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/node/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,cAAc,iBAAiB,CAAC;AAChC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC;AACpC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iCAAiC,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
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
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
/********************************************************************************
|
|
18
|
+
* Copyright (c) 2022-2023 EclipseSource and others.
|
|
19
|
+
*
|
|
20
|
+
* This program and the accompanying materials are made available under the
|
|
21
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
22
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
23
|
+
*
|
|
24
|
+
* This Source Code may also be made available under the following Secondary
|
|
25
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
26
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
27
|
+
* with the GNU Classpath Exception which is available at
|
|
28
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
29
|
+
*
|
|
30
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
31
|
+
********************************************************************************/
|
|
32
|
+
__exportStar(require("../common/index"), exports);
|
|
33
|
+
__exportStar(require("./abstract-json-model-storage"), exports);
|
|
34
|
+
__exportStar(require("./di/app-module"), exports);
|
|
35
|
+
__exportStar(require("./di/winston-logger"), exports);
|
|
36
|
+
__exportStar(require("./gmodel/gmodel-storage"), exports);
|
|
37
|
+
__exportStar(require("./launch/cli-parser"), exports);
|
|
38
|
+
__exportStar(require("./launch/socket-cli-parser"), exports);
|
|
39
|
+
__exportStar(require("./launch/socket-server-launcher"), exports);
|
|
40
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/node/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,kDAAgC;AAChC,gEAA8C;AAC9C,kDAAgC;AAChC,sDAAoC;AACpC,0DAAwC;AACxC,sDAAoC;AACpC,6DAA2C;AAC3C,kEAAgD"}
|
|
@@ -0,0 +1,34 @@
|
|
|
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 * as cmd from 'commander';
|
|
17
|
+
import { LogLevel } from '../../common/utils/logger';
|
|
18
|
+
export interface LaunchOptions {
|
|
19
|
+
logLevel: LogLevel;
|
|
20
|
+
logDir?: string;
|
|
21
|
+
fileLog: boolean;
|
|
22
|
+
consoleLog: boolean;
|
|
23
|
+
}
|
|
24
|
+
export interface CliParser<O extends LaunchOptions = LaunchOptions> {
|
|
25
|
+
command: cmd.Command;
|
|
26
|
+
parse(argv?: string[]): O;
|
|
27
|
+
}
|
|
28
|
+
export declare const defaultLaunchOptions: Required<LaunchOptions>;
|
|
29
|
+
export declare function createCliParser<O extends LaunchOptions = LaunchOptions>(options?: LaunchOptions): CliParser<O>;
|
|
30
|
+
export declare function parse<T extends cmd.OptionValues>(command: cmd.Command, defaultOptions: Partial<T>, argv?: string[]): T;
|
|
31
|
+
export declare function processLogLevel(value: string): LogLevel;
|
|
32
|
+
export declare function processLogDir(value: string): string;
|
|
33
|
+
export declare function isDirectory(value: string): boolean;
|
|
34
|
+
//# sourceMappingURL=cli-parser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-parser.d.ts","sourceRoot":"","sources":["../../../src/node/launch/cli-parser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,KAAK,GAAG,MAAM,WAAW,CAAC;AAGjC,OAAO,EAAc,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAEjE,MAAM,WAAW,aAAa;IAC1B,QAAQ,EAAE,QAAQ,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,WAAW,SAAS,CAAC,CAAC,SAAS,aAAa,GAAG,aAAa;IAC9D,OAAO,EAAE,GAAG,CAAC,OAAO,CAAC;IACrB,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC;CAC7B;AAED,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,aAAa,CAKxD,CAAC;AAEF,wBAAgB,eAAe,CAAC,CAAC,SAAS,aAAa,GAAG,aAAa,EAAE,OAAO,GAAE,aAAoC,GAAG,SAAS,CAAC,CAAC,CAAC,CAgBpI;AAED,wBAAgB,KAAK,CAAC,CAAC,SAAS,GAAG,CAAC,YAAY,EAAE,OAAO,EAAE,GAAG,CAAC,OAAO,EAAE,cAAc,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,CAGtH;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,QAAQ,CAMvD;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAOnD;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAMlD"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isDirectory = exports.processLogDir = exports.processLogLevel = exports.parse = exports.createCliParser = exports.defaultLaunchOptions = void 0;
|
|
4
|
+
/********************************************************************************
|
|
5
|
+
* Copyright (c) 2022-2023 STMicroelectronics and others.
|
|
6
|
+
*
|
|
7
|
+
* This program and the accompanying materials are made available under the
|
|
8
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
9
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
10
|
+
*
|
|
11
|
+
* This Source Code may also be made available under the following Secondary
|
|
12
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
13
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
14
|
+
* with the GNU Classpath Exception which is available at
|
|
15
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
16
|
+
*
|
|
17
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
18
|
+
********************************************************************************/
|
|
19
|
+
const cmd = require("commander");
|
|
20
|
+
const fs = require("fs-extra");
|
|
21
|
+
const path = require("path");
|
|
22
|
+
const logger_1 = require("../../common/utils/logger");
|
|
23
|
+
exports.defaultLaunchOptions = {
|
|
24
|
+
logLevel: logger_1.LogLevel.info,
|
|
25
|
+
logDir: '.config',
|
|
26
|
+
consoleLog: true,
|
|
27
|
+
fileLog: false
|
|
28
|
+
};
|
|
29
|
+
function createCliParser(options = exports.defaultLaunchOptions) {
|
|
30
|
+
const command = new cmd.Command()
|
|
31
|
+
.version('1.0.0')
|
|
32
|
+
.description('GLSP server')
|
|
33
|
+
.showHelpAfterError(true)
|
|
34
|
+
.name('Launch a GLSP server')
|
|
35
|
+
.option('-l , --logLevel <logLevel>', `Set the log level. [default='${options.logLevel}']`, processLogLevel, options.logLevel)
|
|
36
|
+
.option('-d , --logDir <logDir>', `Set the directory for log files (when file logging is enabled) [default=${options.logDir}]`, processLogDir, options.logDir)
|
|
37
|
+
.addHelpText('afterAll', '\n Copyright (c) 2022-2023 Eclipse GLSP');
|
|
38
|
+
return { command, parse: argv => parse(command, options, argv) };
|
|
39
|
+
}
|
|
40
|
+
exports.createCliParser = createCliParser;
|
|
41
|
+
function parse(command, defaultOptions, argv) {
|
|
42
|
+
command.parse(argv);
|
|
43
|
+
return Object.assign(Object.assign({}, defaultOptions), command.opts());
|
|
44
|
+
}
|
|
45
|
+
exports.parse = parse;
|
|
46
|
+
function processLogLevel(value) {
|
|
47
|
+
const level = (0, logger_1.asLogLevel)(value);
|
|
48
|
+
if (!level) {
|
|
49
|
+
throw new cmd.InvalidArgumentError("Argument has to be 'none'|'error'|'warn'|'info'|'debug'!");
|
|
50
|
+
}
|
|
51
|
+
return level;
|
|
52
|
+
}
|
|
53
|
+
exports.processLogLevel = processLogLevel;
|
|
54
|
+
function processLogDir(value) {
|
|
55
|
+
const logDir = path.resolve(value);
|
|
56
|
+
if (path.extname(logDir).length !== 0 || !isDirectory(path.dirname(logDir))) {
|
|
57
|
+
throw new cmd.InvalidArgumentError('Argument is not a valid directory!');
|
|
58
|
+
}
|
|
59
|
+
return logDir;
|
|
60
|
+
}
|
|
61
|
+
exports.processLogDir = processLogDir;
|
|
62
|
+
function isDirectory(value) {
|
|
63
|
+
try {
|
|
64
|
+
return fs.statSync(value).isDirectory();
|
|
65
|
+
}
|
|
66
|
+
catch (error) {
|
|
67
|
+
return false;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
exports.isDirectory = isDirectory;
|
|
71
|
+
//# sourceMappingURL=cli-parser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-parser.js","sourceRoot":"","sources":["../../../src/node/launch/cli-parser.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,iCAAiC;AACjC,+BAA+B;AAC/B,6BAA6B;AAC7B,sDAAiE;AAcpD,QAAA,oBAAoB,GAA4B;IACzD,QAAQ,EAAE,iBAAQ,CAAC,IAAI;IACvB,MAAM,EAAE,SAAS;IACjB,UAAU,EAAE,IAAI;IAChB,OAAO,EAAE,KAAK;CACjB,CAA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AAK,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE;QACzE,MAAM,IAAI,GAAG,CAAC,oBAAoB,CAAC,oCAAoC,CAAC,CAAC;KAC5E;IAED,OAAO,MAAM,CAAC;AAClB,CAAC;AAPD,sCAOC;AAED,SAAgB,WAAW,CAAC,KAAa;IACrC,IAAI;QACA,OAAO,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC;KAC3C;IAAC,OAAO,KAAK,EAAE;QACZ,OAAO,KAAK,CAAC;KAChB;AACL,CAAC;AAND,kCAMC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-parser.spec.d.ts","sourceRoot":"","sources":["../../../src/node/launch/cli-parser.spec.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/********************************************************************************
|
|
4
|
+
* Copyright (c) 2022-2023 STMicroelectronics and others.
|
|
5
|
+
*
|
|
6
|
+
* This program and the accompanying materials are made available under the
|
|
7
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
8
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
9
|
+
*
|
|
10
|
+
* This Source Code may also be made available under the following Secondary
|
|
11
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
12
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
13
|
+
* with the GNU Classpath Exception which is available at
|
|
14
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
15
|
+
*
|
|
16
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
17
|
+
********************************************************************************/
|
|
18
|
+
const chai_1 = require("chai");
|
|
19
|
+
const path = require("path");
|
|
20
|
+
const logger_1 = require("../../common/utils/logger");
|
|
21
|
+
const cli_parser_1 = require("./cli-parser");
|
|
22
|
+
describe('test createCliParser', () => {
|
|
23
|
+
const parser = (0, cli_parser_1.createCliParser)();
|
|
24
|
+
parser.command.exitOverride();
|
|
25
|
+
const argv = ['/usr/bin/node', 'test'];
|
|
26
|
+
it('parse - no args', () => {
|
|
27
|
+
const options = parser.parse(argv);
|
|
28
|
+
(0, chai_1.expect)(options).to.deep.equal(cli_parser_1.defaultLaunchOptions);
|
|
29
|
+
});
|
|
30
|
+
it('parse - invalid log dir', () => {
|
|
31
|
+
(0, chai_1.expect)(() => parser.parse([...argv, '--logDir', 'invalid.Path'])).to.throw();
|
|
32
|
+
});
|
|
33
|
+
it('parse - valid log dir', () => {
|
|
34
|
+
const logDir = path.resolve('../customLog');
|
|
35
|
+
const result = parser.parse([...argv, '--logDir', '../customLog/']);
|
|
36
|
+
(0, chai_1.expect)(result.logDir, logDir);
|
|
37
|
+
});
|
|
38
|
+
it('parse - invalid logLevel', () => {
|
|
39
|
+
(0, chai_1.expect)(() => parser.parse([...argv, '--logLevel', 'someRandomLevel'])).to.throw();
|
|
40
|
+
});
|
|
41
|
+
it('parse - valid logLevel', () => {
|
|
42
|
+
const result = parser.parse([...argv, '--logLevel', 'error']);
|
|
43
|
+
(0, chai_1.expect)(result.logLevel).to.be.equal(logger_1.LogLevel.error);
|
|
44
|
+
});
|
|
45
|
+
it('parse- no args with custom default options', () => {
|
|
46
|
+
const options = {
|
|
47
|
+
logDir: '.myLogDir',
|
|
48
|
+
logLevel: logger_1.LogLevel.debug,
|
|
49
|
+
consoleLog: false,
|
|
50
|
+
fileLog: true
|
|
51
|
+
};
|
|
52
|
+
const result = (0, cli_parser_1.createCliParser)(options).parse(argv);
|
|
53
|
+
(0, chai_1.expect)(result).to.deep.equal(options);
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
//# sourceMappingURL=cli-parser.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-parser.spec.js","sourceRoot":"","sources":["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GAAG,IAAI,EAAE,YAAY,EAAE,iBAAiB,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC;IACtF,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,wBAAwB,EAAE,GAAG,EAAE;QAC9B,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,GAAG,IAAI,EAAE,YAAY,EAAE,OAAO,CAAC,CAAC,CAAC;QAC9D,IAAA,aAAM,EAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,iBAAQ,CAAC,KAAK,CAAC,CAAC;IACxD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,4CAA4C,EAAE,GAAG,EAAE;QAClD,MAAM,OAAO,GAAG;YACZ,MAAM,EAAE,WAAW;YACnB,QAAQ,EAAE,iBAAQ,CAAC,KAAK;YACxB,UAAU,EAAE,KAAK;YACjB,OAAO,EAAE,IAAI;SAChB,CAAC;QACF,MAAM,MAAM,GAAG,IAAA,4BAAe,EAAC,OAAO,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACpD,IAAA,aAAM,EAAC,MAAM,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CliParser, LaunchOptions } from './cli-parser';
|
|
2
|
+
export interface SocketLaunchOptions extends LaunchOptions {
|
|
3
|
+
port: number;
|
|
4
|
+
host: string;
|
|
5
|
+
}
|
|
6
|
+
export declare const defaultSocketLaunchOptions: Required<SocketLaunchOptions>;
|
|
7
|
+
export declare function createSocketCliParser<O extends SocketLaunchOptions = SocketLaunchOptions>(defaultOptions?: SocketLaunchOptions): CliParser<O>;
|
|
8
|
+
export declare function processPort(value: string): number;
|
|
9
|
+
//# sourceMappingURL=socket-cli-parser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"socket-cli-parser.d.ts","sourceRoot":"","sources":["../../../src/node/launch/socket-cli-parser.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,SAAS,EAAyC,aAAa,EAAE,MAAM,cAAc,CAAC;AAE/F,MAAM,WAAW,mBAAoB,SAAQ,aAAa;IACtD,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,mBAAmB,CAIpE,CAAC;AAEF,wBAAgB,qBAAqB,CAAC,CAAC,SAAS,mBAAmB,GAAG,mBAAmB,EACrF,cAAc,GAAE,mBAAgD,GACjE,SAAS,CAAC,CAAC,CAAC,CAQd;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAUjD"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.processPort = exports.createSocketCliParser = exports.defaultSocketLaunchOptions = void 0;
|
|
4
|
+
/********************************************************************************
|
|
5
|
+
* Copyright (c) 2022-2023 STMicroelectronics and others.
|
|
6
|
+
*
|
|
7
|
+
* This program and the accompanying materials are made available under the
|
|
8
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
9
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
10
|
+
*
|
|
11
|
+
* This Source Code may also be made available under the following Secondary
|
|
12
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
13
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
14
|
+
* with the GNU Classpath Exception which is available at
|
|
15
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
16
|
+
*
|
|
17
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
18
|
+
********************************************************************************/
|
|
19
|
+
const cmd = require("commander");
|
|
20
|
+
const cli_parser_1 = require("./cli-parser");
|
|
21
|
+
exports.defaultSocketLaunchOptions = Object.assign(Object.assign({}, cli_parser_1.defaultLaunchOptions), { port: 5007, host: 'localhost' });
|
|
22
|
+
function createSocketCliParser(defaultOptions = exports.defaultSocketLaunchOptions) {
|
|
23
|
+
const parser = (0, cli_parser_1.createCliParser)(defaultOptions);
|
|
24
|
+
parser.command
|
|
25
|
+
.option('-p , --port <port>', `Set server port [default= ${defaultOptions.port}]`, processPort, defaultOptions.port)
|
|
26
|
+
.option('--host <host>', `Set host name [default= ${defaultOptions.host}`, defaultOptions.host)
|
|
27
|
+
.option('--no-consoleLog', 'Disable console logging')
|
|
28
|
+
.option('--fileLog', 'Enable file logging', defaultOptions.fileLog);
|
|
29
|
+
return parser;
|
|
30
|
+
}
|
|
31
|
+
exports.createSocketCliParser = createSocketCliParser;
|
|
32
|
+
function processPort(value) {
|
|
33
|
+
const port = Number.parseInt(value, 10);
|
|
34
|
+
if (isNaN(port)) {
|
|
35
|
+
throw new cmd.InvalidArgumentError('Port is not a number!');
|
|
36
|
+
}
|
|
37
|
+
if (port < 0 || port > 65535) {
|
|
38
|
+
throw new cmd.InvalidArgumentError('Port has to be between in range (0,65535)!');
|
|
39
|
+
}
|
|
40
|
+
return port;
|
|
41
|
+
}
|
|
42
|
+
exports.processPort = processPort;
|
|
43
|
+
//# sourceMappingURL=socket-cli-parser.js.map
|