@strapi/core 0.0.0-experimental.651a6b8ded3c452fedf2a8598f08c51c214e6cf7 → 0.0.0-experimental.80cf2c74a2003f3c0602abc81888dd9f36dc68a3
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.
Potentially problematic release.
This version of @strapi/core might be problematic. Click here for more details.
- package/dist/Strapi.d.ts +38 -36
- package/dist/Strapi.d.ts.map +1 -1
- package/dist/Strapi.js +31 -16
- package/dist/Strapi.js.map +1 -1
- package/dist/Strapi.mjs +31 -16
- package/dist/Strapi.mjs.map +1 -1
- package/dist/configuration/index.d.ts.map +1 -1
- package/dist/configuration/index.js +4 -4
- package/dist/configuration/index.js.map +1 -1
- package/dist/configuration/index.mjs +1 -1
- package/dist/configuration/index.mjs.map +1 -1
- package/dist/configuration/urls.d.ts +8 -0
- package/dist/configuration/urls.d.ts.map +1 -0
- package/dist/configuration/urls.js +68 -0
- package/dist/configuration/urls.js.map +1 -0
- package/dist/configuration/urls.mjs +66 -0
- package/dist/configuration/urls.mjs.map +1 -0
- package/dist/container.d.ts +2 -2
- package/dist/container.d.ts.map +1 -1
- package/dist/container.js.map +1 -1
- package/dist/container.mjs.map +1 -1
- package/dist/core-api/controller/collection-type.d.ts +3 -3
- package/dist/core-api/controller/collection-type.d.ts.map +1 -1
- package/dist/core-api/controller/collection-type.js.map +1 -1
- package/dist/core-api/controller/collection-type.mjs.map +1 -1
- package/dist/core-api/controller/index.d.ts +3 -3
- package/dist/core-api/controller/index.d.ts.map +1 -1
- package/dist/core-api/controller/index.js +6 -1
- package/dist/core-api/controller/index.js.map +1 -1
- package/dist/core-api/controller/index.mjs +6 -1
- package/dist/core-api/controller/index.mjs.map +1 -1
- package/dist/core-api/controller/single-type.d.ts +3 -3
- package/dist/core-api/controller/single-type.d.ts.map +1 -1
- package/dist/core-api/controller/single-type.js.map +1 -1
- package/dist/core-api/controller/single-type.mjs.map +1 -1
- package/dist/core-api/controller/transform.d.ts +10 -9
- package/dist/core-api/controller/transform.d.ts.map +1 -1
- package/dist/core-api/controller/transform.js +19 -13
- package/dist/core-api/controller/transform.js.map +1 -1
- package/dist/core-api/controller/transform.mjs +19 -13
- package/dist/core-api/controller/transform.mjs.map +1 -1
- package/dist/core-api/service/collection-type.d.ts +10 -10
- package/dist/core-api/service/collection-type.d.ts.map +1 -1
- package/dist/core-api/service/collection-type.js.map +1 -1
- package/dist/core-api/service/collection-type.mjs.map +1 -1
- package/dist/core-api/service/index.d.ts +3 -3
- package/dist/core-api/service/index.d.ts.map +1 -1
- package/dist/core-api/service/index.js.map +1 -1
- package/dist/core-api/service/index.mjs.map +1 -1
- package/dist/core-api/service/single-type.d.ts +5 -5
- package/dist/core-api/service/single-type.d.ts.map +1 -1
- package/dist/core-api/service/single-type.js +3 -4
- package/dist/core-api/service/single-type.js.map +1 -1
- package/dist/core-api/service/single-type.mjs +3 -4
- package/dist/core-api/service/single-type.mjs.map +1 -1
- package/dist/domain/content-type/index.d.ts +1 -1
- package/dist/domain/content-type/index.d.ts.map +1 -1
- package/dist/domain/content-type/index.js +3 -0
- package/dist/domain/content-type/index.js.map +1 -1
- package/dist/domain/content-type/index.mjs +3 -0
- package/dist/domain/content-type/index.mjs.map +1 -1
- package/dist/domain/content-type/validator.d.ts.map +1 -1
- package/dist/domain/content-type/validator.js +1 -1
- package/dist/domain/content-type/validator.js.map +1 -1
- package/dist/domain/content-type/validator.mjs +2 -2
- package/dist/domain/content-type/validator.mjs.map +1 -1
- package/dist/domain/module/index.d.ts +24 -23
- package/dist/domain/module/index.d.ts.map +1 -1
- package/dist/domain/module/index.js +3 -3
- package/dist/domain/module/index.js.map +1 -1
- package/dist/domain/module/index.mjs +4 -4
- package/dist/domain/module/index.mjs.map +1 -1
- package/dist/ee/index.d.ts +2 -2
- package/dist/ee/index.d.ts.map +1 -1
- package/dist/ee/index.js.map +1 -1
- package/dist/ee/index.mjs.map +1 -1
- package/dist/ee/license.d.ts +2 -2
- package/dist/ee/license.d.ts.map +1 -1
- package/dist/ee/license.js.map +1 -1
- package/dist/ee/license.mjs.map +1 -1
- package/dist/factories.d.ts +10 -10
- package/dist/factories.d.ts.map +1 -1
- package/dist/factories.js +6 -2
- package/dist/factories.js.map +1 -1
- package/dist/factories.mjs +6 -2
- package/dist/factories.mjs.map +1 -1
- package/dist/loaders/admin.d.ts +2 -2
- package/dist/loaders/admin.d.ts.map +1 -1
- package/dist/loaders/admin.js.map +1 -1
- package/dist/loaders/admin.mjs.map +1 -1
- package/dist/loaders/apis.d.ts +2 -2
- package/dist/loaders/apis.d.ts.map +1 -1
- package/dist/loaders/apis.js +1 -1
- package/dist/loaders/apis.js.map +1 -1
- package/dist/loaders/apis.mjs +2 -2
- package/dist/loaders/apis.mjs.map +1 -1
- package/dist/loaders/components.d.ts +2 -2
- package/dist/loaders/components.d.ts.map +1 -1
- package/dist/loaders/components.js.map +1 -1
- package/dist/loaders/components.mjs.map +1 -1
- package/dist/loaders/index.d.ts +2 -2
- package/dist/loaders/index.d.ts.map +1 -1
- package/dist/loaders/index.js.map +1 -1
- package/dist/loaders/index.mjs.map +1 -1
- package/dist/loaders/middlewares.d.ts +2 -2
- package/dist/loaders/middlewares.d.ts.map +1 -1
- package/dist/loaders/middlewares.js.map +1 -1
- package/dist/loaders/middlewares.mjs.map +1 -1
- package/dist/loaders/plugins/get-enabled-plugins.d.ts +2 -2
- package/dist/loaders/plugins/get-enabled-plugins.d.ts.map +1 -1
- package/dist/loaders/plugins/get-enabled-plugins.js +2 -1
- package/dist/loaders/plugins/get-enabled-plugins.js.map +1 -1
- package/dist/loaders/plugins/get-enabled-plugins.mjs +3 -2
- package/dist/loaders/plugins/get-enabled-plugins.mjs.map +1 -1
- package/dist/loaders/plugins/index.d.ts +2 -2
- package/dist/loaders/plugins/index.d.ts.map +1 -1
- package/dist/loaders/plugins/index.js.map +1 -1
- package/dist/loaders/plugins/index.mjs.map +1 -1
- package/dist/loaders/policies.d.ts +2 -2
- package/dist/loaders/policies.d.ts.map +1 -1
- package/dist/loaders/policies.js.map +1 -1
- package/dist/loaders/policies.mjs.map +1 -1
- package/dist/loaders/sanitizers.d.ts +2 -2
- package/dist/loaders/sanitizers.d.ts.map +1 -1
- package/dist/loaders/sanitizers.js.map +1 -1
- package/dist/loaders/sanitizers.mjs.map +1 -1
- package/dist/loaders/src-index.d.ts +2 -2
- package/dist/loaders/src-index.d.ts.map +1 -1
- package/dist/loaders/src-index.js.map +1 -1
- package/dist/loaders/src-index.mjs.map +1 -1
- package/dist/loaders/validators.d.ts +2 -2
- package/dist/loaders/validators.d.ts.map +1 -1
- package/dist/loaders/validators.js.map +1 -1
- package/dist/loaders/validators.mjs.map +1 -1
- package/dist/middlewares/body.d.ts +2 -2
- package/dist/middlewares/body.d.ts.map +1 -1
- package/dist/middlewares/body.js.map +1 -1
- package/dist/middlewares/body.mjs.map +1 -1
- package/dist/middlewares/compression.d.ts +2 -2
- package/dist/middlewares/compression.d.ts.map +1 -1
- package/dist/middlewares/compression.js.map +1 -1
- package/dist/middlewares/compression.mjs.map +1 -1
- package/dist/middlewares/cors.d.ts +2 -2
- package/dist/middlewares/cors.d.ts.map +1 -1
- package/dist/middlewares/cors.js.map +1 -1
- package/dist/middlewares/cors.mjs.map +1 -1
- package/dist/middlewares/errors.d.ts +2 -2
- package/dist/middlewares/errors.d.ts.map +1 -1
- package/dist/middlewares/errors.js.map +1 -1
- package/dist/middlewares/errors.mjs.map +1 -1
- package/dist/middlewares/favicon.d.ts +2 -2
- package/dist/middlewares/favicon.d.ts.map +1 -1
- package/dist/middlewares/favicon.js.map +1 -1
- package/dist/middlewares/favicon.mjs.map +1 -1
- package/dist/middlewares/index.d.ts +2 -2
- package/dist/middlewares/index.d.ts.map +1 -1
- package/dist/middlewares/index.js.map +1 -1
- package/dist/middlewares/index.mjs.map +1 -1
- package/dist/middlewares/ip.d.ts +2 -2
- package/dist/middlewares/ip.d.ts.map +1 -1
- package/dist/middlewares/ip.js.map +1 -1
- package/dist/middlewares/ip.mjs.map +1 -1
- package/dist/middlewares/logger.d.ts +2 -2
- package/dist/middlewares/logger.d.ts.map +1 -1
- package/dist/middlewares/logger.js.map +1 -1
- package/dist/middlewares/logger.mjs.map +1 -1
- package/dist/middlewares/powered-by.d.ts +2 -2
- package/dist/middlewares/powered-by.d.ts.map +1 -1
- package/dist/middlewares/powered-by.js.map +1 -1
- package/dist/middlewares/powered-by.mjs.map +1 -1
- package/dist/middlewares/public.d.ts +2 -2
- package/dist/middlewares/public.d.ts.map +1 -1
- package/dist/middlewares/public.js.map +1 -1
- package/dist/middlewares/public.mjs.map +1 -1
- package/dist/middlewares/query.d.ts +2 -2
- package/dist/middlewares/query.d.ts.map +1 -1
- package/dist/middlewares/query.js.map +1 -1
- package/dist/middlewares/query.mjs.map +1 -1
- package/dist/middlewares/response-time.d.ts +2 -2
- package/dist/middlewares/response-time.d.ts.map +1 -1
- package/dist/middlewares/response-time.js.map +1 -1
- package/dist/middlewares/response-time.mjs.map +1 -1
- package/dist/middlewares/responses.d.ts +3 -3
- package/dist/middlewares/responses.d.ts.map +1 -1
- package/dist/middlewares/responses.js.map +1 -1
- package/dist/middlewares/responses.mjs.map +1 -1
- package/dist/middlewares/security.d.ts +2 -2
- package/dist/middlewares/security.d.ts.map +1 -1
- package/dist/middlewares/security.js +2 -2
- package/dist/middlewares/security.js.map +1 -1
- package/dist/middlewares/security.mjs +2 -2
- package/dist/middlewares/security.mjs.map +1 -1
- package/dist/middlewares/session.d.ts +2 -2
- package/dist/middlewares/session.d.ts.map +1 -1
- package/dist/middlewares/session.js.map +1 -1
- package/dist/middlewares/session.mjs.map +1 -1
- package/dist/migrations/draft-publish.d.ts +17 -0
- package/dist/migrations/draft-publish.d.ts.map +1 -0
- package/dist/migrations/draft-publish.js +59 -0
- package/dist/migrations/draft-publish.js.map +1 -0
- package/dist/migrations/draft-publish.mjs +59 -0
- package/dist/migrations/draft-publish.mjs.map +1 -0
- package/dist/registries/apis.d.ts +2 -2
- package/dist/registries/apis.d.ts.map +1 -1
- package/dist/registries/apis.js.map +1 -1
- package/dist/registries/apis.mjs.map +1 -1
- package/dist/registries/components.d.ts +6 -6
- package/dist/registries/components.d.ts.map +1 -1
- package/dist/registries/components.js.map +1 -1
- package/dist/registries/components.mjs.map +1 -1
- package/dist/registries/config.d.ts +2 -2
- package/dist/registries/config.d.ts.map +1 -1
- package/dist/registries/config.js +26 -6
- package/dist/registries/config.js.map +1 -1
- package/dist/registries/config.mjs +27 -5
- package/dist/registries/config.mjs.map +1 -1
- package/dist/registries/content-types.d.ts +5 -5
- package/dist/registries/content-types.d.ts.map +1 -1
- package/dist/registries/content-types.js.map +1 -1
- package/dist/registries/content-types.mjs.map +1 -1
- package/dist/registries/controllers.d.ts +10 -10
- package/dist/registries/controllers.d.ts.map +1 -1
- package/dist/registries/controllers.js.map +1 -1
- package/dist/registries/controllers.mjs.map +1 -1
- package/dist/registries/custom-fields.d.ts +3 -3
- package/dist/registries/custom-fields.d.ts.map +1 -1
- package/dist/registries/custom-fields.js.map +1 -1
- package/dist/registries/custom-fields.mjs.map +1 -1
- package/dist/registries/middlewares.d.ts +6 -6
- package/dist/registries/middlewares.d.ts.map +1 -1
- package/dist/registries/middlewares.js.map +1 -1
- package/dist/registries/middlewares.mjs.map +1 -1
- package/dist/registries/modules.d.ts +2 -2
- package/dist/registries/modules.d.ts.map +1 -1
- package/dist/registries/modules.js.map +1 -1
- package/dist/registries/modules.mjs.map +1 -1
- package/dist/registries/plugins.d.ts +5 -5
- package/dist/registries/plugins.d.ts.map +1 -1
- package/dist/registries/plugins.js.map +1 -1
- package/dist/registries/plugins.mjs.map +1 -1
- package/dist/registries/policies.d.ts +6 -6
- package/dist/registries/policies.d.ts.map +1 -1
- package/dist/registries/policies.js.map +1 -1
- package/dist/registries/policies.mjs.map +1 -1
- package/dist/registries/services.d.ts +8 -8
- package/dist/registries/services.d.ts.map +1 -1
- package/dist/registries/services.js.map +1 -1
- package/dist/registries/services.mjs.map +1 -1
- package/dist/services/auth/index.d.ts +4 -4
- package/dist/services/auth/index.d.ts.map +1 -1
- package/dist/services/auth/index.js.map +1 -1
- package/dist/services/auth/index.mjs.map +1 -1
- package/dist/services/content-api/index.d.ts +3 -3
- package/dist/services/content-api/index.d.ts.map +1 -1
- package/dist/services/content-api/index.js.map +1 -1
- package/dist/services/content-api/index.mjs.map +1 -1
- package/dist/services/content-api/permissions/index.d.ts +3 -3
- package/dist/services/content-api/permissions/index.d.ts.map +1 -1
- package/dist/services/content-api/permissions/index.js.map +1 -1
- package/dist/services/content-api/permissions/index.mjs.map +1 -1
- package/dist/services/cron.d.ts +2 -2
- package/dist/services/cron.d.ts.map +1 -1
- package/dist/services/cron.js.map +1 -1
- package/dist/services/cron.mjs.map +1 -1
- package/dist/services/custom-fields.d.ts +2 -2
- package/dist/services/custom-fields.d.ts.map +1 -1
- package/dist/services/custom-fields.js.map +1 -1
- package/dist/services/custom-fields.mjs.map +1 -1
- package/dist/services/document-service/common.d.ts +2 -2
- package/dist/services/document-service/common.d.ts.map +1 -1
- package/dist/services/document-service/common.js.map +1 -1
- package/dist/services/document-service/common.mjs.map +1 -1
- package/dist/services/document-service/document-engine.d.ts +1 -7
- package/dist/services/document-service/document-engine.d.ts.map +1 -1
- package/dist/services/document-service/draft-and-publish.d.ts +9 -23
- package/dist/services/document-service/draft-and-publish.d.ts.map +1 -1
- package/dist/services/document-service/draft-and-publish.js +37 -9
- package/dist/services/document-service/draft-and-publish.js.map +1 -1
- package/dist/services/document-service/draft-and-publish.mjs +38 -10
- package/dist/services/document-service/draft-and-publish.mjs.map +1 -1
- package/dist/services/document-service/index.d.ts +2 -2
- package/dist/services/document-service/index.d.ts.map +1 -1
- package/dist/services/document-service/index.js +10 -8
- package/dist/services/document-service/index.js.map +1 -1
- package/dist/services/document-service/index.mjs +4 -2
- package/dist/services/document-service/index.mjs.map +1 -1
- package/dist/services/document-service/internationalization.d.ts +5 -5
- package/dist/services/document-service/internationalization.d.ts.map +1 -1
- package/dist/services/document-service/internationalization.js.map +1 -1
- package/dist/services/document-service/internationalization.mjs.map +1 -1
- package/dist/services/document-service/middlewares/errors.d.ts +6 -0
- package/dist/services/document-service/middlewares/errors.d.ts.map +1 -0
- package/dist/services/document-service/middlewares/errors.js +25 -0
- package/dist/services/document-service/middlewares/errors.js.map +1 -0
- package/dist/services/document-service/middlewares/errors.mjs +25 -0
- package/dist/services/document-service/middlewares/errors.mjs.map +1 -0
- package/dist/services/document-service/middlewares/index.d.ts +3 -0
- package/dist/services/document-service/middlewares/index.d.ts.map +1 -0
- package/dist/services/document-service/{middlewares.d.ts → middlewares/middleware-manager.d.ts} +3 -4
- package/dist/services/document-service/middlewares/middleware-manager.d.ts.map +1 -0
- package/dist/services/document-service/{middlewares.js → middlewares/middleware-manager.js} +1 -1
- package/dist/services/document-service/middlewares/middleware-manager.js.map +1 -0
- package/dist/services/document-service/{middlewares.mjs → middlewares/middleware-manager.mjs} +1 -1
- package/dist/services/document-service/middlewares/middleware-manager.mjs.map +1 -0
- package/dist/services/document-service/repository.d.ts +3 -0
- package/dist/services/document-service/repository.d.ts.map +1 -0
- package/dist/services/document-service/repository.js +297 -0
- package/dist/services/document-service/repository.js.map +1 -0
- package/dist/services/document-service/repository.mjs +297 -0
- package/dist/services/document-service/repository.mjs.map +1 -0
- package/dist/services/document-service/transform/fields.d.ts +2 -2
- package/dist/services/document-service/transform/fields.d.ts.map +1 -1
- package/dist/services/document-service/transform/fields.js.map +1 -1
- package/dist/services/document-service/transform/fields.mjs.map +1 -1
- package/dist/services/document-service/transform/id-map.d.ts +4 -4
- package/dist/services/document-service/transform/id-map.d.ts.map +1 -1
- package/dist/services/document-service/transform/id-map.js +15 -9
- package/dist/services/document-service/transform/id-map.js.map +1 -1
- package/dist/services/document-service/transform/id-map.mjs +16 -10
- package/dist/services/document-service/transform/id-map.mjs.map +1 -1
- package/dist/services/document-service/transform/id-transform.d.ts +4 -18
- package/dist/services/document-service/transform/id-transform.d.ts.map +1 -1
- package/dist/services/document-service/transform/id-transform.js +18 -12
- package/dist/services/document-service/transform/id-transform.js.map +1 -1
- package/dist/services/document-service/transform/id-transform.mjs +18 -12
- package/dist/services/document-service/transform/id-transform.mjs.map +1 -1
- package/dist/services/document-service/transform/populate.d.ts +5 -2
- package/dist/services/document-service/transform/populate.d.ts.map +1 -1
- package/dist/services/document-service/transform/populate.js.map +1 -1
- package/dist/services/document-service/transform/populate.mjs.map +1 -1
- package/dist/services/document-service/transform/relations/extract/data-ids.d.ts +3 -3
- package/dist/services/document-service/transform/relations/extract/data-ids.d.ts.map +1 -1
- package/dist/services/document-service/transform/relations/extract/data-ids.js +23 -12
- package/dist/services/document-service/transform/relations/extract/data-ids.js.map +1 -1
- package/dist/services/document-service/transform/relations/extract/data-ids.mjs +23 -12
- package/dist/services/document-service/transform/relations/extract/data-ids.mjs.map +1 -1
- package/dist/services/document-service/transform/relations/transform/data-ids.d.ts +3 -3
- package/dist/services/document-service/transform/relations/transform/data-ids.d.ts.map +1 -1
- package/dist/services/document-service/transform/relations/transform/data-ids.js +61 -37
- package/dist/services/document-service/transform/relations/transform/data-ids.js.map +1 -1
- package/dist/services/document-service/transform/relations/transform/data-ids.mjs +62 -38
- package/dist/services/document-service/transform/relations/transform/data-ids.mjs.map +1 -1
- package/dist/services/document-service/transform/relations/transform/output-ids.d.ts +2 -0
- package/dist/services/document-service/transform/relations/transform/output-ids.d.ts.map +1 -0
- package/dist/services/document-service/transform/relations/utils/dp.d.ts +10 -0
- package/dist/services/document-service/transform/relations/utils/dp.d.ts.map +1 -0
- package/dist/services/document-service/transform/relations/utils/dp.js +30 -0
- package/dist/services/document-service/transform/relations/utils/dp.js.map +1 -0
- package/dist/services/document-service/transform/relations/utils/dp.mjs +30 -0
- package/dist/services/document-service/transform/relations/utils/dp.mjs.map +1 -0
- package/dist/services/document-service/transform/relations/utils/i18n.d.ts +4 -4
- package/dist/services/document-service/transform/relations/utils/i18n.d.ts.map +1 -1
- package/dist/services/document-service/transform/relations/utils/i18n.js.map +1 -1
- package/dist/services/document-service/transform/relations/utils/i18n.mjs.map +1 -1
- package/dist/services/document-service/transform/relations/utils/types.d.ts +4 -1
- package/dist/services/document-service/transform/relations/utils/types.d.ts.map +1 -1
- package/dist/services/document-service/transform/types.d.ts +4 -4
- package/dist/services/document-service/transform/types.d.ts.map +1 -1
- package/dist/services/document-service/utils/populate.d.ts +9 -2
- package/dist/services/document-service/utils/populate.d.ts.map +1 -1
- package/dist/services/document-service/utils/populate.js +5 -5
- package/dist/services/document-service/utils/populate.js.map +1 -1
- package/dist/services/document-service/utils/populate.mjs +5 -5
- package/dist/services/document-service/utils/populate.mjs.map +1 -1
- package/dist/services/entity-service/attributes/index.d.ts +4 -4
- package/dist/services/entity-service/attributes/index.d.ts.map +1 -1
- package/dist/services/entity-service/attributes/index.js.map +1 -1
- package/dist/services/entity-service/attributes/index.mjs.map +1 -1
- package/dist/services/entity-service/attributes/transforms.d.ts +3 -3
- package/dist/services/entity-service/attributes/transforms.d.ts.map +1 -1
- package/dist/services/entity-service/attributes/transforms.js.map +1 -1
- package/dist/services/entity-service/attributes/transforms.mjs.map +1 -1
- package/dist/services/entity-service/components.d.ts +88 -16
- package/dist/services/entity-service/components.d.ts.map +1 -1
- package/dist/services/entity-service/components.js +13 -99
- package/dist/services/entity-service/components.js.map +1 -1
- package/dist/services/entity-service/components.mjs +14 -100
- package/dist/services/entity-service/components.mjs.map +1 -1
- package/dist/services/entity-service/index.d.ts +4 -6
- package/dist/services/entity-service/index.d.ts.map +1 -1
- package/dist/services/entity-service/index.js +34 -199
- package/dist/services/entity-service/index.js.map +1 -1
- package/dist/services/entity-service/index.mjs +27 -192
- package/dist/services/entity-service/index.mjs.map +1 -1
- package/dist/services/entity-service/params.d.ts +5 -5
- package/dist/services/entity-service/params.d.ts.map +1 -1
- package/dist/services/entity-service/params.js +1 -1
- package/dist/services/entity-service/params.js.map +1 -1
- package/dist/services/entity-service/params.mjs +1 -1
- package/dist/services/entity-service/params.mjs.map +1 -1
- package/dist/services/entity-validator/index.d.ts +2 -2
- package/dist/services/entity-validator/index.d.ts.map +1 -1
- package/dist/services/entity-validator/index.js +8 -3
- package/dist/services/entity-validator/index.js.map +1 -1
- package/dist/services/entity-validator/index.mjs +8 -3
- package/dist/services/entity-validator/index.mjs.map +1 -1
- package/dist/services/entity-validator/validators.d.ts +18 -18
- package/dist/services/entity-validator/validators.d.ts.map +1 -1
- package/dist/services/entity-validator/validators.js +6 -1
- package/dist/services/entity-validator/validators.js.map +1 -1
- package/dist/services/entity-validator/validators.mjs +6 -1
- package/dist/services/entity-validator/validators.mjs.map +1 -1
- package/dist/services/features.d.ts +3 -3
- package/dist/services/features.d.ts.map +1 -1
- package/dist/services/features.js.map +1 -1
- package/dist/services/features.mjs.map +1 -1
- package/dist/services/fs.d.ts +2 -2
- package/dist/services/fs.d.ts.map +1 -1
- package/dist/services/fs.js.map +1 -1
- package/dist/services/fs.mjs.map +1 -1
- package/dist/services/metrics/admin-user-hash.d.ts +2 -2
- package/dist/services/metrics/admin-user-hash.d.ts.map +1 -1
- package/dist/services/metrics/admin-user-hash.js.map +1 -1
- package/dist/services/metrics/admin-user-hash.mjs.map +1 -1
- package/dist/services/metrics/index.d.ts +2 -2
- package/dist/services/metrics/index.d.ts.map +1 -1
- package/dist/services/metrics/index.js.map +1 -1
- package/dist/services/metrics/index.mjs.map +1 -1
- package/dist/services/metrics/middleware.d.ts +2 -2
- package/dist/services/metrics/middleware.d.ts.map +1 -1
- package/dist/services/metrics/middleware.js.map +1 -1
- package/dist/services/metrics/middleware.mjs.map +1 -1
- package/dist/services/metrics/sender.d.ts +3 -3
- package/dist/services/metrics/sender.d.ts.map +1 -1
- package/dist/services/metrics/sender.js.map +1 -1
- package/dist/services/metrics/sender.mjs.map +1 -1
- package/dist/services/server/admin-api.d.ts +3 -3
- package/dist/services/server/admin-api.d.ts.map +1 -1
- package/dist/services/server/admin-api.js.map +1 -1
- package/dist/services/server/admin-api.mjs.map +1 -1
- package/dist/services/server/api.d.ts +3 -3
- package/dist/services/server/api.d.ts.map +1 -1
- package/dist/services/server/api.js.map +1 -1
- package/dist/services/server/api.mjs.map +1 -1
- package/dist/services/server/compose-endpoint.d.ts +2 -2
- package/dist/services/server/compose-endpoint.d.ts.map +1 -1
- package/dist/services/server/compose-endpoint.js.map +1 -1
- package/dist/services/server/compose-endpoint.mjs.map +1 -1
- package/dist/services/server/content-api.d.ts +3 -3
- package/dist/services/server/content-api.d.ts.map +1 -1
- package/dist/services/server/content-api.js.map +1 -1
- package/dist/services/server/content-api.mjs.map +1 -1
- package/dist/services/server/http-server.d.ts +2 -2
- package/dist/services/server/http-server.d.ts.map +1 -1
- package/dist/services/server/http-server.js.map +1 -1
- package/dist/services/server/http-server.mjs.map +1 -1
- package/dist/services/server/index.d.ts +2 -2
- package/dist/services/server/index.d.ts.map +1 -1
- package/dist/services/server/index.js +1 -2
- package/dist/services/server/index.js.map +1 -1
- package/dist/services/server/index.mjs +1 -2
- package/dist/services/server/index.mjs.map +1 -1
- package/dist/services/server/middleware.d.ts +4 -4
- package/dist/services/server/middleware.d.ts.map +1 -1
- package/dist/services/server/middleware.js.map +1 -1
- package/dist/services/server/middleware.mjs.map +1 -1
- package/dist/services/server/policy.d.ts +2 -2
- package/dist/services/server/policy.d.ts.map +1 -1
- package/dist/services/server/policy.js.map +1 -1
- package/dist/services/server/policy.mjs.map +1 -1
- package/dist/services/server/register-middlewares.d.ts +2 -2
- package/dist/services/server/register-middlewares.d.ts.map +1 -1
- package/dist/services/server/register-middlewares.js.map +1 -1
- package/dist/services/server/register-middlewares.mjs.map +1 -1
- package/dist/services/server/register-routes.d.ts +2 -2
- package/dist/services/server/register-routes.d.ts.map +1 -1
- package/dist/services/server/register-routes.js.map +1 -1
- package/dist/services/server/register-routes.mjs.map +1 -1
- package/dist/services/server/routing.d.ts +4 -4
- package/dist/services/server/routing.d.ts.map +1 -1
- package/dist/services/server/routing.js.map +1 -1
- package/dist/services/server/routing.mjs.map +1 -1
- package/dist/services/utils/dynamic-zones.d.ts.map +1 -1
- package/dist/services/utils/dynamic-zones.js +2 -1
- package/dist/services/utils/dynamic-zones.js.map +1 -1
- package/dist/services/utils/dynamic-zones.mjs +2 -1
- package/dist/services/utils/dynamic-zones.mjs.map +1 -1
- package/dist/services/webhook-runner.js.map +1 -1
- package/dist/services/webhook-runner.mjs.map +1 -1
- package/dist/utils/convert-custom-field-type.d.ts +2 -2
- package/dist/utils/convert-custom-field-type.d.ts.map +1 -1
- package/dist/utils/convert-custom-field-type.js.map +1 -1
- package/dist/utils/convert-custom-field-type.mjs.map +1 -1
- package/dist/utils/fetch.d.ts +3 -3
- package/dist/utils/fetch.d.ts.map +1 -1
- package/dist/utils/fetch.js.map +1 -1
- package/dist/utils/fetch.mjs.map +1 -1
- package/dist/utils/get-dirs.d.ts +3 -3
- package/dist/utils/get-dirs.d.ts.map +1 -1
- package/dist/utils/get-dirs.js.map +1 -1
- package/dist/utils/get-dirs.mjs.map +1 -1
- package/dist/utils/is-initialized.d.ts +2 -2
- package/dist/utils/is-initialized.d.ts.map +1 -1
- package/dist/utils/is-initialized.js +1 -1
- package/dist/utils/is-initialized.js.map +1 -1
- package/dist/utils/is-initialized.mjs +1 -1
- package/dist/utils/is-initialized.mjs.map +1 -1
- package/dist/utils/load-config-file.js +1 -1
- package/dist/utils/load-config-file.js.map +1 -1
- package/dist/utils/load-config-file.mjs +2 -2
- package/dist/utils/load-config-file.mjs.map +1 -1
- package/dist/utils/open-browser.d.ts +2 -2
- package/dist/utils/open-browser.d.ts.map +1 -1
- package/dist/utils/open-browser.js.map +1 -1
- package/dist/utils/open-browser.mjs.map +1 -1
- package/dist/utils/signals.d.ts +2 -2
- package/dist/utils/signals.d.ts.map +1 -1
- package/dist/utils/signals.js.map +1 -1
- package/dist/utils/signals.mjs.map +1 -1
- package/dist/utils/startup-logger.d.ts +2 -2
- package/dist/utils/startup-logger.d.ts.map +1 -1
- package/dist/utils/startup-logger.js.map +1 -1
- package/dist/utils/startup-logger.mjs.map +1 -1
- package/dist/utils/transform-content-types-to-models.d.ts +49 -94
- package/dist/utils/transform-content-types-to-models.d.ts.map +1 -1
- package/dist/utils/transform-content-types-to-models.js +90 -44
- package/dist/utils/transform-content-types-to-models.js.map +1 -1
- package/dist/utils/transform-content-types-to-models.mjs +90 -44
- package/dist/utils/transform-content-types-to-models.mjs.map +1 -1
- package/dist/utils/update-notifier/index.d.ts +2 -2
- package/dist/utils/update-notifier/index.d.ts.map +1 -1
- package/dist/utils/update-notifier/index.js.map +1 -1
- package/dist/utils/update-notifier/index.mjs.map +1 -1
- package/package.json +15 -15
- package/dist/services/document-service/document-engine.js +0 -241
- package/dist/services/document-service/document-engine.js.map +0 -1
- package/dist/services/document-service/document-engine.mjs +0 -242
- package/dist/services/document-service/document-engine.mjs.map +0 -1
- package/dist/services/document-service/middlewares.d.ts.map +0 -1
- package/dist/services/document-service/middlewares.js.map +0 -1
- package/dist/services/document-service/middlewares.mjs.map +0 -1
- package/dist/services/document-service/repositories/content-type.d.ts +0 -3
- package/dist/services/document-service/repositories/content-type.d.ts.map +0 -1
- package/dist/services/document-service/repositories/content-type.js +0 -139
- package/dist/services/document-service/repositories/content-type.js.map +0 -1
- package/dist/services/document-service/repositories/content-type.mjs +0 -139
- package/dist/services/document-service/repositories/content-type.mjs.map +0 -1
- package/dist/services/utils/upload-files.d.ts +0 -8
- package/dist/services/utils/upload-files.d.ts.map +0 -1
- package/dist/services/utils/upload-files.js +0 -64
- package/dist/services/utils/upload-files.js.map +0 -1
- package/dist/services/utils/upload-files.mjs +0 -63
- package/dist/services/utils/upload-files.mjs.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import path from "path";
|
|
2
2
|
import fs from "fs";
|
|
3
|
-
import { importDefault, env
|
|
3
|
+
import { importDefault, env } from "@strapi/utils";
|
|
4
4
|
const loadJsFile = (file) => {
|
|
5
5
|
try {
|
|
6
6
|
const jsModule = importDefault(file);
|
|
@@ -17,7 +17,7 @@ const loadJsFile = (file) => {
|
|
|
17
17
|
};
|
|
18
18
|
const loadJSONFile = (file) => {
|
|
19
19
|
try {
|
|
20
|
-
return
|
|
20
|
+
return JSON.parse(fs.readFileSync(file).toString());
|
|
21
21
|
} catch (error) {
|
|
22
22
|
if (error instanceof Error) {
|
|
23
23
|
throw new Error(`Could not load json config file ${file}: ${error.message}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load-config-file.mjs","sources":["../../src/utils/load-config-file.ts"],"sourcesContent":["import path from 'path';\nimport fs from 'fs';\nimport {
|
|
1
|
+
{"version":3,"file":"load-config-file.mjs","sources":["../../src/utils/load-config-file.ts"],"sourcesContent":["import path from 'path';\nimport fs from 'fs';\nimport { env, importDefault } from '@strapi/utils';\n\nconst loadJsFile = (file: string) => {\n try {\n const jsModule = importDefault(file);\n\n // call if function\n if (typeof jsModule === 'function') {\n return jsModule({ env });\n }\n\n return jsModule;\n } catch (error) {\n if (error instanceof Error) {\n throw new Error(`Could not load js config file ${file}: ${error.message}`);\n }\n\n throw new Error('Unknown error');\n }\n};\n\nconst loadJSONFile = (file: string) => {\n try {\n return JSON.parse(fs.readFileSync(file).toString());\n } catch (error) {\n if (error instanceof Error) {\n throw new Error(`Could not load json config file ${file}: ${error.message}`);\n }\n\n throw new Error('Unknown error');\n }\n};\n\nexport const loadConfigFile = (file: string) => {\n const ext = path.extname(file);\n\n switch (ext) {\n case '.js':\n return loadJsFile(file);\n case '.json':\n return loadJSONFile(file);\n default:\n return {};\n }\n};\n"],"names":[],"mappings":";;;AAIA,MAAM,aAAa,CAAC,SAAiB;AAC/B,MAAA;AACI,UAAA,WAAW,cAAc,IAAI;AAG/B,QAAA,OAAO,aAAa,YAAY;AAC3B,aAAA,SAAS,EAAE,IAAA,CAAK;AAAA,IACzB;AAEO,WAAA;AAAA,WACA,OAAO;AACd,QAAI,iBAAiB,OAAO;AAC1B,YAAM,IAAI,MAAM,iCAAiC,IAAI,KAAK,MAAM,OAAO,EAAE;AAAA,IAC3E;AAEM,UAAA,IAAI,MAAM,eAAe;AAAA,EACjC;AACF;AAEA,MAAM,eAAe,CAAC,SAAiB;AACjC,MAAA;AACF,WAAO,KAAK,MAAM,GAAG,aAAa,IAAI,EAAE,UAAU;AAAA,WAC3C,OAAO;AACd,QAAI,iBAAiB,OAAO;AAC1B,YAAM,IAAI,MAAM,mCAAmC,IAAI,KAAK,MAAM,OAAO,EAAE;AAAA,IAC7E;AAEM,UAAA,IAAI,MAAM,eAAe;AAAA,EACjC;AACF;AAEa,MAAA,iBAAiB,CAAC,SAAiB;AACxC,QAAA,MAAM,KAAK,QAAQ,IAAI;AAE7B,UAAQ,KAAK;AAAA,IACX,KAAK;AACH,aAAO,WAAW,IAAI;AAAA,IACxB,KAAK;AACH,aAAO,aAAa,IAAI;AAAA,IAC1B;AACE,aAAO;EACX;AACF;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import type {
|
|
3
|
-
export declare const openBrowser: (config: ConfigProvider) => Promise<import("child_process").ChildProcess>;
|
|
2
|
+
import type { Core } from '@strapi/types';
|
|
3
|
+
export declare const openBrowser: (config: Core.ConfigProvider) => Promise<import("child_process").ChildProcess>;
|
|
4
4
|
//# sourceMappingURL=open-browser.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"open-browser.d.ts","sourceRoot":"","sources":["../../src/utils/open-browser.ts"],"names":[],"mappings":";AAEA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"open-browser.d.ts","sourceRoot":"","sources":["../../src/utils/open-browser.ts"],"names":[],"mappings":";AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAE1C,eAAO,MAAM,WAAW,WAAkB,KAAK,cAAc,kDAI5D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"open-browser.js","sources":["../../src/utils/open-browser.ts"],"sourcesContent":["import open from 'open';\n\nimport type {
|
|
1
|
+
{"version":3,"file":"open-browser.js","sources":["../../src/utils/open-browser.ts"],"sourcesContent":["import open from 'open';\n\nimport type { Core } from '@strapi/types';\n\nexport const openBrowser = async (config: Core.ConfigProvider) => {\n const url = config.get<string>('admin.absoluteUrl');\n\n return open(url);\n};\n"],"names":["open"],"mappings":";;;;;AAIa,MAAA,cAAc,OAAO,WAAgC;AAC1D,QAAA,MAAM,OAAO,IAAY,mBAAmB;AAElD,SAAOA,cAAAA,QAAK,GAAG;AACjB;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"open-browser.mjs","sources":["../../src/utils/open-browser.ts"],"sourcesContent":["import open from 'open';\n\nimport type {
|
|
1
|
+
{"version":3,"file":"open-browser.mjs","sources":["../../src/utils/open-browser.ts"],"sourcesContent":["import open from 'open';\n\nimport type { Core } from '@strapi/types';\n\nexport const openBrowser = async (config: Core.ConfigProvider) => {\n const url = config.get<string>('admin.absoluteUrl');\n\n return open(url);\n};\n"],"names":[],"mappings":";AAIa,MAAA,cAAc,OAAO,WAAgC;AAC1D,QAAA,MAAM,OAAO,IAAY,mBAAmB;AAElD,SAAO,KAAK,GAAG;AACjB;"}
|
package/dist/utils/signals.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare const destroyOnSignal: (strapi: Strapi) => void;
|
|
1
|
+
import type { Core } from '@strapi/types';
|
|
2
|
+
export declare const destroyOnSignal: (strapi: Core.Strapi) => void;
|
|
3
3
|
//# sourceMappingURL=signals.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signals.d.ts","sourceRoot":"","sources":["../../src/utils/signals.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"signals.d.ts","sourceRoot":"","sources":["../../src/utils/signals.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAE1C,eAAO,MAAM,eAAe,WAAY,KAAK,MAAM,SAiBlD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signals.js","sources":["../../src/utils/signals.ts"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"file":"signals.js","sources":["../../src/utils/signals.ts"],"sourcesContent":["import type { Core } from '@strapi/types';\n\nexport const destroyOnSignal = (strapi: Core.Strapi) => {\n let signalReceived = false;\n\n // For unknown reasons, we receive signals 2 times.\n // As a temporary fix, we ignore the signals received after the first one.\n\n const terminateStrapi = async () => {\n if (!signalReceived) {\n signalReceived = true;\n await strapi.destroy();\n process.exit();\n }\n };\n\n ['SIGTERM', 'SIGINT'].forEach((signal) => {\n process.on(signal, terminateStrapi);\n });\n};\n"],"names":[],"mappings":";;AAEa,MAAA,kBAAkB,CAAC,WAAwB;AACtD,MAAI,iBAAiB;AAKrB,QAAM,kBAAkB,YAAY;AAClC,QAAI,CAAC,gBAAgB;AACF,uBAAA;AACjB,YAAM,OAAO;AACb,cAAQ,KAAK;AAAA,IACf;AAAA,EAAA;AAGF,GAAC,WAAW,QAAQ,EAAE,QAAQ,CAAC,WAAW;AAChC,YAAA,GAAG,QAAQ,eAAe;AAAA,EAAA,CACnC;AACH;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signals.mjs","sources":["../../src/utils/signals.ts"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"file":"signals.mjs","sources":["../../src/utils/signals.ts"],"sourcesContent":["import type { Core } from '@strapi/types';\n\nexport const destroyOnSignal = (strapi: Core.Strapi) => {\n let signalReceived = false;\n\n // For unknown reasons, we receive signals 2 times.\n // As a temporary fix, we ignore the signals received after the first one.\n\n const terminateStrapi = async () => {\n if (!signalReceived) {\n signalReceived = true;\n await strapi.destroy();\n process.exit();\n }\n };\n\n ['SIGTERM', 'SIGINT'].forEach((signal) => {\n process.on(signal, terminateStrapi);\n });\n};\n"],"names":[],"mappings":"AAEa,MAAA,kBAAkB,CAAC,WAAwB;AACtD,MAAI,iBAAiB;AAKrB,QAAM,kBAAkB,YAAY;AAClC,QAAI,CAAC,gBAAgB;AACF,uBAAA;AACjB,YAAM,OAAO;AACb,cAAQ,KAAK;AAAA,IACf;AAAA,EAAA;AAGF,GAAC,WAAW,QAAQ,EAAE,QAAQ,CAAC,WAAW;AAChC,YAAA,GAAG,QAAQ,eAAe;AAAA,EAAA,CACnC;AACH;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare const createStartupLogger: (app: Strapi) => {
|
|
1
|
+
import type { Core } from '@strapi/types';
|
|
2
|
+
export declare const createStartupLogger: (app: Core.Strapi) => {
|
|
3
3
|
logStats(): void;
|
|
4
4
|
logFirstStartupMessage(): void;
|
|
5
5
|
logDefaultStartupMessage(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"startup-logger.d.ts","sourceRoot":"","sources":["../../src/utils/startup-logger.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"startup-logger.d.ts","sourceRoot":"","sources":["../../src/utils/startup-logger.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAE1C,eAAO,MAAM,mBAAmB,QAAS,KAAK,MAAM;;;;;uBAwEM,OAAO;;CAWhE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"startup-logger.js","sources":["../../src/utils/startup-logger.ts"],"sourcesContent":["import chalk from 'chalk';\nimport CLITable from 'cli-table3';\nimport _ from 'lodash/fp';\n\nimport type {
|
|
1
|
+
{"version":3,"file":"startup-logger.js","sources":["../../src/utils/startup-logger.ts"],"sourcesContent":["import chalk from 'chalk';\nimport CLITable from 'cli-table3';\nimport _ from 'lodash/fp';\n\nimport type { Core } from '@strapi/types';\n\nexport const createStartupLogger = (app: Core.Strapi) => {\n return {\n logStats() {\n const columns = Math.min(process.stderr.columns, 80) - 2;\n console.log();\n console.log(chalk.black.bgWhite(_.padEnd(columns, ' Project information')));\n console.log();\n\n const infoTable = new CLITable({\n colWidths: [20, 50],\n chars: { mid: '', 'left-mid': '', 'mid-mid': '', 'right-mid': '' },\n });\n\n infoTable.push(\n [chalk.blue('Time'), `${new Date()}`],\n [chalk.blue('Launched in'), `${Date.now() - app.config.launchedAt} ms`],\n [chalk.blue('Environment'), app.config.environment],\n [chalk.blue('Process PID'), process.pid],\n [chalk.blue('Version'), `${app.config.info.strapi} (node ${process.version})`],\n [chalk.blue('Edition'), app.EE ? 'Enterprise' : 'Community'],\n [chalk.blue('Database'), app.db?.dialect.client]\n );\n\n console.log(infoTable.toString());\n console.log();\n console.log(chalk.black.bgWhite(_.padEnd(columns, ' Actions available')));\n console.log();\n },\n\n logFirstStartupMessage() {\n if (!strapi.config.get('server.logger.startup.enabled')) {\n return;\n }\n\n this.logStats();\n\n console.log(chalk.bold('One more thing...'));\n console.log(\n chalk.grey('Create your first administrator 💻 by going to the administration panel at:')\n );\n console.log();\n\n const addressTable = new CLITable();\n\n const adminUrl = strapi.config.get('admin.absoluteUrl');\n addressTable.push([chalk.bold(adminUrl)]);\n\n console.log(`${addressTable.toString()}`);\n console.log();\n },\n\n logDefaultStartupMessage() {\n if (!strapi.config.get('server.logger.startup.enabled')) {\n return;\n }\n this.logStats();\n\n console.log(chalk.bold('Welcome back!'));\n\n if (app.config.get('admin.serveAdminPanel') === true) {\n console.log(chalk.grey('To manage your project 🚀, go to the administration panel at:'));\n const adminUrl = strapi.config.get('admin.absoluteUrl');\n console.log(chalk.bold(adminUrl));\n console.log();\n }\n\n console.log(chalk.grey('To access the server ⚡️, go to:'));\n const serverUrl = strapi.config.get('server.absoluteUrl');\n console.log(chalk.bold(serverUrl));\n console.log();\n },\n\n logStartupMessage({ isInitialized }: { isInitialized: boolean }) {\n if (!strapi.config.get('server.logger.startup.enabled')) {\n return;\n }\n if (!isInitialized) {\n this.logFirstStartupMessage();\n } else {\n this.logDefaultStartupMessage();\n }\n },\n };\n};\n"],"names":["chalk","_","CLITable"],"mappings":";;;;;;;;;AAMa,MAAA,sBAAsB,CAAC,QAAqB;AAChD,SAAA;AAAA,IACL,WAAW;AACT,YAAM,UAAU,KAAK,IAAI,QAAQ,OAAO,SAAS,EAAE,IAAI;AACvD,cAAQ,IAAI;AACJ,cAAA,IAAIA,uBAAM,MAAM,QAAQC,mBAAE,OAAO,SAAS,sBAAsB,CAAC,CAAC;AAC1E,cAAQ,IAAI;AAEN,YAAA,YAAY,IAAIC,0BAAS;AAAA,QAC7B,WAAW,CAAC,IAAI,EAAE;AAAA,QAClB,OAAO,EAAE,KAAK,IAAI,YAAY,IAAI,WAAW,IAAI,aAAa,GAAG;AAAA,MAAA,CAClE;AAES,gBAAA;AAAA,QACR,CAACF,eAAAA,QAAM,KAAK,MAAM,GAAG,GAAG,oBAAI,KAAM,CAAA,EAAE;AAAA,QACpC,CAACA,uBAAM,KAAK,aAAa,GAAG,GAAG,KAAK,IAAA,IAAQ,IAAI,OAAO,UAAU,KAAK;AAAA,QACtE,CAACA,eAAAA,QAAM,KAAK,aAAa,GAAG,IAAI,OAAO,WAAW;AAAA,QAClD,CAACA,eAAM,QAAA,KAAK,aAAa,GAAG,QAAQ,GAAG;AAAA,QACvC,CAACA,eAAA,QAAM,KAAK,SAAS,GAAG,GAAG,IAAI,OAAO,KAAK,MAAM,UAAU,QAAQ,OAAO,GAAG;AAAA,QAC7E,CAACA,eAAAA,QAAM,KAAK,SAAS,GAAG,IAAI,KAAK,eAAe,WAAW;AAAA,QAC3D,CAACA,eAAAA,QAAM,KAAK,UAAU,GAAG,IAAI,IAAI,QAAQ,MAAM;AAAA,MAAA;AAGzC,cAAA,IAAI,UAAU,SAAU,CAAA;AAChC,cAAQ,IAAI;AACJ,cAAA,IAAIA,uBAAM,MAAM,QAAQC,mBAAE,OAAO,SAAS,oBAAoB,CAAC,CAAC;AACxE,cAAQ,IAAI;AAAA,IACd;AAAA,IAEA,yBAAyB;AACvB,UAAI,CAAC,OAAO,OAAO,IAAI,+BAA+B,GAAG;AACvD;AAAA,MACF;AAEA,WAAK,SAAS;AAEd,cAAQ,IAAID,eAAAA,QAAM,KAAK,mBAAmB,CAAC;AACnC,cAAA;AAAA,QACNA,eAAA,QAAM,KAAK,6EAA6E;AAAA,MAAA;AAE1F,cAAQ,IAAI;AAEN,YAAA,eAAe,IAAIE,kBAAAA;AAEzB,YAAM,WAAW,OAAO,OAAO,IAAI,mBAAmB;AACtD,mBAAa,KAAK,CAACF,eAAAA,QAAM,KAAK,QAAQ,CAAC,CAAC;AAExC,cAAQ,IAAI,GAAG,aAAa,SAAA,CAAU,EAAE;AACxC,cAAQ,IAAI;AAAA,IACd;AAAA,IAEA,2BAA2B;AACzB,UAAI,CAAC,OAAO,OAAO,IAAI,+BAA+B,GAAG;AACvD;AAAA,MACF;AACA,WAAK,SAAS;AAEd,cAAQ,IAAIA,eAAAA,QAAM,KAAK,eAAe,CAAC;AAEvC,UAAI,IAAI,OAAO,IAAI,uBAAuB,MAAM,MAAM;AACpD,gBAAQ,IAAIA,eAAAA,QAAM,KAAK,+DAA+D,CAAC;AACvF,cAAM,WAAW,OAAO,OAAO,IAAI,mBAAmB;AACtD,gBAAQ,IAAIA,eAAAA,QAAM,KAAK,QAAQ,CAAC;AAChC,gBAAQ,IAAI;AAAA,MACd;AAEA,cAAQ,IAAIA,eAAAA,QAAM,KAAK,iCAAiC,CAAC;AACzD,YAAM,YAAY,OAAO,OAAO,IAAI,oBAAoB;AACxD,cAAQ,IAAIA,eAAAA,QAAM,KAAK,SAAS,CAAC;AACjC,cAAQ,IAAI;AAAA,IACd;AAAA,IAEA,kBAAkB,EAAE,iBAA6C;AAC/D,UAAI,CAAC,OAAO,OAAO,IAAI,+BAA+B,GAAG;AACvD;AAAA,MACF;AACA,UAAI,CAAC,eAAe;AAClB,aAAK,uBAAuB;AAAA,MAAA,OACvB;AACL,aAAK,yBAAyB;AAAA,MAChC;AAAA,IACF;AAAA,EAAA;AAEJ;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"startup-logger.mjs","sources":["../../src/utils/startup-logger.ts"],"sourcesContent":["import chalk from 'chalk';\nimport CLITable from 'cli-table3';\nimport _ from 'lodash/fp';\n\nimport type {
|
|
1
|
+
{"version":3,"file":"startup-logger.mjs","sources":["../../src/utils/startup-logger.ts"],"sourcesContent":["import chalk from 'chalk';\nimport CLITable from 'cli-table3';\nimport _ from 'lodash/fp';\n\nimport type { Core } from '@strapi/types';\n\nexport const createStartupLogger = (app: Core.Strapi) => {\n return {\n logStats() {\n const columns = Math.min(process.stderr.columns, 80) - 2;\n console.log();\n console.log(chalk.black.bgWhite(_.padEnd(columns, ' Project information')));\n console.log();\n\n const infoTable = new CLITable({\n colWidths: [20, 50],\n chars: { mid: '', 'left-mid': '', 'mid-mid': '', 'right-mid': '' },\n });\n\n infoTable.push(\n [chalk.blue('Time'), `${new Date()}`],\n [chalk.blue('Launched in'), `${Date.now() - app.config.launchedAt} ms`],\n [chalk.blue('Environment'), app.config.environment],\n [chalk.blue('Process PID'), process.pid],\n [chalk.blue('Version'), `${app.config.info.strapi} (node ${process.version})`],\n [chalk.blue('Edition'), app.EE ? 'Enterprise' : 'Community'],\n [chalk.blue('Database'), app.db?.dialect.client]\n );\n\n console.log(infoTable.toString());\n console.log();\n console.log(chalk.black.bgWhite(_.padEnd(columns, ' Actions available')));\n console.log();\n },\n\n logFirstStartupMessage() {\n if (!strapi.config.get('server.logger.startup.enabled')) {\n return;\n }\n\n this.logStats();\n\n console.log(chalk.bold('One more thing...'));\n console.log(\n chalk.grey('Create your first administrator 💻 by going to the administration panel at:')\n );\n console.log();\n\n const addressTable = new CLITable();\n\n const adminUrl = strapi.config.get('admin.absoluteUrl');\n addressTable.push([chalk.bold(adminUrl)]);\n\n console.log(`${addressTable.toString()}`);\n console.log();\n },\n\n logDefaultStartupMessage() {\n if (!strapi.config.get('server.logger.startup.enabled')) {\n return;\n }\n this.logStats();\n\n console.log(chalk.bold('Welcome back!'));\n\n if (app.config.get('admin.serveAdminPanel') === true) {\n console.log(chalk.grey('To manage your project 🚀, go to the administration panel at:'));\n const adminUrl = strapi.config.get('admin.absoluteUrl');\n console.log(chalk.bold(adminUrl));\n console.log();\n }\n\n console.log(chalk.grey('To access the server ⚡️, go to:'));\n const serverUrl = strapi.config.get('server.absoluteUrl');\n console.log(chalk.bold(serverUrl));\n console.log();\n },\n\n logStartupMessage({ isInitialized }: { isInitialized: boolean }) {\n if (!strapi.config.get('server.logger.startup.enabled')) {\n return;\n }\n if (!isInitialized) {\n this.logFirstStartupMessage();\n } else {\n this.logDefaultStartupMessage();\n }\n },\n };\n};\n"],"names":[],"mappings":";;;AAMa,MAAA,sBAAsB,CAAC,QAAqB;AAChD,SAAA;AAAA,IACL,WAAW;AACT,YAAM,UAAU,KAAK,IAAI,QAAQ,OAAO,SAAS,EAAE,IAAI;AACvD,cAAQ,IAAI;AACJ,cAAA,IAAI,MAAM,MAAM,QAAQ,EAAE,OAAO,SAAS,sBAAsB,CAAC,CAAC;AAC1E,cAAQ,IAAI;AAEN,YAAA,YAAY,IAAI,SAAS;AAAA,QAC7B,WAAW,CAAC,IAAI,EAAE;AAAA,QAClB,OAAO,EAAE,KAAK,IAAI,YAAY,IAAI,WAAW,IAAI,aAAa,GAAG;AAAA,MAAA,CAClE;AAES,gBAAA;AAAA,QACR,CAAC,MAAM,KAAK,MAAM,GAAG,GAAG,oBAAI,KAAM,CAAA,EAAE;AAAA,QACpC,CAAC,MAAM,KAAK,aAAa,GAAG,GAAG,KAAK,IAAA,IAAQ,IAAI,OAAO,UAAU,KAAK;AAAA,QACtE,CAAC,MAAM,KAAK,aAAa,GAAG,IAAI,OAAO,WAAW;AAAA,QAClD,CAAC,MAAM,KAAK,aAAa,GAAG,QAAQ,GAAG;AAAA,QACvC,CAAC,MAAM,KAAK,SAAS,GAAG,GAAG,IAAI,OAAO,KAAK,MAAM,UAAU,QAAQ,OAAO,GAAG;AAAA,QAC7E,CAAC,MAAM,KAAK,SAAS,GAAG,IAAI,KAAK,eAAe,WAAW;AAAA,QAC3D,CAAC,MAAM,KAAK,UAAU,GAAG,IAAI,IAAI,QAAQ,MAAM;AAAA,MAAA;AAGzC,cAAA,IAAI,UAAU,SAAU,CAAA;AAChC,cAAQ,IAAI;AACJ,cAAA,IAAI,MAAM,MAAM,QAAQ,EAAE,OAAO,SAAS,oBAAoB,CAAC,CAAC;AACxE,cAAQ,IAAI;AAAA,IACd;AAAA,IAEA,yBAAyB;AACvB,UAAI,CAAC,OAAO,OAAO,IAAI,+BAA+B,GAAG;AACvD;AAAA,MACF;AAEA,WAAK,SAAS;AAEd,cAAQ,IAAI,MAAM,KAAK,mBAAmB,CAAC;AACnC,cAAA;AAAA,QACN,MAAM,KAAK,6EAA6E;AAAA,MAAA;AAE1F,cAAQ,IAAI;AAEN,YAAA,eAAe,IAAI;AAEzB,YAAM,WAAW,OAAO,OAAO,IAAI,mBAAmB;AACtD,mBAAa,KAAK,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC;AAExC,cAAQ,IAAI,GAAG,aAAa,SAAA,CAAU,EAAE;AACxC,cAAQ,IAAI;AAAA,IACd;AAAA,IAEA,2BAA2B;AACzB,UAAI,CAAC,OAAO,OAAO,IAAI,+BAA+B,GAAG;AACvD;AAAA,MACF;AACA,WAAK,SAAS;AAEd,cAAQ,IAAI,MAAM,KAAK,eAAe,CAAC;AAEvC,UAAI,IAAI,OAAO,IAAI,uBAAuB,MAAM,MAAM;AACpD,gBAAQ,IAAI,MAAM,KAAK,+DAA+D,CAAC;AACvF,cAAM,WAAW,OAAO,OAAO,IAAI,mBAAmB;AACtD,gBAAQ,IAAI,MAAM,KAAK,QAAQ,CAAC;AAChC,gBAAQ,IAAI;AAAA,MACd;AAEA,cAAQ,IAAI,MAAM,KAAK,iCAAiC,CAAC;AACzD,YAAM,YAAY,OAAO,OAAO,IAAI,oBAAoB;AACxD,cAAQ,IAAI,MAAM,KAAK,SAAS,CAAC;AACjC,cAAQ,IAAI;AAAA,IACd;AAAA,IAEA,kBAAkB,EAAE,iBAA6C;AAC/D,UAAI,CAAC,OAAO,OAAO,IAAI,+BAA+B,GAAG;AACvD;AAAA,MACF;AACA,UAAI,CAAC,eAAe;AAClB,aAAK,uBAAuB;AAAA,MAAA,OACvB;AACL,aAAK,yBAAyB;AAAA,MAChC;AAAA,IACF;AAAA,EAAA;AAEJ;"}
|
|
@@ -1,111 +1,66 @@
|
|
|
1
|
-
import { type Model } from '@strapi/database';
|
|
2
|
-
import {
|
|
1
|
+
import { type Model, type MetadataOptions } from '@strapi/database';
|
|
2
|
+
import type { Struct, Schema } from '@strapi/types';
|
|
3
3
|
import { createId } from '@paralleldrive/cuid2';
|
|
4
4
|
/**
|
|
5
5
|
* Because strapi/database models don't know about things like components or dynamic zones, we use this file to convert them
|
|
6
6
|
* to a relations format that it recognizes
|
|
7
7
|
*
|
|
8
8
|
* Therefore we have to keep an additional set of helpers/extensions to the database naming methods
|
|
9
|
+
*
|
|
10
|
+
* IMPORTANT!
|
|
11
|
+
* If we use short versions of anything, we MUST call getNameFromTokens directly; attempting to shorten them ourselves
|
|
12
|
+
* prevents the unshortened name map from being filled properly, so for example it will think that the short name
|
|
13
|
+
* 'collection4f3a_cmps' maps to the unshortened 'collectionname_cmps' rather than 'collectionname_components'
|
|
14
|
+
* Therefore, we only use the identifiers helpers in cases where we do not do any of our own shortening
|
|
9
15
|
*/
|
|
10
|
-
export declare const
|
|
11
|
-
export declare const
|
|
12
|
-
export declare const
|
|
13
|
-
export declare const
|
|
14
|
-
export declare const
|
|
15
|
-
export declare const
|
|
16
|
-
export
|
|
17
|
-
export
|
|
18
|
-
|
|
16
|
+
export declare const getComponentJoinTableName: (collectionName: string, options: MetadataOptions) => string;
|
|
17
|
+
export declare const getDzJoinTableName: (collectionName: string, options: MetadataOptions) => string;
|
|
18
|
+
export declare const getComponentJoinColumnEntityName: (options: MetadataOptions) => string;
|
|
19
|
+
export declare const getComponentJoinColumnInverseName: (options: MetadataOptions) => string;
|
|
20
|
+
export declare const getComponentTypeColumn: (options: MetadataOptions) => string;
|
|
21
|
+
export declare const getComponentFkIndexName: (contentType: string, options: MetadataOptions) => string;
|
|
22
|
+
export type LoadedContentTypeModel = Struct.ContentTypeSchema & Required<Pick<Struct.ContentTypeSchema, 'collectionName' | 'uid' | 'modelName'>>;
|
|
23
|
+
export declare const transformAttribute: (name: string, attribute: Schema.Attribute.AnyAttribute, contentType: LoadedContentTypeModel, options: MetadataOptions) => (Schema.Attribute.OfType<"biginteger"> & Schema.Attribute.ConfigurableOption & Schema.Attribute.DefaultOption<string> & Schema.Attribute.MinMaxOption<string> & Schema.Attribute.PrivateOption & Schema.Attribute.RequiredOption & Schema.Attribute.WritableOption & Schema.Attribute.VisibleOption & Schema.Attribute.UniqueOption) | (Schema.Attribute.OfType<"boolean"> & Schema.Attribute.ConfigurableOption & Schema.Attribute.DefaultOption<boolean> & Schema.Attribute.PrivateOption & Schema.Attribute.RequiredOption & Schema.Attribute.WritableOption & Schema.Attribute.VisibleOption) | (Schema.Attribute.OfType<"blocks"> & Schema.Attribute.ConfigurableOption & Schema.Attribute.PrivateOption & Schema.Attribute.RequiredOption & Schema.Attribute.WritableOption & Schema.Attribute.VisibleOption) | (Schema.Attribute.OfType<"datetime"> & Schema.Attribute.ConfigurableOption & Schema.Attribute.DefaultOption<Schema.Attribute.DateTimeValue> & Schema.Attribute.PrivateOption & Schema.Attribute.RequiredOption & Schema.Attribute.UniqueOption & Schema.Attribute.WritableOption & Schema.Attribute.VisibleOption) | (Schema.Attribute.OfType<"date"> & Schema.Attribute.ConfigurableOption & Schema.Attribute.DefaultOption<Schema.Attribute.DateValue> & Schema.Attribute.PrivateOption & Schema.Attribute.RequiredOption & Schema.Attribute.UniqueOption & Schema.Attribute.WritableOption & Schema.Attribute.VisibleOption) | (Schema.Attribute.OfType<"decimal"> & Schema.Attribute.ConfigurableOption & Schema.Attribute.DefaultOption<number> & Schema.Attribute.MinMaxOption<number> & Schema.Attribute.PrivateOption & Schema.Attribute.RequiredOption & Schema.Attribute.WritableOption & Schema.Attribute.VisibleOption & Schema.Attribute.UniqueOption) | (Schema.Attribute.OfType<"email"> & Schema.Attribute.ConfigurableOption & Schema.Attribute.DefaultOption<string> & Schema.Attribute.MinMaxLengthOption & Schema.Attribute.PrivateOption & Schema.Attribute.RequiredOption & Schema.Attribute.UniqueOption & Schema.Attribute.WritableOption & Schema.Attribute.VisibleOption) | (Schema.Attribute.OfType<"enumeration"> & Schema.Attribute.EnumerationProperties<string[]> & Schema.Attribute.ConfigurableOption & Schema.Attribute.DefaultOption<string> & Schema.Attribute.PrivateOption & Schema.Attribute.RequiredOption & Schema.Attribute.WritableOption & Schema.Attribute.VisibleOption) | (Schema.Attribute.OfType<"float"> & Schema.Attribute.ConfigurableOption & Schema.Attribute.DefaultOption<number> & Schema.Attribute.MinMaxOption<number> & Schema.Attribute.PrivateOption & Schema.Attribute.RequiredOption & Schema.Attribute.WritableOption & Schema.Attribute.VisibleOption & Schema.Attribute.UniqueOption) | (Schema.Attribute.OfType<"integer"> & Schema.Attribute.ConfigurableOption & Schema.Attribute.DefaultOption<number> & Schema.Attribute.MinMaxOption<number> & Schema.Attribute.PrivateOption & Schema.Attribute.RequiredOption & Schema.Attribute.WritableOption & Schema.Attribute.VisibleOption & Schema.Attribute.UniqueOption) | (Schema.Attribute.OfType<"json"> & Schema.Attribute.ConfigurableOption & Schema.Attribute.RequiredOption & Schema.Attribute.PrivateOption & Schema.Attribute.WritableOption & Schema.Attribute.VisibleOption & Schema.Attribute.DefaultOption<import("@strapi/types/dist/utils").JSONPrimitive>) | (Schema.Attribute.OfType<"password"> & Schema.Attribute.ConfigurableOption & Schema.Attribute.DefaultOption<string> & Schema.Attribute.MinMaxLengthOption & Schema.Attribute.PrivateOption & Schema.Attribute.RequiredOption & Schema.Attribute.WritableOption & Schema.Attribute.VisibleOption) | (Schema.Attribute.OfType<"relation"> & Schema.Attribute.ConfigurableOption & Schema.Attribute.PrivateOption & Schema.Attribute.WritableOption & Schema.Attribute.VisibleOption & Schema.Attribute.RequiredOption & {
|
|
24
|
+
useJoinTable?: boolean | undefined;
|
|
25
|
+
} & {
|
|
19
26
|
relation: "morphToOne";
|
|
20
|
-
} & Attribute.ConfigurableOption & Attribute.PrivateOption & Attribute.WritableOption & Attribute.VisibleOption & Attribute.RequiredOption
|
|
27
|
+
}) | (Schema.Attribute.OfType<"relation"> & Schema.Attribute.ConfigurableOption & Schema.Attribute.PrivateOption & Schema.Attribute.WritableOption & Schema.Attribute.VisibleOption & Schema.Attribute.RequiredOption & {
|
|
28
|
+
useJoinTable?: boolean | undefined;
|
|
29
|
+
} & {
|
|
21
30
|
relation: "morphToMany";
|
|
22
|
-
} & Attribute.ConfigurableOption & Attribute.PrivateOption & Attribute.WritableOption & Attribute.VisibleOption & Attribute.RequiredOption
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
} & import("@strapi/types/dist/types/utils").Without<{
|
|
26
|
-
inversedBy?: string | undefined;
|
|
27
|
-
}, {
|
|
28
|
-
mappedBy?: string | undefined;
|
|
29
|
-
}> & {
|
|
30
|
-
mappedBy?: string | undefined;
|
|
31
|
-
} & Attribute.ConfigurableOption & Attribute.PrivateOption & Attribute.WritableOption & Attribute.VisibleOption & Attribute.RequiredOption) | (Attribute.OfType<"relation"> & {
|
|
31
|
+
}) | (Schema.Attribute.OfType<"relation"> & Schema.Attribute.CommonBidirectionalProperties<import("@strapi/types/dist/uid").ContentType> & Schema.Attribute.ConfigurableOption & Schema.Attribute.PrivateOption & Schema.Attribute.WritableOption & Schema.Attribute.VisibleOption & Schema.Attribute.RequiredOption & {
|
|
32
|
+
useJoinTable?: boolean | undefined;
|
|
33
|
+
} & {
|
|
32
34
|
relation: "oneToOne";
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}, {
|
|
37
|
-
inversedBy?: string | undefined;
|
|
38
|
-
}> & {
|
|
39
|
-
inversedBy?: string | undefined;
|
|
40
|
-
} & Attribute.ConfigurableOption & Attribute.PrivateOption & Attribute.WritableOption & Attribute.VisibleOption & Attribute.RequiredOption) | (Attribute.OfType<"relation"> & {
|
|
41
|
-
relation: "oneToMany";
|
|
42
|
-
target: import("@strapi/types/dist/types/core/common/uid").ContentType;
|
|
43
|
-
} & import("@strapi/types/dist/types/utils").Without<{
|
|
44
|
-
inversedBy?: string | undefined;
|
|
45
|
-
}, {
|
|
46
|
-
mappedBy?: string | undefined;
|
|
47
|
-
}> & {
|
|
48
|
-
mappedBy?: string | undefined;
|
|
49
|
-
} & Attribute.ConfigurableOption & Attribute.PrivateOption & Attribute.WritableOption & Attribute.VisibleOption & Attribute.RequiredOption) | (Attribute.OfType<"relation"> & {
|
|
35
|
+
}) | (Schema.Attribute.OfType<"relation"> & Schema.Attribute.CommonBidirectionalProperties<import("@strapi/types/dist/uid").ContentType> & Schema.Attribute.ConfigurableOption & Schema.Attribute.PrivateOption & Schema.Attribute.WritableOption & Schema.Attribute.VisibleOption & Schema.Attribute.RequiredOption & {
|
|
36
|
+
useJoinTable?: boolean | undefined;
|
|
37
|
+
} & {
|
|
50
38
|
relation: "oneToMany";
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}, {
|
|
55
|
-
inversedBy?: string | undefined;
|
|
56
|
-
}> & {
|
|
57
|
-
inversedBy?: string | undefined;
|
|
58
|
-
} & Attribute.ConfigurableOption & Attribute.PrivateOption & Attribute.WritableOption & Attribute.VisibleOption & Attribute.RequiredOption) | (Attribute.OfType<"relation"> & {
|
|
39
|
+
}) | (Schema.Attribute.OfType<"relation"> & Schema.Attribute.CommonBidirectionalProperties<import("@strapi/types/dist/uid").ContentType> & Schema.Attribute.ConfigurableOption & Schema.Attribute.PrivateOption & Schema.Attribute.WritableOption & Schema.Attribute.VisibleOption & Schema.Attribute.RequiredOption & {
|
|
40
|
+
useJoinTable?: boolean | undefined;
|
|
41
|
+
} & {
|
|
59
42
|
relation: "manyToOne";
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}, {
|
|
64
|
-
mappedBy?: string | undefined;
|
|
65
|
-
}> & {
|
|
66
|
-
mappedBy?: string | undefined;
|
|
67
|
-
} & Attribute.ConfigurableOption & Attribute.PrivateOption & Attribute.WritableOption & Attribute.VisibleOption & Attribute.RequiredOption) | (Attribute.OfType<"relation"> & {
|
|
68
|
-
relation: "manyToOne";
|
|
69
|
-
target: import("@strapi/types/dist/types/core/common/uid").ContentType;
|
|
70
|
-
} & import("@strapi/types/dist/types/utils").Without<{
|
|
71
|
-
mappedBy?: string | undefined;
|
|
72
|
-
}, {
|
|
73
|
-
inversedBy?: string | undefined;
|
|
74
|
-
}> & {
|
|
75
|
-
inversedBy?: string | undefined;
|
|
76
|
-
} & Attribute.ConfigurableOption & Attribute.PrivateOption & Attribute.WritableOption & Attribute.VisibleOption & Attribute.RequiredOption) | (Attribute.OfType<"relation"> & {
|
|
77
|
-
relation: "manyToMany";
|
|
78
|
-
target: import("@strapi/types/dist/types/core/common/uid").ContentType;
|
|
79
|
-
} & import("@strapi/types/dist/types/utils").Without<{
|
|
80
|
-
inversedBy?: string | undefined;
|
|
81
|
-
}, {
|
|
82
|
-
mappedBy?: string | undefined;
|
|
83
|
-
}> & {
|
|
84
|
-
mappedBy?: string | undefined;
|
|
85
|
-
} & Attribute.ConfigurableOption & Attribute.PrivateOption & Attribute.WritableOption & Attribute.VisibleOption & Attribute.RequiredOption) | (Attribute.OfType<"relation"> & {
|
|
43
|
+
}) | (Schema.Attribute.OfType<"relation"> & Schema.Attribute.CommonBidirectionalProperties<import("@strapi/types/dist/uid").ContentType> & Schema.Attribute.ConfigurableOption & Schema.Attribute.PrivateOption & Schema.Attribute.WritableOption & Schema.Attribute.VisibleOption & Schema.Attribute.RequiredOption & {
|
|
44
|
+
useJoinTable?: boolean | undefined;
|
|
45
|
+
} & {
|
|
86
46
|
relation: "manyToMany";
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
}, {
|
|
91
|
-
inversedBy?: string | undefined;
|
|
92
|
-
}> & {
|
|
93
|
-
inversedBy?: string | undefined;
|
|
94
|
-
} & Attribute.ConfigurableOption & Attribute.PrivateOption & Attribute.WritableOption & Attribute.VisibleOption & Attribute.RequiredOption) | (Attribute.OfType<"relation"> & {
|
|
47
|
+
}) | (Schema.Attribute.OfType<"relation"> & Schema.Attribute.XWayCommonProperties<import("@strapi/types/dist/uid").ContentType> & Schema.Attribute.ConfigurableOption & Schema.Attribute.PrivateOption & Schema.Attribute.WritableOption & Schema.Attribute.VisibleOption & Schema.Attribute.RequiredOption & {
|
|
48
|
+
useJoinTable?: boolean | undefined;
|
|
49
|
+
} & {
|
|
95
50
|
relation: "oneWay";
|
|
96
|
-
|
|
97
|
-
|
|
51
|
+
}) | (Schema.Attribute.OfType<"relation"> & Schema.Attribute.XWayCommonProperties<import("@strapi/types/dist/uid").ContentType> & Schema.Attribute.ConfigurableOption & Schema.Attribute.PrivateOption & Schema.Attribute.WritableOption & Schema.Attribute.VisibleOption & Schema.Attribute.RequiredOption & {
|
|
52
|
+
useJoinTable?: boolean | undefined;
|
|
53
|
+
} & {
|
|
98
54
|
relation: "manyWay";
|
|
99
|
-
|
|
100
|
-
|
|
55
|
+
}) | (Schema.Attribute.OfType<"relation"> & Schema.Attribute.MorphReferenceCommonProperties<import("@strapi/types/dist/uid").ContentType> & Schema.Attribute.ConfigurableOption & Schema.Attribute.PrivateOption & Schema.Attribute.WritableOption & Schema.Attribute.VisibleOption & Schema.Attribute.RequiredOption & {
|
|
56
|
+
useJoinTable?: boolean | undefined;
|
|
57
|
+
} & {
|
|
101
58
|
relation: "morphOne";
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
} &
|
|
59
|
+
}) | (Schema.Attribute.OfType<"relation"> & Schema.Attribute.MorphReferenceCommonProperties<import("@strapi/types/dist/uid").ContentType> & Schema.Attribute.ConfigurableOption & Schema.Attribute.PrivateOption & Schema.Attribute.WritableOption & Schema.Attribute.VisibleOption & Schema.Attribute.RequiredOption & {
|
|
60
|
+
useJoinTable?: boolean | undefined;
|
|
61
|
+
} & {
|
|
105
62
|
relation: "morphMany";
|
|
106
|
-
|
|
107
|
-
morphBy?: string | undefined;
|
|
108
|
-
} & Attribute.ConfigurableOption & Attribute.PrivateOption & Attribute.WritableOption & Attribute.VisibleOption & Attribute.RequiredOption) | 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.Time | Attribute.Timestamp | Attribute.UID<string, Attribute.UIDOptions> | {
|
|
63
|
+
}) | (Schema.Attribute.OfType<"richtext"> & Schema.Attribute.ConfigurableOption & Schema.Attribute.DefaultOption<string> & Schema.Attribute.MinMaxLengthOption & Schema.Attribute.PrivateOption & Schema.Attribute.RequiredOption & Schema.Attribute.WritableOption & Schema.Attribute.VisibleOption) | (Schema.Attribute.OfType<"string"> & Schema.Attribute.StringProperties & Schema.Attribute.ConfigurableOption & Schema.Attribute.DefaultOption<string> & Schema.Attribute.MinMaxLengthOption & Schema.Attribute.PrivateOption & Schema.Attribute.UniqueOption & Schema.Attribute.RequiredOption & Schema.Attribute.WritableOption & Schema.Attribute.VisibleOption) | (Schema.Attribute.OfType<"text"> & Schema.Attribute.TextProperties & Schema.Attribute.ConfigurableOption & Schema.Attribute.DefaultOption<string> & Schema.Attribute.MinMaxLengthOption & Schema.Attribute.PrivateOption & Schema.Attribute.UniqueOption & Schema.Attribute.RequiredOption & Schema.Attribute.WritableOption & Schema.Attribute.VisibleOption) | (Schema.Attribute.OfType<"time"> & Schema.Attribute.ConfigurableOption & Schema.Attribute.DefaultOption<Schema.Attribute.TimeValue> & Schema.Attribute.PrivateOption & Schema.Attribute.RequiredOption & Schema.Attribute.UniqueOption & Schema.Attribute.WritableOption & Schema.Attribute.VisibleOption) | (Schema.Attribute.OfType<"timestamp"> & Schema.Attribute.ConfigurableOption & Schema.Attribute.DefaultOption<Schema.Attribute.TimestampValue> & Schema.Attribute.PrivateOption & Schema.Attribute.RequiredOption & Schema.Attribute.UniqueOption & Schema.Attribute.WritableOption & Schema.Attribute.VisibleOption) | (Schema.Attribute.OfType<"uid"> & Schema.Attribute.UIDProperties<string, Schema.Attribute.UIDOptions> & Schema.Attribute.ConfigurableOption & Schema.Attribute.DefaultOption<string> & Schema.Attribute.MinMaxLengthOption & Schema.Attribute.PrivateOption & Schema.Attribute.RequiredOption & Schema.Attribute.WritableOption & Schema.Attribute.VisibleOption) | {
|
|
109
64
|
type: string;
|
|
110
65
|
relation: string;
|
|
111
66
|
target: string;
|
|
@@ -168,10 +123,10 @@ export declare const transformAttribute: (name: string, attribute: Attribute.Any
|
|
|
168
123
|
target?: undefined;
|
|
169
124
|
morphBy?: undefined;
|
|
170
125
|
};
|
|
171
|
-
export declare const transformAttributes: (contentType: LoadedContentTypeModel) => {};
|
|
172
|
-
export declare const hasComponentsOrDz: (contentType: LoadedContentTypeModel) => contentType is
|
|
126
|
+
export declare const transformAttributes: (contentType: LoadedContentTypeModel, options: MetadataOptions) => {};
|
|
127
|
+
export declare const hasComponentsOrDz: (contentType: LoadedContentTypeModel) => contentType is Struct.ContentTypeSchema & Required<Pick<Struct.ContentTypeSchema, "uid" | "collectionName" | "modelName">> & {
|
|
173
128
|
type: 'dynamiczone' | 'component';
|
|
174
129
|
};
|
|
175
130
|
export declare const createDocumentId: typeof createId;
|
|
176
|
-
export declare const transformContentTypesToModels: (contentTypes: LoadedContentTypeModel[]) => Model[];
|
|
131
|
+
export declare const transformContentTypesToModels: (contentTypes: LoadedContentTypeModel[], options: MetadataOptions) => Model[];
|
|
177
132
|
//# sourceMappingURL=transform-content-types-to-models.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transform-content-types-to-models.d.ts","sourceRoot":"","sources":["../../src/utils/transform-content-types-to-models.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,KAAK,EAAS,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"transform-content-types-to-models.d.ts","sourceRoot":"","sources":["../../src/utils/transform-content-types-to-models.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,KAAK,EAAS,KAAK,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAC3E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAMhD;;;;;;;;;;;GAWG;AAEH,eAAO,MAAM,yBAAyB,mBAAoB,MAAM,WAAW,eAAe,WAQzF,CAAC;AAEF,eAAO,MAAM,kBAAkB,mBAAoB,MAAM,WAAW,eAAe,WAQlF,CAAC;AAEF,eAAO,MAAM,gCAAgC,YAAa,eAAe,WAQxE,CAAC;AAEF,eAAO,MAAM,iCAAiC,YAAa,eAAe,WAQzE,CAAC;AAEF,eAAO,MAAM,sBAAsB,YAAa,eAAe,WAE9D,CAAC;AAEF,eAAO,MAAM,uBAAuB,gBAAiB,MAAM,WAAW,eAAe,WASpF,CAAC;AAIF,MAAM,MAAM,sBAAsB,GAAG,MAAM,CAAC,iBAAiB,GAC3D,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,iBAAiB,EAAE,gBAAgB,GAAG,KAAK,GAAG,WAAW,CAAC,CAAC,CAAC;AAGnF,eAAO,MAAM,kBAAkB,SACvB,MAAM,aACD,OAAO,SAAS,CAAC,YAAY,eAC3B,sBAAsB,WAC1B,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqFzB,CAAC;AAEF,eAAO,MAAM,mBAAmB,gBACjB,sBAAsB,WAC1B,eAAe,OAazB,CAAC;AAEF,eAAO,MAAM,iBAAiB,gBACf,sBAAsB;UACc,aAAa,GAAG,WAAW;CAI7E,CAAC;AAEF,eAAO,MAAM,gBAAgB,iBAAW,CAAC;AAgFzC,eAAO,MAAM,6BAA6B,iBAC1B,sBAAsB,EAAE,WAC7B,eAAe,KACvB,KAAK,EAiDP,CAAC"}
|
|
@@ -8,15 +8,57 @@ const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
|
|
8
8
|
const assert__default = /* @__PURE__ */ _interopDefault(assert);
|
|
9
9
|
const ___default = /* @__PURE__ */ _interopDefault(_);
|
|
10
10
|
const { identifiers } = database.utils;
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
const getComponentJoinTableName = (collectionName, options) => {
|
|
12
|
+
return identifiers.getNameFromTokens(
|
|
13
|
+
[
|
|
14
|
+
{ name: collectionName, compressible: true },
|
|
15
|
+
{ name: "components", shortName: "cmps", compressible: false }
|
|
16
|
+
],
|
|
17
|
+
options
|
|
18
|
+
);
|
|
19
|
+
};
|
|
20
|
+
const getDzJoinTableName = (collectionName, options) => {
|
|
21
|
+
return identifiers.getNameFromTokens(
|
|
22
|
+
[
|
|
23
|
+
{ name: collectionName, compressible: true },
|
|
24
|
+
{ name: "components", shortName: "cmps", compressible: false }
|
|
25
|
+
],
|
|
26
|
+
options
|
|
27
|
+
);
|
|
28
|
+
};
|
|
29
|
+
const getComponentJoinColumnEntityName = (options) => {
|
|
30
|
+
return identifiers.getNameFromTokens(
|
|
31
|
+
[
|
|
32
|
+
{ name: "entity", compressible: false },
|
|
33
|
+
{ name: "id", compressible: false }
|
|
34
|
+
],
|
|
35
|
+
options
|
|
36
|
+
);
|
|
37
|
+
};
|
|
38
|
+
const getComponentJoinColumnInverseName = (options) => {
|
|
39
|
+
return identifiers.getNameFromTokens(
|
|
40
|
+
[
|
|
41
|
+
{ name: "component", shortName: "cmp", compressible: false },
|
|
42
|
+
{ name: "id", compressible: false }
|
|
43
|
+
],
|
|
44
|
+
options
|
|
45
|
+
);
|
|
46
|
+
};
|
|
47
|
+
const getComponentTypeColumn = (options) => {
|
|
48
|
+
return identifiers.getNameFromTokens([{ name: "component_type", compressible: false }], options);
|
|
49
|
+
};
|
|
50
|
+
const getComponentFkIndexName = (contentType, options) => {
|
|
51
|
+
return identifiers.getNameFromTokens(
|
|
52
|
+
[
|
|
53
|
+
{ name: contentType, compressible: true },
|
|
54
|
+
{ name: "entity", compressible: false },
|
|
55
|
+
{ name: "fk", compressible: false }
|
|
56
|
+
],
|
|
57
|
+
options
|
|
58
|
+
);
|
|
59
|
+
};
|
|
18
60
|
const { ID_COLUMN: id, FIELD_COLUMN: field, ORDER_COLUMN: order } = identifiers;
|
|
19
|
-
const transformAttribute = (name, attribute, contentType) => {
|
|
61
|
+
const transformAttribute = (name, attribute, contentType, options) => {
|
|
20
62
|
switch (attribute.type) {
|
|
21
63
|
case "media": {
|
|
22
64
|
return {
|
|
@@ -27,11 +69,10 @@ const transformAttribute = (name, attribute, contentType) => {
|
|
|
27
69
|
};
|
|
28
70
|
}
|
|
29
71
|
case "component": {
|
|
30
|
-
const joinTableName = getComponentJoinTableName(contentType.collectionName);
|
|
31
|
-
const joinColumnEntityName =
|
|
32
|
-
const joinColumnInverseName =
|
|
33
|
-
|
|
34
|
-
);
|
|
72
|
+
const joinTableName = getComponentJoinTableName(contentType.collectionName, options);
|
|
73
|
+
const joinColumnEntityName = getComponentJoinColumnEntityName(options);
|
|
74
|
+
const joinColumnInverseName = getComponentJoinColumnInverseName(options);
|
|
75
|
+
const compTypeColumn = getComponentTypeColumn(options);
|
|
35
76
|
return {
|
|
36
77
|
type: "relation",
|
|
37
78
|
relation: attribute.repeatable === true ? "oneToMany" : "oneToOne",
|
|
@@ -55,16 +96,15 @@ const transformAttribute = (name, attribute, contentType) => {
|
|
|
55
96
|
orderBy: {
|
|
56
97
|
order: "asc"
|
|
57
98
|
},
|
|
58
|
-
pivotColumns: [joinColumnEntityName, joinColumnInverseName, field,
|
|
99
|
+
pivotColumns: [joinColumnEntityName, joinColumnInverseName, field, compTypeColumn]
|
|
59
100
|
}
|
|
60
101
|
};
|
|
61
102
|
}
|
|
62
103
|
case "dynamiczone": {
|
|
63
|
-
const joinTableName = getDzJoinTableName(contentType.collectionName);
|
|
64
|
-
const joinColumnEntityName =
|
|
65
|
-
const joinColumnInverseName =
|
|
66
|
-
|
|
67
|
-
);
|
|
104
|
+
const joinTableName = getDzJoinTableName(contentType.collectionName, options);
|
|
105
|
+
const joinColumnEntityName = getComponentJoinColumnEntityName(options);
|
|
106
|
+
const joinColumnInverseName = getComponentJoinColumnInverseName(options);
|
|
107
|
+
const compTypeColumn = getComponentTypeColumn(options);
|
|
68
108
|
return {
|
|
69
109
|
type: "relation",
|
|
70
110
|
relation: "morphToMany",
|
|
@@ -82,7 +122,7 @@ const transformAttribute = (name, attribute, contentType) => {
|
|
|
82
122
|
referencedColumn: id
|
|
83
123
|
},
|
|
84
124
|
typeColumn: {
|
|
85
|
-
name:
|
|
125
|
+
name: compTypeColumn
|
|
86
126
|
},
|
|
87
127
|
typeField: "__component"
|
|
88
128
|
},
|
|
@@ -92,7 +132,7 @@ const transformAttribute = (name, attribute, contentType) => {
|
|
|
92
132
|
orderBy: {
|
|
93
133
|
order: "asc"
|
|
94
134
|
},
|
|
95
|
-
pivotColumns: [joinColumnEntityName, joinColumnInverseName, field,
|
|
135
|
+
pivotColumns: [joinColumnEntityName, joinColumnInverseName, field, compTypeColumn]
|
|
96
136
|
}
|
|
97
137
|
};
|
|
98
138
|
}
|
|
@@ -101,11 +141,16 @@ const transformAttribute = (name, attribute, contentType) => {
|
|
|
101
141
|
}
|
|
102
142
|
}
|
|
103
143
|
};
|
|
104
|
-
const transformAttributes = (contentType) => {
|
|
144
|
+
const transformAttributes = (contentType, options) => {
|
|
105
145
|
return Object.keys(contentType.attributes || {}).reduce((attrs, attrName) => {
|
|
106
146
|
return {
|
|
107
147
|
...attrs,
|
|
108
|
-
[attrName]: transformAttribute(
|
|
148
|
+
[attrName]: transformAttribute(
|
|
149
|
+
attrName,
|
|
150
|
+
contentType.attributes[attrName],
|
|
151
|
+
contentType,
|
|
152
|
+
options
|
|
153
|
+
)
|
|
109
154
|
};
|
|
110
155
|
}, {});
|
|
111
156
|
};
|
|
@@ -115,11 +160,12 @@ const hasComponentsOrDz = (contentType) => {
|
|
|
115
160
|
);
|
|
116
161
|
};
|
|
117
162
|
const createDocumentId = cuid2.createId;
|
|
118
|
-
const createCompoLinkModel = (contentType) => {
|
|
119
|
-
const name = getComponentJoinTableName(contentType.collectionName);
|
|
120
|
-
const entityId =
|
|
121
|
-
const componentId =
|
|
122
|
-
const
|
|
163
|
+
const createCompoLinkModel = (contentType, options) => {
|
|
164
|
+
const name = getComponentJoinTableName(contentType.collectionName, options);
|
|
165
|
+
const entityId = getComponentJoinColumnEntityName(options);
|
|
166
|
+
const componentId = getComponentJoinColumnInverseName(options);
|
|
167
|
+
const compTypeColumn = getComponentTypeColumn(options);
|
|
168
|
+
const fkIndex = getComponentFkIndexName(contentType.collectionName, options);
|
|
123
169
|
return {
|
|
124
170
|
// TODO: make sure there can't be any conflicts with a prefix
|
|
125
171
|
singularName: name,
|
|
@@ -141,7 +187,7 @@ const createCompoLinkModel = (contentType) => {
|
|
|
141
187
|
unsigned: true
|
|
142
188
|
}
|
|
143
189
|
},
|
|
144
|
-
[
|
|
190
|
+
[compTypeColumn]: {
|
|
145
191
|
type: "string"
|
|
146
192
|
},
|
|
147
193
|
[field]: {
|
|
@@ -157,12 +203,12 @@ const createCompoLinkModel = (contentType) => {
|
|
|
157
203
|
},
|
|
158
204
|
indexes: [
|
|
159
205
|
{
|
|
160
|
-
name: identifiers.getIndexName([contentType.collectionName, field]),
|
|
206
|
+
name: identifiers.getIndexName([contentType.collectionName, field], options),
|
|
161
207
|
columns: [field]
|
|
162
208
|
},
|
|
163
209
|
{
|
|
164
|
-
name: identifiers.getIndexName([contentType.collectionName,
|
|
165
|
-
columns: [
|
|
210
|
+
name: identifiers.getIndexName([contentType.collectionName, compTypeColumn], options),
|
|
211
|
+
columns: [compTypeColumn]
|
|
166
212
|
},
|
|
167
213
|
{
|
|
168
214
|
name: fkIndex,
|
|
@@ -170,8 +216,8 @@ const createCompoLinkModel = (contentType) => {
|
|
|
170
216
|
},
|
|
171
217
|
{
|
|
172
218
|
// NOTE: since we don't include attribute names, we need to be careful not to create another unique index
|
|
173
|
-
name: identifiers.getUniqueIndexName([contentType.collectionName]),
|
|
174
|
-
columns: [entityId, componentId, field,
|
|
219
|
+
name: identifiers.getUniqueIndexName([contentType.collectionName], options),
|
|
220
|
+
columns: [entityId, componentId, field, compTypeColumn],
|
|
175
221
|
type: "unique"
|
|
176
222
|
}
|
|
177
223
|
],
|
|
@@ -180,13 +226,13 @@ const createCompoLinkModel = (contentType) => {
|
|
|
180
226
|
name: fkIndex,
|
|
181
227
|
columns: [entityId],
|
|
182
228
|
referencedColumns: [id],
|
|
183
|
-
referencedTable: identifiers.getTableName(contentType.collectionName),
|
|
229
|
+
referencedTable: identifiers.getTableName(contentType.collectionName, options),
|
|
184
230
|
onDelete: "CASCADE"
|
|
185
231
|
}
|
|
186
232
|
]
|
|
187
233
|
};
|
|
188
234
|
};
|
|
189
|
-
const transformContentTypesToModels = (contentTypes) => {
|
|
235
|
+
const transformContentTypesToModels = (contentTypes, options) => {
|
|
190
236
|
const models = [];
|
|
191
237
|
contentTypes.forEach((contentType) => {
|
|
192
238
|
assert__default.default(contentType.collectionName, 'Content type "collectionName" is required');
|
|
@@ -203,32 +249,32 @@ const transformContentTypesToModels = (contentTypes) => {
|
|
|
203
249
|
}
|
|
204
250
|
});
|
|
205
251
|
if (hasComponentsOrDz(contentType)) {
|
|
206
|
-
const compoLinkModel = createCompoLinkModel(contentType);
|
|
252
|
+
const compoLinkModel = createCompoLinkModel(contentType, options);
|
|
207
253
|
models.push(compoLinkModel);
|
|
208
254
|
}
|
|
209
255
|
const model = {
|
|
210
256
|
uid: contentType.uid,
|
|
211
257
|
singularName: contentType.modelName,
|
|
212
|
-
tableName:
|
|
258
|
+
tableName: contentType.collectionName,
|
|
259
|
+
// This gets shortened in metadata.loadModels(), so we don't shorten here or it will happen twice
|
|
213
260
|
attributes: {
|
|
214
261
|
[id]: {
|
|
215
262
|
type: "increments"
|
|
216
263
|
},
|
|
217
264
|
...documentIdAttribute,
|
|
218
|
-
...transformAttributes(contentType)
|
|
265
|
+
...transformAttributes(contentType, options)
|
|
219
266
|
}
|
|
220
267
|
};
|
|
221
268
|
models.push(model);
|
|
222
269
|
});
|
|
223
270
|
return models;
|
|
224
271
|
};
|
|
225
|
-
exports.COMPONENT_INVERSE_COLUMN_NAME = COMPONENT_INVERSE_COLUMN_NAME;
|
|
226
|
-
exports.COMPONENT_JOIN_TABLE_SUFFIX = COMPONENT_JOIN_TABLE_SUFFIX;
|
|
227
|
-
exports.COMPONENT_TYPE_COLUMN = COMPONENT_TYPE_COLUMN;
|
|
228
|
-
exports.DZ_JOIN_TABLE_SUFFIX = DZ_JOIN_TABLE_SUFFIX;
|
|
229
|
-
exports.ENTITY = ENTITY;
|
|
230
272
|
exports.createDocumentId = createDocumentId;
|
|
273
|
+
exports.getComponentFkIndexName = getComponentFkIndexName;
|
|
274
|
+
exports.getComponentJoinColumnEntityName = getComponentJoinColumnEntityName;
|
|
275
|
+
exports.getComponentJoinColumnInverseName = getComponentJoinColumnInverseName;
|
|
231
276
|
exports.getComponentJoinTableName = getComponentJoinTableName;
|
|
277
|
+
exports.getComponentTypeColumn = getComponentTypeColumn;
|
|
232
278
|
exports.getDzJoinTableName = getDzJoinTableName;
|
|
233
279
|
exports.hasComponentsOrDz = hasComponentsOrDz;
|
|
234
280
|
exports.transformAttribute = transformAttribute;
|