@directus/api 35.0.2 → 35.1.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.
Files changed (785) hide show
  1. package/dist/_virtual/rolldown_runtime.js +1 -24
  2. package/dist/ai/chat/controllers/chat.post.js +9 -22
  3. package/dist/ai/chat/controllers/object.post.js +58 -0
  4. package/dist/ai/chat/lib/create-ui-stream.js +10 -18
  5. package/dist/ai/chat/lib/transform-file-parts.js +1 -3
  6. package/dist/ai/chat/middleware/load-settings.js +1 -2
  7. package/dist/ai/chat/models/chat-request.js +2 -9
  8. package/dist/ai/chat/models/object-request.js +19 -0
  9. package/dist/ai/chat/router.js +3 -2
  10. package/dist/ai/chat/utils/add-additional-properties-to-json-schema.js +37 -0
  11. package/dist/ai/chat/utils/chat-request-tool-to-ai-sdk-tool.js +3 -8
  12. package/dist/ai/chat/utils/fix-error-tool-calls.js +4 -6
  13. package/dist/ai/chat/utils/format-context.js +17 -27
  14. package/dist/ai/chat/utils/parse-json-schema-7.js +3 -6
  15. package/dist/ai/chat/utils/zod-jsonschema7-parser.js +16 -0
  16. package/dist/ai/devtools/index.js +1 -2
  17. package/dist/ai/files/adapters/anthropic.js +1 -3
  18. package/dist/ai/files/adapters/google.js +5 -12
  19. package/dist/ai/files/adapters/openai.js +1 -3
  20. package/dist/ai/files/controllers/upload.js +8 -24
  21. package/dist/ai/files/lib/fetch-provider.js +1 -3
  22. package/dist/ai/files/lib/upload-to-provider.js +6 -16
  23. package/dist/ai/mcp/server.js +58 -102
  24. package/dist/ai/mcp/transport.js +2 -6
  25. package/dist/ai/providers/anthropic-file-support.js +28 -41
  26. package/dist/ai/providers/anthropic-tool-search.js +10 -14
  27. package/dist/ai/providers/index.js +0 -1
  28. package/dist/ai/providers/options.js +2 -7
  29. package/dist/ai/providers/registry.js +38 -48
  30. package/dist/ai/telemetry/braintrust.js +3 -9
  31. package/dist/ai/telemetry/index.js +14 -13
  32. package/dist/ai/telemetry/langfuse.js +8 -22
  33. package/dist/ai/tools/assets/index.js +15 -23
  34. package/dist/ai/tools/collections/index.js +9 -19
  35. package/dist/ai/tools/fields/index.js +13 -27
  36. package/dist/ai/tools/files/index.js +11 -24
  37. package/dist/ai/tools/flows/index.js +8 -16
  38. package/dist/ai/tools/folders/index.js +11 -23
  39. package/dist/ai/tools/items/index.js +19 -44
  40. package/dist/ai/tools/operations/index.js +7 -13
  41. package/dist/ai/tools/relations/index.js +5 -11
  42. package/dist/ai/tools/schema/index.js +39 -91
  43. package/dist/ai/tools/trigger-flow/index.js +9 -16
  44. package/dist/ai/tools/utils.js +4 -8
  45. package/dist/app.js +19 -51
  46. package/dist/auth/auth.js +3 -9
  47. package/dist/auth/drivers/ldap.js +39 -82
  48. package/dist/auth/drivers/local.js +4 -12
  49. package/dist/auth/drivers/oauth2.js +32 -63
  50. package/dist/auth/drivers/openid.js +49 -89
  51. package/dist/auth/drivers/saml.js +16 -31
  52. package/dist/auth/utils/generate-callback-url.js +2 -7
  53. package/dist/auth/utils/resolve-login-redirect.js +11 -21
  54. package/dist/auth.js +2 -5
  55. package/dist/bus/lib/use-bus.js +3 -7
  56. package/dist/cache.js +11 -24
  57. package/dist/cli/commands/bootstrap/index.js +10 -19
  58. package/dist/cli/commands/cache/clear.js +1 -3
  59. package/dist/cli/commands/database/migrate.js +2 -5
  60. package/dist/cli/commands/init/index.js +3 -5
  61. package/dist/cli/commands/init/questions.js +2 -3
  62. package/dist/cli/commands/schema/apply.js +39 -81
  63. package/dist/cli/commands/schema/snapshot.js +3 -8
  64. package/dist/cli/commands/users/create.js +3 -5
  65. package/dist/cli/commands/users/passwd.js +2 -5
  66. package/dist/cli/index.js +1 -2
  67. package/dist/cli/load-extensions.js +3 -6
  68. package/dist/cli/utils/create-db-connection.js +7 -12
  69. package/dist/cli/utils/create-env/index.js +2 -6
  70. package/dist/cli/utils/drivers.js +1 -3
  71. package/dist/controllers/access.js +15 -30
  72. package/dist/controllers/activity.js +5 -10
  73. package/dist/controllers/assets.js +24 -61
  74. package/dist/controllers/auth.js +19 -52
  75. package/dist/controllers/collections.js +8 -17
  76. package/dist/controllers/comments.js +15 -30
  77. package/dist/controllers/dashboards.js +13 -25
  78. package/dist/controllers/deployment-webhooks.js +6 -12
  79. package/dist/controllers/deployment.js +39 -90
  80. package/dist/controllers/extensions.js +53 -98
  81. package/dist/controllers/fields.js +17 -38
  82. package/dist/controllers/files.js +31 -68
  83. package/dist/controllers/flows.js +15 -30
  84. package/dist/controllers/folders.js +16 -32
  85. package/dist/controllers/graphql.js +2 -6
  86. package/dist/controllers/items.js +18 -38
  87. package/dist/controllers/mcp.js +4 -8
  88. package/dist/controllers/metrics.js +4 -12
  89. package/dist/controllers/not-found.js +2 -5
  90. package/dist/controllers/notifications.js +16 -32
  91. package/dist/controllers/operations.js +13 -25
  92. package/dist/controllers/panels.js +13 -25
  93. package/dist/controllers/permissions.js +18 -35
  94. package/dist/controllers/policies.js +15 -30
  95. package/dist/controllers/presets.js +16 -32
  96. package/dist/controllers/relations.js +12 -24
  97. package/dist/controllers/revisions.js +2 -3
  98. package/dist/controllers/roles.js +13 -25
  99. package/dist/controllers/schema.js +19 -30
  100. package/dist/controllers/server.js +32 -44
  101. package/dist/controllers/settings.js +5 -9
  102. package/dist/controllers/shares.js +20 -40
  103. package/dist/controllers/translations.js +16 -32
  104. package/dist/controllers/tus.js +4 -11
  105. package/dist/controllers/users.js +46 -100
  106. package/dist/controllers/utils/handle-registry-error.js +26 -0
  107. package/dist/controllers/utils.js +20 -41
  108. package/dist/controllers/versions.js +20 -41
  109. package/dist/database/errors/dialects/mssql.js +8 -21
  110. package/dist/database/errors/dialects/mysql.js +7 -14
  111. package/dist/database/errors/dialects/oracle.js +3 -6
  112. package/dist/database/errors/dialects/postgres.js +8 -18
  113. package/dist/database/errors/dialects/sqlite.js +16 -21
  114. package/dist/database/errors/translate.js +1 -2
  115. package/dist/database/get-ast-from-query/get-ast-from-query.js +4 -12
  116. package/dist/database/get-ast-from-query/lib/convert-wildcards.js +15 -29
  117. package/dist/database/get-ast-from-query/lib/parse-fields.js +17 -41
  118. package/dist/database/get-ast-from-query/utils/get-allowed-sort.js +5 -14
  119. package/dist/database/get-ast-from-query/utils/get-related-collection.js +2 -6
  120. package/dist/database/helpers/date/dialects/mysql.js +1 -1
  121. package/dist/database/helpers/date/dialects/oracle.js +3 -9
  122. package/dist/database/helpers/date/dialects/sqlite.js +3 -9
  123. package/dist/database/helpers/date/types.js +1 -3
  124. package/dist/database/helpers/fn/dialects/mssql.js +4 -12
  125. package/dist/database/helpers/fn/dialects/mysql.js +5 -14
  126. package/dist/database/helpers/fn/dialects/oracle.js +4 -12
  127. package/dist/database/helpers/fn/dialects/postgres.js +5 -14
  128. package/dist/database/helpers/fn/dialects/sqlite.js +4 -12
  129. package/dist/database/helpers/fn/json/parse-function.js +9 -27
  130. package/dist/database/helpers/fn/types.js +1 -3
  131. package/dist/database/helpers/geometry/dialects/mssql.js +1 -3
  132. package/dist/database/helpers/geometry/dialects/oracle.js +1 -3
  133. package/dist/database/helpers/geometry/dialects/postgres.js +1 -2
  134. package/dist/database/helpers/geometry/dialects/redshift.js +1 -3
  135. package/dist/database/helpers/geometry/dialects/sqlite.js +1 -2
  136. package/dist/database/helpers/index.js +1 -2
  137. package/dist/database/helpers/number/dialects/postgres.js +1 -3
  138. package/dist/database/helpers/number/utils/decimal-limit.js +2 -4
  139. package/dist/database/helpers/number/utils/maybe-stringify-big-int.js +1 -3
  140. package/dist/database/helpers/schema/dialects/cockroachdb.js +8 -15
  141. package/dist/database/helpers/schema/dialects/mssql.js +8 -15
  142. package/dist/database/helpers/schema/dialects/mysql.js +8 -14
  143. package/dist/database/helpers/schema/dialects/oracle.js +13 -28
  144. package/dist/database/helpers/schema/dialects/postgres.js +6 -10
  145. package/dist/database/helpers/schema/dialects/sqlite.js +1 -3
  146. package/dist/database/helpers/schema/types.js +12 -35
  147. package/dist/database/helpers/schema/utils/prep-query-params.js +4 -7
  148. package/dist/database/helpers/sequence/types.js +1 -3
  149. package/dist/database/index.js +41 -79
  150. package/dist/database/migrations/20201029A-remove-system-relations.js +1 -5
  151. package/dist/database/migrations/20201029B-remove-system-collections.js +1 -5
  152. package/dist/database/migrations/20201029C-remove-system-fields.js +1 -5
  153. package/dist/database/migrations/20201105A-add-cascade-system-relations.js +9 -15
  154. package/dist/database/migrations/20210225A-add-relations-sort-field.js +4 -6
  155. package/dist/database/migrations/20210415A-make-filesize-nullable.js +2 -4
  156. package/dist/database/migrations/20210506A-rename-interfaces.js +13 -20
  157. package/dist/database/migrations/20210518A-add-foreign-key-constraints.js +7 -18
  158. package/dist/database/migrations/20210519A-add-system-fk-triggers.js +58 -67
  159. package/dist/database/migrations/20210626A-change-filesize-bigint.js +2 -8
  160. package/dist/database/migrations/20210802A-replace-groups.js +7 -9
  161. package/dist/database/migrations/20210805A-update-groups.js +4 -14
  162. package/dist/database/migrations/20210805B-change-image-metadata-structure.js +2 -6
  163. package/dist/database/migrations/20210920A-webhooks-url-not-null.js +2 -6
  164. package/dist/database/migrations/20210927A-replace-fields-group.js +5 -11
  165. package/dist/database/migrations/20211007A-update-presets.js +4 -12
  166. package/dist/database/migrations/20220303A-remove-default-project-color.js +2 -4
  167. package/dist/database/migrations/20220322A-rename-field-typecast-flags.js +2 -6
  168. package/dist/database/migrations/20220325A-fix-typecast-flags.js +3 -8
  169. package/dist/database/migrations/20220402A-remove-default-value-panel-icon.js +2 -4
  170. package/dist/database/migrations/20220429A-add-flows.js +2 -4
  171. package/dist/database/migrations/20220801A-update-notifications-timestamp-column.js +2 -4
  172. package/dist/database/migrations/20230401A-update-material-icons.js +2 -4
  173. package/dist/database/migrations/20230526A-migrate-translation-strings.js +9 -16
  174. package/dist/database/migrations/20230721A-require-shares-fields.js +9 -20
  175. package/dist/database/migrations/20231009A-update-csv-fields-to-text.js +15 -22
  176. package/dist/database/migrations/20231009B-update-panel-options.js +4 -12
  177. package/dist/database/migrations/20240204A-marketplace.js +20 -26
  178. package/dist/database/migrations/20240311A-deprecate-webhooks.js +1 -1
  179. package/dist/database/migrations/20240716A-update-files-date-fields.js +8 -14
  180. package/dist/database/migrations/20240806A-permissions-policies.js +17 -39
  181. package/dist/database/migrations/20240909A-separate-comments.js +14 -17
  182. package/dist/database/migrations/20240924A-migrate-legacy-comments.js +6 -11
  183. package/dist/database/migrations/20240924B-populate-versioning-deltas.js +1 -3
  184. package/dist/database/migrations/20250224A-visual-editor.js +1 -2
  185. package/dist/database/migrations/20250609A-license-banner.js +1 -2
  186. package/dist/database/migrations/20250613A-add-project-id.js +2 -5
  187. package/dist/database/migrations/20251014A-add-project-owner.js +7 -10
  188. package/dist/database/migrations/20251028A-add-retention-indexes.js +7 -15
  189. package/dist/database/migrations/20260113A-add-revisions-index.js +7 -15
  190. package/dist/database/migrations/run.js +23 -50
  191. package/dist/database/run-ast/lib/apply-query/add-join.js +8 -20
  192. package/dist/database/run-ast/lib/apply-query/aggregate.js +1 -3
  193. package/dist/database/run-ast/lib/apply-query/filter/get-filter-type.js +3 -9
  194. package/dist/database/run-ast/lib/apply-query/filter/index.js +9 -27
  195. package/dist/database/run-ast/lib/apply-query/filter/operator.js +42 -107
  196. package/dist/database/run-ast/lib/apply-query/filter/validate-operator.js +3 -9
  197. package/dist/database/run-ast/lib/apply-query/get-filter-path.js +2 -6
  198. package/dist/database/run-ast/lib/apply-query/get-operation.js +9 -14
  199. package/dist/database/run-ast/lib/apply-query/index.js +20 -39
  200. package/dist/database/run-ast/lib/apply-query/join-filter-with-cases.js +3 -7
  201. package/dist/database/run-ast/lib/apply-query/pagination.js +2 -6
  202. package/dist/database/run-ast/lib/apply-query/search.js +17 -41
  203. package/dist/database/run-ast/lib/apply-query/sort.js +16 -30
  204. package/dist/database/run-ast/lib/get-db-query.js +7 -15
  205. package/dist/database/run-ast/lib/parse-current-level.js +10 -23
  206. package/dist/database/run-ast/modules/fetch-permitted-ast-root-fields.js +10 -14
  207. package/dist/database/run-ast/run-ast.js +30 -52
  208. package/dist/database/run-ast/utils/apply-case-when.js +1 -3
  209. package/dist/database/run-ast/utils/apply-function-to-column-name.js +2 -6
  210. package/dist/database/run-ast/utils/apply-parent-filters.js +14 -19
  211. package/dist/database/run-ast/utils/generate-alias.js +9 -14
  212. package/dist/database/run-ast/utils/get-column-pre-processor.js +14 -26
  213. package/dist/database/run-ast/utils/get-column.js +5 -14
  214. package/dist/database/run-ast/utils/get-inner-query-column-pre-processor.js +1 -3
  215. package/dist/database/run-ast/utils/merge-with-parent-items.js +31 -63
  216. package/dist/database/run-ast/utils/remove-temporary-fields.js +15 -29
  217. package/dist/database/run-ast/utils/with-preprocess-bindings.js +2 -6
  218. package/dist/database/seeds/run.js +19 -45
  219. package/dist/deployment/deployment.js +2 -8
  220. package/dist/deployment/drivers/netlify.js +43 -88
  221. package/dist/deployment/drivers/vercel.js +34 -72
  222. package/dist/deployment.js +8 -14
  223. package/dist/emitter.js +14 -21
  224. package/dist/extensions/index.js +1 -3
  225. package/dist/extensions/lib/get-extensions-path.js +1 -3
  226. package/dist/extensions/lib/get-extensions-settings.js +26 -42
  227. package/dist/extensions/lib/get-extensions.js +3 -7
  228. package/dist/extensions/lib/get-shared-deps-mapping.js +3 -7
  229. package/dist/extensions/lib/installation/index.js +1 -3
  230. package/dist/extensions/lib/installation/manager.js +9 -23
  231. package/dist/extensions/lib/sandbox/generate-host-function-reference.js +2 -5
  232. package/dist/extensions/lib/sandbox/register/call-reference.js +1 -1
  233. package/dist/extensions/lib/sandbox/register/filter.js +1 -2
  234. package/dist/extensions/lib/sandbox/register/operation.js +1 -2
  235. package/dist/extensions/lib/sandbox/register/route.js +2 -4
  236. package/dist/extensions/lib/sandbox/sdk/generators/log.js +1 -1
  237. package/dist/extensions/lib/sandbox/sdk/generators/request.js +13 -28
  238. package/dist/extensions/lib/sandbox/sdk/generators/sleep.js +2 -3
  239. package/dist/extensions/lib/sandbox/sdk/utils/wrap.js +4 -9
  240. package/dist/extensions/lib/sync/status.js +4 -11
  241. package/dist/extensions/lib/sync/sync.js +6 -12
  242. package/dist/extensions/lib/sync/tracker.js +7 -10
  243. package/dist/extensions/lib/sync/utils.js +5 -9
  244. package/dist/extensions/manager.js +59 -107
  245. package/dist/flows.js +233 -275
  246. package/dist/lock/lib/use-lock.js +3 -7
  247. package/dist/logger/index.js +37 -57
  248. package/dist/logger/redact-query.js +1 -3
  249. package/dist/mailer.js +12 -18
  250. package/dist/metrics/lib/create-metrics.js +69 -117
  251. package/dist/metrics/lib/use-metrics.js +3 -8
  252. package/dist/middleware/authenticate.js +1 -3
  253. package/dist/middleware/cache.js +5 -8
  254. package/dist/middleware/collection-exists.js +3 -8
  255. package/dist/middleware/cors.js +8 -10
  256. package/dist/middleware/error-handler.js +10 -21
  257. package/dist/middleware/extract-token.js +3 -9
  258. package/dist/middleware/graphql.js +16 -27
  259. package/dist/middleware/rate-limiter-global.js +1 -3
  260. package/dist/middleware/rate-limiter-ip.js +9 -11
  261. package/dist/middleware/rate-limiter-registration.js +9 -11
  262. package/dist/middleware/request-counter.js +8 -15
  263. package/dist/middleware/respond.js +8 -16
  264. package/dist/middleware/validate-batch.js +5 -15
  265. package/dist/operations/condition/index.js +4 -10
  266. package/dist/operations/exec/index.js +1 -2
  267. package/dist/operations/item-create/index.js +18 -26
  268. package/dist/operations/item-delete/index.js +21 -31
  269. package/dist/operations/item-read/index.js +21 -31
  270. package/dist/operations/item-update/index.js +23 -36
  271. package/dist/operations/log/index.js +1 -2
  272. package/dist/operations/mail/index.js +5 -8
  273. package/dist/operations/mail/rate-limiter.js +6 -10
  274. package/dist/operations/notification/index.js +13 -19
  275. package/dist/operations/request/index.js +8 -13
  276. package/dist/operations/throw-error/index.js +1 -2
  277. package/dist/operations/trigger/index.js +4 -8
  278. package/dist/packages/types/dist/index.js +219 -231
  279. package/dist/permissions/cache.js +2 -3
  280. package/dist/permissions/lib/fetch-permissions.js +1 -3
  281. package/dist/permissions/lib/fetch-policies.js +5 -10
  282. package/dist/permissions/modules/fetch-accountability-collection-access/fetch-accountability-collection-access.js +19 -32
  283. package/dist/permissions/modules/fetch-allowed-collections/fetch-allowed-collections.js +7 -12
  284. package/dist/permissions/modules/fetch-allowed-field-map/fetch-allowed-field-map.js +8 -17
  285. package/dist/permissions/modules/fetch-global-access/fetch-global-access.js +1 -1
  286. package/dist/permissions/modules/fetch-inconsistent-field-map/fetch-inconsistent-field-map.js +6 -10
  287. package/dist/permissions/modules/fetch-policies-ip-access/fetch-policies-ip-access.js +9 -15
  288. package/dist/permissions/modules/process-ast/lib/extract-fields-from-children.js +2 -8
  289. package/dist/permissions/modules/process-ast/lib/extract-fields-from-query.js +32 -34
  290. package/dist/permissions/modules/process-ast/lib/field-map-from-ast.js +2 -2
  291. package/dist/permissions/modules/process-ast/lib/get-cases.js +3 -8
  292. package/dist/permissions/modules/process-ast/lib/inject-cases.js +6 -19
  293. package/dist/permissions/modules/process-ast/process-ast.js +4 -12
  294. package/dist/permissions/modules/process-ast/utils/collections-in-field-map.js +2 -4
  295. package/dist/permissions/modules/process-ast/utils/dedupe-access.js +6 -10
  296. package/dist/permissions/modules/process-ast/utils/extract-paths-from-query.js +9 -25
  297. package/dist/permissions/modules/process-ast/utils/find-related-collection.js +1 -3
  298. package/dist/permissions/modules/process-ast/utils/flatten-filter.js +7 -10
  299. package/dist/permissions/modules/process-ast/utils/get-info-for-path.js +4 -6
  300. package/dist/permissions/modules/process-ast/utils/validate-path/create-error.js +1 -2
  301. package/dist/permissions/modules/process-ast/utils/validate-path/validate-path-existence.js +3 -8
  302. package/dist/permissions/modules/process-ast/utils/validate-path/validate-path-permissions.js +5 -13
  303. package/dist/permissions/modules/process-payload/lib/is-field-nullable.js +1 -2
  304. package/dist/permissions/modules/process-payload/process-payload.js +6 -15
  305. package/dist/permissions/modules/validate-access/lib/validate-collection-access.js +2 -3
  306. package/dist/permissions/modules/validate-access/lib/validate-item-access.js +14 -28
  307. package/dist/permissions/modules/validate-access/validate-access.js +5 -15
  308. package/dist/permissions/modules/validate-remaining-admin/validate-remaining-admin-count.js +1 -3
  309. package/dist/permissions/utils/extract-required-dynamic-variable-context.js +10 -15
  310. package/dist/permissions/utils/fetch-dynamic-variable-data.js +17 -35
  311. package/dist/permissions/utils/fetch-raw-permissions.js +3 -9
  312. package/dist/permissions/utils/fetch-share-info.js +1 -2
  313. package/dist/permissions/utils/filter-policies-by-ip.js +2 -6
  314. package/dist/permissions/utils/get-permissions-for-share.js +22 -47
  315. package/dist/permissions/utils/get-unaliased-field-key.js +2 -5
  316. package/dist/permissions/utils/merge-permissions.js +13 -36
  317. package/dist/permissions/utils/with-cache.js +1 -3
  318. package/dist/rate-limiter.js +2 -7
  319. package/dist/redis/lib/create-redis.js +1 -2
  320. package/dist/redis/lib/use-redis.js +1 -1
  321. package/dist/redis/utils/redis-config-available.js +1 -3
  322. package/dist/request/agent-with-ip-validation.js +3 -7
  323. package/dist/request/is-denied-ip.js +1 -3
  324. package/dist/schedules/metrics.js +4 -11
  325. package/dist/schedules/retention.js +17 -33
  326. package/dist/schedules/telemetry.js +1 -2
  327. package/dist/schedules/tus.js +5 -7
  328. package/dist/server.js +12 -24
  329. package/dist/services/access.js +1 -3
  330. package/dist/services/assets/name-deduper.js +2 -6
  331. package/dist/services/assets.js +43 -79
  332. package/dist/services/authentication.js +63 -96
  333. package/dist/services/collections.js +107 -218
  334. package/dist/services/comments.js +18 -32
  335. package/dist/services/deployment-projects.js +17 -31
  336. package/dist/services/deployment.js +63 -106
  337. package/dist/services/extensions.js +25 -63
  338. package/dist/services/fields/build-collection-and-field-relations.js +8 -14
  339. package/dist/services/fields/get-collection-meta-updates.js +4 -12
  340. package/dist/services/fields/get-collection-relation-list.js +2 -4
  341. package/dist/services/fields.js +162 -314
  342. package/dist/services/files/lib/extract-metadata.js +7 -20
  343. package/dist/services/files/utils/get-metadata.js +31 -64
  344. package/dist/services/files/utils/parse-image-metadata.js +7 -19
  345. package/dist/services/files.js +102 -173
  346. package/dist/services/flows.js +3 -6
  347. package/dist/services/folders.js +13 -17
  348. package/dist/services/graphql/errors/format.js +2 -2
  349. package/dist/services/graphql/index.js +4 -13
  350. package/dist/services/graphql/resolvers/get-collection-type.js +1 -3
  351. package/dist/services/graphql/resolvers/get-field-type.js +1 -3
  352. package/dist/services/graphql/resolvers/get-relation-type.js +1 -3
  353. package/dist/services/graphql/resolvers/mutation.js +6 -14
  354. package/dist/services/graphql/resolvers/query.js +3 -10
  355. package/dist/services/graphql/resolvers/system-admin.js +13 -27
  356. package/dist/services/graphql/resolvers/system-global.js +31 -71
  357. package/dist/services/graphql/resolvers/system.js +209 -245
  358. package/dist/services/graphql/schema/get-types.js +69 -101
  359. package/dist/services/graphql/schema/index.js +74 -92
  360. package/dist/services/graphql/schema/parse-args.js +1 -2
  361. package/dist/services/graphql/schema/parse-query.js +8 -21
  362. package/dist/services/graphql/schema/read.js +83 -106
  363. package/dist/services/graphql/schema/write.js +36 -41
  364. package/dist/services/graphql/subscription.js +30 -51
  365. package/dist/services/graphql/types/bigint.js +5 -15
  366. package/dist/services/graphql/types/string-or-float.js +2 -6
  367. package/dist/services/graphql/utils/add-path-to-validation-error.js +1 -3
  368. package/dist/services/graphql/utils/aggregate-query.js +2 -6
  369. package/dist/services/graphql/utils/dedupe-resolvers.js +8 -13
  370. package/dist/services/graphql/utils/filter-replace-m2a.js +9 -18
  371. package/dist/services/graphql/utils/process-error.js +21 -31
  372. package/dist/services/graphql/utils/replace-fragments.js +2 -5
  373. package/dist/services/graphql/utils/replace-funcs.js +2 -5
  374. package/dist/services/graphql/utils/sanitize-gql-schema.js +10 -21
  375. package/dist/services/import-export.js +68 -143
  376. package/dist/services/items.js +126 -271
  377. package/dist/services/mail/index.js +13 -26
  378. package/dist/services/mail/rate-limiter.js +6 -10
  379. package/dist/services/meta.js +4 -9
  380. package/dist/services/notifications.js +2 -3
  381. package/dist/services/operations.js +3 -6
  382. package/dist/services/payload.js +188 -316
  383. package/dist/services/permissions.js +14 -26
  384. package/dist/services/policies.js +7 -18
  385. package/dist/services/relations.js +82 -181
  386. package/dist/services/revisions.js +8 -15
  387. package/dist/services/roles.js +4 -12
  388. package/dist/services/schema.js +4 -9
  389. package/dist/services/server.js +31 -66
  390. package/dist/services/shares.js +25 -35
  391. package/dist/services/specifications.js +87 -139
  392. package/dist/services/tfa.js +8 -24
  393. package/dist/services/translations.js +6 -12
  394. package/dist/services/tus/data-store.js +23 -55
  395. package/dist/services/tus/lockers.js +4 -10
  396. package/dist/services/tus/server.js +2 -5
  397. package/dist/services/users.js +79 -153
  398. package/dist/services/utils.js +12 -31
  399. package/dist/services/versions.js +52 -96
  400. package/dist/services/websocket.js +8 -12
  401. package/dist/storage/get-storage-driver.js +2 -5
  402. package/dist/storage/register-drivers.js +1 -3
  403. package/dist/storage/register-locations.js +2 -4
  404. package/dist/synchronization.js +6 -17
  405. package/dist/telemetry/counter/use-buffered-counter.js +6 -22
  406. package/dist/telemetry/counter/use-counters.js +2 -6
  407. package/dist/telemetry/lib/send-report.js +2 -6
  408. package/dist/telemetry/lib/track.js +3 -8
  409. package/dist/telemetry/utils/check-user-limits.js +3 -9
  410. package/dist/telemetry/utils/format-api-request-counts.js +1 -3
  411. package/dist/telemetry/utils/get-extension-count.js +3 -8
  412. package/dist/telemetry/utils/get-item-count.js +2 -5
  413. package/dist/telemetry/utils/get-settings.js +2 -3
  414. package/dist/telemetry/utils/get-user-item-count.js +2 -4
  415. package/dist/telemetry/utils/should-check-user-limits.js +1 -3
  416. package/dist/types/index.js +0 -6
  417. package/dist/utils/apply-diff.js +111 -143
  418. package/dist/utils/apply-snapshot.js +1 -2
  419. package/dist/utils/calculate-field-depth.js +6 -19
  420. package/dist/utils/construct-flow-tree.js +5 -12
  421. package/dist/utils/create-admin.js +1 -2
  422. package/dist/utils/deep-map-response.js +31 -35
  423. package/dist/utils/encrypt.js +2 -3
  424. package/dist/utils/fetch-user-count/fetch-access-lookup.js +5 -15
  425. package/dist/utils/fetch-user-count/get-user-count-query.js +4 -12
  426. package/dist/utils/filter-items.js +9 -14
  427. package/dist/utils/freeze-schema.js +3 -8
  428. package/dist/utils/generate-translations.js +87 -137
  429. package/dist/utils/get-accountability-for-role.js +12 -17
  430. package/dist/utils/get-accountability-for-token.js +25 -31
  431. package/dist/utils/get-address.js +2 -7
  432. package/dist/utils/get-allowed-log-levels.js +1 -3
  433. package/dist/utils/get-auth-providers.js +12 -14
  434. package/dist/utils/get-cache-headers.js +2 -4
  435. package/dist/utils/get-cache-key.js +16 -4
  436. package/dist/utils/get-collection-from-alias.js +1 -6
  437. package/dist/utils/get-column-path.js +10 -21
  438. package/dist/utils/get-config-from-env.js +6 -15
  439. package/dist/utils/get-default-index-name.js +2 -4
  440. package/dist/utils/get-default-value.js +5 -9
  441. package/dist/utils/get-field-relational-depth.js +2 -5
  442. package/dist/utils/get-graphql-query-and-variables.js +1 -2
  443. package/dist/utils/get-graphql-type.js +1 -3
  444. package/dist/utils/get-ip-from-req.js +6 -15
  445. package/dist/utils/get-local-type.js +5 -13
  446. package/dist/utils/get-milliseconds.js +1 -3
  447. package/dist/utils/get-module-default.js +1 -3
  448. package/dist/utils/get-schema.js +9 -21
  449. package/dist/utils/get-secret.js +2 -6
  450. package/dist/utils/get-snapshot-diff.js +15 -23
  451. package/dist/utils/get-snapshot.js +6 -17
  452. package/dist/utils/is-directus-jwt.js +1 -2
  453. package/dist/utils/is-field-allowed.js +1 -3
  454. package/dist/utils/job-queue.js +2 -7
  455. package/dist/utils/jwt.js +7 -13
  456. package/dist/utils/md.js +1 -2
  457. package/dist/utils/parse-filter-key.js +2 -4
  458. package/dist/utils/parse-numeric-string.js +5 -11
  459. package/dist/utils/permissions-cacheable.js +9 -22
  460. package/dist/utils/redact-object.js +27 -57
  461. package/dist/utils/reduce-schema.js +8 -25
  462. package/dist/utils/sanitize-query.js +46 -98
  463. package/dist/utils/sanitize-schema.js +2 -3
  464. package/dist/utils/schedule.js +2 -6
  465. package/dist/utils/should-clear-cache.js +2 -6
  466. package/dist/utils/should-skip-cache.js +3 -8
  467. package/dist/utils/split-fields.js +4 -12
  468. package/dist/utils/stall.js +1 -3
  469. package/dist/utils/store.js +2 -5
  470. package/dist/utils/transaction.js +29 -58
  471. package/dist/utils/transformations.js +28 -43
  472. package/dist/utils/translations-shared.js +4 -12
  473. package/dist/utils/url.js +3 -10
  474. package/dist/utils/user-name.js +4 -12
  475. package/dist/utils/validate-diff.js +10 -35
  476. package/dist/utils/validate-env.js +3 -5
  477. package/dist/utils/validate-keys.js +4 -10
  478. package/dist/utils/validate-query.js +67 -118
  479. package/dist/utils/validate-snapshot.js +3 -9
  480. package/dist/utils/validate-storage.js +12 -19
  481. package/dist/utils/validate-user-count-integrity.js +3 -9
  482. package/dist/utils/verify-session-jwt.js +2 -6
  483. package/dist/utils/versioning/handle-version.js +10 -29
  484. package/dist/utils/versioning/merge-version-data.js +1 -5
  485. package/dist/utils/versioning/split-recursive.js +6 -3
  486. package/dist/websocket/authenticate.js +7 -18
  487. package/dist/websocket/collab/calculate-cache-metadata.js +33 -51
  488. package/dist/websocket/collab/collab.js +49 -113
  489. package/dist/websocket/collab/filter-to-fields.js +2 -5
  490. package/dist/websocket/collab/messenger.js +48 -73
  491. package/dist/websocket/collab/payload-permissions.js +20 -51
  492. package/dist/websocket/collab/permissions-cache.js +17 -46
  493. package/dist/websocket/collab/room.js +57 -124
  494. package/dist/websocket/collab/verify-permissions.js +37 -48
  495. package/dist/websocket/controllers/base.js +34 -61
  496. package/dist/websocket/controllers/graphql.js +11 -18
  497. package/dist/websocket/controllers/index.js +3 -12
  498. package/dist/websocket/controllers/logs.js +3 -7
  499. package/dist/websocket/errors.js +2 -5
  500. package/dist/websocket/handlers/heartbeat.js +11 -19
  501. package/dist/websocket/handlers/index.js +5 -15
  502. package/dist/websocket/handlers/items.js +15 -26
  503. package/dist/websocket/handlers/logs.js +24 -41
  504. package/dist/websocket/handlers/subscribe.js +37 -66
  505. package/dist/websocket/utils/get-expires-at-for-token.js +1 -3
  506. package/dist/websocket/utils/items.js +10 -27
  507. package/dist/websocket/utils/message.js +6 -10
  508. package/package.json +23 -23
  509. package/dist/__utils__/items-utils.js +0 -32
  510. package/dist/__utils__/schemas.js +0 -297
  511. package/dist/__utils__/snapshots.js +0 -899
  512. package/dist/database/run-ast/lib/apply-query/mock.js +0 -9
  513. package/dist/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.js +0 -445
  514. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/index.js +0 -176
  515. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/system/policy.js +0 -54
  516. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/any/any.js +0 -13
  517. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/any/index.js +0 -3
  518. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/argument/argument.js +0 -15
  519. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/argument/index.js +0 -3
  520. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/array/array.js +0 -16
  521. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/array/index.js +0 -3
  522. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/async-iterator/async-iterator.js +0 -16
  523. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/async-iterator/index.js +0 -3
  524. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/awaited/awaited.js +0 -37
  525. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/awaited/index.js +0 -3
  526. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/bigint/bigint.js +0 -16
  527. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/bigint/index.js +0 -3
  528. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/boolean/boolean.js +0 -16
  529. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/boolean/index.js +0 -3
  530. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/clone/index.js +0 -4
  531. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/clone/type.js +0 -17
  532. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/clone/value.js +0 -35
  533. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/composite/composite.js +0 -42
  534. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/composite/index.js +0 -3
  535. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/computed/computed.js +0 -16
  536. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/computed/index.js +0 -3
  537. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/const/const.js +0 -52
  538. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/const/index.js +0 -3
  539. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/constructor/constructor.js +0 -17
  540. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/constructor/index.js +0 -3
  541. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/constructor-parameters/constructor-parameters.js +0 -14
  542. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/constructor-parameters/index.js +0 -3
  543. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/create/immutable.js +0 -32
  544. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/create/index.js +0 -3
  545. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/create/type.js +0 -20
  546. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/date/date.js +0 -15
  547. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/date/index.js +0 -3
  548. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/discard/discard.js +0 -12
  549. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/discard/index.js +0 -3
  550. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/enum/enum.js +0 -23
  551. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/enum/index.js +0 -3
  552. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/error/error.js +0 -10
  553. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/error/index.js +0 -3
  554. 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
  555. 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
  556. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/exclude/exclude.js +0 -25
  557. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/exclude/index.js +0 -5
  558. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/extends/extends-check.js +0 -267
  559. 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
  560. 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
  561. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/extends/extends-undefined.js +0 -21
  562. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/extends/extends.js +0 -20
  563. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/extends/index.js +0 -7
  564. 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
  565. 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
  566. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/extract/extract.js +0 -25
  567. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/extract/index.js +0 -5
  568. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/function/function.js +0 -17
  569. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/function/index.js +0 -3
  570. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/guard/index.js +0 -5
  571. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/guard/kind.js +0 -204
  572. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/guard/type.js +0 -293
  573. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/guard/value.js +0 -68
  574. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/helpers/helpers.js +0 -8
  575. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/helpers/index.js +0 -3
  576. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/indexed/index.js +0 -6
  577. 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
  578. 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
  579. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-property-keys.js +0 -24
  580. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/indexed/indexed.js +0 -67
  581. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/instance-type/index.js +0 -3
  582. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/instance-type/instance-type.js +0 -13
  583. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/instantiate/index.js +0 -3
  584. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/instantiate/instantiate.js +0 -102
  585. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/integer/index.js +0 -3
  586. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/integer/integer.js +0 -15
  587. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/intersect/index.js +0 -5
  588. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/intersect/intersect-create.js +0 -23
  589. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/intersect/intersect-evaluated.js +0 -35
  590. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/intersect/intersect-type.js +0 -3
  591. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/intersect/intersect.js +0 -17
  592. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/intrinsic/capitalize.js +0 -10
  593. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/intrinsic/index.js +0 -8
  594. 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
  595. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/intrinsic/intrinsic.js +0 -54
  596. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/intrinsic/lowercase.js +0 -10
  597. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/intrinsic/uncapitalize.js +0 -10
  598. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/intrinsic/uppercase.js +0 -10
  599. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/iterator/index.js +0 -3
  600. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/iterator/iterator.js +0 -16
  601. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/keyof/index.js +0 -6
  602. 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
  603. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/keyof/keyof-property-entries.js +0 -17
  604. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/keyof/keyof-property-keys.js +0 -52
  605. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/keyof/keyof.js +0 -38
  606. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/literal/index.js +0 -3
  607. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/literal/literal.js +0 -16
  608. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/mapped/index.js +0 -5
  609. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/mapped/mapped-key.js +0 -14
  610. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/mapped/mapped-result.js +0 -14
  611. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/mapped/mapped.js +0 -86
  612. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/module/compute.js +0 -144
  613. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/module/index.js +0 -3
  614. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/module/module.js +0 -44
  615. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/never/index.js +0 -3
  616. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/never/never.js +0 -15
  617. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/not/index.js +0 -3
  618. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/not/not.js +0 -15
  619. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/null/index.js +0 -3
  620. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/null/null.js +0 -15
  621. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/number/index.js +0 -3
  622. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/number/number.js +0 -15
  623. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/object/index.js +0 -3
  624. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/object/object.js +0 -33
  625. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/omit/index.js +0 -5
  626. 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
  627. 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
  628. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/omit/omit.js +0 -65
  629. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/optional/index.js +0 -4
  630. 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
  631. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/optional/optional.js +0 -29
  632. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/parameters/index.js +0 -3
  633. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/parameters/parameters.js +0 -14
  634. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/partial/index.js +0 -4
  635. 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
  636. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/partial/partial.js +0 -62
  637. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/patterns/index.js +0 -3
  638. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/patterns/patterns.js +0 -12
  639. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/pick/index.js +0 -5
  640. 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
  641. 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
  642. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/pick/pick.js +0 -63
  643. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/promise/index.js +0 -3
  644. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/promise/promise.js +0 -16
  645. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/readonly/index.js +0 -4
  646. 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
  647. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/readonly/readonly.js +0 -29
  648. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/readonly-optional/index.js +0 -3
  649. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/readonly-optional/readonly-optional.js +0 -13
  650. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/record/index.js +0 -3
  651. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/record/record.js +0 -92
  652. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/recursive/index.js +0 -3
  653. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/recursive/recursive.js +0 -24
  654. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/ref/index.js +0 -3
  655. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/ref/ref.js +0 -19
  656. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/regexp/index.js +0 -3
  657. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/regexp/regexp.js +0 -19
  658. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/registry/format.js +0 -30
  659. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/registry/index.js +0 -4
  660. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/registry/type.js +0 -30
  661. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/required/index.js +0 -4
  662. 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
  663. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/required/required.js +0 -60
  664. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/rest/index.js +0 -3
  665. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/rest/rest.js +0 -13
  666. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/return-type/index.js +0 -3
  667. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/return-type/return-type.js +0 -13
  668. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/schema/anyschema.js +0 -1
  669. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/schema/index.js +0 -4
  670. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/schema/schema.js +0 -3
  671. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/sets/index.js +0 -3
  672. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/sets/set.js +0 -42
  673. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/static/index.js +0 -3
  674. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/static/static.js +0 -1
  675. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/string/index.js +0 -3
  676. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/string/string.js +0 -15
  677. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/symbol/index.js +0 -3
  678. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/symbol/symbol.js +0 -15
  679. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/symbols/index.js +0 -3
  680. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/symbols/symbols.js +0 -14
  681. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/template-literal/finite.js +0 -28
  682. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/template-literal/generate.js +0 -37
  683. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/template-literal/index.js +0 -9
  684. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/template-literal/parse.js +0 -125
  685. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/template-literal/pattern.js +0 -24
  686. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/template-literal/syntax.js +0 -55
  687. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/template-literal/template-literal.js +0 -20
  688. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/template-literal/union.js +0 -16
  689. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/transform/index.js +0 -3
  690. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/transform/transform.js +0 -51
  691. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/tuple/index.js +0 -3
  692. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/tuple/tuple.js +0 -24
  693. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/type/index.js +0 -10
  694. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/type/javascript.js +0 -123
  695. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/type/json.js +0 -263
  696. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/type/type.js +0 -191
  697. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/uint8array/index.js +0 -3
  698. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/uint8array/uint8array.js +0 -15
  699. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/undefined/index.js +0 -3
  700. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/undefined/undefined.js +0 -15
  701. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/union/index.js +0 -5
  702. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/union/union-create.js +0 -14
  703. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/union/union-evaluated.js +0 -33
  704. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/union/union-type.js +0 -3
  705. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/union/union.js +0 -13
  706. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/unknown/index.js +0 -3
  707. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/unknown/unknown.js +0 -12
  708. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/unsafe/index.js +0 -3
  709. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/unsafe/unsafe.js +0 -12
  710. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/void/index.js +0 -3
  711. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/void/void.js +0 -15
  712. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/value/guard/guard.js +0 -140
  713. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/value/guard/index.js +0 -3
  714. package/dist/node_modules/.pnpm/@vitest_expect@3.2.4/node_modules/@vitest/expect/dist/index.js +0 -1714
  715. package/dist/node_modules/.pnpm/@vitest_pretty-format@3.2.4/node_modules/@vitest/pretty-format/dist/index.js +0 -1287
  716. package/dist/node_modules/.pnpm/@vitest_runner@3.2.4/node_modules/@vitest/runner/dist/chunk-hooks.js +0 -2151
  717. package/dist/node_modules/.pnpm/@vitest_runner@3.2.4/node_modules/@vitest/runner/dist/index.js +0 -8
  718. package/dist/node_modules/.pnpm/@vitest_runner@3.2.4/node_modules/@vitest/runner/dist/utils.js +0 -8
  719. package/dist/node_modules/.pnpm/@vitest_snapshot@3.2.4/node_modules/@vitest/snapshot/dist/index.js +0 -2082
  720. package/dist/node_modules/.pnpm/@vitest_spy@3.2.4/node_modules/@vitest/spy/dist/index.js +0 -192
  721. package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/chunk-_commonjsHelpers.js +0 -158
  722. package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/diff.js +0 -1535
  723. package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/error.js +0 -155
  724. package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/helpers.js +0 -244
  725. package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/index.js +0 -621
  726. package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/source-map.js +0 -890
  727. package/dist/node_modules/.pnpm/chai@5.3.3/node_modules/chai/index.js +0 -3558
  728. package/dist/node_modules/.pnpm/expect-type@1.2.2/node_modules/expect-type/dist/branding.js +0 -13
  729. package/dist/node_modules/.pnpm/expect-type@1.2.2/node_modules/expect-type/dist/index.js +0 -115
  730. package/dist/node_modules/.pnpm/expect-type@1.2.2/node_modules/expect-type/dist/messages.js +0 -77
  731. package/dist/node_modules/.pnpm/expect-type@1.2.2/node_modules/expect-type/dist/overloads.js +0 -13
  732. package/dist/node_modules/.pnpm/expect-type@1.2.2/node_modules/expect-type/dist/utils.js +0 -30
  733. package/dist/node_modules/.pnpm/js-tokens@9.0.1/node_modules/js-tokens/index.js +0 -398
  734. 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
  735. 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
  736. 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
  737. 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
  738. 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
  739. 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
  740. package/dist/node_modules/.pnpm/lodash.clonedeep@4.5.0/node_modules/lodash.clonedeep/index.js +0 -1486
  741. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/arguments.js +0 -11
  742. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/array.js +0 -18
  743. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/bigint.js +0 -11
  744. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/class.js +0 -19
  745. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/date.js +0 -15
  746. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/error.js +0 -39
  747. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/function.js +0 -14
  748. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/helpers.js +0 -141
  749. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/html.js +0 -43
  750. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/index.js +0 -138
  751. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/map.js +0 -25
  752. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/number.js +0 -22
  753. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/object.js +0 -27
  754. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/promise.js +0 -6
  755. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/regexp.js +0 -12
  756. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/set.js +0 -18
  757. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/string.js +0 -27
  758. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/symbol.js +0 -10
  759. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/typedarray.js +0 -36
  760. package/dist/node_modules/.pnpm/magic-string@0.30.21/node_modules/magic-string/dist/magic-string.es.js +0 -1258
  761. package/dist/node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/index.js +0 -21
  762. package/dist/node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.js +0 -478
  763. package/dist/node_modules/.pnpm/strip-literal@3.1.0/node_modules/strip-literal/dist/index.js +0 -84
  764. package/dist/node_modules/.pnpm/tinyrainbow@2.0.0/node_modules/tinyrainbow/dist/chunk-BVHSVHOK.js +0 -85
  765. package/dist/node_modules/.pnpm/tinyrainbow@2.0.0/node_modules/tinyrainbow/dist/node.js +0 -15
  766. package/dist/node_modules/.pnpm/tinyspy@4.0.4/node_modules/tinyspy/dist/index.js +0 -158
  767. 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
  768. 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
  769. 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
  770. 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
  771. 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
  772. 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
  773. 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
  774. package/dist/test-utils/cache.js +0 -64
  775. package/dist/test-utils/controllers.js +0 -101
  776. package/dist/test-utils/database.js +0 -54
  777. package/dist/test-utils/emitter.js +0 -38
  778. package/dist/test-utils/env.js +0 -77
  779. package/dist/test-utils/knex.js +0 -222
  780. package/dist/test-utils/schema.js +0 -35
  781. package/dist/test-utils/services/fields-service.js +0 -38
  782. package/dist/test-utils/services/files-service.js +0 -35
  783. package/dist/test-utils/services/folders-service.js +0 -34
  784. package/dist/test-utils/services/items-service.js +0 -52
  785. package/dist/test-utils/storage.js +0 -150
@@ -3,27 +3,21 @@ import { clamp } from "lodash-es";
3
3
  //#region src/utils/transformations.ts
4
4
  function resolvePreset({ transformationParams, acceptFormat }, file) {
5
5
  const transforms = transformationParams.transforms ? [...transformationParams.transforms] : [];
6
- if (transformationParams.format || transformationParams.quality) {
7
- transforms.push([
8
- "toFormat",
9
- getFormat(file, transformationParams.format, acceptFormat),
10
- { quality: transformationParams.quality ? Number(transformationParams.quality) : undefined }
11
- ]);
12
- }
6
+ if (transformationParams.format || transformationParams.quality) transforms.push([
7
+ "toFormat",
8
+ getFormat(file, transformationParams.format, acceptFormat),
9
+ { quality: transformationParams.quality ? Number(transformationParams.quality) : void 0 }
10
+ ]);
13
11
  if ((transformationParams.width || transformationParams.height) && file.width && file.height) {
14
- let toWidth = transformationParams.width ? Number(transformationParams.width) : undefined;
15
- let toHeight = transformationParams.height ? Number(transformationParams.height) : undefined;
12
+ let toWidth = transformationParams.width ? Number(transformationParams.width) : void 0;
13
+ let toHeight = transformationParams.height ? Number(transformationParams.height) : void 0;
16
14
  if (transformationParams.withoutEnlargement) {
17
- if (toWidth !== undefined) {
18
- toWidth = Math.min(toWidth, file.width);
19
- }
20
- if (toHeight !== undefined) {
21
- toHeight = Math.min(toHeight, file.height);
22
- }
15
+ if (toWidth !== void 0) toWidth = Math.min(toWidth, file.width);
16
+ if (toHeight !== void 0) toHeight = Math.min(toHeight, file.height);
23
17
  }
24
18
  const toFocalPointX = transformationParams.focal_point_x ? Number(transformationParams.focal_point_x) : file.focal_point_x;
25
19
  const toFocalPointY = transformationParams.focal_point_y ? Number(transformationParams.focal_point_y) : file.focal_point_y;
26
- if ((transformationParams.fit === undefined || transformationParams.fit === "cover") && toWidth && toHeight && toFocalPointX !== null && toFocalPointY !== null) {
20
+ if ((transformationParams.fit === void 0 || transformationParams.fit === "cover") && toWidth && toHeight && toFocalPointX !== null && toFocalPointY !== null) {
27
21
  const transformArgs = getResizeArguments({
28
22
  w: file.width,
29
23
  h: file.height
@@ -38,35 +32,27 @@ function resolvePreset({ transformationParams, acceptFormat }, file) {
38
32
  width: transformArgs.width,
39
33
  height: transformArgs.height,
40
34
  fit: transformationParams.fit,
41
- withoutEnlargement: transformationParams.withoutEnlargement ? Boolean(transformationParams.withoutEnlargement) : undefined
35
+ withoutEnlargement: transformationParams.withoutEnlargement ? Boolean(transformationParams.withoutEnlargement) : void 0
42
36
  }], ["extract", transformArgs.region]);
43
- } else {
44
- transforms.push(["resize", {
45
- width: toWidth,
46
- height: toHeight,
47
- fit: transformationParams.fit,
48
- withoutEnlargement: transformationParams.withoutEnlargement ? Boolean(transformationParams.withoutEnlargement) : undefined
49
- }]);
50
- }
37
+ } else transforms.push(["resize", {
38
+ width: toWidth,
39
+ height: toHeight,
40
+ fit: transformationParams.fit,
41
+ withoutEnlargement: transformationParams.withoutEnlargement ? Boolean(transformationParams.withoutEnlargement) : void 0
42
+ }]);
51
43
  }
52
44
  return transforms;
53
45
  }
54
46
  function getFormat(file, format, acceptFormat) {
55
47
  const fileType = file.type?.split("/")[1];
56
48
  if (format) {
57
- if (format !== "auto") {
58
- return format;
59
- }
60
- if (acceptFormat) {
61
- return acceptFormat;
62
- }
49
+ if (format !== "auto") return format;
50
+ if (acceptFormat) return acceptFormat;
63
51
  if (fileType && [
64
52
  "avif",
65
53
  "webp",
66
54
  "tiff"
67
- ].includes(fileType)) {
68
- return "png";
69
- }
55
+ ].includes(fileType)) return "png";
70
56
  }
71
57
  return fileType || "jpg";
72
58
  }
@@ -76,7 +62,7 @@ function getFormat(file, format, acceptFormat) {
76
62
  function maybeExtractFormat(transforms) {
77
63
  const toFormats = transforms.filter((t) => t[0] === "toFormat");
78
64
  const lastToFormat = toFormats[toFormats.length - 1];
79
- return lastToFormat ? lastToFormat[1]?.toString() : undefined;
65
+ return lastToFormat ? lastToFormat[1]?.toString() : void 0;
80
66
  }
81
67
  /**
82
68
  * Resize an image but keep it centered on the focal point.
@@ -84,17 +70,16 @@ function maybeExtractFormat(transforms) {
84
70
  */
85
71
  function getResizeArguments(original, target, focalPoint) {
86
72
  const { width, height, factor } = getIntermediateDimensions(original, target);
87
- const region = getExtractionRegion(factor, focalPoint ?? {
88
- x: original.w / 2,
89
- y: original.h / 2
90
- }, target, {
91
- w: width,
92
- h: height
93
- });
94
73
  return {
95
74
  width,
96
75
  height,
97
- region
76
+ region: getExtractionRegion(factor, focalPoint ?? {
77
+ x: original.w / 2,
78
+ y: original.h / 2
79
+ }, target, {
80
+ w: width,
81
+ h: height
82
+ })
98
83
  };
99
84
  }
100
85
  /**
@@ -8,21 +8,15 @@ const STRIPPED_ON_CLONE_SPECIALS = new Set(TRANSLATIONS_STRIPPED_ON_CLONE_SPECIA
8
8
  function validateFieldsEligibility(sourceFields) {
9
9
  for (const sourceField of sourceFields) {
10
10
  const specials = Array.isArray(sourceField.meta?.special) ? sourceField.meta.special : [];
11
- if (sourceField.type === "alias" || sourceField.meta?.system === true || sourceField.schema?.has_auto_increment === true) {
12
- throw new InvalidPayloadError({ reason: `Field "${sourceField.field}" is not eligible for translations` });
13
- }
14
- if (specials.some((special) => DANGEROUS_SPECIALS.has(special) || RELATIONAL_SPECIALS.has(special))) {
15
- throw new InvalidPayloadError({ reason: `Field "${sourceField.field}" is not eligible for translations` });
16
- }
11
+ if (sourceField.type === "alias" || sourceField.meta?.system === true || sourceField.schema?.has_auto_increment === true) throw new InvalidPayloadError({ reason: `Field "${sourceField.field}" is not eligible for translations` });
12
+ if (specials.some((special) => DANGEROUS_SPECIALS.has(special) || RELATIONAL_SPECIALS.has(special))) throw new InvalidPayloadError({ reason: `Field "${sourceField.field}" is not eligible for translations` });
17
13
  }
18
14
  }
19
15
  function cloneFields(options) {
20
16
  const { fields: fieldNames, sourceFields } = options;
21
17
  return fieldNames.map((fieldName) => {
22
18
  const sourceField = sourceFields.find((field) => field.field === fieldName);
23
- if (!sourceField) {
24
- throw new InvalidPayloadError({ reason: `Field "${fieldName}" does not exist in source fields` });
25
- }
19
+ if (!sourceField) throw new InvalidPayloadError({ reason: `Field "${fieldName}" does not exist in source fields` });
26
20
  const clonedMeta = { ...sourceField.meta ?? {} };
27
21
  delete clonedMeta.id;
28
22
  delete clonedMeta.collection;
@@ -33,9 +27,7 @@ function cloneFields(options) {
33
27
  clonedMeta.readonly = false;
34
28
  if (Array.isArray(clonedMeta.special)) {
35
29
  clonedMeta.special = clonedMeta.special.filter((special) => !STRIPPED_ON_CLONE_SPECIALS.has(special));
36
- if (clonedMeta.special.length === 0) {
37
- clonedMeta.special = null;
38
- }
30
+ if (clonedMeta.special.length === 0) clonedMeta.special = null;
39
31
  }
40
32
  return {
41
33
  field: fieldName,
package/dist/utils/url.js CHANGED
@@ -33,17 +33,10 @@ var Url = class {
33
33
  }
34
34
  addPath(...paths) {
35
35
  const pathToAdd = paths.flatMap((p) => String(p).split("/")).filter((p) => p !== "");
36
- for (const pathSegment of pathToAdd) {
37
- if (pathSegment === "..") {
38
- this.path.pop();
39
- } else if (pathSegment !== ".") {
40
- this.path.push(pathSegment);
41
- }
42
- }
36
+ for (const pathSegment of pathToAdd) if (pathSegment === "..") this.path.pop();
37
+ else if (pathSegment !== ".") this.path.push(pathSegment);
43
38
  const lastPath = paths.at(-1);
44
- if (pathToAdd.length > 0 && lastPath !== "." && lastPath !== "..") {
45
- this.hasTrailingSlash = typeof lastPath === "string" && lastPath.endsWith("/");
46
- }
39
+ if (pathToAdd.length > 0 && lastPath !== "." && lastPath !== "..") this.hasTrailingSlash = typeof lastPath === "string" && lastPath.endsWith("/");
47
40
  return this;
48
41
  }
49
42
  setQuery(key, value) {
@@ -1,17 +1,9 @@
1
1
  //#region src/utils/user-name.ts
2
2
  function userName(user) {
3
- if (!user) {
4
- return "Unknown User";
5
- }
6
- if (user.first_name && user.last_name) {
7
- return `${user.first_name} ${user.last_name}`;
8
- }
9
- if (user.first_name) {
10
- return user.first_name;
11
- }
12
- if (user.email) {
13
- return user.email;
14
- }
3
+ if (!user) return "Unknown User";
4
+ if (user.first_name && user.last_name) return `${user.first_name} ${user.last_name}`;
5
+ if (user.first_name) return user.first_name;
6
+ if (user.email) return user.email;
15
7
  return "Unknown User";
16
8
  }
17
9
 
@@ -58,36 +58,22 @@ const applyJoiSchema = Joi.object({
58
58
  function validateApplyDiff(applyDiff, currentSnapshotWithHash) {
59
59
  const { error } = applyJoiSchema.validate(applyDiff);
60
60
  if (error) throw new InvalidPayloadError({ reason: error.message });
61
- if (applyDiff.diff.collections.length === 0 && applyDiff.diff.fields.length === 0 && applyDiff.diff.systemFields.length === 0 && applyDiff.diff.relations.length === 0) {
62
- return false;
63
- }
61
+ if (applyDiff.diff.collections.length === 0 && applyDiff.diff.fields.length === 0 && applyDiff.diff.systemFields.length === 0 && applyDiff.diff.relations.length === 0) return false;
64
62
  if (applyDiff.hash === currentSnapshotWithHash.hash) return true;
65
63
  for (const diffCollection of applyDiff.diff.collections) {
66
64
  const collection = diffCollection.collection;
67
65
  if (diffCollection.diff[0]?.kind === DiffKind.NEW) {
68
- const existingCollection = currentSnapshotWithHash.collections.find((c) => c.collection === diffCollection.collection);
69
- if (existingCollection) {
70
- throw new InvalidPayloadError({ reason: `Provided diff is trying to create collection "${collection}" but it already exists. Please generate a new diff and try again` });
71
- }
66
+ if (currentSnapshotWithHash.collections.find((c) => c.collection === diffCollection.collection)) throw new InvalidPayloadError({ reason: `Provided diff is trying to create collection "${collection}" but it already exists. Please generate a new diff and try again` });
72
67
  } else if (diffCollection.diff[0]?.kind === DiffKind.DELETE) {
73
- const existingCollection = currentSnapshotWithHash.collections.find((c) => c.collection === diffCollection.collection);
74
- if (!existingCollection) {
75
- throw new InvalidPayloadError({ reason: `Provided diff is trying to delete collection "${collection}" but it does not exist. Please generate a new diff and try again` });
76
- }
68
+ if (!currentSnapshotWithHash.collections.find((c) => c.collection === diffCollection.collection)) throw new InvalidPayloadError({ reason: `Provided diff is trying to delete collection "${collection}" but it does not exist. Please generate a new diff and try again` });
77
69
  }
78
70
  }
79
71
  for (const diffField of applyDiff.diff.fields) {
80
72
  const field = `${diffField.collection}.${diffField.field}`;
81
73
  if (diffField.diff[0]?.kind === DiffKind.NEW) {
82
- const existingField = currentSnapshotWithHash.fields.find((f) => f.collection === diffField.collection && f.field === diffField.field);
83
- if (existingField) {
84
- throw new InvalidPayloadError({ reason: `Provided diff is trying to create field "${field}" but it already exists. Please generate a new diff and try again` });
85
- }
74
+ if (currentSnapshotWithHash.fields.find((f) => f.collection === diffField.collection && f.field === diffField.field)) throw new InvalidPayloadError({ reason: `Provided diff is trying to create field "${field}" but it already exists. Please generate a new diff and try again` });
86
75
  } else if (diffField.diff[0]?.kind === DiffKind.DELETE) {
87
- const existingField = currentSnapshotWithHash.fields.find((f) => f.collection === diffField.collection && f.field === diffField.field);
88
- if (!existingField) {
89
- throw new InvalidPayloadError({ reason: `Provided diff is trying to delete field "${field}" but it does not exist. Please generate a new diff and try again` });
90
- }
76
+ if (!currentSnapshotWithHash.fields.find((f) => f.collection === diffField.collection && f.field === diffField.field)) throw new InvalidPayloadError({ reason: `Provided diff is trying to delete field "${field}" but it does not exist. Please generate a new diff and try again` });
91
77
  }
92
78
  }
93
79
  for (const diffSystemField of applyDiff.diff.systemFields) {
@@ -95,31 +81,20 @@ function validateApplyDiff(applyDiff, currentSnapshotWithHash) {
95
81
  if (!diffSystemField.diff[0]) continue;
96
82
  if (diffSystemField.diff[0].kind !== DiffKind.EDIT) {
97
83
  let action = "update array";
98
- if (diffSystemField.diff[0].kind === DiffKind.NEW) {
99
- action = "create";
100
- } else if (diffSystemField.diff[0].kind === DiffKind.DELETE) {
101
- action = "delete";
102
- }
84
+ if (diffSystemField.diff[0].kind === DiffKind.NEW) action = "create";
85
+ else if (diffSystemField.diff[0].kind === DiffKind.DELETE) action = "delete";
103
86
  throw new InvalidPayloadError({ reason: `Provided diff is trying to ${action} field "${systemField}" but this action is not supported. Please generate a new diff and try again` });
104
87
  }
105
88
  const pathString = diffSystemField.diff[0].path?.join(".") ?? "";
106
- if (pathString.length === 0 || pathString !== "schema.is_indexed") {
107
- throw new InvalidPayloadError({ reason: `Provided diff is trying to alter property "${pathString}" on "${systemField}" but currently only "schema.is_indexed" is supported. Please generate a new diff and try again` });
108
- }
89
+ if (pathString.length === 0 || pathString !== "schema.is_indexed") throw new InvalidPayloadError({ reason: `Provided diff is trying to alter property "${pathString}" on "${systemField}" but currently only "schema.is_indexed" is supported. Please generate a new diff and try again` });
109
90
  }
110
91
  for (const diffRelation of applyDiff.diff.relations) {
111
92
  let relation = `${diffRelation.collection}.${diffRelation.field}`;
112
93
  if (diffRelation.related_collection) relation += `-> ${diffRelation.related_collection}`;
113
94
  if (diffRelation.diff[0]?.kind === DiffKind.NEW) {
114
- const existingRelation = currentSnapshotWithHash.relations.find((r) => r.collection === diffRelation.collection && r.field === diffRelation.field);
115
- if (existingRelation) {
116
- throw new InvalidPayloadError({ reason: `Provided diff is trying to create relation "${relation}" but it already exists. Please generate a new diff and try again` });
117
- }
95
+ if (currentSnapshotWithHash.relations.find((r) => r.collection === diffRelation.collection && r.field === diffRelation.field)) throw new InvalidPayloadError({ reason: `Provided diff is trying to create relation "${relation}" but it already exists. Please generate a new diff and try again` });
118
96
  } else if (diffRelation.diff[0]?.kind === DiffKind.DELETE) {
119
- const existingRelation = currentSnapshotWithHash.relations.find((r) => r.collection === diffRelation.collection && r.field === diffRelation.field);
120
- if (!existingRelation) {
121
- throw new InvalidPayloadError({ reason: `Provided diff is trying to delete relation "${relation}" but it does not exist. Please generate a new diff and try again` });
122
- }
97
+ if (!currentSnapshotWithHash.relations.find((r) => r.collection === diffRelation.collection && r.field === diffRelation.field)) throw new InvalidPayloadError({ reason: `Provided diff is trying to delete relation "${relation}" but it does not exist. Please generate a new diff and try again` });
123
98
  }
124
99
  }
125
100
  throw new InvalidPayloadError({ reason: `Provided hash does not match the current instance's schema hash, indicating the schema has changed after this diff was generated. Please generate a new diff and try again` });
@@ -5,11 +5,9 @@ import { useEnv } from "@directus/env";
5
5
  function validateEnv(requiredKeys) {
6
6
  const env = useEnv();
7
7
  const logger = useLogger();
8
- for (const requiredKey of requiredKeys) {
9
- if (requiredKey in env === false) {
10
- logger.error(`"${requiredKey}" Environment Variable is missing.`);
11
- process.exit(1);
12
- }
8
+ for (const requiredKey of requiredKeys) if (requiredKey in env === false) {
9
+ logger.error(`"${requiredKey}" Environment Variable is missing.`);
10
+ process.exit(1);
13
11
  }
14
12
  }
15
13
 
@@ -6,17 +6,11 @@ import { ForbiddenError } from "@directus/errors";
6
6
  * Validate keys based on its type
7
7
  */
8
8
  function validateKeys(schema, collection, keyField, keys) {
9
- if (Array.isArray(keys)) {
10
- for (const key of keys) {
11
- validateKeys(schema, collection, keyField, key);
12
- }
13
- } else {
9
+ if (Array.isArray(keys)) for (const key of keys) validateKeys(schema, collection, keyField, key);
10
+ else {
14
11
  const primaryKeyFieldType = schema.collections[collection]?.fields[keyField]?.type;
15
- if (primaryKeyFieldType === "uuid" && !isValidUuid(String(keys))) {
16
- throw new ForbiddenError();
17
- } else if (primaryKeyFieldType === "integer" && !Number.isInteger(Number(keys))) {
18
- throw new ForbiddenError();
19
- }
12
+ if (primaryKeyFieldType === "uuid" && !isValidUuid(String(keys))) throw new ForbiddenError();
13
+ else if (primaryKeyFieldType === "integer" && !Number.isInteger(Number(keys))) throw new ForbiddenError();
20
14
  }
21
15
  }
22
16
 
@@ -28,100 +28,77 @@ const querySchema = Joi.object({
28
28
  }).id("query");
29
29
  function validateQuery(query) {
30
30
  const { error } = querySchema.validate(query);
31
- if (query.filter && Object.keys(query.filter).length > 0) {
32
- validateFilter(query.filter);
33
- }
34
- if (query.alias) {
35
- validateAlias(query.alias);
36
- }
31
+ if (query.filter && Object.keys(query.filter).length > 0) validateFilter(query.filter);
32
+ if (query.alias) validateAlias(query.alias);
37
33
  validateRelationalDepth(query);
38
- if (error) {
39
- throw new InvalidQueryError({ reason: error.message });
40
- }
34
+ if (error) throw new InvalidQueryError({ reason: error.message });
41
35
  return query;
42
36
  }
43
37
  function validateFilter(filter) {
44
- for (const [key, nested] of Object.entries(filter)) {
45
- if (key === "_and" || key === "_or") {
46
- nested.forEach(validateFilter);
47
- } else if (key.startsWith("_")) {
48
- const value = nested;
49
- switch (key) {
50
- case "_in":
51
- case "_nin":
52
- case "_between":
53
- case "_nbetween":
54
- validateList(value, key);
55
- break;
56
- case "_null":
57
- case "_nnull":
58
- case "_empty":
59
- case "_nempty":
60
- validateBoolean(value, key);
61
- break;
62
- case "_intersects":
63
- case "_nintersects":
64
- case "_intersects_bbox":
65
- case "_nintersects_bbox":
66
- validateGeometry(value, key);
67
- break;
68
- case "_none":
69
- case "_some":
70
- validateFilter(nested);
71
- break;
72
- case "_eq":
73
- case "_neq":
74
- case "_contains":
75
- case "_ncontains":
76
- case "_starts_with":
77
- case "_nstarts_with":
78
- case "_istarts_with":
79
- case "_nistarts_with":
80
- case "_ends_with":
81
- case "_nends_with":
82
- case "_iends_with":
83
- case "_niends_with":
84
- case "_gt":
85
- case "_gte":
86
- case "_lt":
87
- case "_lte":
88
- default:
89
- validateFilterPrimitive(value, key);
90
- break;
91
- }
92
- } else if (isPlainObject(nested)) {
93
- validateFilter(nested);
94
- } else if (Array.isArray(nested) === false) {
95
- validateFilterPrimitive(nested, "_eq");
96
- } else {
97
- validateFilter(nested);
38
+ for (const [key, nested] of Object.entries(filter)) if (key === "_and" || key === "_or") nested.forEach(validateFilter);
39
+ else if (key.startsWith("_")) {
40
+ const value = nested;
41
+ switch (key) {
42
+ case "_in":
43
+ case "_nin":
44
+ case "_between":
45
+ case "_nbetween":
46
+ validateList(value, key);
47
+ break;
48
+ case "_null":
49
+ case "_nnull":
50
+ case "_empty":
51
+ case "_nempty":
52
+ validateBoolean(value, key);
53
+ break;
54
+ case "_intersects":
55
+ case "_nintersects":
56
+ case "_intersects_bbox":
57
+ case "_nintersects_bbox":
58
+ validateGeometry(value, key);
59
+ break;
60
+ case "_none":
61
+ case "_some":
62
+ validateFilter(nested);
63
+ break;
64
+ case "_eq":
65
+ case "_neq":
66
+ case "_contains":
67
+ case "_ncontains":
68
+ case "_starts_with":
69
+ case "_nstarts_with":
70
+ case "_istarts_with":
71
+ case "_nistarts_with":
72
+ case "_ends_with":
73
+ case "_nends_with":
74
+ case "_iends_with":
75
+ case "_niends_with":
76
+ case "_gt":
77
+ case "_gte":
78
+ case "_lt":
79
+ case "_lte":
80
+ default:
81
+ validateFilterPrimitive(value, key);
82
+ break;
98
83
  }
99
- }
84
+ } else if (isPlainObject(nested)) validateFilter(nested);
85
+ else if (Array.isArray(nested) === false) validateFilterPrimitive(nested, "_eq");
86
+ else validateFilter(nested);
100
87
  }
101
88
  function validateFilterPrimitive(value, key) {
102
89
  if (value === null) return true;
103
- if ((typeof value === "string" || typeof value === "number" || typeof value === "boolean" || value instanceof Date) === false) {
104
- throw new InvalidQueryError({ reason: `The filter value for "${key}" has to be a string, number, or boolean` });
105
- }
106
- if (typeof value === "number" && (Number.isNaN(value) || value > Number.MAX_SAFE_INTEGER)) {
107
- throw new InvalidQueryError({ reason: `The filter value for "${key}" is not a valid number` });
108
- }
109
- if (typeof value === "string" && value.length === 0) {
110
- throw new InvalidQueryError({ reason: `You can't filter for an empty string in "${key}". Use "_empty" or "_nempty" instead` });
111
- }
90
+ if ((typeof value === "string" || typeof value === "number" || typeof value === "boolean" || value instanceof Date) === false) throw new InvalidQueryError({ reason: `The filter value for "${key}" has to be a string, number, or boolean` });
91
+ if (typeof value === "number" && (Number.isNaN(value) || value > Number.MAX_SAFE_INTEGER)) throw new InvalidQueryError({ reason: `The filter value for "${key}" is not a valid number` });
92
+ if (typeof value === "string" && value.length === 0) throw new InvalidQueryError({ reason: `You can't filter for an empty string in "${key}". Use "_empty" or "_nempty" instead` });
112
93
  return true;
113
94
  }
114
95
  function validateList(value, key) {
115
- if (Array.isArray(value) === false || value.length === 0) {
116
- throw new InvalidQueryError({ reason: `"${key}" has to be an array of values` });
117
- }
96
+ if (Array.isArray(value) === false || value.length === 0) throw new InvalidQueryError({ reason: `"${key}" has to be an array of values` });
118
97
  return true;
119
98
  }
120
99
  function validateBoolean(value, key) {
121
100
  if (value === null || value === "") return true;
122
- if (typeof value !== "boolean") {
123
- throw new InvalidQueryError({ reason: `"${key}" has to be a boolean` });
124
- }
101
+ if (typeof value !== "boolean") throw new InvalidQueryError({ reason: `"${key}" has to be a boolean` });
125
102
  return true;
126
103
  }
127
104
  function validateGeometry(value, key) {
@@ -134,65 +111,37 @@ function validateGeometry(value, key) {
134
111
  return true;
135
112
  }
136
113
  function validateAlias(alias) {
137
- if (isPlainObject(alias) === false) {
138
- throw new InvalidQueryError({ reason: `"alias" has to be an object` });
139
- }
114
+ if (isPlainObject(alias) === false) throw new InvalidQueryError({ reason: `"alias" has to be an object` });
140
115
  for (const [key, value] of Object.entries(alias)) {
141
- if (typeof key !== "string") {
142
- throw new InvalidQueryError({ reason: `"alias" key has to be a string. "${typeof key}" given` });
143
- }
144
- if (typeof value !== "string") {
145
- throw new InvalidQueryError({ reason: `"alias" value has to be a string. "${typeof key}" given` });
146
- }
147
- if (key.includes(".") || value.includes(".")) {
148
- throw new InvalidQueryError({ reason: `"alias" key/value can't contain a period character \`.\`` });
149
- }
116
+ if (typeof key !== "string") throw new InvalidQueryError({ reason: `"alias" key has to be a string. "${typeof key}" given` });
117
+ if (typeof value !== "string") throw new InvalidQueryError({ reason: `"alias" value has to be a string. "${typeof key}" given` });
118
+ if (key.includes(".") || value.includes(".")) throw new InvalidQueryError({ reason: `"alias" key/value can't contain a period character \`.\`` });
150
119
  }
151
120
  }
152
121
  function validateRelationalDepth(query) {
153
122
  const maxRelationalDepth = Number(env["MAX_RELATIONAL_DEPTH"]) > 2 ? Number(env["MAX_RELATIONAL_DEPTH"]) : 2;
154
123
  let fields = ["*"];
155
- if (query.fields) {
156
- fields = query.fields;
157
- }
124
+ if (query.fields) fields = query.fields;
158
125
  /**
159
126
  * When using aggregate functions, you can't have any other regular fields
160
127
  * selected. This makes sure you never end up in a non-aggregate fields selection error
161
128
  */
162
- if (Object.keys(query.aggregate || {}).length > 0) {
163
- fields = [];
164
- }
129
+ if (Object.keys(query.aggregate || {}).length > 0) fields = [];
165
130
  /**
166
131
  * Similarly, when grouping on a specific field, you can't have other non-aggregated fields.
167
132
  * The group query will override the fields query
168
133
  */
169
- if (query.group) {
170
- fields = query.group;
171
- }
134
+ if (query.group) fields = query.group;
172
135
  fields = uniq(fields);
173
- for (const field of fields) {
174
- if (getFieldRelationalDepth(field) > maxRelationalDepth) {
175
- throw new InvalidQueryError({ reason: "Max relational depth exceeded" });
176
- }
177
- }
136
+ for (const field of fields) if (getFieldRelationalDepth(field) > maxRelationalDepth) throw new InvalidQueryError({ reason: "Max relational depth exceeded" });
178
137
  if (query.filter) {
179
- const filterRelationalDepth = calculateFieldDepth(query.filter);
180
- if (filterRelationalDepth > maxRelationalDepth) {
181
- throw new InvalidQueryError({ reason: "Max relational depth exceeded" });
182
- }
138
+ if (calculateFieldDepth(query.filter) > maxRelationalDepth) throw new InvalidQueryError({ reason: "Max relational depth exceeded" });
183
139
  }
184
140
  if (query.sort) {
185
- for (const sort of query.sort) {
186
- if (sort.split(".").length > maxRelationalDepth) {
187
- throw new InvalidQueryError({ reason: "Max relational depth exceeded" });
188
- }
189
- }
141
+ for (const sort of query.sort) if (sort.split(".").length > maxRelationalDepth) throw new InvalidQueryError({ reason: "Max relational depth exceeded" });
190
142
  }
191
143
  if (query.deep) {
192
- const deepRelationalDepth = calculateFieldDepth(query.deep, ["_sort"]);
193
- if (deepRelationalDepth > maxRelationalDepth) {
194
- throw new InvalidQueryError({ reason: "Max relational depth exceeded" });
195
- }
144
+ if (calculateFieldDepth(query.deep, ["_sort"]) > maxRelationalDepth) throw new InvalidQueryError({ reason: "Max relational depth exceeded" });
196
145
  }
197
146
  }
198
147
 
@@ -51,16 +51,10 @@ function validateSnapshot(snapshot, force = false) {
51
51
  const { error } = snapshotJoiSchema.validate(snapshot);
52
52
  if (error) throw new InvalidPayloadError({ reason: error.message });
53
53
  if (force) return;
54
- if (snapshot.directus !== version) {
55
- throw new InvalidPayloadError({ reason: `Provided snapshot's directus version ${snapshot.directus} does not match the current instance's version ${version}. You can bypass this check by passing the "force" query parameter` });
56
- }
57
- if (!snapshot.vendor) {
58
- throw new InvalidPayloadError({ reason: "Provided snapshot does not contain the \"vendor\" property. You can bypass this check by passing the \"force\" query parameter" });
59
- }
54
+ if (snapshot.directus !== version) throw new InvalidPayloadError({ reason: `Provided snapshot's directus version ${snapshot.directus} does not match the current instance's version ${version}. You can bypass this check by passing the "force" query parameter` });
55
+ if (!snapshot.vendor) throw new InvalidPayloadError({ reason: "Provided snapshot does not contain the \"vendor\" property. You can bypass this check by passing the \"force\" query parameter" });
60
56
  const currentVendor = getDatabaseClient();
61
- if (snapshot.vendor !== currentVendor) {
62
- throw new InvalidPayloadError({ reason: `Provided snapshot's vendor ${snapshot.vendor} does not match the current instance's vendor ${currentVendor}. You can bypass this check by passing the "force" query parameter` });
63
- }
57
+ if (snapshot.vendor !== currentVendor) throw new InvalidPayloadError({ reason: `Provided snapshot's vendor ${snapshot.vendor} does not match the current instance's vendor ${currentVendor}. You can bypass this check by passing the "force" query parameter` });
64
58
  }
65
59
 
66
60
  //#endregion
@@ -10,27 +10,20 @@ import { constants } from "fs";
10
10
  async function validateStorage() {
11
11
  const env = useEnv();
12
12
  const logger = useLogger();
13
- if (env["DB_CLIENT"] === "sqlite3") {
14
- try {
15
- await access(path.dirname(env["DB_FILENAME"]), constants.R_OK | constants.W_OK);
16
- } catch {
17
- logger.warn(`Directory for SQLite database file (${path.resolve(path.dirname(env["DB_FILENAME"]))}) is not read/writeable!`);
18
- }
13
+ if (env["DB_CLIENT"] === "sqlite3") try {
14
+ await access(path.dirname(env["DB_FILENAME"]), constants.R_OK | constants.W_OK);
15
+ } catch {
16
+ logger.warn(`Directory for SQLite database file (${path.resolve(path.dirname(env["DB_FILENAME"]))}) is not read/writeable!`);
19
17
  }
20
- const usedStorageDrivers = toArray(env["STORAGE_LOCATIONS"]).map((location) => env[`STORAGE_${location.toUpperCase()}_DRIVER`]);
21
- if (usedStorageDrivers.includes("local")) {
22
- try {
23
- await access(env["STORAGE_LOCAL_ROOT"], constants.R_OK | constants.W_OK);
24
- } catch {
25
- logger.warn(`Upload directory (${path.resolve(env["STORAGE_LOCAL_ROOT"])}) is not read/writeable!`);
26
- }
18
+ if (toArray(env["STORAGE_LOCATIONS"]).map((location) => env[`STORAGE_${location.toUpperCase()}_DRIVER`]).includes("local")) try {
19
+ await access(env["STORAGE_LOCAL_ROOT"], constants.R_OK | constants.W_OK);
20
+ } catch {
21
+ logger.warn(`Upload directory (${path.resolve(env["STORAGE_LOCAL_ROOT"])}) is not read/writeable!`);
27
22
  }
28
- if (!env["EXTENSIONS_LOCATION"]) {
29
- try {
30
- await access(getExtensionsPath(), constants.R_OK);
31
- } catch {
32
- logger.warn(`Extensions directory (${path.resolve(getExtensionsPath())}) is not readable!`);
33
- }
23
+ if (!env["EXTENSIONS_LOCATION"]) try {
24
+ await access(getExtensionsPath(), constants.R_OK);
25
+ } catch {
26
+ logger.warn(`Extensions directory (${path.resolve(getExtensionsPath())}) is not readable!`);
34
27
  }
35
28
  }
36
29
 
@@ -9,20 +9,14 @@ async function validateUserCountIntegrity(options) {
9
9
  const validateUserLimits = (options.flags & UserIntegrityCheckFlag.UserLimits) !== 0;
10
10
  const validateRemainingAdminUsers = (options.flags & UserIntegrityCheckFlag.RemainingAdmins) !== 0;
11
11
  const limitCheck = validateUserLimits && shouldCheckUserLimits();
12
- if (!validateRemainingAdminUsers && !limitCheck) {
13
- return;
14
- }
12
+ if (!validateRemainingAdminUsers && !limitCheck) return;
15
13
  const adminOnly = validateRemainingAdminUsers && !limitCheck;
16
14
  const userCounts = await fetchUserCount({
17
15
  ...options,
18
16
  adminOnly
19
17
  });
20
- if (limitCheck) {
21
- await checkUserLimits(userCounts);
22
- }
23
- if (validateRemainingAdminUsers) {
24
- validateRemainingAdminCount(userCounts.admin);
25
- }
18
+ if (limitCheck) await checkUserLimits(userCounts);
19
+ if (validateRemainingAdminUsers) validateRemainingAdminCount(userCounts.admin);
26
20
  }
27
21
 
28
22
  //#endregion