@directus/api 34.0.1 → 35.0.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 (1702) hide show
  1. package/dist/__utils__/items-utils.js +32 -0
  2. package/dist/__utils__/schemas.js +297 -0
  3. package/dist/__utils__/snapshots.js +899 -0
  4. package/dist/_virtual/rolldown_runtime.js +38 -0
  5. package/dist/ai/chat/constants/system-prompt.js +5 -1
  6. package/dist/ai/chat/controllers/chat.post.js +69 -61
  7. package/dist/ai/chat/lib/create-ui-stream.js +71 -45
  8. package/dist/ai/chat/lib/transform-file-parts.js +43 -32
  9. package/dist/ai/chat/middleware/load-settings.js +42 -41
  10. package/dist/ai/chat/models/chat-request.js +77 -69
  11. package/dist/ai/chat/models/providers.js +23 -18
  12. package/dist/ai/chat/router.js +10 -5
  13. package/dist/ai/chat/utils/chat-request-tool-to-ai-sdk-tool.js +40 -36
  14. package/dist/ai/chat/utils/fix-error-tool-calls.js +30 -28
  15. package/dist/ai/chat/utils/format-context.js +87 -89
  16. package/dist/ai/chat/utils/parse-json-schema-7.js +84 -73
  17. package/dist/ai/devtools/index.js +38 -0
  18. package/dist/ai/files/adapters/anthropic.js +29 -24
  19. package/dist/ai/files/adapters/google.js +60 -57
  20. package/dist/ai/files/adapters/index.js +5 -3
  21. package/dist/ai/files/adapters/openai.js +26 -21
  22. package/dist/ai/files/controllers/upload.js +101 -95
  23. package/dist/ai/files/lib/fetch-provider.js +27 -22
  24. package/dist/ai/files/lib/upload-to-provider.js +32 -25
  25. package/dist/ai/files/router.js +10 -5
  26. package/dist/ai/files/types.js +1 -1
  27. package/dist/ai/mcp/index.js +3 -1
  28. package/dist/ai/mcp/server.js +293 -301
  29. package/dist/ai/mcp/transport.js +22 -18
  30. package/dist/ai/mcp/types.js +1 -1
  31. package/dist/ai/providers/anthropic-file-support.js +91 -89
  32. package/dist/ai/providers/anthropic-tool-search.js +33 -0
  33. package/dist/ai/providers/index.js +5 -3
  34. package/dist/ai/providers/options.js +27 -24
  35. package/dist/ai/providers/registry.js +65 -60
  36. package/dist/ai/providers/types.js +1 -1
  37. package/dist/ai/telemetry/braintrust.js +27 -0
  38. package/dist/ai/telemetry/index.js +79 -0
  39. package/dist/ai/telemetry/langfuse.js +67 -0
  40. package/dist/ai/tools/assets/index.js +56 -55
  41. package/dist/ai/tools/collections/index.js +96 -89
  42. package/dist/ai/tools/define-tool.js +6 -2
  43. package/dist/ai/tools/fields/index.js +157 -162
  44. package/dist/ai/tools/files/index.js +109 -104
  45. package/dist/ai/tools/flows/index.js +99 -87
  46. package/dist/ai/tools/folders/index.js +103 -98
  47. package/dist/ai/tools/index.js +32 -28
  48. package/dist/ai/tools/items/index.js +149 -146
  49. package/dist/ai/tools/operations/index.js +88 -80
  50. package/dist/ai/tools/relations/index.js +100 -91
  51. package/dist/ai/tools/schema/index.js +240 -302
  52. package/dist/ai/tools/schema.js +198 -205
  53. package/dist/ai/tools/system/index.js +23 -22
  54. package/dist/ai/tools/trigger-flow/index.js +62 -49
  55. package/dist/ai/tools/types.js +1 -1
  56. package/dist/ai/tools/utils.js +20 -15
  57. package/dist/app.js +296 -288
  58. package/dist/auth/auth.js +46 -41
  59. package/dist/auth/drivers/index.js +7 -5
  60. package/dist/auth/drivers/ldap.js +314 -342
  61. package/dist/auth/drivers/local.js +86 -89
  62. package/dist/auth/drivers/oauth2.js +369 -385
  63. package/dist/auth/drivers/openid.js +429 -447
  64. package/dist/auth/drivers/saml.js +172 -172
  65. package/dist/auth/utils/generate-callback-url.js +38 -35
  66. package/dist/auth/utils/resolve-login-redirect.js +54 -60
  67. package/dist/auth.js +66 -60
  68. package/dist/bus/index.js +3 -1
  69. package/dist/bus/lib/use-bus.js +29 -19
  70. package/dist/cache.js +136 -124
  71. package/dist/cli/commands/bootstrap/index.js +61 -59
  72. package/dist/cli/commands/cache/clear.js +33 -0
  73. package/dist/cli/commands/count/index.js +25 -21
  74. package/dist/cli/commands/database/install.js +20 -16
  75. package/dist/cli/commands/database/migrate.js +26 -23
  76. package/dist/cli/commands/init/index.js +116 -100
  77. package/dist/cli/commands/init/questions.js +86 -48
  78. package/dist/cli/commands/roles/create.js +51 -37
  79. package/dist/cli/commands/schema/apply.js +188 -203
  80. package/dist/cli/commands/schema/snapshot.js +55 -56
  81. package/dist/cli/commands/security/key.js +9 -4
  82. package/dist/cli/commands/security/secret.js +8 -4
  83. package/dist/cli/commands/users/create.js +35 -23
  84. package/dist/cli/commands/users/passwd.js +37 -35
  85. package/dist/cli/index.js +53 -90
  86. package/dist/cli/load-extensions.js +25 -19
  87. package/dist/cli/run.js +9 -7
  88. package/dist/cli/utils/create-db-connection.js +56 -54
  89. package/dist/cli/utils/create-env/index.js +33 -35
  90. package/dist/cli/utils/drivers.js +16 -13
  91. package/dist/constants.js +132 -89
  92. package/dist/controllers/access.js +137 -140
  93. package/dist/controllers/activity.js +47 -46
  94. package/dist/controllers/assets.js +200 -241
  95. package/dist/controllers/auth.js +175 -175
  96. package/dist/controllers/collections.js +99 -99
  97. package/dist/controllers/comments.js +136 -138
  98. package/dist/controllers/dashboards.js +131 -132
  99. package/dist/controllers/deployment-webhooks.js +92 -93
  100. package/dist/controllers/deployment.js +330 -350
  101. package/dist/controllers/extensions.js +205 -199
  102. package/dist/controllers/fields.js +155 -164
  103. package/dist/controllers/files.js +250 -269
  104. package/dist/controllers/flows.js +150 -151
  105. package/dist/controllers/folders.js +138 -141
  106. package/dist/controllers/graphql.js +33 -28
  107. package/dist/controllers/items.js +157 -172
  108. package/dist/controllers/mcp.js +33 -31
  109. package/dist/controllers/metrics.js +33 -29
  110. package/dist/controllers/not-found.js +35 -28
  111. package/dist/controllers/notifications.js +138 -141
  112. package/dist/controllers/operations.js +131 -132
  113. package/dist/controllers/panels.js +131 -132
  114. package/dist/controllers/permissions.js +162 -166
  115. package/dist/controllers/policies.js +155 -160
  116. package/dist/controllers/presets.js +138 -141
  117. package/dist/controllers/relations.js +96 -102
  118. package/dist/controllers/revisions.js +40 -32
  119. package/dist/controllers/roles.js +152 -152
  120. package/dist/controllers/schema.js +97 -92
  121. package/dist/controllers/server.js +84 -81
  122. package/dist/controllers/settings.js +44 -40
  123. package/dist/controllers/shares.js +180 -213
  124. package/dist/controllers/translations.js +138 -141
  125. package/dist/controllers/tus.js +70 -72
  126. package/dist/controllers/users.js +303 -308
  127. package/dist/controllers/utils.js +149 -134
  128. package/dist/controllers/versions.js +178 -176
  129. package/dist/database/errors/dialects/mssql.js +137 -153
  130. package/dist/database/errors/dialects/mysql.js +123 -137
  131. package/dist/database/errors/dialects/oracle.js +24 -20
  132. package/dist/database/errors/dialects/postgres.js +91 -94
  133. package/dist/database/errors/dialects/sqlite.js +48 -46
  134. package/dist/database/errors/dialects/types.js +1 -1
  135. package/dist/database/errors/translate.js +47 -42
  136. package/dist/database/get-ast-from-query/get-ast-from-query.js +51 -52
  137. package/dist/database/get-ast-from-query/lib/convert-wildcards.js +74 -78
  138. package/dist/database/get-ast-from-query/lib/parse-fields.js +231 -246
  139. package/dist/database/get-ast-from-query/utils/get-allowed-sort.js +31 -34
  140. package/dist/database/get-ast-from-query/utils/get-deep-query.js +20 -15
  141. package/dist/database/get-ast-from-query/utils/get-related-collection.js +16 -12
  142. package/dist/database/helpers/capabilities/dialects/default.js +7 -3
  143. package/dist/database/helpers/capabilities/dialects/mysql.js +11 -9
  144. package/dist/database/helpers/capabilities/dialects/postgres.js +14 -14
  145. package/dist/database/helpers/capabilities/index.js +18 -7
  146. package/dist/database/helpers/capabilities/types.js +20 -15
  147. package/dist/database/helpers/date/dialects/default.js +7 -3
  148. package/dist/database/helpers/date/dialects/mssql.js +13 -8
  149. package/dist/database/helpers/date/dialects/mysql.js +17 -12
  150. package/dist/database/helpers/date/dialects/oracle.js +27 -27
  151. package/dist/database/helpers/date/dialects/sqlite.js +27 -28
  152. package/dist/database/helpers/date/index.js +20 -7
  153. package/dist/database/helpers/date/types.js +25 -22
  154. package/dist/database/helpers/fn/dialects/mssql.js +64 -63
  155. package/dist/database/helpers/fn/dialects/mysql.js +70 -67
  156. package/dist/database/helpers/fn/dialects/oracle.js +64 -63
  157. package/dist/database/helpers/fn/dialects/postgres.js +87 -84
  158. package/dist/database/helpers/fn/dialects/sqlite.js +61 -78
  159. package/dist/database/helpers/fn/index.js +20 -7
  160. package/dist/database/helpers/fn/json/parse-function.js +60 -61
  161. package/dist/database/helpers/fn/types.js +48 -56
  162. package/dist/database/helpers/geometry/dialects/mssql.js +42 -34
  163. package/dist/database/helpers/geometry/dialects/mysql.js +21 -12
  164. package/dist/database/helpers/geometry/dialects/oracle.js +49 -37
  165. package/dist/database/helpers/geometry/dialects/postgres.js +27 -18
  166. package/dist/database/helpers/geometry/dialects/redshift.js +21 -12
  167. package/dist/database/helpers/geometry/dialects/sqlite.js +19 -10
  168. package/dist/database/helpers/geometry/index.js +21 -7
  169. package/dist/database/helpers/geometry/types.js +59 -51
  170. package/dist/database/helpers/index.js +26 -21
  171. package/dist/database/helpers/number/dialects/default.js +7 -3
  172. package/dist/database/helpers/number/dialects/mssql.js +16 -11
  173. package/dist/database/helpers/number/dialects/oracle.js +12 -7
  174. package/dist/database/helpers/number/dialects/postgres.js +18 -15
  175. package/dist/database/helpers/number/dialects/sqlite.js +12 -7
  176. package/dist/database/helpers/number/index.js +20 -7
  177. package/dist/database/helpers/number/types.js +14 -9
  178. package/dist/database/helpers/number/utils/decimal-limit.js +17 -9
  179. package/dist/database/helpers/number/utils/maybe-stringify-big-int.js +9 -5
  180. package/dist/database/helpers/number/utils/number-in-range.js +18 -19
  181. package/dist/database/helpers/schema/dialects/cockroachdb.js +63 -81
  182. package/dist/database/helpers/schema/dialects/default.js +7 -3
  183. package/dist/database/helpers/schema/dialects/mssql.js +64 -84
  184. package/dist/database/helpers/schema/dialects/mysql.js +61 -103
  185. package/dist/database/helpers/schema/dialects/oracle.js +96 -116
  186. package/dist/database/helpers/schema/dialects/postgres.js +41 -52
  187. package/dist/database/helpers/schema/dialects/sqlite.js +31 -29
  188. package/dist/database/helpers/schema/index.js +22 -7
  189. package/dist/database/helpers/schema/types.js +151 -154
  190. package/dist/database/helpers/schema/utils/prep-query-params.js +38 -34
  191. package/dist/database/helpers/sequence/dialects/default.js +7 -3
  192. package/dist/database/helpers/sequence/dialects/postgres.js +23 -13
  193. package/dist/database/helpers/sequence/index.js +17 -7
  194. package/dist/database/helpers/sequence/types.js +11 -6
  195. package/dist/database/helpers/types.js +9 -6
  196. package/dist/database/index.js +255 -287
  197. package/dist/database/migrations/20201028A-remove-collection-foreign-keys.js +44 -40
  198. package/dist/database/migrations/20201029A-remove-system-relations.js +122 -120
  199. package/dist/database/migrations/20201029B-remove-system-collections.js +96 -91
  200. package/dist/database/migrations/20201029C-remove-system-fields.js +1527 -1636
  201. package/dist/database/migrations/20201105A-add-cascade-system-relations.js +114 -126
  202. package/dist/database/migrations/20201105B-change-webhook-url-type.js +15 -10
  203. package/dist/database/migrations/20210225A-add-relations-sort-field.js +30 -28
  204. package/dist/database/migrations/20210304A-remove-locked-fields.js +12 -8
  205. package/dist/database/migrations/20210312A-webhooks-collections-text.js +15 -10
  206. package/dist/database/migrations/20210331A-add-refresh-interval.js +12 -8
  207. package/dist/database/migrations/20210415A-make-filesize-nullable.js +18 -13
  208. package/dist/database/migrations/20210416A-add-collections-accountability.js +13 -9
  209. package/dist/database/migrations/20210422A-remove-files-interface.js +7 -5
  210. package/dist/database/migrations/20210506A-rename-interfaces.js +77 -70
  211. package/dist/database/migrations/20210510A-restructure-relations.js +26 -25
  212. package/dist/database/migrations/20210518A-add-foreign-key-constraints.js +83 -106
  213. package/dist/database/migrations/20210519A-add-system-fk-triggers.js +143 -162
  214. package/dist/database/migrations/20210521A-add-collections-icon-color.js +12 -8
  215. package/dist/database/migrations/20210525A-add-insights.js +33 -29
  216. package/dist/database/migrations/20210608A-add-deep-clone-config.js +12 -8
  217. package/dist/database/migrations/20210626A-change-filesize-bigint.js +22 -17
  218. package/dist/database/migrations/20210716A-add-conditions-to-fields.js +12 -8
  219. package/dist/database/migrations/20210721A-add-default-folder.js +16 -16
  220. package/dist/database/migrations/20210802A-replace-groups.js +35 -44
  221. package/dist/database/migrations/20210803A-add-required-to-fields.js +12 -8
  222. package/dist/database/migrations/20210805A-update-groups.js +26 -27
  223. package/dist/database/migrations/20210805B-change-image-metadata-structure.js +67 -82
  224. package/dist/database/migrations/20210811A-add-geometry-config.js +14 -10
  225. package/dist/database/migrations/20210831A-remove-limit-column.js +12 -8
  226. package/dist/database/migrations/20210903A-add-auth-provider.js +38 -33
  227. package/dist/database/migrations/20210907A-webhooks-collections-not-null.js +14 -11
  228. package/dist/database/migrations/20210910A-move-module-setup.js +18 -14
  229. package/dist/database/migrations/20210920A-webhooks-url-not-null.js +18 -19
  230. package/dist/database/migrations/20210924A-add-collection-organization.js +19 -17
  231. package/dist/database/migrations/20210927A-replace-fields-group.js +48 -48
  232. package/dist/database/migrations/20210927B-replace-m2m-interface.js +8 -14
  233. package/dist/database/migrations/20210929A-rename-login-action.js +8 -12
  234. package/dist/database/migrations/20211007A-update-presets.js +79 -96
  235. package/dist/database/migrations/20211009A-add-auth-data.js +12 -8
  236. package/dist/database/migrations/20211016A-add-webhook-headers.js +12 -8
  237. package/dist/database/migrations/20211103A-set-unique-to-user-token.js +12 -8
  238. package/dist/database/migrations/20211103B-update-special-geometry.js +8 -18
  239. package/dist/database/migrations/20211104A-remove-collections-listing.js +12 -8
  240. package/dist/database/migrations/20211118A-add-notifications.js +28 -23
  241. package/dist/database/migrations/20211211A-add-shares.js +37 -37
  242. package/dist/database/migrations/20211230A-add-project-descriptor.js +12 -8
  243. package/dist/database/migrations/20220303A-remove-default-project-color.js +20 -15
  244. package/dist/database/migrations/20220308A-add-bookmark-icon-and-color.js +14 -10
  245. package/dist/database/migrations/20220314A-add-translation-strings.js +12 -8
  246. package/dist/database/migrations/20220322A-rename-field-typecast-flags.js +59 -70
  247. package/dist/database/migrations/20220323A-add-field-validation.js +14 -10
  248. package/dist/database/migrations/20220325A-fix-typecast-flags.js +36 -43
  249. package/dist/database/migrations/20220325B-add-default-language.js +26 -21
  250. package/dist/database/migrations/20220402A-remove-default-value-panel-icon.js +20 -15
  251. package/dist/database/migrations/20220429A-add-flows.js +80 -75
  252. package/dist/database/migrations/20220429B-add-color-to-insights-icon.js +12 -8
  253. package/dist/database/migrations/20220429C-drop-non-null-from-ip-of-activity.js +12 -8
  254. package/dist/database/migrations/20220429D-drop-non-null-from-sender-of-notifications.js +12 -8
  255. package/dist/database/migrations/20220614A-rename-hook-trigger-to-event.js +8 -4
  256. package/dist/database/migrations/20220801A-update-notifications-timestamp-column.js +15 -12
  257. package/dist/database/migrations/20220802A-add-custom-aspect-ratios.js +12 -8
  258. package/dist/database/migrations/20220826A-add-origin-to-accountability.js +18 -14
  259. package/dist/database/migrations/20230401A-update-material-icons.js +22 -17
  260. package/dist/database/migrations/20230525A-add-preview-settings.js +12 -8
  261. package/dist/database/migrations/20230526A-migrate-translation-strings.js +56 -48
  262. package/dist/database/migrations/20230721A-require-shares-fields.js +52 -48
  263. package/dist/database/migrations/20230823A-add-content-versioning.js +34 -36
  264. package/dist/database/migrations/20230927A-themes.js +51 -47
  265. package/dist/database/migrations/20231009A-update-csv-fields-to-text.js +42 -38
  266. package/dist/database/migrations/20231009B-update-panel-options.js +64 -75
  267. package/dist/database/migrations/20231010A-add-extensions.js +11 -7
  268. package/dist/database/migrations/20231215A-add-focalpoints.js +14 -10
  269. package/dist/database/migrations/20240122A-add-report-url-fields.js +16 -12
  270. package/dist/database/migrations/20240204A-marketplace.js +98 -99
  271. package/dist/database/migrations/20240305A-change-useragent-type.js +16 -17
  272. package/dist/database/migrations/20240311A-deprecate-webhooks.js +97 -121
  273. package/dist/database/migrations/20240422A-public-registration.js +16 -12
  274. package/dist/database/migrations/20240515A-add-session-window.js +12 -8
  275. package/dist/database/migrations/20240701A-add-tus-data.js +14 -10
  276. package/dist/database/migrations/20240716A-update-files-date-fields.js +29 -27
  277. package/dist/database/migrations/20240806A-permissions-policies.js +202 -262
  278. package/dist/database/migrations/20240817A-update-icon-fields-length.js +50 -53
  279. package/dist/database/migrations/20240909A-separate-comments.js +53 -60
  280. package/dist/database/migrations/20240909B-consolidate-content-versioning.js +12 -8
  281. package/dist/database/migrations/20240924A-migrate-legacy-comments.js +67 -79
  282. package/dist/database/migrations/20240924B-populate-versioning-deltas.js +26 -31
  283. package/dist/database/migrations/20250224A-visual-editor.js +31 -31
  284. package/dist/database/migrations/20250609A-license-banner.js +17 -12
  285. package/dist/database/migrations/20250613A-add-project-id.js +22 -24
  286. package/dist/database/migrations/20250718A-add-direction.js +12 -8
  287. package/dist/database/migrations/20250813A-add-mcp.js +20 -16
  288. package/dist/database/migrations/20251012A-add-field-searchable.js +12 -8
  289. package/dist/database/migrations/20251014A-add-project-owner.js +40 -35
  290. package/dist/database/migrations/20251028A-add-retention-indexes.js +53 -40
  291. package/dist/database/migrations/20251103A-add-ai-settings.js +16 -12
  292. package/dist/database/migrations/20251224A-remove-webhooks.js +21 -17
  293. package/dist/database/migrations/20260110A-add-ai-provider-settings.js +45 -33
  294. package/dist/database/migrations/20260113A-add-revisions-index.js +49 -39
  295. package/dist/database/migrations/20260128A-add-collaborative-editing.js +12 -8
  296. package/dist/database/migrations/20260204A-add-deployment.js +34 -30
  297. package/dist/database/migrations/20260211A-add-deployment-webhooks.js +39 -35
  298. package/dist/database/migrations/run.js +113 -109
  299. package/dist/database/run-ast/lib/apply-query/add-join.js +81 -85
  300. package/dist/database/run-ast/lib/apply-query/aggregate.js +34 -23
  301. package/dist/database/run-ast/lib/apply-query/filter/get-filter-type.js +27 -19
  302. package/dist/database/run-ast/lib/apply-query/filter/index.js +136 -150
  303. package/dist/database/run-ast/lib/apply-query/filter/operator.js +174 -182
  304. package/dist/database/run-ast/lib/apply-query/filter/validate-operator.js +17 -17
  305. package/dist/database/run-ast/lib/apply-query/get-filter-path.js +17 -12
  306. package/dist/database/run-ast/lib/apply-query/get-operation.js +26 -17
  307. package/dist/database/run-ast/lib/apply-query/index.js +88 -88
  308. package/dist/database/run-ast/lib/apply-query/join-filter-with-cases.js +13 -11
  309. package/dist/database/run-ast/lib/apply-query/mock.js +9 -4
  310. package/dist/database/run-ast/lib/apply-query/pagination.js +14 -9
  311. package/dist/database/run-ast/lib/apply-query/search.js +75 -77
  312. package/dist/database/run-ast/lib/apply-query/sort.js +90 -86
  313. package/dist/database/run-ast/lib/get-db-query.js +181 -241
  314. package/dist/database/run-ast/lib/parse-current-level.js +54 -47
  315. package/dist/database/run-ast/modules/fetch-permitted-ast-root-fields.js +44 -27
  316. package/dist/database/run-ast/run-ast.js +131 -129
  317. package/dist/database/run-ast/types.js +1 -1
  318. package/dist/database/run-ast/utils/apply-case-when.js +29 -26
  319. package/dist/database/run-ast/utils/apply-function-to-column-name.js +29 -26
  320. package/dist/database/run-ast/utils/apply-parent-filters.js +58 -56
  321. package/dist/database/run-ast/utils/generate-alias.js +48 -52
  322. package/dist/database/run-ast/utils/get-column-pre-processor.js +66 -66
  323. package/dist/database/run-ast/utils/get-column.js +64 -64
  324. package/dist/database/run-ast/utils/get-field-alias.js +9 -5
  325. package/dist/database/run-ast/utils/get-inner-query-column-pre-processor.js +30 -23
  326. package/dist/database/run-ast/utils/merge-with-parent-items.js +127 -137
  327. package/dist/database/run-ast/utils/remove-temporary-fields.js +70 -78
  328. package/dist/database/run-ast/utils/with-preprocess-bindings.js +17 -14
  329. package/dist/database/seeds/run.js +77 -78
  330. package/dist/deployment/deployment.js +34 -29
  331. package/dist/deployment/drivers/index.js +4 -2
  332. package/dist/deployment/drivers/netlify.js +372 -358
  333. package/dist/deployment/drivers/vercel.js +276 -285
  334. package/dist/deployment/index.js +6 -2
  335. package/dist/deployment.js +66 -62
  336. package/dist/emitter.js +101 -89
  337. package/dist/extensions/index.js +12 -7
  338. package/dist/extensions/lib/get-extensions-path.js +13 -8
  339. package/dist/extensions/lib/get-extensions-settings.js +117 -128
  340. package/dist/extensions/lib/get-extensions.js +20 -11
  341. package/dist/extensions/lib/get-shared-deps-mapping.js +30 -26
  342. package/dist/extensions/lib/installation/index.js +12 -7
  343. package/dist/extensions/lib/installation/manager.js +100 -95
  344. package/dist/extensions/lib/sandbox/generate-api-extensions-sandbox-entrypoint.js +66 -43
  345. package/dist/extensions/lib/sandbox/generate-host-function-reference.js +19 -16
  346. package/dist/extensions/lib/sandbox/register/action.js +23 -17
  347. package/dist/extensions/lib/sandbox/register/call-reference.js +28 -21
  348. package/dist/extensions/lib/sandbox/register/filter.js +26 -20
  349. package/dist/extensions/lib/sandbox/register/index.js +7 -5
  350. package/dist/extensions/lib/sandbox/register/operation.js +27 -21
  351. package/dist/extensions/lib/sandbox/register/route.js +52 -43
  352. package/dist/extensions/lib/sandbox/sdk/generators/index.js +5 -3
  353. package/dist/extensions/lib/sandbox/sdk/generators/log.js +14 -11
  354. package/dist/extensions/lib/sandbox/sdk/generators/request.js +56 -48
  355. package/dist/extensions/lib/sandbox/sdk/generators/sleep.js +13 -10
  356. package/dist/extensions/lib/sandbox/sdk/index.js +4 -2
  357. package/dist/extensions/lib/sandbox/sdk/instantiate.js +32 -26
  358. package/dist/extensions/lib/sandbox/sdk/sdk.js +32 -9
  359. package/dist/extensions/lib/sandbox/sdk/utils/index.js +3 -1
  360. package/dist/extensions/lib/sandbox/sdk/utils/wrap.js +50 -47
  361. package/dist/extensions/lib/sync/status.js +30 -29
  362. package/dist/extensions/lib/sync/sync.js +83 -89
  363. package/dist/extensions/lib/sync/tracker.js +68 -71
  364. package/dist/extensions/lib/sync/utils.js +53 -54
  365. package/dist/extensions/lib/wrap-embeds.js +9 -6
  366. package/dist/extensions/manager.js +718 -746
  367. package/dist/flows.js +574 -427
  368. package/dist/index.js +3 -1
  369. package/dist/lock/index.js +3 -1
  370. package/dist/lock/lib/use-lock.js +28 -18
  371. package/dist/logger/index.js +186 -179
  372. package/dist/logger/logs-stream.js +45 -40
  373. package/dist/logger/redact-query.js +16 -12
  374. package/dist/mailer.js +61 -60
  375. package/dist/metrics/index.js +3 -1
  376. package/dist/metrics/lib/create-metrics.js +250 -233
  377. package/dist/metrics/lib/use-metrics.js +19 -14
  378. package/dist/metrics/types/metric.js +1 -1
  379. package/dist/middleware/authenticate.js +46 -47
  380. package/dist/middleware/cache.js +61 -57
  381. package/dist/middleware/collection-exists.js +24 -24
  382. package/dist/middleware/cors.js +17 -12
  383. package/dist/middleware/error-handler.js +77 -86
  384. package/dist/middleware/extract-token.js +37 -43
  385. package/dist/middleware/graphql.js +70 -68
  386. package/dist/middleware/rate-limiter-global.js +41 -38
  387. package/dist/middleware/rate-limiter-ip.js +36 -29
  388. package/dist/middleware/rate-limiter-registration.js +32 -29
  389. package/dist/middleware/request-counter.js +28 -0
  390. package/dist/middleware/respond.js +97 -109
  391. package/dist/middleware/sanitize-query.js +25 -27
  392. package/dist/middleware/schema.js +11 -6
  393. package/dist/middleware/use-collection.js +10 -5
  394. package/dist/middleware/validate-batch.js +41 -42
  395. package/dist/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.js +445 -0
  396. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/index.js +176 -0
  397. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/system/policy.js +54 -0
  398. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/any/any.js +13 -0
  399. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/any/index.js +3 -0
  400. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/argument/argument.js +15 -0
  401. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/argument/index.js +3 -0
  402. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/array/array.js +16 -0
  403. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/array/index.js +3 -0
  404. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/async-iterator/async-iterator.js +16 -0
  405. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/async-iterator/index.js +3 -0
  406. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/awaited/awaited.js +37 -0
  407. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/awaited/index.js +3 -0
  408. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/bigint/bigint.js +16 -0
  409. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/bigint/index.js +3 -0
  410. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/boolean/boolean.js +16 -0
  411. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/boolean/index.js +3 -0
  412. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/clone/index.js +4 -0
  413. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/clone/type.js +17 -0
  414. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/clone/value.js +35 -0
  415. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/composite/composite.js +42 -0
  416. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/composite/index.js +3 -0
  417. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/computed/computed.js +16 -0
  418. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/computed/index.js +3 -0
  419. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/const/const.js +52 -0
  420. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/const/index.js +3 -0
  421. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/constructor/constructor.js +17 -0
  422. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/constructor/index.js +3 -0
  423. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/constructor-parameters/constructor-parameters.js +14 -0
  424. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/constructor-parameters/index.js +3 -0
  425. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/create/immutable.js +32 -0
  426. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/create/index.js +3 -0
  427. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/create/type.js +20 -0
  428. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/date/date.js +15 -0
  429. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/date/index.js +3 -0
  430. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/discard/discard.js +12 -0
  431. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/discard/index.js +3 -0
  432. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/enum/enum.js +23 -0
  433. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/enum/index.js +3 -0
  434. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/error/error.js +10 -0
  435. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/error/index.js +3 -0
  436. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/exclude/exclude-from-mapped-result.js +20 -0
  437. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/exclude/exclude-from-template-literal.js +11 -0
  438. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/exclude/exclude.js +25 -0
  439. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/exclude/index.js +5 -0
  440. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/extends/extends-check.js +267 -0
  441. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/extends/extends-from-mapped-key.js +29 -0
  442. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/extends/extends-from-mapped-result.js +21 -0
  443. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/extends/extends-undefined.js +21 -0
  444. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/extends/extends.js +20 -0
  445. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/extends/index.js +7 -0
  446. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/extract/extract-from-mapped-result.js +20 -0
  447. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/extract/extract-from-template-literal.js +11 -0
  448. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/extract/extract.js +25 -0
  449. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/extract/index.js +5 -0
  450. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/function/function.js +17 -0
  451. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/function/index.js +3 -0
  452. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/guard/index.js +5 -0
  453. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/guard/kind.js +204 -0
  454. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/guard/type.js +293 -0
  455. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/guard/value.js +68 -0
  456. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/helpers/helpers.js +8 -0
  457. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/helpers/index.js +3 -0
  458. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/indexed/index.js +6 -0
  459. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-from-mapped-key.js +27 -0
  460. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-from-mapped-result.js +24 -0
  461. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-property-keys.js +24 -0
  462. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/indexed/indexed.js +67 -0
  463. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/instance-type/index.js +3 -0
  464. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/instance-type/instance-type.js +13 -0
  465. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/instantiate/index.js +3 -0
  466. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/instantiate/instantiate.js +102 -0
  467. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/integer/index.js +3 -0
  468. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/integer/integer.js +15 -0
  469. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/intersect/index.js +5 -0
  470. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/intersect/intersect-create.js +23 -0
  471. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/intersect/intersect-evaluated.js +35 -0
  472. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/intersect/intersect-type.js +3 -0
  473. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/intersect/intersect.js +17 -0
  474. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/intrinsic/capitalize.js +10 -0
  475. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/intrinsic/index.js +8 -0
  476. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/intrinsic/intrinsic-from-mapped-key.js +30 -0
  477. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/intrinsic/intrinsic.js +54 -0
  478. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/intrinsic/lowercase.js +10 -0
  479. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/intrinsic/uncapitalize.js +10 -0
  480. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/intrinsic/uppercase.js +10 -0
  481. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/iterator/index.js +3 -0
  482. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/iterator/iterator.js +16 -0
  483. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/keyof/index.js +6 -0
  484. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/keyof/keyof-from-mapped-result.js +21 -0
  485. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/keyof/keyof-property-entries.js +17 -0
  486. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/keyof/keyof-property-keys.js +52 -0
  487. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/keyof/keyof.js +38 -0
  488. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/literal/index.js +3 -0
  489. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/literal/literal.js +16 -0
  490. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/mapped/index.js +5 -0
  491. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/mapped/mapped-key.js +14 -0
  492. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/mapped/mapped-result.js +14 -0
  493. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/mapped/mapped.js +86 -0
  494. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/module/compute.js +144 -0
  495. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/module/index.js +3 -0
  496. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/module/module.js +44 -0
  497. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/never/index.js +3 -0
  498. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/never/never.js +15 -0
  499. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/not/index.js +3 -0
  500. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/not/not.js +15 -0
  501. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/null/index.js +3 -0
  502. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/null/null.js +15 -0
  503. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/number/index.js +3 -0
  504. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/number/number.js +15 -0
  505. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/object/index.js +3 -0
  506. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/object/object.js +33 -0
  507. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/omit/index.js +5 -0
  508. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/omit/omit-from-mapped-key.js +27 -0
  509. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/omit/omit-from-mapped-result.js +21 -0
  510. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/omit/omit.js +65 -0
  511. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/optional/index.js +4 -0
  512. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/optional/optional-from-mapped-result.js +20 -0
  513. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/optional/optional.js +29 -0
  514. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/parameters/index.js +3 -0
  515. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/parameters/parameters.js +14 -0
  516. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/partial/index.js +4 -0
  517. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/partial/partial-from-mapped-result.js +21 -0
  518. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/partial/partial.js +62 -0
  519. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/patterns/index.js +3 -0
  520. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/patterns/patterns.js +12 -0
  521. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/pick/index.js +5 -0
  522. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/pick/pick-from-mapped-key.js +27 -0
  523. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/pick/pick-from-mapped-result.js +21 -0
  524. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/pick/pick.js +63 -0
  525. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/promise/index.js +3 -0
  526. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/promise/promise.js +16 -0
  527. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/readonly/index.js +4 -0
  528. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/readonly/readonly-from-mapped-result.js +20 -0
  529. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/readonly/readonly.js +29 -0
  530. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/readonly-optional/index.js +3 -0
  531. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/readonly-optional/readonly-optional.js +13 -0
  532. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/record/index.js +3 -0
  533. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/record/record.js +92 -0
  534. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/recursive/index.js +3 -0
  535. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/recursive/recursive.js +24 -0
  536. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/ref/index.js +3 -0
  537. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/ref/ref.js +19 -0
  538. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/regexp/index.js +3 -0
  539. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/regexp/regexp.js +19 -0
  540. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/registry/format.js +30 -0
  541. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/registry/index.js +4 -0
  542. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/registry/type.js +30 -0
  543. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/required/index.js +4 -0
  544. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/required/required-from-mapped-result.js +20 -0
  545. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/required/required.js +60 -0
  546. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/rest/index.js +3 -0
  547. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/rest/rest.js +13 -0
  548. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/return-type/index.js +3 -0
  549. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/return-type/return-type.js +13 -0
  550. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/schema/anyschema.js +1 -0
  551. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/schema/index.js +4 -0
  552. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/schema/schema.js +3 -0
  553. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/sets/index.js +3 -0
  554. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/sets/set.js +42 -0
  555. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/static/index.js +3 -0
  556. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/static/static.js +1 -0
  557. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/string/index.js +3 -0
  558. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/string/string.js +15 -0
  559. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/symbol/index.js +3 -0
  560. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/symbol/symbol.js +15 -0
  561. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/symbols/index.js +3 -0
  562. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/symbols/symbols.js +14 -0
  563. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/template-literal/finite.js +28 -0
  564. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/template-literal/generate.js +37 -0
  565. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/template-literal/index.js +9 -0
  566. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/template-literal/parse.js +125 -0
  567. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/template-literal/pattern.js +24 -0
  568. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/template-literal/syntax.js +55 -0
  569. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/template-literal/template-literal.js +20 -0
  570. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/template-literal/union.js +16 -0
  571. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/transform/index.js +3 -0
  572. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/transform/transform.js +51 -0
  573. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/tuple/index.js +3 -0
  574. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/tuple/tuple.js +24 -0
  575. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/type/index.js +10 -0
  576. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/type/javascript.js +123 -0
  577. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/type/json.js +263 -0
  578. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/type/type.js +191 -0
  579. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/uint8array/index.js +3 -0
  580. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/uint8array/uint8array.js +15 -0
  581. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/undefined/index.js +3 -0
  582. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/undefined/undefined.js +15 -0
  583. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/union/index.js +5 -0
  584. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/union/union-create.js +14 -0
  585. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/union/union-evaluated.js +33 -0
  586. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/union/union-type.js +3 -0
  587. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/union/union.js +13 -0
  588. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/unknown/index.js +3 -0
  589. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/unknown/unknown.js +12 -0
  590. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/unsafe/index.js +3 -0
  591. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/unsafe/unsafe.js +12 -0
  592. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/void/index.js +3 -0
  593. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/void/void.js +15 -0
  594. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/value/guard/guard.js +140 -0
  595. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/value/guard/index.js +3 -0
  596. package/dist/node_modules/.pnpm/@vitest_expect@3.2.4/node_modules/@vitest/expect/dist/index.js +1714 -0
  597. package/dist/node_modules/.pnpm/@vitest_pretty-format@3.2.4/node_modules/@vitest/pretty-format/dist/index.js +1287 -0
  598. package/dist/node_modules/.pnpm/@vitest_runner@3.2.4/node_modules/@vitest/runner/dist/chunk-hooks.js +2151 -0
  599. package/dist/node_modules/.pnpm/@vitest_runner@3.2.4/node_modules/@vitest/runner/dist/index.js +8 -0
  600. package/dist/node_modules/.pnpm/@vitest_runner@3.2.4/node_modules/@vitest/runner/dist/utils.js +8 -0
  601. package/dist/node_modules/.pnpm/@vitest_snapshot@3.2.4/node_modules/@vitest/snapshot/dist/index.js +2082 -0
  602. package/dist/node_modules/.pnpm/@vitest_spy@3.2.4/node_modules/@vitest/spy/dist/index.js +192 -0
  603. package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/chunk-_commonjsHelpers.js +158 -0
  604. package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/diff.js +1535 -0
  605. package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/error.js +155 -0
  606. package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/helpers.js +244 -0
  607. package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/index.js +621 -0
  608. package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/source-map.js +890 -0
  609. package/dist/node_modules/.pnpm/chai@5.3.3/node_modules/chai/index.js +3558 -0
  610. package/dist/node_modules/.pnpm/expect-type@1.2.2/node_modules/expect-type/dist/branding.js +13 -0
  611. package/dist/node_modules/.pnpm/expect-type@1.2.2/node_modules/expect-type/dist/index.js +115 -0
  612. package/dist/node_modules/.pnpm/expect-type@1.2.2/node_modules/expect-type/dist/messages.js +77 -0
  613. package/dist/node_modules/.pnpm/expect-type@1.2.2/node_modules/expect-type/dist/overloads.js +13 -0
  614. package/dist/node_modules/.pnpm/expect-type@1.2.2/node_modules/expect-type/dist/utils.js +30 -0
  615. package/dist/node_modules/.pnpm/js-tokens@9.0.1/node_modules/js-tokens/index.js +398 -0
  616. 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 +79 -0
  617. 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 +64 -0
  618. 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 +185 -0
  619. 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 +30 -0
  620. 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 +37 -0
  621. 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 +17 -0
  622. package/dist/node_modules/.pnpm/lodash.clonedeep@4.5.0/node_modules/lodash.clonedeep/index.js +1486 -0
  623. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/arguments.js +11 -0
  624. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/array.js +18 -0
  625. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/bigint.js +11 -0
  626. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/class.js +19 -0
  627. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/date.js +15 -0
  628. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/error.js +39 -0
  629. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/function.js +14 -0
  630. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/helpers.js +141 -0
  631. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/html.js +43 -0
  632. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/index.js +138 -0
  633. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/map.js +25 -0
  634. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/number.js +22 -0
  635. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/object.js +27 -0
  636. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/promise.js +6 -0
  637. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/regexp.js +12 -0
  638. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/set.js +18 -0
  639. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/string.js +27 -0
  640. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/symbol.js +10 -0
  641. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/typedarray.js +36 -0
  642. package/dist/node_modules/.pnpm/magic-string@0.30.21/node_modules/magic-string/dist/magic-string.es.js +1258 -0
  643. package/dist/node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/index.js +21 -0
  644. package/dist/node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.js +478 -0
  645. package/dist/node_modules/.pnpm/strip-literal@3.1.0/node_modules/strip-literal/dist/index.js +84 -0
  646. package/dist/node_modules/.pnpm/tinyrainbow@2.0.0/node_modules/tinyrainbow/dist/chunk-BVHSVHOK.js +85 -0
  647. package/dist/node_modules/.pnpm/tinyrainbow@2.0.0/node_modules/tinyrainbow/dist/node.js +15 -0
  648. package/dist/node_modules/.pnpm/tinyspy@4.0.4/node_modules/tinyspy/dist/index.js +158 -0
  649. package/dist/node_modules/.pnpm/vitest@3.2.4_@types_node@22.13.14_@vitest_ui@3.2.4_happy-dom@20.0.10_jiti@2.6.1_jsdom@2_4abc0aa80426c2cc5a9175f21e1d4ebb/node_modules/vitest/dist/chunks/_commonjsHelpers.BFTU3MAI.js +8 -0
  650. package/dist/node_modules/.pnpm/vitest@3.2.4_@types_node@22.13.14_@vitest_ui@3.2.4_happy-dom@20.0.10_jiti@2.6.1_jsdom@2_4abc0aa80426c2cc5a9175f21e1d4ebb/node_modules/vitest/dist/chunks/benchmark.CYdenmiT.js +41 -0
  651. package/dist/node_modules/.pnpm/vitest@3.2.4_@types_node@22.13.14_@vitest_ui@3.2.4_happy-dom@20.0.10_jiti@2.6.1_jsdom@2_4abc0aa80426c2cc5a9175f21e1d4ebb/node_modules/vitest/dist/chunks/date.Bq6ZW5rf.js +50 -0
  652. package/dist/node_modules/.pnpm/vitest@3.2.4_@types_node@22.13.14_@vitest_ui@3.2.4_happy-dom@20.0.10_jiti@2.6.1_jsdom@2_4abc0aa80426c2cc5a9175f21e1d4ebb/node_modules/vitest/dist/chunks/index.CdQS2e2Q.js +38 -0
  653. package/dist/node_modules/.pnpm/vitest@3.2.4_@types_node@22.13.14_@vitest_ui@3.2.4_happy-dom@20.0.10_jiti@2.6.1_jsdom@2_4abc0aa80426c2cc5a9175f21e1d4ebb/node_modules/vitest/dist/chunks/utils.XdZDrNZV.js +66 -0
  654. package/dist/node_modules/.pnpm/vitest@3.2.4_@types_node@22.13.14_@vitest_ui@3.2.4_happy-dom@20.0.10_jiti@2.6.1_jsdom@2_4abc0aa80426c2cc5a9175f21e1d4ebb/node_modules/vitest/dist/chunks/vi.bdSIJ99Y.js +2986 -0
  655. package/dist/node_modules/.pnpm/vitest@3.2.4_@types_node@22.13.14_@vitest_ui@3.2.4_happy-dom@20.0.10_jiti@2.6.1_jsdom@2_4abc0aa80426c2cc5a9175f21e1d4ebb/node_modules/vitest/dist/index.js +24 -0
  656. package/dist/operations/condition/index.js +23 -21
  657. package/dist/operations/exec/index.js +49 -44
  658. package/dist/operations/item-create/index.js +49 -36
  659. package/dist/operations/item-delete/index.js +56 -44
  660. package/dist/operations/item-read/index.js +56 -44
  661. package/dist/operations/item-update/index.js +62 -51
  662. package/dist/operations/json-web-token/index.js +33 -35
  663. package/dist/operations/log/index.js +14 -9
  664. package/dist/operations/mail/index.js +39 -25
  665. package/dist/operations/mail/rate-limiter.js +26 -25
  666. package/dist/operations/notification/index.js +52 -42
  667. package/dist/operations/request/index.js +47 -39
  668. package/dist/operations/sleep/index.js +11 -6
  669. package/dist/operations/throw-error/index.js +14 -9
  670. package/dist/operations/transform/index.js +12 -7
  671. package/dist/operations/trigger/index.js +42 -37
  672. package/dist/packages/types/dist/index.js +403 -0
  673. package/dist/permissions/cache.js +28 -25
  674. package/dist/permissions/lib/fetch-permissions.js +33 -26
  675. package/dist/permissions/lib/fetch-policies.js +42 -41
  676. package/dist/permissions/lib/fetch-roles-tree.js +10 -5
  677. package/dist/permissions/lib/with-app-minimal-permissions.js +14 -9
  678. package/dist/permissions/modules/fetch-accountability-collection-access/fetch-accountability-collection-access.js +56 -54
  679. package/dist/permissions/modules/fetch-accountability-policy-globals/fetch-accountability-policy-globals.js +14 -15
  680. package/dist/permissions/modules/fetch-allowed-collections/fetch-allowed-collections.js +26 -11
  681. package/dist/permissions/modules/fetch-allowed-field-map/fetch-allowed-field-map.js +40 -25
  682. package/dist/permissions/modules/fetch-allowed-fields/fetch-allowed-fields.js +34 -19
  683. package/dist/permissions/modules/fetch-global-access/fetch-global-access.js +33 -26
  684. package/dist/permissions/modules/fetch-inconsistent-field-map/fetch-inconsistent-field-map.js +38 -25
  685. package/dist/permissions/modules/fetch-policies-ip-access/fetch-policies-ip-access.js +27 -27
  686. package/dist/permissions/modules/process-ast/lib/extract-fields-from-children.js +33 -48
  687. package/dist/permissions/modules/process-ast/lib/extract-fields-from-query.js +55 -55
  688. package/dist/permissions/modules/process-ast/lib/field-map-from-ast.js +15 -7
  689. package/dist/permissions/modules/process-ast/lib/get-cases.js +30 -39
  690. package/dist/permissions/modules/process-ast/lib/inject-cases.js +44 -50
  691. package/dist/permissions/modules/process-ast/process-ast.js +45 -38
  692. package/dist/permissions/modules/process-ast/types.js +1 -1
  693. package/dist/permissions/modules/process-ast/utils/collections-in-field-map.js +10 -6
  694. package/dist/permissions/modules/process-ast/utils/context-has-dynamic-variables.js +6 -2
  695. package/dist/permissions/modules/process-ast/utils/dedupe-access.js +32 -28
  696. package/dist/permissions/modules/process-ast/utils/extract-paths-from-query.js +54 -58
  697. package/dist/permissions/modules/process-ast/utils/find-related-collection.js +12 -8
  698. package/dist/permissions/modules/process-ast/utils/flatten-filter.js +30 -33
  699. package/dist/permissions/modules/process-ast/utils/format-a2o-key.js +6 -2
  700. package/dist/permissions/modules/process-ast/utils/get-info-for-path.js +13 -6
  701. package/dist/permissions/modules/process-ast/utils/has-item-permissions.js +6 -2
  702. package/dist/permissions/modules/process-ast/utils/stringify-query-path.js +6 -2
  703. package/dist/permissions/modules/process-ast/utils/validate-path/create-error.js +13 -14
  704. package/dist/permissions/modules/process-ast/utils/validate-path/validate-path-existence.js +16 -11
  705. package/dist/permissions/modules/process-ast/utils/validate-path/validate-path-permissions.js +28 -27
  706. package/dist/permissions/modules/process-payload/lib/is-field-nullable.js +13 -10
  707. package/dist/permissions/modules/process-payload/process-payload.js +77 -82
  708. package/dist/permissions/modules/validate-access/lib/validate-collection-access.js +19 -9
  709. package/dist/permissions/modules/validate-access/lib/validate-item-access.js +108 -99
  710. package/dist/permissions/modules/validate-access/validate-access.js +33 -39
  711. package/dist/permissions/modules/validate-remaining-admin/validate-remaining-admin-count.js +10 -7
  712. package/dist/permissions/modules/validate-remaining-admin/validate-remaining-admin-users.js +14 -9
  713. package/dist/permissions/types.js +1 -1
  714. package/dist/permissions/utils/create-default-accountability.js +14 -10
  715. package/dist/permissions/utils/default-permission.js +10 -6
  716. package/dist/permissions/utils/extract-required-dynamic-variable-context.js +47 -42
  717. package/dist/permissions/utils/fetch-dynamic-variable-data.js +62 -69
  718. package/dist/permissions/utils/fetch-raw-permissions.js +33 -37
  719. package/dist/permissions/utils/fetch-share-info.js +17 -8
  720. package/dist/permissions/utils/filter-policies-by-ip.js +16 -14
  721. package/dist/permissions/utils/get-permissions-for-share.js +163 -176
  722. package/dist/permissions/utils/get-unaliased-field-key.js +21 -23
  723. package/dist/permissions/utils/merge-fields.js +23 -28
  724. package/dist/permissions/utils/merge-permissions.js +78 -104
  725. package/dist/permissions/utils/process-permissions.js +15 -10
  726. package/dist/permissions/utils/with-cache.js +30 -25
  727. package/dist/rate-limiter.js +28 -26
  728. package/dist/redis/index.js +5 -3
  729. package/dist/redis/lib/create-redis.js +15 -10
  730. package/dist/redis/lib/use-redis.js +21 -19
  731. package/dist/redis/utils/redis-config-available.js +14 -9
  732. package/dist/request/agent-with-ip-validation.js +27 -35
  733. package/dist/request/index.js +19 -14
  734. package/dist/request/is-denied-ip.js +41 -39
  735. package/dist/schedules/metrics.js +45 -42
  736. package/dist/schedules/project.js +26 -25
  737. package/dist/schedules/retention.js +105 -106
  738. package/dist/schedules/telemetry.js +30 -26
  739. package/dist/schedules/tus.js +24 -21
  740. package/dist/server.js +155 -151
  741. package/dist/services/access.js +43 -43
  742. package/dist/services/activity.js +11 -6
  743. package/dist/services/assets/name-deduper.js +28 -23
  744. package/dist/services/assets.js +292 -300
  745. package/dist/services/authentication.js +410 -444
  746. package/dist/services/collections.js +592 -646
  747. package/dist/services/comments.js +143 -132
  748. package/dist/services/dashboards.js +11 -6
  749. package/dist/services/deployment-projects.js +135 -138
  750. package/dist/services/deployment-runs.js +87 -92
  751. package/dist/services/deployment.js +459 -449
  752. package/dist/services/extensions.js +211 -227
  753. package/dist/services/fields/build-collection-and-field-relations.js +53 -53
  754. package/dist/services/fields/get-collection-meta-updates.js +68 -69
  755. package/dist/services/fields/get-collection-relation-list.js +26 -26
  756. package/dist/services/fields.js +732 -810
  757. package/dist/services/files/lib/extract-metadata.js +34 -31
  758. package/dist/services/files/lib/get-sharp-instance.js +14 -9
  759. package/dist/services/files/utils/get-metadata.js +101 -105
  760. package/dist/services/files/utils/parse-image-metadata.js +70 -64
  761. package/dist/services/files.js +409 -328
  762. package/dist/services/flows.js +34 -27
  763. package/dist/services/folders.js +83 -81
  764. package/dist/services/graphql/errors/execution.js +7 -2
  765. package/dist/services/graphql/errors/format.js +16 -11
  766. package/dist/services/graphql/errors/index.js +4 -2
  767. package/dist/services/graphql/errors/validation.js +7 -2
  768. package/dist/services/graphql/index.js +95 -94
  769. package/dist/services/graphql/resolvers/get-collection-type.js +34 -33
  770. package/dist/services/graphql/resolvers/get-field-type.js +51 -50
  771. package/dist/services/graphql/resolvers/get-relation-type.js +41 -38
  772. package/dist/services/graphql/resolvers/mutation.js +68 -73
  773. package/dist/services/graphql/resolvers/query.js +68 -68
  774. package/dist/services/graphql/resolvers/system-admin.js +279 -286
  775. package/dist/services/graphql/resolvers/system-global.js +414 -432
  776. package/dist/services/graphql/resolvers/system.js +406 -459
  777. package/dist/services/graphql/schema/get-types.js +182 -220
  778. package/dist/services/graphql/schema/index.js +189 -185
  779. package/dist/services/graphql/schema/parse-args.js +28 -33
  780. package/dist/services/graphql/schema/parse-query.js +106 -103
  781. package/dist/services/graphql/schema/read.js +451 -735
  782. package/dist/services/graphql/schema/write.js +119 -141
  783. package/dist/services/graphql/schema-cache.js +13 -7
  784. package/dist/services/graphql/subscription.js +91 -94
  785. package/dist/services/graphql/types/bigint.js +41 -42
  786. package/dist/services/graphql/types/date.js +10 -5
  787. package/dist/services/graphql/types/geojson.js +11 -6
  788. package/dist/services/graphql/types/hash.js +10 -5
  789. package/dist/services/graphql/types/string-or-float.js +31 -29
  790. package/dist/services/graphql/types/void.js +18 -13
  791. package/dist/services/graphql/utils/add-path-to-validation-error.js +18 -14
  792. package/dist/services/graphql/utils/aggregate-query.js +33 -37
  793. package/dist/services/graphql/utils/dedupe-resolvers.js +62 -0
  794. package/dist/services/graphql/utils/filter-replace-m2a.js +66 -63
  795. package/dist/services/graphql/utils/process-error.js +40 -41
  796. package/dist/services/graphql/utils/replace-fragments.js +30 -19
  797. package/dist/services/graphql/utils/replace-funcs.js +23 -19
  798. package/dist/services/graphql/utils/sanitize-gql-schema.js +79 -73
  799. package/dist/services/import-export.js +671 -633
  800. package/dist/services/index.js +95 -41
  801. package/dist/services/items.js +854 -945
  802. package/dist/services/mail/index.js +106 -104
  803. package/dist/services/mail/rate-limiter.js +26 -25
  804. package/dist/services/meta.js +71 -63
  805. package/dist/services/notifications.js +66 -58
  806. package/dist/services/operations.js +30 -25
  807. package/dist/services/panels.js +11 -6
  808. package/dist/services/payload.js +745 -832
  809. package/dist/services/permissions.js +143 -132
  810. package/dist/services/policies.js +74 -87
  811. package/dist/services/presets.js +11 -6
  812. package/dist/services/relations.js +438 -494
  813. package/dist/services/revisions.js +50 -44
  814. package/dist/services/roles.js +81 -87
  815. package/dist/services/schema.js +50 -52
  816. package/dist/services/server.js +320 -384
  817. package/dist/services/settings.js +31 -21
  818. package/dist/services/shares.js +138 -141
  819. package/dist/services/specifications.js +396 -526
  820. package/dist/services/tfa.js +64 -65
  821. package/dist/services/translations.js +46 -36
  822. package/dist/services/tus/data-store.js +186 -214
  823. package/dist/services/tus/index.js +4 -2
  824. package/dist/services/tus/lockers.js +77 -81
  825. package/dist/services/tus/server.js +109 -113
  826. package/dist/services/tus/utils/wait-timeout.js +16 -12
  827. package/dist/services/users.js +490 -525
  828. package/dist/services/utils.js +102 -129
  829. package/dist/services/versions.js +303 -314
  830. package/dist/services/websocket.js +45 -36
  831. package/dist/start.js +6 -1
  832. package/dist/storage/get-storage-driver.js +18 -15
  833. package/dist/storage/index.js +18 -16
  834. package/dist/storage/register-drivers.js +20 -17
  835. package/dist/storage/register-locations.js +28 -17
  836. package/dist/synchronization.js +106 -103
  837. package/dist/telemetry/counter/use-buffered-counter.js +138 -0
  838. package/dist/telemetry/counter/use-counters.js +32 -0
  839. package/dist/telemetry/index.js +5 -3
  840. package/dist/telemetry/lib/get-report.js +72 -58
  841. package/dist/telemetry/lib/send-report.js +24 -23
  842. package/dist/telemetry/lib/track.js +32 -28
  843. package/dist/telemetry/types/report.js +1 -1
  844. package/dist/telemetry/utils/check-user-limits.js +20 -16
  845. package/dist/telemetry/utils/format-api-request-counts.js +26 -0
  846. package/dist/telemetry/utils/get-extension-count.js +21 -18
  847. package/dist/telemetry/utils/get-field-count.js +12 -11
  848. package/dist/telemetry/utils/get-filesize-sum.js +9 -6
  849. package/dist/telemetry/utils/get-item-count.js +40 -34
  850. package/dist/telemetry/utils/get-random-wait-time.js +8 -4
  851. package/dist/telemetry/utils/get-settings.js +37 -34
  852. package/dist/telemetry/utils/get-user-item-count.js +24 -18
  853. package/dist/telemetry/utils/should-check-user-limits.js +14 -11
  854. package/dist/test-utils/README.md +316 -5
  855. package/dist/test-utils/cache.js +62 -57
  856. package/dist/test-utils/controllers.js +94 -93
  857. package/dist/test-utils/database.js +50 -50
  858. package/dist/test-utils/emitter.js +36 -36
  859. package/dist/test-utils/env.js +77 -0
  860. package/dist/test-utils/knex.js +208 -254
  861. package/dist/test-utils/schema.js +33 -33
  862. package/dist/test-utils/services/fields-service.js +36 -35
  863. package/dist/test-utils/services/files-service.js +33 -32
  864. package/dist/test-utils/services/folders-service.js +32 -31
  865. package/dist/test-utils/services/items-service.js +50 -35
  866. package/dist/test-utils/storage.js +150 -0
  867. package/dist/types/ast.js +1 -1
  868. package/dist/types/auth.js +1 -1
  869. package/dist/types/collection.js +1 -1
  870. package/dist/types/events.js +1 -1
  871. package/dist/types/index.js +9 -7
  872. package/dist/types/meta.js +9 -5
  873. package/dist/types/migration.js +1 -1
  874. package/dist/types/revision.js +1 -1
  875. package/dist/types/rolemap.js +1 -1
  876. package/dist/utils/apply-diff.js +276 -291
  877. package/dist/utils/apply-snapshot.js +27 -13
  878. package/dist/utils/async-handler.js +5 -1
  879. package/dist/utils/calculate-field-depth.js +70 -69
  880. package/dist/utils/compress.js +13 -10
  881. package/dist/utils/construct-flow-tree.js +29 -24
  882. package/dist/utils/create-admin.js +54 -46
  883. package/dist/utils/deep-map-response.js +64 -59
  884. package/dist/utils/delete-from-require-cache.js +15 -11
  885. package/dist/utils/destroy-piped-stream.js +13 -0
  886. package/dist/utils/encrypt.js +59 -59
  887. package/dist/utils/fetch-user-count/fetch-access-lookup.js +22 -22
  888. package/dist/utils/fetch-user-count/fetch-access-roles.js +31 -35
  889. package/dist/utils/fetch-user-count/fetch-active-users.js +6 -2
  890. package/dist/utils/fetch-user-count/fetch-user-count.js +56 -62
  891. package/dist/utils/fetch-user-count/get-user-count-query.js +19 -16
  892. package/dist/utils/filter-items.js +27 -30
  893. package/dist/utils/freeze-schema.js +28 -29
  894. package/dist/utils/generate-hash.js +11 -8
  895. package/dist/utils/generate-translations.js +436 -0
  896. package/dist/utils/get-accountability-for-role.js +35 -30
  897. package/dist/utils/get-accountability-for-token.js +50 -53
  898. package/dist/utils/get-address.js +20 -17
  899. package/dist/utils/get-allowed-log-levels.js +12 -9
  900. package/dist/utils/get-auth-providers.js +30 -23
  901. package/dist/utils/get-cache-headers.js +30 -37
  902. package/dist/utils/get-cache-key.js +29 -26
  903. package/dist/utils/get-collection-from-alias.js +14 -10
  904. package/dist/utils/get-column-path.js +62 -61
  905. package/dist/utils/get-config-from-env.js +43 -45
  906. package/dist/utils/get-default-index-name.js +23 -20
  907. package/dist/utils/get-default-value.js +43 -52
  908. package/dist/utils/get-field-relational-depth.js +24 -20
  909. package/dist/utils/get-field-system-rows.js +19 -16
  910. package/dist/utils/get-graphql-query-and-variables.js +9 -4
  911. package/dist/utils/get-graphql-type.js +32 -38
  912. package/dist/utils/get-ip-from-req.js +38 -42
  913. package/dist/utils/get-local-type.js +119 -129
  914. package/dist/utils/get-milliseconds.js +13 -8
  915. package/dist/utils/get-module-default.js +9 -5
  916. package/dist/utils/get-schema.js +160 -165
  917. package/dist/utils/get-secret.js +18 -13
  918. package/dist/utils/get-service.js +63 -59
  919. package/dist/utils/get-snapshot-diff.js +106 -134
  920. package/dist/utils/get-snapshot.js +70 -55
  921. package/dist/utils/get-string-byte-size.js +8 -4
  922. package/dist/utils/get-versioned-hash.js +12 -4
  923. package/dist/utils/import-file-url.js +10 -5
  924. package/dist/utils/is-directus-jwt.js +17 -14
  925. package/dist/utils/is-field-allowed.js +11 -7
  926. package/dist/utils/is-url-allowed.js +29 -29
  927. package/dist/utils/is-valid-uuid.js +22 -18
  928. package/dist/utils/job-queue.js +29 -25
  929. package/dist/utils/jwt.js +30 -27
  930. package/dist/utils/md.js +12 -7
  931. package/dist/utils/parse-filter-key.js +21 -14
  932. package/dist/utils/parse-numeric-string.js +20 -20
  933. package/dist/utils/parse-value.js +12 -9
  934. package/dist/utils/permissions-cacheable.js +45 -37
  935. package/dist/utils/redact-object.js +120 -125
  936. package/dist/utils/reduce-schema.js +53 -60
  937. package/dist/utils/require-text.js +8 -3
  938. package/dist/utils/require-yaml.js +10 -5
  939. package/dist/utils/sanitize-query.js +195 -213
  940. package/dist/utils/sanitize-schema.js +102 -83
  941. package/dist/utils/schedule.js +28 -24
  942. package/dist/utils/should-clear-cache.js +23 -18
  943. package/dist/utils/should-skip-cache.js +39 -40
  944. package/dist/utils/split-fields.js +33 -30
  945. package/dist/utils/stall.js +36 -32
  946. package/dist/utils/store.js +40 -0
  947. package/dist/utils/transaction.js +82 -81
  948. package/dist/utils/transformations.js +125 -129
  949. package/dist/utils/translations-shared.js +56 -0
  950. package/dist/utils/translations-validation.js +9 -0
  951. package/dist/utils/url.js +67 -66
  952. package/dist/utils/user-name.js +18 -14
  953. package/dist/utils/validate-diff.js +124 -150
  954. package/dist/utils/validate-env.js +16 -11
  955. package/dist/utils/validate-keys.js +22 -19
  956. package/dist/utils/validate-query.js +185 -198
  957. package/dist/utils/validate-snapshot.js +63 -73
  958. package/dist/utils/validate-storage.js +37 -35
  959. package/dist/utils/validate-user-count-integrity.js +28 -20
  960. package/dist/utils/verify-session-jwt.js +21 -21
  961. package/dist/utils/versioning/handle-version.js +96 -95
  962. package/dist/utils/versioning/merge-version-data.js +14 -9
  963. package/dist/utils/versioning/split-recursive.js +40 -26
  964. package/dist/websocket/authenticate.js +67 -66
  965. package/dist/websocket/collab/calculate-cache-metadata.js +99 -118
  966. package/dist/websocket/collab/collab.js +420 -479
  967. package/dist/websocket/collab/constants.js +16 -12
  968. package/dist/websocket/collab/filter-to-fields.js +18 -10
  969. package/dist/websocket/collab/messenger.js +252 -224
  970. package/dist/websocket/collab/payload-permissions.js +140 -149
  971. package/dist/websocket/collab/permissions-cache.js +188 -202
  972. package/dist/websocket/collab/room.js +569 -588
  973. package/dist/websocket/collab/store.js +9 -31
  974. package/dist/websocket/collab/types.js +1 -1
  975. package/dist/websocket/collab/verify-permissions.js +116 -98
  976. package/dist/websocket/controllers/base.js +331 -352
  977. package/dist/websocket/controllers/graphql.js +98 -104
  978. package/dist/websocket/controllers/hooks.js +117 -118
  979. package/dist/websocket/controllers/index.js +31 -29
  980. package/dist/websocket/controllers/logs.js +65 -53
  981. package/dist/websocket/controllers/rest.js +59 -47
  982. package/dist/websocket/errors.js +62 -55
  983. package/dist/websocket/handlers/heartbeat.js +77 -77
  984. package/dist/websocket/handlers/index.js +36 -35
  985. package/dist/websocket/handlers/items.js +111 -109
  986. package/dist/websocket/handlers/logs.js +122 -120
  987. package/dist/websocket/handlers/subscribe.js +165 -182
  988. package/dist/websocket/messages.js +90 -93
  989. package/dist/websocket/types.js +1 -1
  990. package/dist/websocket/utils/get-expires-at-for-token.js +12 -7
  991. package/dist/websocket/utils/items.js +123 -123
  992. package/dist/websocket/utils/message.js +26 -24
  993. package/dist/websocket/utils/wait-for-message.js +46 -43
  994. package/package.json +35 -32
  995. package/dist/ai/chat/constants/system-prompt.d.ts +0 -1
  996. package/dist/ai/chat/controllers/chat.post.d.ts +0 -2
  997. package/dist/ai/chat/lib/create-ui-stream.d.ts +0 -16
  998. package/dist/ai/chat/lib/transform-file-parts.d.ts +0 -12
  999. package/dist/ai/chat/middleware/load-settings.d.ts +0 -2
  1000. package/dist/ai/chat/models/chat-request.d.ts +0 -167
  1001. package/dist/ai/chat/models/providers.d.ts +0 -23
  1002. package/dist/ai/chat/router.d.ts +0 -1
  1003. package/dist/ai/chat/utils/chat-request-tool-to-ai-sdk-tool.d.ts +0 -9
  1004. package/dist/ai/chat/utils/fix-error-tool-calls.d.ts +0 -12
  1005. package/dist/ai/chat/utils/format-context.d.ts +0 -5
  1006. package/dist/ai/chat/utils/parse-json-schema-7.d.ts +0 -13
  1007. package/dist/ai/files/adapters/anthropic.d.ts +0 -3
  1008. package/dist/ai/files/adapters/google.d.ts +0 -3
  1009. package/dist/ai/files/adapters/index.d.ts +0 -3
  1010. package/dist/ai/files/adapters/openai.d.ts +0 -3
  1011. package/dist/ai/files/controllers/upload.d.ts +0 -2
  1012. package/dist/ai/files/lib/fetch-provider.d.ts +0 -1
  1013. package/dist/ai/files/lib/upload-to-provider.d.ts +0 -4
  1014. package/dist/ai/files/router.d.ts +0 -1
  1015. package/dist/ai/files/types.d.ts +0 -5
  1016. package/dist/ai/mcp/index.d.ts +0 -1
  1017. package/dist/ai/mcp/server.d.ts +0 -126
  1018. package/dist/ai/mcp/transport.d.ts +0 -13
  1019. package/dist/ai/mcp/types.d.ts +0 -15
  1020. package/dist/ai/providers/anthropic-file-support.d.ts +0 -12
  1021. package/dist/ai/providers/index.d.ts +0 -3
  1022. package/dist/ai/providers/options.d.ts +0 -14
  1023. package/dist/ai/providers/registry.d.ts +0 -6
  1024. package/dist/ai/providers/types.d.ts +0 -34
  1025. package/dist/ai/tools/assets/index.d.ts +0 -3
  1026. package/dist/ai/tools/collections/index.d.ts +0 -84
  1027. package/dist/ai/tools/define-tool.d.ts +0 -2
  1028. package/dist/ai/tools/fields/index.d.ts +0 -101
  1029. package/dist/ai/tools/files/index.d.ts +0 -235
  1030. package/dist/ai/tools/flows/index.d.ts +0 -323
  1031. package/dist/ai/tools/folders/index.d.ts +0 -95
  1032. package/dist/ai/tools/index.d.ts +0 -15
  1033. package/dist/ai/tools/items/index.d.ts +0 -87
  1034. package/dist/ai/tools/operations/index.d.ts +0 -217
  1035. package/dist/ai/tools/relations/index.d.ts +0 -73
  1036. package/dist/ai/tools/schema/index.d.ts +0 -54
  1037. package/dist/ai/tools/schema.d.ts +0 -485
  1038. package/dist/ai/tools/system/index.d.ts +0 -3
  1039. package/dist/ai/tools/trigger-flow/index.d.ts +0 -8
  1040. package/dist/ai/tools/types.d.ts +0 -40
  1041. package/dist/ai/tools/utils.d.ts +0 -9
  1042. package/dist/app.d.ts +0 -2
  1043. package/dist/auth/auth.d.ts +0 -47
  1044. package/dist/auth/drivers/index.d.ts +0 -5
  1045. package/dist/auth/drivers/ldap.d.ts +0 -18
  1046. package/dist/auth/drivers/local.d.ts +0 -9
  1047. package/dist/auth/drivers/oauth2.d.ts +0 -18
  1048. package/dist/auth/drivers/openid.d.ts +0 -19
  1049. package/dist/auth/drivers/saml.d.ts +0 -13
  1050. package/dist/auth/utils/generate-callback-url.d.ts +0 -11
  1051. package/dist/auth/utils/resolve-login-redirect.d.ts +0 -11
  1052. package/dist/auth.d.ts +0 -3
  1053. package/dist/bus/index.d.ts +0 -1
  1054. package/dist/bus/lib/use-bus.d.ts +0 -9
  1055. package/dist/cache.d.ts +0 -31
  1056. package/dist/cli/commands/bootstrap/index.d.ts +0 -3
  1057. package/dist/cli/commands/count/index.d.ts +0 -1
  1058. package/dist/cli/commands/database/install.d.ts +0 -1
  1059. package/dist/cli/commands/database/migrate.d.ts +0 -1
  1060. package/dist/cli/commands/init/index.d.ts +0 -1
  1061. package/dist/cli/commands/init/questions.d.ts +0 -21
  1062. package/dist/cli/commands/roles/create.d.ts +0 -5
  1063. package/dist/cli/commands/schema/apply.d.ts +0 -9
  1064. package/dist/cli/commands/schema/snapshot.d.ts +0 -4
  1065. package/dist/cli/commands/security/key.d.ts +0 -1
  1066. package/dist/cli/commands/security/secret.d.ts +0 -1
  1067. package/dist/cli/commands/users/create.d.ts +0 -5
  1068. package/dist/cli/commands/users/passwd.d.ts +0 -4
  1069. package/dist/cli/index.d.ts +0 -2
  1070. package/dist/cli/load-extensions.d.ts +0 -1
  1071. package/dist/cli/run.d.ts +0 -1
  1072. package/dist/cli/utils/create-db-connection.d.ts +0 -13
  1073. package/dist/cli/utils/create-env/index.d.ts +0 -3
  1074. package/dist/cli/utils/drivers.d.ts +0 -3
  1075. package/dist/constants.d.ts +0 -30
  1076. package/dist/controllers/access.d.ts +0 -2
  1077. package/dist/controllers/activity.d.ts +0 -2
  1078. package/dist/controllers/assets.d.ts +0 -2
  1079. package/dist/controllers/auth.d.ts +0 -2
  1080. package/dist/controllers/collections.d.ts +0 -2
  1081. package/dist/controllers/comments.d.ts +0 -2
  1082. package/dist/controllers/dashboards.d.ts +0 -2
  1083. package/dist/controllers/deployment-webhooks.d.ts +0 -2
  1084. package/dist/controllers/deployment.d.ts +0 -2
  1085. package/dist/controllers/extensions.d.ts +0 -2
  1086. package/dist/controllers/fields.d.ts +0 -2
  1087. package/dist/controllers/files.d.ts +0 -4
  1088. package/dist/controllers/flows.d.ts +0 -2
  1089. package/dist/controllers/folders.d.ts +0 -2
  1090. package/dist/controllers/graphql.d.ts +0 -2
  1091. package/dist/controllers/items.d.ts +0 -2
  1092. package/dist/controllers/mcp.d.ts +0 -2
  1093. package/dist/controllers/metrics.d.ts +0 -2
  1094. package/dist/controllers/not-found.d.ts +0 -14
  1095. package/dist/controllers/notifications.d.ts +0 -2
  1096. package/dist/controllers/operations.d.ts +0 -2
  1097. package/dist/controllers/panels.d.ts +0 -2
  1098. package/dist/controllers/permissions.d.ts +0 -2
  1099. package/dist/controllers/policies.d.ts +0 -2
  1100. package/dist/controllers/presets.d.ts +0 -2
  1101. package/dist/controllers/relations.d.ts +0 -2
  1102. package/dist/controllers/revisions.d.ts +0 -2
  1103. package/dist/controllers/roles.d.ts +0 -2
  1104. package/dist/controllers/schema.d.ts +0 -2
  1105. package/dist/controllers/server.d.ts +0 -2
  1106. package/dist/controllers/settings.d.ts +0 -2
  1107. package/dist/controllers/shares.d.ts +0 -2
  1108. package/dist/controllers/translations.d.ts +0 -2
  1109. package/dist/controllers/tus.d.ts +0 -2
  1110. package/dist/controllers/users.d.ts +0 -2
  1111. package/dist/controllers/utils.d.ts +0 -2
  1112. package/dist/controllers/versions.d.ts +0 -2
  1113. package/dist/database/errors/dialects/mssql.d.ts +0 -3
  1114. package/dist/database/errors/dialects/mysql.d.ts +0 -3
  1115. package/dist/database/errors/dialects/oracle.d.ts +0 -2
  1116. package/dist/database/errors/dialects/postgres.d.ts +0 -3
  1117. package/dist/database/errors/dialects/sqlite.d.ts +0 -3
  1118. package/dist/database/errors/dialects/types.d.ts +0 -41
  1119. package/dist/database/errors/translate.d.ts +0 -12
  1120. package/dist/database/get-ast-from-query/get-ast-from-query.d.ts +0 -16
  1121. package/dist/database/get-ast-from-query/lib/convert-wildcards.d.ts +0 -15
  1122. package/dist/database/get-ast-from-query/lib/parse-fields.d.ts +0 -17
  1123. package/dist/database/get-ast-from-query/utils/get-allowed-sort.d.ts +0 -9
  1124. package/dist/database/get-ast-from-query/utils/get-deep-query.d.ts +0 -14
  1125. package/dist/database/get-ast-from-query/utils/get-related-collection.d.ts +0 -2
  1126. package/dist/database/helpers/capabilities/dialects/default.d.ts +0 -3
  1127. package/dist/database/helpers/capabilities/dialects/mysql.d.ts +0 -4
  1128. package/dist/database/helpers/capabilities/dialects/postgres.d.ts +0 -5
  1129. package/dist/database/helpers/capabilities/index.d.ts +0 -7
  1130. package/dist/database/helpers/capabilities/types.d.ts +0 -11
  1131. package/dist/database/helpers/date/dialects/default.d.ts +0 -3
  1132. package/dist/database/helpers/date/dialects/mssql.d.ts +0 -4
  1133. package/dist/database/helpers/date/dialects/mysql.d.ts +0 -5
  1134. package/dist/database/helpers/date/dialects/oracle.d.ts +0 -5
  1135. package/dist/database/helpers/date/dialects/sqlite.d.ts +0 -5
  1136. package/dist/database/helpers/date/index.d.ts +0 -7
  1137. package/dist/database/helpers/date/types.d.ts +0 -7
  1138. package/dist/database/helpers/fn/dialects/mssql.d.ts +0 -15
  1139. package/dist/database/helpers/fn/dialects/mysql.d.ts +0 -16
  1140. package/dist/database/helpers/fn/dialects/oracle.d.ts +0 -15
  1141. package/dist/database/helpers/fn/dialects/postgres.d.ts +0 -28
  1142. package/dist/database/helpers/fn/dialects/sqlite.d.ts +0 -15
  1143. package/dist/database/helpers/fn/index.d.ts +0 -7
  1144. package/dist/database/helpers/fn/json/parse-function.d.ts +0 -19
  1145. package/dist/database/helpers/fn/types.d.ts +0 -34
  1146. package/dist/database/helpers/geometry/dialects/mssql.d.ts +0 -14
  1147. package/dist/database/helpers/geometry/dialects/mysql.d.ts +0 -7
  1148. package/dist/database/helpers/geometry/dialects/oracle.d.ts +0 -15
  1149. package/dist/database/helpers/geometry/dialects/postgres.d.ts +0 -10
  1150. package/dist/database/helpers/geometry/dialects/redshift.d.ts +0 -7
  1151. package/dist/database/helpers/geometry/dialects/sqlite.d.ts +0 -6
  1152. package/dist/database/helpers/geometry/index.d.ts +0 -7
  1153. package/dist/database/helpers/geometry/types.d.ts +0 -20
  1154. package/dist/database/helpers/index.d.ts +0 -19
  1155. package/dist/database/helpers/number/dialects/default.d.ts +0 -3
  1156. package/dist/database/helpers/number/dialects/mssql.d.ts +0 -7
  1157. package/dist/database/helpers/number/dialects/oracle.d.ts +0 -6
  1158. package/dist/database/helpers/number/dialects/postgres.d.ts +0 -5
  1159. package/dist/database/helpers/number/dialects/sqlite.d.ts +0 -6
  1160. package/dist/database/helpers/number/index.d.ts +0 -7
  1161. package/dist/database/helpers/number/types.d.ts +0 -12
  1162. package/dist/database/helpers/number/utils/decimal-limit.d.ts +0 -4
  1163. package/dist/database/helpers/number/utils/maybe-stringify-big-int.d.ts +0 -1
  1164. package/dist/database/helpers/number/utils/number-in-range.d.ts +0 -3
  1165. package/dist/database/helpers/schema/dialects/cockroachdb.d.ts +0 -12
  1166. package/dist/database/helpers/schema/dialects/default.d.ts +0 -3
  1167. package/dist/database/helpers/schema/dialects/mssql.d.ts +0 -14
  1168. package/dist/database/helpers/schema/dialects/mysql.d.ts +0 -10
  1169. package/dist/database/helpers/schema/dialects/oracle.d.ts +0 -24
  1170. package/dist/database/helpers/schema/dialects/postgres.d.ts +0 -8
  1171. package/dist/database/helpers/schema/dialects/sqlite.d.ts +0 -8
  1172. package/dist/database/helpers/schema/index.d.ts +0 -7
  1173. package/dist/database/helpers/schema/types.d.ts +0 -63
  1174. package/dist/database/helpers/schema/utils/prep-query-params.d.ts +0 -12
  1175. package/dist/database/helpers/sequence/dialects/default.d.ts +0 -3
  1176. package/dist/database/helpers/sequence/dialects/postgres.d.ts +0 -12
  1177. package/dist/database/helpers/sequence/index.d.ts +0 -7
  1178. package/dist/database/helpers/sequence/types.d.ts +0 -5
  1179. package/dist/database/helpers/types.d.ts +0 -5
  1180. package/dist/database/index.d.ts +0 -15
  1181. package/dist/database/migrations/20201028A-remove-collection-foreign-keys.d.ts +0 -3
  1182. package/dist/database/migrations/20201029A-remove-system-relations.d.ts +0 -3
  1183. package/dist/database/migrations/20201029B-remove-system-collections.d.ts +0 -3
  1184. package/dist/database/migrations/20201029C-remove-system-fields.d.ts +0 -3
  1185. package/dist/database/migrations/20201105A-add-cascade-system-relations.d.ts +0 -8
  1186. package/dist/database/migrations/20201105B-change-webhook-url-type.d.ts +0 -3
  1187. package/dist/database/migrations/20210225A-add-relations-sort-field.d.ts +0 -3
  1188. package/dist/database/migrations/20210304A-remove-locked-fields.d.ts +0 -3
  1189. package/dist/database/migrations/20210312A-webhooks-collections-text.d.ts +0 -3
  1190. package/dist/database/migrations/20210331A-add-refresh-interval.d.ts +0 -3
  1191. package/dist/database/migrations/20210415A-make-filesize-nullable.d.ts +0 -3
  1192. package/dist/database/migrations/20210416A-add-collections-accountability.d.ts +0 -3
  1193. package/dist/database/migrations/20210422A-remove-files-interface.d.ts +0 -3
  1194. package/dist/database/migrations/20210506A-rename-interfaces.d.ts +0 -3
  1195. package/dist/database/migrations/20210510A-restructure-relations.d.ts +0 -3
  1196. package/dist/database/migrations/20210518A-add-foreign-key-constraints.d.ts +0 -3
  1197. package/dist/database/migrations/20210519A-add-system-fk-triggers.d.ts +0 -3
  1198. package/dist/database/migrations/20210521A-add-collections-icon-color.d.ts +0 -3
  1199. package/dist/database/migrations/20210525A-add-insights.d.ts +0 -3
  1200. package/dist/database/migrations/20210608A-add-deep-clone-config.d.ts +0 -3
  1201. package/dist/database/migrations/20210626A-change-filesize-bigint.d.ts +0 -3
  1202. package/dist/database/migrations/20210716A-add-conditions-to-fields.d.ts +0 -3
  1203. package/dist/database/migrations/20210721A-add-default-folder.d.ts +0 -3
  1204. package/dist/database/migrations/20210802A-replace-groups.d.ts +0 -3
  1205. package/dist/database/migrations/20210803A-add-required-to-fields.d.ts +0 -3
  1206. package/dist/database/migrations/20210805A-update-groups.d.ts +0 -3
  1207. package/dist/database/migrations/20210805B-change-image-metadata-structure.d.ts +0 -3
  1208. package/dist/database/migrations/20210811A-add-geometry-config.d.ts +0 -3
  1209. package/dist/database/migrations/20210831A-remove-limit-column.d.ts +0 -3
  1210. package/dist/database/migrations/20210903A-add-auth-provider.d.ts +0 -3
  1211. package/dist/database/migrations/20210907A-webhooks-collections-not-null.d.ts +0 -3
  1212. package/dist/database/migrations/20210910A-move-module-setup.d.ts +0 -3
  1213. package/dist/database/migrations/20210920A-webhooks-url-not-null.d.ts +0 -3
  1214. package/dist/database/migrations/20210924A-add-collection-organization.d.ts +0 -3
  1215. package/dist/database/migrations/20210927A-replace-fields-group.d.ts +0 -3
  1216. package/dist/database/migrations/20210927B-replace-m2m-interface.d.ts +0 -3
  1217. package/dist/database/migrations/20210929A-rename-login-action.d.ts +0 -3
  1218. package/dist/database/migrations/20211007A-update-presets.d.ts +0 -3
  1219. package/dist/database/migrations/20211009A-add-auth-data.d.ts +0 -3
  1220. package/dist/database/migrations/20211016A-add-webhook-headers.d.ts +0 -3
  1221. package/dist/database/migrations/20211103A-set-unique-to-user-token.d.ts +0 -3
  1222. package/dist/database/migrations/20211103B-update-special-geometry.d.ts +0 -3
  1223. package/dist/database/migrations/20211104A-remove-collections-listing.d.ts +0 -3
  1224. package/dist/database/migrations/20211118A-add-notifications.d.ts +0 -3
  1225. package/dist/database/migrations/20211211A-add-shares.d.ts +0 -3
  1226. package/dist/database/migrations/20211230A-add-project-descriptor.d.ts +0 -3
  1227. package/dist/database/migrations/20220303A-remove-default-project-color.d.ts +0 -3
  1228. package/dist/database/migrations/20220308A-add-bookmark-icon-and-color.d.ts +0 -3
  1229. package/dist/database/migrations/20220314A-add-translation-strings.d.ts +0 -3
  1230. package/dist/database/migrations/20220322A-rename-field-typecast-flags.d.ts +0 -3
  1231. package/dist/database/migrations/20220323A-add-field-validation.d.ts +0 -3
  1232. package/dist/database/migrations/20220325A-fix-typecast-flags.d.ts +0 -3
  1233. package/dist/database/migrations/20220325B-add-default-language.d.ts +0 -3
  1234. package/dist/database/migrations/20220402A-remove-default-value-panel-icon.d.ts +0 -3
  1235. package/dist/database/migrations/20220429A-add-flows.d.ts +0 -3
  1236. package/dist/database/migrations/20220429B-add-color-to-insights-icon.d.ts +0 -3
  1237. package/dist/database/migrations/20220429C-drop-non-null-from-ip-of-activity.d.ts +0 -3
  1238. package/dist/database/migrations/20220429D-drop-non-null-from-sender-of-notifications.d.ts +0 -3
  1239. package/dist/database/migrations/20220614A-rename-hook-trigger-to-event.d.ts +0 -3
  1240. package/dist/database/migrations/20220801A-update-notifications-timestamp-column.d.ts +0 -3
  1241. package/dist/database/migrations/20220802A-add-custom-aspect-ratios.d.ts +0 -3
  1242. package/dist/database/migrations/20220826A-add-origin-to-accountability.d.ts +0 -3
  1243. package/dist/database/migrations/20230401A-update-material-icons.d.ts +0 -3
  1244. package/dist/database/migrations/20230525A-add-preview-settings.d.ts +0 -3
  1245. package/dist/database/migrations/20230526A-migrate-translation-strings.d.ts +0 -3
  1246. package/dist/database/migrations/20230721A-require-shares-fields.d.ts +0 -3
  1247. package/dist/database/migrations/20230823A-add-content-versioning.d.ts +0 -3
  1248. package/dist/database/migrations/20230927A-themes.d.ts +0 -3
  1249. package/dist/database/migrations/20231009A-update-csv-fields-to-text.d.ts +0 -3
  1250. package/dist/database/migrations/20231009B-update-panel-options.d.ts +0 -3
  1251. package/dist/database/migrations/20231010A-add-extensions.d.ts +0 -3
  1252. package/dist/database/migrations/20231215A-add-focalpoints.d.ts +0 -3
  1253. package/dist/database/migrations/20240122A-add-report-url-fields.d.ts +0 -3
  1254. package/dist/database/migrations/20240204A-marketplace.d.ts +0 -3
  1255. package/dist/database/migrations/20240305A-change-useragent-type.d.ts +0 -3
  1256. package/dist/database/migrations/20240311A-deprecate-webhooks.d.ts +0 -28
  1257. package/dist/database/migrations/20240422A-public-registration.d.ts +0 -3
  1258. package/dist/database/migrations/20240515A-add-session-window.d.ts +0 -3
  1259. package/dist/database/migrations/20240701A-add-tus-data.d.ts +0 -3
  1260. package/dist/database/migrations/20240716A-update-files-date-fields.d.ts +0 -3
  1261. package/dist/database/migrations/20240806A-permissions-policies.d.ts +0 -3
  1262. package/dist/database/migrations/20240817A-update-icon-fields-length.d.ts +0 -3
  1263. package/dist/database/migrations/20240909A-separate-comments.d.ts +0 -3
  1264. package/dist/database/migrations/20240909B-consolidate-content-versioning.d.ts +0 -3
  1265. package/dist/database/migrations/20240924A-migrate-legacy-comments.d.ts +0 -3
  1266. package/dist/database/migrations/20240924B-populate-versioning-deltas.d.ts +0 -3
  1267. package/dist/database/migrations/20250224A-visual-editor.d.ts +0 -3
  1268. package/dist/database/migrations/20250609A-license-banner.d.ts +0 -3
  1269. package/dist/database/migrations/20250613A-add-project-id.d.ts +0 -3
  1270. package/dist/database/migrations/20250718A-add-direction.d.ts +0 -3
  1271. package/dist/database/migrations/20250813A-add-mcp.d.ts +0 -3
  1272. package/dist/database/migrations/20251012A-add-field-searchable.d.ts +0 -3
  1273. package/dist/database/migrations/20251014A-add-project-owner.d.ts +0 -3
  1274. package/dist/database/migrations/20251028A-add-retention-indexes.d.ts +0 -3
  1275. package/dist/database/migrations/20251103A-add-ai-settings.d.ts +0 -3
  1276. package/dist/database/migrations/20251224A-remove-webhooks.d.ts +0 -3
  1277. package/dist/database/migrations/20260110A-add-ai-provider-settings.d.ts +0 -3
  1278. package/dist/database/migrations/20260113A-add-revisions-index.d.ts +0 -3
  1279. package/dist/database/migrations/20260128A-add-collaborative-editing.d.ts +0 -3
  1280. package/dist/database/migrations/20260204A-add-deployment.d.ts +0 -3
  1281. package/dist/database/migrations/20260211A-add-deployment-webhooks.d.ts +0 -3
  1282. package/dist/database/migrations/run.d.ts +0 -2
  1283. package/dist/database/run-ast/lib/apply-query/add-join.d.ts +0 -54
  1284. package/dist/database/run-ast/lib/apply-query/aggregate.d.ts +0 -3
  1285. package/dist/database/run-ast/lib/apply-query/filter/get-filter-type.d.ts +0 -8
  1286. package/dist/database/run-ast/lib/apply-query/filter/index.d.ts +0 -8
  1287. package/dist/database/run-ast/lib/apply-query/filter/operator.d.ts +0 -3
  1288. package/dist/database/run-ast/lib/apply-query/filter/validate-operator.d.ts +0 -2
  1289. package/dist/database/run-ast/lib/apply-query/get-filter-path.d.ts +0 -1
  1290. package/dist/database/run-ast/lib/apply-query/get-operation.d.ts +0 -7
  1291. package/dist/database/run-ast/lib/apply-query/index.d.ts +0 -19
  1292. package/dist/database/run-ast/lib/apply-query/join-filter-with-cases.d.ts +0 -2
  1293. package/dist/database/run-ast/lib/apply-query/mock.d.ts +0 -3
  1294. package/dist/database/run-ast/lib/apply-query/pagination.d.ts +0 -3
  1295. package/dist/database/run-ast/lib/apply-query/search.d.ts +0 -4
  1296. package/dist/database/run-ast/lib/apply-query/sort.d.ts +0 -19
  1297. package/dist/database/run-ast/lib/get-db-query.d.ts +0 -14
  1298. package/dist/database/run-ast/lib/parse-current-level.d.ts +0 -7
  1299. package/dist/database/run-ast/modules/fetch-permitted-ast-root-fields.d.ts +0 -15
  1300. package/dist/database/run-ast/run-ast.d.ts +0 -7
  1301. package/dist/database/run-ast/types.d.ts +0 -20
  1302. package/dist/database/run-ast/utils/apply-case-when.d.ts +0 -17
  1303. package/dist/database/run-ast/utils/apply-function-to-column-name.d.ts +0 -12
  1304. package/dist/database/run-ast/utils/apply-parent-filters.d.ts +0 -3
  1305. package/dist/database/run-ast/utils/generate-alias.d.ts +0 -6
  1306. package/dist/database/run-ast/utils/get-column-pre-processor.d.ts +0 -10
  1307. package/dist/database/run-ast/utils/get-column.d.ts +0 -25
  1308. package/dist/database/run-ast/utils/get-field-alias.d.ts +0 -2
  1309. package/dist/database/run-ast/utils/get-inner-query-column-pre-processor.d.ts +0 -5
  1310. package/dist/database/run-ast/utils/merge-with-parent-items.d.ts +0 -3
  1311. package/dist/database/run-ast/utils/remove-temporary-fields.d.ts +0 -3
  1312. package/dist/database/run-ast/utils/with-preprocess-bindings.d.ts +0 -2
  1313. package/dist/database/seeds/run.d.ts +0 -2
  1314. package/dist/deployment/deployment.d.ts +0 -117
  1315. package/dist/deployment/drivers/index.d.ts +0 -2
  1316. package/dist/deployment/drivers/netlify.d.ts +0 -37
  1317. package/dist/deployment/drivers/vercel.d.ts +0 -35
  1318. package/dist/deployment/index.d.ts +0 -2
  1319. package/dist/deployment.d.ts +0 -29
  1320. package/dist/emitter.d.ts +0 -21
  1321. package/dist/extensions/index.d.ts +0 -2
  1322. package/dist/extensions/lib/get-extensions-path.d.ts +0 -1
  1323. package/dist/extensions/lib/get-extensions-settings.d.ts +0 -11
  1324. package/dist/extensions/lib/get-extensions.d.ts +0 -5
  1325. package/dist/extensions/lib/get-shared-deps-mapping.d.ts +0 -1
  1326. package/dist/extensions/lib/installation/index.d.ts +0 -2
  1327. package/dist/extensions/lib/installation/manager.d.ts +0 -5
  1328. package/dist/extensions/lib/sandbox/generate-api-extensions-sandbox-entrypoint.d.ts +0 -28
  1329. package/dist/extensions/lib/sandbox/generate-host-function-reference.d.ts +0 -11
  1330. package/dist/extensions/lib/sandbox/register/action.d.ts +0 -6
  1331. package/dist/extensions/lib/sandbox/register/call-reference.d.ts +0 -5
  1332. package/dist/extensions/lib/sandbox/register/filter.d.ts +0 -6
  1333. package/dist/extensions/lib/sandbox/register/index.d.ts +0 -5
  1334. package/dist/extensions/lib/sandbox/register/operation.d.ts +0 -6
  1335. package/dist/extensions/lib/sandbox/register/route.d.ts +0 -17
  1336. package/dist/extensions/lib/sandbox/sdk/generators/index.d.ts +0 -3
  1337. package/dist/extensions/lib/sandbox/sdk/generators/log.d.ts +0 -3
  1338. package/dist/extensions/lib/sandbox/sdk/generators/request.d.ts +0 -12
  1339. package/dist/extensions/lib/sandbox/sdk/generators/sleep.d.ts +0 -3
  1340. package/dist/extensions/lib/sandbox/sdk/index.d.ts +0 -2
  1341. package/dist/extensions/lib/sandbox/sdk/instantiate.d.ts +0 -11
  1342. package/dist/extensions/lib/sandbox/sdk/sdk.d.ts +0 -20
  1343. package/dist/extensions/lib/sandbox/sdk/utils/index.d.ts +0 -1
  1344. package/dist/extensions/lib/sandbox/sdk/utils/wrap.d.ts +0 -13
  1345. package/dist/extensions/lib/sync/status.d.ts +0 -11
  1346. package/dist/extensions/lib/sync/sync.d.ts +0 -6
  1347. package/dist/extensions/lib/sync/tracker.d.ts +0 -18
  1348. package/dist/extensions/lib/sync/utils.d.ts +0 -24
  1349. package/dist/extensions/lib/wrap-embeds.d.ts +0 -4
  1350. package/dist/extensions/manager.d.ts +0 -164
  1351. package/dist/flows.d.ts +0 -29
  1352. package/dist/index.d.ts +0 -1
  1353. package/dist/lock/index.d.ts +0 -1
  1354. package/dist/lock/lib/use-lock.d.ts +0 -8
  1355. package/dist/logger/index.d.ts +0 -14
  1356. package/dist/logger/logs-stream.d.ts +0 -10
  1357. package/dist/logger/redact-query.d.ts +0 -1
  1358. package/dist/mailer.d.ts +0 -2
  1359. package/dist/metrics/index.d.ts +0 -1
  1360. package/dist/metrics/lib/create-metrics.d.ts +0 -15
  1361. package/dist/metrics/lib/use-metrics.d.ts +0 -17
  1362. package/dist/metrics/types/metric.d.ts +0 -1
  1363. package/dist/middleware/authenticate.d.ts +0 -7
  1364. package/dist/middleware/cache.d.ts +0 -3
  1365. package/dist/middleware/collection-exists.d.ts +0 -6
  1366. package/dist/middleware/cors.d.ts +0 -3
  1367. package/dist/middleware/error-handler.d.ts +0 -2
  1368. package/dist/middleware/extract-token.d.ts +0 -12
  1369. package/dist/middleware/graphql.d.ts +0 -2
  1370. package/dist/middleware/rate-limiter-global.d.ts +0 -5
  1371. package/dist/middleware/rate-limiter-ip.d.ts +0 -5
  1372. package/dist/middleware/rate-limiter-registration.d.ts +0 -5
  1373. package/dist/middleware/respond.d.ts +0 -2
  1374. package/dist/middleware/sanitize-query.d.ts +0 -7
  1375. package/dist/middleware/schema.d.ts +0 -3
  1376. package/dist/middleware/use-collection.d.ts +0 -7
  1377. package/dist/middleware/validate-batch.d.ts +0 -1
  1378. package/dist/operations/condition/index.d.ts +0 -6
  1379. package/dist/operations/exec/index.d.ts +0 -5
  1380. package/dist/operations/item-create/index.d.ts +0 -8
  1381. package/dist/operations/item-delete/index.d.ts +0 -10
  1382. package/dist/operations/item-read/index.d.ts +0 -10
  1383. package/dist/operations/item-update/index.d.ts +0 -11
  1384. package/dist/operations/json-web-token/index.d.ts +0 -10
  1385. package/dist/operations/log/index.d.ts +0 -5
  1386. package/dist/operations/mail/index.d.ts +0 -13
  1387. package/dist/operations/mail/rate-limiter.d.ts +0 -1
  1388. package/dist/operations/notification/index.d.ts +0 -10
  1389. package/dist/operations/request/index.d.ts +0 -11
  1390. package/dist/operations/sleep/index.d.ts +0 -5
  1391. package/dist/operations/throw-error/index.d.ts +0 -7
  1392. package/dist/operations/transform/index.d.ts +0 -5
  1393. package/dist/operations/trigger/index.d.ts +0 -8
  1394. package/dist/permissions/cache.d.ts +0 -2
  1395. package/dist/permissions/lib/fetch-permissions.d.ts +0 -20
  1396. package/dist/permissions/lib/fetch-policies.d.ts +0 -14
  1397. package/dist/permissions/lib/fetch-roles-tree.d.ts +0 -6
  1398. package/dist/permissions/lib/with-app-minimal-permissions.d.ts +0 -2
  1399. package/dist/permissions/modules/fetch-accountability-collection-access/fetch-accountability-collection-access.d.ts +0 -7
  1400. package/dist/permissions/modules/fetch-accountability-policy-globals/fetch-accountability-policy-globals.d.ts +0 -3
  1401. package/dist/permissions/modules/fetch-allowed-collections/fetch-allowed-collections.d.ts +0 -7
  1402. package/dist/permissions/modules/fetch-allowed-field-map/fetch-allowed-field-map.d.ts +0 -8
  1403. package/dist/permissions/modules/fetch-allowed-fields/fetch-allowed-fields.d.ts +0 -15
  1404. package/dist/permissions/modules/fetch-global-access/fetch-global-access.d.ts +0 -12
  1405. package/dist/permissions/modules/fetch-inconsistent-field-map/fetch-inconsistent-field-map.d.ts +0 -11
  1406. package/dist/permissions/modules/fetch-policies-ip-access/fetch-policies-ip-access.d.ts +0 -4
  1407. package/dist/permissions/modules/process-ast/lib/extract-fields-from-children.d.ts +0 -4
  1408. package/dist/permissions/modules/process-ast/lib/extract-fields-from-query.d.ts +0 -3
  1409. package/dist/permissions/modules/process-ast/lib/field-map-from-ast.d.ts +0 -4
  1410. package/dist/permissions/modules/process-ast/lib/get-cases.d.ts +0 -6
  1411. package/dist/permissions/modules/process-ast/lib/inject-cases.d.ts +0 -9
  1412. package/dist/permissions/modules/process-ast/process-ast.d.ts +0 -9
  1413. package/dist/permissions/modules/process-ast/types.d.ts +0 -18
  1414. package/dist/permissions/modules/process-ast/utils/collections-in-field-map.d.ts +0 -2
  1415. package/dist/permissions/modules/process-ast/utils/context-has-dynamic-variables.d.ts +0 -2
  1416. package/dist/permissions/modules/process-ast/utils/dedupe-access.d.ts +0 -12
  1417. package/dist/permissions/modules/process-ast/utils/extract-paths-from-query.d.ts +0 -15
  1418. package/dist/permissions/modules/process-ast/utils/find-related-collection.d.ts +0 -3
  1419. package/dist/permissions/modules/process-ast/utils/flatten-filter.d.ts +0 -3
  1420. package/dist/permissions/modules/process-ast/utils/format-a2o-key.d.ts +0 -1
  1421. package/dist/permissions/modules/process-ast/utils/get-info-for-path.d.ts +0 -5
  1422. package/dist/permissions/modules/process-ast/utils/has-item-permissions.d.ts +0 -2
  1423. package/dist/permissions/modules/process-ast/utils/stringify-query-path.d.ts +0 -2
  1424. package/dist/permissions/modules/process-ast/utils/validate-path/create-error.d.ts +0 -3
  1425. package/dist/permissions/modules/process-ast/utils/validate-path/validate-path-existence.d.ts +0 -2
  1426. package/dist/permissions/modules/process-ast/utils/validate-path/validate-path-permissions.d.ts +0 -2
  1427. package/dist/permissions/modules/process-payload/lib/is-field-nullable.d.ts +0 -5
  1428. package/dist/permissions/modules/process-payload/process-payload.d.ts +0 -14
  1429. package/dist/permissions/modules/validate-access/lib/validate-collection-access.d.ts +0 -12
  1430. package/dist/permissions/modules/validate-access/lib/validate-item-access.d.ts +0 -22
  1431. package/dist/permissions/modules/validate-access/validate-access.d.ts +0 -16
  1432. package/dist/permissions/modules/validate-remaining-admin/validate-remaining-admin-count.d.ts +0 -1
  1433. package/dist/permissions/modules/validate-remaining-admin/validate-remaining-admin-users.d.ts +0 -4
  1434. package/dist/permissions/types.d.ts +0 -7
  1435. package/dist/permissions/utils/create-default-accountability.d.ts +0 -2
  1436. package/dist/permissions/utils/default-permission.d.ts +0 -7
  1437. package/dist/permissions/utils/extract-required-dynamic-variable-context.d.ts +0 -9
  1438. package/dist/permissions/utils/fetch-dynamic-variable-data.d.ts +0 -9
  1439. package/dist/permissions/utils/fetch-raw-permissions.d.ts +0 -11
  1440. package/dist/permissions/utils/fetch-share-info.d.ts +0 -12
  1441. package/dist/permissions/utils/filter-policies-by-ip.d.ts +0 -2
  1442. package/dist/permissions/utils/get-permissions-for-share.d.ts +0 -4
  1443. package/dist/permissions/utils/get-unaliased-field-key.d.ts +0 -5
  1444. package/dist/permissions/utils/merge-fields.d.ts +0 -1
  1445. package/dist/permissions/utils/merge-permissions.d.ts +0 -9
  1446. package/dist/permissions/utils/process-permissions.d.ts +0 -17
  1447. package/dist/permissions/utils/with-cache.d.ts +0 -12
  1448. package/dist/rate-limiter.d.ts +0 -5
  1449. package/dist/redis/index.d.ts +0 -3
  1450. package/dist/redis/lib/create-redis.d.ts +0 -7
  1451. package/dist/redis/lib/use-redis.d.ts +0 -16
  1452. package/dist/redis/utils/redis-config-available.d.ts +0 -4
  1453. package/dist/request/agent-with-ip-validation.d.ts +0 -10
  1454. package/dist/request/index.d.ts +0 -5
  1455. package/dist/request/is-denied-ip.d.ts +0 -1
  1456. package/dist/schedules/metrics.d.ts +0 -7
  1457. package/dist/schedules/project.d.ts +0 -4
  1458. package/dist/schedules/retention.d.ts +0 -14
  1459. package/dist/schedules/telemetry.d.ts +0 -11
  1460. package/dist/schedules/tus.d.ts +0 -6
  1461. package/dist/server.d.ts +0 -4
  1462. package/dist/services/access.d.ts +0 -9
  1463. package/dist/services/activity.d.ts +0 -5
  1464. package/dist/services/assets/name-deduper.d.ts +0 -7
  1465. package/dist/services/assets.d.ts +0 -35
  1466. package/dist/services/authentication.d.ts +0 -26
  1467. package/dist/services/collections.d.ts +0 -57
  1468. package/dist/services/comments.d.ts +0 -12
  1469. package/dist/services/dashboards.d.ts +0 -5
  1470. package/dist/services/deployment-projects.d.ts +0 -49
  1471. package/dist/services/deployment-runs.d.ts +0 -31
  1472. package/dist/services/deployment.d.ts +0 -81
  1473. package/dist/services/extensions.d.ts +0 -34
  1474. package/dist/services/fields/build-collection-and-field-relations.d.ts +0 -21
  1475. package/dist/services/fields/get-collection-meta-updates.d.ts +0 -11
  1476. package/dist/services/fields/get-collection-relation-list.d.ts +0 -5
  1477. package/dist/services/fields.d.ts +0 -49
  1478. package/dist/services/files/lib/extract-metadata.d.ts +0 -3
  1479. package/dist/services/files/lib/get-sharp-instance.d.ts +0 -2
  1480. package/dist/services/files/utils/get-metadata.d.ts +0 -4
  1481. package/dist/services/files/utils/parse-image-metadata.d.ts +0 -2
  1482. package/dist/services/files.d.ts +0 -31
  1483. package/dist/services/flows.d.ts +0 -8
  1484. package/dist/services/folders.d.ts +0 -30
  1485. package/dist/services/graphql/errors/execution.d.ts +0 -6
  1486. package/dist/services/graphql/errors/format.d.ts +0 -6
  1487. package/dist/services/graphql/errors/index.d.ts +0 -2
  1488. package/dist/services/graphql/errors/validation.d.ts +0 -6
  1489. package/dist/services/graphql/index.d.ts +0 -30
  1490. package/dist/services/graphql/resolvers/get-collection-type.d.ts +0 -3
  1491. package/dist/services/graphql/resolvers/get-field-type.d.ts +0 -3
  1492. package/dist/services/graphql/resolvers/get-relation-type.d.ts +0 -3
  1493. package/dist/services/graphql/resolvers/mutation.d.ts +0 -4
  1494. package/dist/services/graphql/resolvers/query.d.ts +0 -8
  1495. package/dist/services/graphql/resolvers/system-admin.d.ts +0 -5
  1496. package/dist/services/graphql/resolvers/system-global.d.ts +0 -7
  1497. package/dist/services/graphql/resolvers/system.d.ts +0 -5
  1498. package/dist/services/graphql/schema/get-types.d.ts +0 -12
  1499. package/dist/services/graphql/schema/index.d.ts +0 -32
  1500. package/dist/services/graphql/schema/parse-args.d.ts +0 -9
  1501. package/dist/services/graphql/schema/parse-query.d.ts +0 -7
  1502. package/dist/services/graphql/schema/read.d.ts +0 -12
  1503. package/dist/services/graphql/schema/write.d.ts +0 -9
  1504. package/dist/services/graphql/schema-cache.d.ts +0 -3
  1505. package/dist/services/graphql/subscription.d.ts +0 -22
  1506. package/dist/services/graphql/types/bigint.d.ts +0 -2
  1507. package/dist/services/graphql/types/date.d.ts +0 -2
  1508. package/dist/services/graphql/types/geojson.d.ts +0 -2
  1509. package/dist/services/graphql/types/hash.d.ts +0 -2
  1510. package/dist/services/graphql/types/string-or-float.d.ts +0 -5
  1511. package/dist/services/graphql/types/void.d.ts +0 -2
  1512. package/dist/services/graphql/utils/add-path-to-validation-error.d.ts +0 -2
  1513. package/dist/services/graphql/utils/aggregate-query.d.ts +0 -6
  1514. package/dist/services/graphql/utils/filter-replace-m2a.d.ts +0 -7
  1515. package/dist/services/graphql/utils/process-error.d.ts +0 -7
  1516. package/dist/services/graphql/utils/replace-fragments.d.ts +0 -6
  1517. package/dist/services/graphql/utils/replace-funcs.d.ts +0 -5
  1518. package/dist/services/graphql/utils/sanitize-gql-schema.d.ts +0 -8
  1519. package/dist/services/import-export.d.ts +0 -44
  1520. package/dist/services/index.d.ts +0 -41
  1521. package/dist/services/items.d.ts +0 -105
  1522. package/dist/services/mail/index.d.ts +0 -32
  1523. package/dist/services/mail/rate-limiter.d.ts +0 -1
  1524. package/dist/services/meta.d.ts +0 -11
  1525. package/dist/services/notifications.d.ts +0 -7
  1526. package/dist/services/operations.d.ts +0 -8
  1527. package/dist/services/panels.d.ts +0 -5
  1528. package/dist/services/payload.d.ts +0 -77
  1529. package/dist/services/permissions.d.ts +0 -14
  1530. package/dist/services/policies.d.ts +0 -11
  1531. package/dist/services/presets.d.ts +0 -5
  1532. package/dist/services/relations.d.ts +0 -55
  1533. package/dist/services/revisions.d.ts +0 -11
  1534. package/dist/services/roles.d.ts +0 -9
  1535. package/dist/services/schema.d.ts +0 -14
  1536. package/dist/services/server.d.ts +0 -13
  1537. package/dist/services/settings.d.ts +0 -6
  1538. package/dist/services/shares.d.ts +0 -19
  1539. package/dist/services/specifications.d.ts +0 -39
  1540. package/dist/services/tfa.d.ts +0 -12
  1541. package/dist/services/translations.d.ts +0 -8
  1542. package/dist/services/tus/data-store.d.ts +0 -33
  1543. package/dist/services/tus/index.d.ts +0 -2
  1544. package/dist/services/tus/lockers.d.ts +0 -36
  1545. package/dist/services/tus/server.d.ts +0 -8
  1546. package/dist/services/tus/utils/wait-timeout.d.ts +0 -1
  1547. package/dist/services/users.d.ts +0 -54
  1548. package/dist/services/utils.d.ts +0 -15
  1549. package/dist/services/versions.d.ts +0 -19
  1550. package/dist/services/websocket.d.ts +0 -12
  1551. package/dist/start.d.ts +0 -1
  1552. package/dist/storage/get-storage-driver.d.ts +0 -3
  1553. package/dist/storage/index.d.ts +0 -5
  1554. package/dist/storage/register-drivers.d.ts +0 -2
  1555. package/dist/storage/register-locations.d.ts +0 -2
  1556. package/dist/synchronization.d.ts +0 -7
  1557. package/dist/telemetry/index.d.ts +0 -3
  1558. package/dist/telemetry/lib/get-report.d.ts +0 -5
  1559. package/dist/telemetry/lib/send-report.d.ts +0 -10
  1560. package/dist/telemetry/lib/track.d.ts +0 -10
  1561. package/dist/telemetry/types/report.d.ts +0 -102
  1562. package/dist/telemetry/utils/check-user-limits.d.ts +0 -5
  1563. package/dist/telemetry/utils/get-extension-count.d.ts +0 -9
  1564. package/dist/telemetry/utils/get-field-count.d.ts +0 -6
  1565. package/dist/telemetry/utils/get-filesize-sum.d.ts +0 -5
  1566. package/dist/telemetry/utils/get-item-count.d.ts +0 -30
  1567. package/dist/telemetry/utils/get-random-wait-time.d.ts +0 -5
  1568. package/dist/telemetry/utils/get-settings.d.ts +0 -26
  1569. package/dist/telemetry/utils/get-user-item-count.d.ts +0 -13
  1570. package/dist/telemetry/utils/should-check-user-limits.d.ts +0 -4
  1571. package/dist/test-utils/cache.d.ts +0 -51
  1572. package/dist/test-utils/controllers.d.ts +0 -65
  1573. package/dist/test-utils/database.d.ts +0 -48
  1574. package/dist/test-utils/emitter.d.ts +0 -35
  1575. package/dist/test-utils/knex.d.ts +0 -164
  1576. package/dist/test-utils/schema.d.ts +0 -26
  1577. package/dist/test-utils/services/fields-service.d.ts +0 -28
  1578. package/dist/test-utils/services/files-service.d.ts +0 -28
  1579. package/dist/test-utils/services/folders-service.d.ts +0 -28
  1580. package/dist/test-utils/services/items-service.d.ts +0 -23
  1581. package/dist/types/ast.d.ts +0 -100
  1582. package/dist/types/auth.d.ts +0 -42
  1583. package/dist/types/collection.d.ts +0 -9
  1584. package/dist/types/events.d.ts +0 -18
  1585. package/dist/types/index.d.ts +0 -7
  1586. package/dist/types/meta.d.ts +0 -4
  1587. package/dist/types/migration.d.ts +0 -5
  1588. package/dist/types/revision.d.ts +0 -7
  1589. package/dist/types/rolemap.d.ts +0 -3
  1590. package/dist/utils/apply-diff.d.ts +0 -8
  1591. package/dist/utils/apply-snapshot.d.ts +0 -8
  1592. package/dist/utils/async-handler.d.ts +0 -3
  1593. package/dist/utils/calculate-field-depth.d.ts +0 -33
  1594. package/dist/utils/compress.d.ts +0 -2
  1595. package/dist/utils/construct-flow-tree.d.ts +0 -2
  1596. package/dist/utils/create-admin.d.ts +0 -11
  1597. package/dist/utils/deep-map-response.d.ts +0 -17
  1598. package/dist/utils/delete-from-require-cache.d.ts +0 -1
  1599. package/dist/utils/encrypt.d.ts +0 -2
  1600. package/dist/utils/fetch-user-count/fetch-access-lookup.d.ts +0 -19
  1601. package/dist/utils/fetch-user-count/fetch-access-roles.d.ts +0 -16
  1602. package/dist/utils/fetch-user-count/fetch-active-users.d.ts +0 -6
  1603. package/dist/utils/fetch-user-count/fetch-user-count.d.ts +0 -11
  1604. package/dist/utils/fetch-user-count/get-user-count-query.d.ts +0 -20
  1605. package/dist/utils/filter-items.d.ts +0 -2
  1606. package/dist/utils/freeze-schema.d.ts +0 -3
  1607. package/dist/utils/generate-hash.d.ts +0 -1
  1608. package/dist/utils/get-accountability-for-role.d.ts +0 -7
  1609. package/dist/utils/get-accountability-for-token.d.ts +0 -2
  1610. package/dist/utils/get-address.d.ts +0 -2
  1611. package/dist/utils/get-allowed-log-levels.d.ts +0 -3
  1612. package/dist/utils/get-auth-providers.d.ts +0 -10
  1613. package/dist/utils/get-cache-headers.d.ts +0 -10
  1614. package/dist/utils/get-cache-key.d.ts +0 -2
  1615. package/dist/utils/get-collection-from-alias.d.ts +0 -6
  1616. package/dist/utils/get-column-path.d.ts +0 -26
  1617. package/dist/utils/get-config-from-env.d.ts +0 -6
  1618. package/dist/utils/get-default-index-name.d.ts +0 -13
  1619. package/dist/utils/get-default-value.d.ts +0 -5
  1620. package/dist/utils/get-field-relational-depth.d.ts +0 -13
  1621. package/dist/utils/get-field-system-rows.d.ts +0 -2
  1622. package/dist/utils/get-graphql-query-and-variables.d.ts +0 -2
  1623. package/dist/utils/get-graphql-type.d.ts +0 -4
  1624. package/dist/utils/get-ip-from-req.d.ts +0 -3
  1625. package/dist/utils/get-local-type.d.ts +0 -9
  1626. package/dist/utils/get-milliseconds.d.ts +0 -4
  1627. package/dist/utils/get-module-default.d.ts +0 -3
  1628. package/dist/utils/get-schema.d.ts +0 -10
  1629. package/dist/utils/get-secret.d.ts +0 -4
  1630. package/dist/utils/get-service.d.ts +0 -7
  1631. package/dist/utils/get-snapshot-diff.d.ts +0 -2
  1632. package/dist/utils/get-snapshot.d.ts +0 -6
  1633. package/dist/utils/get-string-byte-size.d.ts +0 -4
  1634. package/dist/utils/get-versioned-hash.d.ts +0 -1
  1635. package/dist/utils/import-file-url.d.ts +0 -5
  1636. package/dist/utils/is-directus-jwt.d.ts +0 -5
  1637. package/dist/utils/is-field-allowed.d.ts +0 -4
  1638. package/dist/utils/is-url-allowed.d.ts +0 -4
  1639. package/dist/utils/is-valid-uuid.d.ts +0 -3
  1640. package/dist/utils/job-queue.d.ts +0 -9
  1641. package/dist/utils/jwt.d.ts +0 -3
  1642. package/dist/utils/md.d.ts +0 -4
  1643. package/dist/utils/parse-filter-key.d.ts +0 -7
  1644. package/dist/utils/parse-numeric-string.d.ts +0 -2
  1645. package/dist/utils/parse-value.d.ts +0 -4
  1646. package/dist/utils/permissions-cacheable.d.ts +0 -8
  1647. package/dist/utils/redact-object.d.ts +0 -23
  1648. package/dist/utils/reduce-schema.d.ts +0 -7
  1649. package/dist/utils/require-text.d.ts +0 -1
  1650. package/dist/utils/require-yaml.d.ts +0 -1
  1651. package/dist/utils/sanitize-query.d.ts +0 -5
  1652. package/dist/utils/sanitize-schema.d.ts +0 -33
  1653. package/dist/utils/schedule.d.ts +0 -5
  1654. package/dist/utils/should-clear-cache.d.ts +0 -10
  1655. package/dist/utils/should-skip-cache.d.ts +0 -7
  1656. package/dist/utils/split-fields.d.ts +0 -4
  1657. package/dist/utils/stall.d.ts +0 -26
  1658. package/dist/utils/transaction.d.ts +0 -9
  1659. package/dist/utils/transformations.d.ts +0 -6
  1660. package/dist/utils/url.d.ts +0 -18
  1661. package/dist/utils/user-name.d.ts +0 -2
  1662. package/dist/utils/validate-diff.d.ts +0 -7
  1663. package/dist/utils/validate-env.d.ts +0 -1
  1664. package/dist/utils/validate-keys.d.ts +0 -5
  1665. package/dist/utils/validate-query.d.ts +0 -4
  1666. package/dist/utils/validate-snapshot.d.ts +0 -5
  1667. package/dist/utils/validate-storage.d.ts +0 -1
  1668. package/dist/utils/validate-user-count-integrity.d.ts +0 -6
  1669. package/dist/utils/verify-session-jwt.d.ts +0 -7
  1670. package/dist/utils/versioning/handle-version.d.ts +0 -3
  1671. package/dist/utils/versioning/merge-version-data.d.ts +0 -2
  1672. package/dist/utils/versioning/split-recursive.d.ts +0 -4
  1673. package/dist/websocket/authenticate.d.ts +0 -5
  1674. package/dist/websocket/collab/calculate-cache-metadata.d.ts +0 -9
  1675. package/dist/websocket/collab/collab.d.ts +0 -63
  1676. package/dist/websocket/collab/constants.d.ts +0 -1
  1677. package/dist/websocket/collab/filter-to-fields.d.ts +0 -2
  1678. package/dist/websocket/collab/messenger.d.ts +0 -43
  1679. package/dist/websocket/collab/payload-permissions.d.ts +0 -18
  1680. package/dist/websocket/collab/permissions-cache.d.ts +0 -52
  1681. package/dist/websocket/collab/room.d.ts +0 -125
  1682. package/dist/websocket/collab/store.d.ts +0 -7
  1683. package/dist/websocket/collab/types.d.ts +0 -21
  1684. package/dist/websocket/collab/verify-permissions.d.ts +0 -11
  1685. package/dist/websocket/controllers/base.d.ts +0 -35
  1686. package/dist/websocket/controllers/graphql.d.ts +0 -11
  1687. package/dist/websocket/controllers/hooks.d.ts +0 -1
  1688. package/dist/websocket/controllers/index.d.ts +0 -13
  1689. package/dist/websocket/controllers/logs.d.ts +0 -17
  1690. package/dist/websocket/controllers/rest.d.ts +0 -8
  1691. package/dist/websocket/errors.d.ts +0 -16
  1692. package/dist/websocket/handlers/heartbeat.d.ts +0 -11
  1693. package/dist/websocket/handlers/index.d.ts +0 -7
  1694. package/dist/websocket/handlers/items.d.ts +0 -6
  1695. package/dist/websocket/handlers/logs.d.ts +0 -31
  1696. package/dist/websocket/handlers/subscribe.d.ts +0 -38
  1697. package/dist/websocket/messages.d.ts +0 -114
  1698. package/dist/websocket/types.d.ts +0 -38
  1699. package/dist/websocket/utils/get-expires-at-for-token.d.ts +0 -1
  1700. package/dist/websocket/utils/items.d.ts +0 -43
  1701. package/dist/websocket/utils/message.d.ts +0 -4
  1702. package/dist/websocket/utils/wait-for-message.d.ts +0 -4
@@ -1,641 +1,679 @@
1
- import { createReadStream, createWriteStream } from 'node:fs';
2
- import { appendFile } from 'node:fs/promises';
3
- import { useEnv } from '@directus/env';
4
- import { createError, ErrorCode, ForbiddenError, InvalidPayloadError, ServiceUnavailableError, UnsupportedMediaTypeError, } from '@directus/errors';
5
- import { isSystemCollection } from '@directus/system-data';
6
- import { getDateTimeFormatted, parseJSON, toArray } from '@directus/utils';
7
- import { createTmpFile } from '@directus/utils/node';
8
- import { queue } from 'async';
9
- import destroyStream from 'destroy';
10
- import { dump as toYAML } from 'js-yaml';
11
- import { parse as toXML } from 'js2xmlparser';
12
- import { Parser as CSVParser, transforms as CSVTransforms } from 'json2csv';
13
- import { set } from 'lodash-es';
14
- import Papa from 'papaparse';
15
- import StreamArray from 'stream-json/streamers/StreamArray.js';
16
- import { parseFields } from '../database/get-ast-from-query/lib/parse-fields.js';
17
- import getDatabase from '../database/index.js';
18
- import emitter from '../emitter.js';
19
- import { useLogger } from '../logger/index.js';
20
- import { validateAccess } from '../permissions/modules/validate-access/validate-access.js';
21
- import { getService } from '../utils/get-service.js';
22
- import { transaction } from '../utils/transaction.js';
23
- import { Url } from '../utils/url.js';
24
- import { userName } from '../utils/user-name.js';
25
- import { FilesService } from './files.js';
26
- import { NotificationsService } from './notifications.js';
27
- import { UsersService } from './users.js';
1
+ import { useLogger } from "../logger/index.js";
2
+ import database_default from "../database/index.js";
3
+ import emitter_default from "../emitter.js";
4
+ import { validateAccess } from "../permissions/modules/validate-access/validate-access.js";
5
+ import { transaction } from "../utils/transaction.js";
6
+ import { parseFields } from "../database/get-ast-from-query/lib/parse-fields.js";
7
+ import { FilesService } from "./files.js";
8
+ import { destroyPipedStream } from "../utils/destroy-piped-stream.js";
9
+ import { getService } from "../utils/get-service.js";
10
+ import { useStore } from "../utils/store.js";
11
+ import { Url } from "../utils/url.js";
12
+ import { userName } from "../utils/user-name.js";
13
+ import { UsersService } from "./users.js";
14
+ import { NotificationsService } from "./notifications.js";
15
+ import { appendFile } from "node:fs/promises";
16
+ import { useEnv } from "@directus/env";
17
+ import { ErrorCode, ForbiddenError, InvalidPayloadError, LimitExceededError, ServiceUnavailableError, TimeoutError, UnsupportedMediaTypeError, createError } from "@directus/errors";
18
+ import { getDateTimeFormatted, parseJSON, toArray } from "@directus/utils";
19
+ import { set } from "lodash-es";
20
+ import { createTmpFile } from "@directus/utils/node";
21
+ import ms from "ms";
22
+ import { isSystemCollection } from "@directus/system-data";
23
+ import { createReadStream, createWriteStream } from "node:fs";
24
+ import { queue } from "async";
25
+ import { dump } from "js-yaml";
26
+ import { parse } from "js2xmlparser";
27
+ import { Parser, transforms } from "json2csv";
28
+ import Papa from "papaparse";
29
+ import StreamArray from "stream-json/streamers/StreamArray.js";
30
+
31
+ //#region src/services/import-export.ts
28
32
  const env = useEnv();
29
33
  const logger = useLogger();
30
- const MAX_IMPORT_ERRORS = env['MAX_IMPORT_ERRORS'];
31
- export function createErrorTracker() {
32
- let genericError;
33
- // For errors with field / type (joi validation or DB with field)
34
- const fieldErrors = new Map();
35
- let capturedErrorCount = 0;
36
- let isLimitReached = false;
37
- function convertToRanges(rows, minRangeSize = 4) {
38
- const sorted = Array.from(new Set(rows)).sort((a, b) => a - b);
39
- const result = [];
40
- if (sorted.length === 0)
41
- return [];
42
- let start = sorted[0];
43
- let prev = sorted[0];
44
- let count = 1;
45
- const nonConsecutive = [];
46
- const flush = () => {
47
- if (count >= minRangeSize) {
48
- result.push({ type: 'range', start, end: prev });
49
- }
50
- else {
51
- for (let i = start; i <= prev; i++) {
52
- nonConsecutive.push(i);
53
- }
54
- }
55
- };
56
- for (let i = 1; i < sorted.length; i++) {
57
- const current = sorted[i];
58
- if (current === prev + 1) {
59
- prev = current;
60
- count++;
61
- }
62
- else {
63
- flush();
64
- start = prev = current;
65
- count = 1;
66
- }
67
- }
68
- flush();
69
- // Add non-consecutive rows as a single "lines" entry
70
- if (nonConsecutive.length > 0) {
71
- result.push({ type: 'lines', rows: nonConsecutive });
72
- }
73
- return result;
74
- }
75
- function addCapturedError(err, rowNumber) {
76
- const field = err.extensions?.field;
77
- if (field) {
78
- const type = err.extensions?.type;
79
- const substring = err.extensions?.substring;
80
- const valid = err.extensions?.valid;
81
- const invalid = err.extensions?.invalid;
82
- let key = type ? `${field}|${type}` : field;
83
- if (substring !== undefined)
84
- key += `|substring:${substring}`;
85
- if (valid !== undefined)
86
- key += `|valid:${JSON.stringify(valid)}`;
87
- if (invalid !== undefined)
88
- key += `|invalid:${JSON.stringify(invalid)}`;
89
- if (!fieldErrors.has(err.code)) {
90
- fieldErrors.set(err.code, new Map());
91
- }
92
- const errorsByCode = fieldErrors.get(err.code);
93
- if (!errorsByCode.has(key)) {
94
- errorsByCode.set(key, {
95
- message: err.message,
96
- rowNumbers: [],
97
- });
98
- }
99
- errorsByCode.get(key).rowNumbers.push(rowNumber);
100
- }
101
- else {
102
- genericError = err;
103
- }
104
- capturedErrorCount++;
105
- if (capturedErrorCount >= MAX_IMPORT_ERRORS) {
106
- isLimitReached = true;
107
- }
108
- }
109
- function hasGenericError() {
110
- return genericError !== undefined;
111
- }
112
- function buildFinalErrors() {
113
- if (genericError) {
114
- return [genericError];
115
- }
116
- return Array.from(fieldErrors.entries()).flatMap(([code, fieldMap]) => Array.from(fieldMap.entries()).map(([compositeKey, errorData]) => {
117
- const parts = compositeKey.split('|');
118
- const field = parts[0];
119
- const type = parts[1];
120
- const extensions = {};
121
- for (let i = 2; i < parts.length; i++) {
122
- const [paramType, paramValue] = parts[i]?.split(':', 2) ?? [];
123
- if (!paramType || paramValue === undefined)
124
- continue;
125
- try {
126
- extensions[paramType] = JSON.parse(paramValue);
127
- }
128
- catch {
129
- extensions[paramType] = paramValue;
130
- }
131
- }
132
- const ErrorClass = createError(code, errorData.message, 400);
133
- return new ErrorClass({
134
- field,
135
- type,
136
- ...extensions,
137
- rows: convertToRanges(errorData.rowNumbers),
138
- });
139
- }));
140
- }
141
- return {
142
- addCapturedError,
143
- buildFinalErrors,
144
- getCount: () => capturedErrorCount,
145
- hasErrors: () => capturedErrorCount > 0 || hasGenericError(),
146
- shouldStop: () => isLimitReached || hasGenericError(),
147
- hasGenericError,
148
- };
149
- }
150
- export class ImportService {
151
- knex;
152
- accountability;
153
- schema;
154
- constructor(options) {
155
- this.knex = options.knex || getDatabase();
156
- this.accountability = options.accountability || null;
157
- this.schema = options.schema;
158
- }
159
- async import(collection, mimetype, stream) {
160
- if (this.accountability?.admin !== true && isSystemCollection(collection))
161
- throw new ForbiddenError();
162
- if (this.accountability) {
163
- await validateAccess({
164
- accountability: this.accountability,
165
- action: 'create',
166
- collection,
167
- }, {
168
- schema: this.schema,
169
- knex: this.knex,
170
- });
171
- await validateAccess({
172
- accountability: this.accountability,
173
- action: 'update',
174
- collection,
175
- }, {
176
- schema: this.schema,
177
- knex: this.knex,
178
- });
179
- }
180
- switch (mimetype) {
181
- case 'application/json':
182
- return await this.importJSON(collection, stream);
183
- case 'text/csv':
184
- case 'application/vnd.ms-excel':
185
- return await this.importCSV(collection, stream);
186
- default:
187
- throw new UnsupportedMediaTypeError({ mediaType: mimetype, where: 'file import' });
188
- }
189
- }
190
- async importJSON(collection, stream) {
191
- const extractJSON = StreamArray.withParser();
192
- const nestedActionEvents = [];
193
- const errorTracker = createErrorTracker();
194
- const isSingleton = this.schema.collections[collection]?.singleton ?? false;
195
- return transaction(this.knex, async (trx) => {
196
- const service = getService(collection, {
197
- knex: trx,
198
- schema: this.schema,
199
- accountability: this.accountability,
200
- });
201
- try {
202
- await new Promise((resolve, reject) => {
203
- let rowNumber = 1;
204
- const saveQueue = queue(async (task) => {
205
- if (errorTracker.shouldStop())
206
- return;
207
- try {
208
- if (isSingleton) {
209
- return await service.upsertSingleton(task.data, {
210
- bypassEmitAction: (params) => nestedActionEvents.push(params),
211
- });
212
- }
213
- else {
214
- return await service.upsertOne(task.data, {
215
- bypassEmitAction: (params) => nestedActionEvents.push(params),
216
- });
217
- }
218
- }
219
- catch (error) {
220
- for (const err of toArray(error)) {
221
- errorTracker.addCapturedError(err, task.rowNumber);
222
- if (errorTracker.shouldStop()) {
223
- break;
224
- }
225
- }
226
- if (errorTracker.shouldStop()) {
227
- saveQueue.kill();
228
- destroyStream(stream);
229
- destroyStream(extractJSON);
230
- reject();
231
- }
232
- return;
233
- }
234
- });
235
- stream.pipe(extractJSON);
236
- extractJSON.on('data', ({ value }) => {
237
- if (isSingleton && rowNumber > 1) {
238
- saveQueue.kill();
239
- destroyStream(stream);
240
- destroyStream(extractJSON);
241
- reject(new InvalidPayloadError({
242
- reason: `Cannot import multiple records into singleton collection ${collection}`,
243
- }));
244
- return;
245
- }
246
- saveQueue.push({ data: value, rowNumber: rowNumber++ });
247
- });
248
- extractJSON.on('error', (err) => {
249
- destroyStream(stream);
250
- destroyStream(extractJSON);
251
- reject(new InvalidPayloadError({ reason: err.message }));
252
- });
253
- extractJSON.on('end', () => {
254
- // In case of empty JSON file
255
- if (!saveQueue.started)
256
- return resolve();
257
- saveQueue.drain(() => {
258
- if (errorTracker.hasErrors()) {
259
- return reject();
260
- }
261
- for (const nestedActionEvent of nestedActionEvents) {
262
- emitter.emitAction(nestedActionEvent.event, nestedActionEvent.meta, nestedActionEvent.context);
263
- }
264
- return resolve();
265
- });
266
- });
267
- });
268
- }
269
- catch (error) {
270
- if (!error && errorTracker.hasErrors()) {
271
- throw errorTracker.buildFinalErrors();
272
- }
273
- throw error;
274
- }
275
- });
276
- }
277
- async importCSV(collection, stream) {
278
- const tmpFile = await createTmpFile().catch(() => null);
279
- if (!tmpFile)
280
- throw new Error('Failed to create temporary file for import');
281
- const nestedActionEvents = [];
282
- const errorTracker = createErrorTracker();
283
- const isSingleton = this.schema.collections[collection]?.singleton ?? false;
284
- return transaction(this.knex, async (trx) => {
285
- const service = getService(collection, {
286
- knex: trx,
287
- schema: this.schema,
288
- accountability: this.accountability,
289
- });
290
- try {
291
- await new Promise((resolve, reject) => {
292
- const streams = [stream];
293
- let rowNumber = 0;
294
- const cleanup = (destroy = true) => {
295
- if (destroy) {
296
- for (const stream of streams) {
297
- destroyStream(stream);
298
- }
299
- }
300
- tmpFile.cleanup().catch(() => {
301
- logger.warn(`Failed to cleanup temporary import file (${tmpFile.path})`);
302
- });
303
- };
304
- const saveQueue = queue(async (task) => {
305
- if (errorTracker.shouldStop())
306
- return;
307
- try {
308
- if (isSingleton) {
309
- return await service.upsertSingleton(task.data, {
310
- bypassEmitAction: (action) => nestedActionEvents.push(action),
311
- });
312
- }
313
- else {
314
- return await service.upsertOne(task.data, {
315
- bypassEmitAction: (action) => nestedActionEvents.push(action),
316
- });
317
- }
318
- }
319
- catch (error) {
320
- for (const err of toArray(error)) {
321
- errorTracker.addCapturedError(err, task.rowNumber);
322
- if (errorTracker.shouldStop()) {
323
- break;
324
- }
325
- }
326
- if (errorTracker.shouldStop()) {
327
- saveQueue.kill();
328
- cleanup(true);
329
- reject();
330
- }
331
- return;
332
- }
333
- });
334
- const fileWriteStream = createWriteStream(tmpFile.path)
335
- .on('error', (error) => {
336
- cleanup();
337
- reject(new Error('Error while writing import data to temporary file', { cause: error }));
338
- })
339
- .on('finish', () => {
340
- const fileReadStream = createReadStream(tmpFile.path).on('error', (error) => {
341
- cleanup();
342
- reject(new Error('Error while reading import data from temporary file', { cause: error }));
343
- });
344
- streams.push(fileReadStream);
345
- fileReadStream
346
- .pipe(Papa.parse(Papa.NODE_STREAM_INPUT, {
347
- header: true,
348
- transformHeader: (header) => header.trim(),
349
- transform: (value) => {
350
- if (value.length === 0)
351
- return;
352
- try {
353
- const parsedJson = parseJSON(value);
354
- if (typeof parsedJson === 'number') {
355
- return value;
356
- }
357
- return parsedJson;
358
- }
359
- catch {
360
- return value;
361
- }
362
- },
363
- }))
364
- .on('data', (obj) => {
365
- rowNumber++;
366
- if (isSingleton && rowNumber > 1) {
367
- saveQueue.kill();
368
- cleanup(true);
369
- reject(new InvalidPayloadError({
370
- reason: `Cannot import multiple records into singleton collection ${collection}`,
371
- }));
372
- return;
373
- }
374
- const result = {};
375
- for (const field in obj) {
376
- if (obj[field] !== undefined) {
377
- set(result, field, obj[field]);
378
- }
379
- }
380
- saveQueue.push({ data: result, rowNumber });
381
- })
382
- .on('error', (error) => {
383
- cleanup();
384
- reject(new InvalidPayloadError({ reason: error.message }));
385
- })
386
- .on('end', () => {
387
- // In case of empty CSV file
388
- if (!saveQueue.started) {
389
- cleanup(false);
390
- return resolve();
391
- }
392
- saveQueue.drain(() => {
393
- if (!errorTracker.shouldStop())
394
- cleanup(false);
395
- if (errorTracker.hasErrors()) {
396
- return reject();
397
- }
398
- for (const nestedActionEvent of nestedActionEvents) {
399
- emitter.emitAction(nestedActionEvent.event, nestedActionEvent.meta, nestedActionEvent.context);
400
- }
401
- return resolve();
402
- });
403
- });
404
- });
405
- streams.push(fileWriteStream);
406
- stream
407
- .on('error', (error) => {
408
- cleanup();
409
- reject(new Error('Error while retrieving import data', { cause: error }));
410
- })
411
- .pipe(fileWriteStream);
412
- });
413
- }
414
- catch (error) {
415
- if (!error && errorTracker.hasErrors()) {
416
- throw errorTracker.buildFinalErrors();
417
- }
418
- throw error;
419
- }
420
- });
421
- }
34
+ const MAX_IMPORT_ERRORS = env["MAX_IMPORT_ERRORS"];
35
+ function createErrorTracker() {
36
+ let genericError;
37
+ const fieldErrors = new Map();
38
+ let capturedErrorCount = 0;
39
+ let isLimitReached = false;
40
+ function convertToRanges(rows, minRangeSize = 4) {
41
+ const sorted = Array.from(new Set(rows)).sort((a, b) => a - b);
42
+ const result = [];
43
+ if (sorted.length === 0) return [];
44
+ let start = sorted[0];
45
+ let prev = sorted[0];
46
+ let count = 1;
47
+ const nonConsecutive = [];
48
+ const flush = () => {
49
+ if (count >= minRangeSize) {
50
+ result.push({
51
+ type: "range",
52
+ start,
53
+ end: prev
54
+ });
55
+ } else {
56
+ for (let i = start; i <= prev; i++) {
57
+ nonConsecutive.push(i);
58
+ }
59
+ }
60
+ };
61
+ for (let i = 1; i < sorted.length; i++) {
62
+ const current = sorted[i];
63
+ if (current === prev + 1) {
64
+ prev = current;
65
+ count++;
66
+ } else {
67
+ flush();
68
+ start = prev = current;
69
+ count = 1;
70
+ }
71
+ }
72
+ flush();
73
+ if (nonConsecutive.length > 0) {
74
+ result.push({
75
+ type: "lines",
76
+ rows: nonConsecutive
77
+ });
78
+ }
79
+ return result;
80
+ }
81
+ function addCapturedError(err, rowNumber) {
82
+ const field = err.extensions?.field;
83
+ if (field) {
84
+ const type = err.extensions?.type;
85
+ const substring = err.extensions?.substring;
86
+ const valid = err.extensions?.valid;
87
+ const invalid = err.extensions?.invalid;
88
+ let key = type ? `${field}|${type}` : field;
89
+ if (substring !== undefined) key += `|substring:${substring}`;
90
+ if (valid !== undefined) key += `|valid:${JSON.stringify(valid)}`;
91
+ if (invalid !== undefined) key += `|invalid:${JSON.stringify(invalid)}`;
92
+ if (!fieldErrors.has(err.code)) {
93
+ fieldErrors.set(err.code, new Map());
94
+ }
95
+ const errorsByCode = fieldErrors.get(err.code);
96
+ if (!errorsByCode.has(key)) {
97
+ errorsByCode.set(key, {
98
+ message: err.message,
99
+ rowNumbers: []
100
+ });
101
+ }
102
+ errorsByCode.get(key).rowNumbers.push(rowNumber);
103
+ } else {
104
+ genericError = err;
105
+ }
106
+ capturedErrorCount++;
107
+ if (capturedErrorCount >= MAX_IMPORT_ERRORS) {
108
+ isLimitReached = true;
109
+ }
110
+ }
111
+ function hasGenericError() {
112
+ return genericError !== undefined;
113
+ }
114
+ function buildFinalErrors() {
115
+ if (genericError) {
116
+ return [genericError];
117
+ }
118
+ return Array.from(fieldErrors.entries()).flatMap(([code, fieldMap]) => Array.from(fieldMap.entries()).map(([compositeKey, errorData]) => {
119
+ const parts = compositeKey.split("|");
120
+ const field = parts[0];
121
+ const type = parts[1];
122
+ const extensions = {};
123
+ for (let i = 2; i < parts.length; i++) {
124
+ const [paramType, paramValue] = parts[i]?.split(":", 2) ?? [];
125
+ if (!paramType || paramValue === undefined) continue;
126
+ try {
127
+ extensions[paramType] = JSON.parse(paramValue);
128
+ } catch {
129
+ extensions[paramType] = paramValue;
130
+ }
131
+ }
132
+ const ErrorClass = createError(code, errorData.message, 400);
133
+ return new ErrorClass({
134
+ field,
135
+ type,
136
+ ...extensions,
137
+ rows: convertToRanges(errorData.rowNumbers)
138
+ });
139
+ }));
140
+ }
141
+ return {
142
+ addCapturedError,
143
+ buildFinalErrors,
144
+ getCount: () => capturedErrorCount,
145
+ hasErrors: () => capturedErrorCount > 0 || hasGenericError(),
146
+ shouldStop: () => isLimitReached || hasGenericError(),
147
+ hasGenericError
148
+ };
422
149
  }
423
- export class ExportService {
424
- knex;
425
- accountability;
426
- schema;
427
- constructor(options) {
428
- this.knex = options.knex || getDatabase();
429
- this.accountability = options.accountability || null;
430
- this.schema = options.schema;
431
- }
432
- /**
433
- * Export the query results as a named file. Will query in batches, and keep appending a tmp file
434
- * until all the data is retrieved. Uploads the result as a new file using the regular
435
- * FilesService upload method.
436
- */
437
- async exportToFile(collection, query, format, options) {
438
- const { createTmpFile } = await import('@directus/utils/node');
439
- const tmpFile = await createTmpFile().catch(() => null);
440
- try {
441
- if (!tmpFile)
442
- throw new Error('Failed to create temporary file for export');
443
- const mimeTypes = {
444
- csv: 'text/csv',
445
- csv_utf8: 'text/csv; charset=utf-8',
446
- json: 'application/json',
447
- xml: 'text/xml',
448
- yaml: 'text/yaml',
449
- };
450
- const database = getDatabase();
451
- await transaction(database, async (trx) => {
452
- const service = getService(collection, {
453
- accountability: this.accountability,
454
- schema: this.schema,
455
- knex: trx,
456
- });
457
- const { primary } = this.schema.collections[collection];
458
- const sort = query.sort ?? [];
459
- if (sort.includes(primary) === false) {
460
- sort.push(primary);
461
- }
462
- const totalCount = await service
463
- .readByQuery({
464
- ...query,
465
- aggregate: {
466
- count: ['*'],
467
- },
468
- })
469
- .then((result) => Number(result?.[0]?.['count'] ?? 0));
470
- const count = query.limit && query.limit > -1 ? Math.min(totalCount, query.limit) : totalCount;
471
- const requestedLimit = query.limit ?? -1;
472
- const batchesRequired = Math.ceil(count / env['EXPORT_BATCH_SIZE']);
473
- let readCount = 0;
474
- for (let batch = 0; batch < batchesRequired; batch++) {
475
- let limit = env['EXPORT_BATCH_SIZE'];
476
- if (requestedLimit > 0 && env['EXPORT_BATCH_SIZE'] > requestedLimit - readCount) {
477
- limit = requestedLimit - readCount;
478
- }
479
- const result = await service.readByQuery({
480
- ...query,
481
- sort,
482
- limit,
483
- offset: batch * env['EXPORT_BATCH_SIZE'],
484
- });
485
- readCount += result.length;
486
- if (result.length) {
487
- let csvHeadings = null;
488
- if (format.startsWith('csv')) {
489
- if (!query.fields)
490
- query.fields = ['*'];
491
- // to ensure the all headings are included in the CSV file, all possible fields need to be determined.
492
- const parsedFields = await parseFields({
493
- parentCollection: collection,
494
- fields: query.fields,
495
- query: query,
496
- accountability: this.accountability,
497
- }, {
498
- schema: this.schema,
499
- knex: database,
500
- });
501
- csvHeadings = getHeadingsForCsvExport(parsedFields);
502
- }
503
- await appendFile(tmpFile.path, this.transform(result, format, {
504
- includeHeader: batch === 0,
505
- includeFooter: batch + 1 === batchesRequired,
506
- fields: csvHeadings,
507
- }));
508
- }
509
- }
510
- });
511
- const filesService = new FilesService({
512
- accountability: this.accountability,
513
- schema: this.schema,
514
- });
515
- const storage = toArray(env['STORAGE_LOCATIONS'])[0];
516
- const title = `export-${collection}-${getDateTimeFormatted()}`;
517
- const filename = `${title}.${format}`;
518
- const fileWithDefaults = {
519
- ...(options?.file ?? {}),
520
- title: options?.file?.title ?? title,
521
- filename_download: options?.file?.filename_download ?? filename,
522
- storage: options?.file?.storage ?? storage,
523
- type: mimeTypes[format],
524
- };
525
- const savedFile = await filesService.uploadOne(createReadStream(tmpFile.path), fileWithDefaults);
526
- if (this.accountability?.user) {
527
- const notificationsService = new NotificationsService({
528
- schema: this.schema,
529
- });
530
- const usersService = new UsersService({
531
- schema: this.schema,
532
- });
533
- const user = await usersService.readOne(this.accountability.user, {
534
- fields: ['first_name', 'last_name', 'email'],
535
- });
536
- const href = new Url(env['PUBLIC_URL']).addPath('admin', 'files', savedFile).toString();
537
- const message = `
150
+ const store = useStore(String(env["IMPORT_EXPORT_NAMESPACE"]), { ttl: ms(env["IMPORT_TIMEOUT"] ?? "1h") });
151
+ var ImportService = class {
152
+ knex;
153
+ accountability;
154
+ schema;
155
+ constructor(options) {
156
+ this.knex = options.knex || database_default();
157
+ this.accountability = options.accountability || null;
158
+ this.schema = options.schema;
159
+ }
160
+ async import(collection, mimetype, stream, options) {
161
+ if (this.accountability?.admin !== true && isSystemCollection(collection)) throw new ForbiddenError();
162
+ if (this.accountability) {
163
+ await validateAccess({
164
+ accountability: this.accountability,
165
+ action: "create",
166
+ collection
167
+ }, {
168
+ schema: this.schema,
169
+ knex: this.knex
170
+ });
171
+ await validateAccess({
172
+ accountability: this.accountability,
173
+ action: "update",
174
+ collection
175
+ }, {
176
+ schema: this.schema,
177
+ knex: this.knex
178
+ });
179
+ }
180
+ if ([
181
+ "application/json",
182
+ "text/csv",
183
+ "application/vnd.ms-excel"
184
+ ].includes(mimetype) === false) {
185
+ throw new UnsupportedMediaTypeError({
186
+ mediaType: mimetype,
187
+ where: "file import"
188
+ });
189
+ }
190
+ const limitReached = await store(async (store$1) => {
191
+ const count = await store$1.get("importCount") ?? 0;
192
+ if (count >= Number(env["IMPORT_MAX_CONCURRENCY"])) return true;
193
+ await store$1.set("importCount", count + 1);
194
+ return false;
195
+ });
196
+ if (limitReached) {
197
+ throw new LimitExceededError({ category: "Concurrent import" });
198
+ }
199
+ let promise;
200
+ const decrementImportCount = async () => {
201
+ try {
202
+ await store(async (store$1) => {
203
+ const count = await store$1.get("importCount") ?? 0;
204
+ await store$1.set("importCount", count - 1);
205
+ });
206
+ } catch (error) {
207
+ logger.error(error, `Failed to decrement importCount`);
208
+ }
209
+ };
210
+ if (mimetype === "application/json") {
211
+ promise = this.importJSON(collection, stream);
212
+ } else {
213
+ promise = this.importCSV(collection, stream);
214
+ }
215
+ if (options?.background) {
216
+ const notify = async (subject, message) => {
217
+ try {
218
+ if (!this.accountability?.user) return;
219
+ const notificationsService = new NotificationsService({ schema: this.schema });
220
+ const usersService = new UsersService({ schema: this.schema });
221
+ const user = await usersService.readOne(this.accountability.user, { fields: [
222
+ "first_name",
223
+ "last_name",
224
+ "email"
225
+ ] });
226
+ await notificationsService.createOne({
227
+ recipient: this.accountability.user,
228
+ sender: this.accountability.user,
229
+ subject,
230
+ message: `Hello ${userName(user)},\n\n${message}\n`
231
+ });
232
+ } catch (error) {
233
+ logger.error(error, `Failed to notify user`);
234
+ }
235
+ };
236
+ promise.then(async () => {
237
+ await notify("Your import has been successful", `Your import in ${collection} has been successful.`);
238
+ }).catch(async (error) => {
239
+ logger.error(error, `Background import to ${collection} failed`);
240
+ await notify("Your import has failed", `Your import in ${collection} has failed.\n\n${error.message ?? ""}`);
241
+ }).finally(async () => await decrementImportCount());
242
+ } else {
243
+ try {
244
+ await promise;
245
+ } finally {
246
+ await decrementImportCount();
247
+ }
248
+ }
249
+ }
250
+ async importJSON(collection, stream) {
251
+ const extractJSON = StreamArray.withParser();
252
+ const nestedActionEvents = [];
253
+ const errorTracker = createErrorTracker();
254
+ const isSingleton = this.schema.collections[collection]?.singleton ?? false;
255
+ let timeout;
256
+ return transaction(this.knex, async (trx) => {
257
+ const service = getService(collection, {
258
+ knex: trx,
259
+ schema: this.schema,
260
+ accountability: this.accountability
261
+ });
262
+ try {
263
+ await new Promise((resolve, reject) => {
264
+ let rowNumber = 1;
265
+ const saveQueue = queue(async (task) => {
266
+ if (errorTracker.shouldStop()) return;
267
+ try {
268
+ if (isSingleton) {
269
+ return await service.upsertSingleton(task.data, { bypassEmitAction: (params) => nestedActionEvents.push(params) });
270
+ } else {
271
+ return await service.upsertOne(task.data, { bypassEmitAction: (params) => nestedActionEvents.push(params) });
272
+ }
273
+ } catch (error) {
274
+ for (const err of toArray(error)) {
275
+ errorTracker.addCapturedError(err, task.rowNumber);
276
+ if (errorTracker.shouldStop()) {
277
+ break;
278
+ }
279
+ }
280
+ if (errorTracker.shouldStop()) {
281
+ saveQueue.kill();
282
+ destroyPipedStream(extractJSON, stream);
283
+ reject();
284
+ }
285
+ return;
286
+ }
287
+ });
288
+ stream.pipe(extractJSON);
289
+ extractJSON.on("data", ({ value }) => {
290
+ if (isSingleton && rowNumber > 1) {
291
+ saveQueue.kill();
292
+ destroyPipedStream(extractJSON, stream);
293
+ reject(new InvalidPayloadError({ reason: `Cannot import multiple records into singleton collection ${collection}` }));
294
+ return;
295
+ }
296
+ saveQueue.push({
297
+ data: value,
298
+ rowNumber: rowNumber++
299
+ });
300
+ });
301
+ extractJSON.on("error", (err) => {
302
+ destroyPipedStream(extractJSON, stream);
303
+ reject(new InvalidPayloadError({ reason: err.message }));
304
+ });
305
+ extractJSON.on("end", () => {
306
+ if (!saveQueue.started) return resolve();
307
+ saveQueue.drain(() => {
308
+ if (errorTracker.hasErrors()) {
309
+ return reject();
310
+ }
311
+ for (const nestedActionEvent of nestedActionEvents) {
312
+ emitter_default.emitAction(nestedActionEvent.event, nestedActionEvent.meta, nestedActionEvent.context);
313
+ }
314
+ return resolve();
315
+ });
316
+ });
317
+ const duration = ms(env["IMPORT_TIMEOUT"]);
318
+ timeout = setTimeout(() => {
319
+ saveQueue.kill();
320
+ destroyPipedStream(extractJSON, stream);
321
+ reject(new TimeoutError({
322
+ category: "Import",
323
+ duration
324
+ }));
325
+ }, duration);
326
+ });
327
+ } catch (error) {
328
+ if (!error && errorTracker.hasErrors()) {
329
+ throw errorTracker.buildFinalErrors();
330
+ }
331
+ throw error;
332
+ } finally {
333
+ clearTimeout(timeout);
334
+ }
335
+ });
336
+ }
337
+ async importCSV(collection, stream) {
338
+ const tmpFile = await createTmpFile().catch(() => null);
339
+ if (!tmpFile) throw new Error("Failed to create temporary file for import");
340
+ const nestedActionEvents = [];
341
+ const errorTracker = createErrorTracker();
342
+ const isSingleton = this.schema.collections[collection]?.singleton ?? false;
343
+ let timeout;
344
+ return transaction(this.knex, async (trx) => {
345
+ const service = getService(collection, {
346
+ knex: trx,
347
+ schema: this.schema,
348
+ accountability: this.accountability
349
+ });
350
+ try {
351
+ await new Promise((resolve, reject) => {
352
+ const streams = [stream];
353
+ let rowNumber = 0;
354
+ const cleanup = (destroy = true) => {
355
+ if (destroy) {
356
+ for (const stream$1 of streams) {
357
+ stream$1.destroy();
358
+ }
359
+ }
360
+ tmpFile.cleanup().catch(() => {
361
+ logger.warn(`Failed to cleanup temporary import file (${tmpFile.path})`);
362
+ });
363
+ };
364
+ const saveQueue = queue(async (task) => {
365
+ if (errorTracker.shouldStop()) return;
366
+ try {
367
+ if (isSingleton) {
368
+ return await service.upsertSingleton(task.data, { bypassEmitAction: (action) => nestedActionEvents.push(action) });
369
+ } else {
370
+ return await service.upsertOne(task.data, { bypassEmitAction: (action) => nestedActionEvents.push(action) });
371
+ }
372
+ } catch (error) {
373
+ for (const err of toArray(error)) {
374
+ errorTracker.addCapturedError(err, task.rowNumber);
375
+ if (errorTracker.shouldStop()) {
376
+ break;
377
+ }
378
+ }
379
+ if (errorTracker.shouldStop()) {
380
+ saveQueue.kill();
381
+ cleanup(true);
382
+ reject();
383
+ }
384
+ return;
385
+ }
386
+ });
387
+ const fileWriteStream = createWriteStream(tmpFile.path).on("error", (error) => {
388
+ cleanup();
389
+ reject(new Error("Error while writing import data to temporary file", { cause: error }));
390
+ }).on("finish", () => {
391
+ const fileReadStream = createReadStream(tmpFile.path).on("error", (error) => {
392
+ cleanup();
393
+ reject(new Error("Error while reading import data from temporary file", { cause: error }));
394
+ });
395
+ streams.push(fileReadStream);
396
+ fileReadStream.pipe(Papa.parse(Papa.NODE_STREAM_INPUT, {
397
+ header: true,
398
+ transformHeader: (header) => header.trim(),
399
+ transform: (value) => {
400
+ if (value.length === 0) return;
401
+ try {
402
+ const parsedJson = parseJSON(value);
403
+ if (typeof parsedJson === "number") {
404
+ return value;
405
+ }
406
+ return parsedJson;
407
+ } catch {
408
+ return value;
409
+ }
410
+ }
411
+ })).on("data", (obj) => {
412
+ rowNumber++;
413
+ if (isSingleton && rowNumber > 1) {
414
+ saveQueue.kill();
415
+ cleanup(true);
416
+ reject(new InvalidPayloadError({ reason: `Cannot import multiple records into singleton collection ${collection}` }));
417
+ return;
418
+ }
419
+ const result = {};
420
+ for (const field in obj) {
421
+ if (obj[field] !== undefined) {
422
+ set(result, field, obj[field]);
423
+ }
424
+ }
425
+ saveQueue.push({
426
+ data: result,
427
+ rowNumber
428
+ });
429
+ }).on("error", (error) => {
430
+ cleanup();
431
+ reject(new InvalidPayloadError({ reason: error.message }));
432
+ }).on("end", () => {
433
+ if (!saveQueue.started) {
434
+ cleanup(false);
435
+ return resolve();
436
+ }
437
+ saveQueue.drain(() => {
438
+ if (!errorTracker.shouldStop()) cleanup(false);
439
+ if (errorTracker.hasErrors()) {
440
+ return reject();
441
+ }
442
+ for (const nestedActionEvent of nestedActionEvents) {
443
+ emitter_default.emitAction(nestedActionEvent.event, nestedActionEvent.meta, nestedActionEvent.context);
444
+ }
445
+ return resolve();
446
+ });
447
+ });
448
+ });
449
+ streams.push(fileWriteStream);
450
+ const duration = ms(env["IMPORT_TIMEOUT"]);
451
+ timeout = setTimeout(() => {
452
+ saveQueue.kill();
453
+ destroyPipedStream(fileWriteStream, stream);
454
+ reject(new TimeoutError({
455
+ category: "Import",
456
+ duration
457
+ }));
458
+ }, duration);
459
+ stream.on("error", (error) => {
460
+ cleanup();
461
+ reject(new Error("Error while retrieving import data", { cause: error }));
462
+ }).pipe(fileWriteStream);
463
+ });
464
+ } catch (error) {
465
+ if (!error && errorTracker.hasErrors()) {
466
+ throw errorTracker.buildFinalErrors();
467
+ }
468
+ throw error;
469
+ } finally {
470
+ clearTimeout(timeout);
471
+ }
472
+ });
473
+ }
474
+ };
475
+ var ExportService = class {
476
+ knex;
477
+ accountability;
478
+ schema;
479
+ constructor(options) {
480
+ this.knex = options.knex || database_default();
481
+ this.accountability = options.accountability || null;
482
+ this.schema = options.schema;
483
+ }
484
+ /**
485
+ * Export the query results as a named file. Will query in batches, and keep appending a tmp file
486
+ * until all the data is retrieved. Uploads the result as a new file using the regular
487
+ * FilesService upload method.
488
+ */
489
+ async exportToFile(collection, query, format, options) {
490
+ const { createTmpFile: createTmpFile$1 } = await import("@directus/utils/node");
491
+ const tmpFile = await createTmpFile$1().catch(() => null);
492
+ try {
493
+ if (!tmpFile) throw new Error("Failed to create temporary file for export");
494
+ const mimeTypes = {
495
+ csv: "text/csv",
496
+ csv_utf8: "text/csv; charset=utf-8",
497
+ json: "application/json",
498
+ xml: "text/xml",
499
+ yaml: "text/yaml"
500
+ };
501
+ const database = database_default();
502
+ await transaction(database, async (trx) => {
503
+ const service = getService(collection, {
504
+ accountability: this.accountability,
505
+ schema: this.schema,
506
+ knex: trx
507
+ });
508
+ const { primary } = this.schema.collections[collection];
509
+ const sort = query.sort ?? [];
510
+ if (sort.includes(primary) === false) {
511
+ sort.push(primary);
512
+ }
513
+ const totalCount = await service.readByQuery({
514
+ ...query,
515
+ aggregate: { count: ["*"] }
516
+ }).then((result) => Number(result?.[0]?.["count"] ?? 0));
517
+ const count = query.limit && query.limit > -1 ? Math.min(totalCount, query.limit) : totalCount;
518
+ const requestedLimit = query.limit ?? -1;
519
+ const batchesRequired = Math.ceil(count / env["EXPORT_BATCH_SIZE"]);
520
+ let readCount = 0;
521
+ for (let batch = 0; batch < batchesRequired; batch++) {
522
+ let limit = env["EXPORT_BATCH_SIZE"];
523
+ if (requestedLimit > 0 && env["EXPORT_BATCH_SIZE"] > requestedLimit - readCount) {
524
+ limit = requestedLimit - readCount;
525
+ }
526
+ const result = await service.readByQuery({
527
+ ...query,
528
+ sort,
529
+ limit,
530
+ offset: batch * env["EXPORT_BATCH_SIZE"]
531
+ });
532
+ readCount += result.length;
533
+ if (result.length) {
534
+ let csvHeadings = null;
535
+ if (format.startsWith("csv")) {
536
+ if (!query.fields) query.fields = ["*"];
537
+ const parsedFields = await parseFields({
538
+ parentCollection: collection,
539
+ fields: query.fields,
540
+ query,
541
+ accountability: this.accountability
542
+ }, {
543
+ schema: this.schema,
544
+ knex: database
545
+ });
546
+ csvHeadings = getHeadingsForCsvExport(parsedFields);
547
+ }
548
+ await appendFile(tmpFile.path, this.transform(result, format, {
549
+ includeHeader: batch === 0,
550
+ includeFooter: batch + 1 === batchesRequired,
551
+ fields: csvHeadings
552
+ }));
553
+ }
554
+ }
555
+ });
556
+ const filesService = new FilesService({
557
+ accountability: this.accountability,
558
+ schema: this.schema
559
+ });
560
+ const title = `export-${collection}-${getDateTimeFormatted()}`;
561
+ const filename = `${title}.${format}`;
562
+ const fileWithDefaults = {
563
+ ...options?.file ?? {},
564
+ title: options?.file?.title ?? title,
565
+ filename_download: options?.file?.filename_download ?? filename,
566
+ type: mimeTypes[format]
567
+ };
568
+ const savedFile = await filesService.uploadOne(createReadStream(tmpFile.path), fileWithDefaults);
569
+ if (this.accountability?.user) {
570
+ const notificationsService = new NotificationsService({ schema: this.schema });
571
+ const usersService = new UsersService({ schema: this.schema });
572
+ const user = await usersService.readOne(this.accountability.user, { fields: [
573
+ "first_name",
574
+ "last_name",
575
+ "email"
576
+ ] });
577
+ const href = new Url(env["PUBLIC_URL"]).addPath("admin", "files", savedFile).toString();
578
+ const message = `
538
579
  Hello ${userName(user)},
539
580
 
540
581
  Your export of ${collection} is ready. <a href="${href}">Click here to view.</a>
541
582
  `;
542
- await notificationsService.createOne({
543
- recipient: this.accountability.user,
544
- sender: this.accountability.user,
545
- subject: `Your export of ${collection} is ready`,
546
- message,
547
- collection: `directus_files`,
548
- item: savedFile,
549
- });
550
- }
551
- }
552
- catch (err) {
553
- logger.error(err, `Couldn't export ${collection}: ${err.message}`);
554
- if (this.accountability?.user) {
555
- const notificationsService = new NotificationsService({
556
- schema: this.schema,
557
- });
558
- await notificationsService.createOne({
559
- recipient: this.accountability.user,
560
- sender: this.accountability.user,
561
- subject: `Your export of ${collection} failed`,
562
- message: `Please contact your system administrator for more information.`,
563
- });
564
- }
565
- }
566
- finally {
567
- await tmpFile?.cleanup();
568
- }
569
- }
570
- /**
571
- * Transform a given input object / array to the given type
572
- */
573
- transform(input, format, options) {
574
- if (format === 'json') {
575
- let string = JSON.stringify(input || null, null, '\t');
576
- if (options?.includeHeader === false)
577
- string = string.split('\n').slice(1).join('\n');
578
- if (options?.includeFooter === false) {
579
- const lines = string.split('\n');
580
- string = lines.slice(0, lines.length - 1).join('\n');
581
- string += ',\n';
582
- }
583
- return string;
584
- }
585
- if (format === 'xml') {
586
- let string = toXML('data', input);
587
- if (options?.includeHeader === false)
588
- string = string.split('\n').slice(2).join('\n');
589
- if (options?.includeFooter === false) {
590
- const lines = string.split('\n');
591
- string = lines.slice(0, lines.length - 1).join('\n');
592
- string += '\n';
593
- }
594
- return string;
595
- }
596
- if (format.startsWith('csv')) {
597
- if (input.length === 0)
598
- return '';
599
- const transforms = [CSVTransforms.flatten({ separator: '.' })];
600
- const header = options?.includeHeader !== false;
601
- const withBOM = format === 'csv_utf8';
602
- const transformOptions = options?.fields
603
- ? { transforms, header, fields: options?.fields, withBOM }
604
- : { transforms, header, withBOM };
605
- let string = new CSVParser(transformOptions).parse(input);
606
- if (options?.includeHeader === false) {
607
- string = '\n' + string;
608
- }
609
- return string;
610
- }
611
- if (format === 'yaml') {
612
- return toYAML(input);
613
- }
614
- throw new ServiceUnavailableError({ service: 'export', reason: `Illegal export type used: "${format}"` });
615
- }
616
- }
617
- /*
618
- * Recursive function to traverse the field nodes, to determine the headings for the CSV export file.
619
- *
620
- * Relational nodes which target a single item get expanded, which means that their nested fields get their own column in the csv file.
621
- * For relational nodes which target a multiple items, the nested field names are not going to be expanded.
622
- * Instead they will be stored as a single value/cell of the CSV file.
623
- */
624
- export function getHeadingsForCsvExport(nodes, prefix = '') {
625
- let fieldNames = [];
626
- if (!nodes)
627
- return fieldNames;
628
- nodes.forEach((node) => {
629
- switch (node.type) {
630
- case 'field':
631
- case 'functionField':
632
- case 'o2m':
633
- case 'a2o':
634
- fieldNames.push(prefix ? `${prefix}.${node.fieldKey}` : node.fieldKey);
635
- break;
636
- case 'm2o':
637
- fieldNames = fieldNames.concat(getHeadingsForCsvExport(node.children, prefix ? `${prefix}.${node.fieldKey}` : node.fieldKey));
638
- }
639
- });
640
- return fieldNames;
583
+ await notificationsService.createOne({
584
+ recipient: this.accountability.user,
585
+ sender: this.accountability.user,
586
+ subject: `Your export of ${collection} is ready`,
587
+ message,
588
+ collection: `directus_files`,
589
+ item: savedFile
590
+ });
591
+ }
592
+ } catch (err) {
593
+ logger.error(err, `Couldn't export ${collection}: ${err.message}`);
594
+ if (this.accountability?.user) {
595
+ const notificationsService = new NotificationsService({ schema: this.schema });
596
+ await notificationsService.createOne({
597
+ recipient: this.accountability.user,
598
+ sender: this.accountability.user,
599
+ subject: `Your export of ${collection} failed`,
600
+ message: `Please contact your system administrator for more information.`
601
+ });
602
+ }
603
+ } finally {
604
+ await tmpFile?.cleanup();
605
+ }
606
+ }
607
+ /**
608
+ * Transform a given input object / array to the given type
609
+ */
610
+ transform(input, format, options) {
611
+ if (format === "json") {
612
+ let string = JSON.stringify(input || null, null, " ");
613
+ if (options?.includeHeader === false) string = string.split("\n").slice(1).join("\n");
614
+ if (options?.includeFooter === false) {
615
+ const lines = string.split("\n");
616
+ string = lines.slice(0, lines.length - 1).join("\n");
617
+ string += ",\n";
618
+ }
619
+ return string;
620
+ }
621
+ if (format === "xml") {
622
+ let string = parse("data", input);
623
+ if (options?.includeHeader === false) string = string.split("\n").slice(2).join("\n");
624
+ if (options?.includeFooter === false) {
625
+ const lines = string.split("\n");
626
+ string = lines.slice(0, lines.length - 1).join("\n");
627
+ string += "\n";
628
+ }
629
+ return string;
630
+ }
631
+ if (format.startsWith("csv")) {
632
+ if (input.length === 0) return "";
633
+ const transforms$1 = [transforms.flatten({ separator: "." })];
634
+ const header = options?.includeHeader !== false;
635
+ const withBOM = format === "csv_utf8";
636
+ const transformOptions = options?.fields ? {
637
+ transforms: transforms$1,
638
+ header,
639
+ fields: options?.fields,
640
+ withBOM
641
+ } : {
642
+ transforms: transforms$1,
643
+ header,
644
+ withBOM
645
+ };
646
+ let string = new Parser(transformOptions).parse(input);
647
+ if (options?.includeHeader === false) {
648
+ string = "\n" + string;
649
+ }
650
+ return string;
651
+ }
652
+ if (format === "yaml") {
653
+ return dump(input);
654
+ }
655
+ throw new ServiceUnavailableError({
656
+ service: "export",
657
+ reason: `Illegal export type used: "${format}"`
658
+ });
659
+ }
660
+ };
661
+ function getHeadingsForCsvExport(nodes, prefix = "") {
662
+ let fieldNames = [];
663
+ if (!nodes) return fieldNames;
664
+ nodes.forEach((node) => {
665
+ switch (node.type) {
666
+ case "field":
667
+ case "functionField":
668
+ case "o2m":
669
+ case "a2o":
670
+ fieldNames.push(prefix ? `${prefix}.${node.fieldKey}` : node.fieldKey);
671
+ break;
672
+ case "m2o": fieldNames = fieldNames.concat(getHeadingsForCsvExport(node.children, prefix ? `${prefix}.${node.fieldKey}` : node.fieldKey));
673
+ }
674
+ });
675
+ return fieldNames;
641
676
  }
677
+
678
+ //#endregion
679
+ export { ExportService, ImportService, createErrorTracker, getHeadingsForCsvExport };