@silexlabs/silex 3.7.0 → 3.9.0-canary.2
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 +115 -78
- package/common/examples/plugin.js +6 -0
- package/common/silex-plugins/config.test.ts +71 -0
- package/common/silex-plugins/config.ts +25 -0
- package/common/silex-plugins/index.ts +2 -0
- package/common/silex-plugins/plugin.test.ts +57 -0
- package/common/silex-plugins/plugin.ts +65 -0
- package/dist/client/css/admin.css +25 -12
- package/dist/client/css/all.min.css +5 -5
- package/dist/client/index.html +2 -2
- package/dist/client/js/main.js +3108 -2940
- package/dist/client/js/main.js.LICENSE.txt +6 -4
- package/dist/client/webfonts/fa-brands-400.woff2 +0 -0
- package/dist/client/webfonts/fa-regular-400.woff2 +0 -0
- package/dist/client/webfonts/fa-solid-900.woff2 +0 -0
- package/dist/client/webfonts/fa-v4compatibility.woff2 +0 -0
- package/dist/server/common/externs.js +2 -0
- package/dist/server/common/silex-plugins/config.js +25 -0
- package/dist/server/common/silex-plugins/index.js +18 -0
- package/dist/server/common/silex-plugins/plugin.js +41 -0
- package/dist/server/server/api/api.js +9 -9
- package/dist/server/server/api/connectorApi.js +35 -35
- package/dist/server/server/api/publicationApi.js +19 -19
- package/dist/server/server/api/websiteApi.js +46 -46
- package/dist/server/server/config.js +19 -19
- package/dist/server/server/connectors/FsHosting.js +6 -6
- package/dist/server/server/connectors/FsStorage.js +35 -35
- package/dist/server/server/connectors/connectors.js +3 -3
- package/dist/server/server/expose.js +18 -8
- package/dist/server/server/express.js +3 -3
- package/dist/server/server/index.js +29 -19
- package/dist/server/server/jobs.js +4 -4
- package/dist/{plugins/server/plugins/server → server/server/plugins}/DownloadConnector.js +23 -28
- package/dist/{plugins/server/plugins/server → server/server/plugins}/FtpConnector.js +42 -117
- package/dist/{plugins/server/plugins/server → server/server/plugins}/GitlabConnector.js +80 -271
- package/dist/{plugins/server/plugins/server → server/server/plugins}/GitlabHostingConnector.js +11 -134
- package/dist/server/server/plugins/PublicationOptimizer.js +2 -0
- package/dist/{plugins/server/plugins/server → server/server/plugins}/SslPlugin.js +3 -32
- package/dist/{plugins/server/plugins/server → server/server/plugins}/StaticPlugin.js +4 -21
- package/dist/server/server/utils/BackwardCompat.js +2 -0
- package/dist/server/server/utils/websiteDataSerialization.js +10 -10
- package/{src/ts/client → editor}/api.ts +2 -2
- package/{src/ts/client → editor}/assetUrl.test.ts +6 -33
- package/{src/ts/client → editor}/assetUrl.ts +2 -2
- package/{src/ts/client → editor}/config.ts +3 -3
- package/{src/css/theme-modern.scss → editor/css/design-system.scss} +29 -14
- package/{src → editor}/css/index.scss +1 -3
- package/{src → editor}/css/project-bar.scss +5 -0
- package/{src/ts/client → editor}/expose.ts +3 -3
- package/{src/ts/client → editor}/grapesjs/LoginDialog.ts +3 -3
- package/{src/ts/client → editor}/grapesjs/PublicationManager.ts +3 -3
- package/{src/ts/client → editor}/grapesjs/PublicationUi.ts +1 -1
- package/{src/ts/client → editor}/grapesjs/cms/index.ts +1 -1
- package/{src/ts/client → editor}/grapesjs/cms/page-settings.ts +1 -1
- package/{src/ts/client → editor}/grapesjs/cms/publication.ts +1 -1
- package/{src/ts/client → editor}/grapesjs/eleventy.ts +1 -1
- package/{src/ts/client → editor}/grapesjs/index.ts +5 -3
- package/{src/ts/client → editor}/grapesjs/internal-links.ts +2 -2
- package/{src/ts/client → editor}/grapesjs/resize-panel.ts +2 -1
- package/{src/ts/client → editor}/grapesjs/settings-sections.ts +1 -1
- package/{src/ts/client → editor}/grapesjs/settings.ts +2 -2
- package/{src/ts/client → editor}/grapesjs/storage.ts +1 -1
- package/editor/grapesjs/website-info.ts +52 -0
- package/{src/ts/client → editor}/index.ts +1 -1
- package/{src/ts/client → editor}/publication-transformers.test.ts +10 -10
- package/{src/ts/client → editor}/publication-transformers.ts +1 -1
- package/{src/ts/client → editor}/publish-fonts.ts +2 -2
- package/grapesjs-plugins/expression-input/.husky/pre-commit +2 -0
- package/grapesjs-plugins/expression-input/.prettierrc.json +7 -0
- package/grapesjs-plugins/expression-input/.vscode/extensions.json +9 -0
- package/grapesjs-plugins/expression-input/CHANGELOG.md +47 -0
- package/grapesjs-plugins/expression-input/LICENSE +661 -0
- package/grapesjs-plugins/expression-input/README.md +59 -0
- package/grapesjs-plugins/expression-input/babel.config.js +3 -0
- package/grapesjs-plugins/expression-input/commitlint.config.js +1 -0
- package/grapesjs-plugins/expression-input/dev/README.md +1 -0
- package/grapesjs-plugins/expression-input/dev/expression-input.html +148 -0
- package/grapesjs-plugins/expression-input/dev/input-chain.html +88 -0
- package/grapesjs-plugins/expression-input/dev/popin-form.html +83 -0
- package/grapesjs-plugins/expression-input/docs/expression-input.md +173 -0
- package/grapesjs-plugins/expression-input/docs/popin-form.md +228 -0
- package/grapesjs-plugins/expression-input/eslint.config.mjs +71 -0
- package/grapesjs-plugins/expression-input/package.json +84 -0
- package/grapesjs-plugins/expression-input/playwright.config.ts +6 -0
- package/grapesjs-plugins/expression-input/rollup.config.js +39 -0
- package/grapesjs-plugins/expression-input/src/expression-input.ts +339 -0
- package/grapesjs-plugins/expression-input/src/index.ts +3 -0
- package/grapesjs-plugins/expression-input/src/input-chain.ts +216 -0
- package/grapesjs-plugins/expression-input/src/popin-form.ts +189 -0
- package/grapesjs-plugins/expression-input/src/popin-overlay.ts +188 -0
- package/grapesjs-plugins/expression-input/src/styles.ts +374 -0
- package/grapesjs-plugins/expression-input/src/test/popin-form_test.ts +47 -0
- package/grapesjs-plugins/expression-input/tsconfig.json +34 -0
- package/grapesjs-plugins/expression-input/web-dev-server.config.js +25 -0
- package/grapesjs-plugins/expression-input/web-test-runner.config.js +124 -0
- package/grapesjs-plugins/grapesjs-advanced-selector/.editorconfig +5 -0
- package/grapesjs-plugins/grapesjs-advanced-selector/.husky/pre-commit +4 -0
- package/grapesjs-plugins/grapesjs-advanced-selector/LICENSE +661 -0
- package/grapesjs-plugins/grapesjs-advanced-selector/README.md +158 -0
- package/grapesjs-plugins/grapesjs-advanced-selector/babel.config.js +3 -0
- package/grapesjs-plugins/grapesjs-advanced-selector/eslint.config.mjs +20 -0
- package/grapesjs-plugins/grapesjs-advanced-selector/index.html +353 -0
- package/grapesjs-plugins/grapesjs-advanced-selector/jest.config.cjs +11 -0
- package/grapesjs-plugins/grapesjs-advanced-selector/package-lock.json +12500 -0
- package/grapesjs-plugins/grapesjs-advanced-selector/package.json +75 -0
- package/grapesjs-plugins/grapesjs-advanced-selector/public/simple-selector.html +12 -0
- package/grapesjs-plugins/grapesjs-advanced-selector/src/StylableElement.ts +15 -0
- package/grapesjs-plugins/grapesjs-advanced-selector/src/capabilities.ts +49 -0
- package/grapesjs-plugins/grapesjs-advanced-selector/src/commands.ts +89 -0
- package/grapesjs-plugins/grapesjs-advanced-selector/src/components/complex-selector.ts +187 -0
- package/grapesjs-plugins/grapesjs-advanced-selector/src/components/compound-selector.ts +241 -0
- package/grapesjs-plugins/grapesjs-advanced-selector/src/components/current-selector-display.ts +289 -0
- package/grapesjs-plugins/grapesjs-advanced-selector/src/components/inline-select.ts +199 -0
- package/grapesjs-plugins/grapesjs-advanced-selector/src/components/resize-input.ts +19 -0
- package/grapesjs-plugins/grapesjs-advanced-selector/src/components/simple-selector.ts +537 -0
- package/grapesjs-plugins/grapesjs-advanced-selector/src/i18n/en.ts +75 -0
- package/grapesjs-plugins/grapesjs-advanced-selector/src/i18n/fr.ts +75 -0
- package/grapesjs-plugins/grapesjs-advanced-selector/src/index.ts +47 -0
- package/grapesjs-plugins/grapesjs-advanced-selector/src/model/ComplexSelector.test.ts +380 -0
- package/grapesjs-plugins/grapesjs-advanced-selector/src/model/ComplexSelector.ts +231 -0
- package/grapesjs-plugins/grapesjs-advanced-selector/src/model/CompoundSelector.test.ts +232 -0
- package/grapesjs-plugins/grapesjs-advanced-selector/src/model/CompoundSelector.ts +128 -0
- package/grapesjs-plugins/grapesjs-advanced-selector/src/model/GrapesJsSelectors.test.ts +1077 -0
- package/grapesjs-plugins/grapesjs-advanced-selector/src/model/GrapesJsSelectors.ts +653 -0
- package/grapesjs-plugins/grapesjs-advanced-selector/src/model/Operator.test.ts +45 -0
- package/grapesjs-plugins/grapesjs-advanced-selector/src/model/Operator.ts +129 -0
- package/grapesjs-plugins/grapesjs-advanced-selector/src/model/PseudoClass.test.ts +31 -0
- package/grapesjs-plugins/grapesjs-advanced-selector/src/model/PseudoClass.ts +159 -0
- package/grapesjs-plugins/grapesjs-advanced-selector/src/model/SimpleSelector.test.ts +181 -0
- package/grapesjs-plugins/grapesjs-advanced-selector/src/model/SimpleSelector.ts +379 -0
- package/grapesjs-plugins/grapesjs-advanced-selector/src/plugin.ts +225 -0
- package/grapesjs-plugins/grapesjs-advanced-selector/src/styles.ts +40 -0
- package/grapesjs-plugins/grapesjs-advanced-selector/src/test-data.json +3546 -0
- package/grapesjs-plugins/grapesjs-advanced-selector/tsconfig.json +37 -0
- package/grapesjs-plugins/grapesjs-ai-capabilities/.eslintrc.json +31 -0
- package/grapesjs-plugins/grapesjs-ai-capabilities/LICENSE +17 -0
- package/grapesjs-plugins/grapesjs-ai-capabilities/README.md +129 -0
- package/grapesjs-plugins/grapesjs-ai-capabilities/_index.html +37 -0
- package/grapesjs-plugins/grapesjs-ai-capabilities/package-lock.json +9023 -0
- package/grapesjs-plugins/grapesjs-ai-capabilities/package.json +46 -0
- package/grapesjs-plugins/grapesjs-ai-capabilities/src/index.js +97 -0
- package/grapesjs-plugins/grapesjs-ai-capabilities/test/index.test.js +198 -0
- package/grapesjs-plugins/grapesjs-ai-capabilities/tsconfig.json +29 -0
- package/grapesjs-plugins/grapesjs-css-variables/.eslintrc.json +31 -0
- package/grapesjs-plugins/grapesjs-css-variables/LICENSE +661 -0
- package/grapesjs-plugins/grapesjs-css-variables/README.md +172 -0
- package/grapesjs-plugins/grapesjs-css-variables/TEST_SCENARIOS.md +181 -0
- package/grapesjs-plugins/grapesjs-css-variables/_index.html +93 -0
- package/grapesjs-plugins/grapesjs-css-variables/package-lock.json +9020 -0
- package/grapesjs-plugins/grapesjs-css-variables/package.json +46 -0
- package/grapesjs-plugins/grapesjs-css-variables/src/capabilities.js +133 -0
- package/grapesjs-plugins/grapesjs-css-variables/src/index.js +37 -0
- package/grapesjs-plugins/grapesjs-css-variables/src/locale/en.js +22 -0
- package/grapesjs-plugins/grapesjs-css-variables/src/locale/fr.js +22 -0
- package/grapesjs-plugins/grapesjs-css-variables/src/modal.js +692 -0
- package/grapesjs-plugins/grapesjs-css-variables/src/style-manager.js +461 -0
- package/grapesjs-plugins/grapesjs-css-variables/src/types.js +8 -0
- package/grapesjs-plugins/grapesjs-css-variables/src/variables.js +439 -0
- package/grapesjs-plugins/grapesjs-data-source/.husky/pre-commit +4 -0
- package/grapesjs-plugins/grapesjs-data-source/.nvmrc +1 -0
- package/grapesjs-plugins/grapesjs-data-source/LICENSE +661 -0
- package/grapesjs-plugins/grapesjs-data-source/README.md +674 -0
- package/grapesjs-plugins/grapesjs-data-source/__mocks__/directus-schema.json +67137 -0
- package/grapesjs-plugins/grapesjs-data-source/__mocks__/directus-test-schema.json +8393 -0
- package/grapesjs-plugins/grapesjs-data-source/__mocks__/graphql-mocks.js +7 -0
- package/grapesjs-plugins/grapesjs-data-source/__mocks__/simple-schema.json +493 -0
- package/grapesjs-plugins/grapesjs-data-source/__mocks__/squidex-schema.json +6656 -0
- package/grapesjs-plugins/grapesjs-data-source/__mocks__/strapi-schema.json +7986 -0
- package/grapesjs-plugins/grapesjs-data-source/_index.html +110 -0
- package/grapesjs-plugins/grapesjs-data-source/babel.config.js +7 -0
- package/grapesjs-plugins/grapesjs-data-source/eslint.config.mjs +47 -0
- package/grapesjs-plugins/grapesjs-data-source/example.graphql +355 -0
- package/grapesjs-plugins/grapesjs-data-source/example.graphql.json +5666 -0
- package/grapesjs-plugins/grapesjs-data-source/example.page.json +1 -0
- package/grapesjs-plugins/grapesjs-data-source/integration-tests/base/graphql-response.json +6 -0
- package/grapesjs-plugins/grapesjs-data-source/integration-tests/base/graphql-types.json +2095 -0
- package/grapesjs-plugins/grapesjs-data-source/integration-tests/base/preview.html +5 -0
- package/grapesjs-plugins/grapesjs-data-source/integration-tests/base/website.json +79 -0
- package/grapesjs-plugins/grapesjs-data-source/integration-tests/countries-lists/graphql-response.json +1056 -0
- package/grapesjs-plugins/grapesjs-data-source/integration-tests/countries-lists/graphql-types.json +2095 -0
- package/grapesjs-plugins/grapesjs-data-source/integration-tests/countries-lists/preview.html +36 -0
- package/grapesjs-plugins/grapesjs-data-source/integration-tests/countries-lists/website.json +422 -0
- package/grapesjs-plugins/grapesjs-data-source/integration-tests/example.graphql-result.json +18718 -0
- package/grapesjs-plugins/grapesjs-data-source/integration-tests/example.graphql-types.json +1955 -0
- package/grapesjs-plugins/grapesjs-data-source/integration-tests/graphql-modules.json +191 -0
- package/grapesjs-plugins/grapesjs-data-source/integration-tests/modules.html +45 -0
- package/grapesjs-plugins/grapesjs-data-source/integration-tests/visibility-truthy/graphql-response.json +1056 -0
- package/grapesjs-plugins/grapesjs-data-source/integration-tests/visibility-truthy/graphql-types.json +2095 -0
- package/grapesjs-plugins/grapesjs-data-source/integration-tests/visibility-truthy/preview.html +31 -0
- package/grapesjs-plugins/grapesjs-data-source/integration-tests/visibility-truthy/website.json +261 -0
- package/grapesjs-plugins/grapesjs-data-source/integration-tests/website-modules.json +650 -0
- package/grapesjs-plugins/grapesjs-data-source/jest.config.js +21 -0
- package/grapesjs-plugins/grapesjs-data-source/package-lock.json +13182 -0
- package/grapesjs-plugins/grapesjs-data-source/package.json +77 -0
- package/grapesjs-plugins/grapesjs-data-source/src/api.ts +386 -0
- package/grapesjs-plugins/grapesjs-data-source/src/capabilities.ts +80 -0
- package/grapesjs-plugins/grapesjs-data-source/src/commands.ts +269 -0
- package/grapesjs-plugins/grapesjs-data-source/src/datasources/GraphQL.ts +1039 -0
- package/grapesjs-plugins/grapesjs-data-source/src/datasources/graphql-introspection-query.ts +112 -0
- package/grapesjs-plugins/grapesjs-data-source/src/datasources/graphql.test.ts +657 -0
- package/grapesjs-plugins/grapesjs-data-source/src/filters/index.ts +102 -0
- package/grapesjs-plugins/grapesjs-data-source/src/filters/liquid.test.ts +27 -0
- package/grapesjs-plugins/grapesjs-data-source/src/filters/liquid.ts +985 -0
- package/grapesjs-plugins/grapesjs-data-source/src/index.ts +103 -0
- package/grapesjs-plugins/grapesjs-data-source/src/integration.test.ts +504 -0
- package/grapesjs-plugins/grapesjs-data-source/src/model/ExpressionTree.ts +251 -0
- package/grapesjs-plugins/grapesjs-data-source/src/model/completion.ts +213 -0
- package/grapesjs-plugins/grapesjs-data-source/src/model/dataSourceManager.ts +315 -0
- package/grapesjs-plugins/grapesjs-data-source/src/model/dataSourceRegistry.test.ts +170 -0
- package/grapesjs-plugins/grapesjs-data-source/src/model/dataSourceRegistry.ts +117 -0
- package/grapesjs-plugins/grapesjs-data-source/src/model/expressionEvaluator.ts +241 -0
- package/grapesjs-plugins/grapesjs-data-source/src/model/previewDataLoader.ts +196 -0
- package/grapesjs-plugins/grapesjs-data-source/src/model/queryBuilder.ts +118 -0
- package/grapesjs-plugins/grapesjs-data-source/src/model/state.test.ts +76 -0
- package/grapesjs-plugins/grapesjs-data-source/src/model/state.ts +243 -0
- package/grapesjs-plugins/grapesjs-data-source/src/model/token.ts +336 -0
- package/grapesjs-plugins/grapesjs-data-source/src/storage.test.ts +81 -0
- package/grapesjs-plugins/grapesjs-data-source/src/storage.ts +55 -0
- package/grapesjs-plugins/grapesjs-data-source/src/test-data.ts +154 -0
- package/grapesjs-plugins/grapesjs-data-source/src/types.ts +299 -0
- package/grapesjs-plugins/grapesjs-data-source/src/utils.test.ts +46 -0
- package/grapesjs-plugins/grapesjs-data-source/src/utils.ts +367 -0
- package/grapesjs-plugins/grapesjs-data-source/src/view/canvas.ts +718 -0
- package/grapesjs-plugins/grapesjs-data-source/src/view/custom-states-editor.ts +371 -0
- package/grapesjs-plugins/grapesjs-data-source/src/view/defaultStyles.ts +432 -0
- package/grapesjs-plugins/grapesjs-data-source/src/view/index.ts +168 -0
- package/grapesjs-plugins/grapesjs-data-source/src/view/properties-editor.ts +249 -0
- package/grapesjs-plugins/grapesjs-data-source/src/view/settings.ts +1551 -0
- package/grapesjs-plugins/grapesjs-data-source/src/view/state-editor.ts +528 -0
- package/grapesjs-plugins/grapesjs-data-source/strapi/.editorconfig +16 -0
- package/grapesjs-plugins/grapesjs-data-source/strapi/.env.example +7 -0
- package/grapesjs-plugins/grapesjs-data-source/strapi/.eslintignore +3 -0
- package/grapesjs-plugins/grapesjs-data-source/strapi/.eslintrc +27 -0
- package/grapesjs-plugins/grapesjs-data-source/strapi/README.md +57 -0
- package/grapesjs-plugins/grapesjs-data-source/strapi/config/admin.js +13 -0
- package/grapesjs-plugins/grapesjs-data-source/strapi/config/api.js +7 -0
- package/grapesjs-plugins/grapesjs-data-source/strapi/config/database.js +92 -0
- package/grapesjs-plugins/grapesjs-data-source/strapi/config/middlewares.js +12 -0
- package/grapesjs-plugins/grapesjs-data-source/strapi/config/server.js +10 -0
- package/grapesjs-plugins/grapesjs-data-source/strapi/database/migrations/.gitkeep +0 -0
- package/grapesjs-plugins/grapesjs-data-source/strapi/favicon.png +0 -0
- package/grapesjs-plugins/grapesjs-data-source/strapi/jsconfig.json +8 -0
- package/grapesjs-plugins/grapesjs-data-source/strapi/package.json +31 -0
- package/grapesjs-plugins/grapesjs-data-source/strapi/public/robots.txt +3 -0
- package/grapesjs-plugins/grapesjs-data-source/strapi/public/uploads/.gitkeep +0 -0
- package/grapesjs-plugins/grapesjs-data-source/strapi/src/admin/app.example.js +39 -0
- package/grapesjs-plugins/grapesjs-data-source/strapi/src/admin/webpack.config.example.js +9 -0
- package/grapesjs-plugins/grapesjs-data-source/strapi/src/api/.gitkeep +0 -0
- package/grapesjs-plugins/grapesjs-data-source/strapi/src/api/post/content-types/post/schema.json +26 -0
- package/grapesjs-plugins/grapesjs-data-source/strapi/src/api/post/controllers/post.js +9 -0
- package/grapesjs-plugins/grapesjs-data-source/strapi/src/api/post/routes/post.js +9 -0
- package/grapesjs-plugins/grapesjs-data-source/strapi/src/api/post/services/post.js +9 -0
- package/grapesjs-plugins/grapesjs-data-source/strapi/src/extensions/.gitkeep +0 -0
- package/grapesjs-plugins/grapesjs-data-source/strapi/src/index.js +20 -0
- package/grapesjs-plugins/grapesjs-data-source/strapi/types/generated/components.d.ts +5 -0
- package/grapesjs-plugins/grapesjs-data-source/strapi/types/generated/contentTypes.d.ts +723 -0
- package/grapesjs-plugins/grapesjs-data-source/tmp/countries-lists.html +1 -0
- package/grapesjs-plugins/grapesjs-data-source/tsconfig.cjs.json +8 -0
- package/grapesjs-plugins/grapesjs-data-source/tsconfig.json +49 -0
- package/grapesjs-plugins/grapesjs-filter-styles/README.md +137 -0
- package/grapesjs-plugins/grapesjs-filter-styles/eslint.config.mjs +35 -0
- package/grapesjs-plugins/grapesjs-filter-styles/package-lock.json +8927 -0
- package/grapesjs-plugins/grapesjs-filter-styles/package.json +40 -0
- package/grapesjs-plugins/grapesjs-filter-styles/src/index.js +283 -0
- package/grapesjs-plugins/grapesjs-filter-styles/tsconfig.json +26 -0
- package/grapesjs-plugins/grapesjs-fonts/.eslintrc.json +31 -0
- package/grapesjs-plugins/grapesjs-fonts/LICENSE +9 -0
- package/grapesjs-plugins/grapesjs-fonts/README.md +231 -0
- package/grapesjs-plugins/grapesjs-fonts/_index.html +95 -0
- package/grapesjs-plugins/grapesjs-fonts/package-lock.json +9024 -0
- package/grapesjs-plugins/grapesjs-fonts/package.json +46 -0
- package/grapesjs-plugins/grapesjs-fonts/src/capabilities.js +61 -0
- package/grapesjs-plugins/grapesjs-fonts/src/commands.js +100 -0
- package/grapesjs-plugins/grapesjs-fonts/src/fonts.js +396 -0
- package/grapesjs-plugins/grapesjs-fonts/src/index.js +34 -0
- package/grapesjs-plugins/grapesjs-fonts/src/locale/en.js +19 -0
- package/grapesjs-plugins/grapesjs-fonts/src/locale/fr.js +21 -0
- package/grapesjs-plugins/grapesjs-fonts/src/locale/ptbr.js +18 -0
- package/grapesjs-plugins/grapesjs-fonts/tsconfig.json +29 -0
- package/grapesjs-plugins/grapesjs-keymaps-dialog/README.md +116 -0
- package/grapesjs-plugins/grapesjs-keymaps-dialog/package.json +46 -0
- package/grapesjs-plugins/grapesjs-keymaps-dialog/src/KeymapsDialog.ts +208 -0
- package/grapesjs-plugins/grapesjs-keymaps-dialog/src/KeymapsDialogManager.ts +78 -0
- package/grapesjs-plugins/grapesjs-keymaps-dialog/src/index.ts +70 -0
- package/grapesjs-plugins/grapesjs-keymaps-dialog/tsconfig.json +29 -0
- package/grapesjs-plugins/grapesjs-loading/.eslintrc.json +22 -0
- package/grapesjs-plugins/grapesjs-loading/README.md +140 -0
- package/grapesjs-plugins/grapesjs-loading/_index.html +90 -0
- package/grapesjs-plugins/grapesjs-loading/eslint.config.mjs +20 -0
- package/grapesjs-plugins/grapesjs-loading/grapesjs-loading.gif +0 -0
- package/grapesjs-plugins/grapesjs-loading/package.json +50 -0
- package/grapesjs-plugins/grapesjs-loading/src/index.ts +54 -0
- package/grapesjs-plugins/grapesjs-loading/tsconfig.json +20 -0
- package/grapesjs-plugins/grapesjs-notifications/LICENSE +661 -0
- package/grapesjs-plugins/grapesjs-notifications/README.md +295 -0
- package/grapesjs-plugins/grapesjs-notifications/_index.html +95 -0
- package/grapesjs-plugins/grapesjs-notifications/package-lock.json +8187 -0
- package/grapesjs-plugins/grapesjs-notifications/package.json +58 -0
- package/grapesjs-plugins/grapesjs-notifications/src/Notification.ts +117 -0
- package/grapesjs-plugins/grapesjs-notifications/src/NotificationManager.ts +93 -0
- package/grapesjs-plugins/grapesjs-notifications/src/Storage.ts +26 -0
- package/grapesjs-plugins/grapesjs-notifications/src/capabilities.ts +33 -0
- package/grapesjs-plugins/grapesjs-notifications/src/commands.ts +5 -0
- package/grapesjs-plugins/grapesjs-notifications/src/index.ts +126 -0
- package/grapesjs-plugins/grapesjs-notifications/src/locale/en.js +8 -0
- package/grapesjs-plugins/grapesjs-notifications/src/view.ts +127 -0
- package/grapesjs-plugins/grapesjs-notifications/tsconfig.json +30 -0
- package/grapesjs-plugins/grapesjs-storage-rate-limit/LICENSE +213 -0
- package/grapesjs-plugins/grapesjs-storage-rate-limit/README.md +119 -0
- package/grapesjs-plugins/grapesjs-storage-rate-limit/jest.config.js +197 -0
- package/grapesjs-plugins/grapesjs-storage-rate-limit/package-lock.json +10752 -0
- package/grapesjs-plugins/grapesjs-storage-rate-limit/package.json +44 -0
- package/grapesjs-plugins/grapesjs-storage-rate-limit/src/index.js +90 -0
- package/grapesjs-plugins/grapesjs-storage-rate-limit/src/index.test.js +122 -0
- package/grapesjs-plugins/grapesjs-symbols/.eslintrc.cjs +20 -0
- package/grapesjs-plugins/grapesjs-symbols/.husky/pre-commit +5 -0
- package/grapesjs-plugins/grapesjs-symbols/.nvmrc +1 -0
- package/grapesjs-plugins/grapesjs-symbols/LICENSE +661 -0
- package/grapesjs-plugins/grapesjs-symbols/README.md +228 -0
- package/grapesjs-plugins/grapesjs-symbols/_index.html +104 -0
- package/grapesjs-plugins/grapesjs-symbols/es5.html +119 -0
- package/grapesjs-plugins/grapesjs-symbols/es6.html +107 -0
- package/grapesjs-plugins/grapesjs-symbols/eslint.config.mjs +72 -0
- package/grapesjs-plugins/grapesjs-symbols/jest.config.js +12 -0
- package/grapesjs-plugins/grapesjs-symbols/package-lock.json +6867 -0
- package/grapesjs-plugins/grapesjs-symbols/package.json +73 -0
- package/grapesjs-plugins/grapesjs-symbols/rollup.config.mjs +26 -0
- package/grapesjs-plugins/grapesjs-symbols/src/SymbolsCommands.test.ts +147 -0
- package/grapesjs-plugins/grapesjs-symbols/src/SymbolsCommands.ts +144 -0
- package/grapesjs-plugins/grapesjs-symbols/src/capabilities.ts +50 -0
- package/grapesjs-plugins/grapesjs-symbols/src/events.ts +8 -0
- package/grapesjs-plugins/grapesjs-symbols/src/id-utils.ts +158 -0
- package/grapesjs-plugins/grapesjs-symbols/src/index.ts +46 -0
- package/grapesjs-plugins/grapesjs-symbols/src/test-utils.ts +51 -0
- package/grapesjs-plugins/grapesjs-symbols/src/utils.test.ts +118 -0
- package/grapesjs-plugins/grapesjs-symbols/src/utils.ts +90 -0
- package/grapesjs-plugins/grapesjs-symbols/src/view/SymbolsView.ts +251 -0
- package/grapesjs-plugins/grapesjs-symbols/src/view/traits.ts +101 -0
- package/grapesjs-plugins/grapesjs-symbols/tsconfig.json +35 -0
- package/grapesjs-plugins/grapesjs-symbols/tsconfig.test.json +12 -0
- package/grapesjs-plugins/grapesjs-version-flow/LICENSE +661 -0
- package/grapesjs-plugins/grapesjs-version-flow/README.md +422 -0
- package/grapesjs-plugins/grapesjs-version-flow/_index.html +494 -0
- package/grapesjs-plugins/grapesjs-version-flow/babel.config.js +9 -0
- package/grapesjs-plugins/grapesjs-version-flow/package-lock.json +11832 -0
- package/grapesjs-plugins/grapesjs-version-flow/package.json +77 -0
- package/grapesjs-plugins/grapesjs-version-flow/prompts/initial.txt +116 -0
- package/grapesjs-plugins/grapesjs-version-flow/src/event-system.js +48 -0
- package/grapesjs-plugins/grapesjs-version-flow/src/index.js +87 -0
- package/grapesjs-plugins/grapesjs-version-flow/src/locale/en.js +26 -0
- package/grapesjs-plugins/grapesjs-version-flow/src/locale/fr.js +26 -0
- package/grapesjs-plugins/grapesjs-version-flow/src/modal-ui.js +562 -0
- package/grapesjs-plugins/grapesjs-version-flow/src/style-manager.js +240 -0
- package/grapesjs-plugins/grapesjs-version-flow/src/upgrade-engine.js +237 -0
- package/grapesjs-plugins/grapesjs-version-flow/src/version-manager.js +117 -0
- package/grapesjs-plugins/grapesjs-version-flow/tests/index.test.js +241 -0
- package/grapesjs-plugins/grapesjs-version-flow/tests/integration.test.js +227 -0
- package/grapesjs-plugins/grapesjs-version-flow/tests/setup.js +67 -0
- package/grapesjs-plugins/grapesjs-version-flow/tests/upgrade-engine.test.js +360 -0
- package/grapesjs-plugins/grapesjs-version-flow/tests/version-manager.test.js +168 -0
- package/grapesjs-plugins/grapesjs-version-flow/tests/version-storage.test.js +203 -0
- package/grapesjs-plugins/grapesjs-version-flow/tsconfig.json +26 -0
- package/package.json +127 -159
- package/{src/ts/server → server}/api/api.ts +6 -6
- package/{src/ts/server → server}/api/connectorApi.ts +5 -5
- package/{src/ts/server → server}/api/publicationApi.ts +7 -7
- package/{src/ts/server → server}/api/websiteApi.ts +7 -8
- package/{src/ts/server → server}/config.ts +14 -12
- package/{src/ts/server → server}/connectors/FsHosting.ts +4 -4
- package/{src/ts/server → server}/connectors/FsStorage.test.ts +2 -2
- package/{src/ts/server → server}/connectors/FsStorage.ts +8 -8
- package/{src/ts/server → server}/connectors/connectors.ts +3 -3
- package/server/deploy/.nvmrc +1 -0
- package/server/deploy/.silex.js +220 -0
- package/server/deploy/client-config.js +17 -0
- package/server/deploy/client-plugins/.gitkeep +0 -0
- package/server/deploy/client-plugins/onboarding.js +67 -0
- package/server/deploy/example.env +25 -0
- package/server/deploy/onboarding.json +22 -0
- package/server/deploy/picto-silex@3x.png +0 -0
- package/server/deploy/server-plugins/dashboard.js +74 -0
- package/server/deploy/server-plugins/onboarding.js +212 -0
- package/server/deploy/silex-platform.yml +75 -0
- package/{src/ts/server → server}/events.ts +2 -2
- package/{src/ts/server → server}/expose.ts +1 -1
- package/{src/ts/server → server}/express.ts +2 -2
- package/{src/ts/server → server}/index.ts +7 -7
- package/{src/ts/server → server}/jobs.test.ts +1 -1
- package/{src/ts/server → server}/jobs.ts +1 -1
- package/server/plugins/DownloadConnector.publish.test.ts +32 -0
- package/server/plugins/DownloadConnector.test.ts +70 -0
- package/{src/ts/plugins/server → server/plugins}/DownloadConnector.ts +22 -10
- package/{src/ts/plugins/server → server/plugins}/FtpConnector.test.ts +3 -3
- package/{src/ts/plugins/server → server/plugins}/FtpConnector.ts +7 -7
- package/{src/ts/plugins/server → server/plugins}/GitlabConnector.ts +9 -26
- package/{src/ts/plugins/server → server/plugins}/GitlabHostingConnector.ts +5 -5
- package/{src/ts/plugins/server → server/plugins}/SslPlugin.ts +2 -2
- package/{src/ts/plugins/server → server/plugins}/StaticPlugin.ts +2 -2
- package/{src/ts/server → server}/utils/BackwardCompat.ts +1 -1
- package/{src/ts/server → server}/utils/websiteDataSerialization.test.ts +2 -2
- package/{src/ts/server → server}/utils/websiteDataSerialization.ts +3 -3
- package/.silex.js +0 -76
- package/dist/client/client/api.d.ts +0 -101
- package/dist/client/client/assetUrl.d.ts +0 -60
- package/dist/client/client/config.d.ts +0 -110
- package/dist/client/client/events.d.ts +0 -23
- package/dist/client/client/expose.d.ts +0 -10
- package/dist/client/client/grapesjs/LoginDialog.d.ts +0 -15
- package/dist/client/client/grapesjs/PublicationManager.d.ts +0 -117
- package/dist/client/client/grapesjs/PublicationUi.d.ts +0 -59
- package/dist/client/client/grapesjs/blocks.d.ts +0 -1
- package/dist/client/client/grapesjs/body-remap.d.ts +0 -15
- package/dist/client/client/grapesjs/breadcrumbs.d.ts +0 -1
- package/dist/client/client/grapesjs/cms/DataSource.d.ts +0 -43
- package/dist/client/client/grapesjs/cms/blocks.d.ts +0 -2
- package/dist/client/client/grapesjs/cms/buttons.d.ts +0 -2
- package/dist/client/client/grapesjs/cms/collection-pages.d.ts +0 -4
- package/dist/client/client/grapesjs/cms/config.d.ts +0 -9
- package/dist/client/client/grapesjs/cms/filters.d.ts +0 -3
- package/dist/client/client/grapesjs/cms/index.d.ts +0 -43
- package/dist/client/client/grapesjs/cms/liquid.d.ts +0 -73
- package/dist/client/client/grapesjs/cms/page-settings.d.ts +0 -6
- package/dist/client/client/grapesjs/cms/publication.d.ts +0 -60
- package/dist/client/client/grapesjs/cms/site-settings.d.ts +0 -3
- package/dist/client/client/grapesjs/cms/states.d.ts +0 -8
- package/dist/client/client/grapesjs/cms/traits.d.ts +0 -8
- package/dist/client/client/grapesjs/core-commands.d.ts +0 -3
- package/dist/client/client/grapesjs/css-props.d.ts +0 -6
- package/dist/client/client/grapesjs/flex.d.ts +0 -3
- package/dist/client/client/grapesjs/footer.d.ts +0 -2
- package/dist/client/client/grapesjs/img.d.ts +0 -6
- package/dist/client/client/grapesjs/index.d.ts +0 -9
- package/dist/client/client/grapesjs/internal-links.d.ts +0 -1
- package/dist/client/client/grapesjs/keymaps.d.ts +0 -123
- package/dist/client/client/grapesjs/li.d.ts +0 -7
- package/dist/client/client/grapesjs/new-page-dialog.d.ts +0 -2
- package/dist/client/client/grapesjs/openImport.d.ts +0 -9
- package/dist/client/client/grapesjs/page-panel.d.ts +0 -13
- package/dist/client/client/grapesjs/project-bar.d.ts +0 -21
- package/dist/client/client/grapesjs/resize-panel.d.ts +0 -1
- package/dist/client/client/grapesjs/rich-text.d.ts +0 -4
- package/dist/client/client/grapesjs/sectors.d.ts +0 -12
- package/dist/client/client/grapesjs/semantic.d.ts +0 -1
- package/dist/client/client/grapesjs/settings-sections.d.ts +0 -19
- package/dist/client/client/grapesjs/settings.d.ts +0 -16
- package/dist/client/client/grapesjs/storage.d.ts +0 -3
- package/dist/client/client/grapesjs/symbolDialogs.d.ts +0 -4
- package/dist/client/client/grapesjs/upload-progress.d.ts +0 -2
- package/dist/client/client/grapesjs/view-buttons.d.ts +0 -2
- package/dist/client/client/index.d.ts +0 -10
- package/dist/client/client/publication-transformers.d.ts +0 -42
- package/dist/client/client/publish-custom-code-block.d.ts +0 -4
- package/dist/client/client/publish-fonts.d.ts +0 -4
- package/dist/client/client/utils.d.ts +0 -23
- package/dist/client/constants.d.ts +0 -35
- package/dist/client/page.d.ts +0 -2
- package/dist/client/types.d.ts +0 -365
- package/dist/client/webfonts/fa-brands-400.ttf +0 -0
- package/dist/client/webfonts/fa-regular-400.ttf +0 -0
- package/dist/client/webfonts/fa-solid-900.ttf +0 -0
- package/dist/client/webfonts/fa-v4compatibility.ttf +0 -0
- package/dist/plugins/client/client/events.d.ts +0 -23
- package/dist/plugins/client/client/events.js +0 -43
- package/dist/plugins/client/client/events.js.map +0 -1
- package/dist/plugins/client/plugins/client/template.d.ts +0 -2
- package/dist/plugins/client/plugins/client/template.js +0 -234
- package/dist/plugins/client/plugins/client/template.js.map +0 -1
- package/dist/plugins/client/plugins/client/website-info.d.ts +0 -1
- package/dist/plugins/client/plugins/client/website-info.js +0 -72
- package/dist/plugins/client/plugins/client/website-info.js.map +0 -1
- package/dist/plugins/client/types.d.ts +0 -365
- package/dist/plugins/client/types.js +0 -83
- package/dist/plugins/client/types.js.map +0 -1
- package/dist/plugins/server/constants.d.ts +0 -35
- package/dist/plugins/server/constants.js +0 -79
- package/dist/plugins/server/constants.js.map +0 -1
- package/dist/plugins/server/page.d.ts +0 -2
- package/dist/plugins/server/page.js +0 -35
- package/dist/plugins/server/page.js.map +0 -1
- package/dist/plugins/server/plugins/server/Cache.d.ts +0 -2
- package/dist/plugins/server/plugins/server/Cache.js +0 -36
- package/dist/plugins/server/plugins/server/Cache.js.map +0 -1
- package/dist/plugins/server/plugins/server/DownloadConnector.d.ts +0 -29
- package/dist/plugins/server/plugins/server/DownloadConnector.js.map +0 -1
- package/dist/plugins/server/plugins/server/FtpConnector.d.ts +0 -86
- package/dist/plugins/server/plugins/server/FtpConnector.js.map +0 -1
- package/dist/plugins/server/plugins/server/GitlabConnector.d.ts +0 -172
- package/dist/plugins/server/plugins/server/GitlabConnector.js.map +0 -1
- package/dist/plugins/server/plugins/server/GitlabHostingConnector.d.ts +0 -23
- package/dist/plugins/server/plugins/server/GitlabHostingConnector.js.map +0 -1
- package/dist/plugins/server/plugins/server/PublicationOptimizer.js +0 -14
- package/dist/plugins/server/plugins/server/PublicationOptimizer.js.map +0 -1
- package/dist/plugins/server/plugins/server/SslPlugin.d.ts +0 -1
- package/dist/plugins/server/plugins/server/SslPlugin.js.map +0 -1
- package/dist/plugins/server/plugins/server/StaticPlugin.d.ts +0 -8
- package/dist/plugins/server/plugins/server/StaticPlugin.js.map +0 -1
- package/dist/plugins/server/server/config.d.ts +0 -59
- package/dist/plugins/server/server/config.js +0 -181
- package/dist/plugins/server/server/config.js.map +0 -1
- package/dist/plugins/server/server/connectors/FsHosting.d.ts +0 -14
- package/dist/plugins/server/server/connectors/FsHosting.js +0 -66
- package/dist/plugins/server/server/connectors/FsHosting.js.map +0 -1
- package/dist/plugins/server/server/connectors/FsStorage.d.ts +0 -44
- package/dist/plugins/server/server/connectors/FsStorage.js +0 -303
- package/dist/plugins/server/server/connectors/FsStorage.js.map +0 -1
- package/dist/plugins/server/server/connectors/connectors.d.ts +0 -86
- package/dist/plugins/server/server/connectors/connectors.js +0 -126
- package/dist/plugins/server/server/connectors/connectors.js.map +0 -1
- package/dist/plugins/server/server/events.d.ts +0 -26
- package/dist/plugins/server/server/events.js +0 -31
- package/dist/plugins/server/server/events.js.map +0 -1
- package/dist/plugins/server/server/jobs.d.ts +0 -12
- package/dist/plugins/server/server/jobs.js +0 -79
- package/dist/plugins/server/server/jobs.js.map +0 -1
- package/dist/plugins/server/server/utils/validation.d.ts +0 -7
- package/dist/plugins/server/server/utils/validation.js +0 -37
- package/dist/plugins/server/server/utils/validation.js.map +0 -1
- package/dist/plugins/server/server/utils/websiteDataSerialization.d.ts +0 -24
- package/dist/plugins/server/server/utils/websiteDataSerialization.js +0 -136
- package/dist/plugins/server/server/utils/websiteDataSerialization.js.map +0 -1
- package/dist/plugins/server/types.d.ts +0 -365
- package/dist/plugins/server/types.js +0 -87
- package/dist/plugins/server/types.js.map +0 -1
- package/dist/server/server/cli.js +0 -71
- package/src/css/grapesjs-light.scss +0 -180
- package/src/ts/plugins/client/template.ts +0 -246
- package/src/ts/plugins/client/website-info.ts +0 -84
- package/src/ts/server/cli.ts +0 -67
- /package/{src/ts → common}/constants.ts +0 -0
- /package/{src/ts → common}/externs.ts +0 -0
- /package/{src/ts → common}/page.ts +0 -0
- /package/{src/ts → common}/types.ts +0 -0
- /package/dist/server/{constants.js → common/constants.js} +0 -0
- /package/dist/server/{page.js → common/page.js} +0 -0
- /package/dist/server/{types.js → common/types.js} +0 -0
- /package/dist/server/{plugins/server → server/plugins}/Cache.js +0 -0
- /package/{src → editor}/css/_mixins.scss +0 -0
- /package/{src → editor}/css/_variables.scss +0 -0
- /package/{src → editor}/css/dialog.scss +0 -0
- /package/{src → editor}/css/dialogs.scss +0 -0
- /package/{src → editor}/css/fonts.scss +0 -0
- /package/{src → editor}/css/footer.scss +0 -0
- /package/{src → editor}/css/grapesjs-plugins.scss +0 -0
- /package/{src → editor}/css/grapesjs.scss +0 -0
- /package/{src → editor}/css/loader.scss +0 -0
- /package/{src → editor}/css/page-panel.scss +0 -0
- /package/{src → editor}/css/panels.scss +0 -0
- /package/{src → editor}/css/silex.scss +0 -0
- /package/{src → editor}/css/theme-base.scss +0 -0
- /package/{src → editor}/css/website-info.scss +0 -0
- /package/{src/ts/client → editor}/events.ts +0 -0
- /package/{src/ts/client → editor}/grapesjs/blocks.ts +0 -0
- /package/{src/ts/client → editor}/grapesjs/body-remap.ts +0 -0
- /package/{src/ts/client → editor}/grapesjs/breadcrumbs.ts +0 -0
- /package/{src/ts/client → editor}/grapesjs/cms/DataSource.ts +0 -0
- /package/{src/ts/client → editor}/grapesjs/cms/blocks.ts +0 -0
- /package/{src/ts/client → editor}/grapesjs/cms/buttons.ts +0 -0
- /package/{src/ts/client → editor}/grapesjs/cms/collection-pages.ts +0 -0
- /package/{src/ts/client → editor}/grapesjs/cms/config.ts +0 -0
- /package/{src/ts/client → editor}/grapesjs/cms/filters.ts +0 -0
- /package/{src/ts/client → editor}/grapesjs/cms/liquid.mock.ts +0 -0
- /package/{src/ts/client → editor}/grapesjs/cms/liquid.test.ts +0 -0
- /package/{src/ts/client → editor}/grapesjs/cms/liquid.ts +0 -0
- /package/{src/ts/client → editor}/grapesjs/cms/publication.test.ts +0 -0
- /package/{src/ts/client → editor}/grapesjs/cms/site-settings.ts +0 -0
- /package/{src/ts/client → editor}/grapesjs/cms/states.ts +0 -0
- /package/{src/ts/client → editor}/grapesjs/cms/traits.ts +0 -0
- /package/{src/ts/client → editor}/grapesjs/core-commands.ts +0 -0
- /package/{src/ts/client → editor}/grapesjs/css-props.ts +0 -0
- /package/{src/ts/client → editor}/grapesjs/flex.ts +0 -0
- /package/{src/ts/client → editor}/grapesjs/footer.ts +0 -0
- /package/{src/ts/client → editor}/grapesjs/img.ts +0 -0
- /package/{src/ts/client → editor}/grapesjs/internal-links.test.ts +0 -0
- /package/{src/ts/client → editor}/grapesjs/keymaps.ts +0 -0
- /package/{src/ts/client → editor}/grapesjs/li.ts +0 -0
- /package/{src/ts/client → editor}/grapesjs/new-page-dialog.ts +0 -0
- /package/{src/ts/client → editor}/grapesjs/openImport.ts +0 -0
- /package/{src/ts/client → editor}/grapesjs/page-panel.ts +0 -0
- /package/{src/ts/client → editor}/grapesjs/project-bar.ts +0 -0
- /package/{src/ts/client → editor}/grapesjs/rich-text.ts +0 -0
- /package/{src/ts/client → editor}/grapesjs/sectors.ts +0 -0
- /package/{src/ts/client → editor}/grapesjs/semantic.ts +0 -0
- /package/{src/ts/client → editor}/grapesjs/static-plugins.ts +0 -0
- /package/{src/ts/client → editor}/grapesjs/symbolDialogs.ts +0 -0
- /package/{src/ts/client → editor}/grapesjs/upload-progress.ts +0 -0
- /package/{src/ts/client → editor}/grapesjs/view-buttons.ts +0 -0
- /package/{src → editor}/html/debug.pug +0 -0
- /package/{src → editor}/html/index.pug +0 -0
- /package/{src → editor}/html/templates/includes.pug +0 -0
- /package/{src → editor}/html/templates/workspace.pug +0 -0
- /package/{src/ts/client → editor}/publish-custom-code-block.ts +0 -0
- /package/{src/ts/client → editor}/utils.ts +0 -0
- /package/{dist/plugins/server/plugins/server/PublicationOptimizer.d.ts → grapesjs-plugins/expression-input/docs/.nojekyll} +0 -0
- /package/{src/ts/plugins/server → server/plugins}/Cache.ts +0 -0
- /package/{src/ts/plugins/server → server/plugins}/PublicationOptimizer.ts +0 -0
- /package/{src/ts/server → server}/utils/validation.ts +0 -0
|
@@ -8,10 +8,6 @@
|
|
|
8
8
|
* https://github.com/osartun/Backbone.Undo.js
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
/*! @silexlabs/grapesjs-ai-capabilities - 0.0.4 */
|
|
12
|
-
|
|
13
|
-
/*! @silexlabs/grapesjs-filter-styles - 1.4.0 */
|
|
14
|
-
|
|
15
11
|
/*! grapesjs-style-border - 1.0.4 */
|
|
16
12
|
|
|
17
13
|
/**
|
|
@@ -20,6 +16,12 @@
|
|
|
20
16
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
21
17
|
*/
|
|
22
18
|
|
|
19
|
+
/**
|
|
20
|
+
* @license
|
|
21
|
+
* Copyright 2018 Google LLC
|
|
22
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
23
|
+
*/
|
|
24
|
+
|
|
23
25
|
/**
|
|
24
26
|
* @license
|
|
25
27
|
* Copyright 2020 Google LLC
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Config = void 0;
|
|
7
|
+
exports.default = default_1;
|
|
8
|
+
const plugin_js_1 = require("./plugin.js");
|
|
9
|
+
const component_emitter_1 = __importDefault(require("component-emitter"));
|
|
10
|
+
function default_1(baseUrl = null) {
|
|
11
|
+
return new Config(baseUrl);
|
|
12
|
+
}
|
|
13
|
+
class Config extends component_emitter_1.default {
|
|
14
|
+
baseUrl;
|
|
15
|
+
constructor(baseUrl = null) {
|
|
16
|
+
super();
|
|
17
|
+
this.baseUrl = baseUrl;
|
|
18
|
+
}
|
|
19
|
+
async addPlugin(plugin, options) {
|
|
20
|
+
const result = await (0, plugin_js_1.loadPlugins)(this, [].concat(plugin), options, this.baseUrl);
|
|
21
|
+
Object.assign(this, result);
|
|
22
|
+
return this;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
exports.Config = Config;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./config.js"), exports);
|
|
18
|
+
__exportStar(require("./plugin.js"), exports);
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.loadPlugins = loadPlugins;
|
|
4
|
+
async function loadPlugins(config, plugins, options, baseUrl = null) {
|
|
5
|
+
return Promise.all(plugins
|
|
6
|
+
.map(async (plugin) => {
|
|
7
|
+
const [construct, name,] = await (async () => {
|
|
8
|
+
switch (typeof plugin) {
|
|
9
|
+
case 'function': return [plugin, plugin.toString(),];
|
|
10
|
+
case 'string': return [await loadPlugin(plugin, baseUrl), plugin,];
|
|
11
|
+
default: throw new Error(`Unknown type for plugin: ${typeof plugin}`);
|
|
12
|
+
}
|
|
13
|
+
})();
|
|
14
|
+
return construct(config, name && options ? options[name] ?? options : options);
|
|
15
|
+
}))
|
|
16
|
+
.then((results) => {
|
|
17
|
+
return results.reduce((finalConfig, result) => {
|
|
18
|
+
return {
|
|
19
|
+
...finalConfig,
|
|
20
|
+
...result,
|
|
21
|
+
};
|
|
22
|
+
}, config);
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
async function loadPlugin(location, baseUrl) {
|
|
26
|
+
const path = getLocation(location, baseUrl);
|
|
27
|
+
const imported = await dynamicImport(path);
|
|
28
|
+
const result = imported?.default ?? imported;
|
|
29
|
+
return result;
|
|
30
|
+
}
|
|
31
|
+
function getLocation(urlOrPath, baseUrl = null) {
|
|
32
|
+
try {
|
|
33
|
+
return new URL(urlOrPath, baseUrl).toString();
|
|
34
|
+
}
|
|
35
|
+
catch {
|
|
36
|
+
return urlOrPath;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
async function dynamicImport(path) {
|
|
40
|
+
return import(path);
|
|
41
|
+
}
|
|
@@ -5,16 +5,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.default = default_1;
|
|
7
7
|
const express_1 = require("express");
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
8
|
+
const Cache_js_1 = require("../plugins/Cache.js");
|
|
9
|
+
const connectorApi_js_1 = __importDefault(require("./connectorApi.js"));
|
|
10
|
+
const websiteApi_js_1 = __importDefault(require("./websiteApi.js"));
|
|
11
|
+
const publicationApi_js_1 = __importDefault(require("./publicationApi.js"));
|
|
12
|
+
const constants_js_1 = require("../../common/constants.js");
|
|
13
13
|
function default_1(config) {
|
|
14
14
|
const router = (0, express_1.Router)();
|
|
15
|
-
router.use(
|
|
16
|
-
router.use(
|
|
17
|
-
router.use(
|
|
18
|
-
router.use(
|
|
15
|
+
router.use(Cache_js_1.noCache);
|
|
16
|
+
router.use(constants_js_1.API_CONNECTOR_PATH, (0, connectorApi_js_1.default)(config));
|
|
17
|
+
router.use(constants_js_1.API_WEBSITE_PATH, (0, websiteApi_js_1.default)(config));
|
|
18
|
+
router.use(constants_js_1.API_PUBLICATION_PATH, (0, publicationApi_js_1.default)(config));
|
|
19
19
|
return router;
|
|
20
20
|
}
|
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.default = default_1;
|
|
4
4
|
const express_1 = require("express");
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
5
|
+
const constants_js_1 = require("../../common/constants.js");
|
|
6
|
+
const validation_js_1 = require("../utils/validation.js");
|
|
7
|
+
const connectors_js_1 = require("../connectors/connectors.js");
|
|
8
8
|
function default_1(config) {
|
|
9
9
|
const router = (0, express_1.Router)();
|
|
10
|
-
router.get(
|
|
11
|
-
router.get(
|
|
12
|
-
router.get(
|
|
13
|
-
router.post(
|
|
14
|
-
router.get(
|
|
15
|
-
router.post(
|
|
10
|
+
router.get(constants_js_1.API_CONNECTOR_USER, routeUser);
|
|
11
|
+
router.get(constants_js_1.API_CONNECTOR_LIST, routeListConnectors);
|
|
12
|
+
router.get(constants_js_1.API_CONNECTOR_LOGIN, routeLogin);
|
|
13
|
+
router.post(constants_js_1.API_CONNECTOR_LOGIN_CALLBACK, routeLoginSuccess);
|
|
14
|
+
router.get(constants_js_1.API_CONNECTOR_LOGIN_CALLBACK, routeLoginSuccess);
|
|
15
|
+
router.post(constants_js_1.API_CONNECTOR_LOGOUT, routeLogout);
|
|
16
16
|
return router;
|
|
17
17
|
}
|
|
18
18
|
function validateStatus(status, _default = 500) {
|
|
@@ -35,11 +35,11 @@ function validateStatus(status, _default = 500) {
|
|
|
35
35
|
}
|
|
36
36
|
async function routeUser(req, res) {
|
|
37
37
|
try {
|
|
38
|
-
const config = (0,
|
|
39
|
-
const session = (0,
|
|
38
|
+
const config = (0, validation_js_1.requiredParam)(req.app.get('config'), 'Config object on express js APP');
|
|
39
|
+
const session = (0, validation_js_1.requiredParam)(req['session'], 'Session object');
|
|
40
40
|
const query = req.query;
|
|
41
|
-
const type = (0,
|
|
42
|
-
const connector = await (0,
|
|
41
|
+
const type = (0, connectors_js_1.toConnectorEnum)((0, validation_js_1.requiredParam)(query.type, 'Connector type'));
|
|
42
|
+
const connector = await (0, connectors_js_1.getConnector)(config, session, type, query.connectorId);
|
|
43
43
|
if (!connector) {
|
|
44
44
|
res
|
|
45
45
|
.status(500)
|
|
@@ -71,13 +71,13 @@ async function routeUser(req, res) {
|
|
|
71
71
|
}
|
|
72
72
|
async function routeListConnectors(req, res) {
|
|
73
73
|
try {
|
|
74
|
-
const config = (0,
|
|
75
|
-
const session = (0,
|
|
74
|
+
const config = (0, validation_js_1.requiredParam)(req.app.get('config'), 'Config object on express js APP');
|
|
75
|
+
const session = (0, validation_js_1.requiredParam)(req['session'], 'Session object');
|
|
76
76
|
const query = req.query;
|
|
77
|
-
const type = (0,
|
|
77
|
+
const type = (0, connectors_js_1.toConnectorEnum)((0, validation_js_1.requiredParam)(query.type, 'Connector type'));
|
|
78
78
|
const connectors = config.getConnectors(type);
|
|
79
79
|
try {
|
|
80
|
-
const list = await Promise.all(connectors.map(async (connector) => (0,
|
|
80
|
+
const list = await Promise.all(connectors.map(async (connector) => (0, connectors_js_1.toConnectorData)(session, connector)));
|
|
81
81
|
res.json(list);
|
|
82
82
|
}
|
|
83
83
|
catch (error) {
|
|
@@ -99,15 +99,15 @@ async function routeListConnectors(req, res) {
|
|
|
99
99
|
async function routeLogin(req, res) {
|
|
100
100
|
try {
|
|
101
101
|
const query = req.query;
|
|
102
|
-
const connectorId = (0,
|
|
103
|
-
const config = (0,
|
|
104
|
-
const type = (0,
|
|
105
|
-
const connector = await (0,
|
|
106
|
-
const session = (0,
|
|
102
|
+
const connectorId = (0, validation_js_1.requiredParam)(query.connectorId, 'Connector id');
|
|
103
|
+
const config = (0, validation_js_1.requiredParam)(req.app.get('config'), 'Config object on express js APP');
|
|
104
|
+
const type = (0, connectors_js_1.toConnectorEnum)((0, validation_js_1.requiredParam)(query.type, 'Connector type'));
|
|
105
|
+
const connector = await (0, connectors_js_1.getConnector)(config, req['session'], type, connectorId);
|
|
106
|
+
const session = (0, validation_js_1.requiredParam)(req['session'], 'Session object');
|
|
107
107
|
if (!connector)
|
|
108
108
|
throw new Error(`Connector not found ${connectorId} ${type}`);
|
|
109
109
|
if (await connector.isLoggedIn(session)) {
|
|
110
|
-
res.redirect(`${config.url}${
|
|
110
|
+
res.redirect(`${config.url}${constants_js_1.API_PATH}${constants_js_1.API_CONNECTOR_PATH}${constants_js_1.API_CONNECTOR_LOGIN_CALLBACK}?connectorId=${connectorId}&type=${type}`);
|
|
111
111
|
return;
|
|
112
112
|
}
|
|
113
113
|
const oauthUrl = await connector.getOAuthUrl(session);
|
|
@@ -116,8 +116,8 @@ async function routeLogin(req, res) {
|
|
|
116
116
|
}
|
|
117
117
|
else {
|
|
118
118
|
const redirectTo = await connector.getSettingsForm(session, '') ?
|
|
119
|
-
`${config.url}${
|
|
120
|
-
`${config.url}${
|
|
119
|
+
`${config.url}${constants_js_1.API_PATH}${constants_js_1.API_CONNECTOR_PATH}${constants_js_1.API_CONNECTOR_SETTINGS}?connectorId=${connectorId}&type=${type}` :
|
|
120
|
+
`${config.url}${constants_js_1.API_PATH}${constants_js_1.API_CONNECTOR_PATH}${constants_js_1.API_CONNECTOR_LOGIN_CALLBACK}?connectorId=${connectorId}&type=${type}`;
|
|
121
121
|
res.send(await connector.getLoginForm(session, redirectTo));
|
|
122
122
|
}
|
|
123
123
|
}
|
|
@@ -135,11 +135,11 @@ async function routeLoginSuccess(req, res) {
|
|
|
135
135
|
if (query.error)
|
|
136
136
|
throw new Error(query.error);
|
|
137
137
|
const body = req.body;
|
|
138
|
-
const session = (0,
|
|
139
|
-
const connectorId = (0,
|
|
140
|
-
const config = (0,
|
|
141
|
-
const type = (0,
|
|
142
|
-
const connector = await (0,
|
|
138
|
+
const session = (0, validation_js_1.requiredParam)(req['session'], 'Session object');
|
|
139
|
+
const connectorId = (0, validation_js_1.requiredParam)(query.connectorId, 'Connector id');
|
|
140
|
+
const config = (0, validation_js_1.requiredParam)(req.app.get('config'), 'Config object on express js APP');
|
|
141
|
+
const type = (0, connectors_js_1.toConnectorEnum)((0, validation_js_1.requiredParam)(query.type, 'Connector type'));
|
|
142
|
+
const connector = await (0, connectors_js_1.getConnector)(config, req['session'], type, connectorId);
|
|
143
143
|
if (!connector)
|
|
144
144
|
throw new Error('Connector not found ' + connectorId);
|
|
145
145
|
let redirect;
|
|
@@ -175,11 +175,11 @@ async function routeLoginSuccess(req, res) {
|
|
|
175
175
|
async function routeLogout(req, res) {
|
|
176
176
|
try {
|
|
177
177
|
const query = req.query;
|
|
178
|
-
const session = (0,
|
|
179
|
-
const config = (0,
|
|
180
|
-
const type = (0,
|
|
178
|
+
const session = (0, validation_js_1.requiredParam)(req['session'], 'Session object');
|
|
179
|
+
const config = (0, validation_js_1.requiredParam)(req.app.get('config'), 'Config object on express js APP');
|
|
180
|
+
const type = (0, connectors_js_1.toConnectorEnum)((0, validation_js_1.requiredParam)(query.type, 'Connector type'));
|
|
181
181
|
const connectorId = query.connectorId;
|
|
182
|
-
const connector = await (0,
|
|
182
|
+
const connector = await (0, connectors_js_1.getConnector)(config, session, type, connectorId);
|
|
183
183
|
if (!connector)
|
|
184
184
|
throw new Error(`Connector not found ${connectorId} ${type}`);
|
|
185
185
|
try {
|
|
@@ -302,7 +302,7 @@ function getEndAuthHtml(message, error, connectorId, connectorType, options, red
|
|
|
302
302
|
<pre id="error-container" class="error">${message}</pre>
|
|
303
303
|
<script>
|
|
304
304
|
document.getElementById('error-container').style.display = "block";
|
|
305
|
-
fetch("${
|
|
305
|
+
fetch("${constants_js_1.API_PATH}${constants_js_1.API_CONNECTOR_PATH}${constants_js_1.API_CONNECTOR_LOGOUT}?connectorId=${connectorId}&type=${connectorType}", {
|
|
306
306
|
method: 'POST',
|
|
307
307
|
headers: {
|
|
308
308
|
'Content-Type': 'application/json',
|
|
@@ -5,12 +5,12 @@ exports.getHostingConnector = getHostingConnector;
|
|
|
5
5
|
exports.getStorageConnector = getStorageConnector;
|
|
6
6
|
exports.default = default_1;
|
|
7
7
|
const express_1 = require("express");
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
8
|
+
const constants_js_1 = require("../../common/constants.js");
|
|
9
|
+
const types_js_1 = require("../../common/types.js");
|
|
10
|
+
const connectors_js_1 = require("../connectors/connectors.js");
|
|
11
|
+
const validation_js_1 = require("../utils/validation.js");
|
|
12
|
+
const events_js_1 = require("../events.js");
|
|
13
|
+
const jobs_js_1 = require("../jobs.js");
|
|
14
14
|
class PublicationError extends Error {
|
|
15
15
|
code;
|
|
16
16
|
constructor(message, code) {
|
|
@@ -33,7 +33,7 @@ async function mapWithConcurrency(items, limit, mapper) {
|
|
|
33
33
|
return results;
|
|
34
34
|
}
|
|
35
35
|
async function getHostingConnector(session, config, connectorId) {
|
|
36
|
-
const hostingConnector = await (0,
|
|
36
|
+
const hostingConnector = await (0, connectors_js_1.getConnector)(config, session, types_js_1.ConnectorType.HOSTING, connectorId);
|
|
37
37
|
if (!hostingConnector) {
|
|
38
38
|
throw new PublicationError('No hosting connector found', 500);
|
|
39
39
|
}
|
|
@@ -43,7 +43,7 @@ async function getHostingConnector(session, config, connectorId) {
|
|
|
43
43
|
return hostingConnector;
|
|
44
44
|
}
|
|
45
45
|
async function getStorageConnector(session, config, connectorId) {
|
|
46
|
-
const storageConnector = await (0,
|
|
46
|
+
const storageConnector = await (0, connectors_js_1.getConnector)(config, session, types_js_1.ConnectorType.STORAGE, connectorId);
|
|
47
47
|
if (!storageConnector) {
|
|
48
48
|
throw new PublicationError('No storage connector found', 500);
|
|
49
49
|
}
|
|
@@ -54,10 +54,10 @@ async function getStorageConnector(session, config, connectorId) {
|
|
|
54
54
|
}
|
|
55
55
|
function default_1(config) {
|
|
56
56
|
const router = (0, express_1.Router)();
|
|
57
|
-
router.get(
|
|
57
|
+
router.get(constants_js_1.API_PUBLICATION_STATUS, async function (req, res) {
|
|
58
58
|
const query = req.query;
|
|
59
59
|
const jobId = query.jobId;
|
|
60
|
-
const job = jobId && (0,
|
|
60
|
+
const job = jobId && (0, jobs_js_1.getJob)(jobId);
|
|
61
61
|
if (!job) {
|
|
62
62
|
console.error(`Error: job not found with id ${jobId}`);
|
|
63
63
|
res.status(404).json({
|
|
@@ -70,20 +70,20 @@ function default_1(config) {
|
|
|
70
70
|
_timeout: undefined,
|
|
71
71
|
});
|
|
72
72
|
});
|
|
73
|
-
router.post(
|
|
73
|
+
router.post(constants_js_1.API_PUBLICATION_PUBLISH, async function (req, res) {
|
|
74
74
|
try {
|
|
75
75
|
const query = req.query;
|
|
76
76
|
const body = req.body;
|
|
77
|
-
const websiteId = (0,
|
|
78
|
-
const storageId = (0,
|
|
79
|
-
const hostingId = (0,
|
|
80
|
-
const session = (0,
|
|
77
|
+
const websiteId = (0, validation_js_1.requiredParam)(query.websiteId, 'id in query');
|
|
78
|
+
const storageId = (0, validation_js_1.requiredParam)(query.storageId, 'storageId in query');
|
|
79
|
+
const hostingId = (0, validation_js_1.requiredParam)(query.hostingId, 'hostingId in query');
|
|
80
|
+
const session = (0, validation_js_1.requiredParam)(req['session'], 'session on express request');
|
|
81
81
|
const data = body;
|
|
82
82
|
const { files } = data;
|
|
83
83
|
if (!files) {
|
|
84
84
|
throw new PublicationError('Missing files in body', 400);
|
|
85
85
|
}
|
|
86
|
-
config.emit(
|
|
86
|
+
config.emit(events_js_1.ServerEvent.PUBLISH_START, data);
|
|
87
87
|
const hostingConnector = await getHostingConnector(session, config, hostingId);
|
|
88
88
|
const storage = await getStorageConnector(session, config, storageId);
|
|
89
89
|
const filesList = await mapWithConcurrency(files, PUBLISH_STORAGE_CONCURRENCY, async (file) => {
|
|
@@ -99,7 +99,7 @@ function default_1(config) {
|
|
|
99
99
|
});
|
|
100
100
|
res.json({
|
|
101
101
|
url: await hostingConnector.getUrl(session, websiteId),
|
|
102
|
-
job: await hostingConnector.publish(session, websiteId, filesList,
|
|
102
|
+
job: await hostingConnector.publish(session, websiteId, filesList, jobs_js_1.jobManager),
|
|
103
103
|
});
|
|
104
104
|
}
|
|
105
105
|
catch (err) {
|
|
@@ -109,10 +109,10 @@ function default_1(config) {
|
|
|
109
109
|
.json({
|
|
110
110
|
message: `Error publishing the website. ${err.message}`
|
|
111
111
|
});
|
|
112
|
-
config.emit(
|
|
112
|
+
config.emit(events_js_1.ServerEvent.PUBLISH_END, err);
|
|
113
113
|
return;
|
|
114
114
|
}
|
|
115
|
-
config.emit(
|
|
115
|
+
config.emit(events_js_1.ServerEvent.PUBLISH_END);
|
|
116
116
|
});
|
|
117
117
|
return router;
|
|
118
118
|
}
|
|
@@ -6,21 +6,21 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.default = default_1;
|
|
7
7
|
const express_1 = require("express");
|
|
8
8
|
const formidable_1 = __importDefault(require("formidable"));
|
|
9
|
-
const
|
|
9
|
+
const constants_js_1 = require("../../common/constants.js");
|
|
10
10
|
const fs_1 = require("fs");
|
|
11
|
-
const
|
|
12
|
-
const
|
|
11
|
+
const types_js_1 = require("../../common/types.js");
|
|
12
|
+
const connectors_js_1 = require("../connectors/connectors.js");
|
|
13
13
|
const stream_1 = require("stream");
|
|
14
|
-
const
|
|
14
|
+
const validation_js_1 = require("../utils/validation.js");
|
|
15
15
|
const path_1 = require("path");
|
|
16
|
-
const
|
|
16
|
+
const events_js_1 = require("../events.js");
|
|
17
17
|
function default_1(config, opts = {}) {
|
|
18
18
|
const options = {
|
|
19
19
|
assetsPath: '/assets',
|
|
20
20
|
...opts
|
|
21
21
|
};
|
|
22
22
|
const router = (0, express_1.Router)();
|
|
23
|
-
router.get(
|
|
23
|
+
router.get(constants_js_1.API_WEBSITE_READ, async (req, res, next) => {
|
|
24
24
|
const query = req.query;
|
|
25
25
|
const { websiteId, connectorId } = query;
|
|
26
26
|
const session = req['session'];
|
|
@@ -46,7 +46,7 @@ function default_1(config, opts = {}) {
|
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
});
|
|
49
|
-
router.get(
|
|
49
|
+
router.get(constants_js_1.API_WEBSITE_LIST, async (req, res) => {
|
|
50
50
|
const query = req.query;
|
|
51
51
|
const { connectorId } = query;
|
|
52
52
|
const session = req['session'];
|
|
@@ -64,21 +64,21 @@ function default_1(config, opts = {}) {
|
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
});
|
|
67
|
-
router.post(
|
|
67
|
+
router.post(constants_js_1.API_WEBSITE_WRITE, async (req, res) => {
|
|
68
68
|
try {
|
|
69
69
|
const query = req.query;
|
|
70
70
|
const body = req.body;
|
|
71
|
-
const websiteId = (0,
|
|
72
|
-
const websiteData = (0,
|
|
71
|
+
const websiteId = (0, validation_js_1.requiredParam)(query.websiteId, 'Website id');
|
|
72
|
+
const websiteData = (0, validation_js_1.requiredParam)(body, 'Website data');
|
|
73
73
|
const connectorId = query.connectorId;
|
|
74
|
-
config.emit(
|
|
74
|
+
config.emit(events_js_1.ServerEvent.WEBSITE_STORE_START, { websiteId, websiteData, connectorId });
|
|
75
75
|
await writeWebsite(req['session'], websiteId, websiteData, connectorId);
|
|
76
|
-
config.emit(
|
|
76
|
+
config.emit(events_js_1.ServerEvent.WEBSITE_STORE_END, null);
|
|
77
77
|
res.status(200).json({ message: 'Website saved' });
|
|
78
78
|
}
|
|
79
79
|
catch (e) {
|
|
80
80
|
console.error('Error saving website data', e);
|
|
81
|
-
config.emit(
|
|
81
|
+
config.emit(events_js_1.ServerEvent.WEBSITE_STORE_END, e);
|
|
82
82
|
if (e.httpStatusCode) {
|
|
83
83
|
res.status(e.httpStatusCode).json({ message: e.message });
|
|
84
84
|
}
|
|
@@ -87,16 +87,16 @@ function default_1(config, opts = {}) {
|
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
89
|
});
|
|
90
|
-
router.put(
|
|
90
|
+
router.put(constants_js_1.API_WEBSITE_CREATE, async (req, res) => {
|
|
91
91
|
try {
|
|
92
92
|
const session = req['session'];
|
|
93
93
|
const query = req.query;
|
|
94
94
|
const body = req.body;
|
|
95
|
-
const websiteMeta = (0,
|
|
95
|
+
const websiteMeta = (0, validation_js_1.requiredParam)(body, 'Website meta');
|
|
96
96
|
const connectorId = query.connectorId;
|
|
97
|
-
const connector = await (0,
|
|
97
|
+
const connector = await (0, connectors_js_1.getConnector)(config, session, types_js_1.ConnectorType.STORAGE, connectorId);
|
|
98
98
|
if (!connector) {
|
|
99
|
-
throw new
|
|
99
|
+
throw new types_js_1.ApiError(`Connector ${connectorId} not found`, 500);
|
|
100
100
|
}
|
|
101
101
|
await connector.createWebsite(session, websiteMeta);
|
|
102
102
|
res.json({ message: 'Website meta saved' });
|
|
@@ -111,17 +111,17 @@ function default_1(config, opts = {}) {
|
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
113
|
});
|
|
114
|
-
router.post(
|
|
114
|
+
router.post(constants_js_1.API_WEBSITE_META_WRITE, async (req, res) => {
|
|
115
115
|
try {
|
|
116
116
|
const session = req['session'];
|
|
117
117
|
const query = req.query;
|
|
118
118
|
const body = req.body;
|
|
119
|
-
const websiteId = (0,
|
|
120
|
-
const websiteMeta = (0,
|
|
119
|
+
const websiteId = (0, validation_js_1.requiredParam)(query.websiteId, 'Website id');
|
|
120
|
+
const websiteMeta = (0, validation_js_1.requiredParam)(body, 'Website meta');
|
|
121
121
|
const connectorId = query.connectorId;
|
|
122
|
-
const connector = await (0,
|
|
122
|
+
const connector = await (0, connectors_js_1.getConnector)(config, session, types_js_1.ConnectorType.STORAGE, connectorId);
|
|
123
123
|
if (!connector) {
|
|
124
|
-
throw new
|
|
124
|
+
throw new types_js_1.ApiError(`Connector ${connectorId} not found`, 500);
|
|
125
125
|
}
|
|
126
126
|
await connector.setWebsiteMeta(session, websiteId, websiteMeta);
|
|
127
127
|
res.json({ message: 'Website meta saved' });
|
|
@@ -136,15 +136,15 @@ function default_1(config, opts = {}) {
|
|
|
136
136
|
}
|
|
137
137
|
}
|
|
138
138
|
});
|
|
139
|
-
router.get(
|
|
139
|
+
router.get(constants_js_1.API_WEBSITE_META_READ, async (req, res) => {
|
|
140
140
|
try {
|
|
141
141
|
const session = req['session'];
|
|
142
142
|
const query = req.query;
|
|
143
|
-
const websiteId = (0,
|
|
143
|
+
const websiteId = (0, validation_js_1.requiredParam)(query.websiteId, 'Website id');
|
|
144
144
|
const connectorId = query.connectorId;
|
|
145
|
-
const connector = await (0,
|
|
145
|
+
const connector = await (0, connectors_js_1.getConnector)(config, session, types_js_1.ConnectorType.STORAGE, connectorId);
|
|
146
146
|
if (!connector) {
|
|
147
|
-
throw new
|
|
147
|
+
throw new types_js_1.ApiError(`Connector ${connectorId} not found`, 500);
|
|
148
148
|
}
|
|
149
149
|
const websiteMeta = await connector.getWebsiteMeta(session, websiteId);
|
|
150
150
|
res.json(websiteMeta);
|
|
@@ -159,10 +159,10 @@ function default_1(config, opts = {}) {
|
|
|
159
159
|
}
|
|
160
160
|
}
|
|
161
161
|
});
|
|
162
|
-
router.delete(
|
|
162
|
+
router.delete(constants_js_1.API_WEBSITE_DELETE, async (req, res) => {
|
|
163
163
|
try {
|
|
164
164
|
const query = req.query;
|
|
165
|
-
const websiteId = (0,
|
|
165
|
+
const websiteId = (0, validation_js_1.requiredParam)(query.websiteId, 'Website id');
|
|
166
166
|
await deleteWebsite(req['session'], websiteId, query.connectorId);
|
|
167
167
|
res.status(200).json({ message: 'Website deleted' });
|
|
168
168
|
}
|
|
@@ -176,10 +176,10 @@ function default_1(config, opts = {}) {
|
|
|
176
176
|
}
|
|
177
177
|
}
|
|
178
178
|
});
|
|
179
|
-
router.post(
|
|
179
|
+
router.post(constants_js_1.API_WEBSITE_DUPLICATE, async (req, res) => {
|
|
180
180
|
try {
|
|
181
181
|
const query = req.query;
|
|
182
|
-
const websiteId = (0,
|
|
182
|
+
const websiteId = (0, validation_js_1.requiredParam)(query.websiteId, 'New website id');
|
|
183
183
|
await duplicateWebsite(req['session'], websiteId, query.connectorId);
|
|
184
184
|
res.status(200).json({ message: 'Website duplicated' });
|
|
185
185
|
}
|
|
@@ -193,11 +193,11 @@ function default_1(config, opts = {}) {
|
|
|
193
193
|
}
|
|
194
194
|
}
|
|
195
195
|
});
|
|
196
|
-
router.post(
|
|
196
|
+
router.post(constants_js_1.API_WEBSITE_FORK, async (req, res) => {
|
|
197
197
|
try {
|
|
198
198
|
const query = req.query;
|
|
199
199
|
const body = req.body;
|
|
200
|
-
const gitlabUrl = (0,
|
|
200
|
+
const gitlabUrl = (0, validation_js_1.requiredParam)(body.gitlabUrl, 'GitLab project path ("username/repo")');
|
|
201
201
|
const websiteId = await forkWebsite(req['session'], gitlabUrl, query.connectorId);
|
|
202
202
|
res.status(200).json({ websiteId, message: 'Website forked successfully' });
|
|
203
203
|
}
|
|
@@ -211,13 +211,13 @@ function default_1(config, opts = {}) {
|
|
|
211
211
|
}
|
|
212
212
|
}
|
|
213
213
|
});
|
|
214
|
-
router.get(
|
|
214
|
+
router.get(constants_js_1.API_WEBSITE_ASSET_READ + '/:path', async (req, res) => {
|
|
215
215
|
{
|
|
216
216
|
try {
|
|
217
217
|
const query = req.query;
|
|
218
218
|
const params = req.params;
|
|
219
|
-
const websiteId = (0,
|
|
220
|
-
const path = (0,
|
|
219
|
+
const websiteId = (0, validation_js_1.requiredParam)(query.websiteId, 'Website id');
|
|
220
|
+
const path = (0, validation_js_1.requiredParam)(params.path, 'path');
|
|
221
221
|
const asset = await readAsset(req['session'], websiteId, path, query.connectorId);
|
|
222
222
|
res.contentType((0, path_1.basename)(path));
|
|
223
223
|
if (asset instanceof stream_1.Readable) {
|
|
@@ -238,10 +238,10 @@ function default_1(config, opts = {}) {
|
|
|
238
238
|
}
|
|
239
239
|
}
|
|
240
240
|
});
|
|
241
|
-
router.post(
|
|
241
|
+
router.post(constants_js_1.API_WEBSITE_ASSETS_WRITE, async (req, res) => {
|
|
242
242
|
try {
|
|
243
243
|
const query = req.query;
|
|
244
|
-
const websiteId = (0,
|
|
244
|
+
const websiteId = (0, validation_js_1.requiredParam)(query.websiteId, 'Website id');
|
|
245
245
|
const form = (0, formidable_1.default)({
|
|
246
246
|
multiples: true,
|
|
247
247
|
keepExtensions: true,
|
|
@@ -251,7 +251,7 @@ function default_1(config, opts = {}) {
|
|
|
251
251
|
form.parse(req, async (err, fields, _files) => {
|
|
252
252
|
if (err) {
|
|
253
253
|
console.error('Error parsing upload data', err);
|
|
254
|
-
reject(new
|
|
254
|
+
reject(new types_js_1.ApiError('Error parsing upload data: ' + err.message, 400));
|
|
255
255
|
}
|
|
256
256
|
else {
|
|
257
257
|
const files = [].concat(_files['files[]'])
|
|
@@ -264,15 +264,15 @@ function default_1(config, opts = {}) {
|
|
|
264
264
|
}
|
|
265
265
|
});
|
|
266
266
|
});
|
|
267
|
-
config.emit(
|
|
267
|
+
config.emit(events_js_1.ServerEvent.WEBSITE_ASSET_STORE_START, { files, websiteId, connectorId });
|
|
268
268
|
const result = await writeAssets(req['session'], websiteId, files, connectorId);
|
|
269
269
|
const baseUrl = new URL(config.url).pathname.replace(/\/$/, '');
|
|
270
|
-
const data = result.map(path => (0, path_1.join)(baseUrl,
|
|
270
|
+
const data = result.map(path => (0, path_1.join)(baseUrl, constants_js_1.API_PATH, constants_js_1.API_WEBSITE_PATH, constants_js_1.API_WEBSITE_ASSET_READ, path)
|
|
271
271
|
+ `?websiteId=${websiteId}&connectorId=${connectorId ? connectorId : ''}`);
|
|
272
272
|
res.json({
|
|
273
273
|
data,
|
|
274
274
|
});
|
|
275
|
-
config.emit(
|
|
275
|
+
config.emit(events_js_1.ServerEvent.WEBSITE_ASSET_STORE_END, null);
|
|
276
276
|
}
|
|
277
277
|
catch (e) {
|
|
278
278
|
console.error('Error uploading assets', e);
|
|
@@ -282,16 +282,16 @@ function default_1(config, opts = {}) {
|
|
|
282
282
|
else {
|
|
283
283
|
res.status(500).json({ message: e.message });
|
|
284
284
|
}
|
|
285
|
-
config.emit(
|
|
285
|
+
config.emit(events_js_1.ServerEvent.WEBSITE_ASSET_STORE_END, e);
|
|
286
286
|
}
|
|
287
287
|
});
|
|
288
288
|
async function getStorageConnector(session, connectorId) {
|
|
289
|
-
const storageConnector = await (0,
|
|
289
|
+
const storageConnector = await (0, connectors_js_1.getConnector)(config, session, types_js_1.ConnectorType.STORAGE, connectorId);
|
|
290
290
|
if (!storageConnector) {
|
|
291
|
-
throw new
|
|
291
|
+
throw new types_js_1.ApiError('No storage connector found', 404);
|
|
292
292
|
}
|
|
293
293
|
if (!await storageConnector.isLoggedIn(session)) {
|
|
294
|
-
throw new
|
|
294
|
+
throw new types_js_1.ApiError('Not logged in', 401);
|
|
295
295
|
}
|
|
296
296
|
return storageConnector;
|
|
297
297
|
}
|
|
@@ -318,7 +318,7 @@ function default_1(config, opts = {}) {
|
|
|
318
318
|
async function forkWebsite(session, gitlabUrl, connectorId) {
|
|
319
319
|
const storageConnector = await getStorageConnector(session, connectorId);
|
|
320
320
|
if (typeof storageConnector.forkWebsite !== 'function') {
|
|
321
|
-
throw new
|
|
321
|
+
throw new types_js_1.ApiError('This storage connector does not support forking external projects', 400);
|
|
322
322
|
}
|
|
323
323
|
return storageConnector.forkWebsite(session, gitlabUrl);
|
|
324
324
|
}
|