@strapi/strapi 4.14.0-beta.0 → 4.14.1
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 +25 -29
- package/bin/strapi.js +1 -1
- package/dist/Strapi.d.ts +102 -0
- package/dist/Strapi.js +544 -0
- package/dist/Strapi.js.map +1 -0
- package/dist/commands/actions/admin/create-user/action.d.ts +11 -0
- package/dist/commands/actions/admin/create-user/action.js +97 -0
- package/dist/commands/actions/admin/create-user/action.js.map +1 -0
- package/dist/commands/actions/admin/create-user/command.d.ts +6 -0
- package/dist/commands/actions/admin/create-user/command.js +19 -0
- package/dist/commands/actions/admin/create-user/command.js.map +1 -0
- package/dist/commands/actions/admin/reset-user-password/action.d.ts +9 -0
- package/dist/commands/actions/admin/reset-user-password/action.js +43 -0
- package/dist/commands/actions/admin/reset-user-password/action.js.map +1 -0
- package/dist/commands/actions/admin/reset-user-password/command.d.ts +6 -0
- package/dist/commands/actions/admin/reset-user-password/command.js +17 -0
- package/dist/commands/actions/admin/reset-user-password/command.js.map +1 -0
- package/dist/commands/actions/build-command/action.d.ts +9 -0
- package/dist/commands/actions/build-command/action.js +20 -0
- package/dist/commands/actions/build-command/action.js.map +1 -0
- package/dist/commands/actions/build-command/command.d.ts +6 -0
- package/dist/commands/actions/build-command/command.js +15 -0
- package/dist/commands/actions/build-command/command.js.map +1 -0
- package/dist/commands/actions/components/list/action.d.ts +2 -0
- package/dist/commands/actions/components/list/action.js +20 -0
- package/dist/commands/actions/components/list/action.js.map +1 -0
- package/dist/commands/actions/components/list/command.d.ts +6 -0
- package/dist/commands/actions/components/list/command.js +14 -0
- package/dist/commands/actions/components/list/command.js.map +1 -0
- package/dist/commands/actions/configuration/dump/action.d.ts +10 -0
- package/dist/commands/actions/configuration/dump/action.js +46 -0
- package/dist/commands/actions/configuration/dump/action.js.map +1 -0
- package/dist/commands/actions/configuration/dump/command.d.ts +6 -0
- package/dist/commands/actions/configuration/dump/command.js +17 -0
- package/dist/commands/actions/configuration/dump/command.js.map +1 -0
- package/dist/commands/actions/configuration/restore/action.d.ts +10 -0
- package/dist/commands/actions/configuration/restore/action.js +153 -0
- package/dist/commands/actions/configuration/restore/action.js.map +1 -0
- package/dist/commands/actions/configuration/restore/command.d.ts +6 -0
- package/dist/commands/actions/configuration/restore/command.js +17 -0
- package/dist/commands/actions/configuration/restore/command.js.map +1 -0
- package/dist/commands/actions/console/action.d.ts +5 -0
- package/dist/commands/actions/console/action.js +26 -0
- package/dist/commands/actions/console/action.js.map +1 -0
- package/dist/commands/actions/console/command.d.ts +6 -0
- package/dist/commands/actions/console/command.js +14 -0
- package/dist/commands/actions/console/command.js.map +1 -0
- package/dist/commands/actions/content-types/list/action.d.ts +2 -0
- package/dist/commands/actions/content-types/list/action.js +20 -0
- package/dist/commands/actions/content-types/list/action.js.map +1 -0
- package/dist/commands/actions/content-types/list/command.d.ts +6 -0
- package/dist/commands/actions/content-types/list/command.js +14 -0
- package/dist/commands/actions/content-types/list/command.js.map +1 -0
- package/dist/commands/actions/controllers/list/action.d.ts +2 -0
- package/dist/commands/actions/controllers/list/action.js +20 -0
- package/dist/commands/actions/controllers/list/action.js.map +1 -0
- package/dist/commands/actions/controllers/list/command.d.ts +6 -0
- package/dist/commands/actions/controllers/list/command.js +14 -0
- package/dist/commands/actions/controllers/list/command.js.map +1 -0
- package/dist/commands/actions/develop/action.d.ts +86 -0
- package/dist/commands/actions/develop/action.js +190 -0
- package/dist/commands/actions/develop/action.js.map +1 -0
- package/dist/commands/actions/develop/command.d.ts +6 -0
- package/dist/commands/actions/develop/command.js +19 -0
- package/dist/commands/actions/develop/command.js.map +1 -0
- package/dist/commands/actions/generate/command.d.ts +6 -0
- package/dist/commands/actions/generate/command.js +19 -0
- package/dist/commands/actions/generate/command.js.map +1 -0
- package/dist/commands/actions/hooks/list/action.d.ts +2 -0
- package/dist/commands/actions/hooks/list/action.js +20 -0
- package/dist/commands/actions/hooks/list/action.js.map +1 -0
- package/dist/commands/actions/hooks/list/command.d.ts +6 -0
- package/dist/commands/actions/hooks/list/command.js +14 -0
- package/dist/commands/actions/hooks/list/command.js.map +1 -0
- package/dist/commands/actions/install/action.d.ts +2 -0
- package/dist/commands/actions/install/action.js +49 -0
- package/dist/commands/actions/install/action.js.map +1 -0
- package/dist/commands/actions/install/command.d.ts +6 -0
- package/dist/commands/actions/install/command.js +14 -0
- package/dist/commands/actions/install/command.js.map +1 -0
- package/dist/commands/actions/middlewares/list/action.d.ts +2 -0
- package/dist/commands/actions/middlewares/list/action.js +20 -0
- package/dist/commands/actions/middlewares/list/action.js.map +1 -0
- package/dist/commands/actions/middlewares/list/command.d.ts +6 -0
- package/dist/commands/actions/middlewares/list/command.js +14 -0
- package/dist/commands/actions/middlewares/list/command.js.map +1 -0
- package/dist/commands/actions/new/action.d.ts +7 -0
- package/dist/commands/actions/new/action.js +12 -0
- package/dist/commands/actions/new/action.js.map +1 -0
- package/dist/commands/actions/new/command.d.ts +6 -0
- package/dist/commands/actions/new/command.js +35 -0
- package/dist/commands/actions/new/command.js.map +1 -0
- package/dist/commands/actions/plugin/build-command/action.d.ts +6 -0
- package/dist/commands/actions/plugin/build-command/action.js +105 -0
- package/dist/commands/actions/plugin/build-command/action.js.map +1 -0
- package/dist/commands/actions/plugin/build-command/command.d.ts +6 -0
- package/dist/commands/actions/plugin/build-command/command.js +17 -0
- package/dist/commands/actions/plugin/build-command/command.js.map +1 -0
- package/dist/commands/actions/policies/list/action.d.ts +2 -0
- package/dist/commands/actions/policies/list/action.js +20 -0
- package/dist/commands/actions/policies/list/action.js.map +1 -0
- package/dist/commands/actions/policies/list/command.d.ts +6 -0
- package/dist/commands/actions/policies/list/command.js +14 -0
- package/dist/commands/actions/policies/list/command.js.map +1 -0
- package/dist/commands/actions/report/action.d.ts +7 -0
- package/dist/commands/actions/report/action.js +32 -0
- package/dist/commands/actions/report/action.js.map +1 -0
- package/dist/commands/actions/report/command.d.ts +6 -0
- package/dist/commands/actions/report/command.js +17 -0
- package/dist/commands/actions/report/command.js.map +1 -0
- package/dist/commands/actions/routes/list/action.d.ts +2 -0
- package/dist/commands/actions/routes/list/action.js +26 -0
- package/dist/commands/actions/routes/list/action.js.map +1 -0
- package/dist/commands/actions/routes/list/command.d.ts +6 -0
- package/dist/commands/actions/routes/list/command.js +14 -0
- package/dist/commands/actions/routes/list/command.js.map +1 -0
- package/dist/commands/actions/services/list/action.d.ts +2 -0
- package/dist/commands/actions/services/list/action.js +20 -0
- package/dist/commands/actions/services/list/action.js.map +1 -0
- package/dist/commands/actions/services/list/command.d.ts +6 -0
- package/dist/commands/actions/services/list/command.js +14 -0
- package/dist/commands/actions/services/list/command.js.map +1 -0
- package/dist/commands/actions/start/action.d.ts +78 -0
- package/dist/commands/actions/start/action.js +22 -0
- package/dist/commands/actions/start/action.js.map +1 -0
- package/dist/commands/actions/start/command.d.ts +6 -0
- package/dist/commands/actions/start/command.js +14 -0
- package/dist/commands/actions/start/command.js.map +1 -0
- package/dist/commands/actions/telemetry/disable/action.d.ts +1 -0
- package/dist/commands/actions/telemetry/disable/action.js +83 -0
- package/dist/commands/actions/telemetry/disable/action.js.map +1 -0
- package/dist/commands/actions/telemetry/disable/command.d.ts +6 -0
- package/dist/commands/actions/telemetry/disable/command.js +14 -0
- package/dist/commands/actions/telemetry/disable/command.js.map +1 -0
- package/dist/commands/actions/telemetry/enable/action.d.ts +2 -0
- package/dist/commands/actions/telemetry/enable/action.js +103 -0
- package/dist/commands/actions/telemetry/enable/action.js.map +1 -0
- package/dist/commands/actions/telemetry/enable/command.d.ts +6 -0
- package/dist/commands/actions/telemetry/enable/command.js +14 -0
- package/dist/commands/actions/telemetry/enable/command.js.map +1 -0
- package/dist/commands/actions/templates/generate/action.d.ts +1 -0
- package/dist/commands/actions/templates/generate/action.js +85 -0
- package/dist/commands/actions/templates/generate/action.js.map +1 -0
- package/dist/commands/actions/templates/generate/command.d.ts +6 -0
- package/dist/commands/actions/templates/generate/command.js +14 -0
- package/dist/commands/actions/templates/generate/command.js.map +1 -0
- package/dist/commands/actions/ts/generate-types/action.d.ts +8 -0
- package/dist/commands/actions/ts/generate-types/action.js +28 -0
- package/dist/commands/actions/ts/generate-types/action.js.map +1 -0
- package/dist/commands/actions/ts/generate-types/command.d.ts +6 -0
- package/dist/commands/actions/ts/generate-types/command.js +18 -0
- package/dist/commands/actions/ts/generate-types/command.js.map +1 -0
- package/dist/commands/actions/uninstall/action.d.ts +5 -0
- package/dist/commands/actions/uninstall/action.js +67 -0
- package/dist/commands/actions/uninstall/action.js.map +1 -0
- package/dist/commands/actions/uninstall/command.d.ts +6 -0
- package/dist/commands/actions/uninstall/command.js +15 -0
- package/dist/commands/actions/uninstall/command.js.map +1 -0
- package/dist/commands/actions/version/command.d.ts +6 -0
- package/dist/commands/actions/version/command.js +19 -0
- package/dist/commands/actions/version/command.js.map +1 -0
- package/dist/commands/actions/watch-admin/action.d.ts +4 -0
- package/dist/commands/actions/watch-admin/action.js +36 -0
- package/dist/commands/actions/watch-admin/action.js.map +1 -0
- package/dist/commands/actions/watch-admin/command.d.ts +6 -0
- package/dist/commands/actions/watch-admin/command.js +15 -0
- package/dist/commands/actions/watch-admin/command.js.map +1 -0
- package/dist/commands/builders/admin.d.ts +8 -0
- package/dist/commands/builders/admin.js +52 -0
- package/dist/commands/builders/admin.js.map +1 -0
- package/dist/commands/builders/index.d.ts +3 -0
- package/dist/commands/builders/index.js +11 -0
- package/dist/commands/builders/index.js.map +1 -0
- package/dist/commands/builders/packages.d.ts +37 -0
- package/dist/commands/builders/packages.js +166 -0
- package/dist/commands/builders/packages.js.map +1 -0
- package/dist/commands/builders/tasks/dts.d.ts +13 -0
- package/dist/commands/builders/tasks/dts.js +143 -0
- package/dist/commands/builders/tasks/dts.js.map +1 -0
- package/dist/commands/builders/tasks/index.d.ts +14 -0
- package/dist/commands/builders/tasks/index.js +14 -0
- package/dist/commands/builders/tasks/index.js.map +1 -0
- package/dist/commands/builders/tasks/vite.d.ts +15 -0
- package/dist/commands/builders/tasks/vite.js +114 -0
- package/dist/commands/builders/tasks/vite.js.map +1 -0
- package/dist/commands/builders/typescript.d.ts +6 -0
- package/dist/commands/builders/typescript.js +29 -0
- package/dist/commands/builders/typescript.js.map +1 -0
- package/dist/commands/index.d.ts +34 -0
- package/dist/commands/index.js +100 -0
- package/dist/commands/index.js.map +1 -0
- package/dist/commands/types.d.ts +5 -0
- package/dist/commands/types.js +3 -0
- package/dist/commands/types.js.map +1 -0
- package/dist/commands/utils/commander.d.ts +35 -0
- package/dist/commands/utils/commander.js +138 -0
- package/dist/commands/utils/commander.js.map +1 -0
- package/dist/commands/utils/helpers.d.ts +50 -0
- package/dist/commands/utils/helpers.js +165 -0
- package/dist/commands/utils/helpers.js.map +1 -0
- package/dist/commands/utils/logger.d.ts +16 -0
- package/dist/commands/utils/logger.js +53 -0
- package/dist/commands/utils/logger.js.map +1 -0
- package/dist/commands/utils/pkg.d.ts +237 -0
- package/dist/commands/utils/pkg.js +316 -0
- package/dist/commands/utils/pkg.js.map +1 -0
- package/dist/compile.d.ts +9 -0
- package/dist/compile.js +20 -0
- package/dist/compile.js.map +1 -0
- package/dist/container.d.ts +2 -0
- package/dist/container.js +39 -0
- package/dist/container.js.map +1 -0
- package/dist/core/app-configuration/config-loader.d.ts +2 -0
- package/dist/core/app-configuration/config-loader.js +22 -0
- package/dist/core/app-configuration/config-loader.js.map +1 -0
- package/dist/core/app-configuration/index.d.ts +35 -0
- package/dist/core/app-configuration/index.js +54 -0
- package/dist/core/app-configuration/index.js.map +1 -0
- package/dist/core/app-configuration/load-config-file.d.ts +1 -0
- package/dist/core/app-configuration/load-config-file.js +49 -0
- package/dist/core/app-configuration/load-config-file.js.map +1 -0
- package/dist/core/bootstrap.d.ts +4 -0
- package/dist/core/bootstrap.js +27 -0
- package/dist/core/bootstrap.js.map +1 -0
- package/dist/core/domain/content-type/index.d.ts +8 -0
- package/dist/core/domain/content-type/index.js +117 -0
- package/dist/core/domain/content-type/index.js.map +1 -0
- package/dist/core/domain/content-type/validator.d.ts +21 -0
- package/dist/core/domain/content-type/validator.js +91 -0
- package/dist/core/domain/content-type/validator.js.map +1 -0
- package/dist/core/domain/module/index.d.ts +38 -0
- package/dist/core/domain/module/index.js +110 -0
- package/dist/core/domain/module/index.js.map +1 -0
- package/dist/core/domain/module/validation.d.ts +13 -0
- package/dist/core/domain/module/validation.js +29 -0
- package/dist/core/domain/module/validation.js.map +1 -0
- package/dist/core/loaders/admin.d.ts +2 -0
- package/dist/core/loaders/admin.js +18 -0
- package/dist/core/loaders/admin.js.map +1 -0
- package/dist/core/loaders/apis.d.ts +2 -0
- package/dist/core/loaders/apis.js +156 -0
- package/dist/core/loaders/apis.js.map +1 -0
- package/dist/core/loaders/components.d.ts +6 -0
- package/dist/core/loaders/components.js +37 -0
- package/dist/core/loaders/components.js.map +1 -0
- package/dist/core/loaders/index.d.ts +18 -0
- package/dist/core/loaders/index.js +26 -0
- package/dist/core/loaders/index.js.map +1 -0
- package/dist/core/loaders/middlewares.d.ts +2 -0
- package/dist/core/loaders/middlewares.js +34 -0
- package/dist/core/loaders/middlewares.js.map +1 -0
- package/dist/core/loaders/plugins/get-enabled-plugins.d.ts +4 -0
- package/dist/core/loaders/plugins/get-enabled-plugins.js +113 -0
- package/dist/core/loaders/plugins/get-enabled-plugins.js.map +1 -0
- package/dist/core/loaders/plugins/get-user-plugins-config.d.ts +6 -0
- package/dist/core/loaders/plugins/get-user-plugins-config.js +31 -0
- package/dist/core/loaders/plugins/get-user-plugins-config.js.map +1 -0
- package/dist/core/loaders/plugins/index.d.ts +2 -0
- package/dist/core/loaders/plugins/index.js +109 -0
- package/dist/core/loaders/plugins/index.js.map +1 -0
- package/dist/core/loaders/policies.d.ts +2 -0
- package/dist/core/loaders/policies.js +28 -0
- package/dist/core/loaders/policies.js.map +1 -0
- package/dist/core/loaders/sanitizers.d.ts +3 -0
- package/dist/core/loaders/sanitizers.js +6 -0
- package/dist/core/loaders/sanitizers.js.map +1 -0
- package/dist/core/loaders/src-index.d.ts +3 -0
- package/dist/core/loaders/src-index.js +37 -0
- package/dist/core/loaders/src-index.js.map +1 -0
- package/dist/core/loaders/validators.d.ts +3 -0
- package/dist/core/loaders/validators.js +6 -0
- package/dist/core/loaders/validators.js.map +1 -0
- package/dist/core/registries/apis.d.ts +7 -0
- package/dist/core/registries/apis.js +24 -0
- package/dist/core/registries/apis.js.map +1 -0
- package/dist/core/registries/config.d.ts +3 -0
- package/dist/core/registries/config.js +23 -0
- package/dist/core/registries/config.js.map +1 -0
- package/dist/core/registries/content-types.d.ts +32 -0
- package/dist/core/registries/content-types.js +70 -0
- package/dist/core/registries/content-types.js.map +1 -0
- package/dist/core/registries/controllers.d.ts +34 -0
- package/dist/core/registries/controllers.js +81 -0
- package/dist/core/registries/controllers.js.map +1 -0
- package/dist/core/registries/custom-fields.d.ts +7 -0
- package/dist/core/registries/custom-fields.js +74 -0
- package/dist/core/registries/custom-fields.js.map +1 -0
- package/dist/core/registries/hooks.d.ts +43 -0
- package/dist/core/registries/hooks.js +59 -0
- package/dist/core/registries/hooks.js.map +1 -0
- package/dist/core/registries/middlewares.d.ts +30 -0
- package/dist/core/registries/middlewares.js +62 -0
- package/dist/core/registries/middlewares.js.map +1 -0
- package/dist/core/registries/modules.d.ts +14 -0
- package/dist/core/registries/modules.js +40 -0
- package/dist/core/registries/modules.js.map +1 -0
- package/dist/core/registries/plugins.d.ts +8 -0
- package/dist/core/registries/plugins.js +24 -0
- package/dist/core/registries/plugins.js.map +1 -0
- package/dist/core/registries/policies.d.ts +33 -0
- package/dist/core/registries/policies.js +64 -0
- package/dist/core/registries/policies.js.map +1 -0
- package/dist/core/registries/sanitizers.d.ts +9 -0
- package/dist/core/registries/sanitizers.js +27 -0
- package/dist/core/registries/sanitizers.js.map +1 -0
- package/dist/core/registries/services.d.ts +34 -0
- package/dist/core/registries/services.js +82 -0
- package/dist/core/registries/services.js.map +1 -0
- package/dist/core/registries/validators.d.ts +9 -0
- package/dist/core/registries/validators.js +27 -0
- package/dist/core/registries/validators.js.map +1 -0
- package/dist/core/utils.d.ts +4 -0
- package/dist/core/utils.js +28 -0
- package/dist/core/utils.js.map +1 -0
- package/dist/core-api/controller/collection-type.d.ts +10 -0
- package/dist/core-api/controller/collection-type.js +95 -0
- package/dist/core-api/controller/collection-type.js.map +1 -0
- package/dist/core-api/controller/index.d.ts +5 -0
- package/dist/core-api/controller/index.js +50 -0
- package/dist/core-api/controller/index.js.map +1 -0
- package/dist/core-api/controller/single-type.d.ts +9 -0
- package/dist/core-api/controller/single-type.js +52 -0
- package/dist/core-api/controller/single-type.js.map +1 -0
- package/dist/core-api/controller/transform.d.ts +21 -0
- package/dist/core-api/controller/transform.js +86 -0
- package/dist/core-api/controller/transform.js.map +1 -0
- package/dist/core-api/routes/index.d.ts +23 -0
- package/dist/core-api/routes/index.js +68 -0
- package/dist/core-api/routes/index.js.map +1 -0
- package/dist/core-api/service/collection-type.d.ts +9 -0
- package/dist/core-api/service/collection-type.js +61 -0
- package/dist/core-api/service/collection-type.js.map +1 -0
- package/dist/core-api/service/get-fetch-params.d.ts +6 -0
- package/dist/core-api/service/get-fetch-params.js +16 -0
- package/dist/core-api/service/get-fetch-params.js.map +1 -0
- package/dist/core-api/service/index.d.ts +8 -0
- package/dist/core-api/service/index.js +18 -0
- package/dist/core-api/service/index.js.map +1 -0
- package/dist/core-api/service/pagination.d.ts +40 -0
- package/dist/core-api/service/pagination.js +97 -0
- package/dist/core-api/service/pagination.js.map +1 -0
- package/dist/core-api/service/single-type.d.ts +8 -0
- package/dist/core-api/service/single-type.js +57 -0
- package/dist/core-api/service/single-type.js.map +1 -0
- package/dist/ee/index.d.ts +19 -0
- package/dist/ee/index.js +185 -0
- package/dist/ee/index.js.map +1 -0
- package/dist/ee/license.d.ts +20 -0
- package/dist/ee/license.js +94 -0
- package/dist/ee/license.js.map +1 -0
- package/dist/factories.d.ts +12 -0
- package/dist/factories.js +70 -0
- package/dist/factories.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +35 -0
- package/dist/index.js.map +1 -0
- package/dist/load/filepath-to-prop-path.d.ts +5 -0
- package/dist/load/filepath-to-prop-path.js +21 -0
- package/dist/load/filepath-to-prop-path.js.map +1 -0
- package/dist/load/glob.d.ts +6 -0
- package/dist/load/glob.js +20 -0
- package/dist/load/glob.js.map +1 -0
- package/dist/load/index.d.ts +2 -0
- package/dist/load/index.js +11 -0
- package/dist/load/index.js.map +1 -0
- package/dist/load/load-files.d.ts +9 -0
- package/dist/load/load-files.js +44 -0
- package/dist/load/load-files.js.map +1 -0
- package/dist/load/package-path.d.ts +5 -0
- package/dist/load/package-path.js +11 -0
- package/dist/load/package-path.js.map +1 -0
- package/dist/middlewares/body.d.ts +5 -0
- package/dist/middlewares/body.js +78 -0
- package/dist/middlewares/body.js.map +1 -0
- package/dist/middlewares/compression.d.ts +4 -0
- package/dist/middlewares/compression.js +10 -0
- package/dist/middlewares/compression.js.map +1 -0
- package/dist/middlewares/cors.d.ts +12 -0
- package/dist/middlewares/cors.js +54 -0
- package/dist/middlewares/cors.js.map +1 -0
- package/dist/middlewares/errors.d.ts +3 -0
- package/dist/middlewares/errors.js +35 -0
- package/dist/middlewares/errors.js.map +1 -0
- package/dist/middlewares/favicon.d.ts +4 -0
- package/dist/middlewares/favicon.js +30 -0
- package/dist/middlewares/favicon.js.map +1 -0
- package/dist/middlewares/index.d.ts +2 -0
- package/dist/middlewares/index.js +34 -0
- package/dist/middlewares/index.js.map +1 -0
- package/dist/middlewares/ip.d.ts +4 -0
- package/dist/middlewares/ip.js +10 -0
- package/dist/middlewares/ip.js.map +1 -0
- package/dist/middlewares/logger.d.ts +2 -0
- package/dist/middlewares/logger.js +13 -0
- package/dist/middlewares/logger.js.map +1 -0
- package/dist/middlewares/powered-by.d.ts +5 -0
- package/dist/middlewares/powered-by.js +15 -0
- package/dist/middlewares/powered-by.js.map +1 -0
- package/dist/middlewares/public/index.d.ts +2 -0
- package/dist/middlewares/public/index.js +112 -0
- package/dist/middlewares/public/index.js.map +1 -0
- package/dist/middlewares/public/serve-static.d.ts +3 -0
- package/dist/middlewares/public/serve-static.js +27 -0
- package/dist/middlewares/public/serve-static.js.map +1 -0
- package/dist/middlewares/query.d.ts +2 -0
- package/dist/middlewares/query.js +45 -0
- package/dist/middlewares/query.js.map +1 -0
- package/dist/middlewares/response-time.d.ts +2 -0
- package/dist/middlewares/response-time.js +13 -0
- package/dist/middlewares/response-time.js.map +1 -0
- package/dist/middlewares/responses.d.ts +5 -0
- package/dist/middlewares/responses.js +16 -0
- package/dist/middlewares/responses.js.map +1 -0
- package/dist/middlewares/security.d.ts +4 -0
- package/dist/middlewares/security.js +52 -0
- package/dist/middlewares/security.js.map +1 -0
- package/dist/middlewares/session.d.ts +3 -0
- package/dist/middlewares/session.js +30 -0
- package/dist/middlewares/session.js.map +1 -0
- package/dist/migrations/draft-publish.d.ts +8 -0
- package/dist/migrations/draft-publish.js +46 -0
- package/dist/migrations/draft-publish.js.map +1 -0
- package/dist/services/auth/index.d.ts +25 -0
- package/dist/services/auth/index.js +84 -0
- package/dist/services/auth/index.js.map +1 -0
- package/dist/services/content-api/index.d.ts +53 -0
- package/dist/services/content-api/index.js +62 -0
- package/dist/services/content-api/index.js.map +1 -0
- package/dist/services/content-api/permissions/engine.d.ts +4 -0
- package/dist/services/content-api/permissions/engine.js +8 -0
- package/dist/services/content-api/permissions/engine.js.map +1 -0
- package/dist/services/content-api/permissions/index.d.ts +51 -0
- package/dist/services/content-api/permissions/index.js +110 -0
- package/dist/services/content-api/permissions/index.js.map +1 -0
- package/dist/services/content-api/permissions/providers/action.d.ts +19 -0
- package/dist/services/content-api/permissions/providers/action.js +16 -0
- package/dist/services/content-api/permissions/providers/action.js.map +1 -0
- package/dist/services/content-api/permissions/providers/condition.d.ts +23 -0
- package/dist/services/content-api/permissions/providers/condition.js +16 -0
- package/dist/services/content-api/permissions/providers/condition.js.map +1 -0
- package/dist/services/content-api/permissions/providers/index.d.ts +2 -0
- package/dist/services/content-api/permissions/providers/index.js +11 -0
- package/dist/services/content-api/permissions/providers/index.js.map +1 -0
- package/dist/services/core-store.d.ts +52 -0
- package/dist/services/core-store.js +123 -0
- package/dist/services/core-store.js.map +1 -0
- package/dist/services/cron.d.ts +26 -0
- package/dist/services/cron.js +69 -0
- package/dist/services/cron.js.map +1 -0
- package/dist/services/custom-fields.d.ts +3 -0
- package/dist/services/custom-fields.js +11 -0
- package/dist/services/custom-fields.js.map +1 -0
- package/dist/services/entity-service/attributes/index.d.ts +5 -0
- package/dist/services/entity-service/attributes/index.js +26 -0
- package/dist/services/entity-service/attributes/index.js.map +1 -0
- package/dist/services/entity-service/attributes/transforms.d.ts +9 -0
- package/dist/services/entity-service/attributes/transforms.js +22 -0
- package/dist/services/entity-service/attributes/transforms.js.map +1 -0
- package/dist/services/entity-service/components.d.ts +22 -0
- package/dist/services/entity-service/components.js +381 -0
- package/dist/services/entity-service/components.js.map +1 -0
- package/dist/services/entity-service/index.d.ts +14 -0
- package/dist/services/entity-service/index.js +311 -0
- package/dist/services/entity-service/index.js.map +1 -0
- package/dist/services/entity-service/params.d.ts +7 -0
- package/dist/services/entity-service/params.js +9 -0
- package/dist/services/entity-service/params.js.map +1 -0
- package/dist/services/entity-validator/blocks-validator.d.ts +2 -0
- package/dist/services/entity-validator/blocks-validator.js +127 -0
- package/dist/services/entity-validator/blocks-validator.js.map +1 -0
- package/dist/services/entity-validator/index.d.ts +7 -0
- package/dist/services/entity-validator/index.js +332 -0
- package/dist/services/entity-validator/index.js.map +1 -0
- package/dist/services/entity-validator/validators.d.ts +36 -0
- package/dist/services/entity-validator/validators.js +149 -0
- package/dist/services/entity-validator/validators.js.map +1 -0
- package/dist/services/errors.d.ts +39 -0
- package/dist/services/errors.js +78 -0
- package/dist/services/errors.js.map +1 -0
- package/dist/services/event-hub.d.ts +18 -0
- package/dist/services/event-hub.js +77 -0
- package/dist/services/event-hub.js.map +1 -0
- package/dist/services/fs.d.ts +12 -0
- package/dist/services/fs.js +54 -0
- package/dist/services/fs.js.map +1 -0
- package/dist/services/metrics/admin-user-hash.d.ts +6 -0
- package/dist/services/metrics/admin-user-hash.js +19 -0
- package/dist/services/metrics/admin-user-hash.js.map +1 -0
- package/dist/services/metrics/index.d.ts +13 -0
- package/dist/services/metrics/index.js +53 -0
- package/dist/services/metrics/index.js.map +1 -0
- package/dist/services/metrics/is-truthy.d.ts +2 -0
- package/dist/services/metrics/is-truthy.js +11 -0
- package/dist/services/metrics/is-truthy.js.map +1 -0
- package/dist/services/metrics/middleware.d.ts +6 -0
- package/dist/services/metrics/middleware.js +28 -0
- package/dist/services/metrics/middleware.js.map +1 -0
- package/dist/services/metrics/rate-limiter.d.ts +6 -0
- package/dist/services/metrics/rate-limiter.js +21 -0
- package/dist/services/metrics/rate-limiter.js.map +1 -0
- package/dist/services/metrics/sender.d.ts +12 -0
- package/dist/services/metrics/sender.js +80 -0
- package/dist/services/metrics/sender.js.map +1 -0
- package/dist/services/request-context.d.ts +6 -0
- package/dist/services/request-context.js +14 -0
- package/dist/services/request-context.js.map +1 -0
- package/dist/services/server/admin-api.d.ts +10 -0
- package/dist/services/server/admin-api.js +13 -0
- package/dist/services/server/admin-api.js.map +1 -0
- package/dist/services/server/api.d.ts +14 -0
- package/dist/services/server/api.js +32 -0
- package/dist/services/server/api.js.map +1 -0
- package/dist/services/server/compose-endpoint.d.ts +6 -0
- package/dist/services/server/compose-endpoint.js +121 -0
- package/dist/services/server/compose-endpoint.js.map +1 -0
- package/dist/services/server/content-api.d.ts +10 -0
- package/dist/services/server/content-api.js +13 -0
- package/dist/services/server/content-api.js.map +1 -0
- package/dist/services/server/http-server.d.ts +9 -0
- package/dist/services/server/http-server.js +54 -0
- package/dist/services/server/http-server.js.map +1 -0
- package/dist/services/server/index.d.ts +3 -0
- package/dist/services/server/index.js +91 -0
- package/dist/services/server/index.js.map +1 -0
- package/dist/services/server/koa.d.ts +15 -0
- package/dist/services/server/koa.js +56 -0
- package/dist/services/server/koa.js.map +1 -0
- package/dist/services/server/middleware.d.ts +14 -0
- package/dist/services/server/middleware.js +103 -0
- package/dist/services/server/middleware.js.map +1 -0
- package/dist/services/server/policy.d.ts +3 -0
- package/dist/services/server/policy.js +21 -0
- package/dist/services/server/policy.js.map +1 -0
- package/dist/services/server/register-middlewares.d.ts +6 -0
- package/dist/services/server/register-middlewares.js +82 -0
- package/dist/services/server/register-middlewares.js.map +1 -0
- package/dist/services/server/register-routes.d.ts +6 -0
- package/dist/services/server/register-routes.js +94 -0
- package/dist/services/server/register-routes.js.map +1 -0
- package/dist/services/server/routing.d.ts +32 -0
- package/dist/services/server/routing.js +105 -0
- package/dist/services/server/routing.js.map +1 -0
- package/dist/services/utils/dynamic-zones.d.ts +2 -0
- package/dist/services/utils/dynamic-zones.js +13 -0
- package/dist/services/utils/dynamic-zones.js.map +1 -0
- package/dist/services/utils/upload-files.d.ts +7 -0
- package/dist/services/utils/upload-files.js +74 -0
- package/dist/services/utils/upload-files.js.map +1 -0
- package/dist/services/webhook-runner.d.ts +48 -0
- package/dist/services/webhook-runner.js +141 -0
- package/dist/services/webhook-runner.js.map +1 -0
- package/dist/services/webhook-store.d.ts +49 -0
- package/dist/services/webhook-store.js +106 -0
- package/dist/services/webhook-store.js.map +1 -0
- package/dist/services/worker-queue.d.ts +19 -0
- package/dist/services/worker-queue.js +64 -0
- package/dist/services/worker-queue.js.map +1 -0
- package/dist/utils/addSlash.d.ts +2 -0
- package/dist/utils/addSlash.js +15 -0
- package/dist/utils/addSlash.js.map +1 -0
- package/dist/utils/convert-custom-field-type.d.ts +3 -0
- package/dist/utils/convert-custom-field-type.js +20 -0
- package/dist/utils/convert-custom-field-type.js.map +1 -0
- package/dist/utils/cron.d.ts +7 -0
- package/dist/utils/cron.js +56 -0
- package/dist/utils/cron.js.map +1 -0
- package/dist/utils/ee.d.ts +2 -0
- package/dist/utils/ee.js +8 -0
- package/dist/utils/ee.js.map +1 -0
- package/dist/utils/fetch.d.ts +8 -0
- package/dist/utils/fetch.js +23 -0
- package/dist/utils/fetch.js.map +1 -0
- package/dist/utils/get-dirs.d.ts +9 -0
- package/dist/utils/get-dirs.js +30 -0
- package/dist/utils/get-dirs.js.map +1 -0
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/index.js +13 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/is-initialized.d.ts +5 -0
- package/dist/utils/is-initialized.js +21 -0
- package/dist/utils/is-initialized.js.map +1 -0
- package/dist/utils/lifecycles.d.ts +5 -0
- package/dist/utils/lifecycles.js +9 -0
- package/dist/utils/lifecycles.js.map +1 -0
- package/dist/utils/machine-id.d.ts +2 -0
- package/dist/utils/machine-id.js +15 -0
- package/dist/utils/machine-id.js.map +1 -0
- package/dist/utils/open-browser.d.ts +4 -0
- package/dist/utils/open-browser.js +13 -0
- package/dist/utils/open-browser.js.map +1 -0
- package/dist/utils/postinstall.d.ts +1 -0
- package/dist/utils/postinstall.js +32 -0
- package/dist/utils/postinstall.js.map +1 -0
- package/dist/utils/signals.d.ts +2 -0
- package/dist/utils/signals.js +20 -0
- package/dist/utils/signals.js.map +1 -0
- package/dist/utils/startup-logger.d.ts +10 -0
- package/dist/utils/startup-logger.js +68 -0
- package/dist/utils/startup-logger.js.map +1 -0
- package/dist/utils/update-notifier/index.d.ts +8 -0
- package/dist/utils/update-notifier/index.js +85 -0
- package/dist/utils/update-notifier/index.js.map +1 -0
- package/index.js +5 -0
- package/package.json +57 -25
- package/scripts/postinstall.js +7 -0
- package/.eslintignore +0 -2
- package/.eslintrc.js +0 -4
- package/ee/LICENSE.txt +0 -1
- package/ee/index.js +0 -213
- package/ee/license.js +0 -109
- package/lib/Strapi.js +0 -591
- package/lib/commands/actions/admin/create-user/action.js +0 -113
- package/lib/commands/actions/admin/create-user/command.js +0 -19
- package/lib/commands/actions/admin/reset-user-password/action.js +0 -52
- package/lib/commands/actions/admin/reset-user-password/command.js +0 -17
- package/lib/commands/actions/build-command/action.js +0 -18
- package/lib/commands/actions/build-command/command.js +0 -15
- package/lib/commands/actions/components/list/action.js +0 -23
- package/lib/commands/actions/components/list/command.js +0 -14
- package/lib/commands/actions/configuration/dump/action.js +0 -51
- package/lib/commands/actions/configuration/dump/command.js +0 -17
- package/lib/commands/actions/configuration/restore/action.js +0 -172
- package/lib/commands/actions/configuration/restore/command.js +0 -17
- package/lib/commands/actions/console/action.js +0 -27
- package/lib/commands/actions/console/command.js +0 -14
- package/lib/commands/actions/content-types/list/action.js +0 -23
- package/lib/commands/actions/content-types/list/command.js +0 -14
- package/lib/commands/actions/controllers/list/action.js +0 -23
- package/lib/commands/actions/controllers/list/command.js +0 -14
- package/lib/commands/actions/develop/action.js +0 -217
- package/lib/commands/actions/develop/command.js +0 -19
- package/lib/commands/actions/export/action.js +0 -184
- package/lib/commands/actions/export/command.js +0 -45
- package/lib/commands/actions/generate/command.js +0 -18
- package/lib/commands/actions/hooks/list/action.js +0 -23
- package/lib/commands/actions/hooks/list/command.js +0 -14
- package/lib/commands/actions/import/action.js +0 -181
- package/lib/commands/actions/import/command.js +0 -97
- package/lib/commands/actions/install/action.js +0 -48
- package/lib/commands/actions/install/command.js +0 -14
- package/lib/commands/actions/middlewares/list/action.js +0 -23
- package/lib/commands/actions/middlewares/list/command.js +0 -14
- package/lib/commands/actions/new/action.js +0 -13
- package/lib/commands/actions/new/command.js +0 -35
- package/lib/commands/actions/plugin/build-command/action.js +0 -137
- package/lib/commands/actions/plugin/build-command/command.js +0 -17
- package/lib/commands/actions/policies/list/action.js +0 -23
- package/lib/commands/actions/policies/list/command.js +0 -14
- package/lib/commands/actions/report/action.js +0 -35
- package/lib/commands/actions/report/command.js +0 -17
- package/lib/commands/actions/routes/list/action.js +0 -29
- package/lib/commands/actions/routes/list/command.js +0 -14
- package/lib/commands/actions/services/list/action.js +0 -23
- package/lib/commands/actions/services/list/command.js +0 -14
- package/lib/commands/actions/start/action.js +0 -25
- package/lib/commands/actions/start/command.js +0 -14
- package/lib/commands/actions/telemetry/disable/action.js +0 -88
- package/lib/commands/actions/telemetry/disable/command.js +0 -14
- package/lib/commands/actions/telemetry/enable/action.js +0 -104
- package/lib/commands/actions/telemetry/enable/command.js +0 -14
- package/lib/commands/actions/templates/generate/action.js +0 -96
- package/lib/commands/actions/templates/generate/command.js +0 -14
- package/lib/commands/actions/transfer/action.js +0 -200
- package/lib/commands/actions/transfer/command.js +0 -115
- package/lib/commands/actions/ts/generate-types/action.js +0 -29
- package/lib/commands/actions/ts/generate-types/command.js +0 -21
- package/lib/commands/actions/uninstall/action.js +0 -68
- package/lib/commands/actions/uninstall/command.js +0 -15
- package/lib/commands/actions/version/command.js +0 -19
- package/lib/commands/actions/watch-admin/action.js +0 -40
- package/lib/commands/actions/watch-admin/command.js +0 -15
- package/lib/commands/builders/admin.js +0 -57
- package/lib/commands/builders/index.js +0 -9
- package/lib/commands/builders/packages.js +0 -252
- package/lib/commands/builders/tasks/dts.js +0 -199
- package/lib/commands/builders/tasks/index.js +0 -29
- package/lib/commands/builders/tasks/vite.js +0 -144
- package/lib/commands/builders/typescript.js +0 -32
- package/lib/commands/index.js +0 -68
- package/lib/commands/utils/commander.js +0 -157
- package/lib/commands/utils/data-transfer.js +0 -427
- package/lib/commands/utils/helpers.js +0 -218
- package/lib/commands/utils/logger.js +0 -97
- package/lib/commands/utils/pkg.js +0 -421
- package/lib/compile.js +0 -20
- package/lib/container.js +0 -45
- package/lib/core/app-configuration/config-loader.js +0 -22
- package/lib/core/app-configuration/index.js +0 -61
- package/lib/core/app-configuration/load-config-file.js +0 -43
- package/lib/core/bootstrap.js +0 -33
- package/lib/core/domain/component/index.js +0 -24
- package/lib/core/domain/component/validator.js +0 -23
- package/lib/core/domain/content-type/index.js +0 -134
- package/lib/core/domain/content-type/validator.js +0 -105
- package/lib/core/domain/module/index.js +0 -108
- package/lib/core/domain/module/validation.js +0 -32
- package/lib/core/loaders/admin.js +0 -16
- package/lib/core/loaders/apis.js +0 -161
- package/lib/core/loaders/components.js +0 -42
- package/lib/core/loaders/index.js +0 -13
- package/lib/core/loaders/middlewares.js +0 -37
- package/lib/core/loaders/plugins/get-enabled-plugins.js +0 -151
- package/lib/core/loaders/plugins/get-user-plugins-config.js +0 -37
- package/lib/core/loaders/plugins/index.js +0 -121
- package/lib/core/loaders/policies.js +0 -29
- package/lib/core/loaders/sanitizers.js +0 -5
- package/lib/core/loaders/src-index.js +0 -39
- package/lib/core/loaders/validators.js +0 -5
- package/lib/core/registries/apis.js +0 -29
- package/lib/core/registries/config.js +0 -21
- package/lib/core/registries/content-types.js +0 -97
- package/lib/core/registries/controllers.d.ts +0 -7
- package/lib/core/registries/controllers.js +0 -114
- package/lib/core/registries/custom-fields.js +0 -89
- package/lib/core/registries/hooks.d.ts +0 -17
- package/lib/core/registries/hooks.js +0 -87
- package/lib/core/registries/middlewares.d.ts +0 -5
- package/lib/core/registries/middlewares.js +0 -89
- package/lib/core/registries/modules.js +0 -44
- package/lib/core/registries/plugins.js +0 -28
- package/lib/core/registries/policies.d.ts +0 -13
- package/lib/core/registries/policies.js +0 -89
- package/lib/core/registries/sanitizers.js +0 -26
- package/lib/core/registries/services.js +0 -114
- package/lib/core/registries/validators.js +0 -26
- package/lib/core/utils.js +0 -32
- package/lib/core-api/controller/collection-type.js +0 -115
- package/lib/core-api/controller/index.js +0 -63
- package/lib/core-api/controller/single-type.js +0 -65
- package/lib/core-api/controller/transform.js +0 -97
- package/lib/core-api/routes/index.js +0 -71
- package/lib/core-api/service/collection-type.js +0 -80
- package/lib/core-api/service/index.js +0 -45
- package/lib/core-api/service/pagination.js +0 -125
- package/lib/core-api/service/single-type.js +0 -72
- package/lib/factories.d.ts +0 -18
- package/lib/factories.js +0 -93
- package/lib/global.d.ts +0 -22
- package/lib/index.d.ts +0 -6
- package/lib/index.js +0 -8
- package/lib/load/filepath-to-prop-path.js +0 -22
- package/lib/load/glob.js +0 -15
- package/lib/load/index.js +0 -9
- package/lib/load/load-files.js +0 -58
- package/lib/load/package-path.js +0 -9
- package/lib/middlewares/body.js +0 -82
- package/lib/middlewares/compression.js +0 -8
- package/lib/middlewares/cors.js +0 -59
- package/lib/middlewares/errors.js +0 -40
- package/lib/middlewares/favicon.js +0 -32
- package/lib/middlewares/index.d.ts +0 -5
- package/lib/middlewares/index.js +0 -33
- package/lib/middlewares/ip.js +0 -8
- package/lib/middlewares/logger.js +0 -14
- package/lib/middlewares/powered-by.js +0 -20
- package/lib/middlewares/public/index.js +0 -94
- package/lib/middlewares/public/serve-static.js +0 -23
- package/lib/middlewares/query.js +0 -52
- package/lib/middlewares/response-time.js +0 -15
- package/lib/middlewares/responses.js +0 -19
- package/lib/middlewares/security.js +0 -57
- package/lib/middlewares/session.js +0 -30
- package/lib/migrations/draft-publish.js +0 -53
- package/lib/services/auth/index.js +0 -109
- package/lib/services/content-api/index.js +0 -74
- package/lib/services/content-api/permissions/engine.js +0 -5
- package/lib/services/content-api/permissions/index.js +0 -148
- package/lib/services/content-api/permissions/providers/action.js +0 -19
- package/lib/services/content-api/permissions/providers/condition.js +0 -19
- package/lib/services/content-api/permissions/providers/index.js +0 -9
- package/lib/services/core-store.js +0 -145
- package/lib/services/cron.js +0 -71
- package/lib/services/custom-fields.js +0 -11
- package/lib/services/entity-service/attributes/index.js +0 -31
- package/lib/services/entity-service/attributes/transforms.js +0 -20
- package/lib/services/entity-service/components.js +0 -497
- package/lib/services/entity-service/index.d.ts +0 -1
- package/lib/services/entity-service/index.js +0 -434
- package/lib/services/entity-service/params.js +0 -9
- package/lib/services/entity-service/types/index.d.ts +0 -228
- package/lib/services/entity-service/types/params/attributes.d.ts +0 -146
- package/lib/services/entity-service/types/params/data.d.ts +0 -4
- package/lib/services/entity-service/types/params/fields.d.ts +0 -74
- package/lib/services/entity-service/types/params/filters/index.d.ts +0 -90
- package/lib/services/entity-service/types/params/filters/operators.d.ts +0 -30
- package/lib/services/entity-service/types/params/index.d.ts +0 -79
- package/lib/services/entity-service/types/params/pagination.d.ts +0 -13
- package/lib/services/entity-service/types/params/populate.d.ts +0 -130
- package/lib/services/entity-service/types/params/publication-state.d.ts +0 -38
- package/lib/services/entity-service/types/params/search.d.ts +0 -1
- package/lib/services/entity-service/types/params/sort.d.ts +0 -106
- package/lib/services/entity-service/types/plugin.d.ts +0 -11
- package/lib/services/entity-service/types/result.d.ts +0 -205
- package/lib/services/entity-validator/index.js +0 -382
- package/lib/services/entity-validator/validators.js +0 -216
- package/lib/services/errors.js +0 -87
- package/lib/services/event-hub.js +0 -83
- package/lib/services/fs.js +0 -58
- package/lib/services/metrics/admin-user-hash.js +0 -21
- package/lib/services/metrics/index.js +0 -61
- package/lib/services/metrics/is-truthy.js +0 -9
- package/lib/services/metrics/middleware.js +0 -33
- package/lib/services/metrics/rate-limiter.js +0 -27
- package/lib/services/metrics/sender.js +0 -90
- package/lib/services/metrics/stringify-deep.js +0 -22
- package/lib/services/request-context.js +0 -17
- package/lib/services/server/admin-api.js +0 -14
- package/lib/services/server/api.js +0 -36
- package/lib/services/server/compose-endpoint.js +0 -141
- package/lib/services/server/content-api.js +0 -16
- package/lib/services/server/http-server.js +0 -64
- package/lib/services/server/index.js +0 -129
- package/lib/services/server/koa.js +0 -62
- package/lib/services/server/middleware.js +0 -132
- package/lib/services/server/policy.js +0 -32
- package/lib/services/server/register-middlewares.js +0 -109
- package/lib/services/server/register-routes.js +0 -105
- package/lib/services/server/routing.js +0 -105
- package/lib/services/utils/dynamic-zones.js +0 -13
- package/lib/services/utils/upload-files.js +0 -79
- package/lib/services/webhook-runner.js +0 -156
- package/lib/services/webhook-store.js +0 -120
- package/lib/services/worker-queue.js +0 -59
- package/lib/types/core/attributes/base.d.ts +0 -77
- package/lib/types/core/attributes/biginteger.d.ts +0 -15
- package/lib/types/core/attributes/boolean.d.ts +0 -14
- package/lib/types/core/attributes/common.d.ts +0 -77
- package/lib/types/core/attributes/component.d.ts +0 -36
- package/lib/types/core/attributes/date-time.d.ts +0 -16
- package/lib/types/core/attributes/date.d.ts +0 -13
- package/lib/types/core/attributes/decimal.d.ts +0 -15
- package/lib/types/core/attributes/dynamic-zone.d.ts +0 -29
- package/lib/types/core/attributes/email.d.ts +0 -14
- package/lib/types/core/attributes/enumeration.d.ts +0 -18
- package/lib/types/core/attributes/float.d.ts +0 -13
- package/lib/types/core/attributes/index.d.ts +0 -26
- package/lib/types/core/attributes/integer.d.ts +0 -15
- package/lib/types/core/attributes/json.d.ts +0 -11
- package/lib/types/core/attributes/media.d.ts +0 -42
- package/lib/types/core/attributes/password.d.ts +0 -15
- package/lib/types/core/attributes/relation.d.ts +0 -152
- package/lib/types/core/attributes/richtext.d.ts +0 -15
- package/lib/types/core/attributes/string.d.ts +0 -20
- package/lib/types/core/attributes/text.d.ts +0 -20
- package/lib/types/core/attributes/time.d.ts +0 -13
- package/lib/types/core/attributes/timestamp.d.ts +0 -15
- package/lib/types/core/attributes/uid.d.ts +0 -43
- package/lib/types/core/attributes/utils.d.ts +0 -143
- package/lib/types/core/commands/index.d.ts +0 -6
- package/lib/types/core/common/controller.d.ts +0 -8
- package/lib/types/core/common/index.d.ts +0 -16
- package/lib/types/core/common/schema.d.ts +0 -3
- package/lib/types/core/common/service.d.ts +0 -5
- package/lib/types/core/common/uid.d.ts +0 -58
- package/lib/types/core/index.d.ts +0 -9
- package/lib/types/core/namespace.d.ts +0 -99
- package/lib/types/core/plugins/index.d.ts +0 -16
- package/lib/types/core/registry.d.ts +0 -68
- package/lib/types/core/schemas/index.d.ts +0 -133
- package/lib/types/core/strapi/index.d.ts +0 -453
- package/lib/types/core/uid.d.ts +0 -167
- package/lib/types/core-api/controller.d.ts +0 -54
- package/lib/types/core-api/index.d.ts +0 -3
- package/lib/types/core-api/router.d.ts +0 -68
- package/lib/types/core-api/service.d.ts +0 -50
- package/lib/types/index.d.ts +0 -8
- package/lib/types/shared/entity-service.d.ts +0 -1
- package/lib/types/shared/index.d.ts +0 -3
- package/lib/types/shared/plugins.d.ts +0 -3
- package/lib/types/shared/registries.d.ts +0 -45
- package/lib/types/utils/array.d.ts +0 -25
- package/lib/types/utils/expression.d.ts +0 -91
- package/lib/types/utils/guard.d.ts +0 -27
- package/lib/types/utils/index.d.ts +0 -27
- package/lib/types/utils/object.d.ts +0 -63
- package/lib/types/utils/string.d.ts +0 -59
- package/lib/types/utils/tuple.d.ts +0 -13
- package/lib/utils/addSlash.js +0 -11
- package/lib/utils/convert-custom-field-type.js +0 -22
- package/lib/utils/cron.js +0 -56
- package/lib/utils/ee.js +0 -3
- package/lib/utils/fetch.js +0 -23
- package/lib/utils/get-dirs.js +0 -31
- package/lib/utils/index.js +0 -11
- package/lib/utils/is-initialized.js +0 -23
- package/lib/utils/lifecycles.js +0 -15
- package/lib/utils/machine-id.js +0 -14
- package/lib/utils/open-browser.js +0 -12
- package/lib/utils/run-checks.js +0 -22
- package/lib/utils/signals.js +0 -24
- package/lib/utils/startup-logger.js +0 -88
- package/lib/utils/success.js +0 -35
- package/lib/utils/update-notifier/index.js +0 -97
- package/lib/utils/url-from-segments.js +0 -12
- /package/{lib → dist}/middlewares/public/assets/images/group_people_1.png +0 -0
- /package/{lib → dist}/middlewares/public/assets/images/group_people_2.png +0 -0
- /package/{lib → dist}/middlewares/public/assets/images/group_people_3.png +0 -0
- /package/{lib → dist}/middlewares/public/assets/images/logo_login.png +0 -0
- /package/{lib → dist}/middlewares/public/index.html +0 -0
- /package/{ee/resources → resources}/key.pub +0 -0
package/lib/core/bootstrap.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const { getConfigUrls } = require('@strapi/utils');
|
|
4
|
-
const fse = require('fs-extra');
|
|
5
|
-
|
|
6
|
-
module.exports = async function ({ strapi }) {
|
|
7
|
-
strapi.config.port = strapi.config.get('server.port') || strapi.config.port;
|
|
8
|
-
strapi.config.host = strapi.config.get('server.host') || strapi.config.host;
|
|
9
|
-
|
|
10
|
-
const { serverUrl, adminUrl, adminPath } = getConfigUrls(strapi.config);
|
|
11
|
-
|
|
12
|
-
strapi.config.server = strapi.config.server || {};
|
|
13
|
-
strapi.config.server.url = serverUrl;
|
|
14
|
-
strapi.config.admin.url = adminUrl;
|
|
15
|
-
strapi.config.admin.path = adminPath;
|
|
16
|
-
|
|
17
|
-
// check if we should serve admin panel
|
|
18
|
-
const shouldServeAdmin = strapi.config.get(
|
|
19
|
-
'admin.serveAdminPanel',
|
|
20
|
-
strapi.config.get('serveAdminPanel')
|
|
21
|
-
);
|
|
22
|
-
|
|
23
|
-
if (!shouldServeAdmin) {
|
|
24
|
-
strapi.config.serveAdminPanel = false;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
// ensure public repository exists
|
|
28
|
-
if (!(await fse.pathExists(strapi.dirs.static.public))) {
|
|
29
|
-
throw new Error(
|
|
30
|
-
`The public folder (${strapi.dirs.static.public}) doesn't exist or is not accessible. Please make sure it exists.`
|
|
31
|
-
);
|
|
32
|
-
}
|
|
33
|
-
};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const { cloneDeep, camelCase } = require('lodash/fp');
|
|
4
|
-
const { validateComponentDefinition } = require('./validator');
|
|
5
|
-
|
|
6
|
-
const createComponent = (definition = {}) => {
|
|
7
|
-
validateComponentDefinition(definition);
|
|
8
|
-
|
|
9
|
-
const createdComponent = cloneDeep(definition);
|
|
10
|
-
const category = camelCase(definition.info.category);
|
|
11
|
-
|
|
12
|
-
const uid = `${category}.${definition.info.singularModelName}`;
|
|
13
|
-
|
|
14
|
-
Object.assign(createdComponent, {
|
|
15
|
-
uid,
|
|
16
|
-
category,
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
return createdComponent;
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
module.exports = {
|
|
23
|
-
createComponent,
|
|
24
|
-
};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const { yup } = require('@strapi/utils');
|
|
4
|
-
|
|
5
|
-
const componentSchemaValidator = () =>
|
|
6
|
-
yup.object().shape({
|
|
7
|
-
info: yup
|
|
8
|
-
.object()
|
|
9
|
-
.shape({
|
|
10
|
-
singularName: yup.string().isCamelCase().required(),
|
|
11
|
-
pluralName: yup.string().isCamelCase().required(),
|
|
12
|
-
displayName: yup.string().required(),
|
|
13
|
-
})
|
|
14
|
-
.required(),
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
const validateComponentDefinition = (data) => {
|
|
18
|
-
return componentSchemaValidator.validateSync(data, { strict: true, abortEarly: false });
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
module.exports = {
|
|
22
|
-
validateComponentDefinition,
|
|
23
|
-
};
|
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const { cloneDeep } = require('lodash/fp');
|
|
4
|
-
const _ = require('lodash');
|
|
5
|
-
const { hasDraftAndPublish } = require('@strapi/utils').contentTypes;
|
|
6
|
-
const {
|
|
7
|
-
CREATED_AT_ATTRIBUTE,
|
|
8
|
-
UPDATED_AT_ATTRIBUTE,
|
|
9
|
-
PUBLISHED_AT_ATTRIBUTE,
|
|
10
|
-
CREATED_BY_ATTRIBUTE,
|
|
11
|
-
UPDATED_BY_ATTRIBUTE,
|
|
12
|
-
} = require('@strapi/utils').contentTypes.constants;
|
|
13
|
-
const { validateContentTypeDefinition } = require('./validator');
|
|
14
|
-
|
|
15
|
-
const createContentType = (uid, definition) => {
|
|
16
|
-
try {
|
|
17
|
-
validateContentTypeDefinition(definition);
|
|
18
|
-
} catch (e) {
|
|
19
|
-
throw new Error(`Content Type Definition is invalid for ${uid}'.\n${e.errors}`);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
const { schema, actions, lifecycles } = cloneDeep(definition);
|
|
23
|
-
|
|
24
|
-
// general info
|
|
25
|
-
Object.assign(schema, {
|
|
26
|
-
kind: schema.kind || 'collectionType',
|
|
27
|
-
__schema__: pickSchema(definition.schema),
|
|
28
|
-
modelType: 'contentType',
|
|
29
|
-
modelName: definition.schema.info.singularName,
|
|
30
|
-
connection: 'default',
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
if (uid.startsWith('api::')) {
|
|
34
|
-
Object.assign(schema, {
|
|
35
|
-
uid,
|
|
36
|
-
apiName: uid.split('::')[1].split('.')[0],
|
|
37
|
-
collectionName: schema.collectionName || schema.info.singularName,
|
|
38
|
-
globalId: getGlobalId(schema, schema.info.singularName),
|
|
39
|
-
});
|
|
40
|
-
} else if (uid.startsWith('plugin::')) {
|
|
41
|
-
const pluginName = uid.split('::')[1].split('.')[0];
|
|
42
|
-
Object.assign(schema, {
|
|
43
|
-
uid,
|
|
44
|
-
plugin: pluginName, // TODO: to be set in load-plugins.js
|
|
45
|
-
collectionName:
|
|
46
|
-
schema.collectionName || `${pluginName}_${schema.info.singularName}`.toLowerCase(),
|
|
47
|
-
globalId: getGlobalId(schema, schema.info.singularName, pluginName),
|
|
48
|
-
});
|
|
49
|
-
} else if (uid.startsWith('admin::')) {
|
|
50
|
-
Object.assign(schema, {
|
|
51
|
-
uid,
|
|
52
|
-
plugin: 'admin',
|
|
53
|
-
globalId: getGlobalId(schema, schema.info.singularName, 'admin'),
|
|
54
|
-
});
|
|
55
|
-
} else {
|
|
56
|
-
throw new Error(
|
|
57
|
-
`Incorrect Content Type UID "${uid}". The UID should start with api::, plugin:: or admin::.`
|
|
58
|
-
);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
// attributes
|
|
62
|
-
Object.assign(schema.attributes, {
|
|
63
|
-
[CREATED_AT_ATTRIBUTE]: {
|
|
64
|
-
type: 'datetime',
|
|
65
|
-
},
|
|
66
|
-
// TODO: handle on edit set to new date
|
|
67
|
-
[UPDATED_AT_ATTRIBUTE]: {
|
|
68
|
-
type: 'datetime',
|
|
69
|
-
},
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
if (hasDraftAndPublish(schema)) {
|
|
73
|
-
schema.attributes[PUBLISHED_AT_ATTRIBUTE] = {
|
|
74
|
-
type: 'datetime',
|
|
75
|
-
configurable: false,
|
|
76
|
-
writable: true,
|
|
77
|
-
visible: false,
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
const isPrivate = !_.get(schema, 'options.populateCreatorFields', false);
|
|
82
|
-
|
|
83
|
-
schema.attributes[CREATED_BY_ATTRIBUTE] = {
|
|
84
|
-
type: 'relation',
|
|
85
|
-
relation: 'oneToOne',
|
|
86
|
-
target: 'admin::user',
|
|
87
|
-
configurable: false,
|
|
88
|
-
writable: false,
|
|
89
|
-
visible: false,
|
|
90
|
-
useJoinTable: false,
|
|
91
|
-
private: isPrivate,
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
schema.attributes[UPDATED_BY_ATTRIBUTE] = {
|
|
95
|
-
type: 'relation',
|
|
96
|
-
relation: 'oneToOne',
|
|
97
|
-
target: 'admin::user',
|
|
98
|
-
configurable: false,
|
|
99
|
-
writable: false,
|
|
100
|
-
visible: false,
|
|
101
|
-
useJoinTable: false,
|
|
102
|
-
private: isPrivate,
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
Object.assign(schema, { actions, lifecycles });
|
|
106
|
-
|
|
107
|
-
return schema;
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
const getGlobalId = (model, modelName, prefix) => {
|
|
111
|
-
const globalId = prefix ? `${prefix}-${modelName}` : modelName;
|
|
112
|
-
|
|
113
|
-
return model.globalId || _.upperFirst(_.camelCase(globalId));
|
|
114
|
-
};
|
|
115
|
-
|
|
116
|
-
const pickSchema = (model) => {
|
|
117
|
-
const schema = _.cloneDeep(
|
|
118
|
-
_.pick(model, [
|
|
119
|
-
'connection',
|
|
120
|
-
'collectionName',
|
|
121
|
-
'info',
|
|
122
|
-
'options',
|
|
123
|
-
'pluginOptions',
|
|
124
|
-
'attributes',
|
|
125
|
-
])
|
|
126
|
-
);
|
|
127
|
-
|
|
128
|
-
schema.kind = model.kind || 'collectionType';
|
|
129
|
-
return schema;
|
|
130
|
-
};
|
|
131
|
-
|
|
132
|
-
module.exports = {
|
|
133
|
-
createContentType,
|
|
134
|
-
};
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const _ = require('lodash');
|
|
4
|
-
const { yup, toRegressedEnumValue } = require('@strapi/utils');
|
|
5
|
-
|
|
6
|
-
const LIFECYCLES = [
|
|
7
|
-
'beforeCreate',
|
|
8
|
-
'afterCreate',
|
|
9
|
-
'beforeFindOne',
|
|
10
|
-
'afterFindOne',
|
|
11
|
-
'beforeFindMany',
|
|
12
|
-
'afterFindMany',
|
|
13
|
-
'beforeCount',
|
|
14
|
-
'afterCount',
|
|
15
|
-
'beforeCreateMany',
|
|
16
|
-
'afterCreateMany',
|
|
17
|
-
'beforeUpdate',
|
|
18
|
-
'afterUpdate',
|
|
19
|
-
'beforeUpdateMany',
|
|
20
|
-
'afterUpdateMany',
|
|
21
|
-
'beforeDelete',
|
|
22
|
-
'afterDelete',
|
|
23
|
-
'beforeDeleteMany',
|
|
24
|
-
'afterDeleteMany',
|
|
25
|
-
];
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* For enumerations the least common denomiator is GraphQL, where
|
|
29
|
-
* values needs to match the secure name regex:
|
|
30
|
-
* GraphQL Spec https://spec.graphql.org/June2018/#sec-Names
|
|
31
|
-
*
|
|
32
|
-
* Therefore we need to make sure our users only use values, which
|
|
33
|
-
* can be returned by GraphQL, by checking the regressed values
|
|
34
|
-
* agains the GraphQL regex.
|
|
35
|
-
*
|
|
36
|
-
* TODO V5: check if we can avoid this coupling by moving this logic
|
|
37
|
-
* into the GraphQL plugin.
|
|
38
|
-
*/
|
|
39
|
-
const GRAPHQL_ENUM_REGEX = /^[_A-Za-z][_0-9A-Za-z]*$/;
|
|
40
|
-
|
|
41
|
-
const lifecyclesShape = _.mapValues(_.keyBy(LIFECYCLES), () => yup.mixed().nullable().isFunction());
|
|
42
|
-
|
|
43
|
-
const contentTypeSchemaValidator = yup.object().shape({
|
|
44
|
-
schema: yup.object().shape({
|
|
45
|
-
info: yup
|
|
46
|
-
.object()
|
|
47
|
-
.shape({
|
|
48
|
-
displayName: yup.string().required(),
|
|
49
|
-
singularName: yup.string().isKebabCase().required(),
|
|
50
|
-
pluralName: yup.string().isKebabCase().required(),
|
|
51
|
-
})
|
|
52
|
-
.required(),
|
|
53
|
-
attributes: yup.object().test({
|
|
54
|
-
name: 'valuesCollide',
|
|
55
|
-
message: 'Some values collide when normalized',
|
|
56
|
-
test(attributes) {
|
|
57
|
-
for (const attrName of Object.keys(attributes)) {
|
|
58
|
-
const attr = attributes[attrName];
|
|
59
|
-
if (attr.type === 'enumeration') {
|
|
60
|
-
const regressedValues = attr.enum.map(toRegressedEnumValue);
|
|
61
|
-
|
|
62
|
-
// should match the GraphQL regex
|
|
63
|
-
if (!regressedValues.every((value) => GRAPHQL_ENUM_REGEX.test(value))) {
|
|
64
|
-
const message = `Invalid enumeration value. Values should have at least one alphabetical character preceding the first occurence of a number. Update your enumeration '${attrName}'.`;
|
|
65
|
-
|
|
66
|
-
return this.createError({ message });
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
// should not contain empty values
|
|
70
|
-
if (regressedValues.some((value) => value === '')) {
|
|
71
|
-
return this.createError({
|
|
72
|
-
message: `At least one value of the enumeration '${attrName}' appears to be empty. Only alphanumerical characters are taken into account.`,
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
// should not collide
|
|
77
|
-
const duplicates = _.uniq(
|
|
78
|
-
regressedValues.filter((value, index, values) => values.indexOf(value) !== index)
|
|
79
|
-
);
|
|
80
|
-
|
|
81
|
-
if (duplicates.length) {
|
|
82
|
-
const message = `Some enumeration values of the field '${attrName}' collide when normalized: ${duplicates.join(
|
|
83
|
-
', '
|
|
84
|
-
)}. Please modify your enumeration.`;
|
|
85
|
-
|
|
86
|
-
return this.createError({ message });
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
return true;
|
|
92
|
-
},
|
|
93
|
-
}),
|
|
94
|
-
}),
|
|
95
|
-
actions: yup.object().onlyContainsFunctions(),
|
|
96
|
-
lifecycles: yup.object().shape(lifecyclesShape).noUnknown(),
|
|
97
|
-
});
|
|
98
|
-
|
|
99
|
-
const validateContentTypeDefinition = (data) => {
|
|
100
|
-
return contentTypeSchemaValidator.validateSync(data, { strict: true, abortEarly: false });
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
module.exports = {
|
|
104
|
-
validateContentTypeDefinition,
|
|
105
|
-
};
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const _ = require('lodash');
|
|
4
|
-
const { removeNamespace } = require('../../utils');
|
|
5
|
-
const { validateModule } = require('./validation');
|
|
6
|
-
|
|
7
|
-
const uidToPath = (uid) => uid.replace('::', '.');
|
|
8
|
-
|
|
9
|
-
// Removes the namespace from a map with keys prefixed with a namespace
|
|
10
|
-
const removeNamespacedKeys = (map, namespace) => {
|
|
11
|
-
return _.mapKeys(map, (value, key) => removeNamespace(key, namespace));
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
const defaultModule = {
|
|
15
|
-
config: {},
|
|
16
|
-
routes: [],
|
|
17
|
-
controllers: {},
|
|
18
|
-
services: {},
|
|
19
|
-
contentTypes: {},
|
|
20
|
-
policies: {},
|
|
21
|
-
middlewares: {},
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
const createModule = (namespace, rawModule, strapi) => {
|
|
25
|
-
_.defaults(rawModule, defaultModule);
|
|
26
|
-
|
|
27
|
-
try {
|
|
28
|
-
validateModule(rawModule);
|
|
29
|
-
} catch (e) {
|
|
30
|
-
throw new Error(`strapi-server.js is invalid for '${namespace}'.\n${e.errors.join('\n')}`);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
const called = {};
|
|
34
|
-
return {
|
|
35
|
-
async bootstrap() {
|
|
36
|
-
if (called.bootstrap) {
|
|
37
|
-
throw new Error(`Bootstrap for ${namespace} has already been called`);
|
|
38
|
-
}
|
|
39
|
-
called.bootstrap = true;
|
|
40
|
-
await (rawModule.bootstrap && rawModule.bootstrap({ strapi }));
|
|
41
|
-
},
|
|
42
|
-
async register() {
|
|
43
|
-
if (called.register) {
|
|
44
|
-
throw new Error(`Register for ${namespace} has already been called`);
|
|
45
|
-
}
|
|
46
|
-
called.register = true;
|
|
47
|
-
await (rawModule.register && rawModule.register({ strapi }));
|
|
48
|
-
},
|
|
49
|
-
async destroy() {
|
|
50
|
-
if (called.destroy) {
|
|
51
|
-
throw new Error(`Destroy for ${namespace} has already been called`);
|
|
52
|
-
}
|
|
53
|
-
called.destroy = true;
|
|
54
|
-
await (rawModule.destroy && rawModule.destroy({ strapi }));
|
|
55
|
-
},
|
|
56
|
-
load() {
|
|
57
|
-
strapi.container.get('content-types').add(namespace, rawModule.contentTypes);
|
|
58
|
-
strapi.container.get('services').add(namespace, rawModule.services);
|
|
59
|
-
strapi.container.get('policies').add(namespace, rawModule.policies);
|
|
60
|
-
strapi.container.get('middlewares').add(namespace, rawModule.middlewares);
|
|
61
|
-
strapi.container.get('controllers').add(namespace, rawModule.controllers);
|
|
62
|
-
strapi.container.get('config').set(uidToPath(namespace), rawModule.config);
|
|
63
|
-
},
|
|
64
|
-
get routes() {
|
|
65
|
-
return rawModule.routes;
|
|
66
|
-
},
|
|
67
|
-
config(path, defaultValue) {
|
|
68
|
-
return strapi.container.get('config').get(`${uidToPath(namespace)}.${path}`, defaultValue);
|
|
69
|
-
},
|
|
70
|
-
contentType(ctName) {
|
|
71
|
-
return strapi.container.get('content-types').get(`${namespace}.${ctName}`);
|
|
72
|
-
},
|
|
73
|
-
get contentTypes() {
|
|
74
|
-
const contentTypes = strapi.container.get('content-types').getAll(namespace);
|
|
75
|
-
return removeNamespacedKeys(contentTypes, namespace);
|
|
76
|
-
},
|
|
77
|
-
service(serviceName) {
|
|
78
|
-
return strapi.container.get('services').get(`${namespace}.${serviceName}`);
|
|
79
|
-
},
|
|
80
|
-
get services() {
|
|
81
|
-
const services = strapi.container.get('services').getAll(namespace);
|
|
82
|
-
return removeNamespacedKeys(services, namespace);
|
|
83
|
-
},
|
|
84
|
-
policy(policyName) {
|
|
85
|
-
return strapi.container.get('policies').get(`${namespace}.${policyName}`);
|
|
86
|
-
},
|
|
87
|
-
get policies() {
|
|
88
|
-
const policies = strapi.container.get('policies').getAll(namespace);
|
|
89
|
-
return removeNamespacedKeys(policies, namespace);
|
|
90
|
-
},
|
|
91
|
-
middleware(middlewareName) {
|
|
92
|
-
return strapi.container.get('middlewares').get(`${namespace}.${middlewareName}`);
|
|
93
|
-
},
|
|
94
|
-
get middlewares() {
|
|
95
|
-
const middlewares = strapi.container.get('middlewares').getAll(namespace);
|
|
96
|
-
return removeNamespacedKeys(middlewares, namespace);
|
|
97
|
-
},
|
|
98
|
-
controller(controllerName) {
|
|
99
|
-
return strapi.container.get('controllers').get(`${namespace}.${controllerName}`);
|
|
100
|
-
},
|
|
101
|
-
get controllers() {
|
|
102
|
-
const controllers = strapi.container.get('controllers').getAll(namespace);
|
|
103
|
-
return removeNamespacedKeys(controllers, namespace);
|
|
104
|
-
},
|
|
105
|
-
};
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
module.exports = { createModule };
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const { yup } = require('@strapi/utils');
|
|
4
|
-
|
|
5
|
-
const strapiServerSchema = yup
|
|
6
|
-
.object()
|
|
7
|
-
.shape({
|
|
8
|
-
bootstrap: yup.mixed().isFunction(),
|
|
9
|
-
destroy: yup.mixed().isFunction(),
|
|
10
|
-
register: yup.mixed().isFunction(),
|
|
11
|
-
config: yup.object(),
|
|
12
|
-
routes: yup.lazy((value) => {
|
|
13
|
-
if (Array.isArray(value)) {
|
|
14
|
-
return yup.array();
|
|
15
|
-
}
|
|
16
|
-
return yup.object();
|
|
17
|
-
}),
|
|
18
|
-
controllers: yup.object(),
|
|
19
|
-
services: yup.object(),
|
|
20
|
-
policies: yup.object(),
|
|
21
|
-
middlewares: yup.object(),
|
|
22
|
-
contentTypes: yup.object(),
|
|
23
|
-
})
|
|
24
|
-
.noUnknown();
|
|
25
|
-
|
|
26
|
-
const validateModule = (data) => {
|
|
27
|
-
return strapiServerSchema.validateSync(data, { strict: true, abortEarly: false });
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
module.exports = {
|
|
31
|
-
validateModule,
|
|
32
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const _ = require('lodash');
|
|
4
|
-
|
|
5
|
-
module.exports = (strapi) => {
|
|
6
|
-
strapi.admin = require('@strapi/admin/strapi-server');
|
|
7
|
-
|
|
8
|
-
strapi.container.get('services').add(`admin::`, strapi.admin.services);
|
|
9
|
-
strapi.container.get('controllers').add(`admin::`, strapi.admin.controllers);
|
|
10
|
-
strapi.container.get('content-types').add(`admin::`, strapi.admin.contentTypes);
|
|
11
|
-
strapi.container.get('policies').add(`admin::`, strapi.admin.policies);
|
|
12
|
-
strapi.container.get('middlewares').add(`admin::`, strapi.admin.middlewares);
|
|
13
|
-
|
|
14
|
-
const userAdminConfig = strapi.config.get('admin');
|
|
15
|
-
strapi.container.get('config').set('admin', _.merge(strapi.admin.config, userAdminConfig));
|
|
16
|
-
};
|
package/lib/core/loaders/apis.js
DELETED
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const { join, extname, basename } = require('path');
|
|
4
|
-
const { existsSync } = require('fs-extra');
|
|
5
|
-
const _ = require('lodash');
|
|
6
|
-
const fse = require('fs-extra');
|
|
7
|
-
const { isKebabCase, importDefault } = require('@strapi/utils');
|
|
8
|
-
const { isEmpty } = require('lodash/fp');
|
|
9
|
-
|
|
10
|
-
const DEFAULT_CONTENT_TYPE = {
|
|
11
|
-
schema: {},
|
|
12
|
-
actions: {},
|
|
13
|
-
lifecycles: {},
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
// to handle names with numbers in it we first check if it is already in kebabCase
|
|
17
|
-
const normalizeName = (name) => (isKebabCase(name) ? name : _.kebabCase(name));
|
|
18
|
-
|
|
19
|
-
const isDirectory = (fd) => fd.isDirectory();
|
|
20
|
-
const isDotFile = (fd) => fd.name.startsWith('.');
|
|
21
|
-
|
|
22
|
-
module.exports = async (strapi) => {
|
|
23
|
-
if (!existsSync(strapi.dirs.dist.api)) {
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
const apisFDs = await (await fse.readdir(strapi.dirs.dist.api, { withFileTypes: true }))
|
|
28
|
-
.filter(isDirectory)
|
|
29
|
-
.filter(_.negate(isDotFile));
|
|
30
|
-
|
|
31
|
-
const apis = {};
|
|
32
|
-
|
|
33
|
-
// only load folders
|
|
34
|
-
for (const apiFD of apisFDs) {
|
|
35
|
-
const apiName = normalizeName(apiFD.name);
|
|
36
|
-
const api = await loadAPI(join(strapi.dirs.dist.api, apiFD.name));
|
|
37
|
-
|
|
38
|
-
apis[apiName] = api;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
validateContentTypesUnicity(apis);
|
|
42
|
-
|
|
43
|
-
for (const apiName of Object.keys(apis)) {
|
|
44
|
-
strapi.container.get('apis').add(apiName, apis[apiName]);
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
const validateContentTypesUnicity = (apis) => {
|
|
49
|
-
const allApisSchemas = Object.values(apis).flatMap((api) => Object.values(api.contentTypes));
|
|
50
|
-
|
|
51
|
-
const names = [];
|
|
52
|
-
allApisSchemas.forEach(({ schema }) => {
|
|
53
|
-
if (schema.info.singularName) {
|
|
54
|
-
const singularName = _.kebabCase(schema.info.singularName);
|
|
55
|
-
if (names.includes(singularName)) {
|
|
56
|
-
throw new Error(`The singular name "${schema.info.singularName}" should be unique`);
|
|
57
|
-
}
|
|
58
|
-
names.push(singularName);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
if (schema.info.pluralName) {
|
|
62
|
-
const pluralName = _.kebabCase(schema.info.pluralName);
|
|
63
|
-
if (names.includes(pluralName)) {
|
|
64
|
-
throw new Error(`The plural name "${schema.info.pluralName}" should be unique`);
|
|
65
|
-
}
|
|
66
|
-
names.push(pluralName);
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
const loadAPI = async (dir) => {
|
|
72
|
-
const [index, config, routes, controllers, services, policies, middlewares, contentTypes] =
|
|
73
|
-
await Promise.all([
|
|
74
|
-
loadIndex(dir),
|
|
75
|
-
loadDir(join(dir, 'config')),
|
|
76
|
-
loadDir(join(dir, 'routes')),
|
|
77
|
-
loadDir(join(dir, 'controllers')),
|
|
78
|
-
loadDir(join(dir, 'services')),
|
|
79
|
-
loadDir(join(dir, 'policies')),
|
|
80
|
-
loadDir(join(dir, 'middlewares')),
|
|
81
|
-
loadContentTypes(join(dir, 'content-types')),
|
|
82
|
-
]);
|
|
83
|
-
|
|
84
|
-
return {
|
|
85
|
-
...(index || {}),
|
|
86
|
-
config: config || {},
|
|
87
|
-
routes: routes || [],
|
|
88
|
-
controllers: controllers || {},
|
|
89
|
-
services: services || {},
|
|
90
|
-
policies: policies || {},
|
|
91
|
-
middlewares: middlewares || {},
|
|
92
|
-
contentTypes: contentTypes || {},
|
|
93
|
-
};
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
const loadIndex = async (dir) => {
|
|
97
|
-
if (await fse.pathExists(join(dir, 'index.js'))) {
|
|
98
|
-
return loadFile(join(dir, 'index.js'));
|
|
99
|
-
}
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
const loadContentTypes = async (dir) => {
|
|
103
|
-
if (!(await fse.pathExists(dir))) {
|
|
104
|
-
return;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
const fds = await fse.readdir(dir, { withFileTypes: true });
|
|
108
|
-
const contentTypes = {};
|
|
109
|
-
|
|
110
|
-
// only load folders
|
|
111
|
-
for (const fd of fds) {
|
|
112
|
-
if (fd.isFile()) {
|
|
113
|
-
continue;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
const contentTypeName = normalizeName(fd.name);
|
|
117
|
-
const contentType = await loadDir(join(dir, fd.name));
|
|
118
|
-
|
|
119
|
-
if (isEmpty(contentType) || isEmpty(contentType.schema)) {
|
|
120
|
-
throw new Error(`Could not load content type found at ${dir}`);
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
contentTypes[normalizeName(contentTypeName)] = _.defaults(contentType, DEFAULT_CONTENT_TYPE);
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
return contentTypes;
|
|
127
|
-
};
|
|
128
|
-
|
|
129
|
-
const loadDir = async (dir) => {
|
|
130
|
-
if (!(await fse.pathExists(dir))) {
|
|
131
|
-
return;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
const fds = await fse.readdir(dir, { withFileTypes: true });
|
|
135
|
-
|
|
136
|
-
const root = {};
|
|
137
|
-
for (const fd of fds) {
|
|
138
|
-
if (!fd.isFile() || extname(fd.name) === '.map') {
|
|
139
|
-
continue;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
const key = basename(fd.name, extname(fd.name));
|
|
143
|
-
|
|
144
|
-
root[normalizeName(key)] = await loadFile(join(dir, fd.name));
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
return root;
|
|
148
|
-
};
|
|
149
|
-
|
|
150
|
-
const loadFile = (file) => {
|
|
151
|
-
const ext = extname(file);
|
|
152
|
-
|
|
153
|
-
switch (ext) {
|
|
154
|
-
case '.js':
|
|
155
|
-
return importDefault(file);
|
|
156
|
-
case '.json':
|
|
157
|
-
return fse.readJSON(file);
|
|
158
|
-
default:
|
|
159
|
-
return {};
|
|
160
|
-
}
|
|
161
|
-
};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const { join } = require('path');
|
|
4
|
-
const _ = require('lodash');
|
|
5
|
-
const { pathExists } = require('fs-extra');
|
|
6
|
-
const loadFiles = require('../../load/load-files');
|
|
7
|
-
|
|
8
|
-
module.exports = async (strapi) => {
|
|
9
|
-
if (!(await pathExists(strapi.dirs.dist.components))) {
|
|
10
|
-
return {};
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
const map = await loadFiles(strapi.dirs.dist.components, '*/*.*(js|json)');
|
|
14
|
-
|
|
15
|
-
return Object.keys(map).reduce((acc, category) => {
|
|
16
|
-
Object.keys(map[category]).forEach((key) => {
|
|
17
|
-
const schema = map[category][key];
|
|
18
|
-
|
|
19
|
-
if (!schema.collectionName) {
|
|
20
|
-
// NOTE: We're using the filepath from the app directory instead of the dist for information purpose
|
|
21
|
-
const filePath = join(strapi.dirs.app.components, category, schema.__filename__);
|
|
22
|
-
|
|
23
|
-
return strapi.stopWithError(
|
|
24
|
-
`Component ${key} is missing a "collectionName" property.\nVerify file ${filePath}.`
|
|
25
|
-
);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
const uid = `${category}.${key}`;
|
|
29
|
-
|
|
30
|
-
acc[uid] = Object.assign(schema, {
|
|
31
|
-
__schema__: _.cloneDeep(schema),
|
|
32
|
-
uid,
|
|
33
|
-
category,
|
|
34
|
-
modelType: 'component',
|
|
35
|
-
modelName: key,
|
|
36
|
-
globalId: schema.globalId || _.upperFirst(_.camelCase(`component_${uid}`)),
|
|
37
|
-
});
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
return acc;
|
|
41
|
-
}, {});
|
|
42
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
module.exports = {
|
|
4
|
-
loadSrcIndex: require('./src-index'),
|
|
5
|
-
loadAPIs: require('./apis'),
|
|
6
|
-
loadMiddlewares: require('./middlewares'),
|
|
7
|
-
loadComponents: require('./components'),
|
|
8
|
-
loadPolicies: require('./policies'),
|
|
9
|
-
loadPlugins: require('./plugins'),
|
|
10
|
-
loadAdmin: require('./admin'),
|
|
11
|
-
loadSanitizers: require('./sanitizers'),
|
|
12
|
-
loadValidators: require('./validators'),
|
|
13
|
-
};
|