@strapi/strapi 4.14.0-beta.0 → 4.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +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
|
@@ -0,0 +1,332 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Entity validator
|
|
4
|
+
* Module that will validate input data for entity creation or edition
|
|
5
|
+
*/
|
|
6
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
7
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8
|
+
};
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
const lodash_1 = require("lodash");
|
|
11
|
+
const fp_1 = require("lodash/fp");
|
|
12
|
+
const utils_1 = __importDefault(require("@strapi/utils"));
|
|
13
|
+
const validators_1 = __importDefault(require("./validators"));
|
|
14
|
+
const { yup, validateYupSchema } = utils_1.default;
|
|
15
|
+
const { isMediaAttribute, isScalarAttribute, getWritableAttributes } = utils_1.default.contentTypes;
|
|
16
|
+
const { ValidationError } = utils_1.default.errors;
|
|
17
|
+
const isInteger = (value) => Number.isInteger(value);
|
|
18
|
+
const addMinMax = (validator, { attr, updatedAttribute }) => {
|
|
19
|
+
let nextValidator = validator;
|
|
20
|
+
if (isInteger(attr.min) &&
|
|
21
|
+
(('required' in attr && attr.required) ||
|
|
22
|
+
(Array.isArray(updatedAttribute.value) && updatedAttribute.value.length > 0))) {
|
|
23
|
+
nextValidator = nextValidator.min(attr.min);
|
|
24
|
+
}
|
|
25
|
+
if (isInteger(attr.max)) {
|
|
26
|
+
nextValidator = nextValidator.max(attr.max);
|
|
27
|
+
}
|
|
28
|
+
return nextValidator;
|
|
29
|
+
};
|
|
30
|
+
const addRequiredValidation = (createOrUpdate) => {
|
|
31
|
+
return (validator, { attr: { required } }) => {
|
|
32
|
+
let nextValidator = validator;
|
|
33
|
+
if (required) {
|
|
34
|
+
if (createOrUpdate === 'creation') {
|
|
35
|
+
nextValidator = nextValidator.notNil();
|
|
36
|
+
}
|
|
37
|
+
else if (createOrUpdate === 'update') {
|
|
38
|
+
nextValidator = nextValidator.notNull();
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
nextValidator = nextValidator.nullable();
|
|
43
|
+
}
|
|
44
|
+
return nextValidator;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
const addDefault = (createOrUpdate) => {
|
|
48
|
+
return (validator, { attr }) => {
|
|
49
|
+
let nextValidator = validator;
|
|
50
|
+
if (createOrUpdate === 'creation') {
|
|
51
|
+
if (((attr.type === 'component' && attr.repeatable) || attr.type === 'dynamiczone') &&
|
|
52
|
+
!attr.required) {
|
|
53
|
+
nextValidator = nextValidator.default([]);
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
nextValidator = nextValidator.default(attr.default);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
nextValidator = nextValidator.default(undefined);
|
|
61
|
+
}
|
|
62
|
+
return nextValidator;
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
const preventCast = (validator) => validator.transform((val, originalVal) => originalVal);
|
|
66
|
+
const createComponentValidator = (createOrUpdate) => ({ attr, updatedAttribute }, { isDraft }) => {
|
|
67
|
+
const model = strapi.getModel(attr.component);
|
|
68
|
+
if (!model) {
|
|
69
|
+
throw new Error('Validation failed: Model not found');
|
|
70
|
+
}
|
|
71
|
+
if (attr?.repeatable) {
|
|
72
|
+
// FIXME: yup v1
|
|
73
|
+
let validator = yup
|
|
74
|
+
.array()
|
|
75
|
+
.of(yup.lazy((item) => createModelValidator(createOrUpdate)({ model, data: item }, { isDraft }).notNull()));
|
|
76
|
+
validator = addRequiredValidation(createOrUpdate)(validator, {
|
|
77
|
+
attr: { required: true },
|
|
78
|
+
updatedAttribute,
|
|
79
|
+
});
|
|
80
|
+
validator = addMinMax(validator, { attr, updatedAttribute });
|
|
81
|
+
return validator;
|
|
82
|
+
}
|
|
83
|
+
// FIXME: v4 was broken
|
|
84
|
+
let validator = createModelValidator(createOrUpdate)({ model, data: updatedAttribute.value }, { isDraft });
|
|
85
|
+
validator = addRequiredValidation(createOrUpdate)(validator, {
|
|
86
|
+
attr: { required: !isDraft && attr.required },
|
|
87
|
+
updatedAttribute,
|
|
88
|
+
});
|
|
89
|
+
return validator;
|
|
90
|
+
};
|
|
91
|
+
const createDzValidator = (createOrUpdate) => ({ attr, updatedAttribute }, { isDraft }) => {
|
|
92
|
+
let validator;
|
|
93
|
+
validator = yup.array().of(yup.lazy((item) => {
|
|
94
|
+
const model = strapi.getModel((0, fp_1.prop)('__component', item));
|
|
95
|
+
const schema = yup
|
|
96
|
+
.object()
|
|
97
|
+
.shape({
|
|
98
|
+
__component: yup.string().required().oneOf(Object.keys(strapi.components)),
|
|
99
|
+
})
|
|
100
|
+
.notNull();
|
|
101
|
+
return model
|
|
102
|
+
? schema.concat(createModelValidator(createOrUpdate)({ model, data: item }, { isDraft }))
|
|
103
|
+
: schema;
|
|
104
|
+
}) // FIXME: yup v1
|
|
105
|
+
);
|
|
106
|
+
validator = addRequiredValidation(createOrUpdate)(validator, {
|
|
107
|
+
attr: { required: true },
|
|
108
|
+
updatedAttribute,
|
|
109
|
+
});
|
|
110
|
+
validator = addMinMax(validator, { attr, updatedAttribute });
|
|
111
|
+
return validator;
|
|
112
|
+
};
|
|
113
|
+
const createRelationValidator = (createOrUpdate) => ({ attr, updatedAttribute }, { isDraft }) => {
|
|
114
|
+
let validator;
|
|
115
|
+
if (Array.isArray(updatedAttribute.value)) {
|
|
116
|
+
validator = yup.array().of(yup.mixed());
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
validator = yup.mixed();
|
|
120
|
+
}
|
|
121
|
+
validator = addRequiredValidation(createOrUpdate)(validator, {
|
|
122
|
+
attr: { required: !isDraft && attr.required },
|
|
123
|
+
updatedAttribute,
|
|
124
|
+
});
|
|
125
|
+
return validator;
|
|
126
|
+
};
|
|
127
|
+
const createScalarAttributeValidator = (createOrUpdate) => (metas, options) => {
|
|
128
|
+
let validator;
|
|
129
|
+
if ((0, fp_1.has)(metas.attr.type, validators_1.default)) {
|
|
130
|
+
validator = validators_1.default[metas.attr.type](metas, options);
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
// No validators specified - fall back to mixed
|
|
134
|
+
validator = yup.mixed();
|
|
135
|
+
}
|
|
136
|
+
validator = addRequiredValidation(createOrUpdate)(validator, {
|
|
137
|
+
attr: { required: !options.isDraft && metas.attr.required },
|
|
138
|
+
updatedAttribute: metas.updatedAttribute,
|
|
139
|
+
});
|
|
140
|
+
return validator;
|
|
141
|
+
};
|
|
142
|
+
const createAttributeValidator = (createOrUpdate) => (metas, options) => {
|
|
143
|
+
let validator = yup.mixed();
|
|
144
|
+
if (isMediaAttribute(metas.attr)) {
|
|
145
|
+
validator = yup.mixed();
|
|
146
|
+
}
|
|
147
|
+
else if (isScalarAttribute(metas.attr)) {
|
|
148
|
+
validator = createScalarAttributeValidator(createOrUpdate)(metas, options);
|
|
149
|
+
}
|
|
150
|
+
else {
|
|
151
|
+
if (metas.attr.type === 'component') {
|
|
152
|
+
validator = createComponentValidator(createOrUpdate)({ attr: metas.attr, updatedAttribute: metas.updatedAttribute }, options);
|
|
153
|
+
}
|
|
154
|
+
else if (metas.attr.type === 'dynamiczone') {
|
|
155
|
+
validator = createDzValidator(createOrUpdate)(metas, options);
|
|
156
|
+
}
|
|
157
|
+
else if (metas.attr.type === 'relation') {
|
|
158
|
+
validator = createRelationValidator(createOrUpdate)({
|
|
159
|
+
attr: metas.attr,
|
|
160
|
+
updatedAttribute: metas.updatedAttribute,
|
|
161
|
+
}, options);
|
|
162
|
+
}
|
|
163
|
+
validator = preventCast(validator);
|
|
164
|
+
}
|
|
165
|
+
validator = addDefault(createOrUpdate)(validator, metas);
|
|
166
|
+
return validator;
|
|
167
|
+
};
|
|
168
|
+
const createModelValidator = (createOrUpdate) => ({ model, data, entity }, options) => {
|
|
169
|
+
const writableAttributes = model ? getWritableAttributes(model) : [];
|
|
170
|
+
const schema = writableAttributes.reduce((validators, attributeName) => {
|
|
171
|
+
const metas = {
|
|
172
|
+
attr: model.attributes[attributeName],
|
|
173
|
+
updatedAttribute: { name: attributeName, value: (0, fp_1.prop)(attributeName, data) },
|
|
174
|
+
model,
|
|
175
|
+
entity,
|
|
176
|
+
};
|
|
177
|
+
const validator = createAttributeValidator(createOrUpdate)(metas, options);
|
|
178
|
+
validators[attributeName] = validator;
|
|
179
|
+
return validators;
|
|
180
|
+
}, {});
|
|
181
|
+
return yup.object().shape(schema);
|
|
182
|
+
};
|
|
183
|
+
const createValidateEntity = (createOrUpdate) => {
|
|
184
|
+
return async (model, data, options, entity) => {
|
|
185
|
+
if (!(0, fp_1.isObject)(data)) {
|
|
186
|
+
const { displayName } = model.info;
|
|
187
|
+
throw new ValidationError(`Invalid payload submitted for the ${createOrUpdate} of an entity of type ${displayName}. Expected an object, but got ${typeof data}`);
|
|
188
|
+
}
|
|
189
|
+
const validator = createModelValidator(createOrUpdate)({ model, data, entity }, { isDraft: options?.isDraft ?? false })
|
|
190
|
+
.test('relations-test', 'check that all relations exist', async function (data) {
|
|
191
|
+
try {
|
|
192
|
+
await checkRelationsExist(buildRelationsStore({ uid: model.uid, data }));
|
|
193
|
+
}
|
|
194
|
+
catch (e) {
|
|
195
|
+
return this.createError({
|
|
196
|
+
path: this.path,
|
|
197
|
+
message: (e instanceof ValidationError && e.message) || 'Invalid relations',
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
return true;
|
|
201
|
+
})
|
|
202
|
+
.required();
|
|
203
|
+
return validateYupSchema(validator, {
|
|
204
|
+
strict: false,
|
|
205
|
+
abortEarly: false,
|
|
206
|
+
})(data);
|
|
207
|
+
};
|
|
208
|
+
};
|
|
209
|
+
/**
|
|
210
|
+
* Builds an object containing all the media and relations being associated with an entity
|
|
211
|
+
*/
|
|
212
|
+
const buildRelationsStore = ({ uid, data, }) => {
|
|
213
|
+
if (!uid) {
|
|
214
|
+
throw new ValidationError(`Cannot build relations store: "uid" is undefined`);
|
|
215
|
+
}
|
|
216
|
+
if ((0, fp_1.isEmpty)(data)) {
|
|
217
|
+
return {};
|
|
218
|
+
}
|
|
219
|
+
const currentModel = strapi.getModel(uid);
|
|
220
|
+
return Object.keys(currentModel.attributes).reduce((result, attributeName) => {
|
|
221
|
+
const attribute = currentModel.attributes[attributeName];
|
|
222
|
+
const value = data[attributeName];
|
|
223
|
+
if ((0, lodash_1.isNil)(value)) {
|
|
224
|
+
return result;
|
|
225
|
+
}
|
|
226
|
+
switch (attribute.type) {
|
|
227
|
+
case 'relation':
|
|
228
|
+
case 'media': {
|
|
229
|
+
if (attribute.type === 'relation' &&
|
|
230
|
+
(attribute.relation === 'morphToMany' || attribute.relation === 'morphToOne')) {
|
|
231
|
+
// TODO: handle polymorphic relations
|
|
232
|
+
break;
|
|
233
|
+
}
|
|
234
|
+
const target =
|
|
235
|
+
// eslint-disable-next-line no-nested-ternary
|
|
236
|
+
attribute.type === 'media' ? 'plugin::upload.file' : attribute.target;
|
|
237
|
+
// As there are multiple formats supported for associating relations
|
|
238
|
+
// with an entity, the value here can be an: array, object or number.
|
|
239
|
+
let source;
|
|
240
|
+
if (Array.isArray(value)) {
|
|
241
|
+
source = value;
|
|
242
|
+
}
|
|
243
|
+
else if ((0, fp_1.isObject)(value)) {
|
|
244
|
+
if ('connect' in value && !(0, lodash_1.isNil)(value.connect)) {
|
|
245
|
+
source = value.connect;
|
|
246
|
+
}
|
|
247
|
+
else if ('set' in value && !(0, lodash_1.isNil)(value.set)) {
|
|
248
|
+
source = value.set;
|
|
249
|
+
}
|
|
250
|
+
else {
|
|
251
|
+
source = [];
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
else {
|
|
255
|
+
source = (0, lodash_1.castArray)(value);
|
|
256
|
+
}
|
|
257
|
+
const idArray = source.map((v) => ({
|
|
258
|
+
id: typeof v === 'object' ? v.id : v,
|
|
259
|
+
}));
|
|
260
|
+
// Update the relationStore to keep track of all associations being made
|
|
261
|
+
// with relations and media.
|
|
262
|
+
result[target] = result[target] || [];
|
|
263
|
+
result[target].push(...idArray);
|
|
264
|
+
break;
|
|
265
|
+
}
|
|
266
|
+
case 'component': {
|
|
267
|
+
return (0, lodash_1.castArray)(value).reduce((relationsStore, componentValue) => {
|
|
268
|
+
if (!attribute.component) {
|
|
269
|
+
throw new ValidationError(`Cannot build relations store from component, component identifier is undefined`);
|
|
270
|
+
}
|
|
271
|
+
return (0, lodash_1.mergeWith)(relationsStore, buildRelationsStore({
|
|
272
|
+
uid: attribute.component,
|
|
273
|
+
data: componentValue,
|
|
274
|
+
}), (objValue, srcValue) => {
|
|
275
|
+
if ((0, lodash_1.isArray)(objValue)) {
|
|
276
|
+
return objValue.concat(srcValue);
|
|
277
|
+
}
|
|
278
|
+
});
|
|
279
|
+
}, result);
|
|
280
|
+
}
|
|
281
|
+
case 'dynamiczone': {
|
|
282
|
+
return (0, lodash_1.castArray)(value).reduce((relationsStore, dzValue) => {
|
|
283
|
+
const value = dzValue;
|
|
284
|
+
if (!value.__component) {
|
|
285
|
+
throw new ValidationError(`Cannot build relations store from dynamiczone, component identifier is undefined`);
|
|
286
|
+
}
|
|
287
|
+
return (0, lodash_1.mergeWith)(relationsStore, buildRelationsStore({
|
|
288
|
+
uid: value.__component,
|
|
289
|
+
data: value,
|
|
290
|
+
}), (objValue, srcValue) => {
|
|
291
|
+
if ((0, lodash_1.isArray)(objValue)) {
|
|
292
|
+
return objValue.concat(srcValue);
|
|
293
|
+
}
|
|
294
|
+
});
|
|
295
|
+
}, result);
|
|
296
|
+
}
|
|
297
|
+
default:
|
|
298
|
+
break;
|
|
299
|
+
}
|
|
300
|
+
return result;
|
|
301
|
+
}, {});
|
|
302
|
+
};
|
|
303
|
+
/**
|
|
304
|
+
* Iterate through the relations store and validates that every relation or media
|
|
305
|
+
* mentioned exists
|
|
306
|
+
*/
|
|
307
|
+
const checkRelationsExist = async (relationsStore = {}) => {
|
|
308
|
+
const promises = [];
|
|
309
|
+
for (const [key, value] of Object.entries(relationsStore)) {
|
|
310
|
+
const evaluate = async () => {
|
|
311
|
+
const uniqueValues = (0, lodash_1.uniqBy)(value, `id`);
|
|
312
|
+
const count = await strapi.query(key).count({
|
|
313
|
+
where: {
|
|
314
|
+
id: {
|
|
315
|
+
$in: uniqueValues.map((v) => v.id),
|
|
316
|
+
},
|
|
317
|
+
},
|
|
318
|
+
});
|
|
319
|
+
if (count !== uniqueValues.length) {
|
|
320
|
+
throw new ValidationError(`${uniqueValues.length - count} relation(s) of type ${key} associated with this entity do not exist`);
|
|
321
|
+
}
|
|
322
|
+
};
|
|
323
|
+
promises.push(evaluate());
|
|
324
|
+
}
|
|
325
|
+
return Promise.all(promises);
|
|
326
|
+
};
|
|
327
|
+
const entityValidator = {
|
|
328
|
+
validateEntityCreation: createValidateEntity('creation'),
|
|
329
|
+
validateEntityUpdate: createValidateEntity('update'),
|
|
330
|
+
};
|
|
331
|
+
exports.default = entityValidator;
|
|
332
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/services/entity-validator/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;AAEH,mCAAsE;AACtE,kCAAyD;AACzD,0DAAwC;AAExC,8DAAsC;AAItC,MAAM,EAAE,GAAG,EAAE,iBAAiB,EAAE,GAAG,eAAW,CAAC;AAC/C,MAAM,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,GAAG,eAAW,CAAC,YAAY,CAAC;AAChG,MAAM,EAAE,eAAe,EAAE,GAAG,eAAW,CAAC,MAAM,CAAC;AAiC/C,MAAM,SAAS,GAAG,CAAC,KAAc,EAAmB,EAAE,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;AAE/E,MAAM,SAAS,GAAG,CAMhB,SAAY,EACZ,EAAE,IAAI,EAAE,gBAAgB,EAA0E,EAC/F,EAAE;IACL,IAAI,aAAa,GAAM,SAAS,CAAC;IAEjC,IACE,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC;QACnB,CAAC,CAAC,UAAU,IAAI,IAAI,IAAI,IAAI,CAAC,QAAQ,CAAC;YACpC,CAAC,KAAK,CAAC,OAAO,CAAC,gBAAgB,CAAC,KAAK,CAAC,IAAI,gBAAgB,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,EAC/E;QACA,aAAa,GAAG,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;KAC7C;IACD,IAAI,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;QACvB,aAAa,GAAG,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;KAC7C;IACD,OAAO,aAAa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,CAAC;KAC3B;IAED,OAAO,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC/B,CAAC,CAAC;AAEF,MAAM,eAAe,GAAoB;IACvC,sBAAsB,EAAE,oBAAoB,CAAC,UAAU,CAAC;IACxD,oBAAoB,EAAE,oBAAoB,CAAC,QAAQ,CAAC;CACrD,CAAC;AAEF,kBAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { Attribute, Schema } from '@strapi/types';
|
|
2
|
+
interface ValidatorMetas<TAttribute extends Attribute.Any> {
|
|
3
|
+
attr: TAttribute;
|
|
4
|
+
model: Schema.ContentType;
|
|
5
|
+
updatedAttribute: {
|
|
6
|
+
name: string;
|
|
7
|
+
value: unknown;
|
|
8
|
+
};
|
|
9
|
+
entity: Record<string, unknown> | null;
|
|
10
|
+
}
|
|
11
|
+
interface ValidatorOptions {
|
|
12
|
+
isDraft: boolean;
|
|
13
|
+
}
|
|
14
|
+
declare const _default: {
|
|
15
|
+
string: (metas: ValidatorMetas<Attribute.Email | Attribute.Password | Attribute.RichText | (Attribute.OfType<"string"> & Attribute.StringProperties & Attribute.ConfigurableOption & Attribute.DefaultOption<string> & Attribute.MinMaxLengthOption & Attribute.PrivateOption & Attribute.UniqueOption & Attribute.RequiredOption & Attribute.WritableOption & Attribute.VisibleOption) | Attribute.Text | Attribute.UID<never, string, Attribute.UIDOptions>>, options: ValidatorOptions) => import("yup").StringSchema<string | undefined, Record<string, any>, string | undefined>;
|
|
16
|
+
text: (metas: ValidatorMetas<Attribute.Email | Attribute.Password | Attribute.RichText | (Attribute.OfType<"string"> & Attribute.StringProperties & Attribute.ConfigurableOption & Attribute.DefaultOption<string> & Attribute.MinMaxLengthOption & Attribute.PrivateOption & Attribute.UniqueOption & Attribute.RequiredOption & Attribute.WritableOption & Attribute.VisibleOption) | Attribute.Text | Attribute.UID<never, string, Attribute.UIDOptions>>, options: ValidatorOptions) => import("yup").StringSchema<string | undefined, Record<string, any>, string | undefined>;
|
|
17
|
+
richtext: (metas: ValidatorMetas<Attribute.Email | Attribute.Password | Attribute.RichText | (Attribute.OfType<"string"> & Attribute.StringProperties & Attribute.ConfigurableOption & Attribute.DefaultOption<string> & Attribute.MinMaxLengthOption & Attribute.PrivateOption & Attribute.UniqueOption & Attribute.RequiredOption & Attribute.WritableOption & Attribute.VisibleOption) | Attribute.Text | Attribute.UID<never, string, Attribute.UIDOptions>>, options: ValidatorOptions) => import("yup").StringSchema<string | undefined, Record<string, any>, string | undefined>;
|
|
18
|
+
password: (metas: ValidatorMetas<Attribute.Email | Attribute.Password | Attribute.RichText | (Attribute.OfType<"string"> & Attribute.StringProperties & Attribute.ConfigurableOption & Attribute.DefaultOption<string> & Attribute.MinMaxLengthOption & Attribute.PrivateOption & Attribute.UniqueOption & Attribute.RequiredOption & Attribute.WritableOption & Attribute.VisibleOption) | Attribute.Text | Attribute.UID<never, string, Attribute.UIDOptions>>, options: ValidatorOptions) => import("yup").StringSchema<string | undefined, Record<string, any>, string | undefined>;
|
|
19
|
+
email: (metas: ValidatorMetas<Attribute.Email>, options: ValidatorOptions) => import("yup").StringSchema<string | undefined, Record<string, any>, string | undefined>;
|
|
20
|
+
enumeration: ({ attr }: {
|
|
21
|
+
attr: Attribute.Enumeration<[]>;
|
|
22
|
+
}) => import("yup").StringSchema<string | undefined, Record<string, any>, string | undefined>;
|
|
23
|
+
boolean: () => import("yup").BooleanSchema<boolean | undefined, Record<string, any>, boolean | undefined>;
|
|
24
|
+
uid: (metas: ValidatorMetas<Attribute.UID<never, string, Attribute.UIDOptions>>, options: ValidatorOptions) => import("yup").StringSchema<string | undefined, Record<string, any>, string | undefined>;
|
|
25
|
+
json: () => import("yup/lib/mixed").MixedSchema<any, Record<string, any>, any>;
|
|
26
|
+
integer: (metas: ValidatorMetas<Attribute.BigInteger | Attribute.Integer>) => import("yup").NumberSchema<number | undefined, Record<string, any>, number | undefined>;
|
|
27
|
+
biginteger: (metas: ValidatorMetas<Attribute.BigInteger>) => import("yup/lib/mixed").MixedSchema<any, Record<string, any>, any>;
|
|
28
|
+
float: (metas: ValidatorMetas<Attribute.Decimal | Attribute.Float>) => import("yup").NumberSchema<number | undefined, Record<string, any>, number | undefined>;
|
|
29
|
+
decimal: (metas: ValidatorMetas<Attribute.Decimal | Attribute.Float>) => import("yup").NumberSchema<number | undefined, Record<string, any>, number | undefined>;
|
|
30
|
+
date: (metas: ValidatorMetas<Attribute.DateTime | Attribute.Date | Attribute.Time | Attribute.Timestamp>) => import("yup/lib/mixed").MixedSchema<any, Record<string, any>, any>;
|
|
31
|
+
time: (metas: ValidatorMetas<Attribute.DateTime | Attribute.Date | Attribute.Time | Attribute.Timestamp>) => import("yup/lib/mixed").MixedSchema<any, Record<string, any>, any>;
|
|
32
|
+
datetime: (metas: ValidatorMetas<Attribute.DateTime | Attribute.Date | Attribute.Time | Attribute.Timestamp>) => import("yup/lib/mixed").MixedSchema<any, Record<string, any>, any>;
|
|
33
|
+
timestamp: (metas: ValidatorMetas<Attribute.DateTime | Attribute.Date | Attribute.Time | Attribute.Timestamp>) => import("yup/lib/mixed").MixedSchema<any, Record<string, any>, any>;
|
|
34
|
+
blocks: (metas: any, options: any) => import("yup").ArraySchema<any, import("yup/lib/types").AnyObject, any[] | undefined, any[] | undefined>;
|
|
35
|
+
};
|
|
36
|
+
export default _default;
|
|
@@ -0,0 +1,149 @@
|
|
|
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
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
7
|
+
const utils_1 = __importDefault(require("@strapi/utils"));
|
|
8
|
+
const blocks_validator_1 = __importDefault(require("./blocks-validator"));
|
|
9
|
+
const { yup } = utils_1.default;
|
|
10
|
+
/* Validator utils */
|
|
11
|
+
/**
|
|
12
|
+
* Adds minLength validator
|
|
13
|
+
*/
|
|
14
|
+
const addMinLengthValidator = (validator, { attr, }, { isDraft }) => {
|
|
15
|
+
return attr.minLength && lodash_1.default.isInteger(attr.minLength) && !isDraft
|
|
16
|
+
? validator.min(attr.minLength)
|
|
17
|
+
: validator;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Adds maxLength validator
|
|
21
|
+
* @returns {StringSchema}
|
|
22
|
+
*/
|
|
23
|
+
const addMaxLengthValidator = (validator, { attr, }) => {
|
|
24
|
+
return attr.maxLength && lodash_1.default.isInteger(attr.maxLength) ? validator.max(attr.maxLength) : validator;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Adds min integer validator
|
|
28
|
+
* @returns {NumberSchema}
|
|
29
|
+
*/
|
|
30
|
+
const addMinIntegerValidator = (validator, { attr, }) => (lodash_1.default.isNumber(attr.min) ? validator.min(lodash_1.default.toInteger(attr.min)) : validator);
|
|
31
|
+
/**
|
|
32
|
+
* Adds max integer validator
|
|
33
|
+
*/
|
|
34
|
+
const addMaxIntegerValidator = (validator, { attr, }) => (lodash_1.default.isNumber(attr.max) ? validator.max(lodash_1.default.toInteger(attr.max)) : validator);
|
|
35
|
+
/**
|
|
36
|
+
* Adds min float/decimal validator
|
|
37
|
+
*/
|
|
38
|
+
const addMinFloatValidator = (validator, { attr, }) => (lodash_1.default.isNumber(attr.min) ? validator.min(attr.min) : validator);
|
|
39
|
+
/**
|
|
40
|
+
* Adds max float/decimal validator
|
|
41
|
+
*/
|
|
42
|
+
const addMaxFloatValidator = (validator, { attr, }) => (lodash_1.default.isNumber(attr.max) ? validator.max(attr.max) : validator);
|
|
43
|
+
/**
|
|
44
|
+
* Adds regex validator
|
|
45
|
+
*/
|
|
46
|
+
const addStringRegexValidator = (validator, { attr, }) => {
|
|
47
|
+
return 'regex' in attr && !lodash_1.default.isUndefined(attr.regex)
|
|
48
|
+
? validator.matches(new RegExp(attr.regex), { excludeEmptyString: !attr.required })
|
|
49
|
+
: validator;
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Adds unique validator
|
|
53
|
+
*/
|
|
54
|
+
const addUniqueValidator = (validator, { attr, model, updatedAttribute, entity }) => {
|
|
55
|
+
if (attr.type !== 'uid' && !attr.unique) {
|
|
56
|
+
return validator;
|
|
57
|
+
}
|
|
58
|
+
return validator.test('unique', 'This attribute must be unique', async (value) => {
|
|
59
|
+
/**
|
|
60
|
+
* If the attribute value is `null` we want to skip the unique validation.
|
|
61
|
+
* Otherwise it'll only accept a single `null` entry in the database.
|
|
62
|
+
*/
|
|
63
|
+
if (lodash_1.default.isNil(updatedAttribute.value)) {
|
|
64
|
+
return true;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* If the attribute is unchanged we skip the unique verification. This will
|
|
68
|
+
* prevent the validator to be triggered in case the user activated the
|
|
69
|
+
* unique constraint after already creating multiple entries with
|
|
70
|
+
* the same attribute value for that field.
|
|
71
|
+
*/
|
|
72
|
+
if (entity && updatedAttribute.value === entity[updatedAttribute.name]) {
|
|
73
|
+
return true;
|
|
74
|
+
}
|
|
75
|
+
const whereParams = entity
|
|
76
|
+
? { $and: [{ [updatedAttribute.name]: value }, { $not: { id: entity.id } }] }
|
|
77
|
+
: { [updatedAttribute.name]: value };
|
|
78
|
+
const record = await strapi.query(model.uid).findOne({
|
|
79
|
+
select: ['id'],
|
|
80
|
+
where: whereParams,
|
|
81
|
+
});
|
|
82
|
+
return !record;
|
|
83
|
+
});
|
|
84
|
+
};
|
|
85
|
+
/* Type validators */
|
|
86
|
+
const stringValidator = (metas, options) => {
|
|
87
|
+
let schema = yup.string().transform((val, originalVal) => originalVal);
|
|
88
|
+
schema = addMinLengthValidator(schema, metas, options);
|
|
89
|
+
schema = addMaxLengthValidator(schema, metas);
|
|
90
|
+
schema = addStringRegexValidator(schema, metas);
|
|
91
|
+
schema = addUniqueValidator(schema, metas);
|
|
92
|
+
return schema;
|
|
93
|
+
};
|
|
94
|
+
const emailValidator = (metas, options) => {
|
|
95
|
+
const schema = stringValidator(metas, options);
|
|
96
|
+
return schema.email().min(1, '${path} cannot be empty');
|
|
97
|
+
};
|
|
98
|
+
const uidValidator = (metas, options) => {
|
|
99
|
+
const schema = stringValidator(metas, options);
|
|
100
|
+
return schema.matches(/^[A-Za-z0-9-_.~]*$/);
|
|
101
|
+
};
|
|
102
|
+
const enumerationValidator = ({ attr }) => {
|
|
103
|
+
return yup
|
|
104
|
+
.string()
|
|
105
|
+
.oneOf((Array.isArray(attr.enum) ? attr.enum : [attr.enum]).concat(null));
|
|
106
|
+
};
|
|
107
|
+
const integerValidator = (metas) => {
|
|
108
|
+
let schema = yup.number().integer();
|
|
109
|
+
schema = addMinIntegerValidator(schema, metas);
|
|
110
|
+
schema = addMaxIntegerValidator(schema, metas);
|
|
111
|
+
schema = addUniqueValidator(schema, metas);
|
|
112
|
+
return schema;
|
|
113
|
+
};
|
|
114
|
+
const floatValidator = (metas) => {
|
|
115
|
+
let schema = yup.number();
|
|
116
|
+
schema = addMinFloatValidator(schema, metas);
|
|
117
|
+
schema = addMaxFloatValidator(schema, metas);
|
|
118
|
+
schema = addUniqueValidator(schema, metas);
|
|
119
|
+
return schema;
|
|
120
|
+
};
|
|
121
|
+
const bigintegerValidator = (metas) => {
|
|
122
|
+
const schema = yup.mixed();
|
|
123
|
+
return addUniqueValidator(schema, metas);
|
|
124
|
+
};
|
|
125
|
+
const datesValidator = (metas) => {
|
|
126
|
+
const schema = yup.mixed();
|
|
127
|
+
return addUniqueValidator(schema, metas);
|
|
128
|
+
};
|
|
129
|
+
exports.default = {
|
|
130
|
+
string: stringValidator,
|
|
131
|
+
text: stringValidator,
|
|
132
|
+
richtext: stringValidator,
|
|
133
|
+
password: stringValidator,
|
|
134
|
+
email: emailValidator,
|
|
135
|
+
enumeration: enumerationValidator,
|
|
136
|
+
boolean: () => yup.boolean(),
|
|
137
|
+
uid: uidValidator,
|
|
138
|
+
json: () => yup.mixed(),
|
|
139
|
+
integer: integerValidator,
|
|
140
|
+
biginteger: bigintegerValidator,
|
|
141
|
+
float: floatValidator,
|
|
142
|
+
decimal: floatValidator,
|
|
143
|
+
date: datesValidator,
|
|
144
|
+
time: datesValidator,
|
|
145
|
+
datetime: datesValidator,
|
|
146
|
+
timestamp: datesValidator,
|
|
147
|
+
blocks: blocks_validator_1.default,
|
|
148
|
+
};
|
|
149
|
+
//# sourceMappingURL=validators.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validators.js","sourceRoot":"","sources":["../../../src/services/entity-validator/validators.ts"],"names":[],"mappings":";;;;;AAAA,oDAAuB;AACvB,0DAAwC;AAExC,0EAAiD;AAEjD,MAAM,EAAE,GAAG,EAAE,GAAG,eAAW,CAAC;AAa5B,qBAAqB;AAErB;;GAEG;AACH,MAAM,qBAAqB,GAAG,CAC5B,SAAuC,EACvC,EACE,IAAI,GASL,EACD,EAAE,OAAO,EAAwB,EACjC,EAAE;IACF,OAAO,IAAI,CAAC,SAAS,IAAI,gBAAC,CAAC,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO;QAC9D,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC;QAC/B,CAAC,CAAC,SAAS,CAAC;AAChB,CAAC,CAAC;AAEF;;;GAGG;AACH,MAAM,qBAAqB,GAAG,CAC5B,SAAuC,EACvC,EACE,IAAI,GASL,EACD,EAAE;IACF,OAAO,IAAI,CAAC,SAAS,IAAI,gBAAC,CAAC,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AACnG,CAAC,CAAC;AAEF;;;GAGG;AACH,MAAM,sBAAsB,GAAG,CAC7B,SAAuC,EACvC,EACE,IAAI,GAGL,EACD,EAAE,CAAC,CAAC,gBAAC,CAAC,QAAQ,CAAC,IAAI,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OAAO,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,OAAO,EAAE;IAC5B,GAAG,EAAE,YAAY;IACjB,IAAI,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE;IACvB,OAAO,EAAE,gBAAgB;IACzB,UAAU,EAAE,mBAAmB;IAC/B,KAAK,EAAE,cAAc;IACrB,OAAO,EAAE,cAAc;IACvB,IAAI,EAAE,cAAc;IACpB,IAAI,EAAE,cAAc;IACpB,QAAQ,EAAE,cAAc;IACxB,SAAS,EAAE,cAAc;IACzB,MAAM,EAAE,0BAAe;CACxB,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import createError from 'http-errors';
|
|
2
|
+
import { errors } from '@strapi/utils';
|
|
3
|
+
declare const formatApplicationError: (error: InstanceType<typeof errors.ApplicationError>) => {
|
|
4
|
+
status: number;
|
|
5
|
+
body: {
|
|
6
|
+
data: null;
|
|
7
|
+
error: {
|
|
8
|
+
status: number;
|
|
9
|
+
name: string;
|
|
10
|
+
message: string;
|
|
11
|
+
details: unknown;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
declare const formatHttpError: (error: createError.HttpError) => {
|
|
16
|
+
status: number;
|
|
17
|
+
body: {
|
|
18
|
+
data: null;
|
|
19
|
+
error: {
|
|
20
|
+
status: number;
|
|
21
|
+
name: string;
|
|
22
|
+
message: string;
|
|
23
|
+
details: any;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
declare const formatInternalError: (error: unknown) => {
|
|
28
|
+
status: number;
|
|
29
|
+
body: {
|
|
30
|
+
data: null;
|
|
31
|
+
error: {
|
|
32
|
+
status: number;
|
|
33
|
+
name: string;
|
|
34
|
+
message: string;
|
|
35
|
+
details: any;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
export { formatApplicationError, formatHttpError, formatInternalError };
|