@strapi/types 5.0.0-alpha.5 → 5.0.0-alpha.8
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/dist/core/api.d.ts +3 -0
- package/dist/core/api.d.ts.map +1 -0
- package/dist/{types/core → core}/commands/index.d.ts +1 -1
- package/dist/core/commands/index.d.ts.map +1 -0
- package/dist/core/config/admin.d.ts.map +1 -0
- package/dist/core/config/api.d.ts.map +1 -0
- package/dist/{types/core → core}/config/database.d.ts +2 -2
- package/dist/core/config/database.d.ts.map +1 -0
- package/dist/core/config/index.d.ts.map +1 -0
- package/dist/{types/core → core}/config/middlewares.d.ts +1 -1
- package/dist/core/config/middlewares.d.ts.map +1 -0
- package/dist/core/config/plugin.d.ts.map +1 -0
- package/dist/{types/core → core}/config/server.d.ts +0 -4
- package/dist/core/config/server.d.ts.map +1 -0
- package/dist/core/config/shared.d.ts.map +1 -0
- package/dist/core/container.d.ts.map +1 -0
- package/dist/{types/core/common → core}/controller.d.ts +1 -1
- package/dist/core/controller.d.ts.map +1 -0
- package/dist/{types → core}/core-api/controller.d.ts +16 -14
- package/dist/core/core-api/controller.d.ts.map +1 -0
- package/dist/core/core-api/index.d.ts.map +1 -0
- package/dist/{types → core}/core-api/router.d.ts +7 -6
- package/dist/core/core-api/router.d.ts.map +1 -0
- package/dist/{types → core}/core-api/service.d.ts +7 -6
- package/dist/core/core-api/service.d.ts.map +1 -0
- package/dist/core/index.d.ts +14 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/{types/core/common → core}/middleware.d.ts +3 -2
- package/dist/core/middleware.d.ts.map +1 -0
- package/dist/core/module.d.ts +26 -0
- package/dist/core/module.d.ts.map +1 -0
- package/dist/core/plugin.d.ts +6 -0
- package/dist/core/plugin.d.ts.map +1 -0
- package/dist/core/policy.d.ts +15 -0
- package/dist/core/policy.d.ts.map +1 -0
- package/dist/core/router.d.ts.map +1 -0
- package/dist/core/service.d.ts.map +1 -0
- package/dist/core/strapi.d.ts +156 -0
- package/dist/core/strapi.d.ts.map +1 -0
- package/dist/data/component.d.ts +12 -0
- package/dist/data/component.d.ts.map +1 -0
- package/dist/data/constants.d.ts +2 -0
- package/dist/data/constants.d.ts.map +1 -0
- package/dist/data/content-type.d.ts +17 -0
- package/dist/data/content-type.d.ts.map +1 -0
- package/dist/data/entity.d.ts +9 -0
- package/dist/data/entity.d.ts.map +1 -0
- package/dist/data/index.d.ts +5 -0
- package/dist/data/index.d.ts.map +1 -0
- package/dist/index.d.ts +11 -150
- package/dist/index.d.ts.map +1 -1
- package/dist/internal/index.d.ts +13 -0
- package/dist/internal/index.d.ts.map +1 -0
- package/dist/{types/core → internal}/namespace.d.ts +6 -6
- package/dist/internal/namespace.d.ts.map +1 -0
- package/dist/internal/registry.d.ts +8 -0
- package/dist/internal/registry.d.ts.map +1 -0
- package/dist/{types/core → internal}/uid.d.ts +20 -13
- package/dist/internal/uid.d.ts.map +1 -0
- package/dist/modules/auth.d.ts +4 -4
- package/dist/modules/auth.d.ts.map +1 -1
- package/dist/modules/content-api.d.ts +5 -3
- package/dist/modules/content-api.d.ts.map +1 -1
- package/dist/modules/core-store.d.ts +3 -3
- package/dist/modules/core-store.d.ts.map +1 -1
- package/dist/modules/cron.d.ts +1 -1
- package/dist/modules/cron.d.ts.map +1 -1
- package/dist/modules/documents/document-engine.d.ts +2 -0
- package/dist/modules/documents/document-engine.d.ts.map +1 -0
- package/dist/modules/documents/draft-and-publish.d.ts +7 -7
- package/dist/modules/documents/draft-and-publish.d.ts.map +1 -1
- package/dist/modules/documents/index.d.ts +2 -2
- package/dist/modules/documents/index.d.ts.map +1 -1
- package/dist/modules/documents/middleware.d.ts +2 -2
- package/dist/modules/documents/middleware.d.ts.map +1 -1
- package/dist/modules/documents/params/attributes.d.ts +33 -30
- package/dist/modules/documents/params/attributes.d.ts.map +1 -1
- package/dist/modules/documents/params/data.d.ts +2 -2
- package/dist/modules/documents/params/data.d.ts.map +1 -1
- package/dist/modules/documents/params/document-engine.d.ts +14 -14
- package/dist/modules/documents/params/document-engine.d.ts.map +1 -1
- package/dist/modules/documents/params/fields.d.ts +7 -5
- package/dist/modules/documents/params/fields.d.ts.map +1 -1
- package/dist/modules/documents/params/filters/index.d.ts +11 -9
- package/dist/modules/documents/params/filters/index.d.ts.map +1 -1
- package/dist/modules/documents/params/index.d.ts +5 -4
- package/dist/modules/documents/params/index.d.ts.map +1 -1
- package/dist/modules/documents/params/pagination.d.ts +2 -2
- package/dist/modules/documents/params/pagination.d.ts.map +1 -1
- package/dist/modules/documents/params/populate.d.ts +19 -17
- package/dist/modules/documents/params/populate.d.ts.map +1 -1
- package/dist/modules/documents/params/sort.d.ts +10 -8
- package/dist/modules/documents/params/sort.d.ts.map +1 -1
- package/dist/modules/documents/plugin.d.ts +8 -5
- package/dist/modules/documents/plugin.d.ts.map +1 -1
- package/dist/modules/documents/result/document-engine.d.ts +30 -0
- package/dist/modules/documents/result/document-engine.d.ts.map +1 -0
- package/dist/modules/documents/result/index.d.ts +38 -35
- package/dist/modules/documents/result/index.d.ts.map +1 -1
- package/dist/modules/documents/service-instance.d.ts +6 -6
- package/dist/modules/documents/service-instance.d.ts.map +1 -1
- package/dist/modules/entity-service/index.d.ts +22 -22
- package/dist/modules/entity-service/index.d.ts.map +1 -1
- package/dist/modules/entity-service/params/attributes/id.d.ts +2 -2
- package/dist/modules/entity-service/params/attributes/id.d.ts.map +1 -1
- package/dist/modules/entity-service/params/attributes/index.d.ts +21 -19
- package/dist/modules/entity-service/params/attributes/index.d.ts.map +1 -1
- package/dist/modules/entity-service/params/attributes/literals.d.ts +1 -1
- package/dist/modules/entity-service/params/attributes/literals.d.ts.map +1 -1
- package/dist/modules/entity-service/params/attributes/relation.d.ts +6 -4
- package/dist/modules/entity-service/params/attributes/relation.d.ts.map +1 -1
- package/dist/modules/entity-service/params/attributes/utils.d.ts +8 -6
- package/dist/modules/entity-service/params/attributes/utils.d.ts.map +1 -1
- package/dist/modules/entity-service/params/data.d.ts +2 -2
- package/dist/modules/entity-service/params/data.d.ts.map +1 -1
- package/dist/modules/entity-service/params/fields.d.ts +7 -5
- package/dist/modules/entity-service/params/fields.d.ts.map +1 -1
- package/dist/modules/entity-service/params/filters/index.d.ts +17 -15
- package/dist/modules/entity-service/params/filters/index.d.ts.map +1 -1
- package/dist/modules/entity-service/params/index.d.ts +4 -3
- package/dist/modules/entity-service/params/index.d.ts.map +1 -1
- package/dist/modules/entity-service/params/pagination.d.ts +1 -2
- package/dist/modules/entity-service/params/pagination.d.ts.map +1 -1
- package/dist/modules/entity-service/params/populate.d.ts +20 -18
- package/dist/modules/entity-service/params/populate.d.ts.map +1 -1
- package/dist/modules/entity-service/params/sort.d.ts +11 -9
- package/dist/modules/entity-service/params/sort.d.ts.map +1 -1
- package/dist/modules/entity-service/plugin.d.ts +8 -5
- package/dist/modules/entity-service/plugin.d.ts.map +1 -1
- package/dist/modules/entity-service/result.d.ts +34 -45
- package/dist/modules/entity-service/result.d.ts.map +1 -1
- package/dist/modules/entity-validator.d.ts +5 -4
- package/dist/modules/entity-validator.d.ts.map +1 -1
- package/dist/modules/index.d.ts +20 -0
- package/dist/modules/index.d.ts.map +1 -0
- package/dist/modules/permissions.d.ts +14 -0
- package/dist/modules/permissions.d.ts.map +1 -0
- package/dist/modules/sanitizers.d.ts +4 -5
- package/dist/modules/sanitizers.d.ts.map +1 -1
- package/dist/modules/server.d.ts +3 -3
- package/dist/modules/server.d.ts.map +1 -1
- package/dist/modules/validators.d.ts +4 -5
- package/dist/modules/validators.d.ts.map +1 -1
- package/dist/plugin/config/index.d.ts.map +1 -0
- package/dist/plugin/config/strapi-admin/index.d.ts.map +1 -0
- package/dist/plugin/config/strapi-server/config.d.ts.map +1 -0
- package/dist/{types/core/plugins → plugin}/config/strapi-server/content-types.d.ts +2 -2
- package/dist/plugin/config/strapi-server/content-types.d.ts.map +1 -0
- package/dist/plugin/config/strapi-server/controllers.d.ts +8 -0
- package/dist/plugin/config/strapi-server/controllers.d.ts.map +1 -0
- package/dist/plugin/config/strapi-server/index.d.ts.map +1 -0
- package/dist/{types/core/plugins → plugin}/config/strapi-server/lifecycle.d.ts +1 -1
- package/dist/plugin/config/strapi-server/lifecycle.d.ts.map +1 -0
- package/dist/plugin/config/strapi-server/routes.d.ts +11 -0
- package/dist/plugin/config/strapi-server/routes.d.ts.map +1 -0
- package/dist/plugin/index.d.ts +37 -0
- package/dist/plugin/index.d.ts.map +1 -0
- package/dist/public/index.d.ts +6 -0
- package/dist/public/index.d.ts.map +1 -0
- package/dist/public/registries.d.ts +34 -0
- package/dist/public/registries.d.ts.map +1 -0
- package/dist/public/shared.d.ts +8 -0
- package/dist/public/shared.d.ts.map +1 -0
- package/dist/{types/core/attributes → schema/attribute}/base.d.ts +4 -30
- package/dist/schema/attribute/base.d.ts.map +1 -0
- package/dist/schema/attribute/common.d.ts +4 -0
- package/dist/schema/attribute/common.d.ts.map +1 -0
- package/dist/schema/attribute/constants.d.ts +12 -0
- package/dist/schema/attribute/constants.d.ts.map +1 -0
- package/dist/schema/attribute/definitions/biginteger.d.ts +16 -0
- package/dist/schema/attribute/definitions/biginteger.d.ts.map +1 -0
- package/dist/{types/core/attributes → schema/attribute/definitions}/blocks.d.ts +17 -13
- package/dist/schema/attribute/definitions/blocks.d.ts.map +1 -0
- package/dist/schema/attribute/definitions/boolean.d.ts +16 -0
- package/dist/schema/attribute/definitions/boolean.d.ts.map +1 -0
- package/dist/schema/attribute/definitions/component.d.ts +22 -0
- package/dist/schema/attribute/definitions/component.d.ts.map +1 -0
- package/dist/schema/attribute/definitions/date-time.d.ts +15 -0
- package/dist/schema/attribute/definitions/date-time.d.ts.map +1 -0
- package/dist/schema/attribute/definitions/date.d.ts +15 -0
- package/dist/schema/attribute/definitions/date.d.ts.map +1 -0
- package/dist/schema/attribute/definitions/decimal.d.ts +16 -0
- package/dist/schema/attribute/definitions/decimal.d.ts.map +1 -0
- package/dist/schema/attribute/definitions/dynamic-zone.d.ts +22 -0
- package/dist/schema/attribute/definitions/dynamic-zone.d.ts.map +1 -0
- package/dist/schema/attribute/definitions/email.d.ts +16 -0
- package/dist/schema/attribute/definitions/email.d.ts.map +1 -0
- package/dist/schema/attribute/definitions/enumeration.d.ts +19 -0
- package/dist/schema/attribute/definitions/enumeration.d.ts.map +1 -0
- package/dist/schema/attribute/definitions/float.d.ts +16 -0
- package/dist/schema/attribute/definitions/float.d.ts.map +1 -0
- package/dist/schema/attribute/definitions/index.d.ts +23 -0
- package/dist/schema/attribute/definitions/index.d.ts.map +1 -0
- package/dist/schema/attribute/definitions/integer.d.ts +16 -0
- package/dist/schema/attribute/definitions/integer.d.ts.map +1 -0
- package/dist/schema/attribute/definitions/json.d.ts +14 -0
- package/dist/schema/attribute/definitions/json.d.ts.map +1 -0
- package/dist/schema/attribute/definitions/media.d.ts +21 -0
- package/dist/schema/attribute/definitions/media.d.ts.map +1 -0
- package/dist/schema/attribute/definitions/password.d.ts +15 -0
- package/dist/schema/attribute/definitions/password.d.ts.map +1 -0
- package/dist/schema/attribute/definitions/relation.d.ts +165 -0
- package/dist/schema/attribute/definitions/relation.d.ts.map +1 -0
- package/dist/schema/attribute/definitions/richtext.d.ts +15 -0
- package/dist/schema/attribute/definitions/richtext.d.ts.map +1 -0
- package/dist/schema/attribute/definitions/string.d.ts +22 -0
- package/dist/schema/attribute/definitions/string.d.ts.map +1 -0
- package/dist/schema/attribute/definitions/text.d.ts +20 -0
- package/dist/schema/attribute/definitions/text.d.ts.map +1 -0
- package/dist/schema/attribute/definitions/time.d.ts +15 -0
- package/dist/schema/attribute/definitions/time.d.ts.map +1 -0
- package/dist/schema/attribute/definitions/timestamp.d.ts +15 -0
- package/dist/schema/attribute/definitions/timestamp.d.ts.map +1 -0
- package/dist/{types/core/attributes → schema/attribute/definitions}/uid.d.ts +13 -2
- package/dist/schema/attribute/definitions/uid.d.ts.map +1 -0
- package/dist/schema/attribute/index.d.ts +7 -0
- package/dist/schema/attribute/index.d.ts.map +1 -0
- package/dist/schema/attribute/options.d.ts +81 -0
- package/dist/schema/attribute/options.d.ts.map +1 -0
- package/dist/schema/attribute/utils.d.ts +60 -0
- package/dist/schema/attribute/utils.d.ts.map +1 -0
- package/dist/schema/index.d.ts +71 -0
- package/dist/schema/index.d.ts.map +1 -0
- package/dist/struct/index.d.ts +3 -0
- package/dist/struct/index.d.ts.map +1 -0
- package/dist/struct/schema-definition.d.ts +10 -0
- package/dist/struct/schema-definition.d.ts.map +1 -0
- package/dist/{types/core/schemas/index.d.ts → struct/schema.d.ts} +46 -36
- package/dist/struct/schema.d.ts.map +1 -0
- package/dist/uid/index.d.ts +43 -0
- package/dist/uid/index.d.ts.map +1 -0
- package/dist/utils/array.d.ts +80 -0
- package/dist/utils/array.d.ts.map +1 -0
- package/dist/utils/constants.d.ts +67 -0
- package/dist/utils/constants.d.ts.map +1 -0
- package/dist/utils/expression.d.ts +490 -0
- package/dist/utils/expression.d.ts.map +1 -0
- package/dist/utils/function.d.ts +21 -0
- package/dist/utils/function.d.ts.map +1 -0
- package/dist/utils/guard.d.ts +90 -0
- package/dist/utils/guard.d.ts.map +1 -0
- package/dist/utils/index.d.ts +180 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/json.d.ts +119 -0
- package/dist/utils/json.d.ts.map +1 -0
- package/dist/utils/object.d.ts +180 -0
- package/dist/utils/object.d.ts.map +1 -0
- package/dist/utils/string.d.ts +154 -0
- package/dist/utils/string.d.ts.map +1 -0
- package/dist/utils/tuple.d.ts +19 -0
- package/dist/utils/tuple.d.ts.map +1 -0
- package/package.json +14 -12
- package/dist/container.d.ts.map +0 -1
- package/dist/modules/documents/result/document-enigne.d.ts +0 -30
- package/dist/modules/documents/result/document-enigne.d.ts.map +0 -1
- package/dist/types/core/attributes/base.d.ts.map +0 -1
- package/dist/types/core/attributes/biginteger.d.ts +0 -5
- package/dist/types/core/attributes/biginteger.d.ts.map +0 -1
- package/dist/types/core/attributes/blocks.d.ts.map +0 -1
- package/dist/types/core/attributes/boolean.d.ts +0 -7
- package/dist/types/core/attributes/boolean.d.ts.map +0 -1
- package/dist/types/core/attributes/common.d.ts +0 -59
- package/dist/types/core/attributes/common.d.ts.map +0 -1
- package/dist/types/core/attributes/component.d.ts +0 -20
- package/dist/types/core/attributes/component.d.ts.map +0 -1
- package/dist/types/core/attributes/date-time.d.ts +0 -5
- package/dist/types/core/attributes/date-time.d.ts.map +0 -1
- package/dist/types/core/attributes/date.d.ts +0 -5
- package/dist/types/core/attributes/date.d.ts.map +0 -1
- package/dist/types/core/attributes/decimal.d.ts +0 -5
- package/dist/types/core/attributes/decimal.d.ts.map +0 -1
- package/dist/types/core/attributes/dynamic-zone.d.ts +0 -13
- package/dist/types/core/attributes/dynamic-zone.d.ts.map +0 -1
- package/dist/types/core/attributes/email.d.ts +0 -5
- package/dist/types/core/attributes/email.d.ts.map +0 -1
- package/dist/types/core/attributes/enumeration.d.ts +0 -10
- package/dist/types/core/attributes/enumeration.d.ts.map +0 -1
- package/dist/types/core/attributes/float.d.ts +0 -5
- package/dist/types/core/attributes/float.d.ts.map +0 -1
- package/dist/types/core/attributes/index.d.ts +0 -26
- package/dist/types/core/attributes/index.d.ts.map +0 -1
- package/dist/types/core/attributes/integer.d.ts +0 -5
- package/dist/types/core/attributes/integer.d.ts.map +0 -1
- package/dist/types/core/attributes/json.d.ts +0 -6
- package/dist/types/core/attributes/json.d.ts.map +0 -1
- package/dist/types/core/attributes/media.d.ts +0 -13
- package/dist/types/core/attributes/media.d.ts.map +0 -1
- package/dist/types/core/attributes/password.d.ts +0 -5
- package/dist/types/core/attributes/password.d.ts.map +0 -1
- package/dist/types/core/attributes/relation.d.ts +0 -85
- package/dist/types/core/attributes/relation.d.ts.map +0 -1
- package/dist/types/core/attributes/richtext.d.ts +0 -5
- package/dist/types/core/attributes/richtext.d.ts.map +0 -1
- package/dist/types/core/attributes/string.d.ts +0 -10
- package/dist/types/core/attributes/string.d.ts.map +0 -1
- package/dist/types/core/attributes/text.d.ts +0 -8
- package/dist/types/core/attributes/text.d.ts.map +0 -1
- package/dist/types/core/attributes/time.d.ts +0 -5
- package/dist/types/core/attributes/time.d.ts.map +0 -1
- package/dist/types/core/attributes/timestamp.d.ts +0 -5
- package/dist/types/core/attributes/timestamp.d.ts.map +0 -1
- package/dist/types/core/attributes/uid.d.ts.map +0 -1
- package/dist/types/core/attributes/utils.d.ts +0 -28
- package/dist/types/core/attributes/utils.d.ts.map +0 -1
- package/dist/types/core/commands/index.d.ts.map +0 -1
- package/dist/types/core/common/api.d.ts +0 -4
- package/dist/types/core/common/api.d.ts.map +0 -1
- package/dist/types/core/common/controller.d.ts.map +0 -1
- package/dist/types/core/common/index.d.ts +0 -15
- package/dist/types/core/common/index.d.ts.map +0 -1
- package/dist/types/core/common/middleware.d.ts.map +0 -1
- package/dist/types/core/common/module.d.ts +0 -25
- package/dist/types/core/common/module.d.ts.map +0 -1
- package/dist/types/core/common/plugin.d.ts +0 -6
- package/dist/types/core/common/plugin.d.ts.map +0 -1
- package/dist/types/core/common/policy.d.ts +0 -10
- package/dist/types/core/common/policy.d.ts.map +0 -1
- package/dist/types/core/common/router.d.ts.map +0 -1
- package/dist/types/core/common/schema.d.ts +0 -3
- package/dist/types/core/common/schema.d.ts.map +0 -1
- package/dist/types/core/common/service.d.ts.map +0 -1
- package/dist/types/core/common/uid.d.ts +0 -16
- package/dist/types/core/common/uid.d.ts.map +0 -1
- package/dist/types/core/config/admin.d.ts.map +0 -1
- package/dist/types/core/config/api.d.ts.map +0 -1
- package/dist/types/core/config/database.d.ts.map +0 -1
- package/dist/types/core/config/index.d.ts.map +0 -1
- package/dist/types/core/config/middlewares.d.ts.map +0 -1
- package/dist/types/core/config/plugin.d.ts.map +0 -1
- package/dist/types/core/config/server.d.ts.map +0 -1
- package/dist/types/core/config/shared.d.ts.map +0 -1
- package/dist/types/core/entity/index.d.ts +0 -2
- package/dist/types/core/entity/index.d.ts.map +0 -1
- package/dist/types/core/index.d.ts +0 -11
- package/dist/types/core/index.d.ts.map +0 -1
- package/dist/types/core/namespace.d.ts.map +0 -1
- package/dist/types/core/permissions/index.d.ts +0 -5
- package/dist/types/core/permissions/index.d.ts.map +0 -1
- package/dist/types/core/plugins/config/index.d.ts.map +0 -1
- package/dist/types/core/plugins/config/strapi-admin/index.d.ts.map +0 -1
- package/dist/types/core/plugins/config/strapi-server/config.d.ts.map +0 -1
- package/dist/types/core/plugins/config/strapi-server/content-types.d.ts.map +0 -1
- package/dist/types/core/plugins/config/strapi-server/controllers.d.ts +0 -8
- package/dist/types/core/plugins/config/strapi-server/controllers.d.ts.map +0 -1
- package/dist/types/core/plugins/config/strapi-server/index.d.ts.map +0 -1
- package/dist/types/core/plugins/config/strapi-server/lifecycle.d.ts.map +0 -1
- package/dist/types/core/plugins/config/strapi-server/routes.d.ts +0 -11
- package/dist/types/core/plugins/config/strapi-server/routes.d.ts.map +0 -1
- package/dist/types/core/plugins/index.d.ts +0 -33
- package/dist/types/core/plugins/index.d.ts.map +0 -1
- package/dist/types/core/registry.d.ts +0 -58
- package/dist/types/core/registry.d.ts.map +0 -1
- package/dist/types/core/schemas/index.d.ts.map +0 -1
- package/dist/types/core/strapi/index.d.ts +0 -26
- package/dist/types/core/strapi/index.d.ts.map +0 -1
- package/dist/types/core/uid.d.ts.map +0 -1
- package/dist/types/core-api/controller.d.ts.map +0 -1
- package/dist/types/core-api/index.d.ts.map +0 -1
- package/dist/types/core-api/router.d.ts.map +0 -1
- package/dist/types/core-api/service.d.ts.map +0 -1
- package/dist/types/index.d.ts +0 -5
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/shared/index.d.ts +0 -5
- package/dist/types/shared/index.d.ts.map +0 -1
- package/dist/types/shared/registries.d.ts +0 -38
- package/dist/types/shared/registries.d.ts.map +0 -1
- package/dist/types/utils/array.d.ts +0 -16
- package/dist/types/utils/array.d.ts.map +0 -1
- package/dist/types/utils/expression.d.ts +0 -44
- package/dist/types/utils/expression.d.ts.map +0 -1
- package/dist/types/utils/function.d.ts +0 -3
- package/dist/types/utils/function.d.ts.map +0 -1
- package/dist/types/utils/guard.d.ts +0 -20
- package/dist/types/utils/guard.d.ts.map +0 -1
- package/dist/types/utils/index.d.ts +0 -27
- package/dist/types/utils/index.d.ts.map +0 -1
- package/dist/types/utils/json.d.ts +0 -7
- package/dist/types/utils/json.d.ts.map +0 -1
- package/dist/types/utils/object.d.ts +0 -69
- package/dist/types/utils/object.d.ts.map +0 -1
- package/dist/types/utils/string.d.ts +0 -40
- package/dist/types/utils/string.d.ts.map +0 -1
- package/dist/types/utils/tuple.d.ts +0 -9
- package/dist/types/utils/tuple.d.ts.map +0 -1
- /package/dist/{types/core → core}/config/admin.d.ts +0 -0
- /package/dist/{types/core → core}/config/api.d.ts +0 -0
- /package/dist/{types/core → core}/config/index.d.ts +0 -0
- /package/dist/{types/core → core}/config/plugin.d.ts +0 -0
- /package/dist/{types/core → core}/config/shared.d.ts +0 -0
- /package/dist/{container.d.ts → core/container.d.ts} +0 -0
- /package/dist/{types → core}/core-api/index.d.ts +0 -0
- /package/dist/{types/core/common → core}/router.d.ts +0 -0
- /package/dist/{types/core/common → core}/service.d.ts +0 -0
- /package/dist/{types/core/plugins → plugin}/config/index.d.ts +0 -0
- /package/dist/{types/core/plugins → plugin}/config/strapi-admin/index.d.ts +0 -0
- /package/dist/{types/core/plugins → plugin}/config/strapi-server/config.d.ts +0 -0
- /package/dist/{types/core/plugins → plugin}/config/strapi-server/index.d.ts +0 -0
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
export interface RequiredOption {
|
|
2
|
+
required?: boolean;
|
|
3
|
+
}
|
|
4
|
+
export interface PrivateOption {
|
|
5
|
+
private?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export interface UniqueOption {
|
|
8
|
+
unique?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface DefaultOption<T> {
|
|
11
|
+
default?: T | (() => T);
|
|
12
|
+
}
|
|
13
|
+
export interface ConfigurableOption {
|
|
14
|
+
configurable?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export interface MinMaxOption<T = number> {
|
|
17
|
+
min?: T;
|
|
18
|
+
max?: T;
|
|
19
|
+
}
|
|
20
|
+
export interface MinMaxLengthOption {
|
|
21
|
+
minLength?: number;
|
|
22
|
+
maxLength?: number;
|
|
23
|
+
}
|
|
24
|
+
export interface WritableOption {
|
|
25
|
+
writable?: boolean;
|
|
26
|
+
}
|
|
27
|
+
export interface VisibleOption {
|
|
28
|
+
visible?: boolean;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Setters for the attributes options
|
|
32
|
+
*/
|
|
33
|
+
export type Required = {
|
|
34
|
+
required: true;
|
|
35
|
+
};
|
|
36
|
+
export type NonRequired = {
|
|
37
|
+
required: false;
|
|
38
|
+
};
|
|
39
|
+
export type Private = {
|
|
40
|
+
private: true;
|
|
41
|
+
};
|
|
42
|
+
export type NonPrivate = {
|
|
43
|
+
private: false;
|
|
44
|
+
};
|
|
45
|
+
export type Unique = {
|
|
46
|
+
unique: true;
|
|
47
|
+
};
|
|
48
|
+
export type NonUnique = {
|
|
49
|
+
unique: false;
|
|
50
|
+
};
|
|
51
|
+
export type Configurable = {
|
|
52
|
+
configurable: true;
|
|
53
|
+
};
|
|
54
|
+
export type NonConfigurable = {
|
|
55
|
+
configurable: false;
|
|
56
|
+
};
|
|
57
|
+
export type Writable = {
|
|
58
|
+
writable: true;
|
|
59
|
+
};
|
|
60
|
+
export type NonWritable = {
|
|
61
|
+
writable: false;
|
|
62
|
+
};
|
|
63
|
+
export type Visible = {
|
|
64
|
+
visible: true;
|
|
65
|
+
};
|
|
66
|
+
export type NonVisible = {
|
|
67
|
+
visible: false;
|
|
68
|
+
};
|
|
69
|
+
export type CustomField<TKind extends string, TOptions extends object | undefined = undefined> = {
|
|
70
|
+
customField: TKind;
|
|
71
|
+
options?: TOptions;
|
|
72
|
+
};
|
|
73
|
+
export type SetMinMax<TConfig extends MinMaxOption<TType>, TType = number> = TConfig;
|
|
74
|
+
export type SetMinMaxLength<TConfig extends MinMaxLengthOption> = TConfig;
|
|
75
|
+
export type SetPluginOptions<TConfig extends object = object> = {
|
|
76
|
+
pluginOptions?: TConfig;
|
|
77
|
+
};
|
|
78
|
+
export type DefaultTo<T> = {
|
|
79
|
+
default: T;
|
|
80
|
+
};
|
|
81
|
+
//# sourceMappingURL=options.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../../src/schema/attribute/options.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,YAAY;IAC3B,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,aAAa,CAAC,CAAC;IAC9B,OAAO,CAAC,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;CACzB;AAED,MAAM,WAAW,kBAAkB;IACjC,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,YAAY,CAAC,CAAC,GAAG,MAAM;IACtC,GAAG,CAAC,EAAE,CAAC,CAAC;IACR,GAAG,CAAC,EAAE,CAAC,CAAC;CACT;AAED,MAAM,WAAW,kBAAkB;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;GAEG;AAGH,MAAM,MAAM,QAAQ,GAAG;IAAE,QAAQ,EAAE,IAAI,CAAA;CAAE,CAAC;AAC1C,MAAM,MAAM,WAAW,GAAG;IAAE,QAAQ,EAAE,KAAK,CAAA;CAAE,CAAC;AAG9C,MAAM,M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AAC,IAAI;IAAE,OAAO,EAAE,CAAC,CAAA;CAAE,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type * as UID from '../../uid';
|
|
2
|
+
import type { Constants, Guard, And, Extends, IsNotNever } from '../../utils';
|
|
3
|
+
import type { Attribute } from '..';
|
|
4
|
+
/**
|
|
5
|
+
* Determines if a given attribute type is of a specific kind.
|
|
6
|
+
*
|
|
7
|
+
* @template TAttribute - The attribute type to check.
|
|
8
|
+
* @template TKind - The kind of attribute to compare against.
|
|
9
|
+
*/
|
|
10
|
+
export type IsOfType<TAttribute extends Attribute.Attribute, TKind extends Attribute.Kind> = TAttribute extends {
|
|
11
|
+
type: TKind;
|
|
12
|
+
} ? true : false;
|
|
13
|
+
/**
|
|
14
|
+
* Checks whether a given Attribute {@link TAttribute} is populatable.
|
|
15
|
+
*
|
|
16
|
+
* @template TAttribute - The attribute to check.
|
|
17
|
+
*
|
|
18
|
+
* @see {@link PopulatableKind} for more information about populatable attributes.
|
|
19
|
+
*/
|
|
20
|
+
export type IsPopulatable<TAttribute extends Attribute.Attribute> = IsOfType<TAttribute, Attribute.PopulatableKind>;
|
|
21
|
+
/**
|
|
22
|
+
* Returns the type (as {@link Kind}) of a given attribute.
|
|
23
|
+
*
|
|
24
|
+
* @template TAttribute - Any attribute
|
|
25
|
+
*/
|
|
26
|
+
export type TypeOf<TAttribute extends Attribute.Attribute> = TAttribute['type'];
|
|
27
|
+
export type Target<TAttribute extends Attribute.Attribute> = Attribute.RelationTarget<TAttribute> | Attribute.ComponentTarget<TAttribute> | Attribute.MediaTarget<TAttribute>;
|
|
28
|
+
export type MorphTargets<TAttribute extends Attribute.Attribute> = Attribute.DynamicZoneTargets<TAttribute>;
|
|
29
|
+
export type HasTarget<TAttribute extends Attribute.Attribute> = Target<TAttribute> extends infer TTarget ? And<IsNotNever<TTarget>, Extends<TTarget, UID.Schema>> : Constants.False;
|
|
30
|
+
export type HasMorphTargets<TAttribute extends Attribute.Attribute> = MorphTargets<TAttribute> extends infer TMaybeTargets ? And<IsNotNever<TMaybeTargets>, Extends<TMaybeTargets, UID.Schema>> : Constants.False;
|
|
31
|
+
/**
|
|
32
|
+
* Represents the actual value of a given attribute {@link TAttribute}.
|
|
33
|
+
*
|
|
34
|
+
* @template TAttribute - The attribute to extract the value from.
|
|
35
|
+
*/
|
|
36
|
+
export type Value<TAttribute extends Attribute.Attribute, TGuard = unknown> = Guard.Never<{
|
|
37
|
+
biginteger: Attribute.GetBigIntegerValue<TAttribute>;
|
|
38
|
+
boolean: Attribute.GetBooleanValue<TAttribute>;
|
|
39
|
+
blocks: Attribute.GetBlocksValue<TAttribute>;
|
|
40
|
+
decimal: Attribute.GetDecimalValue<TAttribute>;
|
|
41
|
+
enumeration: Attribute.GetEnumerationValue<TAttribute>;
|
|
42
|
+
email: Attribute.GetEmailValue<TAttribute>;
|
|
43
|
+
float: Attribute.GetFloatValue<TAttribute>;
|
|
44
|
+
integer: Attribute.GetIntegerValue<TAttribute>;
|
|
45
|
+
json: Attribute.GetJsonValue<TAttribute>;
|
|
46
|
+
password: Attribute.GetPasswordValue<TAttribute>;
|
|
47
|
+
richtext: Attribute.GetRichTextValue<TAttribute>;
|
|
48
|
+
string: Attribute.GetStringValue<TAttribute>;
|
|
49
|
+
text: Attribute.GetTextValue<TAttribute>;
|
|
50
|
+
uid: Attribute.GetUIDValue<TAttribute>;
|
|
51
|
+
date: Attribute.GetDateValue<TAttribute>;
|
|
52
|
+
datetime: Attribute.GetDateTimeValue<TAttribute>;
|
|
53
|
+
time: Attribute.GetTimeValue<TAttribute>;
|
|
54
|
+
timestamp: Attribute.GetTimestampValue<TAttribute>;
|
|
55
|
+
component: Attribute.GetComponentValue<TAttribute>;
|
|
56
|
+
dynamiczone: Attribute.GetDynamicZoneValue<TAttribute>;
|
|
57
|
+
media: Attribute.GetMediaValue<TAttribute>;
|
|
58
|
+
relation: Attribute.GetRelationValue<TAttribute>;
|
|
59
|
+
}[Attribute.TypeOf<TAttribute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AC,CAAC;IAC7C,IAAI,EAAE,SAAS,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;IACzC,GAAG,EAAE,SAAS,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IACvC,IAAI,EAAE,SAAS,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;IACzC,QAAQ,EAAE,SAAS,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC;IACjD,IAAI,EAAE,SAAS,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;IACzC,SAAS,EAAE,SAAS,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAC;IAEnD,SAAS,EAAE,SAAS,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAC;IACnD,WAAW,EAAE,SAAS,CAAC,mBAAmB,CAAC,UAAU,CAAC,CAAC;IACvD,KAAK,EAAE,SAAS,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;IAC3C,QAAQ,EAAE,SAAS,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC;CAClD,CAAC,SAAS,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,EAC/B,MAAM,CACP,CAAC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type * as Public from '../public';
|
|
2
|
+
import type * as UID from '../uid';
|
|
3
|
+
import type { If, Object, Guard } from '../utils';
|
|
4
|
+
import type * as Attribute from './attribute';
|
|
5
|
+
export { Attribute };
|
|
6
|
+
/**
|
|
7
|
+
* The Schemas type represents a combination of both content type and component schemas
|
|
8
|
+
*
|
|
9
|
+
* Both are fetched from the public registries.
|
|
10
|
+
*/
|
|
11
|
+
export type Schemas = Public.ContentTypeSchemas & Public.ComponentSchemas;
|
|
12
|
+
export type ContentTypes = Public.ContentTypeSchemas;
|
|
13
|
+
export type Components = Public.ComponentSchemas;
|
|
14
|
+
export type ContentType<TContentTypeUID extends UID.ContentType = UID.ContentType> = ContentTypes[TContentTypeUID];
|
|
15
|
+
export type Component<TComponentUID extends UID.Component = UID.Component> = Components[TComponentUID];
|
|
16
|
+
/**
|
|
17
|
+
* Returns the Schema data structure associated with the given UID
|
|
18
|
+
*
|
|
19
|
+
* @template TSchemaUID - The unique identifier for the schema.
|
|
20
|
+
*/
|
|
21
|
+
export type Schema<TSchemaUID extends UID.Schema = UID.Schema> = Schemas[TSchemaUID];
|
|
22
|
+
/**
|
|
23
|
+
* Returns the `info` property for a given schema.
|
|
24
|
+
*
|
|
25
|
+
* @template TSchemaUID - The targeted schema UID.
|
|
26
|
+
*/
|
|
27
|
+
export type Info<TSchemaUID extends UID.Schema> = Schema<TSchemaUID>['info'];
|
|
28
|
+
/**
|
|
29
|
+
* Returns the `modelType` property for a given schema.
|
|
30
|
+
*
|
|
31
|
+
* @template TSchemaUID - The targeted schema UID.
|
|
32
|
+
*/
|
|
33
|
+
export type ModelType<TSchemaUID extends UID.Schema> = Schema<TSchemaUID>['modelType'];
|
|
34
|
+
/**
|
|
35
|
+
* Returns the attribute {@link TAttributeName} from {@link TSchemaUID}'s attributes.
|
|
36
|
+
*
|
|
37
|
+
* @template TSchemaUID - The Schema's UID used to look for attributes.
|
|
38
|
+
* @template TAttributeName - The name of the wanted attribute.
|
|
39
|
+
*/
|
|
40
|
+
export type AttributeByName<TSchemaUID extends UID.Schema, TAttributeName extends AttributeNames<TSchemaUID>> = Attributes<TSchemaUID>[TAttributeName];
|
|
41
|
+
/**
|
|
42
|
+
* Represents the value of an attribute based on its name
|
|
43
|
+
*
|
|
44
|
+
* @template TSchemaUID - The Schema's UID used to look for attributes.
|
|
45
|
+
* @template TAttributeName - The name of the wanted attribute.
|
|
46
|
+
*/
|
|
47
|
+
export type AttributeValueByName<TSchemaUID extends UID.Schema, TAttributeName extends AttributeNames<TSchemaUID>> = Attribute.Value<AttributeByName<TSchemaUID, TAttributeName>>;
|
|
48
|
+
/**
|
|
49
|
+
* Returns an object containing every attribute within {@link TSchemaUID}.
|
|
50
|
+
*
|
|
51
|
+
* @template TSchemaUID - The Schema's UID used to get its attributes
|
|
52
|
+
*/
|
|
53
|
+
export type Attributes<TSchemaUID extends UID.Schema = UID.Schema> = {
|
|
54
|
+
[TUID in TSchemaUID]: Schema<TSchemaUID>['attributes'];
|
|
55
|
+
}[TSchemaUID];
|
|
56
|
+
/**
|
|
57
|
+
* Union type of every attribute name within {@link TSchemaUID}'s attributes
|
|
58
|
+
*
|
|
59
|
+
* @template TSchemaUID - The Schema's UID used to get the attributes names.
|
|
60
|
+
*/
|
|
61
|
+
export type AttributeNames<TSchemaUID extends UID.Schema> = Extract<keyof Attributes<TSchemaUID>, string>;
|
|
62
|
+
export type AttributesByType<TSchemaUID extends UID.Schema, TKind extends Attribute.Kind, TCondition = never> = Object.PickBy<Attributes<TSchemaUID>, Attribute.OfType<TKind> & Guard.Never<TCondition>>;
|
|
63
|
+
export type AttributeNamesByType<TSchemaUID extends UID.Schema, TKind extends Attribute.Kind, TCondition = never> = Object.KeysBy<Attributes<TSchemaUID>, Attribute.OfType<TKind> & Guard.Never<TCondition, unknown>, AttributeNames<TSchemaUID>>;
|
|
64
|
+
export type NonPopulatableAttributeNames<TSchemaUID extends UID.Schema> = AttributeNamesByType<TSchemaUID, Attribute.NonPopulatableKind>;
|
|
65
|
+
export type PopulatableAttributeNames<TSchemaUID extends UID.Schema> = AttributeNamesByType<TSchemaUID, Attribute.PopulatableKind>;
|
|
66
|
+
export type AttributeNamesWithTarget<TSchemaUID extends UID.Schema> = Extract<Object.Values<{
|
|
67
|
+
[TKey in AttributeNames<TSchemaUID>]: If<Attribute.HasTarget<AttributeByName<TSchemaUID, TKey>>, TKey>;
|
|
68
|
+
}>, AttributeNames<TSchemaUID>>;
|
|
69
|
+
export type RequiredAttributeNames<TSchemaUID extends UID.Schema> = Object.KeysBy<Attributes<TSchemaUID>, Attribute.Required, AttributeNames<TSchemaUID>>;
|
|
70
|
+
export type OptionalAttributeNames<TSchemaUID extends UID.Schema> = Object.KeysExcept<Attributes<TSchemaUID>, Attribute.Required, AttributeNames<TSchemaUID>>;
|
|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|
1
|
+
import type { Schema } from './schema';
|
|
2
|
+
/**
|
|
3
|
+
* Represents a generic Schema before being loaded by Strapi (e.g. app or user defined schemas)
|
|
4
|
+
*
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
export type SchemaDefinition = Omit<Schema, 'uid' | 'attributes'> & {
|
|
8
|
+
attributes: Record<string, Record<string, unknown>>;
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=schema-definition.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-definition.d.ts","sourceRoot":"","sources":["../../src/struct/schema-definition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEvC;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GAAG,IAAI,CAAC,MAAM,EAAE,KAAK,GAAG,YAAY,CAAC,GAAG;IAClE,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CACrD,CAAC"}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import type { Attribute
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
*/
|
|
5
|
-
export type ContentTypeKind = 'singleType' | 'collectionType';
|
|
6
|
-
/**
|
|
7
|
-
* Literal union type representing the possible types of a model
|
|
8
|
-
*/
|
|
1
|
+
import type { Attribute } from '../schema';
|
|
2
|
+
import type * as UID from '../uid';
|
|
3
|
+
export type ContentTypeKind = 'collectionType' | 'singleType';
|
|
9
4
|
export type ModelType = 'contentType' | 'component';
|
|
5
|
+
export type Schema = ContentTypeSchema | ComponentSchema;
|
|
10
6
|
/**
|
|
11
|
-
*
|
|
7
|
+
* Represents a Strapi Schema once loaded by the server
|
|
12
8
|
*/
|
|
13
|
-
export interface
|
|
9
|
+
export interface BaseSchema {
|
|
10
|
+
/**
|
|
11
|
+
* The unique identifier of the Schema
|
|
12
|
+
*/
|
|
13
|
+
uid: UID.Schema;
|
|
14
14
|
/**
|
|
15
15
|
* The type of the model. Useful to discriminate content-types from component
|
|
16
16
|
*/
|
|
@@ -23,18 +23,14 @@ export interface Schema {
|
|
|
23
23
|
* Unique identifier of the schema
|
|
24
24
|
*/
|
|
25
25
|
globalId: string;
|
|
26
|
-
/**
|
|
27
|
-
* Map of all the attributes with their name and definition
|
|
28
|
-
*/
|
|
29
|
-
attributes: Attributes;
|
|
30
26
|
/**
|
|
31
27
|
* Options declared and read by the plugins
|
|
32
28
|
*/
|
|
33
|
-
pluginOptions?:
|
|
29
|
+
pluginOptions?: SchemaPluginOptions;
|
|
34
30
|
/**
|
|
35
31
|
* Options object dedicated to Strapi core features
|
|
36
32
|
*/
|
|
37
|
-
options?:
|
|
33
|
+
options?: SchemaOptions;
|
|
38
34
|
/**
|
|
39
35
|
* Custom table name for the schema
|
|
40
36
|
*/
|
|
@@ -42,12 +38,20 @@ export interface Schema {
|
|
|
42
38
|
/**
|
|
43
39
|
* Information about schema naming and display
|
|
44
40
|
*/
|
|
45
|
-
info:
|
|
41
|
+
info: SchemaInfo;
|
|
42
|
+
/**
|
|
43
|
+
* A collection of attributes for a given Schema.
|
|
44
|
+
*
|
|
45
|
+
* It is stored as a record, where each attribute is associated with a unique string key.
|
|
46
|
+
*
|
|
47
|
+
* The values should be instances of {@link Attribute.AnyAttribute}.
|
|
48
|
+
*/
|
|
49
|
+
attributes: SchemaAttributes;
|
|
46
50
|
}
|
|
47
51
|
/**
|
|
48
52
|
* Data structure containing naming and display information for a Schema
|
|
49
53
|
*/
|
|
50
|
-
export interface
|
|
54
|
+
export interface SchemaInfo {
|
|
51
55
|
/**
|
|
52
56
|
* Default name to use in the admin panel
|
|
53
57
|
*/
|
|
@@ -61,16 +65,11 @@ export interface Info {
|
|
|
61
65
|
*/
|
|
62
66
|
icon?: string;
|
|
63
67
|
}
|
|
64
|
-
|
|
65
|
-
* Low level data structure referencing every schema attribute and its name
|
|
66
|
-
*/
|
|
67
|
-
export interface Attributes {
|
|
68
|
-
[key: string]: Attribute.Any;
|
|
69
|
-
}
|
|
68
|
+
export type SchemaAttributes = Record<string, Attribute.AnyAttribute>;
|
|
70
69
|
/**
|
|
71
70
|
* Structure containing every core schema options and their associated value
|
|
72
71
|
*/
|
|
73
|
-
export interface
|
|
72
|
+
export interface SchemaOptions {
|
|
74
73
|
/**
|
|
75
74
|
* EE only.
|
|
76
75
|
*/
|
|
@@ -80,17 +79,21 @@ export interface Options {
|
|
|
80
79
|
version?: string;
|
|
81
80
|
draftAndPublish?: boolean;
|
|
82
81
|
}
|
|
83
|
-
|
|
82
|
+
/**
|
|
83
|
+
* Plugins' options for a Schema
|
|
84
|
+
*/
|
|
85
|
+
export interface SchemaPluginOptions {
|
|
86
|
+
[key: string]: unknown;
|
|
84
87
|
}
|
|
85
88
|
/**
|
|
86
89
|
* Schema for a content type
|
|
87
90
|
*/
|
|
88
|
-
export interface
|
|
91
|
+
export interface ContentTypeSchema extends BaseSchema {
|
|
89
92
|
modelType: 'contentType';
|
|
90
93
|
/**
|
|
91
94
|
* Unique identifier of the schema
|
|
92
95
|
*/
|
|
93
|
-
uid:
|
|
96
|
+
uid: UID.ContentType;
|
|
94
97
|
/**
|
|
95
98
|
* Determine the type of the content type (single-type or collection-type)
|
|
96
99
|
*/
|
|
@@ -98,9 +101,17 @@ export interface ContentType extends Schema {
|
|
|
98
101
|
/**
|
|
99
102
|
* Information about schema naming and display
|
|
100
103
|
*/
|
|
101
|
-
info:
|
|
104
|
+
info: ContentTypeSchemaInfo;
|
|
105
|
+
/**
|
|
106
|
+
* Indexes to be created on the database
|
|
107
|
+
* @internal
|
|
108
|
+
*/
|
|
109
|
+
indexes?: unknown[];
|
|
102
110
|
}
|
|
103
|
-
|
|
111
|
+
/**
|
|
112
|
+
* Represents information about a content type schema.
|
|
113
|
+
*/
|
|
114
|
+
export interface ContentTypeSchemaInfo extends SchemaInfo {
|
|
104
115
|
/**
|
|
105
116
|
* Singular form of the content type name
|
|
106
117
|
*/
|
|
@@ -113,22 +124,21 @@ export interface ContentTypeInfo extends Info {
|
|
|
113
124
|
/**
|
|
114
125
|
* Schema for a collection type
|
|
115
126
|
*/
|
|
116
|
-
export interface
|
|
127
|
+
export interface CollectionTypeSchema extends ContentTypeSchema {
|
|
117
128
|
kind: 'collectionType';
|
|
118
129
|
}
|
|
119
130
|
/**
|
|
120
131
|
* Schema for a single type
|
|
121
132
|
*/
|
|
122
|
-
export interface
|
|
133
|
+
export interface SingleTypeSchema extends ContentTypeSchema {
|
|
123
134
|
kind: 'singleType';
|
|
124
135
|
}
|
|
125
136
|
/**
|
|
126
137
|
* Schema for a component
|
|
127
138
|
*/
|
|
128
|
-
export interface
|
|
139
|
+
export interface ComponentSchema extends BaseSchema {
|
|
129
140
|
modelType: 'component';
|
|
130
|
-
uid:
|
|
141
|
+
uid: UID.Component;
|
|
131
142
|
category: string;
|
|
132
143
|
}
|
|
133
|
-
|
|
134
|
-
//# sourceMappingURL=index.d.ts.map
|
|
144
|
+
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/struct/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,KAAK,KAAK,GAAG,MAAM,QAAQ,CAAC;AAEnC,MAAM,MAAM,eAAe,GAAG,gBAAgB,GAAG,YAAY,CAAC;AAE9D,MAAM,MAAM,SAAS,GAAG,aAAa,GAAG,WAAW,CAAC;AAEpD,MAAM,MAAM,MAAM,GAAG,iBAAiB,GAAG,eAAe,CAAC;AAEzD;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB;;OAEG;IACH,GAAG,EAAE,GAAG,CAAC,MAAM,CAAC;IAEhB;;OAEG;IACH,SAAS,EAAE,SAAS,CAAC;IAErB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,QAAQ,EAAE,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CAAC;IAErB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,oBAAqB,SAAQ,iBAAiB;IAC7D,IAAI,EAAE,gBAAgB,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAiB,SAAQ,iBAAiB;IACzD,IAAI,EAAE,YAAY,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,eAAgB,SAAQ,UAAU;IACjD,SAAS,EAAE,WAAW,CAAC;IAEvB,GAAG,EAAE,GAAG,CAAC,SAAS,CAAC;IAEnB,QAAQ,EAAE,MAAM,CAAC;CAClB"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type * as Internal from '../internal';
|
|
2
|
+
import type * as Struct from '../struct';
|
|
3
|
+
import type { Constants, Guard, Object, Extends, Or } from '../utils';
|
|
4
|
+
import type * as Public from '../public';
|
|
5
|
+
/**
|
|
6
|
+
* Schemas' UIDs based on the public schema registries.
|
|
7
|
+
*
|
|
8
|
+
* It includes both ContentTypeSchemas and ComponentSchemas
|
|
9
|
+
*/
|
|
10
|
+
export type Schema = ContentType | Component;
|
|
11
|
+
/**
|
|
12
|
+
* Content-Types' UIDs based on the public content-type registry.
|
|
13
|
+
*/
|
|
14
|
+
export type ContentType = Internal.Registry.Keys<Public.ContentTypeSchemas, Internal.UID.ContentType>;
|
|
15
|
+
/**
|
|
16
|
+
* Components' UIDs based on the public component registry.
|
|
17
|
+
*/
|
|
18
|
+
export type Component = Internal.Registry.Keys<Public.ComponentSchemas, Internal.UID.Component>;
|
|
19
|
+
/**
|
|
20
|
+
* Union of every components' category, based on the public component registry
|
|
21
|
+
*/
|
|
22
|
+
export type ComponentCategory = Component extends Internal.UID.Component<infer TCategory> ? TCategory : never;
|
|
23
|
+
/**
|
|
24
|
+
* Collection-Types' UIDs based on the public content-type registry.
|
|
25
|
+
*
|
|
26
|
+
* If no collection type is found, fallback to a generic content-type UID.
|
|
27
|
+
*/
|
|
28
|
+
export type CollectionType = Guard.Never<Extract<Object.KeysBy<Public.ContentTypeSchemas, Struct.CollectionTypeSchema>, ContentType>, Internal.UID.ContentType>;
|
|
29
|
+
/**
|
|
30
|
+
* Single-Type's UIDs based on the public content-type registry
|
|
31
|
+
*
|
|
32
|
+
* If no collection type is found, fallback to a generic content-type UID.
|
|
33
|
+
*/
|
|
34
|
+
export type SingleType = Guard.Never<Extract<Object.KeysBy<Public.ContentTypeSchemas, Struct.SingleTypeSchema>, ContentType>, Internal.UID.ContentType>;
|
|
35
|
+
export type Service = Internal.Registry.Keys<Public.Services, Internal.UID.Service>;
|
|
36
|
+
export type Controller = Internal.Registry.Keys<Public.Controllers, Internal.UID.Controller>;
|
|
37
|
+
export type Policy = Internal.Registry.Keys<Public.Policies, Internal.UID.Policy>;
|
|
38
|
+
export type Middleware = Internal.Registry.Keys<Public.Middlewares, Internal.UID.Middleware>;
|
|
39
|
+
export type IsCollectionType<TSchemaUID extends Schema> = TSchemaUID extends CollectionType ? Extends<Public.ContentTypeSchemas[TSchemaUID], Struct.CollectionTypeSchema> : Constants.False;
|
|
40
|
+
export type IsSingleType<TSchemaUID extends Schema> = TSchemaUID extends SingleType ? Extends<Public.ContentTypeSchemas[TSchemaUID], Struct.SingleTypeSchema> : Constants.False;
|
|
41
|
+
export type IsComponent<TSchemaUID extends Schema> = TSchemaUID extends Component ? Extends<Public.ComponentSchemas[TSchemaUID], Struct.ComponentSchema> : Constants.False;
|
|
42
|
+
export type IsContentType<TSchemaUID extends Schema> = TSchemaUID extends ContentType ? Or<IsCollectionType<TSchemaUID>, IsSingleType<TSchemaUID>> : Constants.False;
|
|
43
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/uid/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,QAAQ,MAAM,aAAa,CAAC;AAC7C,OAAO,KAAK,KAAK,MAAM,MAAM,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80 @@
|
|
|
1
|
+
import type { Extends, Not } from '.';
|
|
2
|
+
/**
|
|
3
|
+
* The `Values` type extracts the type of the values stored in arrays or tuples.
|
|
4
|
+
*
|
|
5
|
+
* @returns A union of every value contained in the array/tuple
|
|
6
|
+
*
|
|
7
|
+
* @template TCollection - The array-like structure from which the values' type will be extracted.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* Let's suppose we have an array of numbers, and we would like to extract the type its values
|
|
11
|
+
*
|
|
12
|
+
* ```typescript
|
|
13
|
+
* type MyTuple = [1, 2, 3, 4];
|
|
14
|
+
*
|
|
15
|
+
* type TupleValues = Values<MyTuple>; // TupleValues: 1 | 2 | 3 | 4
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* Now, let's suppose we have a regular TypeScript array, and we would like to extract its value
|
|
20
|
+
*
|
|
21
|
+
* ```typescript
|
|
22
|
+
* type MyArray = (string | number)[];
|
|
23
|
+
*
|
|
24
|
+
* type ArrayValues = Values<MyArray>; // ArrayValues: string | number
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export type Values<TCollection extends Array<unknown>> = TCollection extends Array<infer TValues> ? TValues : never;
|
|
28
|
+
/**
|
|
29
|
+
* Checks if a given array ({@link TCollection}) is empty.
|
|
30
|
+
*
|
|
31
|
+
* @template TCollection - The array to be checked. It should extend 'Array<unknown>'.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* Validate an array that is empty:
|
|
35
|
+
* ```typescript
|
|
36
|
+
* type EmptyArray = [];
|
|
37
|
+
*
|
|
38
|
+
* type IsEmptyCheck = IsEmpty<EmptyArray>;
|
|
39
|
+
* // Result: Constants.True
|
|
40
|
+
* ```
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* Validate an array that is not empty:
|
|
44
|
+
* ```typescript
|
|
45
|
+
* type NonEmptyArray = [1, 2, 3];
|
|
46
|
+
*
|
|
47
|
+
* type IsEmptyCheck = IsEmpty<NonEmptyArray>;
|
|
48
|
+
* // Result: Constants.False
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
export type IsEmpty<TCollection extends Array<unknown>> = Extends<TCollection['length'], 0>;
|
|
52
|
+
/**
|
|
53
|
+
* Checks if a given array ({@link TCollection}) is not empty.
|
|
54
|
+
*
|
|
55
|
+
* @template TCollection - The collection (array) that needs to be checked if it's not empty. It must extend 'Array<unknown>'.
|
|
56
|
+
*
|
|
57
|
+
* @see {@link Not}
|
|
58
|
+
* @see {@link IsEmpty}
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* Checking non-empty array:
|
|
62
|
+
* ```typescript
|
|
63
|
+
* type NonEmptyArray = [1, 2, 3];
|
|
64
|
+
*
|
|
65
|
+
* // This type checks will result to True because
|
|
66
|
+
* // 'NonEmptyArray' is indeed not empty.
|
|
67
|
+
* type IsNotEmptyCheck = IsNotEmpty<NonEmptyArray>;
|
|
68
|
+
* ```
|
|
69
|
+
*
|
|
70
|
+
* @example
|
|
71
|
+
* Checking empty array:
|
|
72
|
+
* ```typescript
|
|
73
|
+
* type EmptyArray = [];
|
|
74
|
+
*
|
|
75
|
+
* // This type checks will result to False because 'EmptyArray' is empty.
|
|
76
|
+
* type IsNotEmptyCheck = IsNotEmpty<EmptyArray>;
|
|
77
|
+
* ```
|
|
78
|
+
*/
|
|
79
|
+
export type IsNotEmpty<TCollection extends Array<unknown>> = Not<IsEmpty<TCollection>>;
|
|
80
|
+
//# sourceMappingURL=array.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"array.d.ts","sourceRoot":"","sources":["../../src/utils/array.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,GAAG,CAAC;AAEtC;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,MAAM,MAAM,CAAC,WAAW,SAAS,KAAK,CAAC,OAAO,CAAC,IAAI,WAAW,SAAS,KAAK,CAAC,MAAM,OAAO,CAAC,GAC7F,OAAO,GACP,KAAK,CAAC;AAEV;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,MAAM,OAAO,CAAC,WAAW,SAAS,KAAK,CAAC,OAAO,CAAC,IAAI,OAAO,CAAC,WAAW,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC;AAE5F;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,MAAM,UAAU,CAAC,WAAW,SAAS,KAAK,CAAC,OAAO,CAAC,IAAI,GAAG,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type * as Internal from '../internal';
|
|
2
|
+
import type * as UID from '../uid';
|
|
3
|
+
import type { NotStrictEqual, Or } from '.';
|
|
4
|
+
export type True = true;
|
|
5
|
+
export type False = false;
|
|
6
|
+
export type BooleanValue = True | False;
|
|
7
|
+
/**
|
|
8
|
+
* Determine if there's been an extension or change in either Component Registry or Content-Type Registry.
|
|
9
|
+
*
|
|
10
|
+
* It applies the compound boolean OR operation on the results derived from {@link IsComponentRegistryExtended} and {@link IsContentTypeRegistryExtended}.
|
|
11
|
+
*
|
|
12
|
+
* If either or both results are true (indicating a change or extension in the corresponding registry), it returns {@link True}; otherwise, it returns {@link False}.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```typescript
|
|
16
|
+
* // A change or extension in both the Component Registry and the Content-Type Registry
|
|
17
|
+
* type Example1 = AreSchemaRegistriesExtended; // Result: Constants.True
|
|
18
|
+
*
|
|
19
|
+
* // A change or extension only in the Component Registry
|
|
20
|
+
* type Example2 = IsComponentRegistryExtended; // Result: Constants.True
|
|
21
|
+
*
|
|
22
|
+
* // A change or extension only in the Content-Type Registry
|
|
23
|
+
* type Example3 = IsContentTypeRegistryExtended; // Result: Constants.True
|
|
24
|
+
|
|
25
|
+
* // No change or extension in either registries
|
|
26
|
+
* type Example4 = AreSchemaRegistriesExtended; // Result: Constants.False
|
|
27
|
+
* ```
|
|
28
|
+
*
|
|
29
|
+
* @see IsComponentRegistryExtended
|
|
30
|
+
* @see IsContentTypeRegistryExtended
|
|
31
|
+
*/
|
|
32
|
+
export type AreSchemaRegistriesExtended = Or<IsComponentRegistryExtended, IsContentTypeRegistryExtended>;
|
|
33
|
+
/**
|
|
34
|
+
* Evaluate if the internal UIDs ({@link Internal.UID.ContentType}) and public ones ({@link UID.ContentType}) are not identical.
|
|
35
|
+
*
|
|
36
|
+
* If these two types are not the same, it indicates an extension or change has occurred in the public Content-Type Registry.
|
|
37
|
+
*
|
|
38
|
+
* The type leverages {@link NotStrictEqual} to perform this comparison accurately. The result is a type-level
|
|
39
|
+
* boolean that denotes whether there is a deviation between the two Content-Type representations.
|
|
40
|
+
*
|
|
41
|
+
* @returns Either [Constants.True](@link Constants.True) if the Content-Type Registry has been extended, else [Constants.False](@link Constants.False).
|
|
42
|
+
*
|
|
43
|
+
* @remark
|
|
44
|
+
* This type is particularly useful when there is a need to verify whether there have been extensions or changes to the Content-Type Registry
|
|
45
|
+
* after initially creating it.
|
|
46
|
+
*
|
|
47
|
+
* It allows developers to perform this check at the type level and decide what type should be resolved depending on the context
|
|
48
|
+
*/
|
|
49
|
+
export type IsContentTypeRegistryExtended = NotStrictEqual<Internal.UID.ContentType, UID.ContentType>;
|
|
50
|
+
/**
|
|
51
|
+
* Evaluate if the internal UIDs ({@link Internal.UID.Component}) and public ones ({@link UID.Component}) are not identical.
|
|
52
|
+
*
|
|
53
|
+
* If these two types are not the same, it indicates an extension or change has occurred in the public Component Registry.
|
|
54
|
+
*
|
|
55
|
+
* The type leverages {@link NotStrictEqual} to perform this comparison accurately. The result is a type-level
|
|
56
|
+
* boolean that denotes whether there is a deviation between the two Content-Type representations.
|
|
57
|
+
*
|
|
58
|
+
* @return - Either {@link True} if the Component Registry has been extended, else {@link False}.
|
|
59
|
+
*
|
|
60
|
+
* @remark
|
|
61
|
+
* This type is particularly useful when there is a need to verify whether there have been extensions or changes to the Component Registry
|
|
62
|
+
* after initially creating it.
|
|
63
|
+
*
|
|
64
|
+
* It allows developers to perform this check at the type level and decide what type should be resolved depending on the context
|
|
65
|
+
*/
|
|
66
|
+
export type IsComponentRegistryExtended = NotStrictEqual<Internal.UID.Component, UID.Component>;
|
|
67
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/utils/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,QAAQ,MAAM,aAAa,CAAC;AAC7C,OAAO,KAAK,KAAK,GAAG,MAAM,QAAQ,CAAC;AAEnC,OAAO,KAAK,EAAE,cAAc,EAAE,EAAE,EAAE,MAAM,GAAG,CAAC;AAE5C,MAAM,MAAM,IAAI,GAAG,IAAI,CAAC;AAExB,MAAM,MAAM,KAAK,GAAG,KAAK,CAAC;AAE1B,MAAM,MAAM,YAAY,GAAG,IAAI,GAAG,KAAK,CAAC;AAExC;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,MAAM,2BAA2B,GAAG,EAAE,CAC1C,2BAA2B,EAC3B,6BAA6B,CAC9B,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,6BAA6B,GAAG,cAAc,CACxD,QAAQ,CAAC,GAAG,CAAC,WAAW,EACxB,GAAG,CAAC,WAAW,CAChB,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,2BAA2B,GAAG,cAAc,CAAC,QAAQ,CAAC,GAAG,CAAC,SAAS,EAAE,GAAG,CAAC,SAAS,CAAC,CAAC"}
|