@directus/api 35.0.2 → 35.2.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/_virtual/rolldown_runtime.js +1 -24
- package/dist/ai/chat/controllers/chat.post.js +9 -22
- package/dist/ai/chat/controllers/object.post.js +58 -0
- package/dist/ai/chat/lib/create-ui-stream.js +10 -18
- package/dist/ai/chat/lib/transform-file-parts.js +1 -3
- package/dist/ai/chat/middleware/load-settings.js +1 -2
- package/dist/ai/chat/models/chat-request.js +2 -9
- package/dist/ai/chat/models/object-request.js +19 -0
- package/dist/ai/chat/router.js +3 -2
- package/dist/ai/chat/utils/add-additional-properties-to-json-schema.js +37 -0
- package/dist/ai/chat/utils/chat-request-tool-to-ai-sdk-tool.js +3 -8
- package/dist/ai/chat/utils/fix-error-tool-calls.js +4 -6
- package/dist/ai/chat/utils/format-context.js +17 -27
- package/dist/ai/chat/utils/parse-json-schema-7.js +3 -6
- package/dist/ai/chat/utils/zod-jsonschema7-parser.js +16 -0
- package/dist/ai/devtools/index.js +1 -2
- package/dist/ai/files/adapters/anthropic.js +1 -3
- package/dist/ai/files/adapters/google.js +5 -12
- package/dist/ai/files/adapters/openai.js +1 -3
- package/dist/ai/files/controllers/upload.js +8 -24
- package/dist/ai/files/lib/fetch-provider.js +1 -3
- package/dist/ai/files/lib/upload-to-provider.js +6 -16
- package/dist/ai/mcp/server.js +58 -102
- package/dist/ai/mcp/transport.js +2 -6
- package/dist/ai/providers/anthropic-file-support.js +28 -41
- package/dist/ai/providers/anthropic-tool-search.js +10 -14
- package/dist/ai/providers/index.js +0 -1
- package/dist/ai/providers/options.js +2 -7
- package/dist/ai/providers/registry.js +38 -48
- package/dist/ai/telemetry/braintrust.js +3 -9
- package/dist/ai/telemetry/index.js +14 -13
- package/dist/ai/telemetry/langfuse.js +8 -22
- package/dist/ai/tools/assets/index.js +15 -23
- package/dist/ai/tools/collections/index.js +9 -19
- package/dist/ai/tools/fields/index.js +13 -27
- package/dist/ai/tools/files/index.js +11 -24
- package/dist/ai/tools/flows/index.js +8 -16
- package/dist/ai/tools/folders/index.js +11 -23
- package/dist/ai/tools/items/index.js +19 -44
- package/dist/ai/tools/operations/index.js +7 -13
- package/dist/ai/tools/relations/index.js +5 -11
- package/dist/ai/tools/schema/index.js +39 -91
- package/dist/ai/tools/trigger-flow/index.js +9 -16
- package/dist/ai/tools/utils.js +4 -8
- package/dist/app.js +19 -51
- package/dist/auth/auth.js +3 -9
- package/dist/auth/drivers/ldap.js +39 -82
- package/dist/auth/drivers/local.js +4 -12
- package/dist/auth/drivers/oauth2.js +32 -63
- package/dist/auth/drivers/openid.js +49 -89
- package/dist/auth/drivers/saml.js +16 -31
- package/dist/auth/utils/generate-callback-url.js +2 -7
- package/dist/auth/utils/resolve-login-redirect.js +11 -21
- package/dist/auth.js +2 -5
- package/dist/bus/lib/use-bus.js +3 -7
- package/dist/cache.js +11 -24
- package/dist/cli/commands/bootstrap/index.js +10 -19
- package/dist/cli/commands/cache/clear.js +1 -3
- package/dist/cli/commands/database/migrate.js +2 -5
- package/dist/cli/commands/init/index.js +3 -5
- package/dist/cli/commands/init/questions.js +2 -3
- package/dist/cli/commands/schema/apply.js +39 -81
- package/dist/cli/commands/schema/snapshot.js +3 -8
- package/dist/cli/commands/users/create.js +3 -5
- package/dist/cli/commands/users/passwd.js +2 -5
- package/dist/cli/index.js +1 -2
- package/dist/cli/load-extensions.js +3 -6
- package/dist/cli/utils/create-db-connection.js +7 -12
- package/dist/cli/utils/create-env/index.js +2 -6
- package/dist/cli/utils/drivers.js +1 -3
- package/dist/controllers/access.js +15 -30
- package/dist/controllers/activity.js +5 -10
- package/dist/controllers/assets.js +67 -62
- package/dist/controllers/auth.js +19 -52
- package/dist/controllers/collections.js +8 -17
- package/dist/controllers/comments.js +15 -30
- package/dist/controllers/dashboards.js +13 -25
- package/dist/controllers/deployment-webhooks.js +6 -12
- package/dist/controllers/deployment.js +39 -90
- package/dist/controllers/extensions.js +53 -98
- package/dist/controllers/fields.js +17 -38
- package/dist/controllers/files.js +31 -68
- package/dist/controllers/flows.js +15 -30
- package/dist/controllers/folders.js +16 -32
- package/dist/controllers/graphql.js +2 -6
- package/dist/controllers/items.js +18 -38
- package/dist/controllers/mcp.js +4 -8
- package/dist/controllers/metrics.js +4 -12
- package/dist/controllers/not-found.js +2 -5
- package/dist/controllers/notifications.js +16 -32
- package/dist/controllers/operations.js +13 -25
- package/dist/controllers/panels.js +13 -25
- package/dist/controllers/permissions.js +18 -35
- package/dist/controllers/policies.js +15 -30
- package/dist/controllers/presets.js +16 -32
- package/dist/controllers/relations.js +12 -24
- package/dist/controllers/revisions.js +2 -3
- package/dist/controllers/roles.js +13 -25
- package/dist/controllers/schema.js +21 -32
- package/dist/controllers/server.js +32 -44
- package/dist/controllers/settings.js +5 -9
- package/dist/controllers/shares.js +20 -40
- package/dist/controllers/translations.js +16 -32
- package/dist/controllers/tus.js +4 -11
- package/dist/controllers/users.js +46 -100
- package/dist/controllers/utils/handle-registry-error.js +26 -0
- package/dist/controllers/utils.js +20 -41
- package/dist/controllers/versions.js +20 -41
- package/dist/database/errors/dialects/mssql.js +8 -21
- package/dist/database/errors/dialects/mysql.js +7 -14
- package/dist/database/errors/dialects/oracle.js +3 -6
- package/dist/database/errors/dialects/postgres.js +8 -18
- package/dist/database/errors/dialects/sqlite.js +16 -21
- package/dist/database/errors/translate.js +1 -2
- package/dist/database/get-ast-from-query/get-ast-from-query.js +4 -12
- package/dist/database/get-ast-from-query/lib/convert-wildcards.js +15 -29
- package/dist/database/get-ast-from-query/lib/parse-fields.js +17 -41
- package/dist/database/get-ast-from-query/utils/get-allowed-sort.js +5 -14
- package/dist/database/get-ast-from-query/utils/get-related-collection.js +2 -6
- package/dist/database/helpers/date/dialects/mysql.js +1 -1
- package/dist/database/helpers/date/dialects/oracle.js +3 -9
- package/dist/database/helpers/date/dialects/sqlite.js +3 -9
- package/dist/database/helpers/date/types.js +1 -3
- package/dist/database/helpers/fn/dialects/mssql.js +4 -12
- package/dist/database/helpers/fn/dialects/mysql.js +5 -14
- package/dist/database/helpers/fn/dialects/oracle.js +4 -12
- package/dist/database/helpers/fn/dialects/postgres.js +5 -14
- package/dist/database/helpers/fn/dialects/sqlite.js +4 -12
- package/dist/database/helpers/fn/json/parse-function.js +9 -27
- package/dist/database/helpers/fn/types.js +1 -3
- package/dist/database/helpers/geometry/dialects/mssql.js +1 -3
- package/dist/database/helpers/geometry/dialects/oracle.js +1 -3
- package/dist/database/helpers/geometry/dialects/postgres.js +1 -2
- package/dist/database/helpers/geometry/dialects/redshift.js +1 -3
- package/dist/database/helpers/geometry/dialects/sqlite.js +1 -2
- package/dist/database/helpers/index.js +1 -2
- package/dist/database/helpers/number/dialects/postgres.js +1 -3
- package/dist/database/helpers/number/utils/decimal-limit.js +2 -4
- package/dist/database/helpers/number/utils/maybe-stringify-big-int.js +1 -3
- package/dist/database/helpers/schema/dialects/cockroachdb.js +8 -15
- package/dist/database/helpers/schema/dialects/mssql.js +8 -15
- package/dist/database/helpers/schema/dialects/mysql.js +8 -14
- package/dist/database/helpers/schema/dialects/oracle.js +13 -28
- package/dist/database/helpers/schema/dialects/postgres.js +6 -10
- package/dist/database/helpers/schema/dialects/sqlite.js +1 -3
- package/dist/database/helpers/schema/types.js +12 -35
- package/dist/database/helpers/schema/utils/prep-query-params.js +4 -7
- package/dist/database/helpers/sequence/types.js +1 -3
- package/dist/database/index.js +41 -79
- package/dist/database/migrations/20201029A-remove-system-relations.js +1 -5
- package/dist/database/migrations/20201029B-remove-system-collections.js +1 -5
- package/dist/database/migrations/20201029C-remove-system-fields.js +1 -5
- package/dist/database/migrations/20201105A-add-cascade-system-relations.js +9 -15
- package/dist/database/migrations/20210225A-add-relations-sort-field.js +4 -6
- package/dist/database/migrations/20210415A-make-filesize-nullable.js +2 -4
- package/dist/database/migrations/20210506A-rename-interfaces.js +13 -20
- package/dist/database/migrations/20210518A-add-foreign-key-constraints.js +7 -18
- package/dist/database/migrations/20210519A-add-system-fk-triggers.js +58 -67
- package/dist/database/migrations/20210626A-change-filesize-bigint.js +2 -8
- package/dist/database/migrations/20210802A-replace-groups.js +7 -9
- package/dist/database/migrations/20210805A-update-groups.js +4 -14
- package/dist/database/migrations/20210805B-change-image-metadata-structure.js +2 -6
- package/dist/database/migrations/20210920A-webhooks-url-not-null.js +2 -6
- package/dist/database/migrations/20210927A-replace-fields-group.js +5 -11
- package/dist/database/migrations/20211007A-update-presets.js +4 -12
- package/dist/database/migrations/20220303A-remove-default-project-color.js +2 -4
- package/dist/database/migrations/20220322A-rename-field-typecast-flags.js +2 -6
- package/dist/database/migrations/20220325A-fix-typecast-flags.js +3 -8
- package/dist/database/migrations/20220402A-remove-default-value-panel-icon.js +2 -4
- package/dist/database/migrations/20220429A-add-flows.js +2 -4
- package/dist/database/migrations/20220801A-update-notifications-timestamp-column.js +2 -4
- package/dist/database/migrations/20230401A-update-material-icons.js +2 -4
- package/dist/database/migrations/20230526A-migrate-translation-strings.js +9 -16
- package/dist/database/migrations/20230721A-require-shares-fields.js +9 -20
- package/dist/database/migrations/20231009A-update-csv-fields-to-text.js +15 -22
- package/dist/database/migrations/20231009B-update-panel-options.js +4 -12
- package/dist/database/migrations/20240204A-marketplace.js +20 -26
- package/dist/database/migrations/20240311A-deprecate-webhooks.js +1 -1
- package/dist/database/migrations/20240716A-update-files-date-fields.js +8 -14
- package/dist/database/migrations/20240806A-permissions-policies.js +17 -39
- package/dist/database/migrations/20240909A-separate-comments.js +14 -17
- package/dist/database/migrations/20240924A-migrate-legacy-comments.js +6 -11
- package/dist/database/migrations/20240924B-populate-versioning-deltas.js +1 -3
- package/dist/database/migrations/20250224A-visual-editor.js +1 -2
- package/dist/database/migrations/20250609A-license-banner.js +1 -2
- package/dist/database/migrations/20250613A-add-project-id.js +2 -5
- package/dist/database/migrations/20251014A-add-project-owner.js +7 -10
- package/dist/database/migrations/20251028A-add-retention-indexes.js +7 -15
- package/dist/database/migrations/20260113A-add-revisions-index.js +7 -15
- package/dist/database/migrations/run.js +23 -50
- package/dist/database/run-ast/lib/apply-query/add-join.js +8 -20
- package/dist/database/run-ast/lib/apply-query/aggregate.js +1 -3
- package/dist/database/run-ast/lib/apply-query/filter/get-filter-type.js +3 -9
- package/dist/database/run-ast/lib/apply-query/filter/index.js +9 -27
- package/dist/database/run-ast/lib/apply-query/filter/operator.js +42 -107
- package/dist/database/run-ast/lib/apply-query/filter/validate-operator.js +3 -9
- package/dist/database/run-ast/lib/apply-query/get-filter-path.js +2 -6
- package/dist/database/run-ast/lib/apply-query/get-operation.js +9 -14
- package/dist/database/run-ast/lib/apply-query/index.js +20 -39
- package/dist/database/run-ast/lib/apply-query/join-filter-with-cases.js +3 -7
- package/dist/database/run-ast/lib/apply-query/pagination.js +2 -6
- package/dist/database/run-ast/lib/apply-query/search.js +17 -41
- package/dist/database/run-ast/lib/apply-query/sort.js +16 -30
- package/dist/database/run-ast/lib/get-db-query.js +7 -15
- package/dist/database/run-ast/lib/parse-current-level.js +10 -23
- package/dist/database/run-ast/modules/fetch-permitted-ast-root-fields.js +10 -14
- package/dist/database/run-ast/run-ast.js +30 -52
- package/dist/database/run-ast/utils/apply-case-when.js +1 -3
- package/dist/database/run-ast/utils/apply-function-to-column-name.js +2 -6
- package/dist/database/run-ast/utils/apply-parent-filters.js +14 -19
- package/dist/database/run-ast/utils/generate-alias.js +9 -14
- package/dist/database/run-ast/utils/get-column-pre-processor.js +14 -26
- package/dist/database/run-ast/utils/get-column.js +5 -14
- package/dist/database/run-ast/utils/get-inner-query-column-pre-processor.js +1 -3
- package/dist/database/run-ast/utils/merge-with-parent-items.js +31 -63
- package/dist/database/run-ast/utils/remove-temporary-fields.js +15 -29
- package/dist/database/run-ast/utils/with-preprocess-bindings.js +2 -6
- package/dist/database/seeds/run.js +19 -45
- package/dist/deployment/deployment.js +2 -8
- package/dist/deployment/drivers/netlify.js +43 -88
- package/dist/deployment/drivers/vercel.js +34 -72
- package/dist/deployment.js +8 -14
- package/dist/emitter.js +14 -21
- package/dist/extensions/index.js +1 -3
- package/dist/extensions/lib/get-extensions-path.js +1 -3
- package/dist/extensions/lib/get-extensions-settings.js +26 -42
- package/dist/extensions/lib/get-extensions.js +3 -7
- package/dist/extensions/lib/get-shared-deps-mapping.js +3 -7
- package/dist/extensions/lib/installation/index.js +1 -3
- package/dist/extensions/lib/installation/manager.js +12 -26
- package/dist/extensions/lib/sandbox/generate-host-function-reference.js +2 -5
- package/dist/extensions/lib/sandbox/register/call-reference.js +1 -1
- package/dist/extensions/lib/sandbox/register/filter.js +1 -2
- package/dist/extensions/lib/sandbox/register/operation.js +1 -2
- package/dist/extensions/lib/sandbox/register/route.js +2 -4
- package/dist/extensions/lib/sandbox/sdk/generators/log.js +1 -1
- package/dist/extensions/lib/sandbox/sdk/generators/request.js +13 -28
- package/dist/extensions/lib/sandbox/sdk/generators/sleep.js +2 -3
- package/dist/extensions/lib/sandbox/sdk/utils/wrap.js +4 -9
- package/dist/extensions/lib/sync/status.js +4 -11
- package/dist/extensions/lib/sync/sync.js +8 -14
- package/dist/extensions/lib/sync/tracker.js +7 -10
- package/dist/extensions/lib/sync/utils.js +5 -9
- package/dist/extensions/manager.js +62 -110
- package/dist/flows.js +237 -277
- package/dist/lock/lib/use-lock.js +3 -7
- package/dist/logger/index.js +37 -57
- package/dist/logger/redact-query.js +1 -3
- package/dist/mailer.js +12 -18
- package/dist/metrics/lib/create-metrics.js +69 -117
- package/dist/metrics/lib/use-metrics.js +3 -8
- package/dist/middleware/authenticate.js +1 -3
- package/dist/middleware/cache.js +5 -8
- package/dist/middleware/collection-exists.js +3 -8
- package/dist/middleware/cors.js +8 -10
- package/dist/middleware/error-handler.js +10 -21
- package/dist/middleware/extract-token.js +3 -9
- package/dist/middleware/graphql.js +16 -27
- package/dist/middleware/rate-limiter-global.js +1 -3
- package/dist/middleware/rate-limiter-ip.js +9 -11
- package/dist/middleware/rate-limiter-registration.js +9 -11
- package/dist/middleware/request-counter.js +8 -15
- package/dist/middleware/respond.js +8 -16
- package/dist/middleware/validate-batch.js +5 -15
- package/dist/operations/condition/index.js +4 -10
- package/dist/operations/exec/index.js +1 -2
- package/dist/operations/item-create/index.js +18 -26
- package/dist/operations/item-delete/index.js +21 -31
- package/dist/operations/item-read/index.js +21 -31
- package/dist/operations/item-update/index.js +23 -36
- package/dist/operations/log/index.js +1 -2
- package/dist/operations/mail/index.js +5 -8
- package/dist/operations/mail/rate-limiter.js +6 -10
- package/dist/operations/notification/index.js +13 -19
- package/dist/operations/request/index.js +8 -13
- package/dist/operations/throw-error/index.js +1 -2
- package/dist/operations/trigger/index.js +4 -8
- package/dist/packages/types/dist/index.js +219 -231
- package/dist/permissions/cache.js +2 -3
- package/dist/permissions/lib/fetch-permissions.js +1 -3
- package/dist/permissions/lib/fetch-policies.js +5 -10
- package/dist/permissions/modules/fetch-accountability-collection-access/fetch-accountability-collection-access.js +19 -32
- package/dist/permissions/modules/fetch-allowed-collections/fetch-allowed-collections.js +7 -12
- package/dist/permissions/modules/fetch-allowed-field-map/fetch-allowed-field-map.js +8 -17
- package/dist/permissions/modules/fetch-global-access/fetch-global-access.js +1 -1
- package/dist/permissions/modules/fetch-inconsistent-field-map/fetch-inconsistent-field-map.js +6 -10
- package/dist/permissions/modules/fetch-policies-ip-access/fetch-policies-ip-access.js +9 -15
- package/dist/permissions/modules/process-ast/lib/extract-fields-from-children.js +2 -8
- package/dist/permissions/modules/process-ast/lib/extract-fields-from-query.js +32 -34
- package/dist/permissions/modules/process-ast/lib/field-map-from-ast.js +2 -2
- package/dist/permissions/modules/process-ast/lib/get-cases.js +3 -8
- package/dist/permissions/modules/process-ast/lib/inject-cases.js +6 -19
- package/dist/permissions/modules/process-ast/process-ast.js +4 -12
- package/dist/permissions/modules/process-ast/utils/collections-in-field-map.js +2 -4
- package/dist/permissions/modules/process-ast/utils/dedupe-access.js +6 -10
- package/dist/permissions/modules/process-ast/utils/extract-paths-from-query.js +9 -25
- package/dist/permissions/modules/process-ast/utils/find-related-collection.js +1 -3
- package/dist/permissions/modules/process-ast/utils/flatten-filter.js +7 -10
- package/dist/permissions/modules/process-ast/utils/get-info-for-path.js +4 -6
- package/dist/permissions/modules/process-ast/utils/validate-path/create-error.js +1 -2
- package/dist/permissions/modules/process-ast/utils/validate-path/validate-path-existence.js +3 -8
- package/dist/permissions/modules/process-ast/utils/validate-path/validate-path-permissions.js +5 -13
- package/dist/permissions/modules/process-payload/lib/is-field-nullable.js +1 -2
- package/dist/permissions/modules/process-payload/process-payload.js +6 -15
- package/dist/permissions/modules/validate-access/lib/validate-collection-access.js +2 -3
- package/dist/permissions/modules/validate-access/lib/validate-item-access.js +14 -28
- package/dist/permissions/modules/validate-access/validate-access.js +5 -15
- package/dist/permissions/modules/validate-remaining-admin/validate-remaining-admin-count.js +1 -3
- package/dist/permissions/utils/extract-required-dynamic-variable-context.js +10 -15
- package/dist/permissions/utils/fetch-dynamic-variable-data.js +17 -35
- package/dist/permissions/utils/fetch-raw-permissions.js +3 -9
- package/dist/permissions/utils/fetch-share-info.js +1 -2
- package/dist/permissions/utils/filter-policies-by-ip.js +2 -6
- package/dist/permissions/utils/get-permissions-for-share.js +22 -47
- package/dist/permissions/utils/get-unaliased-field-key.js +2 -5
- package/dist/permissions/utils/merge-permissions.js +13 -36
- package/dist/permissions/utils/with-cache.js +1 -3
- package/dist/rate-limiter.js +2 -7
- package/dist/redis/lib/create-redis.js +1 -2
- package/dist/redis/lib/use-redis.js +1 -1
- package/dist/redis/utils/redis-config-available.js +1 -3
- package/dist/request/agent-with-ip-validation.js +3 -7
- package/dist/request/is-denied-ip.js +1 -3
- package/dist/schedules/metrics.js +4 -11
- package/dist/schedules/retention.js +17 -33
- package/dist/schedules/telemetry.js +1 -2
- package/dist/schedules/tus.js +5 -7
- package/dist/server.js +12 -24
- package/dist/services/access.js +1 -3
- package/dist/services/assets/name-deduper.js +2 -6
- package/dist/services/assets.js +43 -79
- package/dist/services/authentication.js +63 -96
- package/dist/services/collections.js +108 -218
- package/dist/services/comments.js +18 -32
- package/dist/services/deployment-projects.js +17 -31
- package/dist/services/deployment.js +63 -106
- package/dist/services/extensions.js +25 -63
- package/dist/services/fields/build-collection-and-field-relations.js +8 -14
- package/dist/services/fields/get-collection-meta-updates.js +4 -12
- package/dist/services/fields/get-collection-relation-list.js +2 -4
- package/dist/services/fields.js +162 -314
- package/dist/services/files/lib/extract-metadata.js +7 -20
- package/dist/services/files/utils/get-metadata.js +31 -64
- package/dist/services/files/utils/parse-image-metadata.js +7 -19
- package/dist/services/files.js +102 -173
- package/dist/services/flows.js +3 -6
- package/dist/services/folders.js +13 -17
- package/dist/services/graphql/errors/format.js +2 -2
- package/dist/services/graphql/index.js +4 -13
- package/dist/services/graphql/resolvers/get-collection-type.js +1 -3
- package/dist/services/graphql/resolvers/get-field-type.js +1 -3
- package/dist/services/graphql/resolvers/get-relation-type.js +1 -3
- package/dist/services/graphql/resolvers/mutation.js +6 -14
- package/dist/services/graphql/resolvers/query.js +3 -10
- package/dist/services/graphql/resolvers/system-admin.js +13 -27
- package/dist/services/graphql/resolvers/system-global.js +31 -71
- package/dist/services/graphql/resolvers/system.js +209 -245
- package/dist/services/graphql/schema/get-types.js +69 -101
- package/dist/services/graphql/schema/index.js +74 -92
- package/dist/services/graphql/schema/parse-args.js +1 -2
- package/dist/services/graphql/schema/parse-query.js +8 -21
- package/dist/services/graphql/schema/read.js +83 -106
- package/dist/services/graphql/schema/write.js +36 -41
- package/dist/services/graphql/subscription.js +30 -51
- package/dist/services/graphql/types/bigint.js +5 -15
- package/dist/services/graphql/types/string-or-float.js +2 -6
- package/dist/services/graphql/utils/add-path-to-validation-error.js +1 -3
- package/dist/services/graphql/utils/aggregate-query.js +2 -6
- package/dist/services/graphql/utils/dedupe-resolvers.js +8 -13
- package/dist/services/graphql/utils/filter-replace-m2a.js +9 -18
- package/dist/services/graphql/utils/process-error.js +21 -31
- package/dist/services/graphql/utils/replace-fragments.js +2 -5
- package/dist/services/graphql/utils/replace-funcs.js +2 -5
- package/dist/services/graphql/utils/sanitize-gql-schema.js +10 -21
- package/dist/services/import-export.js +68 -143
- package/dist/services/items.js +126 -271
- package/dist/services/mail/index.js +13 -26
- package/dist/services/mail/rate-limiter.js +6 -10
- package/dist/services/meta.js +4 -9
- package/dist/services/notifications.js +2 -3
- package/dist/services/operations.js +3 -6
- package/dist/services/payload.js +188 -316
- package/dist/services/permissions.js +14 -26
- package/dist/services/policies.js +7 -18
- package/dist/services/relations.js +82 -181
- package/dist/services/revisions.js +8 -15
- package/dist/services/roles.js +4 -12
- package/dist/services/schema.js +5 -10
- package/dist/services/server.js +31 -66
- package/dist/services/shares.js +25 -35
- package/dist/services/specifications.js +87 -139
- package/dist/services/tfa.js +8 -24
- package/dist/services/translations.js +6 -12
- package/dist/services/tus/data-store.js +23 -55
- package/dist/services/tus/lockers.js +4 -10
- package/dist/services/tus/server.js +2 -5
- package/dist/services/users.js +79 -153
- package/dist/services/utils.js +12 -31
- package/dist/services/versions.js +78 -121
- package/dist/services/websocket.js +8 -12
- package/dist/storage/get-storage-driver.js +2 -5
- package/dist/storage/register-drivers.js +1 -3
- package/dist/storage/register-locations.js +2 -4
- package/dist/synchronization.js +6 -17
- package/dist/telemetry/counter/use-buffered-counter.js +6 -22
- package/dist/telemetry/counter/use-counters.js +2 -6
- package/dist/telemetry/lib/send-report.js +2 -6
- package/dist/telemetry/lib/track.js +3 -8
- package/dist/telemetry/utils/check-user-limits.js +3 -9
- package/dist/telemetry/utils/format-api-request-counts.js +1 -3
- package/dist/telemetry/utils/get-extension-count.js +3 -8
- package/dist/telemetry/utils/get-item-count.js +2 -5
- package/dist/telemetry/utils/get-settings.js +2 -3
- package/dist/telemetry/utils/get-user-item-count.js +2 -4
- package/dist/telemetry/utils/should-check-user-limits.js +1 -3
- package/dist/types/index.js +0 -6
- package/dist/utils/apply-diff.js +111 -143
- package/dist/utils/apply-snapshot.js +1 -2
- package/dist/utils/calculate-field-depth.js +6 -19
- package/dist/utils/construct-flow-tree.js +5 -12
- package/dist/utils/create-admin.js +1 -2
- package/dist/utils/deep-map-response.js +31 -35
- package/dist/utils/encrypt.js +2 -3
- package/dist/utils/fetch-user-count/fetch-access-lookup.js +5 -15
- package/dist/utils/fetch-user-count/get-user-count-query.js +4 -12
- package/dist/utils/filter-items.js +9 -14
- package/dist/utils/freeze-schema.js +3 -8
- package/dist/utils/generate-translations.js +87 -137
- package/dist/utils/get-accountability-for-role.js +12 -17
- package/dist/utils/get-accountability-for-token.js +25 -31
- package/dist/utils/get-address.js +2 -7
- package/dist/utils/get-allowed-log-levels.js +1 -3
- package/dist/utils/get-auth-providers.js +12 -14
- package/dist/utils/get-cache-headers.js +2 -4
- package/dist/utils/get-cache-key.js +16 -4
- package/dist/utils/get-collection-from-alias.js +1 -6
- package/dist/utils/get-column-path.js +10 -21
- package/dist/utils/get-config-from-env.js +6 -15
- package/dist/utils/get-default-index-name.js +2 -4
- package/dist/utils/get-default-value.js +5 -9
- package/dist/utils/get-field-relational-depth.js +2 -5
- package/dist/utils/get-graphql-query-and-variables.js +1 -2
- package/dist/utils/get-graphql-type.js +1 -3
- package/dist/utils/get-ip-from-req.js +6 -15
- package/dist/utils/get-local-type.js +5 -13
- package/dist/utils/get-milliseconds.js +1 -3
- package/dist/utils/get-module-default.js +1 -3
- package/dist/utils/get-schema.js +9 -21
- package/dist/utils/get-secret.js +2 -6
- package/dist/utils/get-snapshot-diff.js +15 -23
- package/dist/utils/get-snapshot.js +6 -17
- package/dist/utils/is-directus-jwt.js +1 -2
- package/dist/utils/is-field-allowed.js +1 -3
- package/dist/utils/jwt.js +7 -13
- package/dist/utils/md.js +1 -2
- package/dist/utils/parse-filter-key.js +2 -4
- package/dist/utils/parse-numeric-string.js +5 -11
- package/dist/utils/permissions-cacheable.js +9 -22
- package/dist/utils/redact-object.js +27 -57
- package/dist/utils/reduce-schema.js +8 -25
- package/dist/utils/sanitize-query.js +46 -98
- package/dist/utils/sanitize-schema.js +2 -3
- package/dist/utils/schedule.js +2 -6
- package/dist/utils/should-clear-cache.js +2 -6
- package/dist/utils/should-skip-cache.js +3 -8
- package/dist/utils/split-fields.js +4 -12
- package/dist/utils/stall.js +1 -3
- package/dist/utils/store.js +2 -5
- package/dist/utils/transaction.js +29 -58
- package/dist/utils/transformations.js +28 -43
- package/dist/utils/translations-shared.js +4 -12
- package/dist/utils/url.js +3 -10
- package/dist/utils/user-name.js +4 -12
- package/dist/utils/validate-diff.js +17 -38
- package/dist/utils/validate-env.js +3 -5
- package/dist/utils/validate-keys.js +4 -10
- package/dist/utils/validate-query.js +67 -118
- package/dist/utils/validate-snapshot.js +3 -9
- package/dist/utils/validate-storage.js +12 -19
- package/dist/utils/validate-user-count-integrity.js +3 -9
- package/dist/utils/verify-session-jwt.js +2 -6
- package/dist/utils/versioning/handle-version.js +10 -29
- package/dist/utils/versioning/merge-version-data.js +1 -5
- package/dist/utils/versioning/split-recursive.js +6 -3
- package/dist/websocket/authenticate.js +7 -18
- package/dist/websocket/collab/calculate-cache-metadata.js +33 -51
- package/dist/websocket/collab/collab.js +49 -113
- package/dist/websocket/collab/filter-to-fields.js +2 -5
- package/dist/websocket/collab/messenger.js +48 -73
- package/dist/websocket/collab/payload-permissions.js +20 -51
- package/dist/websocket/collab/permissions-cache.js +17 -46
- package/dist/websocket/collab/room.js +57 -124
- package/dist/websocket/collab/verify-permissions.js +37 -48
- package/dist/websocket/controllers/base.js +34 -61
- package/dist/websocket/controllers/graphql.js +11 -18
- package/dist/websocket/controllers/index.js +3 -12
- package/dist/websocket/controllers/logs.js +3 -7
- package/dist/websocket/errors.js +2 -5
- package/dist/websocket/handlers/heartbeat.js +11 -19
- package/dist/websocket/handlers/index.js +5 -15
- package/dist/websocket/handlers/items.js +15 -26
- package/dist/websocket/handlers/logs.js +24 -41
- package/dist/websocket/handlers/subscribe.js +37 -66
- package/dist/websocket/utils/get-expires-at-for-token.js +1 -3
- package/dist/websocket/utils/items.js +10 -27
- package/dist/websocket/utils/message.js +6 -10
- package/package.json +28 -29
- package/dist/__utils__/items-utils.js +0 -32
- package/dist/__utils__/schemas.js +0 -297
- package/dist/__utils__/snapshots.js +0 -899
- package/dist/database/run-ast/lib/apply-query/mock.js +0 -9
- package/dist/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.js +0 -445
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/index.js +0 -176
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/system/policy.js +0 -54
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/any/any.js +0 -13
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/any/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/argument/argument.js +0 -15
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/argument/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/array/array.js +0 -16
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/array/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/async-iterator/async-iterator.js +0 -16
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/async-iterator/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/awaited/awaited.js +0 -37
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/awaited/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/bigint/bigint.js +0 -16
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/bigint/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/boolean/boolean.js +0 -16
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/boolean/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/clone/index.js +0 -4
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/clone/type.js +0 -17
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/clone/value.js +0 -35
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/composite/composite.js +0 -42
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/composite/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/computed/computed.js +0 -16
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/computed/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/const/const.js +0 -52
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/const/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/constructor/constructor.js +0 -17
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/constructor/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/constructor-parameters/constructor-parameters.js +0 -14
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/constructor-parameters/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/create/immutable.js +0 -32
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/create/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/create/type.js +0 -20
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/date/date.js +0 -15
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/date/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/discard/discard.js +0 -12
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/discard/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/enum/enum.js +0 -23
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/enum/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/error/error.js +0 -10
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/error/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/exclude/exclude-from-mapped-result.js +0 -20
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/exclude/exclude-from-template-literal.js +0 -11
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/exclude/exclude.js +0 -25
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/exclude/index.js +0 -5
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/extends/extends-check.js +0 -267
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/extends/extends-from-mapped-key.js +0 -29
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/extends/extends-from-mapped-result.js +0 -21
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/extends/extends-undefined.js +0 -21
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/extends/extends.js +0 -20
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/extends/index.js +0 -7
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/extract/extract-from-mapped-result.js +0 -20
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/extract/extract-from-template-literal.js +0 -11
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/extract/extract.js +0 -25
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/extract/index.js +0 -5
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/function/function.js +0 -17
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/function/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/guard/index.js +0 -5
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/guard/kind.js +0 -204
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/guard/type.js +0 -293
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/guard/value.js +0 -68
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/helpers/helpers.js +0 -8
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/helpers/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/indexed/index.js +0 -6
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-from-mapped-key.js +0 -27
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-from-mapped-result.js +0 -24
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-property-keys.js +0 -24
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/indexed/indexed.js +0 -67
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/instance-type/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/instance-type/instance-type.js +0 -13
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/instantiate/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/instantiate/instantiate.js +0 -102
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/integer/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/integer/integer.js +0 -15
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/intersect/index.js +0 -5
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/intersect/intersect-create.js +0 -23
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/intersect/intersect-evaluated.js +0 -35
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/intersect/intersect-type.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/intersect/intersect.js +0 -17
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/intrinsic/capitalize.js +0 -10
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/intrinsic/index.js +0 -8
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/intrinsic/intrinsic-from-mapped-key.js +0 -30
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/intrinsic/intrinsic.js +0 -54
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/intrinsic/lowercase.js +0 -10
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/intrinsic/uncapitalize.js +0 -10
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/intrinsic/uppercase.js +0 -10
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/iterator/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/iterator/iterator.js +0 -16
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/keyof/index.js +0 -6
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/keyof/keyof-from-mapped-result.js +0 -21
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/keyof/keyof-property-entries.js +0 -17
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/keyof/keyof-property-keys.js +0 -52
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/keyof/keyof.js +0 -38
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/literal/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/literal/literal.js +0 -16
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/mapped/index.js +0 -5
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/mapped/mapped-key.js +0 -14
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/mapped/mapped-result.js +0 -14
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/mapped/mapped.js +0 -86
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/module/compute.js +0 -144
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/module/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/module/module.js +0 -44
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/never/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/never/never.js +0 -15
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/not/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/not/not.js +0 -15
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/null/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/null/null.js +0 -15
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/number/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/number/number.js +0 -15
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/object/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/object/object.js +0 -33
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/omit/index.js +0 -5
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/omit/omit-from-mapped-key.js +0 -27
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/omit/omit-from-mapped-result.js +0 -21
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/omit/omit.js +0 -65
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/optional/index.js +0 -4
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/optional/optional-from-mapped-result.js +0 -20
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/optional/optional.js +0 -29
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/parameters/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/parameters/parameters.js +0 -14
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/partial/index.js +0 -4
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/partial/partial-from-mapped-result.js +0 -21
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/partial/partial.js +0 -62
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/patterns/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/patterns/patterns.js +0 -12
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/pick/index.js +0 -5
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/pick/pick-from-mapped-key.js +0 -27
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/pick/pick-from-mapped-result.js +0 -21
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/pick/pick.js +0 -63
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/promise/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/promise/promise.js +0 -16
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/readonly/index.js +0 -4
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/readonly/readonly-from-mapped-result.js +0 -20
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/readonly/readonly.js +0 -29
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/readonly-optional/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/readonly-optional/readonly-optional.js +0 -13
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/record/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/record/record.js +0 -92
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/recursive/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/recursive/recursive.js +0 -24
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/ref/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/ref/ref.js +0 -19
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/regexp/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/regexp/regexp.js +0 -19
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/registry/format.js +0 -30
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/registry/index.js +0 -4
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/registry/type.js +0 -30
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/required/index.js +0 -4
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/required/required-from-mapped-result.js +0 -20
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/required/required.js +0 -60
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/rest/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/rest/rest.js +0 -13
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/return-type/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/return-type/return-type.js +0 -13
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/schema/anyschema.js +0 -1
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/schema/index.js +0 -4
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/schema/schema.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/sets/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/sets/set.js +0 -42
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/static/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/static/static.js +0 -1
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/string/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/string/string.js +0 -15
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/symbol/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/symbol/symbol.js +0 -15
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/symbols/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/symbols/symbols.js +0 -14
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/template-literal/finite.js +0 -28
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/template-literal/generate.js +0 -37
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/template-literal/index.js +0 -9
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/template-literal/parse.js +0 -125
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/template-literal/pattern.js +0 -24
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/template-literal/syntax.js +0 -55
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/template-literal/template-literal.js +0 -20
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/template-literal/union.js +0 -16
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/transform/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/transform/transform.js +0 -51
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/tuple/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/tuple/tuple.js +0 -24
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/type/index.js +0 -10
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/type/javascript.js +0 -123
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/type/json.js +0 -263
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/type/type.js +0 -191
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/uint8array/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/uint8array/uint8array.js +0 -15
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/undefined/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/undefined/undefined.js +0 -15
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/union/index.js +0 -5
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/union/union-create.js +0 -14
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/union/union-evaluated.js +0 -33
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/union/union-type.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/union/union.js +0 -13
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/unknown/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/unknown/unknown.js +0 -12
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/unsafe/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/unsafe/unsafe.js +0 -12
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/void/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/void/void.js +0 -15
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/value/guard/guard.js +0 -140
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/value/guard/index.js +0 -3
- package/dist/node_modules/.pnpm/@vitest_expect@3.2.4/node_modules/@vitest/expect/dist/index.js +0 -1714
- package/dist/node_modules/.pnpm/@vitest_pretty-format@3.2.4/node_modules/@vitest/pretty-format/dist/index.js +0 -1287
- package/dist/node_modules/.pnpm/@vitest_runner@3.2.4/node_modules/@vitest/runner/dist/chunk-hooks.js +0 -2151
- package/dist/node_modules/.pnpm/@vitest_runner@3.2.4/node_modules/@vitest/runner/dist/index.js +0 -8
- package/dist/node_modules/.pnpm/@vitest_runner@3.2.4/node_modules/@vitest/runner/dist/utils.js +0 -8
- package/dist/node_modules/.pnpm/@vitest_snapshot@3.2.4/node_modules/@vitest/snapshot/dist/index.js +0 -2082
- package/dist/node_modules/.pnpm/@vitest_spy@3.2.4/node_modules/@vitest/spy/dist/index.js +0 -192
- package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/chunk-_commonjsHelpers.js +0 -158
- package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/diff.js +0 -1535
- package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/error.js +0 -155
- package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/helpers.js +0 -244
- package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/index.js +0 -621
- package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/source-map.js +0 -890
- package/dist/node_modules/.pnpm/chai@5.3.3/node_modules/chai/index.js +0 -3558
- package/dist/node_modules/.pnpm/expect-type@1.2.2/node_modules/expect-type/dist/branding.js +0 -13
- package/dist/node_modules/.pnpm/expect-type@1.2.2/node_modules/expect-type/dist/index.js +0 -115
- package/dist/node_modules/.pnpm/expect-type@1.2.2/node_modules/expect-type/dist/messages.js +0 -77
- package/dist/node_modules/.pnpm/expect-type@1.2.2/node_modules/expect-type/dist/overloads.js +0 -13
- package/dist/node_modules/.pnpm/expect-type@1.2.2/node_modules/expect-type/dist/utils.js +0 -30
- package/dist/node_modules/.pnpm/js-tokens@9.0.1/node_modules/js-tokens/index.js +0 -398
- package/dist/node_modules/.pnpm/knex-mock-client@3.0.2_knex@3.1.0_mysql2@3.15.3_pg@8.16.3_sqlite3@5.1.7_tedious@18.6.1_/node_modules/knex-mock-client/dist/MockClient.js +0 -79
- package/dist/node_modules/.pnpm/knex-mock-client@3.0.2_knex@3.1.0_mysql2@3.15.3_pg@8.16.3_sqlite3@5.1.7_tedious@18.6.1_/node_modules/knex-mock-client/dist/MockConnection.js +0 -64
- package/dist/node_modules/.pnpm/knex-mock-client@3.0.2_knex@3.1.0_mysql2@3.15.3_pg@8.16.3_sqlite3@5.1.7_tedious@18.6.1_/node_modules/knex-mock-client/dist/Tracker.js +0 -185
- package/dist/node_modules/.pnpm/knex-mock-client@3.0.2_knex@3.1.0_mysql2@3.15.3_pg@8.16.3_sqlite3@5.1.7_tedious@18.6.1_/node_modules/knex-mock-client/dist/constants.js +0 -30
- package/dist/node_modules/.pnpm/knex-mock-client@3.0.2_knex@3.1.0_mysql2@3.15.3_pg@8.16.3_sqlite3@5.1.7_tedious@18.6.1_/node_modules/knex-mock-client/dist/index.js +0 -37
- package/dist/node_modules/.pnpm/knex-mock-client@3.0.2_knex@3.1.0_mysql2@3.15.3_pg@8.16.3_sqlite3@5.1.7_tedious@18.6.1_/node_modules/knex-mock-client/dist/utils.js +0 -17
- package/dist/node_modules/.pnpm/lodash.clonedeep@4.5.0/node_modules/lodash.clonedeep/index.js +0 -1486
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/arguments.js +0 -11
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/array.js +0 -18
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/bigint.js +0 -11
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/class.js +0 -19
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/date.js +0 -15
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/error.js +0 -39
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/function.js +0 -14
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/helpers.js +0 -141
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/html.js +0 -43
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/index.js +0 -138
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/map.js +0 -25
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/number.js +0 -22
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/object.js +0 -27
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/promise.js +0 -6
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/regexp.js +0 -12
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/set.js +0 -18
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/string.js +0 -27
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/symbol.js +0 -10
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/typedarray.js +0 -36
- package/dist/node_modules/.pnpm/magic-string@0.30.21/node_modules/magic-string/dist/magic-string.es.js +0 -1258
- package/dist/node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/index.js +0 -21
- package/dist/node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.js +0 -478
- package/dist/node_modules/.pnpm/strip-literal@3.1.0/node_modules/strip-literal/dist/index.js +0 -84
- package/dist/node_modules/.pnpm/tinyrainbow@2.0.0/node_modules/tinyrainbow/dist/chunk-BVHSVHOK.js +0 -85
- package/dist/node_modules/.pnpm/tinyrainbow@2.0.0/node_modules/tinyrainbow/dist/node.js +0 -15
- package/dist/node_modules/.pnpm/tinyspy@4.0.4/node_modules/tinyspy/dist/index.js +0 -158
- package/dist/node_modules/.pnpm/vitest@3.2.4_@types_node@22.13.14_@vitest_ui@3.2.4_happy-dom@20.8.9_jiti@2.6.1_jsdom@20_c24d183060b6f93f55300b66d0779768/node_modules/vitest/dist/chunks/_commonjsHelpers.BFTU3MAI.js +0 -8
- package/dist/node_modules/.pnpm/vitest@3.2.4_@types_node@22.13.14_@vitest_ui@3.2.4_happy-dom@20.8.9_jiti@2.6.1_jsdom@20_c24d183060b6f93f55300b66d0779768/node_modules/vitest/dist/chunks/benchmark.CYdenmiT.js +0 -41
- package/dist/node_modules/.pnpm/vitest@3.2.4_@types_node@22.13.14_@vitest_ui@3.2.4_happy-dom@20.8.9_jiti@2.6.1_jsdom@20_c24d183060b6f93f55300b66d0779768/node_modules/vitest/dist/chunks/date.Bq6ZW5rf.js +0 -50
- package/dist/node_modules/.pnpm/vitest@3.2.4_@types_node@22.13.14_@vitest_ui@3.2.4_happy-dom@20.8.9_jiti@2.6.1_jsdom@20_c24d183060b6f93f55300b66d0779768/node_modules/vitest/dist/chunks/index.CdQS2e2Q.js +0 -38
- package/dist/node_modules/.pnpm/vitest@3.2.4_@types_node@22.13.14_@vitest_ui@3.2.4_happy-dom@20.8.9_jiti@2.6.1_jsdom@20_c24d183060b6f93f55300b66d0779768/node_modules/vitest/dist/chunks/utils.XdZDrNZV.js +0 -66
- package/dist/node_modules/.pnpm/vitest@3.2.4_@types_node@22.13.14_@vitest_ui@3.2.4_happy-dom@20.8.9_jiti@2.6.1_jsdom@20_c24d183060b6f93f55300b66d0779768/node_modules/vitest/dist/chunks/vi.bdSIJ99Y.js +0 -2986
- package/dist/node_modules/.pnpm/vitest@3.2.4_@types_node@22.13.14_@vitest_ui@3.2.4_happy-dom@20.8.9_jiti@2.6.1_jsdom@20_c24d183060b6f93f55300b66d0779768/node_modules/vitest/dist/index.js +0 -24
- package/dist/test-utils/cache.js +0 -64
- package/dist/test-utils/controllers.js +0 -101
- package/dist/test-utils/database.js +0 -54
- package/dist/test-utils/emitter.js +0 -38
- package/dist/test-utils/env.js +0 -77
- package/dist/test-utils/knex.js +0 -222
- package/dist/test-utils/schema.js +0 -35
- package/dist/test-utils/services/fields-service.js +0 -38
- package/dist/test-utils/services/files-service.js +0 -35
- package/dist/test-utils/services/folders-service.js +0 -34
- package/dist/test-utils/services/items-service.js +0 -52
- package/dist/test-utils/storage.js +0 -150
- package/dist/utils/job-queue.js +0 -29
package/dist/services/fields.js
CHANGED
|
@@ -64,35 +64,25 @@ var FieldsService = class FieldsService {
|
|
|
64
64
|
async columnInfo(collection, field) {
|
|
65
65
|
const schemaCacheIsEnabled = Boolean(env["CACHE_SCHEMA"]);
|
|
66
66
|
let columnInfo = null;
|
|
67
|
-
if (schemaCacheIsEnabled)
|
|
68
|
-
columnInfo = await getCacheValue(this.schemaCache, "columnInfo");
|
|
69
|
-
}
|
|
67
|
+
if (schemaCacheIsEnabled) columnInfo = await getCacheValue(this.schemaCache, "columnInfo");
|
|
70
68
|
if (!columnInfo) {
|
|
71
69
|
columnInfo = await this.schemaInspector.columnInfo();
|
|
72
|
-
if (schemaCacheIsEnabled)
|
|
73
|
-
await setCacheValue(this.schemaCache, "columnInfo", columnInfo);
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
if (collection) {
|
|
77
|
-
columnInfo = columnInfo.filter((column) => column.table === collection);
|
|
78
|
-
}
|
|
79
|
-
if (field) {
|
|
80
|
-
return columnInfo.find((column) => column.name === field);
|
|
70
|
+
if (schemaCacheIsEnabled) await setCacheValue(this.schemaCache, "columnInfo", columnInfo);
|
|
81
71
|
}
|
|
72
|
+
if (collection) columnInfo = columnInfo.filter((column) => column.table === collection);
|
|
73
|
+
if (field) return columnInfo.find((column) => column.name === field);
|
|
82
74
|
return columnInfo;
|
|
83
75
|
}
|
|
84
76
|
async readAll(collection) {
|
|
85
77
|
let fields;
|
|
86
|
-
if (this.accountability) {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
});
|
|
95
|
-
}
|
|
78
|
+
if (this.accountability) await validateAccess({
|
|
79
|
+
accountability: this.accountability,
|
|
80
|
+
action: "read",
|
|
81
|
+
collection: "directus_fields"
|
|
82
|
+
}, {
|
|
83
|
+
schema: this.schema,
|
|
84
|
+
knex: this.knex
|
|
85
|
+
});
|
|
96
86
|
const nonAuthorizedItemsService = new ItemsService("directus_fields", {
|
|
97
87
|
knex: this.knex,
|
|
98
88
|
schema: this.schema
|
|
@@ -107,51 +97,41 @@ var FieldsService = class FieldsService {
|
|
|
107
97
|
fields = await nonAuthorizedItemsService.readByQuery({ limit: -1 });
|
|
108
98
|
fields.push(...systemFieldRows$1);
|
|
109
99
|
}
|
|
110
|
-
const
|
|
100
|
+
const columnsWithSystem = (await this.columnInfo(collection)).map((column) => ({
|
|
111
101
|
...column,
|
|
112
102
|
default_value: getDefaultValue(column, fields.find((field) => field.collection === column.table && field.field === column.name))
|
|
113
|
-
}))
|
|
114
|
-
const columnsWithSystem = columns.map((column) => {
|
|
103
|
+
})).map((column) => {
|
|
115
104
|
const field = fields.find((field$1) => {
|
|
116
105
|
return field$1.field === column.name && field$1.collection === column.table;
|
|
117
106
|
});
|
|
118
107
|
const type = getLocalType(column, field);
|
|
119
|
-
|
|
108
|
+
return {
|
|
120
109
|
collection: column.table,
|
|
121
110
|
field: column.name,
|
|
122
111
|
type,
|
|
123
112
|
schema: column,
|
|
124
113
|
meta: field || null
|
|
125
114
|
};
|
|
126
|
-
return data;
|
|
127
115
|
});
|
|
128
116
|
const aliasQuery = this.knex.select("*").from("directus_fields");
|
|
129
|
-
if (collection)
|
|
130
|
-
aliasQuery.andWhere("collection", collection);
|
|
131
|
-
}
|
|
117
|
+
if (collection) aliasQuery.andWhere("collection", collection);
|
|
132
118
|
let aliasFields = [...await this.payloadService.processValues("read", await aliasQuery)];
|
|
133
|
-
if (collection)
|
|
134
|
-
|
|
135
|
-
} else {
|
|
136
|
-
aliasFields.push(...systemFieldRows$1);
|
|
137
|
-
}
|
|
119
|
+
if (collection) aliasFields.push(...systemFieldRows$1.filter((fieldMeta) => fieldMeta.collection === collection));
|
|
120
|
+
else aliasFields.push(...systemFieldRows$1);
|
|
138
121
|
aliasFields = aliasFields.filter((field) => {
|
|
139
122
|
const specials = toArray(field.special);
|
|
140
|
-
for (const type of ALIAS_TYPES)
|
|
141
|
-
if (specials.includes(type)) return true;
|
|
142
|
-
}
|
|
123
|
+
for (const type of ALIAS_TYPES) if (specials.includes(type)) return true;
|
|
143
124
|
return false;
|
|
144
125
|
});
|
|
145
126
|
const aliasFieldsAsField = aliasFields.map((field) => {
|
|
146
|
-
const type = getLocalType(
|
|
147
|
-
|
|
127
|
+
const type = getLocalType(void 0, field);
|
|
128
|
+
return {
|
|
148
129
|
collection: field.collection,
|
|
149
130
|
field: field.field,
|
|
150
131
|
type,
|
|
151
132
|
schema: null,
|
|
152
133
|
meta: field
|
|
153
134
|
};
|
|
154
|
-
return data;
|
|
155
135
|
});
|
|
156
136
|
const knownCollections = Object.keys(this.schema.collections);
|
|
157
137
|
let result = [...columnsWithSystem, ...aliasFieldsAsField].filter((field) => knownCollections.includes(field.collection));
|
|
@@ -175,16 +155,10 @@ var FieldsService = class FieldsService {
|
|
|
175
155
|
});
|
|
176
156
|
const allowedFieldsInCollection = {};
|
|
177
157
|
permissions.forEach((permission) => {
|
|
178
|
-
if (!allowedFieldsInCollection[permission.collection])
|
|
179
|
-
|
|
180
|
-
}
|
|
181
|
-
for (const field of permission.fields ?? []) {
|
|
182
|
-
allowedFieldsInCollection[permission.collection].add(field);
|
|
183
|
-
}
|
|
158
|
+
if (!allowedFieldsInCollection[permission.collection]) allowedFieldsInCollection[permission.collection] = /* @__PURE__ */ new Set();
|
|
159
|
+
for (const field of permission.fields ?? []) allowedFieldsInCollection[permission.collection].add(field);
|
|
184
160
|
});
|
|
185
|
-
if (collection && collection in allowedFieldsInCollection === false)
|
|
186
|
-
throw new ForbiddenError();
|
|
187
|
-
}
|
|
161
|
+
if (collection && collection in allowedFieldsInCollection === false) throw new ForbiddenError();
|
|
188
162
|
result = result.filter((field) => {
|
|
189
163
|
if (field.collection in allowedFieldsInCollection === false) return false;
|
|
190
164
|
const allowedFields = allowedFieldsInCollection[field.collection];
|
|
@@ -192,9 +166,7 @@ var FieldsService = class FieldsService {
|
|
|
192
166
|
return allowedFields.has(field.field);
|
|
193
167
|
});
|
|
194
168
|
}
|
|
195
|
-
for (const field of result)
|
|
196
|
-
field.type = this.helpers.schema.processFieldType(field);
|
|
197
|
-
}
|
|
169
|
+
for (const field of result) field.type = this.helpers.schema.processFieldType(field);
|
|
198
170
|
return result;
|
|
199
171
|
}
|
|
200
172
|
async readOne(collection, field) {
|
|
@@ -207,13 +179,12 @@ var FieldsService = class FieldsService {
|
|
|
207
179
|
schema: this.schema,
|
|
208
180
|
knex: this.knex
|
|
209
181
|
});
|
|
210
|
-
const policies = await fetchPolicies(this.accountability, {
|
|
211
|
-
knex: this.knex,
|
|
212
|
-
schema: this.schema
|
|
213
|
-
});
|
|
214
182
|
const permissions = await fetchPermissions({
|
|
215
183
|
action: "read",
|
|
216
|
-
policies,
|
|
184
|
+
policies: await fetchPolicies(this.accountability, {
|
|
185
|
+
knex: this.knex,
|
|
186
|
+
schema: this.schema
|
|
187
|
+
}),
|
|
217
188
|
collections: [collection],
|
|
218
189
|
accountability: this.accountability
|
|
219
190
|
}, {
|
|
@@ -221,26 +192,20 @@ var FieldsService = class FieldsService {
|
|
|
221
192
|
schema: this.schema
|
|
222
193
|
});
|
|
223
194
|
let hasAccess = false;
|
|
224
|
-
for (const permission of permissions) {
|
|
225
|
-
if (permission.fields) {
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
break;
|
|
229
|
-
}
|
|
195
|
+
for (const permission of permissions) if (permission.fields) {
|
|
196
|
+
if (permission.fields.includes("*") || permission.fields.includes(field)) {
|
|
197
|
+
hasAccess = true;
|
|
198
|
+
break;
|
|
230
199
|
}
|
|
231
200
|
}
|
|
232
|
-
if (!hasAccess)
|
|
233
|
-
throw new ForbiddenError();
|
|
234
|
-
}
|
|
201
|
+
if (!hasAccess) throw new ForbiddenError();
|
|
235
202
|
}
|
|
236
|
-
let column =
|
|
203
|
+
let column = void 0;
|
|
237
204
|
let fieldInfo = await this.knex.select("*").from("directus_fields").where({
|
|
238
205
|
collection,
|
|
239
206
|
field
|
|
240
207
|
}).first();
|
|
241
|
-
if (fieldInfo)
|
|
242
|
-
fieldInfo = await this.payloadService.processValues("read", fieldInfo);
|
|
243
|
-
}
|
|
208
|
+
if (fieldInfo) fieldInfo = await this.payloadService.processValues("read", fieldInfo);
|
|
244
209
|
fieldInfo = fieldInfo || systemFieldRows$1.find((fieldMeta) => fieldMeta.collection === collection && fieldMeta.field === field);
|
|
245
210
|
try {
|
|
246
211
|
column = await this.columnInfo(collection, field);
|
|
@@ -251,33 +216,25 @@ var FieldsService = class FieldsService {
|
|
|
251
216
|
...column,
|
|
252
217
|
default_value: getDefaultValue(column, fieldInfo)
|
|
253
218
|
} : null;
|
|
254
|
-
|
|
219
|
+
return {
|
|
255
220
|
collection,
|
|
256
221
|
field,
|
|
257
222
|
type,
|
|
258
223
|
meta: fieldInfo || null,
|
|
259
224
|
schema: type === "alias" ? null : columnWithCastDefaultValue
|
|
260
225
|
};
|
|
261
|
-
return data;
|
|
262
226
|
}
|
|
263
227
|
async createField(collection, field, table, opts) {
|
|
264
|
-
if (this.accountability && this.accountability.admin !== true)
|
|
265
|
-
throw new ForbiddenError();
|
|
266
|
-
}
|
|
228
|
+
if (this.accountability && this.accountability.admin !== true) throw new ForbiddenError();
|
|
267
229
|
const runPostColumnChange = await this.helpers.schema.preColumnChange();
|
|
268
230
|
const nestedActionEvents = [];
|
|
269
231
|
try {
|
|
270
|
-
|
|
232
|
+
if (field.field in this.schema.collections[collection].fields || isNil(await this.knex.select("id").from("directus_fields").where({
|
|
271
233
|
collection,
|
|
272
234
|
field: field.field
|
|
273
|
-
}).first()) === false;
|
|
274
|
-
if (exists) {
|
|
275
|
-
throw new InvalidPayloadError({ reason: `Field "${field.field}" already exists in collection "${collection}"` });
|
|
276
|
-
}
|
|
235
|
+
}).first()) === false) throw new InvalidPayloadError({ reason: `Field "${field.field}" already exists in collection "${collection}"` });
|
|
277
236
|
const flagToAdd = this.helpers.date.fieldFlagForField(field.type);
|
|
278
|
-
if (flagToAdd)
|
|
279
|
-
addFieldFlag(field, flagToAdd);
|
|
280
|
-
}
|
|
237
|
+
if (flagToAdd) addFieldFlag(field, flagToAdd);
|
|
281
238
|
let hookAdjustedField = field;
|
|
282
239
|
const attemptConcurrentIndex = Boolean(opts?.attemptConcurrentIndex);
|
|
283
240
|
await transaction(this.knex, async (trx) => {
|
|
@@ -291,15 +248,10 @@ var FieldsService = class FieldsService {
|
|
|
291
248
|
schema: this.schema,
|
|
292
249
|
accountability: this.accountability
|
|
293
250
|
}) : field;
|
|
294
|
-
if (hookAdjustedField.type && ALIAS_TYPES.includes(hookAdjustedField.type) === false) {
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
await trx.schema.alterTable(collection, (table$1) => {
|
|
299
|
-
this.addColumnToTable(table$1, collection, hookAdjustedField, { attemptConcurrentIndex });
|
|
300
|
-
});
|
|
301
|
-
}
|
|
302
|
-
}
|
|
251
|
+
if (hookAdjustedField.type && ALIAS_TYPES.includes(hookAdjustedField.type) === false) if (table) this.addColumnToTable(table, collection, hookAdjustedField, { attemptConcurrentIndex });
|
|
252
|
+
else await trx.schema.alterTable(collection, (table$1) => {
|
|
253
|
+
this.addColumnToTable(table$1, collection, hookAdjustedField, { attemptConcurrentIndex });
|
|
254
|
+
});
|
|
303
255
|
if (hookAdjustedField.meta) {
|
|
304
256
|
const existingSortRecord = await trx.from("directus_fields").where(hookAdjustedField.meta?.group ? {
|
|
305
257
|
collection,
|
|
@@ -325,25 +277,14 @@ var FieldsService = class FieldsService {
|
|
|
325
277
|
accountability: this.accountability
|
|
326
278
|
}
|
|
327
279
|
};
|
|
328
|
-
if (opts?.bypassEmitAction)
|
|
329
|
-
|
|
330
|
-
} else {
|
|
331
|
-
nestedActionEvents.push(actionEvent);
|
|
332
|
-
}
|
|
280
|
+
if (opts?.bypassEmitAction) opts.bypassEmitAction(actionEvent);
|
|
281
|
+
else nestedActionEvents.push(actionEvent);
|
|
333
282
|
});
|
|
334
|
-
if (attemptConcurrentIndex && hookAdjustedField.type && ALIAS_TYPES.includes(hookAdjustedField.type) === false) {
|
|
335
|
-
await this.addColumnIndex(collection, hookAdjustedField, { attemptConcurrentIndex });
|
|
336
|
-
}
|
|
283
|
+
if (attemptConcurrentIndex && hookAdjustedField.type && ALIAS_TYPES.includes(hookAdjustedField.type) === false) await this.addColumnIndex(collection, hookAdjustedField, { attemptConcurrentIndex });
|
|
337
284
|
} finally {
|
|
338
|
-
if (runPostColumnChange)
|
|
339
|
-
|
|
340
|
-
}
|
|
341
|
-
if (shouldClearCache(this.cache, opts)) {
|
|
342
|
-
await this.cache.clear();
|
|
343
|
-
}
|
|
344
|
-
if (opts?.autoPurgeSystemCache !== false) {
|
|
345
|
-
await clearSystemCache({ autoPurgeCache: opts?.autoPurgeCache });
|
|
346
|
-
}
|
|
285
|
+
if (runPostColumnChange) await this.helpers.schema.postColumnChange();
|
|
286
|
+
if (shouldClearCache(this.cache, opts)) await this.cache.clear();
|
|
287
|
+
if (opts?.autoPurgeSystemCache !== false) await clearSystemCache({ autoPurgeCache: opts?.autoPurgeCache });
|
|
347
288
|
if (opts?.emitEvents !== false && nestedActionEvents.length > 0) {
|
|
348
289
|
const updatedSchema = await getSchema({ database: this.knex });
|
|
349
290
|
for (const nestedActionEvent of nestedActionEvents) {
|
|
@@ -354,9 +295,7 @@ var FieldsService = class FieldsService {
|
|
|
354
295
|
}
|
|
355
296
|
}
|
|
356
297
|
async updateField(collection, field, opts) {
|
|
357
|
-
if (this.accountability && this.accountability.admin !== true)
|
|
358
|
-
throw new ForbiddenError();
|
|
359
|
-
}
|
|
298
|
+
if (this.accountability && this.accountability.admin !== true) throw new ForbiddenError();
|
|
360
299
|
const runPostColumnChange = await this.helpers.schema.preColumnChange();
|
|
361
300
|
const nestedActionEvents = [];
|
|
362
301
|
if (field.schema && !field.type) {
|
|
@@ -376,55 +315,41 @@ var FieldsService = class FieldsService {
|
|
|
376
315
|
collection,
|
|
377
316
|
field: field.field
|
|
378
317
|
}).first() : null;
|
|
379
|
-
if (hookAdjustedField.type && (hookAdjustedField.type === "alias" || this.schema.collections[collection].fields[field.field]?.type === "alias") && hookAdjustedField.type !== (this.schema.collections[collection].fields[field.field]?.type ?? "alias")) {
|
|
380
|
-
throw new InvalidPayloadError({ reason: "Alias type cannot be changed" });
|
|
381
|
-
}
|
|
318
|
+
if (hookAdjustedField.type && (hookAdjustedField.type === "alias" || this.schema.collections[collection].fields[field.field]?.type === "alias") && hookAdjustedField.type !== (this.schema.collections[collection].fields[field.field]?.type ?? "alias")) throw new InvalidPayloadError({ reason: "Alias type cannot be changed" });
|
|
382
319
|
if (hookAdjustedField.schema) {
|
|
383
320
|
const existingColumn = await this.columnInfo(collection, hookAdjustedField.field);
|
|
384
321
|
if (existingColumn.is_primary_key) {
|
|
385
|
-
if (hookAdjustedField.schema?.is_nullable === true) {
|
|
386
|
-
throw new InvalidPayloadError({ reason: "Primary key cannot be null" });
|
|
387
|
-
}
|
|
322
|
+
if (hookAdjustedField.schema?.is_nullable === true) throw new InvalidPayloadError({ reason: "Primary key cannot be null" });
|
|
388
323
|
}
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
if (!hookAdjustedField.schema) return;
|
|
396
|
-
this.addColumnToTable(table, collection, field, {
|
|
397
|
-
existing: existingColumn,
|
|
398
|
-
attemptConcurrentIndex
|
|
399
|
-
});
|
|
400
|
-
});
|
|
401
|
-
});
|
|
402
|
-
if (attemptConcurrentIndex) {
|
|
403
|
-
await this.addColumnIndex(collection, field, {
|
|
324
|
+
if (!isEqual(opts?.bypassLimits && opts.autoPurgeSystemCache === false ? sanitizeColumn(existingColumn) : existingColumn, hookAdjustedField.schema)) try {
|
|
325
|
+
const attemptConcurrentIndex = Boolean(opts?.attemptConcurrentIndex);
|
|
326
|
+
await transaction(this.knex, async (trx) => {
|
|
327
|
+
await trx.schema.alterTable(collection, (table) => {
|
|
328
|
+
if (!hookAdjustedField.schema) return;
|
|
329
|
+
this.addColumnToTable(table, collection, field, {
|
|
404
330
|
existing: existingColumn,
|
|
405
331
|
attemptConcurrentIndex
|
|
406
332
|
});
|
|
407
|
-
}
|
|
408
|
-
}
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
await this.itemsService.updateOne(record.id, {
|
|
416
|
-
...hookAdjustedField.meta,
|
|
417
|
-
collection,
|
|
418
|
-
field: hookAdjustedField.field
|
|
419
|
-
}, { emitEvents: false });
|
|
420
|
-
} else {
|
|
421
|
-
await this.itemsService.createOne({
|
|
422
|
-
...hookAdjustedField.meta,
|
|
423
|
-
collection,
|
|
424
|
-
field: hookAdjustedField.field
|
|
425
|
-
}, { emitEvents: false });
|
|
333
|
+
});
|
|
334
|
+
});
|
|
335
|
+
if (attemptConcurrentIndex) await this.addColumnIndex(collection, field, {
|
|
336
|
+
existing: existingColumn,
|
|
337
|
+
attemptConcurrentIndex
|
|
338
|
+
});
|
|
339
|
+
} catch (err) {
|
|
340
|
+
throw await translateDatabaseError(err, field);
|
|
426
341
|
}
|
|
427
342
|
}
|
|
343
|
+
if (hookAdjustedField.meta && !isSystemField(collection, hookAdjustedField.field)) if (record) await this.itemsService.updateOne(record.id, {
|
|
344
|
+
...hookAdjustedField.meta,
|
|
345
|
+
collection,
|
|
346
|
+
field: hookAdjustedField.field
|
|
347
|
+
}, { emitEvents: false });
|
|
348
|
+
else await this.itemsService.createOne({
|
|
349
|
+
...hookAdjustedField.meta,
|
|
350
|
+
collection,
|
|
351
|
+
field: hookAdjustedField.field
|
|
352
|
+
}, { emitEvents: false });
|
|
428
353
|
const actionEvent = {
|
|
429
354
|
event: "fields.update",
|
|
430
355
|
meta: {
|
|
@@ -438,22 +363,13 @@ var FieldsService = class FieldsService {
|
|
|
438
363
|
accountability: this.accountability
|
|
439
364
|
}
|
|
440
365
|
};
|
|
441
|
-
if (opts?.bypassEmitAction)
|
|
442
|
-
|
|
443
|
-
} else {
|
|
444
|
-
nestedActionEvents.push(actionEvent);
|
|
445
|
-
}
|
|
366
|
+
if (opts?.bypassEmitAction) opts.bypassEmitAction(actionEvent);
|
|
367
|
+
else nestedActionEvents.push(actionEvent);
|
|
446
368
|
return field.field;
|
|
447
369
|
} finally {
|
|
448
|
-
if (runPostColumnChange)
|
|
449
|
-
|
|
450
|
-
}
|
|
451
|
-
if (shouldClearCache(this.cache, opts)) {
|
|
452
|
-
await this.cache.clear();
|
|
453
|
-
}
|
|
454
|
-
if (opts?.autoPurgeSystemCache !== false) {
|
|
455
|
-
await clearSystemCache({ autoPurgeCache: opts?.autoPurgeCache });
|
|
456
|
-
}
|
|
370
|
+
if (runPostColumnChange) await this.helpers.schema.postColumnChange();
|
|
371
|
+
if (shouldClearCache(this.cache, opts)) await this.cache.clear();
|
|
372
|
+
if (opts?.autoPurgeSystemCache !== false) await clearSystemCache({ autoPurgeCache: opts?.autoPurgeCache });
|
|
457
373
|
if (opts?.emitEvents !== false && nestedActionEvents.length > 0) {
|
|
458
374
|
const updatedSchema = await getSchema({ database: this.knex });
|
|
459
375
|
for (const nestedActionEvent of nestedActionEvents) {
|
|
@@ -468,22 +384,16 @@ var FieldsService = class FieldsService {
|
|
|
468
384
|
try {
|
|
469
385
|
const fieldNames = [];
|
|
470
386
|
const attemptConcurrentIndex = Boolean(opts?.attemptConcurrentIndex);
|
|
471
|
-
for (const field of fields) {
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
}));
|
|
478
|
-
}
|
|
387
|
+
for (const field of fields) fieldNames.push(await this.updateField(collection, field, {
|
|
388
|
+
autoPurgeCache: false,
|
|
389
|
+
autoPurgeSystemCache: false,
|
|
390
|
+
bypassEmitAction: (params) => nestedActionEvents.push(params),
|
|
391
|
+
attemptConcurrentIndex
|
|
392
|
+
}));
|
|
479
393
|
return fieldNames;
|
|
480
394
|
} finally {
|
|
481
|
-
if (shouldClearCache(this.cache, opts))
|
|
482
|
-
|
|
483
|
-
}
|
|
484
|
-
if (opts?.autoPurgeSystemCache !== false) {
|
|
485
|
-
await clearSystemCache({ autoPurgeCache: opts?.autoPurgeCache });
|
|
486
|
-
}
|
|
395
|
+
if (shouldClearCache(this.cache, opts)) await this.cache.clear();
|
|
396
|
+
if (opts?.autoPurgeSystemCache !== false) await clearSystemCache({ autoPurgeCache: opts?.autoPurgeCache });
|
|
487
397
|
if (opts?.emitEvents !== false && nestedActionEvents.length > 0) {
|
|
488
398
|
const updatedSchema = await getSchema({ database: this.knex });
|
|
489
399
|
for (const nestedActionEvent of nestedActionEvents) {
|
|
@@ -494,19 +404,15 @@ var FieldsService = class FieldsService {
|
|
|
494
404
|
}
|
|
495
405
|
}
|
|
496
406
|
async deleteField(collection, field, opts) {
|
|
497
|
-
if (this.accountability && this.accountability.admin !== true)
|
|
498
|
-
throw new ForbiddenError();
|
|
499
|
-
}
|
|
407
|
+
if (this.accountability && this.accountability.admin !== true) throw new ForbiddenError();
|
|
500
408
|
const runPostColumnChange = await this.helpers.schema.preColumnChange();
|
|
501
409
|
const nestedActionEvents = [];
|
|
502
410
|
try {
|
|
503
|
-
if (opts?.emitEvents !== false) {
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
});
|
|
509
|
-
}
|
|
411
|
+
if (opts?.emitEvents !== false) await emitter_default.emitFilter("fields.delete", [field], { collection }, {
|
|
412
|
+
database: this.knex,
|
|
413
|
+
schema: this.schema,
|
|
414
|
+
accountability: this.accountability
|
|
415
|
+
});
|
|
510
416
|
await transaction(this.knex, async (trx) => {
|
|
511
417
|
const relations = getRelations(this.schema.relations, collection, field);
|
|
512
418
|
const relationsService = new RelationsService({
|
|
@@ -526,55 +432,41 @@ var FieldsService = class FieldsService {
|
|
|
526
432
|
autoPurgeSystemCache: false,
|
|
527
433
|
bypassEmitAction: (params) => opts?.bypassEmitAction ? opts.bypassEmitAction(params) : nestedActionEvents.push(params)
|
|
528
434
|
});
|
|
529
|
-
if (relation.related_collection && relation.meta?.one_field && relation.related_collection !== collection && relation.meta.one_field !== field) {
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
bypassEmitAction: (params) => opts?.bypassEmitAction ? opts.bypassEmitAction(params) : nestedActionEvents.push(params)
|
|
534
|
-
});
|
|
535
|
-
}
|
|
536
|
-
}
|
|
537
|
-
if (!isM2O && relation.meta?.one_field) {
|
|
538
|
-
await trx("directus_relations").update({ one_field: null }).where({
|
|
539
|
-
many_collection: relation.collection,
|
|
540
|
-
many_field: relation.field
|
|
435
|
+
if (relation.related_collection && relation.meta?.one_field && relation.related_collection !== collection && relation.meta.one_field !== field) await fieldsService.deleteField(relation.related_collection, relation.meta.one_field, {
|
|
436
|
+
autoPurgeCache: false,
|
|
437
|
+
autoPurgeSystemCache: false,
|
|
438
|
+
bypassEmitAction: (params) => opts?.bypassEmitAction ? opts.bypassEmitAction(params) : nestedActionEvents.push(params)
|
|
541
439
|
});
|
|
542
440
|
}
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
table.dropColumn(field);
|
|
441
|
+
if (!isM2O && relation.meta?.one_field) await trx("directus_relations").update({ one_field: null }).where({
|
|
442
|
+
many_collection: relation.collection,
|
|
443
|
+
many_field: relation.field
|
|
547
444
|
});
|
|
548
445
|
}
|
|
446
|
+
if (this.schema.collections[collection] && field in this.schema.collections[collection].fields && this.schema.collections[collection].fields[field].alias === false) await trx.schema.table(collection, (table) => {
|
|
447
|
+
table.dropColumn(field);
|
|
448
|
+
});
|
|
549
449
|
const { collectionRelationTree, fieldToCollectionList } = await buildCollectionAndFieldRelations(this.schema.relations);
|
|
550
450
|
const collectionRelationList = getCollectionRelationList(collection, collectionRelationTree);
|
|
551
451
|
const collectionMetaQuery = trx.queryBuilder().select("collection", "archive_field", "sort_field", "item_duplication_fields").from("directus_collections").where({ collection });
|
|
552
|
-
if (collectionRelationList.size !== 0) {
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
}
|
|
557
|
-
const collectionMetas = await collectionMetaQuery;
|
|
558
|
-
const collectionMetaUpdates = getCollectionMetaUpdates(collection, field, collectionMetas, this.schema.collections, fieldToCollectionList);
|
|
559
|
-
for (const meta of collectionMetaUpdates) {
|
|
560
|
-
await trx("directus_collections").update(meta.updates).where({ collection: meta.collection });
|
|
561
|
-
}
|
|
452
|
+
if (collectionRelationList.size !== 0) collectionMetaQuery.orWhere(function() {
|
|
453
|
+
this.whereIn("collection", Array.from(collectionRelationList)).whereNotNull("item_duplication_fields");
|
|
454
|
+
});
|
|
455
|
+
const collectionMetaUpdates = getCollectionMetaUpdates(collection, field, await collectionMetaQuery, this.schema.collections, fieldToCollectionList);
|
|
456
|
+
for (const meta of collectionMetaUpdates) await trx("directus_collections").update(meta.updates).where({ collection: meta.collection });
|
|
562
457
|
const metaRow = await trx.select("collection", "field").from("directus_fields").where({
|
|
563
458
|
collection,
|
|
564
459
|
field
|
|
565
460
|
}).first();
|
|
566
|
-
if (metaRow) {
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
}
|
|
572
|
-
const itemsService = new ItemsService("directus_fields", {
|
|
461
|
+
if (metaRow) await trx("directus_fields").update({ group: null }).where({
|
|
462
|
+
group: metaRow.field,
|
|
463
|
+
collection: metaRow.collection
|
|
464
|
+
});
|
|
465
|
+
await new ItemsService("directus_fields", {
|
|
573
466
|
knex: trx,
|
|
574
467
|
accountability: this.accountability,
|
|
575
468
|
schema: this.schema
|
|
576
|
-
})
|
|
577
|
-
await itemsService.deleteByQuery({ filter: {
|
|
469
|
+
}).deleteByQuery({ filter: {
|
|
578
470
|
collection: { _eq: collection },
|
|
579
471
|
field: { _eq: field }
|
|
580
472
|
} }, { emitEvents: false });
|
|
@@ -584,11 +476,9 @@ var FieldsService = class FieldsService {
|
|
|
584
476
|
"fields",
|
|
585
477
|
"%" + field + "%"
|
|
586
478
|
]);
|
|
587
|
-
if (permissionRows.length > 0) {
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
await trx("directus_permissions").update("fields", newFields.length > 0 ? newFields : null).where("id", "=", permissionRow["id"]);
|
|
591
|
-
}
|
|
479
|
+
if (permissionRows.length > 0) for (const permissionRow of permissionRows) {
|
|
480
|
+
const newFields = permissionRow["fields"].split(",").filter((v) => v !== field).join(",");
|
|
481
|
+
await trx("directus_permissions").update("fields", newFields.length > 0 ? newFields : null).where("id", "=", permissionRow["id"]);
|
|
592
482
|
}
|
|
593
483
|
});
|
|
594
484
|
const actionEvent = {
|
|
@@ -603,21 +493,12 @@ var FieldsService = class FieldsService {
|
|
|
603
493
|
accountability: this.accountability
|
|
604
494
|
}
|
|
605
495
|
};
|
|
606
|
-
if (opts?.bypassEmitAction)
|
|
607
|
-
|
|
608
|
-
} else {
|
|
609
|
-
nestedActionEvents.push(actionEvent);
|
|
610
|
-
}
|
|
496
|
+
if (opts?.bypassEmitAction) opts.bypassEmitAction(actionEvent);
|
|
497
|
+
else nestedActionEvents.push(actionEvent);
|
|
611
498
|
} finally {
|
|
612
|
-
if (runPostColumnChange)
|
|
613
|
-
|
|
614
|
-
}
|
|
615
|
-
if (shouldClearCache(this.cache, opts)) {
|
|
616
|
-
await this.cache.clear();
|
|
617
|
-
}
|
|
618
|
-
if (opts?.autoPurgeSystemCache !== false) {
|
|
619
|
-
await clearSystemCache({ autoPurgeCache: opts?.autoPurgeCache });
|
|
620
|
-
}
|
|
499
|
+
if (runPostColumnChange) await this.helpers.schema.postColumnChange();
|
|
500
|
+
if (shouldClearCache(this.cache, opts)) await this.cache.clear();
|
|
501
|
+
if (opts?.autoPurgeSystemCache !== false) await clearSystemCache({ autoPurgeCache: opts?.autoPurgeCache });
|
|
621
502
|
if (opts?.emitEvents !== false && nestedActionEvents.length > 0) {
|
|
622
503
|
const updatedSchema = await getSchema({ database: this.knex });
|
|
623
504
|
for (const nestedActionEvent of nestedActionEvents) {
|
|
@@ -631,32 +512,20 @@ var FieldsService = class FieldsService {
|
|
|
631
512
|
let column;
|
|
632
513
|
if (field.type === "alias" || field.type === "unknown") return;
|
|
633
514
|
const existing = options?.existing ?? null;
|
|
634
|
-
if (field.schema?.has_auto_increment)
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
} else if (field.type
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
column = table.string(field.field, 255);
|
|
649
|
-
} else if (field.type === "dateTime") {
|
|
650
|
-
column = table.dateTime(field.field, { useTz: false });
|
|
651
|
-
} else if (field.type === "timestamp") {
|
|
652
|
-
column = table.timestamp(field.field, { useTz: true });
|
|
653
|
-
} else if (field.type.startsWith("geometry")) {
|
|
654
|
-
column = this.helpers.st.createColumn(table, field);
|
|
655
|
-
} else if (KNEX_TYPES.includes(field.type)) {
|
|
656
|
-
column = table[field.type](field.field);
|
|
657
|
-
} else {
|
|
658
|
-
throw new InvalidPayloadError({ reason: `Illegal type passed: "${field.type}"` });
|
|
659
|
-
}
|
|
515
|
+
if (field.schema?.has_auto_increment) if (field.type === "bigInteger") column = table.bigIncrements(field.field);
|
|
516
|
+
else column = table.increments(field.field);
|
|
517
|
+
else if (field.type === "string") {
|
|
518
|
+
const maxLength = field.schema?.max_length !== void 0 ? field.schema.max_length : existing?.max_length ?? void 0;
|
|
519
|
+
if (maxLength === null && this.helpers.schema.isOneOfClients(["mssql"])) column = table.text(field.field);
|
|
520
|
+
else column = table.string(field.field, maxLength ?? void 0);
|
|
521
|
+
} else if (["float", "decimal"].includes(field.type)) column = table[field.type](field.field, field.schema?.numeric_precision ?? existing?.numeric_precision ?? DEFAULT_NUMERIC_PRECISION, field.schema?.numeric_scale ?? existing?.numeric_scale ?? DEFAULT_NUMERIC_SCALE);
|
|
522
|
+
else if (field.type === "csv") column = table.text(field.field);
|
|
523
|
+
else if (field.type === "hash") column = table.string(field.field, 255);
|
|
524
|
+
else if (field.type === "dateTime") column = table.dateTime(field.field, { useTz: false });
|
|
525
|
+
else if (field.type === "timestamp") column = table.timestamp(field.field, { useTz: true });
|
|
526
|
+
else if (field.type.startsWith("geometry")) column = this.helpers.st.createColumn(table, field);
|
|
527
|
+
else if (KNEX_TYPES.includes(field.type)) column = table[field.type](field.field);
|
|
528
|
+
else throw new InvalidPayloadError({ reason: `Illegal type passed: "${field.type}"` });
|
|
660
529
|
/**
|
|
661
530
|
* The column nullability must be set on every alter or it will be dropped
|
|
662
531
|
* This is due to column.alter() not being incremental per https://knexjs.org/guide/schema-builder.html#alter
|
|
@@ -666,46 +535,29 @@ var FieldsService = class FieldsService {
|
|
|
666
535
|
* The default value must be set on every alter or it will be dropped
|
|
667
536
|
* This is due to column.alter() not being incremental per https://knexjs.org/guide/schema-builder.html#alter
|
|
668
537
|
*/
|
|
669
|
-
const defaultValue = field.schema?.default_value !==
|
|
670
|
-
if (defaultValue !==
|
|
538
|
+
const defaultValue = field.schema?.default_value !== void 0 ? field.schema?.default_value : existing?.default_value;
|
|
539
|
+
if (defaultValue !== void 0) {
|
|
671
540
|
const newDefaultValueIsString = typeof defaultValue === "string";
|
|
672
|
-
const
|
|
673
|
-
const newDefaultIsCurrentTimestamp = newDefaultValueIsString && defaultValue === "CURRENT_TIMESTAMP";
|
|
674
|
-
const newDefaultIsSetToCurrentTime = newDefaultIsNowFunction || newDefaultIsCurrentTimestamp;
|
|
541
|
+
const newDefaultIsSetToCurrentTime = newDefaultValueIsString && defaultValue.toLowerCase() === "now()" || newDefaultValueIsString && defaultValue === "CURRENT_TIMESTAMP";
|
|
675
542
|
const newDefaultIsAFunction = newDefaultValueIsString && ALLOWED_DB_DEFAULT_FUNCTIONS.includes(defaultValue);
|
|
676
543
|
const newDefaultIsTimestampWithPrecision = newDefaultValueIsString && defaultValue.includes("CURRENT_TIMESTAMP(") && defaultValue.includes(")");
|
|
677
|
-
if (newDefaultIsSetToCurrentTime)
|
|
678
|
-
|
|
679
|
-
} else if (newDefaultIsTimestampWithPrecision) {
|
|
544
|
+
if (newDefaultIsSetToCurrentTime) column.defaultTo(this.knex.fn.now());
|
|
545
|
+
else if (newDefaultIsTimestampWithPrecision) {
|
|
680
546
|
const precision = defaultValue.match(REGEX_BETWEEN_PARENS)[1];
|
|
681
547
|
column.defaultTo(this.knex.fn.now(Number(precision)));
|
|
682
|
-
} else if (newDefaultIsAFunction)
|
|
683
|
-
|
|
684
|
-
} else {
|
|
685
|
-
column.defaultTo(defaultValue);
|
|
686
|
-
}
|
|
548
|
+
} else if (newDefaultIsAFunction) column.defaultTo(this.knex.raw(defaultValue));
|
|
549
|
+
else column.defaultTo(defaultValue);
|
|
687
550
|
}
|
|
688
|
-
if (field.schema?.is_primary_key)
|
|
689
|
-
|
|
690
|
-
} else if (!existing?.is_primary_key) {
|
|
551
|
+
if (field.schema?.is_primary_key) column.primary().notNullable();
|
|
552
|
+
else if (!existing?.is_primary_key) {
|
|
691
553
|
if (field.schema?.is_unique === true) {
|
|
692
|
-
if ((!existing || existing.is_unique === false) && !options?.attemptConcurrentIndex) {
|
|
693
|
-
|
|
694
|
-
}
|
|
695
|
-
} else if (field.schema?.is_unique === false && existing?.is_unique === true) {
|
|
696
|
-
table.dropUnique([field.field], this.helpers.schema.generateIndexName("unique", collection, field.field));
|
|
697
|
-
}
|
|
554
|
+
if ((!existing || existing.is_unique === false) && !options?.attemptConcurrentIndex) column.unique({ indexName: this.helpers.schema.generateIndexName("unique", collection, field.field) });
|
|
555
|
+
} else if (field.schema?.is_unique === false && existing?.is_unique === true) table.dropUnique([field.field], this.helpers.schema.generateIndexName("unique", collection, field.field));
|
|
698
556
|
if (field.schema?.is_indexed === true) {
|
|
699
|
-
if ((!existing || existing.is_indexed === false) && !options?.attemptConcurrentIndex)
|
|
700
|
-
|
|
701
|
-
}
|
|
702
|
-
} else if (field.schema?.is_indexed === false && existing?.is_indexed === true) {
|
|
703
|
-
table.dropIndex([field.field], this.helpers.schema.generateIndexName("index", collection, field.field));
|
|
704
|
-
}
|
|
705
|
-
}
|
|
706
|
-
if (existing) {
|
|
707
|
-
column.alter();
|
|
557
|
+
if ((!existing || existing.is_indexed === false) && !options?.attemptConcurrentIndex) column.index(this.helpers.schema.generateIndexName("index", collection, field.field));
|
|
558
|
+
} else if (field.schema?.is_indexed === false && existing?.is_indexed === true) table.dropIndex([field.field], this.helpers.schema.generateIndexName("index", collection, field.field));
|
|
708
559
|
}
|
|
560
|
+
if (existing) column.alter();
|
|
709
561
|
}
|
|
710
562
|
async addColumnIndex(collection, field, options) {
|
|
711
563
|
const attemptConcurrentIndex = Boolean(options?.attemptConcurrentIndex);
|
|
@@ -714,18 +566,14 @@ var FieldsService = class FieldsService {
|
|
|
714
566
|
if (field.type === "alias" || field.type === "unknown") return;
|
|
715
567
|
if (field.schema?.is_primary_key || existing?.is_primary_key) return;
|
|
716
568
|
const helpers = getHelpers(knex);
|
|
717
|
-
if (field.schema?.is_unique === true && (!existing || existing.is_unique == false)) {
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
unique: false,
|
|
726
|
-
attemptConcurrentIndex
|
|
727
|
-
});
|
|
728
|
-
}
|
|
569
|
+
if (field.schema?.is_unique === true && (!existing || existing.is_unique == false)) await helpers.schema.createIndex(collection, field.field, {
|
|
570
|
+
unique: true,
|
|
571
|
+
attemptConcurrentIndex
|
|
572
|
+
});
|
|
573
|
+
if (field.schema?.is_indexed === true && (!existing || existing.is_indexed === false)) await helpers.schema.createIndex(collection, field.field, {
|
|
574
|
+
unique: false,
|
|
575
|
+
attemptConcurrentIndex
|
|
576
|
+
});
|
|
729
577
|
}
|
|
730
578
|
};
|
|
731
579
|
|