@kumologica/sdk 3.0.0
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/README.md +1 -0
- package/bin/kl.js +3 -0
- package/cli/cli.js +6 -0
- package/cli/commands/build-commands/aws.js +49 -0
- package/cli/commands/build-commands/azure.js +43 -0
- package/cli/commands/build-commands/kumohub.js +7 -0
- package/cli/commands/build.js +6 -0
- package/cli/commands/create.js +32 -0
- package/cli/commands/deploy-commands/kumohub.js +114 -0
- package/cli/commands/deploy.js +6 -0
- package/cli/commands/doc-commands/html.js +61 -0
- package/cli/commands/doc.js +6 -0
- package/cli/commands/export-commands/cloudformation.js +338 -0
- package/cli/commands/export-commands/serverless.js +164 -0
- package/cli/commands/export-commands/terraform-commands/aws.js +193 -0
- package/cli/commands/export-commands/terraform-commands/azure.js +148 -0
- package/cli/commands/export-commands/terraform.js +6 -0
- package/cli/commands/export-commands/utils/validator.js +152 -0
- package/cli/commands/export.js +6 -0
- package/cli/commands/import-commands/mulesoft.js +61 -0
- package/cli/commands/import.js +6 -0
- package/cli/commands/open.js +46 -0
- package/cli/commands/test-utils/TestSuiteController.js +359 -0
- package/cli/commands/test-utils/TestSuiteController.test.js +171 -0
- package/cli/commands/test-utils/fixtures/example3-flow.json +148 -0
- package/cli/commands/test-utils/fixtures/package.json +6 -0
- package/cli/commands/test-utils/fixtures/s3-event.js +43 -0
- package/cli/commands/test-utils/util/output.js +14 -0
- package/cli/commands/test-utils/util/updates/index.js +17 -0
- package/cli/commands/test-utils/util/updates/pkg.js +13 -0
- package/cli/commands/test-utils/util/updates/templates/default-settings.js +209 -0
- package/cli/commands/test.js +66 -0
- package/cli/commands/utils.js +14 -0
- package/package.json +158 -0
- package/src/app/lib/aws/aws-profile.js +43 -0
- package/src/app/lib/aws/ca-alexa-api.js +29 -0
- package/src/app/lib/aws/ca-apigw-api.js +216 -0
- package/src/app/lib/aws/ca-cloudwatch-api.js +78 -0
- package/src/app/lib/aws/ca-codecommit-api.js +63 -0
- package/src/app/lib/aws/ca-dynamodb-api.js +27 -0
- package/src/app/lib/aws/ca-elb-api.js +44 -0
- package/src/app/lib/aws/ca-events-api.js +27 -0
- package/src/app/lib/aws/ca-iot-api.js +105 -0
- package/src/app/lib/aws/ca-s3-api.js +115 -0
- package/src/app/lib/aws/ca-sns-api.js +38 -0
- package/src/app/lib/aws/ca-sqs-api.js +51 -0
- package/src/app/lib/aws/cf.js +439 -0
- package/src/app/lib/aws/index.js +970 -0
- package/src/app/lib/aws/kl-iam-api.js +27 -0
- package/src/app/lib/aws/kl-rekognition-api.js +66 -0
- package/src/app/lib/aws/kl-ssm-api.js +24 -0
- package/src/app/lib/azure/index.js +80 -0
- package/src/app/lib/dependencies.js +50 -0
- package/src/app/lib/kumohub/index.js +201 -0
- package/src/app/lib/runtime-loader/index.js +42 -0
- package/src/app/lib/serverless/index.js +318 -0
- package/src/app/lib/stores/aws-cloud-config-store.js +35 -0
- package/src/app/lib/stores/azure-config-store.js +24 -0
- package/src/app/lib/stores/kumohub-config-store.js +24 -0
- package/src/app/lib/stores/project-info-config-store.js +26 -0
- package/src/app/lib/stores/settings-cloud-store.js +117 -0
- package/src/app/lib/stores/settings-cloud-store.spec.js +26 -0
- package/src/app/lib/stores/settings-network-store.js +119 -0
- package/src/app/lib/stores/settings-network-store.spec.js +27 -0
- package/src/app/lib/stores/store.js +97 -0
- package/src/app/lib/stores/test-config-store.js +26 -0
- package/src/app/lib/stores/user-preference-store.js +44 -0
- package/src/app/lib/utils/editor.js +98 -0
- package/src/app/lib/utils/fix-path.js +15 -0
- package/src/app/main-process/favicon.ico +0 -0
- package/src/app/main-process/main-window.js +209 -0
- package/src/app/main-process/menu.js +219 -0
- package/src/app/main-process/modal-home.js +118 -0
- package/src/app/main-process/modal-newproject.js +119 -0
- package/src/app/main-process/modal-nodelibrary.js +90 -0
- package/src/app/main-process/modal-welcome.js +114 -0
- package/src/app/main-process/runtime-manager.js +141 -0
- package/src/app/main.js +590 -0
- package/src/app/preload.js +633 -0
- package/src/app/ui/editor-api/lib/admin/context.js +42 -0
- package/src/app/ui/editor-api/lib/admin/flow.js +55 -0
- package/src/app/ui/editor-api/lib/admin/flows.js +53 -0
- package/src/app/ui/editor-api/lib/admin/index.js +155 -0
- package/src/app/ui/editor-api/lib/admin/nodes.js +164 -0
- package/src/app/ui/editor-api/lib/auth/clients.js +17 -0
- package/src/app/ui/editor-api/lib/auth/index.js +267 -0
- package/src/app/ui/editor-api/lib/auth/permissions.js +51 -0
- package/src/app/ui/editor-api/lib/auth/strategies.js +144 -0
- package/src/app/ui/editor-api/lib/auth/tokens.js +138 -0
- package/src/app/ui/editor-api/lib/auth/users.js +122 -0
- package/src/app/ui/editor-api/lib/editor/comms.js +247 -0
- package/src/app/ui/editor-api/lib/editor/credentials.js +22 -0
- package/src/app/ui/editor-api/lib/editor/index.js +234 -0
- package/src/app/ui/editor-api/lib/editor/library.js +69 -0
- package/src/app/ui/editor-api/lib/editor/locales.js +37 -0
- package/src/app/ui/editor-api/lib/editor/projects.js +497 -0
- package/src/app/ui/editor-api/lib/editor/settings.js +118 -0
- package/src/app/ui/editor-api/lib/editor/sshkeys.js +87 -0
- package/src/app/ui/editor-api/lib/editor/theme.js +184 -0
- package/src/app/ui/editor-api/lib/editor/ui.js +149 -0
- package/src/app/ui/editor-api/lib/index.js +149 -0
- package/src/app/ui/editor-api/lib/runner/index.js +81 -0
- package/src/app/ui/editor-api/lib/util.js +51 -0
- package/src/app/ui/editor-client/README.md +10 -0
- package/src/app/ui/editor-client/constants.js +5 -0
- package/src/app/ui/editor-client/index.js +3 -0
- package/src/app/ui/editor-client/public/favicon.ico +0 -0
- package/src/app/ui/editor-client/public/red/images/bolt.png +0 -0
- package/src/app/ui/editor-client/public/red/images/debugger/continue-full.png +0 -0
- package/src/app/ui/editor-client/public/red/images/debugger/continue-outline.png +0 -0
- package/src/app/ui/editor-client/public/red/images/debugger/pause.png +0 -0
- package/src/app/ui/editor-client/public/red/images/debugger/restart.png +0 -0
- package/src/app/ui/editor-client/public/red/images/debugger/stepover.png +0 -0
- package/src/app/ui/editor-client/public/red/images/debugger/stop.png +0 -0
- package/src/app/ui/editor-client/public/red/images/deploy-flows-o.png +0 -0
- package/src/app/ui/editor-client/public/red/images/deploy-flows.png +0 -0
- package/src/app/ui/editor-client/public/red/images/deploy-full-o.png +0 -0
- package/src/app/ui/editor-client/public/red/images/deploy-full.png +0 -0
- package/src/app/ui/editor-client/public/red/images/deploy-nodes-o.png +0 -0
- package/src/app/ui/editor-client/public/red/images/deploy-nodes.png +0 -0
- package/src/app/ui/editor-client/public/red/images/deploy-reload.png +0 -0
- package/src/app/ui/editor-client/public/red/images/grip.png +0 -0
- package/src/app/ui/editor-client/public/red/images/icons/arrow-in.png +0 -0
- package/src/app/ui/editor-client/public/red/images/icons/bolt.png +0 -0
- package/src/app/ui/editor-client/public/red/images/icons/node-changed.png +0 -0
- package/src/app/ui/editor-client/public/red/images/icons/node-error.png +0 -0
- package/src/app/ui/editor-client/public/red/images/icons/node-play.png +0 -0
- package/src/app/ui/editor-client/public/red/images/kumologica-app.png +0 -0
- package/src/app/ui/editor-client/public/red/images/node-red-256.png +0 -0
- package/src/app/ui/editor-client/public/red/images/node-red-icon-black.svg +9 -0
- package/src/app/ui/editor-client/public/red/images/node-red-icon.svg +33 -0
- package/src/app/ui/editor-client/public/red/images/node-red.png +0 -0
- package/src/app/ui/editor-client/public/red/images/pw_maze_white.png +0 -0
- package/src/app/ui/editor-client/public/red/images/spin.svg +41 -0
- package/src/app/ui/editor-client/public/red/images/spinner.gif +0 -0
- package/src/app/ui/editor-client/public/red/images/subflow_tab.png +0 -0
- package/src/app/ui/editor-client/public/red/images/test-icon.png +0 -0
- package/src/app/ui/editor-client/public/red/images/typedInput/09.png +0 -0
- package/src/app/ui/editor-client/public/red/images/typedInput/az.png +0 -0
- package/src/app/ui/editor-client/public/red/images/typedInput/bin.png +0 -0
- package/src/app/ui/editor-client/public/red/images/typedInput/bool.png +0 -0
- package/src/app/ui/editor-client/public/red/images/typedInput/env.png +0 -0
- package/src/app/ui/editor-client/public/red/images/typedInput/expr.png +0 -0
- package/src/app/ui/editor-client/public/red/images/typedInput/json.png +0 -0
- package/src/app/ui/editor-client/public/red/images/typedInput/re.png +0 -0
- package/src/app/ui/editor-client/public/red/keymap.json +54 -0
- package/src/app/ui/editor-client/public/red/main-modals.js +14 -0
- package/src/app/ui/editor-client/public/red/main-modals.min.js +16 -0
- package/src/app/ui/editor-client/public/red/main.js +10 -0
- package/src/app/ui/editor-client/public/red/main.min.js +16 -0
- package/src/app/ui/editor-client/public/red/red.js +44903 -0
- package/src/app/ui/editor-client/public/red/red.min.js +16 -0
- package/src/app/ui/editor-client/public/red/style.min.css +24 -0
- package/src/app/ui/editor-client/public/vendor/ace/LICENSE +24 -0
- package/src/app/ui/editor-client/public/vendor/ace/ace.js +17 -0
- package/src/app/ui/editor-client/public/vendor/ace/ext-language_tools.js +8 -0
- package/src/app/ui/editor-client/public/vendor/ace/ext-searchbox.js +8 -0
- package/src/app/ui/editor-client/public/vendor/ace/mode-css.js +8 -0
- package/src/app/ui/editor-client/public/vendor/ace/mode-handlebars.js +8 -0
- package/src/app/ui/editor-client/public/vendor/ace/mode-html.js +8 -0
- package/src/app/ui/editor-client/public/vendor/ace/mode-javascript.js +8 -0
- package/src/app/ui/editor-client/public/vendor/ace/mode-json.js +8 -0
- package/src/app/ui/editor-client/public/vendor/ace/mode-jsonata.js +1 -0
- package/src/app/ui/editor-client/public/vendor/ace/mode-markdown.js +8 -0
- package/src/app/ui/editor-client/public/vendor/ace/mode-properties.js +8 -0
- package/src/app/ui/editor-client/public/vendor/ace/mode-python.js +8 -0
- package/src/app/ui/editor-client/public/vendor/ace/mode-sql.js +8 -0
- package/src/app/ui/editor-client/public/vendor/ace/mode-swift.js +8 -0
- package/src/app/ui/editor-client/public/vendor/ace/mode-text.js +8 -0
- package/src/app/ui/editor-client/public/vendor/ace/mode-xml.js +8 -0
- package/src/app/ui/editor-client/public/vendor/ace/mode-yaml.js +8 -0
- package/src/app/ui/editor-client/public/vendor/ace/snippets/css.js +8 -0
- package/src/app/ui/editor-client/public/vendor/ace/snippets/handlebars.js +8 -0
- package/src/app/ui/editor-client/public/vendor/ace/snippets/html.js +8 -0
- package/src/app/ui/editor-client/public/vendor/ace/snippets/javascript.js +8 -0
- package/src/app/ui/editor-client/public/vendor/ace/snippets/json.js +8 -0
- package/src/app/ui/editor-client/public/vendor/ace/snippets/jsonata.js +1 -0
- package/src/app/ui/editor-client/public/vendor/ace/snippets/markdown.js +8 -0
- package/src/app/ui/editor-client/public/vendor/ace/snippets/properties.js +8 -0
- package/src/app/ui/editor-client/public/vendor/ace/snippets/python.js +8 -0
- package/src/app/ui/editor-client/public/vendor/ace/snippets/sql.js +8 -0
- package/src/app/ui/editor-client/public/vendor/ace/snippets/swift.js +8 -0
- package/src/app/ui/editor-client/public/vendor/ace/snippets/text.js +8 -0
- package/src/app/ui/editor-client/public/vendor/ace/snippets/xml.js +8 -0
- package/src/app/ui/editor-client/public/vendor/ace/snippets/yaml.js +8 -0
- package/src/app/ui/editor-client/public/vendor/ace/theme-chrome.js +8 -0
- package/src/app/ui/editor-client/public/vendor/ace/theme-tomorrow.js +8 -0
- package/src/app/ui/editor-client/public/vendor/ace/worker-css.js +1 -0
- package/src/app/ui/editor-client/public/vendor/ace/worker-html.js +1 -0
- package/src/app/ui/editor-client/public/vendor/ace/worker-javascript.js +1 -0
- package/src/app/ui/editor-client/public/vendor/ace/worker-json.js +1 -0
- package/src/app/ui/editor-client/public/vendor/ace/worker-jsonata.js +2140 -0
- package/src/app/ui/editor-client/public/vendor/ace/worker-xml.js +1 -0
- package/src/app/ui/editor-client/public/vendor/beautifyjs/beautify.min.js +1 -0
- package/src/app/ui/editor-client/public/vendor/bootstrap/css/bootstrap.min.css +9 -0
- package/src/app/ui/editor-client/public/vendor/bootstrap/img/glyphicons-halflings-white.png +0 -0
- package/src/app/ui/editor-client/public/vendor/bootstrap/img/glyphicons-halflings.png +0 -0
- package/src/app/ui/editor-client/public/vendor/code-mirror/addon/active-line.js +72 -0
- package/src/app/ui/editor-client/public/vendor/code-mirror/addon/coffeescript-lint.js +47 -0
- package/src/app/ui/editor-client/public/vendor/code-mirror/addon/javascript-hint.js +157 -0
- package/src/app/ui/editor-client/public/vendor/code-mirror/addon/javascript-lint.js +63 -0
- package/src/app/ui/editor-client/public/vendor/code-mirror/addon/jshint.js +29591 -0
- package/src/app/ui/editor-client/public/vendor/code-mirror/addon/lint.css +73 -0
- package/src/app/ui/editor-client/public/vendor/code-mirror/addon/lint.js +252 -0
- package/src/app/ui/editor-client/public/vendor/code-mirror/addon/show-hint.css +36 -0
- package/src/app/ui/editor-client/public/vendor/code-mirror/addon/show-hint.js +460 -0
- package/src/app/ui/editor-client/public/vendor/code-mirror/addon/sql-hint.js +304 -0
- package/src/app/ui/editor-client/public/vendor/code-mirror/lib/codemirror.css +350 -0
- package/src/app/ui/editor-client/public/vendor/code-mirror/lib/codemirror.js +9800 -0
- package/src/app/ui/editor-client/public/vendor/code-mirror/mode/javascript.js +927 -0
- package/src/app/ui/editor-client/public/vendor/code-mirror/mode/sql.js +494 -0
- package/src/app/ui/editor-client/public/vendor/code-mirror/theme/base16-dark.css +38 -0
- package/src/app/ui/editor-client/public/vendor/code-mirror/theme/monokai.css +42 -0
- package/src/app/ui/editor-client/public/vendor/code-mirror/theme/solarized.css +168 -0
- package/src/app/ui/editor-client/public/vendor/d3-context-menu/d3-context-menu.css +43 -0
- package/src/app/ui/editor-client/public/vendor/d3-context-menu/d3-context-menu.js +87 -0
- package/src/app/ui/editor-client/public/vendor/easy-json-schema/index.js +88 -0
- package/src/app/ui/editor-client/public/vendor/font-awesome/css/font-awesome.min.css +4 -0
- package/src/app/ui/editor-client/public/vendor/font-awesome/fonts/FontAwesome.otf +0 -0
- package/src/app/ui/editor-client/public/vendor/font-awesome/fonts/fontawesome-webfont.eot +0 -0
- package/src/app/ui/editor-client/public/vendor/font-awesome/fonts/fontawesome-webfont.svg +2671 -0
- package/src/app/ui/editor-client/public/vendor/font-awesome/fonts/fontawesome-webfont.ttf +0 -0
- package/src/app/ui/editor-client/public/vendor/font-awesome/fonts/fontawesome-webfont.woff +0 -0
- package/src/app/ui/editor-client/public/vendor/font-awesome/fonts/fontawesome-webfont.woff2 +0 -0
- package/src/app/ui/editor-client/public/vendor/icofont/fonts/icofont.eot +0 -0
- package/src/app/ui/editor-client/public/vendor/icofont/fonts/icofont.svg +2105 -0
- package/src/app/ui/editor-client/public/vendor/icofont/fonts/icofont.ttf +0 -0
- package/src/app/ui/editor-client/public/vendor/icofont/fonts/icofont.woff +0 -0
- package/src/app/ui/editor-client/public/vendor/icofont/fonts/icofont.woff2 +0 -0
- package/src/app/ui/editor-client/public/vendor/icofont/icofont.min.css +7 -0
- package/src/app/ui/editor-client/public/vendor/jquery/css/smoothness/images/animated-overlay.gif +0 -0
- package/src/app/ui/editor-client/public/vendor/jquery/css/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- package/src/app/ui/editor-client/public/vendor/jquery/css/smoothness/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- package/src/app/ui/editor-client/public/vendor/jquery/css/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- package/src/app/ui/editor-client/public/vendor/jquery/css/smoothness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- package/src/app/ui/editor-client/public/vendor/jquery/css/smoothness/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- package/src/app/ui/editor-client/public/vendor/jquery/css/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- package/src/app/ui/editor-client/public/vendor/jquery/css/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- package/src/app/ui/editor-client/public/vendor/jquery/css/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- package/src/app/ui/editor-client/public/vendor/jquery/css/smoothness/images/ui-icons_222222_256x240.png +0 -0
- package/src/app/ui/editor-client/public/vendor/jquery/css/smoothness/images/ui-icons_2e83ff_256x240.png +0 -0
- package/src/app/ui/editor-client/public/vendor/jquery/css/smoothness/images/ui-icons_454545_256x240.png +0 -0
- package/src/app/ui/editor-client/public/vendor/jquery/css/smoothness/images/ui-icons_888888_256x240.png +0 -0
- package/src/app/ui/editor-client/public/vendor/jquery/css/smoothness/images/ui-icons_cd0a0a_256x240.png +0 -0
- package/src/app/ui/editor-client/public/vendor/jquery/css/smoothness/jquery-ui-1.10.3.custom.min.css +5 -0
- package/src/app/ui/editor-client/public/vendor/jsonata/jsonata.min.js +183 -0
- package/src/app/ui/editor-client/public/vendor/misc/toggleswitch.css +181 -0
- package/src/app/ui/editor-client/public/vendor/misc/toggleswitch.js +48 -0
- package/src/app/ui/editor-client/public/vendor/simplemde/simplemde.min.css +7 -0
- package/src/app/ui/editor-client/public/vendor/simplemde/simplemde.min.js +15 -0
- package/src/app/ui/editor-client/public/vendor/vendor.css +0 -0
- package/src/app/ui/editor-client/public/vendor/vendor.js +125 -0
- package/src/app/ui/editor-client/public/vendor/xterm/lib/xterm.js +2 -0
- package/src/app/ui/editor-client/src/ace/README.md +50 -0
- package/src/app/ui/editor-client/src/ace/mode/nrjavascript.js +35 -0
- package/src/app/ui/editor-client/src/ace/mode/nrjavascript_worker.js +189 -0
- package/src/app/ui/editor-client/src/favicon.ico +0 -0
- package/src/app/ui/editor-client/src/images/bolt.png +0 -0
- package/src/app/ui/editor-client/src/images/debugger/continue-full.png +0 -0
- package/src/app/ui/editor-client/src/images/debugger/continue-outline.png +0 -0
- package/src/app/ui/editor-client/src/images/debugger/pause.png +0 -0
- package/src/app/ui/editor-client/src/images/debugger/restart.png +0 -0
- package/src/app/ui/editor-client/src/images/debugger/stepover.png +0 -0
- package/src/app/ui/editor-client/src/images/debugger/stop.png +0 -0
- package/src/app/ui/editor-client/src/images/deploy-flows-o.png +0 -0
- package/src/app/ui/editor-client/src/images/deploy-flows.png +0 -0
- package/src/app/ui/editor-client/src/images/deploy-full-o.png +0 -0
- package/src/app/ui/editor-client/src/images/deploy-full.png +0 -0
- package/src/app/ui/editor-client/src/images/deploy-nodes-o.png +0 -0
- package/src/app/ui/editor-client/src/images/deploy-nodes.png +0 -0
- package/src/app/ui/editor-client/src/images/deploy-reload.png +0 -0
- package/src/app/ui/editor-client/src/images/grip.png +0 -0
- package/src/app/ui/editor-client/src/images/icons/arrow-in.png +0 -0
- package/src/app/ui/editor-client/src/images/icons/bolt.png +0 -0
- package/src/app/ui/editor-client/src/images/icons/node-changed.png +0 -0
- package/src/app/ui/editor-client/src/images/icons/node-error.png +0 -0
- package/src/app/ui/editor-client/src/images/icons/node-play.png +0 -0
- package/src/app/ui/editor-client/src/images/kumologica-app.png +0 -0
- package/src/app/ui/editor-client/src/images/node-red-256.png +0 -0
- package/src/app/ui/editor-client/src/images/node-red-icon-black.svg +9 -0
- package/src/app/ui/editor-client/src/images/node-red-icon.svg +33 -0
- package/src/app/ui/editor-client/src/images/node-red.png +0 -0
- package/src/app/ui/editor-client/src/images/pw_maze_white.png +0 -0
- package/src/app/ui/editor-client/src/images/spin.svg +41 -0
- package/src/app/ui/editor-client/src/images/spinner.gif +0 -0
- package/src/app/ui/editor-client/src/images/subflow_tab.png +0 -0
- package/src/app/ui/editor-client/src/images/test-icon.png +0 -0
- package/src/app/ui/editor-client/src/images/typedInput/09.png +0 -0
- package/src/app/ui/editor-client/src/images/typedInput/az.png +0 -0
- package/src/app/ui/editor-client/src/images/typedInput/bin.png +0 -0
- package/src/app/ui/editor-client/src/images/typedInput/bool.png +0 -0
- package/src/app/ui/editor-client/src/images/typedInput/env.png +0 -0
- package/src/app/ui/editor-client/src/images/typedInput/expr.png +0 -0
- package/src/app/ui/editor-client/src/images/typedInput/json.png +0 -0
- package/src/app/ui/editor-client/src/images/typedInput/re.png +0 -0
- package/src/app/ui/editor-client/src/js/comms.js +174 -0
- package/src/app/ui/editor-client/src/js/events.js +39 -0
- package/src/app/ui/editor-client/src/js/font-awesome.js +818 -0
- package/src/app/ui/editor-client/src/js/history.js +337 -0
- package/src/app/ui/editor-client/src/js/i18n.js +81 -0
- package/src/app/ui/editor-client/src/js/jquery-addons.js +21 -0
- package/src/app/ui/editor-client/src/js/keymap.json +54 -0
- package/src/app/ui/editor-client/src/js/main-modals.js +14 -0
- package/src/app/ui/editor-client/src/js/main.js +10 -0
- package/src/app/ui/editor-client/src/js/modals/modal-home.js +162 -0
- package/src/app/ui/editor-client/src/js/modals/modal-new-project.js +86 -0
- package/src/app/ui/editor-client/src/js/modals/modal-node-library.js +255 -0
- package/src/app/ui/editor-client/src/js/modals/modal-welcome.js +102 -0
- package/src/app/ui/editor-client/src/js/nodes.js +1736 -0
- package/src/app/ui/editor-client/src/js/red.js +704 -0
- package/src/app/ui/editor-client/src/js/settings.js +275 -0
- package/src/app/ui/editor-client/src/js/text/bidi.js +116 -0
- package/src/app/ui/editor-client/src/js/text/format.js +1316 -0
- package/src/app/ui/editor-client/src/js/ui/actions.js +39 -0
- package/src/app/ui/editor-client/src/js/ui/clipboard.js +510 -0
- package/src/app/ui/editor-client/src/js/ui/common/checkboxSet.js +117 -0
- package/src/app/ui/editor-client/src/js/ui/common/editableList.js +322 -0
- package/src/app/ui/editor-client/src/js/ui/common/menu.js +277 -0
- package/src/app/ui/editor-client/src/js/ui/common/panels.js +104 -0
- package/src/app/ui/editor-client/src/js/ui/common/popover.js +268 -0
- package/src/app/ui/editor-client/src/js/ui/common/searchBox.js +98 -0
- package/src/app/ui/editor-client/src/js/ui/common/stack.js +184 -0
- package/src/app/ui/editor-client/src/js/ui/common/tabs.js +730 -0
- package/src/app/ui/editor-client/src/js/ui/common/treeList.js +170 -0
- package/src/app/ui/editor-client/src/js/ui/common/typedInput.js +819 -0
- package/src/app/ui/editor-client/src/js/ui/common/typedInputLong.js +829 -0
- package/src/app/ui/editor-client/src/js/ui/deploy.js +422 -0
- package/src/app/ui/editor-client/src/js/ui/diff.js +2225 -0
- package/src/app/ui/editor-client/src/js/ui/editor.js +3020 -0
- package/src/app/ui/editor-client/src/js/ui/editors/buffer.js +195 -0
- package/src/app/ui/editor-client/src/js/ui/editors/expression.js +627 -0
- package/src/app/ui/editor-client/src/js/ui/editors/js.js +89 -0
- package/src/app/ui/editor-client/src/js/ui/editors/json.js +107 -0
- package/src/app/ui/editor-client/src/js/ui/editors/markdown.js +267 -0
- package/src/app/ui/editor-client/src/js/ui/editors/string.js +75 -0
- package/src/app/ui/editor-client/src/js/ui/event-log.js +107 -0
- package/src/app/ui/editor-client/src/js/ui/header.js +372 -0
- package/src/app/ui/editor-client/src/js/ui/keyboard.js +565 -0
- package/src/app/ui/editor-client/src/js/ui/library.js +570 -0
- package/src/app/ui/editor-client/src/js/ui/logviewer.js +116 -0
- package/src/app/ui/editor-client/src/js/ui/notifications.js +282 -0
- package/src/app/ui/editor-client/src/js/ui/palette-editor.js +1061 -0
- package/src/app/ui/editor-client/src/js/ui/palette.js +788 -0
- package/src/app/ui/editor-client/src/js/ui/project-info.js +232 -0
- package/src/app/ui/editor-client/src/js/ui/projects/projectSettings.js +1651 -0
- package/src/app/ui/editor-client/src/js/ui/projects/projectUserSettings.js +404 -0
- package/src/app/ui/editor-client/src/js/ui/projects/projects.js +2395 -0
- package/src/app/ui/editor-client/src/js/ui/projects/tab-versionControl.js +1383 -0
- package/src/app/ui/editor-client/src/js/ui/search.js +366 -0
- package/src/app/ui/editor-client/src/js/ui/sidebar.js +409 -0
- package/src/app/ui/editor-client/src/js/ui/state.js +14 -0
- package/src/app/ui/editor-client/src/js/ui/subflow.js +748 -0
- package/src/app/ui/editor-client/src/js/ui/tab-awsDeploy.js +1427 -0
- package/src/app/ui/editor-client/src/js/ui/tab-azure.js +852 -0
- package/src/app/ui/editor-client/src/js/ui/tab-config.js +452 -0
- package/src/app/ui/editor-client/src/js/ui/tab-context.js +406 -0
- package/src/app/ui/editor-client/src/js/ui/tab-info.js +661 -0
- package/src/app/ui/editor-client/src/js/ui/tab-kumohub.js +800 -0
- package/src/app/ui/editor-client/src/js/ui/tab-nodeInfo.js +60 -0
- package/src/app/ui/editor-client/src/js/ui/tab-test.js +915 -0
- package/src/app/ui/editor-client/src/js/ui/terminal.js +240 -0
- package/src/app/ui/editor-client/src/js/ui/touch/radialMenu.js +170 -0
- package/src/app/ui/editor-client/src/js/ui/tray.js +411 -0
- package/src/app/ui/editor-client/src/js/ui/typeSearch.js +411 -0
- package/src/app/ui/editor-client/src/js/ui/ui-settings.js +422 -0
- package/src/app/ui/editor-client/src/js/ui/update-panel.js +84 -0
- package/src/app/ui/editor-client/src/js/ui/userSettings.js +673 -0
- package/src/app/ui/editor-client/src/js/ui/utils.js +1287 -0
- package/src/app/ui/editor-client/src/js/ui/view-navigator.js +169 -0
- package/src/app/ui/editor-client/src/js/ui/view-tools.js +123 -0
- package/src/app/ui/editor-client/src/js/ui/view.js +5333 -0
- package/src/app/ui/editor-client/src/js/ui/workspaces.js +498 -0
- package/src/app/ui/editor-client/src/js/user.js +282 -0
- package/src/app/ui/editor-client/src/js/validators.js +54 -0
- package/src/app/ui/editor-client/src/kumologica-app.png +0 -0
- package/src/app/ui/editor-client/src/sass/ace.scss +29 -0
- package/src/app/ui/editor-client/src/sass/bootstrap.scss +21 -0
- package/src/app/ui/editor-client/src/sass/colors.scss +76 -0
- package/src/app/ui/editor-client/src/sass/debug.scss +383 -0
- package/src/app/ui/editor-client/src/sass/diff.scss +695 -0
- package/src/app/ui/editor-client/src/sass/dragdrop.scss +37 -0
- package/src/app/ui/editor-client/src/sass/dropdownMenu.scss +93 -0
- package/src/app/ui/editor-client/src/sass/editor.scss +683 -0
- package/src/app/ui/editor-client/src/sass/flow.scss +330 -0
- package/src/app/ui/editor-client/src/sass/forms.scss +1093 -0
- package/src/app/ui/editor-client/src/sass/header.scss +502 -0
- package/src/app/ui/editor-client/src/sass/jquery.scss +152 -0
- package/src/app/ui/editor-client/src/sass/keyboard.scss +136 -0
- package/src/app/ui/editor-client/src/sass/library.scss +54 -0
- package/src/app/ui/editor-client/src/sass/mixins.scss +283 -0
- package/src/app/ui/editor-client/src/sass/modals/modalHome.scss +138 -0
- package/src/app/ui/editor-client/src/sass/modals/modalNewProject.scss +96 -0
- package/src/app/ui/editor-client/src/sass/modals/modalNodeLibrary.scss +131 -0
- package/src/app/ui/editor-client/src/sass/modals/modalWelcome.scss +102 -0
- package/src/app/ui/editor-client/src/sass/notifications.scss +118 -0
- package/src/app/ui/editor-client/src/sass/palette-editor.scss +275 -0
- package/src/app/ui/editor-client/src/sass/palette.scss +279 -0
- package/src/app/ui/editor-client/src/sass/panels.scss +61 -0
- package/src/app/ui/editor-client/src/sass/popover.scss +166 -0
- package/src/app/ui/editor-client/src/sass/project-info.scss +74 -0
- package/src/app/ui/editor-client/src/sass/projects.scss +875 -0
- package/src/app/ui/editor-client/src/sass/search.scss +201 -0
- package/src/app/ui/editor-client/src/sass/sidebar.scss +201 -0
- package/src/app/ui/editor-client/src/sass/style.scss +170 -0
- package/src/app/ui/editor-client/src/sass/tab-azure.scss +68 -0
- package/src/app/ui/editor-client/src/sass/tab-cloud.scss +67 -0
- package/src/app/ui/editor-client/src/sass/tab-config.scss +100 -0
- package/src/app/ui/editor-client/src/sass/tab-context.scss +54 -0
- package/src/app/ui/editor-client/src/sass/tab-info.scss +307 -0
- package/src/app/ui/editor-client/src/sass/tab-kumohub.scss +68 -0
- package/src/app/ui/editor-client/src/sass/tab-test.scss +257 -0
- package/src/app/ui/editor-client/src/sass/tabs.scss +395 -0
- package/src/app/ui/editor-client/src/sass/terminal.scss +246 -0
- package/src/app/ui/editor-client/src/sass/ui/common/checkboxSet.scss +29 -0
- package/src/app/ui/editor-client/src/sass/ui/common/editableList.scss +81 -0
- package/src/app/ui/editor-client/src/sass/ui/common/nodeList.scss +65 -0
- package/src/app/ui/editor-client/src/sass/ui/common/searchBox.scss +77 -0
- package/src/app/ui/editor-client/src/sass/ui/common/stack.scss +26 -0
- package/src/app/ui/editor-client/src/sass/ui/common/treeList.scss +108 -0
- package/src/app/ui/editor-client/src/sass/ui/common/typedInput.scss +181 -0
- package/src/app/ui/editor-client/src/sass/ui/common/typedInputLong.scss +183 -0
- package/src/app/ui/editor-client/src/sass/ui-settings.scss +119 -0
- package/src/app/ui/editor-client/src/sass/update-panel.scss +18 -0
- package/src/app/ui/editor-client/src/sass/userSettings.scss +93 -0
- package/src/app/ui/editor-client/src/sass/widgetStyle.scss +23 -0
- package/src/app/ui/editor-client/src/sass/workspace.scss +123 -0
- package/src/app/ui/editor-client/src/sass/workspaceToolbar.scss +85 -0
- package/src/app/ui/editor-client/src/vendor/ace/LICENSE +24 -0
- package/src/app/ui/editor-client/src/vendor/ace/ace.js +17 -0
- package/src/app/ui/editor-client/src/vendor/ace/ext-language_tools.js +8 -0
- package/src/app/ui/editor-client/src/vendor/ace/ext-searchbox.js +8 -0
- package/src/app/ui/editor-client/src/vendor/ace/mode-css.js +8 -0
- package/src/app/ui/editor-client/src/vendor/ace/mode-handlebars.js +8 -0
- package/src/app/ui/editor-client/src/vendor/ace/mode-html.js +8 -0
- package/src/app/ui/editor-client/src/vendor/ace/mode-javascript.js +8 -0
- package/src/app/ui/editor-client/src/vendor/ace/mode-json.js +8 -0
- package/src/app/ui/editor-client/src/vendor/ace/mode-markdown.js +8 -0
- package/src/app/ui/editor-client/src/vendor/ace/mode-properties.js +8 -0
- package/src/app/ui/editor-client/src/vendor/ace/mode-python.js +8 -0
- package/src/app/ui/editor-client/src/vendor/ace/mode-sql.js +8 -0
- package/src/app/ui/editor-client/src/vendor/ace/mode-swift.js +8 -0
- package/src/app/ui/editor-client/src/vendor/ace/mode-text.js +8 -0
- package/src/app/ui/editor-client/src/vendor/ace/mode-xml.js +8 -0
- package/src/app/ui/editor-client/src/vendor/ace/mode-yaml.js +8 -0
- package/src/app/ui/editor-client/src/vendor/ace/snippets/css.js +8 -0
- package/src/app/ui/editor-client/src/vendor/ace/snippets/handlebars.js +8 -0
- package/src/app/ui/editor-client/src/vendor/ace/snippets/html.js +8 -0
- package/src/app/ui/editor-client/src/vendor/ace/snippets/javascript.js +8 -0
- package/src/app/ui/editor-client/src/vendor/ace/snippets/json.js +8 -0
- package/src/app/ui/editor-client/src/vendor/ace/snippets/markdown.js +8 -0
- package/src/app/ui/editor-client/src/vendor/ace/snippets/properties.js +8 -0
- package/src/app/ui/editor-client/src/vendor/ace/snippets/python.js +8 -0
- package/src/app/ui/editor-client/src/vendor/ace/snippets/sql.js +8 -0
- package/src/app/ui/editor-client/src/vendor/ace/snippets/swift.js +8 -0
- package/src/app/ui/editor-client/src/vendor/ace/snippets/text.js +8 -0
- package/src/app/ui/editor-client/src/vendor/ace/snippets/xml.js +8 -0
- package/src/app/ui/editor-client/src/vendor/ace/snippets/yaml.js +8 -0
- package/src/app/ui/editor-client/src/vendor/ace/theme-chrome.js +8 -0
- package/src/app/ui/editor-client/src/vendor/ace/theme-tomorrow.js +8 -0
- package/src/app/ui/editor-client/src/vendor/ace/worker-css.js +1 -0
- package/src/app/ui/editor-client/src/vendor/ace/worker-html.js +1 -0
- package/src/app/ui/editor-client/src/vendor/ace/worker-javascript.js +1 -0
- package/src/app/ui/editor-client/src/vendor/ace/worker-json.js +1 -0
- package/src/app/ui/editor-client/src/vendor/ace/worker-xml.js +1 -0
- package/src/app/ui/editor-client/src/vendor/beautifyjs/beautify.min.js +1 -0
- package/src/app/ui/editor-client/src/vendor/bootstrap/css/bootstrap.css +5406 -0
- package/src/app/ui/editor-client/src/vendor/bootstrap/css/bootstrap.min.css +9 -0
- package/src/app/ui/editor-client/src/vendor/bootstrap/img/glyphicons-halflings-white.png +0 -0
- package/src/app/ui/editor-client/src/vendor/bootstrap/img/glyphicons-halflings.png +0 -0
- package/src/app/ui/editor-client/src/vendor/bootstrap/js/bootstrap.min.js +6 -0
- package/src/app/ui/editor-client/src/vendor/code-mirror/addon/active-line.js +72 -0
- package/src/app/ui/editor-client/src/vendor/code-mirror/addon/coffeescript-lint.js +47 -0
- package/src/app/ui/editor-client/src/vendor/code-mirror/addon/javascript-hint.js +157 -0
- package/src/app/ui/editor-client/src/vendor/code-mirror/addon/javascript-lint.js +63 -0
- package/src/app/ui/editor-client/src/vendor/code-mirror/addon/jshint.js +29591 -0
- package/src/app/ui/editor-client/src/vendor/code-mirror/addon/lint.css +73 -0
- package/src/app/ui/editor-client/src/vendor/code-mirror/addon/lint.js +252 -0
- package/src/app/ui/editor-client/src/vendor/code-mirror/addon/show-hint.css +36 -0
- package/src/app/ui/editor-client/src/vendor/code-mirror/addon/show-hint.js +460 -0
- package/src/app/ui/editor-client/src/vendor/code-mirror/addon/sql-hint.js +304 -0
- package/src/app/ui/editor-client/src/vendor/code-mirror/lib/codemirror.css +350 -0
- package/src/app/ui/editor-client/src/vendor/code-mirror/lib/codemirror.js +9800 -0
- package/src/app/ui/editor-client/src/vendor/code-mirror/mode/javascript.js +927 -0
- package/src/app/ui/editor-client/src/vendor/code-mirror/mode/sql.js +494 -0
- package/src/app/ui/editor-client/src/vendor/code-mirror/theme/base16-dark.css +38 -0
- package/src/app/ui/editor-client/src/vendor/code-mirror/theme/monokai.css +42 -0
- package/src/app/ui/editor-client/src/vendor/code-mirror/theme/solarized.css +168 -0
- package/src/app/ui/editor-client/src/vendor/d3/d3.v3.min.js +4 -0
- package/src/app/ui/editor-client/src/vendor/d3/d3.v4.min.js +2 -0
- package/src/app/ui/editor-client/src/vendor/d3-context-menu/d3-context-menu.css +43 -0
- package/src/app/ui/editor-client/src/vendor/d3-context-menu/d3-context-menu.js +87 -0
- package/src/app/ui/editor-client/src/vendor/easy-json-schema/index.js +88 -0
- package/src/app/ui/editor-client/src/vendor/font-awesome/css/font-awesome.min.css +4 -0
- package/src/app/ui/editor-client/src/vendor/font-awesome/fonts/FontAwesome.otf +0 -0
- package/src/app/ui/editor-client/src/vendor/font-awesome/fonts/fontawesome-webfont.eot +0 -0
- package/src/app/ui/editor-client/src/vendor/font-awesome/fonts/fontawesome-webfont.svg +2671 -0
- package/src/app/ui/editor-client/src/vendor/font-awesome/fonts/fontawesome-webfont.ttf +0 -0
- package/src/app/ui/editor-client/src/vendor/font-awesome/fonts/fontawesome-webfont.woff +0 -0
- package/src/app/ui/editor-client/src/vendor/font-awesome/fonts/fontawesome-webfont.woff2 +0 -0
- package/src/app/ui/editor-client/src/vendor/i18next/i18next.min.js +5 -0
- package/src/app/ui/editor-client/src/vendor/icofont/fonts/icofont.eot +0 -0
- package/src/app/ui/editor-client/src/vendor/icofont/fonts/icofont.svg +2105 -0
- package/src/app/ui/editor-client/src/vendor/icofont/fonts/icofont.ttf +0 -0
- package/src/app/ui/editor-client/src/vendor/icofont/fonts/icofont.woff +0 -0
- package/src/app/ui/editor-client/src/vendor/icofont/fonts/icofont.woff2 +0 -0
- package/src/app/ui/editor-client/src/vendor/icofont/icofont.min.css +7 -0
- package/src/app/ui/editor-client/src/vendor/jquery/css/smoothness/images/animated-overlay.gif +0 -0
- package/src/app/ui/editor-client/src/vendor/jquery/css/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- package/src/app/ui/editor-client/src/vendor/jquery/css/smoothness/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- package/src/app/ui/editor-client/src/vendor/jquery/css/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- package/src/app/ui/editor-client/src/vendor/jquery/css/smoothness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- package/src/app/ui/editor-client/src/vendor/jquery/css/smoothness/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- package/src/app/ui/editor-client/src/vendor/jquery/css/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- package/src/app/ui/editor-client/src/vendor/jquery/css/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- package/src/app/ui/editor-client/src/vendor/jquery/css/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- package/src/app/ui/editor-client/src/vendor/jquery/css/smoothness/images/ui-icons_222222_256x240.png +0 -0
- package/src/app/ui/editor-client/src/vendor/jquery/css/smoothness/images/ui-icons_2e83ff_256x240.png +0 -0
- package/src/app/ui/editor-client/src/vendor/jquery/css/smoothness/images/ui-icons_454545_256x240.png +0 -0
- package/src/app/ui/editor-client/src/vendor/jquery/css/smoothness/images/ui-icons_888888_256x240.png +0 -0
- package/src/app/ui/editor-client/src/vendor/jquery/css/smoothness/images/ui-icons_cd0a0a_256x240.png +0 -0
- package/src/app/ui/editor-client/src/vendor/jquery/css/smoothness/jquery-ui-1.10.3.custom.min.css +5 -0
- package/src/app/ui/editor-client/src/vendor/jquery/js/jquery-1.11.3.min.js +5 -0
- package/src/app/ui/editor-client/src/vendor/jquery/js/jquery-ui-1.10.3.custom.min.js +7 -0
- package/src/app/ui/editor-client/src/vendor/jquery/js/jquery.ui.touch-punch.min.js +11 -0
- package/src/app/ui/editor-client/src/vendor/jsonata/formatter.js +183 -0
- package/src/app/ui/editor-client/src/vendor/jsonata/mode-jsonata.js +134 -0
- package/src/app/ui/editor-client/src/vendor/jsonata/snippets-jsonata.js +11 -0
- package/src/app/ui/editor-client/src/vendor/jsonata/worker-jsonata.js +2140 -0
- package/src/app/ui/editor-client/src/vendor/marked/marked.min.js +6 -0
- package/src/app/ui/editor-client/src/vendor/misc/toggleswitch.css +181 -0
- package/src/app/ui/editor-client/src/vendor/misc/toggleswitch.js +48 -0
- package/src/app/ui/editor-client/templates/index.mst +314 -0
- package/src/app/ui/editor-client/templates/modals/modalHome.mst +107 -0
- package/src/app/ui/editor-client/templates/modals/modalNewProject.mst +104 -0
- package/src/app/ui/editor-client/templates/modals/modalNodeLibrary.mst +72 -0
- package/src/app/ui/editor-client/templates/modals/modalWelcome.mst +111 -0
- package/src/assets/eula.txt +170 -0
- package/src/assets/icon.icns +0 -0
- package/src/assets/kumologica-app.png +0 -0
- package/src/assets/license_en.txt +170 -0
|
@@ -0,0 +1,1427 @@
|
|
|
1
|
+
RED.sidebar.awsDeploy = (function () {
|
|
2
|
+
marked.setOptions({
|
|
3
|
+
renderer: new marked.Renderer(),
|
|
4
|
+
gfm: true,
|
|
5
|
+
tables: true,
|
|
6
|
+
breaks: false,
|
|
7
|
+
pedantic: false,
|
|
8
|
+
sanitize: true,
|
|
9
|
+
smartLists: true,
|
|
10
|
+
smartypants: false,
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
var content;
|
|
14
|
+
var sections;
|
|
15
|
+
var functionSection;
|
|
16
|
+
var environmentSection;
|
|
17
|
+
var eventSection;
|
|
18
|
+
var SELECT_AWS_PROFILE = 'Select AWS profile...';
|
|
19
|
+
var DEFINE_AWS_PROFILE = 'Define AWS profile';
|
|
20
|
+
var initialised = false;
|
|
21
|
+
var parameters;
|
|
22
|
+
const CONNECTED = "CONNECTED";
|
|
23
|
+
const DISCONNECTED = "DISCONNECTED";
|
|
24
|
+
const CONNECTING = "CONNECTING";
|
|
25
|
+
|
|
26
|
+
const DEPLOYING = 'DEPLOYING';
|
|
27
|
+
const NOTDEPLOYING = 'NOTDEPLOYING';
|
|
28
|
+
let deployState = NOTDEPLOYING;
|
|
29
|
+
|
|
30
|
+
var connectedState = DISCONNECTED;
|
|
31
|
+
|
|
32
|
+
function initCss() {
|
|
33
|
+
$('<style>')
|
|
34
|
+
.text(
|
|
35
|
+
`
|
|
36
|
+
select {
|
|
37
|
+
outline: 1.5px solid #ccc;
|
|
38
|
+
}
|
|
39
|
+
select:focus {
|
|
40
|
+
outline: 1.5px solid #ccc;
|
|
41
|
+
outline-offset: 0px;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.invalid {
|
|
45
|
+
border: 1px solid red;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.valid {
|
|
49
|
+
border: 1px solid green;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
datalist {
|
|
53
|
+
max-height: 300px;
|
|
54
|
+
overflow-y: auto !important;
|
|
55
|
+
}
|
|
56
|
+
.editor-button-xsmall {
|
|
57
|
+
height: 16px;
|
|
58
|
+
min-width: 16px;
|
|
59
|
+
line-height: 14px;
|
|
60
|
+
font-size: 10px;
|
|
61
|
+
border-radius: 2px;
|
|
62
|
+
padding: 0 2px;
|
|
63
|
+
}
|
|
64
|
+
`
|
|
65
|
+
)
|
|
66
|
+
.appendTo(document.head);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function initHTML() {
|
|
70
|
+
initCss();
|
|
71
|
+
content = document.createElement('div');
|
|
72
|
+
content.className = 'sidebar-cloud';
|
|
73
|
+
|
|
74
|
+
RED.actions.add('core:show-cloud-tab', show);
|
|
75
|
+
|
|
76
|
+
var stackContainer = $('<div>', {
|
|
77
|
+
class: 'sidebar-node-info-stack',
|
|
78
|
+
}).appendTo(content);
|
|
79
|
+
|
|
80
|
+
let headerContentHtml = `
|
|
81
|
+
<div class="sidebar-title-wrapper">
|
|
82
|
+
<span>Deploy: AWS</span>
|
|
83
|
+
</div>
|
|
84
|
+
<div id="cloud-sidebar-header" class="sidebar-header">
|
|
85
|
+
<div id="cloud-instrumentation" class="node-info">
|
|
86
|
+
|
|
87
|
+
<div id="profiles-wrapper">
|
|
88
|
+
<span style="padding-left: 3px">Profiles</span>
|
|
89
|
+
<select id="cloud-sidebar-profiles" class="palette-textinput" style="padding: 0px;">
|
|
90
|
+
<option value="Select AWS profile..." style="color:#3988CB !important">Click to select one...</option>
|
|
91
|
+
</select>
|
|
92
|
+
</div>
|
|
93
|
+
|
|
94
|
+
<div id="cloudops-wrapper">
|
|
95
|
+
<!-- connect btn -->
|
|
96
|
+
<div>
|
|
97
|
+
<a id="cloud-sidebar-connect-btn" class="sidebar-header-button" href="#">
|
|
98
|
+
<i id="cloud-sidebar-connect-icon" class="fa fa-circle" style="color: red"></i>
|
|
99
|
+
Connect
|
|
100
|
+
</a>
|
|
101
|
+
</div>
|
|
102
|
+
|
|
103
|
+
<!-- deploy btn -->
|
|
104
|
+
<div style="margin-right: 4px;">
|
|
105
|
+
<a id="cloud-sidebar-deploy-btn" class="sidebar-header-button" href="#">
|
|
106
|
+
<i id="cloud-sidebar-deploy-icon" class="fa fa-cloud-upload"></i>
|
|
107
|
+
Deploy
|
|
108
|
+
</a>
|
|
109
|
+
</div>
|
|
110
|
+
|
|
111
|
+
<!-- export btn -->
|
|
112
|
+
<div id="cloud-options-dropdown">
|
|
113
|
+
<a id="cloud-sidebar-export-btn" class="sidebar-header-button" href="#">
|
|
114
|
+
<i class="fa fa-ellipsis-h"></i>
|
|
115
|
+
</a>
|
|
116
|
+
</div>
|
|
117
|
+
<div id="cloud-options-dropdown-content">
|
|
118
|
+
<span class="option-disabled">Generate script...</span>
|
|
119
|
+
<span id="exportCloudFormationBtn" class="option">AWS CloudFormation</span>
|
|
120
|
+
<span id="exportServerlessBtn" class="option">Serverless</span>
|
|
121
|
+
</div>
|
|
122
|
+
</div>
|
|
123
|
+
</div>
|
|
124
|
+
|
|
125
|
+
<table hidden id="cloud-sidebar-error" class="node-info" style="margin: 0px;">
|
|
126
|
+
<tr>
|
|
127
|
+
<td style="border: 0px solid white; padding: 3px; width: 100%;">
|
|
128
|
+
<p style="font-size: 12px; margin: 0px; text-align: center; color:red;"><span>AWS profile has not been configured</span></p>
|
|
129
|
+
</td>
|
|
130
|
+
|
|
131
|
+
<td style="border: 0px solid white; padding: 3px;">
|
|
132
|
+
<a id="cloud-sidebar-error-help-btn" class="editor-button editor-button-xsmall" href="https://docs.kumologica.com/docs/guide/GettingStarted.html#installation" target="_blank">
|
|
133
|
+
<i class="fa fa-question"></i>
|
|
134
|
+
</a>
|
|
135
|
+
</td>
|
|
136
|
+
|
|
137
|
+
<td style="border: 0px solid white; padding: 3px 6px 3px 3px;">
|
|
138
|
+
<a id="cloud-sidebar-error-close-btn" class="editor-button editor-button-xsmall" href="#">
|
|
139
|
+
<i class="fa fa-times"></i></a>
|
|
140
|
+
</td>
|
|
141
|
+
</tr>
|
|
142
|
+
</table>
|
|
143
|
+
</div>
|
|
144
|
+
`;
|
|
145
|
+
|
|
146
|
+
$(headerContentHtml).appendTo(stackContainer);
|
|
147
|
+
|
|
148
|
+
let bodyContainer = $(`<div id="cloud-sidebar-body" style="display:none"></div>`);
|
|
149
|
+
bodyContainer.appendTo(stackContainer);
|
|
150
|
+
|
|
151
|
+
sections = RED.stack
|
|
152
|
+
.create({
|
|
153
|
+
container: bodyContainer,
|
|
154
|
+
})
|
|
155
|
+
.hide();
|
|
156
|
+
|
|
157
|
+
// function section
|
|
158
|
+
functionSection = sections.add({
|
|
159
|
+
title: 'function',
|
|
160
|
+
collapsible: true,
|
|
161
|
+
});
|
|
162
|
+
functionSection.expand();
|
|
163
|
+
|
|
164
|
+
// function section
|
|
165
|
+
functionParametersSection = sections.add({
|
|
166
|
+
title: 'more parameters',
|
|
167
|
+
collapsible: true,
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
// environment section
|
|
171
|
+
environmentSection = sections.add({
|
|
172
|
+
title: 'environment',
|
|
173
|
+
collapsible: true,
|
|
174
|
+
});
|
|
175
|
+
//environmentSection.expand();
|
|
176
|
+
|
|
177
|
+
// tags section
|
|
178
|
+
tagsSection = sections.add({
|
|
179
|
+
title: 'tags',
|
|
180
|
+
collapsible: true,
|
|
181
|
+
});
|
|
182
|
+
//tagsSection.expand();
|
|
183
|
+
|
|
184
|
+
// event section
|
|
185
|
+
eventSection = sections.add({
|
|
186
|
+
title: 'Triggers',
|
|
187
|
+
collapsible: true,
|
|
188
|
+
});
|
|
189
|
+
eventSection.expand();
|
|
190
|
+
|
|
191
|
+
RED.sidebar.addTab({
|
|
192
|
+
id: 'cloud',
|
|
193
|
+
label: 'Cloud',
|
|
194
|
+
name: 'AWS Deployer',
|
|
195
|
+
iconClass: 'fa fa-amazon',
|
|
196
|
+
action: 'core:show-cloud-tab',
|
|
197
|
+
content: content,
|
|
198
|
+
pinned: true,
|
|
199
|
+
enableOnEdit: true,
|
|
200
|
+
onchange: onchange,
|
|
201
|
+
onsame: onsame
|
|
202
|
+
});
|
|
203
|
+
|
|
204
|
+
// Function content init
|
|
205
|
+
let functionSectionHtml = `
|
|
206
|
+
<table class="node-info">
|
|
207
|
+
<tr class="node-info-node-row">
|
|
208
|
+
<td>Name</td>
|
|
209
|
+
<td colspan="2" style="background: white"><input style="width:100%" id="cloud-fn-name" class="palette-textinput" pattern="[a-zA-Z0-9-_]{1,64}" type="text"></td>
|
|
210
|
+
</tr>
|
|
211
|
+
<tr class="node-info-node-row">
|
|
212
|
+
<td>Description</td>
|
|
213
|
+
<td colspan="2" style="background: white"><input style="width:100%" id="cloud-fn-description" class="palette-textinput" type="text"></td>
|
|
214
|
+
</tr>
|
|
215
|
+
<tr class="node-info-node-row">
|
|
216
|
+
<td>Memory (MB)</td>
|
|
217
|
+
<td colspan="2" style="background: white"><input id="cloud-fn-memory" class="palette-textinput" type="number" min="128" max="1536"></td>
|
|
218
|
+
</tr>
|
|
219
|
+
<tr class="node-info-node-row">
|
|
220
|
+
<td>Timeout (s)</td>
|
|
221
|
+
<td colspan="2" style="background: white"><input id="cloud-fn-timeout" class="palette-textinput" type="number" min="5" max="900"></td>
|
|
222
|
+
</tr>
|
|
223
|
+
</table>
|
|
224
|
+
`;
|
|
225
|
+
$(functionSectionHtml).appendTo(functionSection.content);
|
|
226
|
+
functionSection.container.show();
|
|
227
|
+
|
|
228
|
+
// Function content init
|
|
229
|
+
let functionParametersSectionHtml = `
|
|
230
|
+
<table class="node-info">
|
|
231
|
+
<tr class="node-info-node-row">
|
|
232
|
+
<td>Res. Concurrency</td>
|
|
233
|
+
<td colspan="2" style="background: white"><input id="cloud-fn-reservedConcurrency" class="palette-textinput" placeHolder="default" type="number"></td>
|
|
234
|
+
</tr>
|
|
235
|
+
<tr class="node-info-node-row">
|
|
236
|
+
<td>Activate X-Ray</td>
|
|
237
|
+
<td colspan="2" align="left" style="background: white; padding: 0px 6px 6px 12px; margin: 3px;"><input id="cloud-fn-x-ray" type="checkbox"></td>
|
|
238
|
+
</tr>
|
|
239
|
+
<tr class="node-info-node-row">
|
|
240
|
+
<td>Custom Role</td>
|
|
241
|
+
<td colspan="2" style="background: white; overflow-x:hidden"><input id="cloud-fn-role" list="iamroles-cloud-fn-role-dataList" style="width:100%" class="palette-textinput" placeHolder="optional" type="string"><datalist id="iamroles-cloud-fn-role-dataList"></datalist></td>
|
|
242
|
+
</tr>
|
|
243
|
+
</table>
|
|
244
|
+
`;
|
|
245
|
+
$(functionParametersSectionHtml).appendTo(
|
|
246
|
+
functionParametersSection.content
|
|
247
|
+
);
|
|
248
|
+
functionParametersSection.container.show();
|
|
249
|
+
|
|
250
|
+
// Environment section init
|
|
251
|
+
let environmentSectionHtml = `
|
|
252
|
+
<div style="display:flex; flex-direction: column; justify-content: flex-start;">
|
|
253
|
+
<div style="display:flex; justify-content: flex-end; padding:6px">
|
|
254
|
+
<a id="add-environment-variable" href="#" class="editor-button editor-button-small red-ui-editableList-addButton">
|
|
255
|
+
<i class="fa fa-plus"></i> Add
|
|
256
|
+
</a>
|
|
257
|
+
</div>
|
|
258
|
+
<div id="cloud-fn-env" style="display:flex; flex-direction: column">
|
|
259
|
+
<table id="cloud-fn-env-table" class="node-info" style="table-layout: fixed">
|
|
260
|
+
|
|
261
|
+
</table>
|
|
262
|
+
</div>
|
|
263
|
+
</div>
|
|
264
|
+
`;
|
|
265
|
+
$(environmentSectionHtml).appendTo(environmentSection.content);
|
|
266
|
+
environmentSection.container.show();
|
|
267
|
+
|
|
268
|
+
// Tags section init
|
|
269
|
+
let tagsSectionHtml = `
|
|
270
|
+
<div style="display:flex; flex-direction: column; justify-content: flex-start;">
|
|
271
|
+
<div style="display:flex; justify-content: flex-end; padding:6px">
|
|
272
|
+
<a id="add-tag" href="#" class="editor-button editor-button-small red-ui-editableList-addButton">
|
|
273
|
+
<i class="fa fa-plus"></i> Add
|
|
274
|
+
</a>
|
|
275
|
+
</div>
|
|
276
|
+
<div id="cloud-fn-tags" style="display:flex; flex-direction: column">
|
|
277
|
+
<table id="cloud-fn-tags-table" class="node-info" style="table-layout: fixed">
|
|
278
|
+
|
|
279
|
+
</table>
|
|
280
|
+
</div>
|
|
281
|
+
</div>
|
|
282
|
+
`;
|
|
283
|
+
$(tagsSectionHtml).appendTo(tagsSection.content);
|
|
284
|
+
tagsSection.container.show();
|
|
285
|
+
|
|
286
|
+
// Event section init
|
|
287
|
+
$(`
|
|
288
|
+
<div style="display:flex; flex-direction: column; justify-content: flex-start;">
|
|
289
|
+
<div style="display:flex; justify-content: flex-start; padding:6px; margin-right: 6px;">
|
|
290
|
+
<select type="text" class="palette-textinput" id="eventSource" style="float: left; padding: 0px; height: 20px !important;">
|
|
291
|
+
<option value="dynamodb">Amazon DynamoDB</option>
|
|
292
|
+
<option value="kinesis">Amazon Kinesis</option>
|
|
293
|
+
<option value="sqs">Amazon SQS</option>
|
|
294
|
+
<option disabled>────────────────────</option>
|
|
295
|
+
<option value="alb">Application Load Balancer</option>
|
|
296
|
+
<!--option value="cognito">Amazon Cognito Sync Trigger</option-->
|
|
297
|
+
<!--option value="lex">Amazon Lex</option-->
|
|
298
|
+
<option value="alexa">Amazon Alexa</option>
|
|
299
|
+
<option selected value="api">Amazon API Gateway</option>
|
|
300
|
+
<!--option value="cf">Amazon CloudFront (Lambda@Edge)</option-->
|
|
301
|
+
<!--option value="firehose">Amazon Kinesis Data Firehose</option-->
|
|
302
|
+
<option disabled>────────────────────</option>
|
|
303
|
+
<option value="s3">Amazon S3</option>
|
|
304
|
+
<option value="sns">Amazon SNS</option>
|
|
305
|
+
<!--option value="ses">Amazon SES</option-->
|
|
306
|
+
<!--option value="cloudformation">Amazon CloudFormation</option-->
|
|
307
|
+
<!--option value="cwlogs">Amazon CloudWatch Logs</option-->
|
|
308
|
+
<option value="cwevents">Amazon CloudWatch Events</option>
|
|
309
|
+
<!--option value="codecommit">Amazon CodeCommit</option-->
|
|
310
|
+
<!--option value="config">Amazon Config</option-->
|
|
311
|
+
<option value="iot">Amazon IoT Events</option>
|
|
312
|
+
</select>
|
|
313
|
+
|
|
314
|
+
<a id="add-event" href="#" style="float: right; margin: 0px 0px 0px 5px !important; height: 21px !important;" class="editor-button editor-button-small">
|
|
315
|
+
<i class="fa fa-plus"></i> Event
|
|
316
|
+
</a>
|
|
317
|
+
</div>
|
|
318
|
+
|
|
319
|
+
<div id="cloud-fn-event" style="display:flex; flex-direction: column">
|
|
320
|
+
</div>
|
|
321
|
+
</div>
|
|
322
|
+
`).appendTo(eventSection.content);
|
|
323
|
+
eventSection.container.show();
|
|
324
|
+
|
|
325
|
+
// Tooltips
|
|
326
|
+
RED.popover.tooltip($('#cloud-sidebar-deploy-btn'), 'Deploy to AWS');
|
|
327
|
+
RED.popover.tooltip($('#cloud-sidebar-connect-btn'), 'Connect to AWS Account');
|
|
328
|
+
RED.popover.tooltip($('#cloud-options-dropdown'), 'Other Cloud Operations');
|
|
329
|
+
RED.popover.tooltip($('#cloud-sidebar-profiles'), 'Select AWS Profiles');
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
function onchange(){
|
|
333
|
+
RED.actions.invoke('core:show-sidebar');
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
function onsame(){
|
|
337
|
+
RED.actions.invoke('core:hide-sidebar');
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
function validateEventsValues() {
|
|
341
|
+
let logError = '';
|
|
342
|
+
|
|
343
|
+
$('#cloud-fn-event')
|
|
344
|
+
.find('input')
|
|
345
|
+
.each(function () {
|
|
346
|
+
if ($(this).prop('required') && !$(this).val()) {
|
|
347
|
+
let triggerName = $(this).closest('table').find('th').eq(0).text();
|
|
348
|
+
let triggerParameter = $(this).parent().siblings(':first').text();
|
|
349
|
+
|
|
350
|
+
logError += `<li>${triggerName.toUpperCase()}: ${triggerParameter} is required.</li>`;
|
|
351
|
+
}
|
|
352
|
+
});
|
|
353
|
+
|
|
354
|
+
if (logError != '') {
|
|
355
|
+
RED.notify(
|
|
356
|
+
`Missing trigger details: \n <ul>${logError}</ul>`,
|
|
357
|
+
'error'
|
|
358
|
+
);
|
|
359
|
+
return false;
|
|
360
|
+
}
|
|
361
|
+
return true;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
function sanitizeLambdaName(name) {
|
|
365
|
+
return name
|
|
366
|
+
.replace('.json', '')
|
|
367
|
+
.trim()
|
|
368
|
+
.replace(/^@/, '')
|
|
369
|
+
.replace(/[^a-zA-Z0-9-_]/g, '_')
|
|
370
|
+
.substr(0, 140);
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
function setLambdaName(name) {
|
|
374
|
+
$('#cloud-fn-name').val(sanitizeLambdaName(name));
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
function setValues(params) {
|
|
378
|
+
if (!initialised) {
|
|
379
|
+
parameters = params;
|
|
380
|
+
return;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
if (params.name || params.functionName) {
|
|
384
|
+
setLambdaName(params.name || params.functionName);
|
|
385
|
+
} else {
|
|
386
|
+
if (window.__kumologica.settings.projectFlowName) {
|
|
387
|
+
setLambdaName(window.__kumologica.settings.projectFlowName);
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
if (params.description) {
|
|
392
|
+
$('#cloud-fn-description').val(params.description);
|
|
393
|
+
}
|
|
394
|
+
if (params.memory) {
|
|
395
|
+
$('#cloud-fn-memory').val(params.memory);
|
|
396
|
+
}
|
|
397
|
+
if (params.timeout) {
|
|
398
|
+
$('#cloud-fn-timeout').val(params.timeout);
|
|
399
|
+
}
|
|
400
|
+
if (params.reservedConcurrency) {
|
|
401
|
+
$('#cloud-fn-reservedConcurrency').val(params.reservedConcurrency);
|
|
402
|
+
}
|
|
403
|
+
if (params.xRay) {
|
|
404
|
+
$('#cloud-fn-x-ray').prop('checked', params.xRay);
|
|
405
|
+
}
|
|
406
|
+
if (params.role) {
|
|
407
|
+
$('#cloud-fn-role').val(params.role);
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
if (params.profile) {
|
|
411
|
+
setProfile(params.profile);
|
|
412
|
+
} else {
|
|
413
|
+
console.log(`params have no profile set`);
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
if (params.environment && params.environment.length > 0) {
|
|
417
|
+
let environmentTable = $('#cloud-fn-env-table');
|
|
418
|
+
|
|
419
|
+
params.environment.forEach(function (e, i) {
|
|
420
|
+
$(`
|
|
421
|
+
<tr class="node-info-node-row">
|
|
422
|
+
<td style="background: white; width:46%"><input id="cloud-fn-env-key" class="palette-textinput" type="text" placeholder="key" style="width:100%" value="${e.key}"></td>
|
|
423
|
+
<td style="background: white; width:46%"><input id="cloud-fn-env-val" class="palette-textinput" type="text" placeholder="value" style="width:100%" value="${e.value}"></td>
|
|
424
|
+
<td id="cloud-fn-env-row" style="text-align:center; width:8%" class="removeRow"><i class="fa fa-minus"></i></td>
|
|
425
|
+
</tr>`).appendTo(environmentTable);
|
|
426
|
+
});
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
if (params.tags && params.tags.length > 0) {
|
|
430
|
+
params.tags.forEach(function (e, i) {
|
|
431
|
+
$(`
|
|
432
|
+
<tr class="node-info-node-row">
|
|
433
|
+
<td style="background: white; width:46%"><input id="cloud-fn-env-key" class="palette-textinput" type="text" placeholder="key" style="width:100%" value="${e.key}"></td>
|
|
434
|
+
<td style="background: white; width:46%"><input id="cloud-fn-env-val" class="palette-textinput" type="text" placeholder="value" style="width:100%" value="${e.value}"></td>
|
|
435
|
+
<td id="cloud-fn-tag-row" style="text-align:center; width:8%" class="removeRow"><i class="fa fa-minus"></i></td>
|
|
436
|
+
</tr>`).appendTo($('#cloud-fn-tags-table'));
|
|
437
|
+
});
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
if (params.events && params.events.length > 0) {
|
|
441
|
+
params.events.forEach(function (e) {
|
|
442
|
+
addEvent(e.source, e);
|
|
443
|
+
});
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
function getValues() {
|
|
448
|
+
// Basic information
|
|
449
|
+
let fnName = $('#cloud-fn-name').val();
|
|
450
|
+
let fnDescription = $('#cloud-fn-description').val();
|
|
451
|
+
let fnMemory = $('#cloud-fn-memory').val();
|
|
452
|
+
let fnTimeout = $('#cloud-fn-timeout').val();
|
|
453
|
+
let fnReservedConcurrency = $('#cloud-fn-reservedConcurrency').val();
|
|
454
|
+
let fnXray = $('#cloud-fn-x-ray').prop('checked');
|
|
455
|
+
let fnProfile = getProfile();
|
|
456
|
+
let fnRole = $('#cloud-fn-role').val();
|
|
457
|
+
|
|
458
|
+
// Environment variables
|
|
459
|
+
let environment = [];
|
|
460
|
+
let envvarRows = $('#cloud-fn-env-table tr');
|
|
461
|
+
|
|
462
|
+
envvarRows.map((index, row) => {
|
|
463
|
+
let envvar = $(row).find('td').find('input');
|
|
464
|
+
let key = $(envvar[0]).val();
|
|
465
|
+
let value = $(envvar[1]).val();
|
|
466
|
+
environment.push({ key, value });
|
|
467
|
+
});
|
|
468
|
+
|
|
469
|
+
// tags
|
|
470
|
+
let tags = [];
|
|
471
|
+
let tagsRows = $('#cloud-fn-tags-table tr');
|
|
472
|
+
|
|
473
|
+
tagsRows.map((index, row) => {
|
|
474
|
+
let tagsrow = $(row).find('td').find('input');
|
|
475
|
+
let key = $(tagsrow[0]).val();
|
|
476
|
+
let value = $(tagsrow[1]).val();
|
|
477
|
+
tags.push({ key, value });
|
|
478
|
+
});
|
|
479
|
+
|
|
480
|
+
// events
|
|
481
|
+
let events = [];
|
|
482
|
+
$('#cloud-fn-event #cloud-fn-event-table').each(function () {
|
|
483
|
+
let event = {};
|
|
484
|
+
event.source = $(this)
|
|
485
|
+
.find('thead')
|
|
486
|
+
.find('tr')
|
|
487
|
+
.find('th:first')
|
|
488
|
+
.find('span')
|
|
489
|
+
.html();
|
|
490
|
+
|
|
491
|
+
$(this)
|
|
492
|
+
.find('tbody tr')
|
|
493
|
+
.each(function () {
|
|
494
|
+
// ignore td0, its a label
|
|
495
|
+
|
|
496
|
+
let key = $(this).find('td:eq(1)').html();
|
|
497
|
+
event[key] = $(this).find('td:eq(2) input').val();
|
|
498
|
+
|
|
499
|
+
if (!event[key]) {
|
|
500
|
+
event[key] = $(this)
|
|
501
|
+
.find('td:eq(2) select')
|
|
502
|
+
.children('option:selected')
|
|
503
|
+
.val();
|
|
504
|
+
}
|
|
505
|
+
});
|
|
506
|
+
events.push(event);
|
|
507
|
+
});
|
|
508
|
+
|
|
509
|
+
return {
|
|
510
|
+
functionName: fnName,
|
|
511
|
+
description: fnDescription,
|
|
512
|
+
memory: fnMemory,
|
|
513
|
+
timeout: fnTimeout,
|
|
514
|
+
reservedConcurrency: fnReservedConcurrency,
|
|
515
|
+
xRay: fnXray,
|
|
516
|
+
role: fnRole,
|
|
517
|
+
profile: fnProfile,
|
|
518
|
+
environment: environment,
|
|
519
|
+
tags: tags,
|
|
520
|
+
events: events,
|
|
521
|
+
};
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
async function attachDataList(serviceType, itemId, dataListId) {
|
|
525
|
+
|
|
526
|
+
let profile = getProfile();
|
|
527
|
+
if (!profile || profile == SELECT_AWS_PROFILE || connectedState != CONNECTED) {
|
|
528
|
+
return;
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
$(`#${dataListId}`).empty();
|
|
532
|
+
try {
|
|
533
|
+
let services = await window.__kumologica.cloud.listServices(serviceType);
|
|
534
|
+
|
|
535
|
+
if (serviceType == 'api') {
|
|
536
|
+
$(`#${dataListId}`).append(
|
|
537
|
+
$('<option>').attr('value', 'Create new API').text('Create new API')
|
|
538
|
+
);
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
if (services) {
|
|
542
|
+
$.each(services, function (i, item) {
|
|
543
|
+
$(`#${dataListId}`).append(
|
|
544
|
+
$('<option>').attr('value', item.id).text(item.name)
|
|
545
|
+
);
|
|
546
|
+
});
|
|
547
|
+
$(`#${itemId}`).attr('list', dataListId);
|
|
548
|
+
|
|
549
|
+
$(itemId).change(function () {
|
|
550
|
+
saveSettings();
|
|
551
|
+
});
|
|
552
|
+
|
|
553
|
+
}
|
|
554
|
+
} catch (err) {
|
|
555
|
+
let msg = `<li> getting <b>${serviceType}</b> details: ${err.message? err.message: err}</li>`;
|
|
556
|
+
RED.notify(`<strong>Permission Issues:</strong><ul>${msg}</ul>`, 'warn');
|
|
557
|
+
};
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
function attachServicesToDataList(serviceType, services, itemId) {
|
|
561
|
+
|
|
562
|
+
let dataListId = $(itemId).attr('list');
|
|
563
|
+
|
|
564
|
+
$(`#${dataListId}`).empty();
|
|
565
|
+
|
|
566
|
+
if (serviceType == 'api') {
|
|
567
|
+
$(`#${dataListId}`).append(
|
|
568
|
+
$('<option>').attr('value', 'Create new API').text('Create new API')
|
|
569
|
+
);
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
if (services) {
|
|
573
|
+
$.each(services, function (i, item) {
|
|
574
|
+
$(`#${dataListId}`).append(
|
|
575
|
+
$('<option>').attr('value', item.id).text(item.name)
|
|
576
|
+
);
|
|
577
|
+
});
|
|
578
|
+
|
|
579
|
+
$(itemId).change(function () {
|
|
580
|
+
saveSettings();
|
|
581
|
+
});
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
function handleError(error) {
|
|
586
|
+
|
|
587
|
+
let msg = error.message? error.message: error.toString();
|
|
588
|
+
if (error.code == 'InvalidClientTokenId') {
|
|
589
|
+
msg = `Unable to communicate with AWS account using profile: ${getProfile()}`;
|
|
590
|
+
|
|
591
|
+
} else if (error.code == 'UnrecognizedClientException') {
|
|
592
|
+
msg = `AWS identity defined by profile ${getProfile()} has insufficient permissions. Consider use of kumologica-designer-policy.`;
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
console.error(msg);
|
|
596
|
+
//RED.notify(`${msg}`, 'error');
|
|
597
|
+
return msg;
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
function eventTableHtml(eventSource, values, itemId, dataListId) {
|
|
601
|
+
html = `
|
|
602
|
+
<table id="cloud-fn-event-table" class="node-info" style="table-layout: fixed; padding: 0px; margin: 0px;">
|
|
603
|
+
<thead class="toggleHeader">
|
|
604
|
+
<tr>
|
|
605
|
+
<th style="width:46%" class="palette-header"><i class="fa fa-angle-down expanded"></i><span>${eventSource}</span></th>
|
|
606
|
+
<th style="display: none"></th>
|
|
607
|
+
<th style="width:44%; text-align:right; padding: 6px;" id="cloud-fn-event-remove"><i class="fa fa-minus removeRow"></i></th>
|
|
608
|
+
</tr>
|
|
609
|
+
</thead>
|
|
610
|
+
<tbody>`;
|
|
611
|
+
|
|
612
|
+
// add parameters
|
|
613
|
+
parameterSets[eventSource].forEach(function (p, i) {
|
|
614
|
+
let placeholder = 'optional';
|
|
615
|
+
let requiredAttribute = '';
|
|
616
|
+
if (p.required) {
|
|
617
|
+
placeholder = 'required';
|
|
618
|
+
requiredAttribute = 'required';
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
html += `
|
|
622
|
+
<tr class="node-info-node-row">
|
|
623
|
+
<td style="width:46%">${p.label}</td>
|
|
624
|
+
<td style="display: none">${p.key}</td>
|
|
625
|
+
`;
|
|
626
|
+
|
|
627
|
+
if (p.list) {
|
|
628
|
+
html += `
|
|
629
|
+
<td style="background: white; width:46%">
|
|
630
|
+
<select type="text" class="palette-textinput" id="${itemId}-${i}" style="float: left; width: 100%; padding: 0px; outline: 0px solid #ccc; ">
|
|
631
|
+
`;
|
|
632
|
+
$.each(p.list, function () {
|
|
633
|
+
if (values && this.v == values[p.key]) {
|
|
634
|
+
html += `<option value="${this.v}" selected>${this.k}</option>`;
|
|
635
|
+
} else {
|
|
636
|
+
html += `<option value="${this.v}">${this.k}</option>`;
|
|
637
|
+
}
|
|
638
|
+
});
|
|
639
|
+
html += `</select>
|
|
640
|
+
</td>
|
|
641
|
+
`;
|
|
642
|
+
} else if (p.function) {
|
|
643
|
+
html += `
|
|
644
|
+
<td style="background: white; width:46%">
|
|
645
|
+
<input id="${itemId}-${i}"
|
|
646
|
+
class="palette-textinput" type="text"
|
|
647
|
+
list="${dataListId}"
|
|
648
|
+
placeholder="required" style="width:100%"
|
|
649
|
+
value="${
|
|
650
|
+
values == undefined || values[p.key] == undefined
|
|
651
|
+
? ''
|
|
652
|
+
: values[p.key]
|
|
653
|
+
}" ${requiredAttribute}>
|
|
654
|
+
<datalist id="${dataListId}"></datalist>
|
|
655
|
+
</td>
|
|
656
|
+
`;
|
|
657
|
+
} else {
|
|
658
|
+
html += `
|
|
659
|
+
<td style="background: white; width:46%">
|
|
660
|
+
<input id="${itemId}-${i}" class="palette-textinput" type="text" placeholder="${placeholder}" style="width:100%" value="${
|
|
661
|
+
values == undefined || values[p.key] == undefined ? '' : values[p.key]
|
|
662
|
+
}" ${requiredAttribute}>
|
|
663
|
+
</td>
|
|
664
|
+
`;
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
html += `
|
|
668
|
+
</tr>`;
|
|
669
|
+
});
|
|
670
|
+
|
|
671
|
+
html += `
|
|
672
|
+
</tbody>
|
|
673
|
+
</table>`;
|
|
674
|
+
|
|
675
|
+
return html;
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
function addEvent(eventSource, values) {
|
|
679
|
+
let dataListId = eventSource + '-' + Date.now().toString();
|
|
680
|
+
let itemId = 'itemId' + Date.now().toString();
|
|
681
|
+
|
|
682
|
+
let eventsTable = $('#cloud-fn-event');
|
|
683
|
+
$(eventTableHtml(eventSource, values, itemId, dataListId)).appendTo(
|
|
684
|
+
eventsTable
|
|
685
|
+
);
|
|
686
|
+
|
|
687
|
+
$(eventsTable).on('click', '.removeRow', function () {
|
|
688
|
+
// i td tr tbody table
|
|
689
|
+
$(this).parent().parent().parent().parent().remove();
|
|
690
|
+
saveSettings();
|
|
691
|
+
});
|
|
692
|
+
|
|
693
|
+
for (var i = 0; i < parameterSets[eventSource].length; i++) {
|
|
694
|
+
$(`${itemId}-${i}`).change(function () {
|
|
695
|
+
saveSettings();
|
|
696
|
+
});
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
$('.toggleHeader').on('click', function () {
|
|
700
|
+
$(this).next('tbody').toggle();
|
|
701
|
+
});
|
|
702
|
+
|
|
703
|
+
attachDataList(eventSource, itemId, dataListId);
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
function cleanDataLists() {
|
|
707
|
+
let inputItems = $('#cloud-fn-event :input');
|
|
708
|
+
inputItems.each(function (idx, item) {
|
|
709
|
+
let dataListId = $(this).attr('list');
|
|
710
|
+
if (dataListId) {
|
|
711
|
+
$(`#${dataListId}`).empty();
|
|
712
|
+
}
|
|
713
|
+
});
|
|
714
|
+
|
|
715
|
+
let roleItemDataListId = $('#cloud-fn-role').attr('list');
|
|
716
|
+
$(`#${roleItemDataListId}`).empty();
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
function refreshDataLists() {
|
|
720
|
+
if (!getProfile()) {
|
|
721
|
+
return;
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
let inputItems = $('#cloud-fn-event :input');
|
|
725
|
+
let services = []; // array of promises
|
|
726
|
+
let serviceTypes = []; // array of string
|
|
727
|
+
|
|
728
|
+
inputItems.each(function (idx, item) {
|
|
729
|
+
let dataListId = $(this).attr('list');
|
|
730
|
+
if (dataListId) {
|
|
731
|
+
let serviceType = dataListId.split('-')[0];
|
|
732
|
+
serviceTypes.push({item: item, serviceType: serviceType});
|
|
733
|
+
services.push(window.__kumologica.cloud.listServices(serviceType).catch(err => err));
|
|
734
|
+
}
|
|
735
|
+
});
|
|
736
|
+
|
|
737
|
+
// iam roles
|
|
738
|
+
serviceTypes.push({item: $('#cloud-fn-role'), serviceType: 'iamroles'});
|
|
739
|
+
services.push(window.__kumologica.cloud.listServices('iamroles').catch(err => err));
|
|
740
|
+
|
|
741
|
+
Promise.all(services).then((results) => {
|
|
742
|
+
let msg = "";
|
|
743
|
+
results.forEach((r, i) => {
|
|
744
|
+
if (r.statusCode) {
|
|
745
|
+
msg += `<li> getting <b>${serviceTypes[i].serviceType}</b> details: ${r.message}</li>`;
|
|
746
|
+
} else {
|
|
747
|
+
attachServicesToDataList(serviceTypes[i].serviceType, results[i], serviceTypes[i].item);
|
|
748
|
+
}
|
|
749
|
+
})
|
|
750
|
+
|
|
751
|
+
if (msg.length > 0) {
|
|
752
|
+
RED.notify(`<strong>Permission Issues:</strong><ul>${msg}</ul>`, 'warn');
|
|
753
|
+
}
|
|
754
|
+
connectUIConnected();
|
|
755
|
+
});
|
|
756
|
+
}
|
|
757
|
+
|
|
758
|
+
RED.events.on('settings:cloud-config-changed', function() {
|
|
759
|
+
fillProfiles();
|
|
760
|
+
});
|
|
761
|
+
|
|
762
|
+
// event triggered when cloud-config.json file has been loaded
|
|
763
|
+
RED.events.on('cloud-config', function () {
|
|
764
|
+
if (
|
|
765
|
+
!$('#cloud-fn-name').val() &&
|
|
766
|
+
window.__kumologica.settings.projectFlowName
|
|
767
|
+
) {
|
|
768
|
+
setLambdaName(window.__kumologica.settings.projectFlowName);
|
|
769
|
+
}
|
|
770
|
+
|
|
771
|
+
if (window.__kumologica.settings.cloudConfig) {
|
|
772
|
+
const params = window.__kumologica.settings.cloudConfig.getCloudConfig();
|
|
773
|
+
|
|
774
|
+
setValues(params);
|
|
775
|
+
//attachRoleList();
|
|
776
|
+
} else {
|
|
777
|
+
console.log('kumologica.settings.cloudConfig not present');
|
|
778
|
+
}
|
|
779
|
+
});
|
|
780
|
+
|
|
781
|
+
function initJs() {
|
|
782
|
+
fillProfiles();
|
|
783
|
+
|
|
784
|
+
// Initialize fields with default values
|
|
785
|
+
if (window.__kumologica.settings.projectFlowName) {
|
|
786
|
+
setLambdaName(window.__kumologica.settings.projectFlowName);
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
$('#cloud-fn-description').val('kumologica flow');
|
|
790
|
+
$('#cloud-fn-memory').val('512');
|
|
791
|
+
$('#cloud-fn-timeout').val('20');
|
|
792
|
+
|
|
793
|
+
$('#cloud-fn-timeout, #cloud-fn-memory, #cloud-fn-description, #cloud-fn-name, #cloud-fn-reservedConcurrency, #cloud-fn-x-ray, #cloud-fn-role'
|
|
794
|
+
).change(function () {
|
|
795
|
+
saveSettings();
|
|
796
|
+
});
|
|
797
|
+
|
|
798
|
+
$('#cloud-fn-name').change(function () {
|
|
799
|
+
this.value = sanitizeLambdaName(this.value);
|
|
800
|
+
});
|
|
801
|
+
|
|
802
|
+
$('#cloud-sidebar-profiles').click(function() {
|
|
803
|
+
$(this).data('lastSelected', $(this).find('option:selected'));
|
|
804
|
+
return false;
|
|
805
|
+
});
|
|
806
|
+
|
|
807
|
+
$('#cloud-sidebar-profiles').change(function (e) {
|
|
808
|
+
|
|
809
|
+
e.preventDefault();
|
|
810
|
+
|
|
811
|
+
// when deploying then do nothing, go back to previous selection
|
|
812
|
+
// we dont allow changing profile mid of deployments as this will
|
|
813
|
+
// "disconnect" from aws
|
|
814
|
+
if(deployState == DEPLOYING) {
|
|
815
|
+
RED.notify(`<strong>Information</strong>: Please wait until deployment to AWS finishes.`, 'info');
|
|
816
|
+
$(this).data('lastSelected').prop('selected', true);
|
|
817
|
+
return false;
|
|
818
|
+
}
|
|
819
|
+
|
|
820
|
+
// - invoke settings screen,
|
|
821
|
+
// - go back to select profile option as settings screen will only define profile
|
|
822
|
+
if (this.value == DEFINE_AWS_PROFILE) {
|
|
823
|
+
$(this).data('lastSelected').prop('selected', true);
|
|
824
|
+
RED.actions.invoke('core:settings:open');
|
|
825
|
+
return false;
|
|
826
|
+
}
|
|
827
|
+
|
|
828
|
+
console.log('[tab-cloud] profile changed to:', this.value);
|
|
829
|
+
|
|
830
|
+
if (this.value) {
|
|
831
|
+
$('#cloud-sidebar-body').show();
|
|
832
|
+
}
|
|
833
|
+
saveSettings();
|
|
834
|
+
|
|
835
|
+
// if genuine profile selected then:
|
|
836
|
+
// - "disconnect" from aws
|
|
837
|
+
// - remove select aws profile
|
|
838
|
+
// - remove define aws profile
|
|
839
|
+
if (this.value != SELECT_AWS_PROFILE && this.value != DEFINE_AWS_PROFILE) {
|
|
840
|
+
$(`#cloud-sidebar-profiles option[value='${SELECT_AWS_PROFILE}']`).remove();
|
|
841
|
+
$(`#cloud-sidebar-profiles option[value='${DEFINE_AWS_PROFILE}']`).remove();
|
|
842
|
+
window.__kumologica.cloud.profile = this.value;
|
|
843
|
+
disconnectFromAWS();
|
|
844
|
+
}
|
|
845
|
+
});
|
|
846
|
+
|
|
847
|
+
// Attach the environment variables
|
|
848
|
+
$('#add-environment-variable').click((e) => {
|
|
849
|
+
let environmentTable = $('#cloud-fn-env-table');
|
|
850
|
+
let environmentRowHtml = `
|
|
851
|
+
<tr class="node-info-node-row">
|
|
852
|
+
<td style="background: white; width:46%"><input id="cloud-fn-env-key" class="palette-textinput" type="text" placeholder="key" style="width:100%"></td>
|
|
853
|
+
<td style="background: white; width:46%"><input id="cloud-fn-env-val" class="palette-textinput" type="text" placeholder="value" style="width:100%"></td>
|
|
854
|
+
<td id="cloud-fn-env-row" style="text-align:center; width:8%" class="removeRow"><i class="fa fa-minus"></i></td>
|
|
855
|
+
</tr>`;
|
|
856
|
+
$(environmentRowHtml).appendTo(environmentTable);
|
|
857
|
+
|
|
858
|
+
$('#cloud-fn-env-table')
|
|
859
|
+
.find('input')
|
|
860
|
+
.each(function () {
|
|
861
|
+
$(this).change(function () {
|
|
862
|
+
saveSettings();
|
|
863
|
+
});
|
|
864
|
+
});
|
|
865
|
+
});
|
|
866
|
+
|
|
867
|
+
$('#cloud-fn-env-table')
|
|
868
|
+
.find('input')
|
|
869
|
+
.each(function () {
|
|
870
|
+
$(this).change(function () {
|
|
871
|
+
saveSettings();
|
|
872
|
+
});
|
|
873
|
+
});
|
|
874
|
+
|
|
875
|
+
$('#cloud-fn-env-table').on('click', '.removeRow', function () {
|
|
876
|
+
$(this).parent().remove();
|
|
877
|
+
saveSettings();
|
|
878
|
+
});
|
|
879
|
+
|
|
880
|
+
// Attach tag
|
|
881
|
+
$('#add-tag').click((e) => {
|
|
882
|
+
let tagsTable = $('#cloud-fn-tags-table');
|
|
883
|
+
let tagsRowHtml = `
|
|
884
|
+
<tr class="node-info-node-row">
|
|
885
|
+
<td style="background: white; width:46%"><input id="cloud-fn-env-key" class="palette-textinput" type="text" placeholder="key" style="width:100%"></td>
|
|
886
|
+
<td style="background: white; width:46%"><input id="cloud-fn-env-val" class="palette-textinput" type="text" placeholder="value" style="width:100%"></td>
|
|
887
|
+
<td id="cloud-fn-tags-row" style="text-align:center; width:8%" class="removeRow"><i class="fa fa-minus"></i></td>
|
|
888
|
+
</tr>`;
|
|
889
|
+
$(tagsRowHtml).appendTo(tagsTable);
|
|
890
|
+
|
|
891
|
+
$('#cloud-fn-tags-table')
|
|
892
|
+
.find('input')
|
|
893
|
+
.each(function () {
|
|
894
|
+
$(this).change(function () {
|
|
895
|
+
saveSettings();
|
|
896
|
+
});
|
|
897
|
+
});
|
|
898
|
+
});
|
|
899
|
+
|
|
900
|
+
$('#cloud-fn-tags-table')
|
|
901
|
+
.find('input')
|
|
902
|
+
.each(function () {
|
|
903
|
+
$(this).change(function () {
|
|
904
|
+
saveSettings();
|
|
905
|
+
});
|
|
906
|
+
});
|
|
907
|
+
|
|
908
|
+
$('#cloud-fn-tags-table').on('click', '.removeRow', function () {
|
|
909
|
+
$(this).parent().remove();
|
|
910
|
+
saveSettings();
|
|
911
|
+
});
|
|
912
|
+
|
|
913
|
+
// Attach event
|
|
914
|
+
$('#add-event').click((e) => {
|
|
915
|
+
selectedEventSource = $('#eventSource').find(':selected').attr('value');
|
|
916
|
+
addEvent(selectedEventSource, null);
|
|
917
|
+
});
|
|
918
|
+
|
|
919
|
+
$('#cloud-fn-useReservedConcurrency').click((e) => {
|
|
920
|
+
$('#cloud-fn-reservedConcurrency').prop(
|
|
921
|
+
'disabled',
|
|
922
|
+
!$('#cloud-fn-useReservedConcurrency').is(':checked')
|
|
923
|
+
);
|
|
924
|
+
|
|
925
|
+
if (!$('#cloud-fn-useReservedConcurrency').is(':checked')) {
|
|
926
|
+
$('#cloud-fn-reservedConcurrency').val('');
|
|
927
|
+
}
|
|
928
|
+
});
|
|
929
|
+
|
|
930
|
+
// Close export menu when click in the window
|
|
931
|
+
$('.sidebar-cloud').click(function (e) {
|
|
932
|
+
$('#cloud-options-dropdown-content').hide();
|
|
933
|
+
});
|
|
934
|
+
|
|
935
|
+
// Deploy to AWS button
|
|
936
|
+
$('#cloud-sidebar-deploy-btn').click((e) => {
|
|
937
|
+
e.preventDefault();
|
|
938
|
+
if (validateEventsValues()) {
|
|
939
|
+
deploy();
|
|
940
|
+
}
|
|
941
|
+
});
|
|
942
|
+
|
|
943
|
+
// Connect to AWS button
|
|
944
|
+
$('#cloud-sidebar-connect-btn').click((e) => {
|
|
945
|
+
e.preventDefault();
|
|
946
|
+
connectToAWS();
|
|
947
|
+
});
|
|
948
|
+
|
|
949
|
+
// Export cloudformation script
|
|
950
|
+
$('#exportCloudFormationBtn').click((e) => {
|
|
951
|
+
e.preventDefault();
|
|
952
|
+
hideMenu();
|
|
953
|
+
exportScript(window.__kumologica.cloud.provider.aws);
|
|
954
|
+
});
|
|
955
|
+
|
|
956
|
+
// Export serverless script
|
|
957
|
+
$('#exportServerlessBtn').click((e) => {
|
|
958
|
+
e.preventDefault();
|
|
959
|
+
hideMenu();
|
|
960
|
+
exportScript(window.__kumologica.cloud.provider.serverless);
|
|
961
|
+
});
|
|
962
|
+
|
|
963
|
+
$('#cloud-options-dropdown').click((e) => {
|
|
964
|
+
e.stopPropagation();
|
|
965
|
+
|
|
966
|
+
$('#cloud-sidebar-export-btn').toggleClass('dropdown-selected');
|
|
967
|
+
|
|
968
|
+
$('#cloud-options-dropdown-content').toggle();
|
|
969
|
+
});
|
|
970
|
+
|
|
971
|
+
// Close error section
|
|
972
|
+
$('#cloud-sidebar-error-close-btn').click((e) => {
|
|
973
|
+
e.preventDefault();
|
|
974
|
+
$('#cloud-sidebar-error').hide();
|
|
975
|
+
});
|
|
976
|
+
|
|
977
|
+
initialised = true;
|
|
978
|
+
if (parameters) {
|
|
979
|
+
setValues(parameters);
|
|
980
|
+
// attachRoleList();
|
|
981
|
+
}
|
|
982
|
+
connectUIDisconnected();
|
|
983
|
+
}
|
|
984
|
+
|
|
985
|
+
function hideMenu() {
|
|
986
|
+
$('#cloud-sidebar-export-btn').removeClass('dropdown-selected');
|
|
987
|
+
$('#cloud-options-dropdown-content').hide();
|
|
988
|
+
}
|
|
989
|
+
|
|
990
|
+
function showProfileError() {
|
|
991
|
+
$('#cloud-sidebar-error').show();
|
|
992
|
+
}
|
|
993
|
+
|
|
994
|
+
async function connectToAWS() {
|
|
995
|
+
profile = getProfile();
|
|
996
|
+
|
|
997
|
+
if (!profile || profile == SELECT_AWS_PROFILE) {
|
|
998
|
+
RED.notify(`<strong>Error</strong>: Please select AWS profile before connecting to AWS account.`, 'error');
|
|
999
|
+
return;
|
|
1000
|
+
}
|
|
1001
|
+
|
|
1002
|
+
if (connectedState != DISCONNECTED) {
|
|
1003
|
+
RED.notify(`<strong>Information</strong>: Already connected to ${profile} AWS account.`, 'info');
|
|
1004
|
+
return;
|
|
1005
|
+
}
|
|
1006
|
+
|
|
1007
|
+
if (deployState == DEPLOYING) {
|
|
1008
|
+
RED.notify(`<strong>Information</strong>: Please wait until deployment to AWS finishes.`, 'info');
|
|
1009
|
+
return;
|
|
1010
|
+
}
|
|
1011
|
+
|
|
1012
|
+
connectedState = CONNECTING;
|
|
1013
|
+
connectUIConnecting();
|
|
1014
|
+
|
|
1015
|
+
try {
|
|
1016
|
+
await window.__kumologica.cloud.getRegion(profile);
|
|
1017
|
+
} catch (err) {
|
|
1018
|
+
connectUIDisconnected();
|
|
1019
|
+
connectedState = DISCONNECTED;
|
|
1020
|
+
|
|
1021
|
+
RED.notify(`<strong>Error</strong>: ${err.stderr? err.stderr: err}`, 'error');
|
|
1022
|
+
return;
|
|
1023
|
+
}
|
|
1024
|
+
|
|
1025
|
+
|
|
1026
|
+
refreshDataLists();
|
|
1027
|
+
connectedState = CONNECTED;
|
|
1028
|
+
}
|
|
1029
|
+
|
|
1030
|
+
function disconnectFromAWS() {
|
|
1031
|
+
connectUIDisconnected();
|
|
1032
|
+
cleanDataLists();
|
|
1033
|
+
connectedState = DISCONNECTED;
|
|
1034
|
+
}
|
|
1035
|
+
|
|
1036
|
+
function connectUIDisconnected() {
|
|
1037
|
+
// show connect button
|
|
1038
|
+
$('#cloud-sidebar-connect-btn').show();
|
|
1039
|
+
$('#cloud-sidebar-connect-icon').attr({'class': 'fa fa-circle'});
|
|
1040
|
+
$('#cloud-sidebar-connect-icon').css({'color': 'red'});
|
|
1041
|
+
|
|
1042
|
+
if ($('#cloud-sidebar-connect-btn') && $('#cloud-sidebar-connect-btn').html()) {
|
|
1043
|
+
$('#cloud-sidebar-connect-btn').html($('#cloud-sidebar-connect-btn').html().replace('Connecting', 'Connect'));
|
|
1044
|
+
}
|
|
1045
|
+
|
|
1046
|
+
// hide deploy and export buttons
|
|
1047
|
+
$('#cloud-sidebar-deploy-btn').hide();
|
|
1048
|
+
$('#cloud-sidebar-export-btn').hide();
|
|
1049
|
+
$('#cloud-sidebar-body').hide();
|
|
1050
|
+
}
|
|
1051
|
+
|
|
1052
|
+
function connectUIConnecting() {
|
|
1053
|
+
$('#cloud-sidebar-connect-icon').attr({'class': 'fa fa-spinner fa-spin'});
|
|
1054
|
+
$('#cloud-sidebar-connect-icon').css({'color': 'black'});
|
|
1055
|
+
}
|
|
1056
|
+
|
|
1057
|
+
function connectUIConnected() {
|
|
1058
|
+
// hide connect button
|
|
1059
|
+
$('#cloud-sidebar-connect-btn').hide();
|
|
1060
|
+
//$('#cloud-sidebar-connect-btn').html($('#cloud-sidebar-connect-btn').html().replace('Connect', 'Connected'));
|
|
1061
|
+
//$('#cloud-sidebar-connect-icon').attr({'class': 'fa fa-circle'});
|
|
1062
|
+
//$('#cloud-sidebar-connect-icon').css({'color': 'green'});
|
|
1063
|
+
|
|
1064
|
+
// show deploy and export buttons
|
|
1065
|
+
$('#cloud-sidebar-deploy-btn').show();
|
|
1066
|
+
$('#cloud-sidebar-export-btn').show();
|
|
1067
|
+
$('#cloud-sidebar-body').show();
|
|
1068
|
+
}
|
|
1069
|
+
|
|
1070
|
+
function deployingUIDeploying() {
|
|
1071
|
+
$('#cloud-sidebar-deploy-icon').attr({'class': 'fa fa-spinner fa-spin'});
|
|
1072
|
+
}
|
|
1073
|
+
function deployingUINotDeploying() {
|
|
1074
|
+
$('#cloud-sidebar-deploy-icon').attr({'class': 'fa fa-cloud-upload'});
|
|
1075
|
+
}
|
|
1076
|
+
|
|
1077
|
+
function fillProfiles() {
|
|
1078
|
+
try {
|
|
1079
|
+
const profiles = window.__kumologica.cloud.listProfiles();
|
|
1080
|
+
let dropdown = $('#cloud-sidebar-profiles');
|
|
1081
|
+
|
|
1082
|
+
dropdown.empty();
|
|
1083
|
+
dropdown.append($(`<option value="${SELECT_AWS_PROFILE}">${SELECT_AWS_PROFILE}</option>`));
|
|
1084
|
+
|
|
1085
|
+
// add define profile option only if no profiles loaded
|
|
1086
|
+
if (profiles.length == 0) {
|
|
1087
|
+
dropdown.append($(`<option value="${DEFINE_AWS_PROFILE}">${DEFINE_AWS_PROFILE}</option>`));
|
|
1088
|
+
}
|
|
1089
|
+
|
|
1090
|
+
profiles.forEach(function (profile) {
|
|
1091
|
+
dropdown.append($('<option></option>').val(profile).text(profile));
|
|
1092
|
+
});
|
|
1093
|
+
|
|
1094
|
+
// if stored profile no longer on the list then:
|
|
1095
|
+
// - make selected profile null
|
|
1096
|
+
// - make SELECT_AWS_PROFILE option selected
|
|
1097
|
+
// - disconnect ui
|
|
1098
|
+
if (!$('#cloud-sidebar-profiles').find('option[value=' + window.__kumologica.cloud.profile + ']').length) {
|
|
1099
|
+
//console.log(`fillProfiles: setting current profile to null, cant find ${window.__kumologica.cloud.profile } on the list`);
|
|
1100
|
+
window.__kumologica.cloud.profile = null;
|
|
1101
|
+
$('#cloud-sidebar-profiles').val(SELECT_AWS_PROFILE);
|
|
1102
|
+
connectUIDisconnected();
|
|
1103
|
+
}
|
|
1104
|
+
|
|
1105
|
+
// in case cloud-config.json was loaded already and
|
|
1106
|
+
// setValues could not select correct profile, doing it now
|
|
1107
|
+
// set profile should cleanup define and select profile options
|
|
1108
|
+
// if genuine value is set
|
|
1109
|
+
if (window.__kumologica.cloud.profile) {
|
|
1110
|
+
setProfile(window.__kumologica.cloud.profile);
|
|
1111
|
+
}
|
|
1112
|
+
} catch (Error) {
|
|
1113
|
+
showProfileError();
|
|
1114
|
+
}
|
|
1115
|
+
}
|
|
1116
|
+
|
|
1117
|
+
async function exportScript(provider) {
|
|
1118
|
+
profile = getProfile();
|
|
1119
|
+
if (!profile || profile == SELECT_AWS_PROFILE) {
|
|
1120
|
+
RED.notify(`<strong>Error</strong>: Please select AWS profile before generating cloudformation script.`,
|
|
1121
|
+
'error'
|
|
1122
|
+
);
|
|
1123
|
+
return;
|
|
1124
|
+
}
|
|
1125
|
+
$('#workspace-terminal').show();
|
|
1126
|
+
RED.deploy.save(true, true, true);
|
|
1127
|
+
try {
|
|
1128
|
+
await window.__kumologica.cloud.generateScript(
|
|
1129
|
+
provider,
|
|
1130
|
+
RED.header.getCurrentProjectInfo(),
|
|
1131
|
+
getValues()
|
|
1132
|
+
);
|
|
1133
|
+
} catch (Error) {
|
|
1134
|
+
handleError(Error);
|
|
1135
|
+
}
|
|
1136
|
+
}
|
|
1137
|
+
|
|
1138
|
+
function getProfile() {
|
|
1139
|
+
return $('#cloud-sidebar-profiles').find(':selected').val();
|
|
1140
|
+
}
|
|
1141
|
+
|
|
1142
|
+
function setProfile(profile) {
|
|
1143
|
+
window.__kumologica.cloud.profile = profile;
|
|
1144
|
+
|
|
1145
|
+
if (profile != SELECT_AWS_PROFILE && profile != DEFINE_AWS_PROFILE &&
|
|
1146
|
+
$('#cloud-sidebar-profiles').find('option[value=' + profile + ']').length) {
|
|
1147
|
+
|
|
1148
|
+
//console.log(`set profile: genuine: ${profile}`);
|
|
1149
|
+
// once we got genuine profile, we no longer display define and select profile options.
|
|
1150
|
+
$(`#cloud-sidebar-profiles option[value='${DEFINE_AWS_PROFILE}']`).remove();
|
|
1151
|
+
$(`#cloud-sidebar-profiles option[value='${SELECT_AWS_PROFILE}']`).remove();
|
|
1152
|
+
$('#cloud-sidebar-profiles').val(profile);
|
|
1153
|
+
} else {
|
|
1154
|
+
console.log(`set profile: non-genuine: ${profile}, back to select profile`);
|
|
1155
|
+
|
|
1156
|
+
$('#cloud-sidebar-profiles').val(SELECT_AWS_PROFILE);
|
|
1157
|
+
}
|
|
1158
|
+
}
|
|
1159
|
+
|
|
1160
|
+
async function deploy() {
|
|
1161
|
+
let fnProfile = getProfile();
|
|
1162
|
+
if (!fnProfile || fnProfile == SELECT_AWS_PROFILE) {
|
|
1163
|
+
RED.notify(`Please select AWS profile before deploying flow.`, 'error');
|
|
1164
|
+
return;
|
|
1165
|
+
}
|
|
1166
|
+
|
|
1167
|
+
if (deployState == DEPLOYING) {
|
|
1168
|
+
RED.notify(`<strong>Information</strong>: Already deploying to AWS.`, 'info');
|
|
1169
|
+
return;
|
|
1170
|
+
}
|
|
1171
|
+
|
|
1172
|
+
deployingUIDeploying();
|
|
1173
|
+
deployState = DEPLOYING;
|
|
1174
|
+
|
|
1175
|
+
let item = $('#cloud-fn-event-table :input').filter(function () {
|
|
1176
|
+
return this.value == 'Create new API';
|
|
1177
|
+
});
|
|
1178
|
+
|
|
1179
|
+
$('#workspace-terminal').show();
|
|
1180
|
+
|
|
1181
|
+
RED.deploy.save(true, true, true);
|
|
1182
|
+
|
|
1183
|
+
try {
|
|
1184
|
+
const response = await window.__kumologica.cloud.deploy(
|
|
1185
|
+
RED.header.getCurrentProjectInfo(),
|
|
1186
|
+
getValues()
|
|
1187
|
+
);
|
|
1188
|
+
|
|
1189
|
+
if (response && response.apiId) {
|
|
1190
|
+
await updateEventList(item, 'api', response.apiId);
|
|
1191
|
+
}
|
|
1192
|
+
} catch (Error) {
|
|
1193
|
+
handleError(Error);
|
|
1194
|
+
}
|
|
1195
|
+
deployState = NOTDEPLOYING;
|
|
1196
|
+
deployingUINotDeploying();
|
|
1197
|
+
}
|
|
1198
|
+
|
|
1199
|
+
async function updateEventList(item, serviceType, value) {
|
|
1200
|
+
|
|
1201
|
+
if (item.length) {
|
|
1202
|
+
let id = item.attr('id');
|
|
1203
|
+
let dataListId = item.attr('list');
|
|
1204
|
+
|
|
1205
|
+
item.val(value);
|
|
1206
|
+
if (dataListId) {
|
|
1207
|
+
await attachDataList(serviceType, id, dataListId);
|
|
1208
|
+
}
|
|
1209
|
+
}
|
|
1210
|
+
}
|
|
1211
|
+
|
|
1212
|
+
function saveSettings() {
|
|
1213
|
+
window.__kumologica.settings.cloudConfig.setCloudConfig(getValues());
|
|
1214
|
+
}
|
|
1215
|
+
|
|
1216
|
+
function show() {
|
|
1217
|
+
RED.sidebar.show('cloud');
|
|
1218
|
+
}
|
|
1219
|
+
|
|
1220
|
+
function init() {
|
|
1221
|
+
initHTML();
|
|
1222
|
+
initJs();
|
|
1223
|
+
}
|
|
1224
|
+
|
|
1225
|
+
var parameterSets = [];
|
|
1226
|
+
parameterSets['dynamodb'] = [
|
|
1227
|
+
{
|
|
1228
|
+
label: 'Stream ARN',
|
|
1229
|
+
key: 'stream',
|
|
1230
|
+
value: '',
|
|
1231
|
+
required: true,
|
|
1232
|
+
function: 'attachDataList',
|
|
1233
|
+
},
|
|
1234
|
+
{ label: 'Batch Size', key: 'batchSize', value: '', min: 1, max: 1000 },
|
|
1235
|
+
{ label: 'Batch Window', key: 'batchWindow', value: '', min: 0, max: 300 },
|
|
1236
|
+
{
|
|
1237
|
+
label: 'Starting Position',
|
|
1238
|
+
key: 'startingPosition',
|
|
1239
|
+
value: '',
|
|
1240
|
+
list: [
|
|
1241
|
+
{ k: 'LATEST', v: 'LATEST' },
|
|
1242
|
+
{ k: 'TRIM_HORIZON', v: 'TRIM_HORIZON' },
|
|
1243
|
+
],
|
|
1244
|
+
},
|
|
1245
|
+
];
|
|
1246
|
+
parameterSets['s3'] = [
|
|
1247
|
+
{
|
|
1248
|
+
label: 'Bucket Name',
|
|
1249
|
+
key: 'bucket',
|
|
1250
|
+
value: '',
|
|
1251
|
+
required: true,
|
|
1252
|
+
function: 'attachDataList',
|
|
1253
|
+
},
|
|
1254
|
+
{ label: 'Bucket Account', key: 'sourceAccount', value: '' },
|
|
1255
|
+
{
|
|
1256
|
+
label: 'Event Type',
|
|
1257
|
+
key: 'eventType',
|
|
1258
|
+
value: '',
|
|
1259
|
+
list: [
|
|
1260
|
+
{ k: 'ObjectCreated:*', v: 's3:ObjectCreated:*' },
|
|
1261
|
+
{ k: ' ObjectCreated:Put', v: 's3:ObjectCreated:Put' },
|
|
1262
|
+
{ k: ' ObjectCreated:Post', v: 's3:ObjectCreated:Post' },
|
|
1263
|
+
{ k: ' ObjectCreated:Copy', v: 's3:ObjectCreated:Copy' },
|
|
1264
|
+
{
|
|
1265
|
+
k: ' ObjectCreated:CompleteMultipartUpload',
|
|
1266
|
+
v: 's3:ObjectCreated:CompleteMultipartUpload',
|
|
1267
|
+
},
|
|
1268
|
+
{ k: 'ObjectRemoved:*', v: 's3:ObjectRemoved:*' },
|
|
1269
|
+
{ k: ' ObjectRemoved:Delete', v: 's3:ObjectRemoved:Delete' },
|
|
1270
|
+
{
|
|
1271
|
+
k: ' ObjectRemoved:DeleteMarkerCreated',
|
|
1272
|
+
v: 's3:ObjectRemoved:DeleteMarkerCreated',
|
|
1273
|
+
},
|
|
1274
|
+
{ k: 'ObjectRestore:Post', v: 's3:ObjectRestore:Post' },
|
|
1275
|
+
{ k: 'ObjectRestore:Completed', v: 's3:ObjectRestore:Completed' },
|
|
1276
|
+
{
|
|
1277
|
+
k: 'ReducedRedundancyLostObject',
|
|
1278
|
+
v: 's3:ReducedRedundancyLostObject',
|
|
1279
|
+
},
|
|
1280
|
+
{
|
|
1281
|
+
k: 'Replication:OperationFailedReplication',
|
|
1282
|
+
v: 's3:Replication:OperationFailedReplication',
|
|
1283
|
+
},
|
|
1284
|
+
{
|
|
1285
|
+
k: 'Replication:OperationMissedThreshold',
|
|
1286
|
+
v: 's3:Replication:OperationMissedThreshold',
|
|
1287
|
+
},
|
|
1288
|
+
{
|
|
1289
|
+
k: 'Replication:OperationReplicatedAfterThreshold',
|
|
1290
|
+
v: 's3:Replication:OperationReplicatedAfterThreshold',
|
|
1291
|
+
},
|
|
1292
|
+
{
|
|
1293
|
+
k: 'Replication:OperationNotTracked',
|
|
1294
|
+
v: 's3:Replication:OperationNotTracked',
|
|
1295
|
+
},
|
|
1296
|
+
],
|
|
1297
|
+
},
|
|
1298
|
+
{ label: 'Prefix', key: 'prefix', value: '' },
|
|
1299
|
+
{ label: 'Suffix', key: 'suffix', value: '' },
|
|
1300
|
+
];
|
|
1301
|
+
parameterSets['sns'] = [
|
|
1302
|
+
{
|
|
1303
|
+
label: 'Topic ARN',
|
|
1304
|
+
key: 'topic',
|
|
1305
|
+
value: '',
|
|
1306
|
+
required: true,
|
|
1307
|
+
function: 'attachDataList',
|
|
1308
|
+
},
|
|
1309
|
+
];
|
|
1310
|
+
parameterSets['cognito'] = [
|
|
1311
|
+
{ label: 'Identity Pool ARN', key: 'identityPool', value: '' },
|
|
1312
|
+
];
|
|
1313
|
+
parameterSets['iot'] = [
|
|
1314
|
+
{
|
|
1315
|
+
label: 'Rule Name',
|
|
1316
|
+
key: 'rule',
|
|
1317
|
+
value: '',
|
|
1318
|
+
required: true,
|
|
1319
|
+
function: 'attachDataList',
|
|
1320
|
+
},
|
|
1321
|
+
{ label: 'Query', key: 'query', value: '', required: true },
|
|
1322
|
+
];
|
|
1323
|
+
parameterSets['api'] = [
|
|
1324
|
+
{
|
|
1325
|
+
label: 'API',
|
|
1326
|
+
key: 'api',
|
|
1327
|
+
value: '',
|
|
1328
|
+
required: true,
|
|
1329
|
+
function: 'attachDataList',
|
|
1330
|
+
},
|
|
1331
|
+
{ label: 'Deployment Stage', key: 'stage', value: '', required: true }
|
|
1332
|
+
];
|
|
1333
|
+
parameterSets['alb'] = [
|
|
1334
|
+
{
|
|
1335
|
+
label: 'App Load Balancer',
|
|
1336
|
+
key: 'alb',
|
|
1337
|
+
value: '',
|
|
1338
|
+
required: true,
|
|
1339
|
+
function: 'attachDataList',
|
|
1340
|
+
},
|
|
1341
|
+
{ label: 'Listener ARN', key: 'listener', value: '', required: true },
|
|
1342
|
+
{ label: 'Host', key: 'host', value: '' },
|
|
1343
|
+
{ label: 'Path', key: 'path', value: '' },
|
|
1344
|
+
];
|
|
1345
|
+
parameterSets['sqs'] = [
|
|
1346
|
+
{
|
|
1347
|
+
label: 'Queue URL',
|
|
1348
|
+
key: 'stream',
|
|
1349
|
+
value: '',
|
|
1350
|
+
required: true,
|
|
1351
|
+
function: 'attachDataList',
|
|
1352
|
+
},
|
|
1353
|
+
{ label: 'Batch Size', key: 'batchSize', value: '', min: 1, max: 10 },
|
|
1354
|
+
];
|
|
1355
|
+
parameterSets['alexa'] = [
|
|
1356
|
+
{
|
|
1357
|
+
label: 'Skill ID',
|
|
1358
|
+
key: 'skillID',
|
|
1359
|
+
value: '',
|
|
1360
|
+
required: true,
|
|
1361
|
+
function: 'attachDataList',
|
|
1362
|
+
},
|
|
1363
|
+
];
|
|
1364
|
+
parameterSets['kinesis'] = [
|
|
1365
|
+
{ label: 'Stream ARN', key: 'stream', value: '', required: true },
|
|
1366
|
+
{ label: 'Batch Size', key: 'batchSize', value: '', min: 1, max: 10000 },
|
|
1367
|
+
{ label: 'Batch Window', key: 'batchWindow', value: '', min: 0, max: 300 },
|
|
1368
|
+
{
|
|
1369
|
+
label: 'Starting Position',
|
|
1370
|
+
key: 'startingPosition',
|
|
1371
|
+
value: '',
|
|
1372
|
+
list: [
|
|
1373
|
+
{ k: 'LATEST', v: 'LATEST' },
|
|
1374
|
+
{ k: 'AT_TIMESTAMP', v: 'AT_TIMESTAMP' },
|
|
1375
|
+
{ k: 'TRIM_HORIZON', v: 'TRIM_HORIZON' },
|
|
1376
|
+
],
|
|
1377
|
+
},
|
|
1378
|
+
];
|
|
1379
|
+
parameterSets['cwevents'] = [
|
|
1380
|
+
{
|
|
1381
|
+
label: 'Rule ARN',
|
|
1382
|
+
key: 'rule',
|
|
1383
|
+
value: '',
|
|
1384
|
+
required: true,
|
|
1385
|
+
function: 'attachDataList',
|
|
1386
|
+
},
|
|
1387
|
+
];
|
|
1388
|
+
parameterSets['cwlogs'] = [
|
|
1389
|
+
{
|
|
1390
|
+
label: 'Log Group',
|
|
1391
|
+
key: 'logGroup',
|
|
1392
|
+
value: '',
|
|
1393
|
+
required: true,
|
|
1394
|
+
function: 'attachDataList',
|
|
1395
|
+
},
|
|
1396
|
+
{ label: 'Filter Name', key: 'filterName', value: '' },
|
|
1397
|
+
{ label: 'Filter Pattern', key: 'filterPattern', value: '' },
|
|
1398
|
+
];
|
|
1399
|
+
parameterSets['codecommit'] = [
|
|
1400
|
+
{
|
|
1401
|
+
label: 'Repository Name',
|
|
1402
|
+
key: 'repository',
|
|
1403
|
+
value: '',
|
|
1404
|
+
required: true,
|
|
1405
|
+
function: 'attachDataList',
|
|
1406
|
+
},
|
|
1407
|
+
{ label: 'Trigger Name', key: 'trigger', value: '', required: true },
|
|
1408
|
+
{
|
|
1409
|
+
label: 'Events',
|
|
1410
|
+
key: 'events',
|
|
1411
|
+
value: '',
|
|
1412
|
+
list: [
|
|
1413
|
+
{ k: 'all', v: 'all' },
|
|
1414
|
+
{ k: 'updateReference', v: 'updateReference' },
|
|
1415
|
+
{ k: 'createReference', v: 'createReference' },
|
|
1416
|
+
{ k: 'deleteReference', v: 'deleteReference' },
|
|
1417
|
+
],
|
|
1418
|
+
},
|
|
1419
|
+
{ label: 'Branch Names', key: 'branchNames', value: '' },
|
|
1420
|
+
{ label: 'Custom Data', key: 'customData', value: '' },
|
|
1421
|
+
];
|
|
1422
|
+
|
|
1423
|
+
return {
|
|
1424
|
+
init: init,
|
|
1425
|
+
show: show,
|
|
1426
|
+
};
|
|
1427
|
+
})();
|