@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
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const chalk = require('chalk');
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* @typedef {{ silent?: boolean; debug?: boolean; timestamp?: boolean; }} LoggerOptions
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* @typedef {object} Logger
|
|
11
|
-
* @property {number} warnings
|
|
12
|
-
* @property {number} errors
|
|
13
|
-
* @property {(...args: any[]) => void} debug
|
|
14
|
-
* @property {(...args: any[]) => void} info
|
|
15
|
-
* @property {(...args: any[]) => void} warn
|
|
16
|
-
* @property {(...args: any[]) => void} error
|
|
17
|
-
* @property {(...args: any[]) => void} log
|
|
18
|
-
*/
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* @type {(options: LoggerOptions) => Logger}
|
|
22
|
-
*/
|
|
23
|
-
const createLogger = (options = {}) => {
|
|
24
|
-
const { silent = false, debug = false, timestamp = true } = options;
|
|
25
|
-
|
|
26
|
-
const state = { errors: 0, warning: 0 };
|
|
27
|
-
|
|
28
|
-
return {
|
|
29
|
-
get warnings() {
|
|
30
|
-
return state.warning;
|
|
31
|
-
},
|
|
32
|
-
|
|
33
|
-
get errors() {
|
|
34
|
-
return state.errors;
|
|
35
|
-
},
|
|
36
|
-
|
|
37
|
-
debug(...args) {
|
|
38
|
-
if (silent || !debug) {
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
console.log(
|
|
43
|
-
chalk.cyan(`[DEBUG]${timestamp ? `\t[${new Date().toISOString()}]` : ''}`),
|
|
44
|
-
...args
|
|
45
|
-
);
|
|
46
|
-
},
|
|
47
|
-
|
|
48
|
-
info(...args) {
|
|
49
|
-
if (silent) {
|
|
50
|
-
return;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
console.info(
|
|
54
|
-
chalk.blue(`[INFO]${timestamp ? `\t[${new Date().toISOString()}]` : ''}`),
|
|
55
|
-
...args
|
|
56
|
-
);
|
|
57
|
-
},
|
|
58
|
-
|
|
59
|
-
log(...args) {
|
|
60
|
-
if (silent) {
|
|
61
|
-
return;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
console.info(chalk.blue(`${timestamp ? `\t[${new Date().toISOString()}]` : ''}`), ...args);
|
|
65
|
-
},
|
|
66
|
-
|
|
67
|
-
warn(...args) {
|
|
68
|
-
state.warning += 1;
|
|
69
|
-
|
|
70
|
-
if (silent) {
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
console.warn(
|
|
75
|
-
chalk.yellow(`[WARN]${timestamp ? `\t[${new Date().toISOString()}]` : ''}`),
|
|
76
|
-
...args
|
|
77
|
-
);
|
|
78
|
-
},
|
|
79
|
-
|
|
80
|
-
error(...args) {
|
|
81
|
-
state.errors += 1;
|
|
82
|
-
|
|
83
|
-
if (silent) {
|
|
84
|
-
return;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
console.error(
|
|
88
|
-
chalk.red(`[ERROR]${timestamp ? `\t[${new Date().toISOString()}]` : ''}`),
|
|
89
|
-
...args
|
|
90
|
-
);
|
|
91
|
-
},
|
|
92
|
-
};
|
|
93
|
-
};
|
|
94
|
-
|
|
95
|
-
module.exports = {
|
|
96
|
-
createLogger,
|
|
97
|
-
};
|
|
@@ -1,421 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const fs = require('fs/promises');
|
|
4
|
-
const path = require('path');
|
|
5
|
-
const chalk = require('chalk');
|
|
6
|
-
const yup = require('yup');
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Utility functions for loading and validating package.json
|
|
10
|
-
* this includes the specific validation of specific parts of
|
|
11
|
-
* the package.json.
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* The schema for the package.json that we expect,
|
|
16
|
-
* currently pretty loose.
|
|
17
|
-
*/
|
|
18
|
-
const packageJsonSchema = yup.object({
|
|
19
|
-
name: yup.string().required(),
|
|
20
|
-
version: yup.string().required(),
|
|
21
|
-
type: yup.string().matches(/(commonjs|module)/),
|
|
22
|
-
license: yup.string(),
|
|
23
|
-
bin: yup.mixed().oneOf([
|
|
24
|
-
yup.string(),
|
|
25
|
-
yup.object({
|
|
26
|
-
[yup.string()]: yup.string(),
|
|
27
|
-
}),
|
|
28
|
-
]),
|
|
29
|
-
main: yup.string(),
|
|
30
|
-
module: yup.string(),
|
|
31
|
-
source: yup.string(),
|
|
32
|
-
types: yup.string(),
|
|
33
|
-
exports: yup.lazy((value) =>
|
|
34
|
-
yup.object(
|
|
35
|
-
typeof value === 'object'
|
|
36
|
-
? Object.entries(value).reduce((acc, [key, value]) => {
|
|
37
|
-
if (typeof value === 'object') {
|
|
38
|
-
acc[key] = yup
|
|
39
|
-
.object({
|
|
40
|
-
types: yup.string(),
|
|
41
|
-
source: yup.string(),
|
|
42
|
-
import: yup.string(),
|
|
43
|
-
require: yup.string(),
|
|
44
|
-
default: yup.string(),
|
|
45
|
-
})
|
|
46
|
-
.noUnknown(true);
|
|
47
|
-
} else {
|
|
48
|
-
acc[key] = yup
|
|
49
|
-
.string()
|
|
50
|
-
.matches(/^\.\/.*\.json$/)
|
|
51
|
-
.required();
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
return acc;
|
|
55
|
-
}, {})
|
|
56
|
-
: undefined
|
|
57
|
-
)
|
|
58
|
-
),
|
|
59
|
-
files: yup.array(yup.string()),
|
|
60
|
-
scripts: yup.object(),
|
|
61
|
-
dependencies: yup.object(),
|
|
62
|
-
devDependencies: yup.object(),
|
|
63
|
-
peerDependencies: yup.object(),
|
|
64
|
-
engines: yup.object(),
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* @typedef {import('yup').Asserts<typeof packageJsonSchema>} PackageJson
|
|
69
|
-
*/
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* @description being a task to load the package.json starting from the current working directory
|
|
73
|
-
* using a shallow find for the package.json and `fs` to read the file. If no package.json is found,
|
|
74
|
-
* the process will throw with an appropriate error message.
|
|
75
|
-
*
|
|
76
|
-
* @type {(args: { cwd: string, logger: import('./logger').Logger }) => Promise<object>}
|
|
77
|
-
*/
|
|
78
|
-
const loadPkg = async ({ cwd, logger }) => {
|
|
79
|
-
const directory = path.resolve(cwd);
|
|
80
|
-
|
|
81
|
-
const pkgPath = path.join(directory, 'package.json');
|
|
82
|
-
|
|
83
|
-
const buffer = await fs.readFile(pkgPath).catch((err) => {
|
|
84
|
-
logger.debug(err);
|
|
85
|
-
throw new Error('Could not find a package.json in the current directory');
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
const pkg = JSON.parse(buffer.toString());
|
|
89
|
-
|
|
90
|
-
logger.debug('Loaded package.json: \n', pkg);
|
|
91
|
-
|
|
92
|
-
return pkg;
|
|
93
|
-
};
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
* @description validate the package.json against a standardised schema using `yup`.
|
|
97
|
-
* If the validation fails, the process will throw with an appropriate error message.
|
|
98
|
-
*
|
|
99
|
-
* @type {(args: { pkg: object }) => Promise<PackageJson | null>}
|
|
100
|
-
*/
|
|
101
|
-
const validatePkg = async ({ pkg }) => {
|
|
102
|
-
try {
|
|
103
|
-
const validatedPkg = await packageJsonSchema.validate(pkg, {
|
|
104
|
-
strict: true,
|
|
105
|
-
});
|
|
106
|
-
|
|
107
|
-
return validatedPkg;
|
|
108
|
-
} catch (err) {
|
|
109
|
-
if (err instanceof yup.ValidationError) {
|
|
110
|
-
switch (err.type) {
|
|
111
|
-
case 'required':
|
|
112
|
-
throw new Error(
|
|
113
|
-
`'${err.path}' in 'package.json' is required as type '${chalk.magenta(
|
|
114
|
-
yup.reach(packageJsonSchema, err.path).type
|
|
115
|
-
)}'`
|
|
116
|
-
);
|
|
117
|
-
case 'matches':
|
|
118
|
-
throw new Error(
|
|
119
|
-
`'${err.path}' in 'package.json' must be of type '${chalk.magenta(
|
|
120
|
-
err.params.regex
|
|
121
|
-
)}' (recieved the value '${chalk.magenta(err.params.value)}')`
|
|
122
|
-
);
|
|
123
|
-
/**
|
|
124
|
-
* This will only be thrown if there are keys in the export map
|
|
125
|
-
* that we don't expect so we can therefore make some assumptions
|
|
126
|
-
*/
|
|
127
|
-
case 'noUnknown':
|
|
128
|
-
throw new Error(
|
|
129
|
-
`'${err.path}' in 'package.json' contains the unknown key ${chalk.magenta(
|
|
130
|
-
err.params.unknown
|
|
131
|
-
)}, for compatability only the following keys are allowed: ${chalk.magenta(
|
|
132
|
-
"['types', 'source', 'import', 'require', 'default']"
|
|
133
|
-
)}`
|
|
134
|
-
);
|
|
135
|
-
default:
|
|
136
|
-
throw new Error(
|
|
137
|
-
`'${err.path}' in 'package.json' must be of type '${chalk.magenta(
|
|
138
|
-
err.params.type
|
|
139
|
-
)}' (recieved '${chalk.magenta(typeof err.params.value)}')`
|
|
140
|
-
);
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
throw err;
|
|
145
|
-
}
|
|
146
|
-
};
|
|
147
|
-
|
|
148
|
-
/**
|
|
149
|
-
* @description validate the `exports` property of the package.json against a set of rules.
|
|
150
|
-
* If the validation fails, the process will throw with an appropriate error message. If
|
|
151
|
-
* there is no `exports` property we check the standard export-like properties on the root
|
|
152
|
-
* of the package.json.
|
|
153
|
-
*
|
|
154
|
-
* @type {(args: { pkg: object, logger: import('./logger').Logger }) => Promise<PackageJson>}
|
|
155
|
-
*/
|
|
156
|
-
const validateExportsOrdering = async ({ pkg, logger }) => {
|
|
157
|
-
if (pkg.exports) {
|
|
158
|
-
const exports = Object.entries(pkg.exports);
|
|
159
|
-
|
|
160
|
-
for (const [expPath, exp] of exports) {
|
|
161
|
-
if (typeof exp === 'string') {
|
|
162
|
-
// eslint-disable-next-line no-continue
|
|
163
|
-
continue;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
const keys = Object.keys(exp);
|
|
167
|
-
|
|
168
|
-
if (!assertFirst('types', keys)) {
|
|
169
|
-
throw new Error(`exports["${expPath}"]: the 'types' property should be the first property`);
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
if (!assertOrder('import', 'require', keys)) {
|
|
173
|
-
logger.warn(
|
|
174
|
-
`exports["${expPath}"]: the 'import' property should come before the 'require' property`
|
|
175
|
-
);
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
if (!assertOrder('module', 'import', keys)) {
|
|
179
|
-
logger.warn(
|
|
180
|
-
`exports["${expPath}"]: the 'module' property should come before 'import' property`
|
|
181
|
-
);
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
if (!assertLast('default', keys)) {
|
|
185
|
-
throw new Error(
|
|
186
|
-
`exports["${expPath}"]: the 'default' property should be the last property`
|
|
187
|
-
);
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
} else if (!['main', 'module'].some((key) => Object.prototype.hasOwnProperty.call(pkg, key))) {
|
|
191
|
-
throw new Error(`'package.json' must contain a 'main' and 'module' property`);
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
return pkg;
|
|
195
|
-
};
|
|
196
|
-
|
|
197
|
-
/** @internal */
|
|
198
|
-
function assertFirst(key, arr) {
|
|
199
|
-
const aIdx = arr.indexOf(key);
|
|
200
|
-
|
|
201
|
-
// if not found, then we don't care
|
|
202
|
-
if (aIdx === -1) {
|
|
203
|
-
return true;
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
return aIdx === 0;
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
/** @internal */
|
|
210
|
-
function assertLast(key, arr) {
|
|
211
|
-
const aIdx = arr.indexOf(key);
|
|
212
|
-
|
|
213
|
-
// if not found, then we don't care
|
|
214
|
-
if (aIdx === -1) {
|
|
215
|
-
return true;
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
return aIdx === arr.length - 1;
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
/** @internal */
|
|
222
|
-
function assertOrder(keyA, keyB, arr) {
|
|
223
|
-
const aIdx = arr.indexOf(keyA);
|
|
224
|
-
const bIdx = arr.indexOf(keyB);
|
|
225
|
-
|
|
226
|
-
// if either is not found, then we don't care
|
|
227
|
-
if (aIdx === -1 || bIdx === -1) {
|
|
228
|
-
return true;
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
return aIdx < bIdx;
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
/**
|
|
235
|
-
* @typedef {Object} Extensions
|
|
236
|
-
* @property {string} commonjs
|
|
237
|
-
* @property {string} esm
|
|
238
|
-
*/
|
|
239
|
-
|
|
240
|
-
/**
|
|
241
|
-
* @typedef {Object} ExtMap
|
|
242
|
-
* @property {Extensions} commonjs
|
|
243
|
-
* @property {Extensions} esm
|
|
244
|
-
*/
|
|
245
|
-
|
|
246
|
-
/**
|
|
247
|
-
* @internal
|
|
248
|
-
*
|
|
249
|
-
* @type {ExtMap}
|
|
250
|
-
*/
|
|
251
|
-
const DEFAULT_PKG_EXT_MAP = {
|
|
252
|
-
// pkg.type: "commonjs"
|
|
253
|
-
commonjs: {
|
|
254
|
-
cjs: '.js',
|
|
255
|
-
es: '.mjs',
|
|
256
|
-
},
|
|
257
|
-
|
|
258
|
-
// pkg.type: "module"
|
|
259
|
-
module: {
|
|
260
|
-
cjs: '.cjs',
|
|
261
|
-
es: '.js',
|
|
262
|
-
},
|
|
263
|
-
};
|
|
264
|
-
|
|
265
|
-
/**
|
|
266
|
-
* We potentially might need to support legacy exports or as package
|
|
267
|
-
* development continues we have space to tweak this.
|
|
268
|
-
*
|
|
269
|
-
* @type {() => ExtMap}
|
|
270
|
-
*/
|
|
271
|
-
const getExportExtensionMap = () => {
|
|
272
|
-
return DEFAULT_PKG_EXT_MAP;
|
|
273
|
-
};
|
|
274
|
-
|
|
275
|
-
/**
|
|
276
|
-
* @internal
|
|
277
|
-
*
|
|
278
|
-
* @description validate the `require` and `import` properties of a given exports maps from the package.json
|
|
279
|
-
* returning if any errors are found.
|
|
280
|
-
*
|
|
281
|
-
* @type {(_exports: unknown, options: {extMap: ExtMap; pkg: PackageJson}) => string[]}
|
|
282
|
-
*/
|
|
283
|
-
const validateExports = (_exports, options) => {
|
|
284
|
-
const { extMap, pkg } = options;
|
|
285
|
-
const ext = extMap[pkg.type || 'commonjs'];
|
|
286
|
-
|
|
287
|
-
const errors = [];
|
|
288
|
-
|
|
289
|
-
for (const exp of _exports) {
|
|
290
|
-
if (exp.require && !exp.require.endsWith(ext.cjs)) {
|
|
291
|
-
errors.push(
|
|
292
|
-
`package.json with \`type: "${pkg.type}"\` - \`exports["${exp._path}"].require\` must end with "${ext.cjs}"`
|
|
293
|
-
);
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
if (exp.import && !exp.import.endsWith(ext.es)) {
|
|
297
|
-
errors.push(
|
|
298
|
-
`package.json with \`type: "${pkg.type}"\` - \`exports["${exp._path}"].import\` must end with "${ext.es}"`
|
|
299
|
-
);
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
return errors;
|
|
304
|
-
};
|
|
305
|
-
|
|
306
|
-
/**
|
|
307
|
-
* @typedef {Object} Export
|
|
308
|
-
* @property {string} _path the path of the export, `.` for the root.
|
|
309
|
-
* @property {string=} types the path to the types file
|
|
310
|
-
* @property {string} source the path to the source file
|
|
311
|
-
* @property {string=} require the path to the commonjs require file
|
|
312
|
-
* @property {string=} import the path to the esm import file
|
|
313
|
-
* @property {string=} default the path to the default file
|
|
314
|
-
*/
|
|
315
|
-
|
|
316
|
-
/**
|
|
317
|
-
* @description parse the exports map from the package.json into a standardised
|
|
318
|
-
* format that we can use to generate build tasks from.
|
|
319
|
-
*
|
|
320
|
-
* @type {(args: { extMap: ExtMap, pkg: PackageJson }) => Export[]}
|
|
321
|
-
*/
|
|
322
|
-
const parseExports = ({ extMap, pkg }) => {
|
|
323
|
-
/**
|
|
324
|
-
* @type {Export}
|
|
325
|
-
*/
|
|
326
|
-
const rootExport = {
|
|
327
|
-
_path: '.',
|
|
328
|
-
types: pkg.types,
|
|
329
|
-
source: pkg.source,
|
|
330
|
-
require: pkg.main,
|
|
331
|
-
import: pkg.module,
|
|
332
|
-
default: pkg.module || pkg.main,
|
|
333
|
-
};
|
|
334
|
-
|
|
335
|
-
/**
|
|
336
|
-
* @type {Export[]}
|
|
337
|
-
*/
|
|
338
|
-
const extraExports = [];
|
|
339
|
-
|
|
340
|
-
/**
|
|
341
|
-
* @type {string[]}
|
|
342
|
-
*/
|
|
343
|
-
const errors = [];
|
|
344
|
-
|
|
345
|
-
if (pkg.exports) {
|
|
346
|
-
if (!pkg.exports['./package.json']) {
|
|
347
|
-
errors.push('package.json: `exports["./package.json"] must be declared.');
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
Object.entries(pkg.exports).forEach(([path, entry]) => {
|
|
351
|
-
if (path.endsWith('.json')) {
|
|
352
|
-
if (path === './package.json' && entry !== './package.json') {
|
|
353
|
-
errors.push(`package.json: 'exports["./package.json"]' must be './package.json'.`);
|
|
354
|
-
}
|
|
355
|
-
} else if (Boolean(entry) && typeof entry === 'object' && !Array.isArray(entry)) {
|
|
356
|
-
if (path === '.') {
|
|
357
|
-
if (entry.require && rootExport.require && entry.require !== rootExport.require) {
|
|
358
|
-
errors.push(
|
|
359
|
-
`package.json: mismatch between 'main' and 'exports.require'. These must be equal.`
|
|
360
|
-
);
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
if (entry.import && rootExport.import && entry.import !== rootExport.import) {
|
|
364
|
-
errors.push(
|
|
365
|
-
`package.json: mismatch between 'module' and 'exports.import' These must be equal.`
|
|
366
|
-
);
|
|
367
|
-
}
|
|
368
|
-
|
|
369
|
-
if (entry.types && rootExport.types && entry.types !== rootExport.types) {
|
|
370
|
-
errors.push(
|
|
371
|
-
`package.json: mismatch between 'types' and 'exports.types'. These must be equal.`
|
|
372
|
-
);
|
|
373
|
-
}
|
|
374
|
-
|
|
375
|
-
if (entry.source && rootExport.source && entry.source !== rootExport.source) {
|
|
376
|
-
errors.push(
|
|
377
|
-
`package.json: mismatch between 'source' and 'exports.source'. These must be equal.`
|
|
378
|
-
);
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
Object.assign(rootExport, entry);
|
|
382
|
-
} else {
|
|
383
|
-
const extraExport = {
|
|
384
|
-
_exported: true,
|
|
385
|
-
_path: path,
|
|
386
|
-
...entry,
|
|
387
|
-
};
|
|
388
|
-
|
|
389
|
-
extraExports.push(extraExport);
|
|
390
|
-
}
|
|
391
|
-
} else {
|
|
392
|
-
errors.push('package.json: exports must be an object');
|
|
393
|
-
}
|
|
394
|
-
});
|
|
395
|
-
}
|
|
396
|
-
|
|
397
|
-
const _exports = [
|
|
398
|
-
/**
|
|
399
|
-
* In the case of strapi plugins, we don't have a root export because we
|
|
400
|
-
* ship a server side and client side package. So this can be completely omitted.
|
|
401
|
-
*/
|
|
402
|
-
Object.values(rootExport).some((exp) => exp !== rootExport._path && Boolean(exp)) && rootExport,
|
|
403
|
-
...extraExports,
|
|
404
|
-
].filter(Boolean);
|
|
405
|
-
|
|
406
|
-
errors.push(...validateExports(_exports, { extMap, pkg }));
|
|
407
|
-
|
|
408
|
-
if (errors.length) {
|
|
409
|
-
throw new Error(`\n- ${errors.join('\n- ')}`);
|
|
410
|
-
}
|
|
411
|
-
|
|
412
|
-
return _exports;
|
|
413
|
-
};
|
|
414
|
-
|
|
415
|
-
module.exports = {
|
|
416
|
-
loadPkg,
|
|
417
|
-
validatePkg,
|
|
418
|
-
validateExportsOrdering,
|
|
419
|
-
getExportExtensionMap,
|
|
420
|
-
parseExports,
|
|
421
|
-
};
|
package/lib/compile.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const tsUtils = require('@strapi/typescript-utils');
|
|
4
|
-
|
|
5
|
-
module.exports = async (dir) => {
|
|
6
|
-
const appDir = dir || process.cwd();
|
|
7
|
-
const isTSProject = await tsUtils.isUsingTypeScript(appDir);
|
|
8
|
-
const outDir = await tsUtils.resolveOutDir(appDir);
|
|
9
|
-
|
|
10
|
-
if (isTSProject) {
|
|
11
|
-
await tsUtils.compile(appDir, {
|
|
12
|
-
watch: false,
|
|
13
|
-
configOptions: { options: { incremental: true } },
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
const distDir = isTSProject ? outDir : appDir;
|
|
18
|
-
|
|
19
|
-
return { appDir, distDir };
|
|
20
|
-
};
|
package/lib/container.js
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const createContainer = (strapi) => {
|
|
4
|
-
const registered = new Map();
|
|
5
|
-
const resolved = new Map();
|
|
6
|
-
|
|
7
|
-
return {
|
|
8
|
-
register(name, resolver) {
|
|
9
|
-
if (registered.has(name)) {
|
|
10
|
-
throw new Error(`Cannot register already registered service ${name}`);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
registered.set(name, resolver);
|
|
14
|
-
return this;
|
|
15
|
-
},
|
|
16
|
-
|
|
17
|
-
get(name, args) {
|
|
18
|
-
// TODO: handle singleton vs reinstanciation everytime
|
|
19
|
-
if (resolved.has(name)) {
|
|
20
|
-
return resolved.get(name);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
if (registered.has(name)) {
|
|
24
|
-
const resolver = registered.get(name);
|
|
25
|
-
|
|
26
|
-
if (typeof resolver === 'function') {
|
|
27
|
-
resolved.set(name, resolver({ strapi }, args));
|
|
28
|
-
} else {
|
|
29
|
-
resolved.set(name, resolver);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
return resolved.get(name);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
throw new Error(`Could not resolve service ${name}`);
|
|
36
|
-
},
|
|
37
|
-
|
|
38
|
-
// TODO: implement
|
|
39
|
-
extend() {},
|
|
40
|
-
};
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
module.exports = {
|
|
44
|
-
createContainer,
|
|
45
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const path = require('path');
|
|
4
|
-
const fs = require('fs');
|
|
5
|
-
const loadFile = require('./load-config-file');
|
|
6
|
-
|
|
7
|
-
const VALID_EXTENSIONS = ['.js', '.json'];
|
|
8
|
-
|
|
9
|
-
module.exports = (dir) => {
|
|
10
|
-
if (!fs.existsSync(dir)) return {};
|
|
11
|
-
|
|
12
|
-
return fs
|
|
13
|
-
.readdirSync(dir, { withFileTypes: true })
|
|
14
|
-
.filter((file) => file.isFile() && VALID_EXTENSIONS.includes(path.extname(file.name)))
|
|
15
|
-
.reduce((acc, file) => {
|
|
16
|
-
const key = path.basename(file.name, path.extname(file.name));
|
|
17
|
-
|
|
18
|
-
acc[key] = loadFile(path.resolve(dir, file.name));
|
|
19
|
-
|
|
20
|
-
return acc;
|
|
21
|
-
}, {});
|
|
22
|
-
};
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const os = require('os');
|
|
4
|
-
const path = require('path');
|
|
5
|
-
const _ = require('lodash');
|
|
6
|
-
const { omit } = require('lodash/fp');
|
|
7
|
-
const dotenv = require('dotenv');
|
|
8
|
-
|
|
9
|
-
dotenv.config({ path: process.env.ENV_PATH });
|
|
10
|
-
|
|
11
|
-
process.env.NODE_ENV = process.env.NODE_ENV || 'development';
|
|
12
|
-
|
|
13
|
-
const loadConfigDir = require('./config-loader');
|
|
14
|
-
|
|
15
|
-
const { version: strapiVersion } = require(path.join(__dirname, '../../../package.json'));
|
|
16
|
-
|
|
17
|
-
const defaultConfig = {
|
|
18
|
-
server: {
|
|
19
|
-
host: process.env.HOST || os.hostname() || 'localhost',
|
|
20
|
-
port: process.env.PORT || 1337,
|
|
21
|
-
proxy: false,
|
|
22
|
-
cron: { enabled: false },
|
|
23
|
-
admin: { autoOpen: false },
|
|
24
|
-
dirs: { public: './public' },
|
|
25
|
-
},
|
|
26
|
-
admin: {},
|
|
27
|
-
api: {
|
|
28
|
-
rest: {
|
|
29
|
-
prefix: '/api',
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
module.exports = (dirs, initialConfig = {}) => {
|
|
35
|
-
const { appDir, distDir } = dirs;
|
|
36
|
-
const { autoReload = false, serveAdminPanel = true } = initialConfig;
|
|
37
|
-
|
|
38
|
-
const pkgJSON = require(path.resolve(appDir, 'package.json'));
|
|
39
|
-
|
|
40
|
-
const configDir = path.resolve(distDir || process.cwd(), 'config');
|
|
41
|
-
|
|
42
|
-
const rootConfig = {
|
|
43
|
-
launchedAt: Date.now(),
|
|
44
|
-
serveAdminPanel,
|
|
45
|
-
autoReload,
|
|
46
|
-
environment: process.env.NODE_ENV,
|
|
47
|
-
uuid: _.get(pkgJSON, 'strapi.uuid'),
|
|
48
|
-
packageJsonStrapi: _.omit(_.get(pkgJSON, 'strapi', {}), 'uuid'),
|
|
49
|
-
info: {
|
|
50
|
-
...pkgJSON,
|
|
51
|
-
strapi: strapiVersion,
|
|
52
|
-
},
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
const baseConfig = omit('plugins', loadConfigDir(configDir)); // plugin config will be loaded later
|
|
56
|
-
|
|
57
|
-
const envDir = path.resolve(configDir, 'env', process.env.NODE_ENV);
|
|
58
|
-
const envConfig = loadConfigDir(envDir);
|
|
59
|
-
|
|
60
|
-
return _.merge(rootConfig, defaultConfig, baseConfig, envConfig);
|
|
61
|
-
};
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const path = require('path');
|
|
4
|
-
const fs = require('fs');
|
|
5
|
-
const { templateConfiguration, env, importDefault } = require('@strapi/utils');
|
|
6
|
-
|
|
7
|
-
const loadJsFile = (file) => {
|
|
8
|
-
try {
|
|
9
|
-
const jsModule = importDefault(file);
|
|
10
|
-
|
|
11
|
-
// call if function
|
|
12
|
-
if (typeof jsModule === 'function') {
|
|
13
|
-
return jsModule({ env });
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
return jsModule;
|
|
17
|
-
} catch (error) {
|
|
18
|
-
throw new Error(`Could not load js config file ${file}: ${error.message}`);
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
const loadJSONFile = (file) => {
|
|
23
|
-
try {
|
|
24
|
-
return templateConfiguration(JSON.parse(fs.readFileSync(file)));
|
|
25
|
-
} catch (error) {
|
|
26
|
-
throw new Error(`Could not load json config file ${file}: ${error.message}`);
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
const loadFile = (file) => {
|
|
31
|
-
const ext = path.extname(file);
|
|
32
|
-
|
|
33
|
-
switch (ext) {
|
|
34
|
-
case '.js':
|
|
35
|
-
return loadJsFile(file);
|
|
36
|
-
case '.json':
|
|
37
|
-
return loadJSONFile(file);
|
|
38
|
-
default:
|
|
39
|
-
return {};
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
module.exports = loadFile;
|