@strapi/core 5.48.1 → 5.50.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Strapi.d.ts.map +1 -1
- package/dist/Strapi.js +11 -5
- package/dist/Strapi.js.map +1 -1
- package/dist/Strapi.mjs +2 -1
- package/dist/Strapi.mjs.map +1 -1
- package/dist/ai.d.ts +2 -0
- package/dist/ai.d.ts.map +1 -0
- package/dist/ai.js +8 -0
- package/dist/ai.js.map +1 -0
- package/dist/ai.mjs +3 -0
- package/dist/ai.mjs.map +1 -0
- package/dist/configuration/config-loader.d.ts.map +1 -1
- package/dist/configuration/config-loader.js +11 -6
- package/dist/configuration/config-loader.js.map +1 -1
- package/dist/configuration/get-dirs.d.ts.map +1 -1
- package/dist/configuration/index.d.ts +0 -3
- package/dist/configuration/index.d.ts.map +1 -1
- package/dist/configuration/index.js +22 -18
- package/dist/configuration/index.js.map +1 -1
- package/dist/configuration/index.mjs +0 -3
- package/dist/configuration/index.mjs.map +1 -1
- package/dist/configuration/server-config.d.ts +11 -0
- package/dist/configuration/server-config.d.ts.map +1 -0
- package/dist/configuration/server-config.js +16 -0
- package/dist/configuration/server-config.js.map +1 -0
- package/dist/configuration/server-config.mjs +14 -0
- package/dist/configuration/server-config.mjs.map +1 -0
- package/dist/configuration/urls.d.ts.map +1 -1
- package/dist/configuration/urls.js +11 -7
- package/dist/configuration/urls.js.map +1 -1
- package/dist/core-api/controller/collection-type.d.ts.map +1 -1
- package/dist/core-api/controller/single-type.d.ts.map +1 -1
- package/dist/core-api/controller/transform.d.ts.map +1 -1
- package/dist/core-api/routes/index.d.ts.map +1 -1
- package/dist/core-api/routes/index.js +3 -2
- package/dist/core-api/routes/index.js.map +1 -1
- package/dist/core-api/routes/validation/attributes.d.ts.map +1 -1
- package/dist/core-api/routes/validation/common.js +3 -2
- package/dist/core-api/routes/validation/common.js.map +1 -1
- package/dist/core-api/routes/validation/content-type.js +3 -2
- package/dist/core-api/routes/validation/content-type.js.map +1 -1
- package/dist/core-api/routes/validation/mappers.d.ts.map +1 -1
- package/dist/core-api/routes/validation/mappers.js +3 -2
- package/dist/core-api/routes/validation/mappers.js.map +1 -1
- package/dist/core-api/routes/validation/utils.d.ts.map +1 -1
- package/dist/core-api/routes/validation/utils.js +3 -2
- package/dist/core-api/routes/validation/utils.js.map +1 -1
- package/dist/core-api/service/collection-type.d.ts.map +1 -1
- package/dist/core-api/service/pagination.d.ts.map +1 -1
- package/dist/core-api/service/single-type.d.ts.map +1 -1
- package/dist/domain/content-type/index.d.ts.map +1 -1
- package/dist/domain/content-type/index.js +9 -5
- package/dist/domain/content-type/index.js.map +1 -1
- package/dist/domain/content-type/validator.d.ts.map +1 -1
- package/dist/domain/content-type/validator.js +6 -2
- package/dist/domain/content-type/validator.js.map +1 -1
- package/dist/domain/module/index.d.ts.map +1 -1
- package/dist/domain/module/index.js +6 -2
- package/dist/domain/module/index.js.map +1 -1
- package/dist/domain/module/validation.d.ts.map +1 -1
- package/dist/ee/index.d.ts +2 -1
- package/dist/ee/index.d.ts.map +1 -1
- package/dist/ee/license.d.ts.map +1 -1
- package/dist/ee/license.js +8 -3
- package/dist/ee/license.js.map +1 -1
- package/dist/factories.d.ts.map +1 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -0
- package/dist/index.mjs.map +1 -1
- package/dist/loaders/admin.js +5 -1
- package/dist/loaders/admin.js.map +1 -1
- package/dist/loaders/apis.js +16 -11
- package/dist/loaders/apis.js.map +1 -1
- package/dist/loaders/components.js +6 -2
- package/dist/loaders/components.js.map +1 -1
- package/dist/loaders/middlewares.js +6 -2
- package/dist/loaders/middlewares.js.map +1 -1
- package/dist/loaders/plugins/get-enabled-plugins.d.ts.map +1 -1
- package/dist/loaders/plugins/get-enabled-plugins.js +5 -1
- package/dist/loaders/plugins/get-enabled-plugins.js.map +1 -1
- package/dist/loaders/plugins/get-user-plugins-config.js +6 -2
- package/dist/loaders/plugins/get-user-plugins-config.js.map +1 -1
- package/dist/loaders/plugins/index.js +8 -4
- package/dist/loaders/plugins/index.js.map +1 -1
- package/dist/loaders/policies.js +6 -2
- package/dist/loaders/policies.js.map +1 -1
- package/dist/loaders/sanitizers.d.ts.map +1 -1
- package/dist/loaders/src-index.d.ts.map +1 -1
- package/dist/loaders/validators.d.ts.map +1 -1
- package/dist/mcp.d.ts +4 -0
- package/dist/mcp.d.ts.map +1 -0
- package/dist/mcp.js +12 -0
- package/dist/mcp.js.map +1 -0
- package/dist/mcp.mjs +4 -0
- package/dist/mcp.mjs.map +1 -0
- package/dist/middlewares/body.d.ts.map +1 -1
- package/dist/middlewares/body.js +9 -4
- package/dist/middlewares/body.js.map +1 -1
- package/dist/middlewares/body.mjs +1 -1
- package/dist/middlewares/body.mjs.map +1 -1
- package/dist/middlewares/compression.js +5 -1
- package/dist/middlewares/compression.js.map +1 -1
- package/dist/middlewares/cors.d.ts.map +1 -1
- package/dist/middlewares/cors.js +5 -1
- package/dist/middlewares/cors.js.map +1 -1
- package/dist/middlewares/errors.d.ts +5 -0
- 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 +0 -1
- package/dist/middlewares/favicon.d.ts.map +1 -1
- package/dist/middlewares/favicon.js +5 -1
- package/dist/middlewares/favicon.js.map +1 -1
- package/dist/middlewares/ip.js +5 -1
- package/dist/middlewares/ip.js.map +1 -1
- package/dist/middlewares/public.js +5 -1
- package/dist/middlewares/public.js.map +1 -1
- package/dist/middlewares/query.js +6 -2
- package/dist/middlewares/query.js.map +1 -1
- package/dist/middlewares/security.js +5 -1
- package/dist/middlewares/security.js.map +1 -1
- package/dist/migrations/database/5.0.0-discard-drafts.js +5 -1
- package/dist/migrations/database/5.0.0-discard-drafts.js.map +1 -1
- package/dist/migrations/draft-publish.d.ts.map +1 -1
- package/dist/migrations/first-published-at.d.ts.map +1 -1
- package/dist/migrations/first-published-at.js +5 -1
- package/dist/migrations/first-published-at.js.map +1 -1
- package/dist/migrations/i18n.d.ts.map +1 -1
- package/dist/migrations/index.d.ts.map +1 -1
- package/dist/package.json.js +18 -21
- package/dist/package.json.js.map +1 -1
- package/dist/package.json.mjs +18 -21
- package/dist/package.json.mjs.map +1 -1
- package/dist/providers/provider.d.ts.map +1 -1
- package/dist/registries/apis.d.ts.map +1 -1
- package/dist/registries/components.d.ts +1 -1
- package/dist/registries/components.d.ts.map +1 -1
- package/dist/registries/content-types.d.ts +2 -3
- package/dist/registries/content-types.d.ts.map +1 -1
- package/dist/registries/controllers.d.ts +3 -3
- package/dist/registries/controllers.d.ts.map +1 -1
- package/dist/registries/custom-fields.d.ts.map +1 -1
- package/dist/registries/hooks.d.ts +3 -4
- package/dist/registries/hooks.d.ts.map +1 -1
- package/dist/registries/middlewares.d.ts +2 -3
- package/dist/registries/middlewares.d.ts.map +1 -1
- package/dist/registries/models.d.ts +1 -1
- package/dist/registries/modules.d.ts.map +1 -1
- package/dist/registries/namespace.d.ts.map +1 -1
- package/dist/registries/plugins.d.ts.map +1 -1
- package/dist/registries/policies.d.ts +1 -2
- package/dist/registries/policies.d.ts.map +1 -1
- package/dist/registries/sanitizers.d.ts +2 -2
- package/dist/registries/sanitizers.js +7 -3
- package/dist/registries/sanitizers.js.map +1 -1
- package/dist/registries/services.d.ts +3 -3
- package/dist/registries/services.d.ts.map +1 -1
- package/dist/registries/validators.d.ts +2 -2
- package/dist/registries/validators.js +7 -3
- package/dist/registries/validators.js.map +1 -1
- package/dist/services/ai.d.ts.map +1 -1
- package/dist/services/auth/index.js +7 -3
- package/dist/services/auth/index.js.map +1 -1
- package/dist/services/config.d.ts.map +1 -1
- package/dist/services/content-api/index.d.ts +4 -4
- package/dist/services/content-api/index.d.ts.map +1 -1
- package/dist/services/content-api/index.js +10 -6
- package/dist/services/content-api/index.js.map +1 -1
- package/dist/services/content-api/permissions/engine.d.ts.map +1 -1
- package/dist/services/content-api/permissions/engine.js +5 -1
- package/dist/services/content-api/permissions/engine.js.map +1 -1
- package/dist/services/content-api/permissions/index.d.ts +2 -2
- package/dist/services/content-api/permissions/index.d.ts.map +1 -1
- package/dist/services/content-api/permissions/index.js +10 -6
- package/dist/services/content-api/permissions/index.js.map +1 -1
- package/dist/services/content-api/permissions/providers/action.d.ts +1 -1
- package/dist/services/content-api/permissions/providers/action.d.ts.map +1 -1
- package/dist/services/content-api/permissions/providers/condition.d.ts +1 -1
- package/dist/services/content-api/permissions/providers/condition.d.ts.map +1 -1
- package/dist/services/content-source-maps.d.ts.map +1 -1
- package/dist/services/core-store.d.ts.map +1 -1
- package/dist/services/cron.d.ts +5 -5
- package/dist/services/custom-fields.d.ts.map +1 -1
- package/dist/services/document-service/attributes/index.d.ts +0 -1
- package/dist/services/document-service/attributes/index.d.ts.map +1 -1
- package/dist/services/document-service/attributes/transforms.js +5 -1
- package/dist/services/document-service/attributes/transforms.js.map +1 -1
- package/dist/services/document-service/common.d.ts.map +1 -1
- package/dist/services/document-service/components.d.ts +2 -2
- package/dist/services/document-service/components.d.ts.map +1 -1
- package/dist/services/document-service/components.js +14 -10
- package/dist/services/document-service/components.js.map +1 -1
- package/dist/services/document-service/components.mjs.map +1 -1
- package/dist/services/document-service/draft-and-publish.d.ts +0 -1
- package/dist/services/document-service/draft-and-publish.d.ts.map +1 -1
- package/dist/services/document-service/draft-and-publish.js +1 -1
- package/dist/services/document-service/draft-and-publish.js.map +1 -1
- package/dist/services/document-service/draft-and-publish.mjs +1 -1
- package/dist/services/document-service/draft-and-publish.mjs.map +1 -1
- package/dist/services/document-service/entries.d.ts.map +1 -1
- package/dist/services/document-service/entries.js +6 -2
- package/dist/services/document-service/entries.js.map +1 -1
- package/dist/services/document-service/entries.mjs +7 -3
- package/dist/services/document-service/entries.mjs.map +1 -1
- package/dist/services/document-service/events.d.ts.map +1 -1
- package/dist/services/document-service/first-published-at.d.ts.map +1 -1
- package/dist/services/document-service/index.d.ts.map +1 -1
- package/dist/services/document-service/internationalization.d.ts +0 -1
- 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/middleware-manager.d.ts.map +1 -1
- package/dist/services/document-service/params.d.ts +1 -1
- package/dist/services/document-service/params.d.ts.map +1 -1
- package/dist/services/document-service/publication-filter.d.ts +1 -1
- package/dist/services/document-service/publication-filter.d.ts.map +1 -1
- package/dist/services/document-service/transform/data.d.ts +2 -0
- package/dist/services/document-service/transform/data.d.ts.map +1 -1
- package/dist/services/document-service/transform/data.js +7 -1
- package/dist/services/document-service/transform/data.js.map +1 -1
- package/dist/services/document-service/transform/data.mjs +7 -2
- package/dist/services/document-service/transform/data.mjs.map +1 -1
- package/dist/services/document-service/transform/fields.d.ts.map +1 -1
- package/dist/services/document-service/transform/id-map.d.ts.map +1 -1
- package/dist/services/document-service/transform/id-map.js +7 -4
- package/dist/services/document-service/transform/id-map.js.map +1 -1
- package/dist/services/document-service/transform/id-map.mjs +7 -4
- package/dist/services/document-service/transform/id-map.mjs.map +1 -1
- package/dist/services/document-service/transform/id-transform.d.ts +0 -1
- package/dist/services/document-service/transform/id-transform.d.ts.map +1 -1
- package/dist/services/document-service/transform/populate.d.ts.map +1 -1
- package/dist/services/document-service/transform/query.d.ts +0 -1
- package/dist/services/document-service/transform/query.d.ts.map +1 -1
- package/dist/services/document-service/transform/relations/extract/data-ids.d.ts.map +1 -1
- package/dist/services/document-service/transform/relations/transform/data-ids.d.ts.map +1 -1
- package/dist/services/document-service/transform/relations/transform/default-locale.d.ts.map +1 -1
- package/dist/services/document-service/transform/relations/utils/data.d.ts.map +1 -1
- package/dist/services/document-service/transform/relations/utils/dp.d.ts +1 -1
- package/dist/services/document-service/transform/relations/utils/dp.d.ts.map +1 -1
- package/dist/services/document-service/transform/relations/utils/i18n.d.ts.map +1 -1
- package/dist/services/document-service/transform/relations/utils/map-relation.d.ts +0 -1
- package/dist/services/document-service/transform/relations/utils/map-relation.d.ts.map +1 -1
- package/dist/services/document-service/transform/relations/utils/xto-one.d.ts.map +1 -1
- package/dist/services/document-service/utils/bidirectional-relations.d.ts.map +1 -1
- package/dist/services/document-service/utils/bidirectional-relations.js +7 -2
- package/dist/services/document-service/utils/bidirectional-relations.js.map +1 -1
- package/dist/services/document-service/utils/bidirectional-relations.mjs +7 -2
- package/dist/services/document-service/utils/bidirectional-relations.mjs.map +1 -1
- package/dist/services/document-service/utils/clean-component-join-table.d.ts.map +1 -1
- package/dist/services/document-service/utils/ordered-parallel.d.ts.map +1 -1
- package/dist/services/document-service/utils/populate.d.ts +1 -1
- package/dist/services/document-service/utils/populate.d.ts.map +1 -1
- package/dist/services/document-service/utils/populate.js.map +1 -1
- package/dist/services/document-service/utils/populate.mjs.map +1 -1
- package/dist/services/document-service/utils/self-referential-relations.d.ts.map +1 -1
- package/dist/services/document-service/utils/unidirectional-relations.d.ts.map +1 -1
- package/dist/services/entity-service/index.d.ts.map +1 -1
- package/dist/services/entity-service/index.js +9 -4
- package/dist/services/entity-service/index.js.map +1 -1
- package/dist/services/entity-validator/index.d.ts.map +1 -1
- package/dist/services/entity-validator/index.js +9 -4
- package/dist/services/entity-validator/index.js.map +1 -1
- package/dist/services/entity-validator/index.mjs.map +1 -1
- package/dist/services/entity-validator/validators.d.ts.map +1 -1
- package/dist/services/entity-validator/validators.js +10 -6
- package/dist/services/entity-validator/validators.js.map +1 -1
- package/dist/services/errors.d.ts.map +1 -1
- package/dist/services/errors.js +7 -3
- package/dist/services/errors.js.map +1 -1
- package/dist/services/features.d.ts.map +1 -1
- package/dist/services/fs.d.ts.map +1 -1
- package/dist/services/fs.js +10 -5
- package/dist/services/fs.js.map +1 -1
- package/dist/services/mcp/authentication.d.ts.map +1 -1
- package/dist/services/mcp/handlers/handlePost.d.ts.map +1 -1
- package/dist/services/mcp/index.d.ts.map +1 -1
- package/dist/services/mcp/internal/McpCapabilityRegistry.d.ts +2 -2
- package/dist/services/mcp/internal/McpServerFactory.d.ts.map +1 -1
- package/dist/services/mcp/internal/syncMcpSessionCapabilities.d.ts.map +1 -1
- package/dist/services/mcp/metrics/metrics.d.ts.map +1 -1
- package/dist/services/mcp/metrics/normalizeMcpCapability.d.ts.map +1 -1
- package/dist/services/mcp/metrics/wrapCapabilityHandlerForMetrics.d.ts.map +1 -1
- package/dist/services/mcp/middleware/oauthDiscoveryFallback.d.ts.map +1 -1
- package/dist/services/mcp/prompt-registry.d.ts +31 -3
- package/dist/services/mcp/prompt-registry.d.ts.map +1 -1
- package/dist/services/mcp/prompt-registry.js +31 -0
- package/dist/services/mcp/prompt-registry.js.map +1 -1
- package/dist/services/mcp/prompt-registry.mjs +31 -1
- package/dist/services/mcp/prompt-registry.mjs.map +1 -1
- package/dist/services/mcp/resource-registry.d.ts +31 -1
- package/dist/services/mcp/resource-registry.d.ts.map +1 -1
- package/dist/services/mcp/resource-registry.js +31 -0
- package/dist/services/mcp/resource-registry.js.map +1 -1
- package/dist/services/mcp/resource-registry.mjs +31 -1
- package/dist/services/mcp/resource-registry.mjs.map +1 -1
- package/dist/services/mcp/routes.d.ts +1 -1
- package/dist/services/mcp/routes.d.ts.map +1 -1
- package/dist/services/mcp/tool-registry.d.ts +36 -9
- package/dist/services/mcp/tool-registry.d.ts.map +1 -1
- package/dist/services/mcp/tool-registry.js +35 -3
- package/dist/services/mcp/tool-registry.js.map +1 -1
- package/dist/services/mcp/tool-registry.mjs +35 -3
- package/dist/services/mcp/tool-registry.mjs.map +1 -1
- package/dist/services/mcp/tools/log.d.ts +15 -85
- package/dist/services/mcp/tools/log.d.ts.map +1 -1
- package/dist/services/mcp/utils/createSafeCapabilityRegistration.d.ts.map +1 -1
- package/dist/services/mcp/utils/safeHandlerWrapper.d.ts.map +1 -1
- package/dist/services/mcp/utils/sendJsonRpcError.d.ts +0 -1
- package/dist/services/mcp/utils/sendJsonRpcError.d.ts.map +1 -1
- package/dist/services/mcp/utils/withTimeout.d.ts.map +1 -1
- package/dist/services/metrics/admin-user-hash.d.ts.map +1 -1
- package/dist/services/metrics/admin-user-hash.js +5 -1
- package/dist/services/metrics/admin-user-hash.js.map +1 -1
- package/dist/services/metrics/index.d.ts.map +1 -1
- package/dist/services/metrics/is-truthy.d.ts.map +1 -1
- package/dist/services/metrics/is-truthy.js +5 -1
- package/dist/services/metrics/is-truthy.js.map +1 -1
- package/dist/services/metrics/middleware.d.ts.map +1 -1
- package/dist/services/metrics/rate-limiter.d.ts +2 -1
- package/dist/services/metrics/rate-limiter.d.ts.map +1 -1
- package/dist/services/metrics/sender.d.ts.map +1 -1
- package/dist/services/metrics/sender.js +17 -9
- package/dist/services/metrics/sender.js.map +1 -1
- package/dist/services/query-params.d.ts.map +1 -1
- package/dist/services/reloader.d.ts.map +1 -1
- package/dist/services/request-context.d.ts.map +1 -1
- package/dist/services/server/admin-api.d.ts +3 -5
- package/dist/services/server/admin-api.d.ts.map +1 -1
- package/dist/services/server/api.d.ts +3 -4
- package/dist/services/server/api.d.ts.map +1 -1
- package/dist/services/server/api.js +5 -1
- package/dist/services/server/api.js.map +1 -1
- package/dist/services/server/compose-endpoint.d.ts.map +1 -1
- package/dist/services/server/compose-endpoint.js +5 -1
- package/dist/services/server/compose-endpoint.js.map +1 -1
- package/dist/services/server/content-api.d.ts +3 -5
- package/dist/services/server/content-api.d.ts.map +1 -1
- package/dist/services/server/http-server.d.ts +0 -1
- package/dist/services/server/http-server.d.ts.map +1 -1
- package/dist/services/server/http-server.js +5 -1
- package/dist/services/server/http-server.js.map +1 -1
- package/dist/services/server/index.d.ts.map +1 -1
- package/dist/services/server/index.js +5 -1
- package/dist/services/server/index.js.map +1 -1
- package/dist/services/server/koa-methods.d.ts +107 -0
- package/dist/services/server/koa-methods.d.ts.map +1 -0
- package/dist/services/server/koa-methods.js +24 -0
- package/dist/services/server/koa-methods.js.map +1 -0
- package/dist/services/server/koa-methods.mjs +22 -0
- package/dist/services/server/koa-methods.mjs.map +1 -0
- package/dist/services/server/koa.d.ts +0 -9
- package/dist/services/server/koa.d.ts.map +1 -1
- package/dist/services/server/koa.js +14 -10
- package/dist/services/server/koa.js.map +1 -1
- package/dist/services/server/koa.mjs +7 -9
- package/dist/services/server/koa.mjs.map +1 -1
- package/dist/services/server/middleware.d.ts.map +1 -1
- package/dist/services/server/middleware.js +5 -1
- package/dist/services/server/middleware.js.map +1 -1
- package/dist/services/server/openapi.d.ts.map +1 -1
- package/dist/services/server/openapi.js +11 -6
- package/dist/services/server/openapi.js.map +1 -1
- package/dist/services/server/policy.d.ts.map +1 -1
- package/dist/services/server/register-middlewares.d.ts.map +1 -1
- package/dist/services/server/register-routes.d.ts.map +1 -1
- package/dist/services/server/register-routes.js +8 -4
- package/dist/services/server/register-routes.js.map +1 -1
- package/dist/services/server/routing.d.ts +0 -2
- package/dist/services/server/routing.d.ts.map +1 -1
- package/dist/services/server/routing.js +5 -1
- package/dist/services/server/routing.js.map +1 -1
- package/dist/services/session-manager.d.ts +20 -0
- package/dist/services/session-manager.d.ts.map +1 -1
- package/dist/services/session-manager.js +71 -9
- package/dist/services/session-manager.js.map +1 -1
- package/dist/services/session-manager.mjs +57 -0
- package/dist/services/session-manager.mjs.map +1 -1
- package/dist/services/webhook-runner.js +7 -2
- package/dist/services/webhook-runner.js.map +1 -1
- package/dist/services/webhook-store.d.ts.map +1 -1
- package/dist/services/worker-queue.js +5 -1
- package/dist/services/worker-queue.js.map +1 -1
- package/dist/utils/convert-custom-field-type.d.ts.map +1 -1
- package/dist/utils/cron.d.ts.map +1 -1
- package/dist/utils/fetch.d.ts.map +1 -1
- package/dist/utils/filepath-to-prop-path.d.ts.map +1 -1
- package/dist/utils/filepath-to-prop-path.js +13 -8
- package/dist/utils/filepath-to-prop-path.js.map +1 -1
- package/dist/utils/is-initialized.d.ts.map +1 -1
- package/dist/utils/load-config-file.d.ts.map +1 -1
- package/dist/utils/load-config-file.js +7 -2
- package/dist/utils/load-config-file.js.map +1 -1
- package/dist/utils/load-files.d.ts +1 -1
- package/dist/utils/load-files.d.ts.map +1 -1
- package/dist/utils/load-files.js +12 -6
- package/dist/utils/load-files.js.map +1 -1
- package/dist/utils/open-browser.d.ts +0 -1
- package/dist/utils/open-browser.d.ts.map +1 -1
- package/dist/utils/open-browser.js +5 -1
- package/dist/utils/open-browser.js.map +1 -1
- package/dist/utils/resolve-working-dirs.d.ts.map +1 -1
- package/dist/utils/resolve-working-dirs.js +6 -2
- package/dist/utils/resolve-working-dirs.js.map +1 -1
- package/dist/utils/signals.d.ts.map +1 -1
- package/dist/utils/startup-logger.d.ts.map +1 -1
- package/dist/utils/startup-logger.js +27 -21
- package/dist/utils/startup-logger.js.map +1 -1
- package/dist/utils/transform-content-types-to-models.d.ts +3 -3
- package/dist/utils/transform-content-types-to-models.d.ts.map +1 -1
- package/dist/utils/transform-content-types-to-models.js +10 -5
- package/dist/utils/transform-content-types-to-models.js.map +1 -1
- package/dist/utils/update-notifier/index.d.ts.map +1 -1
- package/dist/utils/update-notifier/index.js +21 -8
- package/dist/utils/update-notifier/index.js.map +1 -1
- package/dist/utils/update-notifier/index.mjs +6 -1
- package/dist/utils/update-notifier/index.mjs.map +1 -1
- package/package.json +18 -21
|
@@ -4,6 +4,10 @@ var _ = require('lodash');
|
|
|
4
4
|
var strapiUtils = require('@strapi/utils');
|
|
5
5
|
var blocksValidator = require('./blocks-validator.js');
|
|
6
6
|
|
|
7
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
8
|
+
|
|
9
|
+
var ___default = /*#__PURE__*/_interopDefault(_);
|
|
10
|
+
|
|
7
11
|
/* Validator utils */ const toNumberSafe = (value)=>{
|
|
8
12
|
if (value === undefined || value === null) return undefined;
|
|
9
13
|
const num = Number(value);
|
|
@@ -51,26 +55,26 @@ const shouldSkipUniqueValidation = (attrType, value)=>{
|
|
|
51
55
|
/**
|
|
52
56
|
* Adds minLength validator
|
|
53
57
|
*/ const addMinLengthValidator = (validator, { attr }, { isDraft })=>{
|
|
54
|
-
return attr.minLength &&
|
|
58
|
+
return attr.minLength && ___default.default.isInteger(attr.minLength) && !isDraft ? validator.min(attr.minLength) : validator;
|
|
55
59
|
};
|
|
56
60
|
/**
|
|
57
61
|
* Adds maxLength validator
|
|
58
62
|
* @returns {StringSchema}
|
|
59
63
|
*/ const addMaxLengthValidator = (validator, { attr })=>{
|
|
60
|
-
return attr.maxLength &&
|
|
64
|
+
return attr.maxLength && ___default.default.isInteger(attr.maxLength) ? validator.max(attr.maxLength) : validator;
|
|
61
65
|
};
|
|
62
66
|
/**
|
|
63
67
|
* Adds min integer validator
|
|
64
68
|
* @returns {NumberSchema}
|
|
65
69
|
*/ const addMinIntegerValidator = (validator, { attr }, { isDraft })=>{
|
|
66
70
|
const min = toNumberSafe(attr.min);
|
|
67
|
-
return min !== undefined && !isDraft ? validator.min(
|
|
71
|
+
return min !== undefined && !isDraft ? validator.min(___default.default.toInteger(min)) : validator;
|
|
68
72
|
};
|
|
69
73
|
/**
|
|
70
74
|
* Adds max integer validator
|
|
71
75
|
*/ const addMaxIntegerValidator = (validator, { attr })=>{
|
|
72
76
|
const max = toNumberSafe(attr.max);
|
|
73
|
-
return max !== undefined ? validator.max(
|
|
77
|
+
return max !== undefined ? validator.max(___default.default.toInteger(max)) : validator;
|
|
74
78
|
};
|
|
75
79
|
/**
|
|
76
80
|
* Adds min float/decimal validator
|
|
@@ -87,7 +91,7 @@ const shouldSkipUniqueValidation = (attrType, value)=>{
|
|
|
87
91
|
/**
|
|
88
92
|
* Adds regex validator
|
|
89
93
|
*/ const addStringRegexValidator = (validator, { attr }, { isDraft })=>{
|
|
90
|
-
return 'regex' in attr && !
|
|
94
|
+
return 'regex' in attr && !___default.default.isUndefined(attr.regex) && !isDraft ? validator.matches(new RegExp(attr.regex), {
|
|
91
95
|
excludeEmptyString: !attr.required
|
|
92
96
|
}) : validator;
|
|
93
97
|
};
|
|
@@ -227,7 +231,7 @@ const addUniqueValidator = (validator, { attr, model, updatedAttribute, entity,
|
|
|
227
231
|
/**
|
|
228
232
|
* If the attribute value is `null` or an empty string we want to skip the unique validation.
|
|
229
233
|
* Otherwise it'll only accept a single entry with that value in the database.
|
|
230
|
-
*/ if (
|
|
234
|
+
*/ if (___default.default.isNil(value) || value === '') {
|
|
231
235
|
return true;
|
|
232
236
|
}
|
|
233
237
|
// Skip unique checks for invalid scalar numeric values and let the type validator fail.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validators.js","sources":["../../../src/services/entity-validator/validators.ts"],"sourcesContent":["/**\n * Validators check if the entry data meets specific criteria before saving or publishing.\n * (e.g., length, range, format).\n *\n * Drafts have limited validations (mainly max constraints),\n * while published content undergoes full validation.\n *\n * The system also takes locales into account when validating data.\n * E.g, unique fields must be unique within the same locale.\n */\nimport _ from 'lodash';\nimport { yup } from '@strapi/utils';\nimport type { Schema, Struct, Modules } from '@strapi/types';\nimport { blocksValidator } from './blocks-validator';\n\nimport type { ComponentContext } from '.';\n\nexport interface ValidatorMetas<\n TAttribute extends Schema.Attribute.AnyAttribute = Schema.Attribute.AnyAttribute,\n TValue extends Schema.Attribute.Value<TAttribute> = Schema.Attribute.Value<TAttribute>,\n> {\n attr: TAttribute;\n model: Struct.Schema;\n updatedAttribute: {\n name: string;\n value: TValue;\n };\n data: Record<string, unknown>;\n componentContext?: ComponentContext;\n entity?: Modules.EntityValidator.Entity;\n}\n\ninterface ValidatorOptions {\n isDraft: boolean;\n locale?: string;\n}\n\n/* Validator utils */\n\nconst toNumberSafe = (value: unknown): number | undefined => {\n if (value === undefined || value === null) return undefined;\n const num = Number(value);\n return Number.isFinite(num) ? num : undefined;\n};\n\nconst BIG_INTEGER_REGEX = /^[+-]?\\d+$/;\n\nconst toBigIntegerString = (value: unknown): string | undefined => {\n if (value == null) {\n return undefined;\n }\n\n if (typeof value === 'bigint') {\n return value.toString();\n }\n\n if (typeof value === 'number') {\n if (!Number.isFinite(value) || !Number.isInteger(value)) {\n return undefined;\n }\n\n return value.toString();\n }\n\n if (typeof value === 'string') {\n const trimmedValue = value.trim();\n\n if (!BIG_INTEGER_REGEX.test(trimmedValue)) {\n return undefined;\n }\n\n return BigInt(trimmedValue).toString();\n }\n\n return undefined;\n};\n\nconst isValidBigInteger = (value: unknown): boolean => toBigIntegerString(value) != null;\n\nconst isValidFiniteNumber = (value: unknown): value is number =>\n typeof value === 'number' && Number.isFinite(value);\n\nconst isValidInteger = (value: unknown): value is number =>\n isValidFiniteNumber(value) && Number.isInteger(value);\n\nconst shouldSkipUniqueValidation = (\n attrType: Schema.Attribute.AnyAttribute['type'],\n value: unknown\n): boolean => {\n switch (attrType) {\n case 'integer':\n return !isValidInteger(value);\n case 'float':\n case 'decimal':\n return !isValidFiniteNumber(value);\n case 'biginteger':\n return !isValidBigInteger(value);\n default:\n return false;\n }\n};\n\n/**\n * Adds minLength validator\n */\nconst addMinLengthValidator = (\n validator: yup.StringSchema,\n {\n attr,\n }: {\n attr:\n | Schema.Attribute.String\n | Schema.Attribute.Text\n | Schema.Attribute.RichText\n | Schema.Attribute.Password\n | Schema.Attribute.Email\n | Schema.Attribute.UID;\n },\n { isDraft }: ValidatorOptions\n) => {\n return attr.minLength && _.isInteger(attr.minLength) && !isDraft\n ? validator.min(attr.minLength)\n : validator;\n};\n\n/**\n * Adds maxLength validator\n * @returns {StringSchema}\n */\nconst addMaxLengthValidator = (\n validator: yup.StringSchema,\n {\n attr,\n }: {\n attr:\n | Schema.Attribute.String\n | Schema.Attribute.Text\n | Schema.Attribute.RichText\n | Schema.Attribute.Password\n | Schema.Attribute.Email\n | Schema.Attribute.UID;\n }\n) => {\n return attr.maxLength && _.isInteger(attr.maxLength) ? validator.max(attr.maxLength) : validator;\n};\n\n/**\n * Adds min integer validator\n * @returns {NumberSchema}\n */\nconst addMinIntegerValidator = (\n validator: yup.NumberSchema,\n {\n attr,\n }: {\n attr: Schema.Attribute.Integer | Schema.Attribute.BigInteger;\n },\n { isDraft }: ValidatorOptions\n) => {\n const min = toNumberSafe(attr.min);\n return min !== undefined && !isDraft ? validator.min(_.toInteger(min)) : validator;\n};\n\n/**\n * Adds max integer validator\n */\nconst addMaxIntegerValidator = (\n validator: yup.NumberSchema,\n {\n attr,\n }: {\n attr: Schema.Attribute.Integer | Schema.Attribute.BigInteger;\n }\n) => {\n const max = toNumberSafe(attr.max);\n return max !== undefined ? validator.max(_.toInteger(max)) : validator;\n};\n\n/**\n * Adds min float/decimal validator\n */\nconst addMinFloatValidator = (\n validator: yup.NumberSchema,\n {\n attr,\n }: {\n attr: Schema.Attribute.Decimal | Schema.Attribute.Float;\n },\n { isDraft }: ValidatorOptions\n) => {\n const min = toNumberSafe(attr.min);\n return min !== undefined && !isDraft ? validator.min(min) : validator;\n};\n\n/**\n * Adds max float/decimal validator\n */\nconst addMaxFloatValidator = (\n validator: yup.NumberSchema,\n {\n attr,\n }: {\n attr: Schema.Attribute.Decimal | Schema.Attribute.Float;\n }\n) => {\n const max = toNumberSafe(attr.max);\n return max !== undefined ? validator.max(max) : validator;\n};\n\n/**\n * Adds regex validator\n */\nconst addStringRegexValidator = (\n validator: yup.StringSchema,\n {\n attr,\n }: {\n attr:\n | Schema.Attribute.String\n | Schema.Attribute.Text\n | Schema.Attribute.RichText\n | Schema.Attribute.Password\n | Schema.Attribute.Email\n | Schema.Attribute.UID;\n },\n { isDraft }: ValidatorOptions\n) => {\n return 'regex' in attr && !_.isUndefined(attr.regex) && !isDraft\n ? validator.matches(new RegExp(attr.regex), { excludeEmptyString: !attr.required })\n : validator;\n};\n\nconst addUniqueValidator = <T extends yup.AnySchema>(\n validator: T,\n {\n attr,\n model,\n updatedAttribute,\n entity,\n componentContext,\n }: ValidatorMetas<Schema.Attribute.AnyAttribute & Schema.Attribute.UniqueOption>,\n options: ValidatorOptions\n): T => {\n if (attr.type !== 'uid' && !attr.unique) {\n return validator;\n }\n\n const validateUniqueFieldWithinComponent = async (value: any): Promise<boolean> => {\n if (!componentContext) {\n return false;\n }\n\n // If we are validating a unique field within a repeatable component,\n // we first need to ensure that the repeatable in the current entity is\n // valid against itself.\n const hasRepeatableData = componentContext.repeatableData.length > 0;\n if (hasRepeatableData) {\n const { name: updatedName, value: updatedValue } = updatedAttribute;\n // Construct the full path to the unique field within the component.\n const pathToCheck = [...componentContext.pathToComponent.slice(1), updatedName].join('.');\n\n // Extract the values from the repeatable data using the constructed path\n const values = componentContext.repeatableData.map((item) => {\n return pathToCheck.split('.').reduce((acc, key) => acc[key], item as any);\n });\n\n // Check if the value is repeated in the current entity\n const isUpdatedAttributeRepeatedInThisEntity =\n values.filter((value) => value === updatedValue).length > 1;\n\n if (isUpdatedAttributeRepeatedInThisEntity) {\n return false;\n }\n }\n\n /**\n * When `componentContext` is present it means we are dealing with a unique\n * field within a component.\n *\n * The unique validation must consider the specific context of the\n * component, which will always be contained within a parent content type\n * and may also be nested within another component.\n *\n * We construct a query that takes into account the parent's model UID,\n * dimensions (such as draft and publish state/locale) and excludes the current\n * content type entity by its ID if provided.\n */\n const {\n model: parentModel,\n options: parentOptions,\n id: excludeId,\n } = componentContext.parentContent;\n\n const whereConditions: Record<string, any> = {};\n const isParentDraft = parentOptions && parentOptions.isDraft;\n\n whereConditions.publishedAt = isParentDraft ? null : { $notNull: true };\n\n if (parentOptions?.locale) {\n whereConditions.locale = parentOptions.locale;\n }\n\n if (excludeId && !Number.isNaN(excludeId)) {\n whereConditions.id = { $ne: excludeId };\n }\n\n const queryUid = parentModel.uid;\n const queryWhere = {\n ...componentContext.pathToComponent.reduceRight((acc, key) => ({ [key]: acc }), {\n [updatedAttribute.name]: value,\n }),\n\n ...whereConditions,\n };\n\n // The validation should pass if there is no other record found from the query\n return !(await strapi.db.query(queryUid).findOne({ where: queryWhere }));\n };\n\n const validateUniqueFieldWithinDynamicZoneComponent = async (\n startOfPath: string\n ): Promise<boolean> => {\n if (!componentContext) {\n return false;\n }\n\n const targetComponentUID = model.uid;\n // Ensure that the value is unique within the dynamic zone in this entity.\n const countOfValueInThisEntity = (componentContext?.fullDynamicZoneContent ?? []).reduce(\n (acc, component) => {\n if (component.__component !== targetComponentUID) {\n return acc;\n }\n\n const updatedValue = component[updatedAttribute.name];\n return updatedValue === updatedAttribute.value ? acc + 1 : acc;\n },\n 0\n );\n\n if (countOfValueInThisEntity > 1) {\n // If the value is repeated in the current entity, the validation fails.\n return false;\n }\n\n // Build a query for the parent content type to find all entities in the\n // same locale and publication state\n type QueryType = {\n select: string[];\n where: {\n published_at?: { $eq: null } | { $ne: null };\n id?: { $ne: number };\n locale?: string;\n };\n populate: {\n [key: string]: {\n on: {\n [key: string]: {\n select: string[];\n where: { [key: string]: string | number | boolean };\n };\n };\n };\n };\n };\n\n // Populate the dynamic zone for any components that share the same value\n // as the updated attribute.\n const query: QueryType = {\n select: ['id'],\n where: {},\n populate: {\n [startOfPath]: {\n on: {\n [targetComponentUID]: {\n select: ['id'],\n where: { [updatedAttribute.name]: updatedAttribute.value },\n },\n },\n },\n },\n };\n\n const { options, id } = componentContext.parentContent;\n\n if (options?.isDraft !== undefined) {\n query.where.published_at = options.isDraft ? { $eq: null } : { $ne: null };\n }\n\n if (id) {\n query.where.id = { $ne: id };\n }\n\n if (options?.locale) {\n query.where.locale = options.locale;\n }\n\n const parentModelQueryResult = await strapi.db\n .query(componentContext.parentContent.model.uid)\n .findMany(query);\n\n // Filter the results to only include results that have components in the\n // dynamic zone that match the target component type.\n const filteredResults = parentModelQueryResult\n .filter((result) => Array.isArray(result[startOfPath]) && result[startOfPath].length)\n .flatMap((result) => result[startOfPath])\n .filter((dynamicZoneComponent) => dynamicZoneComponent.__component === targetComponentUID);\n\n if (filteredResults.length >= 1) {\n return false;\n }\n\n return true;\n };\n\n return validator.test('unique', 'This attribute must be unique', async (value) => {\n /**\n * If the attribute value is `null` or an empty string we want to skip the unique validation.\n * Otherwise it'll only accept a single entry with that value in the database.\n */\n if (_.isNil(value) || value === '') {\n return true;\n }\n\n // Skip unique checks for invalid scalar numeric values and let the type validator fail.\n // This prevents malformed values from reaching the DB query layer when abortEarly=false.\n if (shouldSkipUniqueValidation(attr.type, value)) {\n return true;\n }\n\n /**\n * We don't validate any unique constraint for draft entries.\n */\n if (options.isDraft) {\n return true;\n }\n\n const hasPathToComponent = componentContext && componentContext.pathToComponent.length > 0;\n if (hasPathToComponent) {\n // Detect if we are validating within a dynamiczone by checking if the first\n // path is a dynamiczone attribute in the parent content type.\n const startOfPath = componentContext.pathToComponent[0];\n const testingDZ =\n componentContext.parentContent.model.attributes[startOfPath].type === 'dynamiczone';\n\n if (testingDZ) {\n return validateUniqueFieldWithinDynamicZoneComponent(startOfPath);\n }\n\n return validateUniqueFieldWithinComponent(value);\n }\n\n /**\n * Here we are validating a scalar unique field from the content type's schema.\n * We construct a query to check if the value is unique\n * considering dimensions (e.g. locale, publication state) and excluding the current entity by its ID if available.\n */\n const scalarAttributeWhere: Record<string, any> = {\n [updatedAttribute.name]: value,\n publishedAt: { $notNull: true },\n };\n\n if (options?.locale) {\n scalarAttributeWhere.locale = options.locale;\n }\n\n if (entity?.id) {\n scalarAttributeWhere.id = { $ne: entity.id };\n }\n\n // The validation should pass if there is no other record found from the query\n return !(await strapi.db\n .query(model.uid)\n .findOne({ where: scalarAttributeWhere, select: ['id'] }));\n });\n};\n\n/* Type validators */\n\nconst stringValidator = (\n metas: ValidatorMetas<\n | Schema.Attribute.String\n | Schema.Attribute.Text\n | Schema.Attribute.RichText\n | Schema.Attribute.Password\n | Schema.Attribute.Email\n | Schema.Attribute.UID\n >,\n options: ValidatorOptions\n) => {\n let schema = yup.string().transform((val, originalVal) => originalVal);\n\n schema = addMinLengthValidator(schema, metas, options);\n schema = addMaxLengthValidator(schema, metas);\n schema = addStringRegexValidator(schema, metas, options);\n schema = addUniqueValidator(schema, metas, options);\n\n return schema;\n};\n\nexport const emailValidator = (\n metas: ValidatorMetas<Schema.Attribute.Email>,\n options: ValidatorOptions\n) => {\n const schema = stringValidator(metas, options);\n\n if (options.isDraft) {\n return schema;\n }\n\n return schema.email().min(\n 1,\n // eslint-disable-next-line no-template-curly-in-string\n '${path} cannot be empty'\n );\n};\n\nexport const uidValidator = (\n metas: ValidatorMetas<Schema.Attribute.UID>,\n options: ValidatorOptions\n) => {\n const schema = stringValidator(metas, options);\n\n if (options.isDraft) {\n return schema;\n }\n\n if (metas.attr.regex) {\n return schema.matches(new RegExp(metas.attr.regex));\n }\n\n return schema.matches(/^[A-Za-z0-9-_.~]*$/);\n};\n\nexport const enumerationValidator = ({ attr }: { attr: Schema.Attribute.Enumeration }) => {\n return yup\n .string()\n .oneOf((Array.isArray(attr.enum) ? attr.enum : [attr.enum]).concat(null as any));\n};\n\nexport const integerValidator = (\n metas: ValidatorMetas<Schema.Attribute.Integer | Schema.Attribute.BigInteger>,\n options: ValidatorOptions\n) => {\n let schema = yup.number().integer();\n\n schema = addMinIntegerValidator(schema, metas, options);\n schema = addMaxIntegerValidator(schema, metas);\n schema = addUniqueValidator(schema, metas, options);\n\n return schema;\n};\n\nexport const floatValidator = (\n metas: ValidatorMetas<Schema.Attribute.Decimal | Schema.Attribute.Float>,\n options: ValidatorOptions\n) => {\n let schema = yup\n .number()\n .test(\n 'is-finite-number',\n '${path} must be a finite number',\n (value) => value == null || isValidFiniteNumber(value)\n );\n\n schema = addMinFloatValidator(schema, metas, options);\n schema = addMaxFloatValidator(schema, metas);\n schema = addUniqueValidator(schema, metas, options);\n\n return schema;\n};\n\nexport const bigintegerValidator = (\n metas: ValidatorMetas<Schema.Attribute.BigInteger>,\n options: ValidatorOptions\n) => {\n const schema = yup\n .mixed()\n .transform((value, originalValue) => toBigIntegerString(originalValue) ?? value)\n .test('is-biginteger', '${path} must be a valid integer', (value) => {\n if (value == null) {\n return true;\n }\n\n return isValidBigInteger(value);\n });\n\n return addUniqueValidator(schema, metas, options);\n};\n\nexport const datesValidator = (\n metas: ValidatorMetas<\n | Schema.Attribute.Date\n | Schema.Attribute.DateTime\n | Schema.Attribute.Time\n | Schema.Attribute.Timestamp\n >,\n options: ValidatorOptions\n) => {\n const schema = yup.mixed();\n return addUniqueValidator(schema, metas, options);\n};\n\nexport const Validators = {\n string: stringValidator,\n text: stringValidator,\n richtext: stringValidator,\n password: stringValidator,\n email: emailValidator,\n enumeration: enumerationValidator,\n boolean: () => yup.boolean().nullable(),\n uid: uidValidator,\n json: () => yup.mixed(),\n integer: integerValidator,\n biginteger: bigintegerValidator,\n float: floatValidator,\n decimal: floatValidator,\n date: datesValidator,\n time: datesValidator,\n datetime: datesValidator,\n timestamp: datesValidator,\n blocks: blocksValidator,\n};\n"],"names":["toNumberSafe","value","undefined","num","Number","isFinite","BIG_INTEGER_REGEX","toBigIntegerString","toString","isInteger","trimmedValue","trim","test","BigInt","isValidBigInteger","isValidFiniteNumber","isValidInteger","shouldSkipUniqueValidation","attrType","addMinLengthValidator","validator","attr","isDraft","minLength","_","min","addMaxLengthValidator","maxLength","max","addMinIntegerValidator","toInteger","addMaxIntegerValidator","addMinFloatValidator","addMaxFloatValidator","addStringRegexValidator","isUndefined","regex","matches","RegExp","excludeEmptyString","required","addUniqueValidator","model","updatedAttribute","entity","componentContext","options","type","unique","validateUniqueFieldWithinComponent","hasRepeatableData","repeatableData","length","name","updatedName","updatedValue","pathToCheck","pathToComponent","slice","join","values","map","item","split","reduce","acc","key","isUpdatedAttributeRepeatedInThisEntity","filter","parentModel","parentOptions","id","excludeId","parentContent","whereConditions","isParentDraft","publishedAt","$notNull","locale","isNaN","$ne","queryUid","uid","queryWhere","reduceRight","strapi","db","query","findOne","where","validateUniqueFieldWithinDynamicZoneComponent","startOfPath","targetComponentUID","countOfValueInThisEntity","fullDynamicZoneContent","component","__component","select","populate","on","published_at","$eq","parentModelQueryResult","findMany","filteredResults","result","Array","isArray","flatMap","dynamicZoneComponent","isNil","hasPathToComponent","testingDZ","attributes","scalarAttributeWhere","stringValidator","metas","schema","yup","string","transform","val","originalVal","emailValidator","email","uidValidator","enumerationValidator","oneOf","enum","concat","integerValidator","number","integer","floatValidator","bigintegerValidator","mixed","originalValue","datesValidator","Validators","text","richtext","password","enumeration","boolean","nullable","json","biginteger","float","decimal","date","time","datetime","timestamp","blocks","blocksValidator"],"mappings":";;;;;;AAqCA,sBAEA,MAAMA,YAAAA,GAAe,CAACC,KAAAA,GAAAA;AACpB,IAAA,IAAIA,KAAAA,KAAUC,SAAAA,IAAaD,KAAAA,KAAU,IAAA,EAAM,OAAOC,SAAAA;AAClD,IAAA,MAAMC,MAAMC,MAAAA,CAAOH,KAAAA,CAAAA;AACnB,IAAA,OAAOG,MAAAA,CAAOC,QAAQ,CAACF,GAAAA,CAAAA,GAAOA,GAAAA,GAAMD,SAAAA;AACtC,CAAA;AAEA,MAAMI,iBAAAA,GAAoB,YAAA;AAE1B,MAAMC,qBAAqB,CAACN,KAAAA,GAAAA;AAC1B,IAAA,IAAIA,SAAS,IAAA,EAAM;QACjB,OAAOC,SAAAA;AACT,IAAA;IAEA,IAAI,OAAOD,UAAU,QAAA,EAAU;AAC7B,QAAA,OAAOA,MAAMO,QAAQ,EAAA;AACvB,IAAA;IAEA,IAAI,OAAOP,UAAU,QAAA,EAAU;QAC7B,IAAI,CAACG,OAAOC,QAAQ,CAACJ,UAAU,CAACG,MAAAA,CAAOK,SAAS,CAACR,KAAAA,CAAAA,EAAQ;YACvD,OAAOC,SAAAA;AACT,QAAA;AAEA,QAAA,OAAOD,MAAMO,QAAQ,EAAA;AACvB,IAAA;IAEA,IAAI,OAAOP,UAAU,QAAA,EAAU;QAC7B,MAAMS,YAAAA,GAAeT,MAAMU,IAAI,EAAA;AAE/B,QAAA,IAAI,CAACL,iBAAAA,CAAkBM,IAAI,CAACF,YAAAA,CAAAA,EAAe;YACzC,OAAOR,SAAAA;AACT,QAAA;QAEA,OAAOW,MAAAA,CAAOH,cAAcF,QAAQ,EAAA;AACtC,IAAA;IAEA,OAAON,SAAAA;AACT,CAAA;AAEA,MAAMY,iBAAAA,GAAoB,CAACb,KAAAA,GAA4BM,kBAAAA,CAAmBN,KAAAA,CA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AAahB,oBAAAA;AACbiB,IAAAA,OAAAA,EAAS,IAAMzB,eAAAA,CAAIyB,OAAO,EAAA,CAAGC,QAAQ,EAAA;IACrC9D,GAAAA,EAAK2C,YAAAA;IACLoB,IAAAA,EAAM,IAAM3B,gBAAIiB,KAAK,EAAA;IACrBH,OAAAA,EAASF,gBAAAA;IACTgB,UAAAA,EAAYZ,mBAAAA;IACZa,KAAAA,EAAOd,cAAAA;IACPe,OAAAA,EAASf,cAAAA;IACTgB,IAAAA,EAAMZ,cAAAA;IACNa,IAAAA,EAAMb,cAAAA;IACNc,QAAAA,EAAUd,cAAAA;IACVe,SAAAA,EAAWf,cAAAA;IACXgB,MAAAA,EAAQC;AACV;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"validators.js","sources":["../../../src/services/entity-validator/validators.ts"],"sourcesContent":["/**\n * Validators check if the entry data meets specific criteria before saving or publishing.\n * (e.g., length, range, format).\n *\n * Drafts have limited validations (mainly max constraints),\n * while published content undergoes full validation.\n *\n * The system also takes locales into account when validating data.\n * E.g, unique fields must be unique within the same locale.\n */\nimport _ from 'lodash';\nimport { yup } from '@strapi/utils';\nimport type { Schema, Struct, Modules } from '@strapi/types';\nimport { blocksValidator } from './blocks-validator';\n\nimport type { ComponentContext } from '.';\n\nexport interface ValidatorMetas<\n TAttribute extends Schema.Attribute.AnyAttribute = Schema.Attribute.AnyAttribute,\n TValue extends Schema.Attribute.Value<TAttribute> = Schema.Attribute.Value<TAttribute>,\n> {\n attr: TAttribute;\n model: Struct.Schema;\n updatedAttribute: {\n name: string;\n value: TValue;\n };\n data: Record<string, unknown>;\n componentContext?: ComponentContext;\n entity?: Modules.EntityValidator.Entity;\n}\n\ninterface ValidatorOptions {\n isDraft: boolean;\n locale?: string;\n}\n\n/* Validator utils */\n\nconst toNumberSafe = (value: unknown): number | undefined => {\n if (value === undefined || value === null) return undefined;\n const num = Number(value);\n return Number.isFinite(num) ? num : undefined;\n};\n\nconst BIG_INTEGER_REGEX = /^[+-]?\\d+$/;\n\nconst toBigIntegerString = (value: unknown): string | undefined => {\n if (value == null) {\n return undefined;\n }\n\n if (typeof value === 'bigint') {\n return value.toString();\n }\n\n if (typeof value === 'number') {\n if (!Number.isFinite(value) || !Number.isInteger(value)) {\n return undefined;\n }\n\n return value.toString();\n }\n\n if (typeof value === 'string') {\n const trimmedValue = value.trim();\n\n if (!BIG_INTEGER_REGEX.test(trimmedValue)) {\n return undefined;\n }\n\n return BigInt(trimmedValue).toString();\n }\n\n return undefined;\n};\n\nconst isValidBigInteger = (value: unknown): boolean => toBigIntegerString(value) != null;\n\nconst isValidFiniteNumber = (value: unknown): value is number =>\n typeof value === 'number' && Number.isFinite(value);\n\nconst isValidInteger = (value: unknown): value is number =>\n isValidFiniteNumber(value) && Number.isInteger(value);\n\nconst shouldSkipUniqueValidation = (\n attrType: Schema.Attribute.AnyAttribute['type'],\n value: unknown\n): boolean => {\n switch (attrType) {\n case 'integer':\n return !isValidInteger(value);\n case 'float':\n case 'decimal':\n return !isValidFiniteNumber(value);\n case 'biginteger':\n return !isValidBigInteger(value);\n default:\n return false;\n }\n};\n\n/**\n * Adds minLength validator\n */\nconst addMinLengthValidator = (\n validator: yup.StringSchema,\n {\n attr,\n }: {\n attr:\n | Schema.Attribute.String\n | Schema.Attribute.Text\n | Schema.Attribute.RichText\n | Schema.Attribute.Password\n | Schema.Attribute.Email\n | Schema.Attribute.UID;\n },\n { isDraft }: ValidatorOptions\n) => {\n return attr.minLength && _.isInteger(attr.minLength) && !isDraft\n ? validator.min(attr.minLength)\n : validator;\n};\n\n/**\n * Adds maxLength validator\n * @returns {StringSchema}\n */\nconst addMaxLengthValidator = (\n validator: yup.StringSchema,\n {\n attr,\n }: {\n attr:\n | Schema.Attribute.String\n | Schema.Attribute.Text\n | Schema.Attribute.RichText\n | Schema.Attribute.Password\n | Schema.Attribute.Email\n | Schema.Attribute.UID;\n }\n) => {\n return attr.maxLength && _.isInteger(attr.maxLength) ? validator.max(attr.maxLength) : validator;\n};\n\n/**\n * Adds min integer validator\n * @returns {NumberSchema}\n */\nconst addMinIntegerValidator = (\n validator: yup.NumberSchema,\n {\n attr,\n }: {\n attr: Schema.Attribute.Integer | Schema.Attribute.BigInteger;\n },\n { isDraft }: ValidatorOptions\n) => {\n const min = toNumberSafe(attr.min);\n return min !== undefined && !isDraft ? validator.min(_.toInteger(min)) : validator;\n};\n\n/**\n * Adds max integer validator\n */\nconst addMaxIntegerValidator = (\n validator: yup.NumberSchema,\n {\n attr,\n }: {\n attr: Schema.Attribute.Integer | Schema.Attribute.BigInteger;\n }\n) => {\n const max = toNumberSafe(attr.max);\n return max !== undefined ? validator.max(_.toInteger(max)) : validator;\n};\n\n/**\n * Adds min float/decimal validator\n */\nconst addMinFloatValidator = (\n validator: yup.NumberSchema,\n {\n attr,\n }: {\n attr: Schema.Attribute.Decimal | Schema.Attribute.Float;\n },\n { isDraft }: ValidatorOptions\n) => {\n const min = toNumberSafe(attr.min);\n return min !== undefined && !isDraft ? validator.min(min) : validator;\n};\n\n/**\n * Adds max float/decimal validator\n */\nconst addMaxFloatValidator = (\n validator: yup.NumberSchema,\n {\n attr,\n }: {\n attr: Schema.Attribute.Decimal | Schema.Attribute.Float;\n }\n) => {\n const max = toNumberSafe(attr.max);\n return max !== undefined ? validator.max(max) : validator;\n};\n\n/**\n * Adds regex validator\n */\nconst addStringRegexValidator = (\n validator: yup.StringSchema,\n {\n attr,\n }: {\n attr:\n | Schema.Attribute.String\n | Schema.Attribute.Text\n | Schema.Attribute.RichText\n | Schema.Attribute.Password\n | Schema.Attribute.Email\n | Schema.Attribute.UID;\n },\n { isDraft }: ValidatorOptions\n) => {\n return 'regex' in attr && !_.isUndefined(attr.regex) && !isDraft\n ? validator.matches(new RegExp(attr.regex), { excludeEmptyString: !attr.required })\n : validator;\n};\n\nconst addUniqueValidator = <T extends yup.AnySchema>(\n validator: T,\n {\n attr,\n model,\n updatedAttribute,\n entity,\n componentContext,\n }: ValidatorMetas<Schema.Attribute.AnyAttribute & Schema.Attribute.UniqueOption>,\n options: ValidatorOptions\n): T => {\n if (attr.type !== 'uid' && !attr.unique) {\n return validator;\n }\n\n const validateUniqueFieldWithinComponent = async (value: any): Promise<boolean> => {\n if (!componentContext) {\n return false;\n }\n\n // If we are validating a unique field within a repeatable component,\n // we first need to ensure that the repeatable in the current entity is\n // valid against itself.\n const hasRepeatableData = componentContext.repeatableData.length > 0;\n if (hasRepeatableData) {\n const { name: updatedName, value: updatedValue } = updatedAttribute;\n // Construct the full path to the unique field within the component.\n const pathToCheck = [...componentContext.pathToComponent.slice(1), updatedName].join('.');\n\n // Extract the values from the repeatable data using the constructed path\n const values = componentContext.repeatableData.map((item) => {\n return pathToCheck.split('.').reduce((acc, key) => acc[key], item as any);\n });\n\n // Check if the value is repeated in the current entity\n const isUpdatedAttributeRepeatedInThisEntity =\n values.filter((value) => value === updatedValue).length > 1;\n\n if (isUpdatedAttributeRepeatedInThisEntity) {\n return false;\n }\n }\n\n /**\n * When `componentContext` is present it means we are dealing with a unique\n * field within a component.\n *\n * The unique validation must consider the specific context of the\n * component, which will always be contained within a parent content type\n * and may also be nested within another component.\n *\n * We construct a query that takes into account the parent's model UID,\n * dimensions (such as draft and publish state/locale) and excludes the current\n * content type entity by its ID if provided.\n */\n const {\n model: parentModel,\n options: parentOptions,\n id: excludeId,\n } = componentContext.parentContent;\n\n const whereConditions: Record<string, any> = {};\n const isParentDraft = parentOptions && parentOptions.isDraft;\n\n whereConditions.publishedAt = isParentDraft ? null : { $notNull: true };\n\n if (parentOptions?.locale) {\n whereConditions.locale = parentOptions.locale;\n }\n\n if (excludeId && !Number.isNaN(excludeId)) {\n whereConditions.id = { $ne: excludeId };\n }\n\n const queryUid = parentModel.uid;\n const queryWhere = {\n ...componentContext.pathToComponent.reduceRight((acc, key) => ({ [key]: acc }), {\n [updatedAttribute.name]: value,\n }),\n\n ...whereConditions,\n };\n\n // The validation should pass if there is no other record found from the query\n return !(await strapi.db.query(queryUid).findOne({ where: queryWhere }));\n };\n\n const validateUniqueFieldWithinDynamicZoneComponent = async (\n startOfPath: string\n ): Promise<boolean> => {\n if (!componentContext) {\n return false;\n }\n\n const targetComponentUID = model.uid;\n // Ensure that the value is unique within the dynamic zone in this entity.\n const countOfValueInThisEntity = (componentContext?.fullDynamicZoneContent ?? []).reduce(\n (acc, component) => {\n if (component.__component !== targetComponentUID) {\n return acc;\n }\n\n const updatedValue = component[updatedAttribute.name];\n return updatedValue === updatedAttribute.value ? acc + 1 : acc;\n },\n 0\n );\n\n if (countOfValueInThisEntity > 1) {\n // If the value is repeated in the current entity, the validation fails.\n return false;\n }\n\n // Build a query for the parent content type to find all entities in the\n // same locale and publication state\n type QueryType = {\n select: string[];\n where: {\n published_at?: { $eq: null } | { $ne: null };\n id?: { $ne: number };\n locale?: string;\n };\n populate: {\n [key: string]: {\n on: {\n [key: string]: {\n select: string[];\n where: { [key: string]: string | number | boolean };\n };\n };\n };\n };\n };\n\n // Populate the dynamic zone for any components that share the same value\n // as the updated attribute.\n const query: QueryType = {\n select: ['id'],\n where: {},\n populate: {\n [startOfPath]: {\n on: {\n [targetComponentUID]: {\n select: ['id'],\n where: { [updatedAttribute.name]: updatedAttribute.value },\n },\n },\n },\n },\n };\n\n const { options, id } = componentContext.parentContent;\n\n if (options?.isDraft !== undefined) {\n query.where.published_at = options.isDraft ? { $eq: null } : { $ne: null };\n }\n\n if (id) {\n query.where.id = { $ne: id };\n }\n\n if (options?.locale) {\n query.where.locale = options.locale;\n }\n\n const parentModelQueryResult = await strapi.db\n .query(componentContext.parentContent.model.uid)\n .findMany(query);\n\n // Filter the results to only include results that have components in the\n // dynamic zone that match the target component type.\n const filteredResults = parentModelQueryResult\n .filter((result) => Array.isArray(result[startOfPath]) && result[startOfPath].length)\n .flatMap((result) => result[startOfPath])\n .filter((dynamicZoneComponent) => dynamicZoneComponent.__component === targetComponentUID);\n\n if (filteredResults.length >= 1) {\n return false;\n }\n\n return true;\n };\n\n return validator.test('unique', 'This attribute must be unique', async (value) => {\n /**\n * If the attribute value is `null` or an empty string we want to skip the unique validation.\n * Otherwise it'll only accept a single entry with that value in the database.\n */\n if (_.isNil(value) || value === '') {\n return true;\n }\n\n // Skip unique checks for invalid scalar numeric values and let the type validator fail.\n // This prevents malformed values from reaching the DB query layer when abortEarly=false.\n if (shouldSkipUniqueValidation(attr.type, value)) {\n return true;\n }\n\n /**\n * We don't validate any unique constraint for draft entries.\n */\n if (options.isDraft) {\n return true;\n }\n\n const hasPathToComponent = componentContext && componentContext.pathToComponent.length > 0;\n if (hasPathToComponent) {\n // Detect if we are validating within a dynamiczone by checking if the first\n // path is a dynamiczone attribute in the parent content type.\n const startOfPath = componentContext.pathToComponent[0];\n const testingDZ =\n componentContext.parentContent.model.attributes[startOfPath].type === 'dynamiczone';\n\n if (testingDZ) {\n return validateUniqueFieldWithinDynamicZoneComponent(startOfPath);\n }\n\n return validateUniqueFieldWithinComponent(value);\n }\n\n /**\n * Here we are validating a scalar unique field from the content type's schema.\n * We construct a query to check if the value is unique\n * considering dimensions (e.g. locale, publication state) and excluding the current entity by its ID if available.\n */\n const scalarAttributeWhere: Record<string, any> = {\n [updatedAttribute.name]: value,\n publishedAt: { $notNull: true },\n };\n\n if (options?.locale) {\n scalarAttributeWhere.locale = options.locale;\n }\n\n if (entity?.id) {\n scalarAttributeWhere.id = { $ne: entity.id };\n }\n\n // The validation should pass if there is no other record found from the query\n return !(await strapi.db\n .query(model.uid)\n .findOne({ where: scalarAttributeWhere, select: ['id'] }));\n });\n};\n\n/* Type validators */\n\nconst stringValidator = (\n metas: ValidatorMetas<\n | Schema.Attribute.String\n | Schema.Attribute.Text\n | Schema.Attribute.RichText\n | Schema.Attribute.Password\n | Schema.Attribute.Email\n | Schema.Attribute.UID\n >,\n options: ValidatorOptions\n) => {\n let schema = yup.string().transform((val, originalVal) => originalVal);\n\n schema = addMinLengthValidator(schema, metas, options);\n schema = addMaxLengthValidator(schema, metas);\n schema = addStringRegexValidator(schema, metas, options);\n schema = addUniqueValidator(schema, metas, options);\n\n return schema;\n};\n\nexport const emailValidator = (\n metas: ValidatorMetas<Schema.Attribute.Email>,\n options: ValidatorOptions\n) => {\n const schema = stringValidator(metas, options);\n\n if (options.isDraft) {\n return schema;\n }\n\n return schema.email().min(\n 1,\n // eslint-disable-next-line no-template-curly-in-string\n '${path} cannot be empty'\n );\n};\n\nexport const uidValidator = (\n metas: ValidatorMetas<Schema.Attribute.UID>,\n options: ValidatorOptions\n) => {\n const schema = stringValidator(metas, options);\n\n if (options.isDraft) {\n return schema;\n }\n\n if (metas.attr.regex) {\n return schema.matches(new RegExp(metas.attr.regex));\n }\n\n return schema.matches(/^[A-Za-z0-9-_.~]*$/);\n};\n\nexport const enumerationValidator = ({ attr }: { attr: Schema.Attribute.Enumeration }) => {\n return yup\n .string()\n .oneOf((Array.isArray(attr.enum) ? attr.enum : [attr.enum]).concat(null as any));\n};\n\nexport const integerValidator = (\n metas: ValidatorMetas<Schema.Attribute.Integer | Schema.Attribute.BigInteger>,\n options: ValidatorOptions\n) => {\n let schema = yup.number().integer();\n\n schema = addMinIntegerValidator(schema, metas, options);\n schema = addMaxIntegerValidator(schema, metas);\n schema = addUniqueValidator(schema, metas, options);\n\n return schema;\n};\n\nexport const floatValidator = (\n metas: ValidatorMetas<Schema.Attribute.Decimal | Schema.Attribute.Float>,\n options: ValidatorOptions\n) => {\n let schema = yup\n .number()\n .test(\n 'is-finite-number',\n '${path} must be a finite number',\n (value) => value == null || isValidFiniteNumber(value)\n );\n\n schema = addMinFloatValidator(schema, metas, options);\n schema = addMaxFloatValidator(schema, metas);\n schema = addUniqueValidator(schema, metas, options);\n\n return schema;\n};\n\nexport const bigintegerValidator = (\n metas: ValidatorMetas<Schema.Attribute.BigInteger>,\n options: ValidatorOptions\n) => {\n const schema = yup\n .mixed()\n .transform((value, originalValue) => toBigIntegerString(originalValue) ?? value)\n .test('is-biginteger', '${path} must be a valid integer', (value) => {\n if (value == null) {\n return true;\n }\n\n return isValidBigInteger(value);\n });\n\n return addUniqueValidator(schema, metas, options);\n};\n\nexport const datesValidator = (\n metas: ValidatorMetas<\n | Schema.Attribute.Date\n | Schema.Attribute.DateTime\n | Schema.Attribute.Time\n | Schema.Attribute.Timestamp\n >,\n options: ValidatorOptions\n) => {\n const schema = yup.mixed();\n return addUniqueValidator(schema, metas, options);\n};\n\nexport const Validators = {\n string: stringValidator,\n text: stringValidator,\n richtext: stringValidator,\n password: stringValidator,\n email: emailValidator,\n enumeration: enumerationValidator,\n boolean: () => yup.boolean().nullable(),\n uid: uidValidator,\n json: () => yup.mixed(),\n integer: integerValidator,\n biginteger: bigintegerValidator,\n float: floatValidator,\n decimal: floatValidator,\n date: datesValidator,\n time: datesValidator,\n datetime: datesValidator,\n timestamp: datesValidator,\n blocks: blocksValidator,\n};\n"],"names":["toNumberSafe","value","undefined","num","Number","isFinite","BIG_INTEGER_REGEX","toBigIntegerString","toString","isInteger","trimmedValue","trim","test","BigInt","isValidBigInteger","isValidFiniteNumber","isValidInteger","shouldSkipUniqueValidation","attrType","addMinLengthValidator","validator","attr","isDraft","minLength","_","min","addMaxLengthValidator","maxLength","max","addMinIntegerValidator","toInteger","addMaxIntegerValidator","addMinFloatValidator","addMaxFloatValidator","addStringRegexValidator","isUndefined","regex","matches","RegExp","excludeEmptyString","required","addUniqueValidator","model","updatedAttribute","entity","componentContext","options","type","unique","validateUniqueFieldWithinComponent","hasRepeatableData","repeatableData","length","name","updatedName","updatedValue","pathToCheck","pathToComponent","slice","join","values","map","item","split","reduce","acc","key","isUpdatedAttributeRepeatedInThisEntity","filter","parentModel","parentOptions","id","excludeId","parentContent","whereConditions","isParentDraft","publishedAt","$notNull","locale","isNaN","$ne","queryUid","uid","queryWhere","reduceRight","strapi","db","query","findOne","where","validateUniqueFieldWithinDynamicZoneComponent","startOfPath","targetComponentUID","countOfValueInThisEntity","fullDynamicZoneContent","component","__component","select","populate","on","published_at","$eq","parentModelQueryResult","findMany","filteredResults","result","Array","isArray","flatMap","dynamicZoneComponent","isNil","hasPathToComponent","testingDZ","attributes","scalarAttributeWhere","stringValidator","metas","schema","yup","string","transform","val","originalVal","emailValidator","email","uidValidator","enumerationValidator","oneOf","enum","concat","integerValidator","number","integer","floatValidator","bigintegerValidator","mixed","originalValue","datesValidator","Validators","text","richtext","password","enumeration","boolean","nullable","json","biginteger","float","decimal","date","time","datetime","timestamp","blocks","blocksValidator"],"mappings":";;;;;;;;;;AAqCA,sBAEA,MAAMA,YAAAA,GAAe,CAACC,KAAAA,GAAAA;AACpB,IAAA,IAAIA,KAAAA,KAAUC,SAAAA,IAAaD,KAAAA,KAAU,IAAA,EAAM,OAAOC,SAAAA;AAClD,IAAA,MAAMC,MAAMC,MAAAA,CAAOH,KAAAA,CAAAA;AACnB,IAAA,OAAOG,MAAAA,CAAOC,QAAQ,CAACF,GAAAA,CAAAA,GAAOA,GAAAA,GAAMD,SAAAA;AACtC,CAAA;AAEA,MAAMI,iBAAAA,GAAoB,YAAA;AAE1B,MAAMC,qBAAqB,CAACN,KAAAA,GAAAA;AAC1B,IAAA,IAAIA,SAAS,IAAA,EAAM;QACjB,OAAOC,SAAAA;AACT,IAAA;IAEA,IAAI,OAAOD,UAAU,QAAA,EAAU;AAC7B,QAAA,OAAOA,MAAMO,QAAQ,EAAA;AACvB,IAAA;IAEA,IAAI,OAAOP,UAAU,QAAA,EAAU;QAC7B,IAAI,CAACG,OAAOC,QAAQ,CAACJ,UAAU,CAACG,MAAAA,CAAOK,SAAS,CAACR,KAAAA,CAAAA,EAAQ;YACvD,OAAOC,SAAAA;AACT,QAAA;AAEA,QAAA,OAAOD,MAAMO,QAAQ,EAAA;AACvB,IAAA;IAEA,IAAI,OAAOP,UAAU,QAAA,EAAU;QAC7B,MAAMS,YAAAA,GAAeT,MAAMU,IAAI,EAAA;AAE/B,QAAA,IAAI,CAACL,iBAAAA,CAAkBM,IAAI,CAACF,YAAAA,CAAAA,EAAe;YACzC,OAAOR,SAAAA;AACT,QAAA;QAEA,OAAOW,MAAAA,C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AA,EAAQJ,eAAAA;IACRwB,IAAAA,EAAMxB,eAAAA;IACNyB,QAAAA,EAAUzB,eAAAA;IACV0B,QAAAA,EAAU1B,eAAAA;IACVS,KAAAA,EAAOD,cAAAA;IACPmB,WAAAA,EAAahB,oBAAAA;AACbiB,IAAAA,OAAAA,EAAS,IAAMzB,eAAAA,CAAIyB,OAAO,EAAA,CAAGC,QAAQ,EAAA;IACrC9D,GAAAA,EAAK2C,YAAAA;IACLoB,IAAAA,EAAM,IAAM3B,gBAAIiB,KAAK,EAAA;IACrBH,OAAAA,EAASF,gBAAAA;IACTgB,UAAAA,EAAYZ,mBAAAA;IACZa,KAAAA,EAAOd,cAAAA;IACPe,OAAAA,EAASf,cAAAA;IACTgB,IAAAA,EAAMZ,cAAAA;IACNa,IAAAA,EAAMb,cAAAA;IACNc,QAAAA,EAAUd,cAAAA;IACVe,SAAAA,EAAWf,cAAAA;IACXgB,MAAAA,EAAQC;AACV;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/services/errors.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AA6BvC,QAAA,MAAM,sBAAsB,
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/services/errors.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AA6BvC,QAAA,MAAM,sBAAsB,GAAI,OAAO,YAAY,CAAC,OAAO,MAAM,CAAC,gBAAgB,CAAC;;;;;;;;;;;CAgBlF,CAAC;AAEF,QAAA,MAAM,eAAe,GAAI,OAAO,WAAW,CAAC,SAAS;;;;;;;;;;;CAapD,CAAC;AAEF,QAAA,MAAM,mBAAmB,GAAI,OAAO,OAAO;;;;;;;;;;;CAY1C,CAAC;AAEF,OAAO,EAAE,sBAAsB,EAAE,eAAe,EAAE,mBAAmB,EAAE,CAAC"}
|
package/dist/services/errors.js
CHANGED
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
var createError = require('http-errors');
|
|
4
4
|
var strapiUtils = require('@strapi/utils');
|
|
5
5
|
|
|
6
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
7
|
+
|
|
8
|
+
var createError__default = /*#__PURE__*/_interopDefault(createError);
|
|
9
|
+
|
|
6
10
|
const mapErrorsAndStatus = [
|
|
7
11
|
{
|
|
8
12
|
classError: strapiUtils.errors.UnauthorizedError,
|
|
@@ -61,13 +65,13 @@ const formatHttpError = (error)=>{
|
|
|
61
65
|
};
|
|
62
66
|
const formatInternalError = (error)=>{
|
|
63
67
|
if (!(error instanceof Error)) {
|
|
64
|
-
return formatHttpError(
|
|
68
|
+
return formatHttpError(createError__default.default(500));
|
|
65
69
|
}
|
|
66
|
-
const httpError =
|
|
70
|
+
const httpError = createError__default.default(error);
|
|
67
71
|
if (httpError.expose) {
|
|
68
72
|
return formatHttpError(httpError);
|
|
69
73
|
}
|
|
70
|
-
return formatHttpError(
|
|
74
|
+
return formatHttpError(createError__default.default(httpError.status || 500));
|
|
71
75
|
};
|
|
72
76
|
|
|
73
77
|
exports.formatApplicationError = formatApplicationError;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sources":["../../src/services/errors.ts"],"sourcesContent":["import createError from 'http-errors';\nimport { errors } from '@strapi/utils';\n\nconst mapErrorsAndStatus = [\n {\n classError: errors.UnauthorizedError,\n status: 401,\n },\n {\n classError: errors.ForbiddenError,\n status: 403,\n },\n {\n classError: errors.NotFoundError,\n status: 404,\n },\n {\n classError: errors.PayloadTooLargeError,\n status: 413,\n },\n {\n classError: errors.RateLimitError,\n status: 429,\n },\n {\n classError: errors.NotImplementedError,\n status: 501,\n },\n];\n\nconst formatApplicationError = (error: InstanceType<typeof errors.ApplicationError>) => {\n const errorAndStatus = mapErrorsAndStatus.find((pair) => error instanceof pair.classError);\n const status = errorAndStatus ? errorAndStatus.status : 400;\n\n return {\n status,\n body: {\n data: null,\n error: {\n status,\n name: error.name,\n message: error.message,\n details: error.details,\n },\n },\n };\n};\n\nconst formatHttpError = (error: createError.HttpError) => {\n return {\n status: error.status,\n body: {\n data: null,\n error: {\n status: error.status,\n name: error.name,\n message: error.message,\n details: error.details,\n },\n },\n };\n};\n\nconst formatInternalError = (error: unknown) => {\n if (!(error instanceof Error)) {\n return formatHttpError(createError(500));\n }\n\n const httpError = createError(error);\n\n if (httpError.expose) {\n return formatHttpError(httpError);\n }\n\n return formatHttpError(createError(httpError.status || 500));\n};\n\nexport { formatApplicationError, formatHttpError, formatInternalError };\n"],"names":["mapErrorsAndStatus","classError","errors","UnauthorizedError","status","ForbiddenError","NotFoundError","PayloadTooLargeError","RateLimitError","NotImplementedError","formatApplicationError","error","errorAndStatus","find","pair","body","data","name","message","details","formatHttpError","formatInternalError","Error","createError","httpError","expose"],"mappings":"
|
|
1
|
+
{"version":3,"file":"errors.js","sources":["../../src/services/errors.ts"],"sourcesContent":["import createError from 'http-errors';\nimport { errors } from '@strapi/utils';\n\nconst mapErrorsAndStatus = [\n {\n classError: errors.UnauthorizedError,\n status: 401,\n },\n {\n classError: errors.ForbiddenError,\n status: 403,\n },\n {\n classError: errors.NotFoundError,\n status: 404,\n },\n {\n classError: errors.PayloadTooLargeError,\n status: 413,\n },\n {\n classError: errors.RateLimitError,\n status: 429,\n },\n {\n classError: errors.NotImplementedError,\n status: 501,\n },\n];\n\nconst formatApplicationError = (error: InstanceType<typeof errors.ApplicationError>) => {\n const errorAndStatus = mapErrorsAndStatus.find((pair) => error instanceof pair.classError);\n const status = errorAndStatus ? errorAndStatus.status : 400;\n\n return {\n status,\n body: {\n data: null,\n error: {\n status,\n name: error.name,\n message: error.message,\n details: error.details,\n },\n },\n };\n};\n\nconst formatHttpError = (error: createError.HttpError) => {\n return {\n status: error.status,\n body: {\n data: null,\n error: {\n status: error.status,\n name: error.name,\n message: error.message,\n details: error.details,\n },\n },\n };\n};\n\nconst formatInternalError = (error: unknown) => {\n if (!(error instanceof Error)) {\n return formatHttpError(createError(500));\n }\n\n const httpError = createError(error);\n\n if (httpError.expose) {\n return formatHttpError(httpError);\n }\n\n return formatHttpError(createError(httpError.status || 500));\n};\n\nexport { formatApplicationError, formatHttpError, formatInternalError };\n"],"names":["mapErrorsAndStatus","classError","errors","UnauthorizedError","status","ForbiddenError","NotFoundError","PayloadTooLargeError","RateLimitError","NotImplementedError","formatApplicationError","error","errorAndStatus","find","pair","body","data","name","message","details","formatHttpError","formatInternalError","Error","createError","httpError","expose"],"mappings":";;;;;;;;;AAGA,MAAMA,kBAAAA,GAAqB;AACzB,IAAA;AACEC,QAAAA,UAAAA,EAAYC,mBAAOC,iBAAiB;QACpCC,MAAAA,EAAQ;AACV,KAAA;AACA,IAAA;AACEH,QAAAA,UAAAA,EAAYC,mBAAOG,cAAc;QACjCD,MAAAA,EAAQ;AACV,KAAA;AACA,IAAA;AACEH,QAAAA,UAAAA,EAAYC,mBAAOI,aAAa;QAChCF,MAAAA,EAAQ;AACV,KAAA;AACA,IAAA;AACEH,QAAAA,UAAAA,EAAYC,mBAAOK,oBAAoB;QACvCH,MAAAA,EAAQ;AACV,KAAA;AACA,IAAA;AACEH,QAAAA,UAAAA,EAAYC,mBAAOM,cAAc;QACjCJ,MAAAA,EAAQ;AACV,KAAA;AACA,IAAA;AACEH,QAAAA,UAAAA,EAAYC,mBAAOO,mBAAmB;QACtCL,MAAAA,EAAQ;AACV;AACD,CAAA;AAED,MAAMM,yBAAyB,CAACC,KAAAA,GAAAA;IAC9B,MAAMC,cAAAA,GAAiBZ,mBAAmBa,IAAI,CAAC,CAACC,IAAAA,GAASH,KAAAA,YAAiBG,KAAKb,UAAU,CAAA;AACzF,IAAA,MAAMG,MAAAA,GAASQ,cAAAA,GAAiBA,cAAAA,CAAeR,MAAM,GAAG,GAAA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M,eAAe,CAAC;AAInD,QAAA,MAAM,qBAAqB,
|
|
1
|
+
{"version":3,"file":"features.d.ts","sourceRoot":"","sources":["../../src/services/features.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAInD,QAAA,MAAM,qBAAqB,GAAI,QAAQ,IAAI,CAAC,MAAM,KAAG,OAAO,CAAC,QAAQ,CAAC,eAarE,CAAC;AAEF,OAAO,EAAE,qBAAqB,EAAE,CAAC;AACjC,MAAM,MAAM,eAAe,GAAG,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fs.d.ts","sourceRoot":"","sources":["../../src/services/fs.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAE1C,UAAU,QAAQ;IAChB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACtE,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACzF,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACzD,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5D;AAED;;GAEG;
|
|
1
|
+
{"version":3,"file":"fs.d.ts","sourceRoot":"","sources":["../../src/services/fs.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAE1C,UAAU,QAAQ;IAChB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACtE,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACzF,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACzD,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5D;AAED;;GAEG;yBACa,QAAQ,IAAI,CAAC,MAAM;AAAnC,wBAiDE"}
|
package/dist/services/fs.js
CHANGED
|
@@ -3,13 +3,18 @@
|
|
|
3
3
|
var path = require('path');
|
|
4
4
|
var fse = require('fs-extra');
|
|
5
5
|
|
|
6
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
7
|
+
|
|
8
|
+
var path__default = /*#__PURE__*/_interopDefault(path);
|
|
9
|
+
var fse__default = /*#__PURE__*/_interopDefault(fse);
|
|
10
|
+
|
|
6
11
|
/**
|
|
7
12
|
* create strapi fs layer
|
|
8
13
|
*/ var createStrapiFs = ((strapi)=>{
|
|
9
14
|
function normalizePath(optPath) {
|
|
10
15
|
const filePath = Array.isArray(optPath) ? optPath.join('/') : optPath;
|
|
11
|
-
const normalizedPath =
|
|
12
|
-
return
|
|
16
|
+
const normalizedPath = path__default.default.normalize(filePath).replace(/^\/?(\.\/|\.\.\/)+/, '');
|
|
17
|
+
return path__default.default.resolve(strapi.dirs.app.root, normalizedPath);
|
|
13
18
|
}
|
|
14
19
|
const strapiFS = {
|
|
15
20
|
/**
|
|
@@ -18,7 +23,7 @@ var fse = require('fs-extra');
|
|
|
18
23
|
* @param {string} data - content
|
|
19
24
|
*/ writeAppFile (optPath, data) {
|
|
20
25
|
const writePath = normalizePath(optPath);
|
|
21
|
-
return
|
|
26
|
+
return fse__default.default.ensureFile(writePath).then(()=>fse__default.default.writeFile(writePath, data));
|
|
22
27
|
},
|
|
23
28
|
/**
|
|
24
29
|
* Writes a file in a plugin extensions folder
|
|
@@ -36,13 +41,13 @@ var fse = require('fs-extra');
|
|
|
36
41
|
* Removes a file in strapi app
|
|
37
42
|
*/ removeAppFile (optPath) {
|
|
38
43
|
const removePath = normalizePath(optPath);
|
|
39
|
-
return
|
|
44
|
+
return fse__default.default.remove(removePath);
|
|
40
45
|
},
|
|
41
46
|
/**
|
|
42
47
|
* Appends a file in strapi app
|
|
43
48
|
*/ appendFile (optPath, data) {
|
|
44
49
|
const writePath = normalizePath(optPath);
|
|
45
|
-
return
|
|
50
|
+
return fse__default.default.appendFileSync(writePath, data);
|
|
46
51
|
}
|
|
47
52
|
};
|
|
48
53
|
return strapiFS;
|
package/dist/services/fs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fs.js","sources":["../../src/services/fs.ts"],"sourcesContent":["import path from 'path';\nimport fse from 'fs-extra';\n\nimport type { Core } from '@strapi/types';\n\ninterface StrapiFS {\n writeAppFile(optPath: string | string[], data: string): Promise<void>;\n writePluginFile(plugin: string, optPath: string | string[], data: string): Promise<void>;\n removeAppFile(optPath: string | string[]): Promise<void>;\n appendFile(optPath: string | string[], data: string): void;\n}\n\n/**\n * create strapi fs layer\n */\nexport default (strapi: Core.Strapi) => {\n function normalizePath(optPath: string | string[]) {\n const filePath = Array.isArray(optPath) ? optPath.join('/') : optPath;\n\n const normalizedPath = path.normalize(filePath).replace(/^\\/?(\\.\\/|\\.\\.\\/)+/, '');\n\n return path.resolve(strapi.dirs.app.root, normalizedPath);\n }\n\n const strapiFS: StrapiFS = {\n /**\n * Writes a file in a strapi app\n * @param {Array|string} optPath - file path\n * @param {string} data - content\n */\n writeAppFile(optPath, data) {\n const writePath = normalizePath(optPath);\n return fse.ensureFile(writePath).then(() => fse.writeFile(writePath, data));\n },\n\n /**\n * Writes a file in a plugin extensions folder\n * @param {string} plugin - plugin name\n * @param {Array|string} optPath - path to file\n * @param {string} data - content\n */\n writePluginFile(plugin, optPath, data) {\n const newPath = ['extensions', plugin].concat(optPath).join('/');\n return strapiFS.writeAppFile(newPath, data);\n },\n\n /**\n * Removes a file in strapi app\n */\n removeAppFile(optPath) {\n const removePath = normalizePath(optPath);\n return fse.remove(removePath);\n },\n\n /**\n * Appends a file in strapi app\n */\n appendFile(optPath, data) {\n const writePath = normalizePath(optPath);\n return fse.appendFileSync(writePath, data);\n },\n };\n\n return strapiFS;\n};\n"],"names":["strapi","normalizePath","optPath","filePath","Array","isArray","join","normalizedPath","path","normalize","replace","resolve","dirs","app","root","strapiFS","writeAppFile","data","writePath","fse","ensureFile","then","writeFile","writePluginFile","plugin","newPath","concat","removeAppFile","removePath","remove","appendFile","appendFileSync"],"mappings":"
|
|
1
|
+
{"version":3,"file":"fs.js","sources":["../../src/services/fs.ts"],"sourcesContent":["import path from 'path';\nimport fse from 'fs-extra';\n\nimport type { Core } from '@strapi/types';\n\ninterface StrapiFS {\n writeAppFile(optPath: string | string[], data: string): Promise<void>;\n writePluginFile(plugin: string, optPath: string | string[], data: string): Promise<void>;\n removeAppFile(optPath: string | string[]): Promise<void>;\n appendFile(optPath: string | string[], data: string): void;\n}\n\n/**\n * create strapi fs layer\n */\nexport default (strapi: Core.Strapi) => {\n function normalizePath(optPath: string | string[]) {\n const filePath = Array.isArray(optPath) ? optPath.join('/') : optPath;\n\n const normalizedPath = path.normalize(filePath).replace(/^\\/?(\\.\\/|\\.\\.\\/)+/, '');\n\n return path.resolve(strapi.dirs.app.root, normalizedPath);\n }\n\n const strapiFS: StrapiFS = {\n /**\n * Writes a file in a strapi app\n * @param {Array|string} optPath - file path\n * @param {string} data - content\n */\n writeAppFile(optPath, data) {\n const writePath = normalizePath(optPath);\n return fse.ensureFile(writePath).then(() => fse.writeFile(writePath, data));\n },\n\n /**\n * Writes a file in a plugin extensions folder\n * @param {string} plugin - plugin name\n * @param {Array|string} optPath - path to file\n * @param {string} data - content\n */\n writePluginFile(plugin, optPath, data) {\n const newPath = ['extensions', plugin].concat(optPath).join('/');\n return strapiFS.writeAppFile(newPath, data);\n },\n\n /**\n * Removes a file in strapi app\n */\n removeAppFile(optPath) {\n const removePath = normalizePath(optPath);\n return fse.remove(removePath);\n },\n\n /**\n * Appends a file in strapi app\n */\n appendFile(optPath, data) {\n const writePath = normalizePath(optPath);\n return fse.appendFileSync(writePath, data);\n },\n };\n\n return strapiFS;\n};\n"],"names":["strapi","normalizePath","optPath","filePath","Array","isArray","join","normalizedPath","path","normalize","replace","resolve","dirs","app","root","strapiFS","writeAppFile","data","writePath","fse","ensureFile","then","writeFile","writePluginFile","plugin","newPath","concat","removeAppFile","removePath","remove","appendFile","appendFileSync"],"mappings":";;;;;;;;;;AAYA;;IAGA,qBAAe,CAAA,CAACA,MAAAA,GAAAA;AACd,IAAA,SAASC,cAAcC,OAA0B,EAAA;QAC/C,MAAMC,QAAAA,GAAWC,MAAMC,OAAO,CAACH,WAAWA,OAAAA,CAAQI,IAAI,CAAC,GAAA,CAAA,GAAOJ,OAAAA;AAE9D,QAAA,MAAMK,iBAAiBC,qBAAAA,CAAKC,SAAS,CAACN,QAAAA,CAAAA,CAAUO,OAAO,CAAC,oBAAA,EAAsB,EAAA,CAAA;QAE9E,OAAOF,qBAAAA,CAAKG,OAAO,CAACX,MAAAA,CAAOY,IAAI,CAACC,GAAG,CAACC,IAAI,EAAEP,cAAAA,CAAAA;AAC5C,IAAA;AAEA,IAAA,MAAMQ,QAAAA,GAAqB;AACzB;;;;QAKAC,YAAAA,CAAAA,CAAad,OAAO,EAAEe,IAAI,EAAA;AACxB,YAAA,MAAMC,YAAYjB,aAAAA,CAAcC,OAAAA,CAAAA;YAChC,OAAOiB,oBAAAA,CAAIC,UAAU,CAACF,SAAAA,CAAAA,CAAWG,IAAI,CAAC,IAAMF,oBAAAA,CAAIG,SAAS,CAACJ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version":3,"file":"handlePost.d.ts","sourceRoot":"","sources":["../../../../src/services/mcp/handlers/handlePost.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAS1C,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAEtD,eAAO,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"handlePost.d.ts","sourceRoot":"","sources":["../../../../src/services/mcp/handlers/handlePost.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAS1C,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAEtD,eAAO,MAAM,iBAAiB,GAAI,MAAM,sBAAsB,KAAG,IAAI,CAAC,iBAuErE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/mcp/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAYnD;;GAEG;AACH,eAAO,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/mcp/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAYnD;;GAEG;AACH,eAAO,MAAM,gBAAgB,GAAI,QAAQ,IAAI,CAAC,MAAM,KAAG,OAAO,CAAC,GAAG,CAAC,UAgHlE,CAAC"}
|
|
@@ -22,9 +22,9 @@ export declare class McpCapabilityRegistryBase<CapabilityName extends 'tool' | '
|
|
|
22
22
|
};
|
|
23
23
|
}): {
|
|
24
24
|
name: string;
|
|
25
|
-
status:
|
|
25
|
+
status: "enabled" | "disabled" | "defined" | "undefined";
|
|
26
26
|
devModeOnly: boolean;
|
|
27
|
-
auth: Definition[
|
|
27
|
+
auth: Definition["auth"] | undefined;
|
|
28
28
|
}[];
|
|
29
29
|
status(name: string): 'enabled' | 'disabled' | 'defined' | 'undefined';
|
|
30
30
|
/** @internal Used by syncMcpSessionCapabilities; not part of the public registry API. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"McpServerFactory.d.ts","sourceRoot":"","sources":["../../../../src/services/mcp/internal/McpServerFactory.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,+BAA+B,EAAE,MAAM,mCAAmC,CAAC;AACpF,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,yBAAyB,CAAC;AAG7E,MAAM,MAAM,wBAAwB,GAAG;IACrC,KAAK,EAAE,+BAA+B,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;IAC9E,OAAO,EAAE,+BAA+B,CAAC,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;IACpF,SAAS,EAAE,+BAA+B,CAAC,UAAU,EAAE,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC;CAC3F,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,KAAK,EAAE,eAAe,CAAC;IACvB,OAAO,EAAE,iBAAiB,CAAC;IAC3B,SAAS,EAAE,mBAAmB,CAAC;CAChC,CAAC;AAEF,qEAAqE;AACrE,MAAM,MAAM,qBAAqB,GAAG;IAClC,KAAK,EAAE,6BAA6B,CAA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C;IACpF,SAAS,EAAE,+BAA+B,CAAC,UAAU,EAAE,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC;CAC3F,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,KAAK,EAAE,eAAe,CAAC;IACvB,OAAO,EAAE,iBAAiB,CAAC;IAC3B,SAAS,EAAE,mBAAmB,CAAC;CAChC,CAAC;AAEF,qEAAqE;AACrE,MAAM,MAAM,qBAAqB,GAAG;IAClC,KAAK,EAAE,6BAA6B,CAAC;IACrC,OAAO,EAAE,6BAA6B,CAAC;IACvC,SAAS,EAAE,6BAA6B,CAAC;CAC1C,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG;IACpC,SAAS,EAAE,SAAS,CAAC;IACrB,UAAU,EAAE,qBAAqB,CAAC;CACnC,CAAC;AAEF,MAAM,MAAM,mCAAmC,GAAG;IAChD,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC;IACpB,WAAW,EAAE,wBAAwB,CAAC;IACtC,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,oBAAoB,CAAC;IAC9B,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC;CAC7C,CAAC;AAEF,eAAO,MAAM,6BAA6B,GAAI,oDAM3C,mCAAmC,KAAG,uBAuExC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"syncMcpSessionCapabilities.d.ts","sourceRoot":"","sources":["../../../../src/services/mcp/internal/syncMcpSessionCapabilities.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,KAAK,EAAE,wBAAwB,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAOlF,MAAM,MAAM,yBAAyB,GAAG;IACtC,OAAO,EAAE,oBAAoB,CAAC;IA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,OAY9B,CAAC;AAEF,eAAO,MAAM,0BAA0B,GAAI,kDAKxC,gCAAgC,KAAG,iCAoDrC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metrics.d.ts","sourceRoot":"","sources":["../../../../src/services/mcp/metrics/metrics.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAE1C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAEtE,wDAAwD;AACxD,eAAO,MAAM,4BAA4B;;;;;CAK/B,CAAC;AAEX,MAAM,MAAM,wBAAwB,GAClC,CAAC,OAAO,4BAA4B,CAAC,CAAC,MAAM,OAAO,4BAA4B,CAAC,CAAC;AAEnF,MAAM,MAAM,iBAAiB,GAAG,eAAe,GAAG,eAAe,CAAC;AAClE,MAAM,MAAM,oBAAoB,GAAG,SAAS,GAAG,OAAO,CAAC;AACvD,MAAM,MAAM,uBAAuB,GAAG,iBAAiB,CAAC;AAExD,MAAM,MAAM,2BAA2B,GAAG;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,iBAAiB,EAAE,MAAM,CAAC;CAC3B,CAAC;AAWF,mEAAmE;AACnE,eAAO,MAAM,4BAA4B,QAAO,IAI/C,CAAC;AAwBF,eAAO,MAAM,yBAAyB,
|
|
1
|
+
{"version":3,"file":"metrics.d.ts","sourceRoot":"","sources":["../../../../src/services/mcp/metrics/metrics.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAE1C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAEtE,wDAAwD;AACxD,eAAO,MAAM,4BAA4B;;;;;CAK/B,CAAC;AAEX,MAAM,MAAM,wBAAwB,GAClC,CAAC,OAAO,4BAA4B,CAAC,CAAC,MAAM,OA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AM,GAAG,QAAQ,GAAG,UAAU,CAAC;AAE/D,MAAM,MAAM,qBAAqB,GAAG;IAClC,IAAI,EAAE,iBAAiB,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,eAAO,MAAM,sBAAsB,
|
|
1
|
+
{"version":3,"file":"normalizeMcpCapability.d.ts","sourceRoot":"","sources":["../../../../src/services/mcp/metrics/normalizeMcpCapability.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,QAAQ,GAAG,UAAU,CAAC;AAE/D,MAAM,MAAM,qBAAqB,GAAG;IAClC,IAAI,EAAE,iBAAiB,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,eAAO,MAAM,sBAAsB,GACjC,MAAM,iBAAiB,EACvB,SAAS,MAAM,EACf,YAAY;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,KAC7C,qBAID,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wrapCapabilityHandlerForMetrics.d.ts","sourceRoot":"","sources":["../../../../src/services/mcp/metrics/wrapCapabilityHandlerForMetrics.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAEnD,OAAO,EAA0B,KAAK,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAW1F,eAAO,MAAM,+BAA+B,
|
|
1
|
+
{"version":3,"file":"wrapCapabilityHandlerForMetrics.d.ts","sourceRoot":"","sources":["../../../../src/services/mcp/metrics/wrapCapabilityHandlerForMetrics.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAEnD,OAAO,EAA0B,KAAK,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAW1F,eAAO,MAAM,+BAA+B,GAC1C,QAAQ,SAAS,CAAC,GAAG,IAAI,EAAE,KAAK,EAAE,KAAK,OAAO,CAAC,OAAO,CAAC,EAEvD,QAAQ,IAAI,CAAC,MAAM,EACnB,MAAM,iBAAiB,EACvB,gBAAgB,MAAM,EACtB,WAAW,OAAO,CAAC,GAAG,CAAC,sBAAsB,GAAG,SAAS,EACzD,SAAS,QAAQ,KAChB,QAeF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oauthDiscoveryFallback.d.ts","sourceRoot":"","sources":["../../../../src/services/mcp/middleware/oauthDiscoveryFallback.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAmB1C,eAAO,MAAM,sCAAsC,QAAO,
|
|
1
|
+
{"version":3,"file":"oauthDiscoveryFallback.d.ts","sourceRoot":"","sources":["../../../../src/services/mcp/middleware/oauthDiscoveryFallback.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAmB1C,eAAO,MAAM,sCAAsC,QAAO,IAAI,CAAC,iBAoB9D,CAAC"}
|
|
@@ -2,9 +2,37 @@ import type { McpServer, RegisteredPrompt } from '@modelcontextprotocol/sdk/serv
|
|
|
2
2
|
import type { Core, Modules } from '@strapi/types';
|
|
3
3
|
import { McpCapabilityDefinitionRegistry } from './internal/McpCapabilityDefinitionRegistry';
|
|
4
4
|
import { type McpCapabilityRegistry, McpCapabilityRegistryBase } from './internal/McpCapabilityRegistry';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Defines a Strapi MCP prompt with full type inference, ready to pass to
|
|
7
|
+
* `strapi.ai.mcp.registerPrompt()`. Exposed publicly as `ai.mcp.definePrompt`.
|
|
8
|
+
*
|
|
9
|
+
* The returned value is the definition unchanged — this builder only exists to
|
|
10
|
+
* infer the `name`/`argsSchema` and narrow the access variant (`devModeOnly` vs
|
|
11
|
+
* `auth`) so the result is directly assignable to `registerPrompt`.
|
|
12
|
+
*
|
|
13
|
+
* @param prompt - The prompt definition. Provide either `devModeOnly: true`
|
|
14
|
+
* (dev-only, no auth) or an `auth` policy set — never both.
|
|
15
|
+
* @returns The same definition, with its access variant narrowed.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```ts
|
|
19
|
+
* import { ai } from '@strapi/strapi';
|
|
20
|
+
*
|
|
21
|
+
* const context = ai.mcp.definePrompt({
|
|
22
|
+
* name: 'app-context',
|
|
23
|
+
* title: 'App Context',
|
|
24
|
+
* description: 'Provides context about the app',
|
|
25
|
+
* devModeOnly: true,
|
|
26
|
+
* createHandler: (strapi) => async () => ({
|
|
27
|
+
* messages: [{ role: 'user', content: { type: 'text', text: 'You are connected to Strapi.' } }],
|
|
28
|
+
* }),
|
|
29
|
+
* });
|
|
30
|
+
*
|
|
31
|
+
* // later, in register() or bootstrap():
|
|
32
|
+
* strapi.ai.mcp.registerPrompt(context);
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
export declare const makeMcpPromptDefinition: Modules.MCP.McpPromptBuilder;
|
|
8
36
|
export declare class McpPromptRegistry extends McpCapabilityRegistryBase<'prompt', Modules.MCP.McpPromptDefinition, RegisteredPrompt> implements McpCapabilityRegistry {
|
|
9
37
|
#private;
|
|
10
38
|
constructor(ctx: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompt-registry.d.ts","sourceRoot":"","sources":["../../../src/services/mcp/prompt-registry.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAC3F,OAAO,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAEnD,OAAO,EAAE,+BAA+B,EAAE,MAAM,4CAA4C,CAAC;AAC7F,OAAO,EACL,KAAK,qBAAqB,EAC1B,yBAAyB,EAC1B,MAAM,kCAAkC,CAAC;AAI1C,eAAO,MAAM,uBAAuB
|
|
1
|
+
{"version":3,"file":"prompt-registry.d.ts","sourceRoot":"","sources":["../../../src/services/mcp/prompt-registry.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAC3F,OAAO,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAEnD,OAAO,EAAE,+BAA+B,EAAE,MAAM,4CAA4C,CAAC;AAC7F,OAAO,EACL,KAAK,qBAAqB,EAC1B,yBAAyB,EAC1B,MAAM,kCAAkC,CAAC;AAI1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,eAAO,MAAM,uBAAuB,EACR,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC;AAEzD,qBAAa,iBACX,SAAQ,yBAAyB,CAAC,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,gBAAgB,CAC7F,YAAW,qBAAqB;;gBAIpB,GAAG,EAAE;QACf,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC;QACpB,WAAW,EAAE,+BAA+B,CAAC,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;KACzF;IAKD,IAAI,CAAC,SAAS,EAAE,SAAS;CA4D1B"}
|
|
@@ -15,6 +15,36 @@ var id = 0;
|
|
|
15
15
|
function _class_private_field_loose_key(name) {
|
|
16
16
|
return "__private_" + id++ + "_" + name;
|
|
17
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* Defines a Strapi MCP prompt with full type inference, ready to pass to
|
|
20
|
+
* `strapi.ai.mcp.registerPrompt()`. Exposed publicly as `ai.mcp.definePrompt`.
|
|
21
|
+
*
|
|
22
|
+
* The returned value is the definition unchanged — this builder only exists to
|
|
23
|
+
* infer the `name`/`argsSchema` and narrow the access variant (`devModeOnly` vs
|
|
24
|
+
* `auth`) so the result is directly assignable to `registerPrompt`.
|
|
25
|
+
*
|
|
26
|
+
* @param prompt - The prompt definition. Provide either `devModeOnly: true`
|
|
27
|
+
* (dev-only, no auth) or an `auth` policy set — never both.
|
|
28
|
+
* @returns The same definition, with its access variant narrowed.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```ts
|
|
32
|
+
* import { ai } from '@strapi/strapi';
|
|
33
|
+
*
|
|
34
|
+
* const context = ai.mcp.definePrompt({
|
|
35
|
+
* name: 'app-context',
|
|
36
|
+
* title: 'App Context',
|
|
37
|
+
* description: 'Provides context about the app',
|
|
38
|
+
* devModeOnly: true,
|
|
39
|
+
* createHandler: (strapi) => async () => ({
|
|
40
|
+
* messages: [{ role: 'user', content: { type: 'text', text: 'You are connected to Strapi.' } }],
|
|
41
|
+
* }),
|
|
42
|
+
* });
|
|
43
|
+
*
|
|
44
|
+
* // later, in register() or bootstrap():
|
|
45
|
+
* strapi.ai.mcp.registerPrompt(context);
|
|
46
|
+
* ```
|
|
47
|
+
*/ const makeMcpPromptDefinition = (definition)=>definition;
|
|
18
48
|
var _strapi = /*#__PURE__*/ _class_private_field_loose_key("_strapi");
|
|
19
49
|
class McpPromptRegistry extends McpCapabilityRegistry.McpCapabilityRegistryBase {
|
|
20
50
|
bind(mcpServer) {
|
|
@@ -74,4 +104,5 @@ class McpPromptRegistry extends McpCapabilityRegistry.McpCapabilityRegistryBase
|
|
|
74
104
|
}
|
|
75
105
|
|
|
76
106
|
exports.McpPromptRegistry = McpPromptRegistry;
|
|
107
|
+
exports.makeMcpPromptDefinition = makeMcpPromptDefinition;
|
|
77
108
|
//# sourceMappingURL=prompt-registry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompt-registry.js","sources":["../../../src/services/mcp/prompt-registry.ts"],"sourcesContent":["// eslint-disable-next-line import/extensions\nimport type { McpServer, RegisteredPrompt } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport type { Core, Modules } from '@strapi/types';\n\nimport { McpCapabilityDefinitionRegistry } from './internal/McpCapabilityDefinitionRegistry';\nimport {\n type McpCapabilityRegistry,\n McpCapabilityRegistryBase,\n} from './internal/McpCapabilityRegistry';\nimport { createSafeCapabilityRegistration } from './utils/createSafeCapabilityRegistration';\nimport { wrapCapabilityHandlerForMetrics } from './metrics/wrapCapabilityHandlerForMetrics';\n\
|
|
1
|
+
{"version":3,"file":"prompt-registry.js","sources":["../../../src/services/mcp/prompt-registry.ts"],"sourcesContent":["// eslint-disable-next-line import/extensions\nimport type { McpServer, RegisteredPrompt } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport type { Core, Modules } from '@strapi/types';\n\nimport { McpCapabilityDefinitionRegistry } from './internal/McpCapabilityDefinitionRegistry';\nimport {\n type McpCapabilityRegistry,\n McpCapabilityRegistryBase,\n} from './internal/McpCapabilityRegistry';\nimport { createSafeCapabilityRegistration } from './utils/createSafeCapabilityRegistration';\nimport { wrapCapabilityHandlerForMetrics } from './metrics/wrapCapabilityHandlerForMetrics';\n\n/**\n * Defines a Strapi MCP prompt with full type inference, ready to pass to\n * `strapi.ai.mcp.registerPrompt()`. Exposed publicly as `ai.mcp.definePrompt`.\n *\n * The returned value is the definition unchanged — this builder only exists to\n * infer the `name`/`argsSchema` and narrow the access variant (`devModeOnly` vs\n * `auth`) so the result is directly assignable to `registerPrompt`.\n *\n * @param prompt - The prompt definition. Provide either `devModeOnly: true`\n * (dev-only, no auth) or an `auth` policy set — never both.\n * @returns The same definition, with its access variant narrowed.\n *\n * @example\n * ```ts\n * import { ai } from '@strapi/strapi';\n *\n * const context = ai.mcp.definePrompt({\n * name: 'app-context',\n * title: 'App Context',\n * description: 'Provides context about the app',\n * devModeOnly: true,\n * createHandler: (strapi) => async () => ({\n * messages: [{ role: 'user', content: { type: 'text', text: 'You are connected to Strapi.' } }],\n * }),\n * });\n *\n * // later, in register() or bootstrap():\n * strapi.ai.mcp.registerPrompt(context);\n * ```\n */\nexport const makeMcpPromptDefinition = ((definition: Modules.MCP.McpPromptDefinition) =>\n definition) as unknown as Modules.MCP.McpPromptBuilder;\n\nexport class McpPromptRegistry\n extends McpCapabilityRegistryBase<'prompt', Modules.MCP.McpPromptDefinition, RegisteredPrompt>\n implements McpCapabilityRegistry\n{\n #strapi: Core.Strapi;\n\n constructor(ctx: {\n strapi: Core.Strapi;\n definitions: McpCapabilityDefinitionRegistry<'prompt', Modules.MCP.McpPromptDefinition>;\n }) {\n super(ctx.definitions);\n this.#strapi = ctx.strapi;\n }\n\n bind(mcpServer: McpServer) {\n const strapi = this.#strapi;\n\n super.register((definition) => {\n const { name, title, description, argsSchema, createHandler } = definition;\n\n return createSafeCapabilityRegistration({\n strapi,\n capabilityType: 'Prompt',\n name,\n createHandler,\n createFallbackHandler(errorMessage) {\n return async () => ({\n messages: [\n {\n role: 'user' as const,\n content: {\n type: 'text' as const,\n text: `Prompt \"${name}\" failed to initialize: ${errorMessage}`,\n },\n },\n ],\n });\n },\n createErrorResult(error) {\n return {\n messages: [\n {\n role: 'user' as const,\n content: {\n type: 'text' as const,\n text: `Prompt \"${name}\" execution failed: ${error.message}`,\n },\n },\n ],\n };\n },\n registerWithSdk(safeHandler) {\n const sdkHandler = wrapCapabilityHandlerForMetrics(\n strapi,\n 'prompt',\n name,\n definition.telemetry,\n safeHandler\n );\n\n return mcpServer.registerPrompt(\n name,\n {\n title,\n description,\n // @ts-expect-error - Internal handler type mismatch due to optional argsSchema\n argsSchema,\n },\n sdkHandler\n );\n },\n });\n });\n }\n}\n"],"names":["makeMcpPromptDefinition","definition","McpPromptRegistry","McpCapabilityRegistryBase","bind","mcpServer","strapi","register","name","title","description","argsSchema","createHandler","createSafeCapabilityRegistration","capabilityType","createFallbackHandler","errorMessage","messages","role","content","type","text","createErrorResult","error","message","registerWithSdk","safeHandler","sdkHandler","wrapCapabilityHandlerForMetrics","telemetry","registerPrompt","ctx","definitions"],"mappings":";;;;;;AAAA;;;;;;;;;;;AAYA;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