@directus/api 35.0.2 → 35.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (785) hide show
  1. package/dist/_virtual/rolldown_runtime.js +1 -24
  2. package/dist/ai/chat/controllers/chat.post.js +9 -22
  3. package/dist/ai/chat/controllers/object.post.js +58 -0
  4. package/dist/ai/chat/lib/create-ui-stream.js +10 -18
  5. package/dist/ai/chat/lib/transform-file-parts.js +1 -3
  6. package/dist/ai/chat/middleware/load-settings.js +1 -2
  7. package/dist/ai/chat/models/chat-request.js +2 -9
  8. package/dist/ai/chat/models/object-request.js +19 -0
  9. package/dist/ai/chat/router.js +3 -2
  10. package/dist/ai/chat/utils/add-additional-properties-to-json-schema.js +37 -0
  11. package/dist/ai/chat/utils/chat-request-tool-to-ai-sdk-tool.js +3 -8
  12. package/dist/ai/chat/utils/fix-error-tool-calls.js +4 -6
  13. package/dist/ai/chat/utils/format-context.js +17 -27
  14. package/dist/ai/chat/utils/parse-json-schema-7.js +3 -6
  15. package/dist/ai/chat/utils/zod-jsonschema7-parser.js +16 -0
  16. package/dist/ai/devtools/index.js +1 -2
  17. package/dist/ai/files/adapters/anthropic.js +1 -3
  18. package/dist/ai/files/adapters/google.js +5 -12
  19. package/dist/ai/files/adapters/openai.js +1 -3
  20. package/dist/ai/files/controllers/upload.js +8 -24
  21. package/dist/ai/files/lib/fetch-provider.js +1 -3
  22. package/dist/ai/files/lib/upload-to-provider.js +6 -16
  23. package/dist/ai/mcp/server.js +58 -102
  24. package/dist/ai/mcp/transport.js +2 -6
  25. package/dist/ai/providers/anthropic-file-support.js +28 -41
  26. package/dist/ai/providers/anthropic-tool-search.js +10 -14
  27. package/dist/ai/providers/index.js +0 -1
  28. package/dist/ai/providers/options.js +2 -7
  29. package/dist/ai/providers/registry.js +38 -48
  30. package/dist/ai/telemetry/braintrust.js +3 -9
  31. package/dist/ai/telemetry/index.js +14 -13
  32. package/dist/ai/telemetry/langfuse.js +8 -22
  33. package/dist/ai/tools/assets/index.js +15 -23
  34. package/dist/ai/tools/collections/index.js +9 -19
  35. package/dist/ai/tools/fields/index.js +13 -27
  36. package/dist/ai/tools/files/index.js +11 -24
  37. package/dist/ai/tools/flows/index.js +8 -16
  38. package/dist/ai/tools/folders/index.js +11 -23
  39. package/dist/ai/tools/items/index.js +19 -44
  40. package/dist/ai/tools/operations/index.js +7 -13
  41. package/dist/ai/tools/relations/index.js +5 -11
  42. package/dist/ai/tools/schema/index.js +39 -91
  43. package/dist/ai/tools/trigger-flow/index.js +9 -16
  44. package/dist/ai/tools/utils.js +4 -8
  45. package/dist/app.js +19 -51
  46. package/dist/auth/auth.js +3 -9
  47. package/dist/auth/drivers/ldap.js +39 -82
  48. package/dist/auth/drivers/local.js +4 -12
  49. package/dist/auth/drivers/oauth2.js +32 -63
  50. package/dist/auth/drivers/openid.js +49 -89
  51. package/dist/auth/drivers/saml.js +16 -31
  52. package/dist/auth/utils/generate-callback-url.js +2 -7
  53. package/dist/auth/utils/resolve-login-redirect.js +11 -21
  54. package/dist/auth.js +2 -5
  55. package/dist/bus/lib/use-bus.js +3 -7
  56. package/dist/cache.js +11 -24
  57. package/dist/cli/commands/bootstrap/index.js +10 -19
  58. package/dist/cli/commands/cache/clear.js +1 -3
  59. package/dist/cli/commands/database/migrate.js +2 -5
  60. package/dist/cli/commands/init/index.js +3 -5
  61. package/dist/cli/commands/init/questions.js +2 -3
  62. package/dist/cli/commands/schema/apply.js +39 -81
  63. package/dist/cli/commands/schema/snapshot.js +3 -8
  64. package/dist/cli/commands/users/create.js +3 -5
  65. package/dist/cli/commands/users/passwd.js +2 -5
  66. package/dist/cli/index.js +1 -2
  67. package/dist/cli/load-extensions.js +3 -6
  68. package/dist/cli/utils/create-db-connection.js +7 -12
  69. package/dist/cli/utils/create-env/index.js +2 -6
  70. package/dist/cli/utils/drivers.js +1 -3
  71. package/dist/controllers/access.js +15 -30
  72. package/dist/controllers/activity.js +5 -10
  73. package/dist/controllers/assets.js +24 -61
  74. package/dist/controllers/auth.js +19 -52
  75. package/dist/controllers/collections.js +8 -17
  76. package/dist/controllers/comments.js +15 -30
  77. package/dist/controllers/dashboards.js +13 -25
  78. package/dist/controllers/deployment-webhooks.js +6 -12
  79. package/dist/controllers/deployment.js +39 -90
  80. package/dist/controllers/extensions.js +53 -98
  81. package/dist/controllers/fields.js +17 -38
  82. package/dist/controllers/files.js +31 -68
  83. package/dist/controllers/flows.js +15 -30
  84. package/dist/controllers/folders.js +16 -32
  85. package/dist/controllers/graphql.js +2 -6
  86. package/dist/controllers/items.js +18 -38
  87. package/dist/controllers/mcp.js +4 -8
  88. package/dist/controllers/metrics.js +4 -12
  89. package/dist/controllers/not-found.js +2 -5
  90. package/dist/controllers/notifications.js +16 -32
  91. package/dist/controllers/operations.js +13 -25
  92. package/dist/controllers/panels.js +13 -25
  93. package/dist/controllers/permissions.js +18 -35
  94. package/dist/controllers/policies.js +15 -30
  95. package/dist/controllers/presets.js +16 -32
  96. package/dist/controllers/relations.js +12 -24
  97. package/dist/controllers/revisions.js +2 -3
  98. package/dist/controllers/roles.js +13 -25
  99. package/dist/controllers/schema.js +19 -30
  100. package/dist/controllers/server.js +32 -44
  101. package/dist/controllers/settings.js +5 -9
  102. package/dist/controllers/shares.js +20 -40
  103. package/dist/controllers/translations.js +16 -32
  104. package/dist/controllers/tus.js +4 -11
  105. package/dist/controllers/users.js +46 -100
  106. package/dist/controllers/utils/handle-registry-error.js +26 -0
  107. package/dist/controllers/utils.js +20 -41
  108. package/dist/controllers/versions.js +20 -41
  109. package/dist/database/errors/dialects/mssql.js +8 -21
  110. package/dist/database/errors/dialects/mysql.js +7 -14
  111. package/dist/database/errors/dialects/oracle.js +3 -6
  112. package/dist/database/errors/dialects/postgres.js +8 -18
  113. package/dist/database/errors/dialects/sqlite.js +16 -21
  114. package/dist/database/errors/translate.js +1 -2
  115. package/dist/database/get-ast-from-query/get-ast-from-query.js +4 -12
  116. package/dist/database/get-ast-from-query/lib/convert-wildcards.js +15 -29
  117. package/dist/database/get-ast-from-query/lib/parse-fields.js +17 -41
  118. package/dist/database/get-ast-from-query/utils/get-allowed-sort.js +5 -14
  119. package/dist/database/get-ast-from-query/utils/get-related-collection.js +2 -6
  120. package/dist/database/helpers/date/dialects/mysql.js +1 -1
  121. package/dist/database/helpers/date/dialects/oracle.js +3 -9
  122. package/dist/database/helpers/date/dialects/sqlite.js +3 -9
  123. package/dist/database/helpers/date/types.js +1 -3
  124. package/dist/database/helpers/fn/dialects/mssql.js +4 -12
  125. package/dist/database/helpers/fn/dialects/mysql.js +5 -14
  126. package/dist/database/helpers/fn/dialects/oracle.js +4 -12
  127. package/dist/database/helpers/fn/dialects/postgres.js +5 -14
  128. package/dist/database/helpers/fn/dialects/sqlite.js +4 -12
  129. package/dist/database/helpers/fn/json/parse-function.js +9 -27
  130. package/dist/database/helpers/fn/types.js +1 -3
  131. package/dist/database/helpers/geometry/dialects/mssql.js +1 -3
  132. package/dist/database/helpers/geometry/dialects/oracle.js +1 -3
  133. package/dist/database/helpers/geometry/dialects/postgres.js +1 -2
  134. package/dist/database/helpers/geometry/dialects/redshift.js +1 -3
  135. package/dist/database/helpers/geometry/dialects/sqlite.js +1 -2
  136. package/dist/database/helpers/index.js +1 -2
  137. package/dist/database/helpers/number/dialects/postgres.js +1 -3
  138. package/dist/database/helpers/number/utils/decimal-limit.js +2 -4
  139. package/dist/database/helpers/number/utils/maybe-stringify-big-int.js +1 -3
  140. package/dist/database/helpers/schema/dialects/cockroachdb.js +8 -15
  141. package/dist/database/helpers/schema/dialects/mssql.js +8 -15
  142. package/dist/database/helpers/schema/dialects/mysql.js +8 -14
  143. package/dist/database/helpers/schema/dialects/oracle.js +13 -28
  144. package/dist/database/helpers/schema/dialects/postgres.js +6 -10
  145. package/dist/database/helpers/schema/dialects/sqlite.js +1 -3
  146. package/dist/database/helpers/schema/types.js +12 -35
  147. package/dist/database/helpers/schema/utils/prep-query-params.js +4 -7
  148. package/dist/database/helpers/sequence/types.js +1 -3
  149. package/dist/database/index.js +41 -79
  150. package/dist/database/migrations/20201029A-remove-system-relations.js +1 -5
  151. package/dist/database/migrations/20201029B-remove-system-collections.js +1 -5
  152. package/dist/database/migrations/20201029C-remove-system-fields.js +1 -5
  153. package/dist/database/migrations/20201105A-add-cascade-system-relations.js +9 -15
  154. package/dist/database/migrations/20210225A-add-relations-sort-field.js +4 -6
  155. package/dist/database/migrations/20210415A-make-filesize-nullable.js +2 -4
  156. package/dist/database/migrations/20210506A-rename-interfaces.js +13 -20
  157. package/dist/database/migrations/20210518A-add-foreign-key-constraints.js +7 -18
  158. package/dist/database/migrations/20210519A-add-system-fk-triggers.js +58 -67
  159. package/dist/database/migrations/20210626A-change-filesize-bigint.js +2 -8
  160. package/dist/database/migrations/20210802A-replace-groups.js +7 -9
  161. package/dist/database/migrations/20210805A-update-groups.js +4 -14
  162. package/dist/database/migrations/20210805B-change-image-metadata-structure.js +2 -6
  163. package/dist/database/migrations/20210920A-webhooks-url-not-null.js +2 -6
  164. package/dist/database/migrations/20210927A-replace-fields-group.js +5 -11
  165. package/dist/database/migrations/20211007A-update-presets.js +4 -12
  166. package/dist/database/migrations/20220303A-remove-default-project-color.js +2 -4
  167. package/dist/database/migrations/20220322A-rename-field-typecast-flags.js +2 -6
  168. package/dist/database/migrations/20220325A-fix-typecast-flags.js +3 -8
  169. package/dist/database/migrations/20220402A-remove-default-value-panel-icon.js +2 -4
  170. package/dist/database/migrations/20220429A-add-flows.js +2 -4
  171. package/dist/database/migrations/20220801A-update-notifications-timestamp-column.js +2 -4
  172. package/dist/database/migrations/20230401A-update-material-icons.js +2 -4
  173. package/dist/database/migrations/20230526A-migrate-translation-strings.js +9 -16
  174. package/dist/database/migrations/20230721A-require-shares-fields.js +9 -20
  175. package/dist/database/migrations/20231009A-update-csv-fields-to-text.js +15 -22
  176. package/dist/database/migrations/20231009B-update-panel-options.js +4 -12
  177. package/dist/database/migrations/20240204A-marketplace.js +20 -26
  178. package/dist/database/migrations/20240311A-deprecate-webhooks.js +1 -1
  179. package/dist/database/migrations/20240716A-update-files-date-fields.js +8 -14
  180. package/dist/database/migrations/20240806A-permissions-policies.js +17 -39
  181. package/dist/database/migrations/20240909A-separate-comments.js +14 -17
  182. package/dist/database/migrations/20240924A-migrate-legacy-comments.js +6 -11
  183. package/dist/database/migrations/20240924B-populate-versioning-deltas.js +1 -3
  184. package/dist/database/migrations/20250224A-visual-editor.js +1 -2
  185. package/dist/database/migrations/20250609A-license-banner.js +1 -2
  186. package/dist/database/migrations/20250613A-add-project-id.js +2 -5
  187. package/dist/database/migrations/20251014A-add-project-owner.js +7 -10
  188. package/dist/database/migrations/20251028A-add-retention-indexes.js +7 -15
  189. package/dist/database/migrations/20260113A-add-revisions-index.js +7 -15
  190. package/dist/database/migrations/run.js +23 -50
  191. package/dist/database/run-ast/lib/apply-query/add-join.js +8 -20
  192. package/dist/database/run-ast/lib/apply-query/aggregate.js +1 -3
  193. package/dist/database/run-ast/lib/apply-query/filter/get-filter-type.js +3 -9
  194. package/dist/database/run-ast/lib/apply-query/filter/index.js +9 -27
  195. package/dist/database/run-ast/lib/apply-query/filter/operator.js +42 -107
  196. package/dist/database/run-ast/lib/apply-query/filter/validate-operator.js +3 -9
  197. package/dist/database/run-ast/lib/apply-query/get-filter-path.js +2 -6
  198. package/dist/database/run-ast/lib/apply-query/get-operation.js +9 -14
  199. package/dist/database/run-ast/lib/apply-query/index.js +20 -39
  200. package/dist/database/run-ast/lib/apply-query/join-filter-with-cases.js +3 -7
  201. package/dist/database/run-ast/lib/apply-query/pagination.js +2 -6
  202. package/dist/database/run-ast/lib/apply-query/search.js +17 -41
  203. package/dist/database/run-ast/lib/apply-query/sort.js +16 -30
  204. package/dist/database/run-ast/lib/get-db-query.js +7 -15
  205. package/dist/database/run-ast/lib/parse-current-level.js +10 -23
  206. package/dist/database/run-ast/modules/fetch-permitted-ast-root-fields.js +10 -14
  207. package/dist/database/run-ast/run-ast.js +30 -52
  208. package/dist/database/run-ast/utils/apply-case-when.js +1 -3
  209. package/dist/database/run-ast/utils/apply-function-to-column-name.js +2 -6
  210. package/dist/database/run-ast/utils/apply-parent-filters.js +14 -19
  211. package/dist/database/run-ast/utils/generate-alias.js +9 -14
  212. package/dist/database/run-ast/utils/get-column-pre-processor.js +14 -26
  213. package/dist/database/run-ast/utils/get-column.js +5 -14
  214. package/dist/database/run-ast/utils/get-inner-query-column-pre-processor.js +1 -3
  215. package/dist/database/run-ast/utils/merge-with-parent-items.js +31 -63
  216. package/dist/database/run-ast/utils/remove-temporary-fields.js +15 -29
  217. package/dist/database/run-ast/utils/with-preprocess-bindings.js +2 -6
  218. package/dist/database/seeds/run.js +19 -45
  219. package/dist/deployment/deployment.js +2 -8
  220. package/dist/deployment/drivers/netlify.js +43 -88
  221. package/dist/deployment/drivers/vercel.js +34 -72
  222. package/dist/deployment.js +8 -14
  223. package/dist/emitter.js +14 -21
  224. package/dist/extensions/index.js +1 -3
  225. package/dist/extensions/lib/get-extensions-path.js +1 -3
  226. package/dist/extensions/lib/get-extensions-settings.js +26 -42
  227. package/dist/extensions/lib/get-extensions.js +3 -7
  228. package/dist/extensions/lib/get-shared-deps-mapping.js +3 -7
  229. package/dist/extensions/lib/installation/index.js +1 -3
  230. package/dist/extensions/lib/installation/manager.js +9 -23
  231. package/dist/extensions/lib/sandbox/generate-host-function-reference.js +2 -5
  232. package/dist/extensions/lib/sandbox/register/call-reference.js +1 -1
  233. package/dist/extensions/lib/sandbox/register/filter.js +1 -2
  234. package/dist/extensions/lib/sandbox/register/operation.js +1 -2
  235. package/dist/extensions/lib/sandbox/register/route.js +2 -4
  236. package/dist/extensions/lib/sandbox/sdk/generators/log.js +1 -1
  237. package/dist/extensions/lib/sandbox/sdk/generators/request.js +13 -28
  238. package/dist/extensions/lib/sandbox/sdk/generators/sleep.js +2 -3
  239. package/dist/extensions/lib/sandbox/sdk/utils/wrap.js +4 -9
  240. package/dist/extensions/lib/sync/status.js +4 -11
  241. package/dist/extensions/lib/sync/sync.js +6 -12
  242. package/dist/extensions/lib/sync/tracker.js +7 -10
  243. package/dist/extensions/lib/sync/utils.js +5 -9
  244. package/dist/extensions/manager.js +59 -107
  245. package/dist/flows.js +233 -275
  246. package/dist/lock/lib/use-lock.js +3 -7
  247. package/dist/logger/index.js +37 -57
  248. package/dist/logger/redact-query.js +1 -3
  249. package/dist/mailer.js +12 -18
  250. package/dist/metrics/lib/create-metrics.js +69 -117
  251. package/dist/metrics/lib/use-metrics.js +3 -8
  252. package/dist/middleware/authenticate.js +1 -3
  253. package/dist/middleware/cache.js +5 -8
  254. package/dist/middleware/collection-exists.js +3 -8
  255. package/dist/middleware/cors.js +8 -10
  256. package/dist/middleware/error-handler.js +10 -21
  257. package/dist/middleware/extract-token.js +3 -9
  258. package/dist/middleware/graphql.js +16 -27
  259. package/dist/middleware/rate-limiter-global.js +1 -3
  260. package/dist/middleware/rate-limiter-ip.js +9 -11
  261. package/dist/middleware/rate-limiter-registration.js +9 -11
  262. package/dist/middleware/request-counter.js +8 -15
  263. package/dist/middleware/respond.js +8 -16
  264. package/dist/middleware/validate-batch.js +5 -15
  265. package/dist/operations/condition/index.js +4 -10
  266. package/dist/operations/exec/index.js +1 -2
  267. package/dist/operations/item-create/index.js +18 -26
  268. package/dist/operations/item-delete/index.js +21 -31
  269. package/dist/operations/item-read/index.js +21 -31
  270. package/dist/operations/item-update/index.js +23 -36
  271. package/dist/operations/log/index.js +1 -2
  272. package/dist/operations/mail/index.js +5 -8
  273. package/dist/operations/mail/rate-limiter.js +6 -10
  274. package/dist/operations/notification/index.js +13 -19
  275. package/dist/operations/request/index.js +8 -13
  276. package/dist/operations/throw-error/index.js +1 -2
  277. package/dist/operations/trigger/index.js +4 -8
  278. package/dist/packages/types/dist/index.js +219 -231
  279. package/dist/permissions/cache.js +2 -3
  280. package/dist/permissions/lib/fetch-permissions.js +1 -3
  281. package/dist/permissions/lib/fetch-policies.js +5 -10
  282. package/dist/permissions/modules/fetch-accountability-collection-access/fetch-accountability-collection-access.js +19 -32
  283. package/dist/permissions/modules/fetch-allowed-collections/fetch-allowed-collections.js +7 -12
  284. package/dist/permissions/modules/fetch-allowed-field-map/fetch-allowed-field-map.js +8 -17
  285. package/dist/permissions/modules/fetch-global-access/fetch-global-access.js +1 -1
  286. package/dist/permissions/modules/fetch-inconsistent-field-map/fetch-inconsistent-field-map.js +6 -10
  287. package/dist/permissions/modules/fetch-policies-ip-access/fetch-policies-ip-access.js +9 -15
  288. package/dist/permissions/modules/process-ast/lib/extract-fields-from-children.js +2 -8
  289. package/dist/permissions/modules/process-ast/lib/extract-fields-from-query.js +32 -34
  290. package/dist/permissions/modules/process-ast/lib/field-map-from-ast.js +2 -2
  291. package/dist/permissions/modules/process-ast/lib/get-cases.js +3 -8
  292. package/dist/permissions/modules/process-ast/lib/inject-cases.js +6 -19
  293. package/dist/permissions/modules/process-ast/process-ast.js +4 -12
  294. package/dist/permissions/modules/process-ast/utils/collections-in-field-map.js +2 -4
  295. package/dist/permissions/modules/process-ast/utils/dedupe-access.js +6 -10
  296. package/dist/permissions/modules/process-ast/utils/extract-paths-from-query.js +9 -25
  297. package/dist/permissions/modules/process-ast/utils/find-related-collection.js +1 -3
  298. package/dist/permissions/modules/process-ast/utils/flatten-filter.js +7 -10
  299. package/dist/permissions/modules/process-ast/utils/get-info-for-path.js +4 -6
  300. package/dist/permissions/modules/process-ast/utils/validate-path/create-error.js +1 -2
  301. package/dist/permissions/modules/process-ast/utils/validate-path/validate-path-existence.js +3 -8
  302. package/dist/permissions/modules/process-ast/utils/validate-path/validate-path-permissions.js +5 -13
  303. package/dist/permissions/modules/process-payload/lib/is-field-nullable.js +1 -2
  304. package/dist/permissions/modules/process-payload/process-payload.js +6 -15
  305. package/dist/permissions/modules/validate-access/lib/validate-collection-access.js +2 -3
  306. package/dist/permissions/modules/validate-access/lib/validate-item-access.js +14 -28
  307. package/dist/permissions/modules/validate-access/validate-access.js +5 -15
  308. package/dist/permissions/modules/validate-remaining-admin/validate-remaining-admin-count.js +1 -3
  309. package/dist/permissions/utils/extract-required-dynamic-variable-context.js +10 -15
  310. package/dist/permissions/utils/fetch-dynamic-variable-data.js +17 -35
  311. package/dist/permissions/utils/fetch-raw-permissions.js +3 -9
  312. package/dist/permissions/utils/fetch-share-info.js +1 -2
  313. package/dist/permissions/utils/filter-policies-by-ip.js +2 -6
  314. package/dist/permissions/utils/get-permissions-for-share.js +22 -47
  315. package/dist/permissions/utils/get-unaliased-field-key.js +2 -5
  316. package/dist/permissions/utils/merge-permissions.js +13 -36
  317. package/dist/permissions/utils/with-cache.js +1 -3
  318. package/dist/rate-limiter.js +2 -7
  319. package/dist/redis/lib/create-redis.js +1 -2
  320. package/dist/redis/lib/use-redis.js +1 -1
  321. package/dist/redis/utils/redis-config-available.js +1 -3
  322. package/dist/request/agent-with-ip-validation.js +3 -7
  323. package/dist/request/is-denied-ip.js +1 -3
  324. package/dist/schedules/metrics.js +4 -11
  325. package/dist/schedules/retention.js +17 -33
  326. package/dist/schedules/telemetry.js +1 -2
  327. package/dist/schedules/tus.js +5 -7
  328. package/dist/server.js +12 -24
  329. package/dist/services/access.js +1 -3
  330. package/dist/services/assets/name-deduper.js +2 -6
  331. package/dist/services/assets.js +43 -79
  332. package/dist/services/authentication.js +63 -96
  333. package/dist/services/collections.js +107 -218
  334. package/dist/services/comments.js +18 -32
  335. package/dist/services/deployment-projects.js +17 -31
  336. package/dist/services/deployment.js +63 -106
  337. package/dist/services/extensions.js +25 -63
  338. package/dist/services/fields/build-collection-and-field-relations.js +8 -14
  339. package/dist/services/fields/get-collection-meta-updates.js +4 -12
  340. package/dist/services/fields/get-collection-relation-list.js +2 -4
  341. package/dist/services/fields.js +162 -314
  342. package/dist/services/files/lib/extract-metadata.js +7 -20
  343. package/dist/services/files/utils/get-metadata.js +31 -64
  344. package/dist/services/files/utils/parse-image-metadata.js +7 -19
  345. package/dist/services/files.js +102 -173
  346. package/dist/services/flows.js +3 -6
  347. package/dist/services/folders.js +13 -17
  348. package/dist/services/graphql/errors/format.js +2 -2
  349. package/dist/services/graphql/index.js +4 -13
  350. package/dist/services/graphql/resolvers/get-collection-type.js +1 -3
  351. package/dist/services/graphql/resolvers/get-field-type.js +1 -3
  352. package/dist/services/graphql/resolvers/get-relation-type.js +1 -3
  353. package/dist/services/graphql/resolvers/mutation.js +6 -14
  354. package/dist/services/graphql/resolvers/query.js +3 -10
  355. package/dist/services/graphql/resolvers/system-admin.js +13 -27
  356. package/dist/services/graphql/resolvers/system-global.js +31 -71
  357. package/dist/services/graphql/resolvers/system.js +209 -245
  358. package/dist/services/graphql/schema/get-types.js +69 -101
  359. package/dist/services/graphql/schema/index.js +74 -92
  360. package/dist/services/graphql/schema/parse-args.js +1 -2
  361. package/dist/services/graphql/schema/parse-query.js +8 -21
  362. package/dist/services/graphql/schema/read.js +83 -106
  363. package/dist/services/graphql/schema/write.js +36 -41
  364. package/dist/services/graphql/subscription.js +30 -51
  365. package/dist/services/graphql/types/bigint.js +5 -15
  366. package/dist/services/graphql/types/string-or-float.js +2 -6
  367. package/dist/services/graphql/utils/add-path-to-validation-error.js +1 -3
  368. package/dist/services/graphql/utils/aggregate-query.js +2 -6
  369. package/dist/services/graphql/utils/dedupe-resolvers.js +8 -13
  370. package/dist/services/graphql/utils/filter-replace-m2a.js +9 -18
  371. package/dist/services/graphql/utils/process-error.js +21 -31
  372. package/dist/services/graphql/utils/replace-fragments.js +2 -5
  373. package/dist/services/graphql/utils/replace-funcs.js +2 -5
  374. package/dist/services/graphql/utils/sanitize-gql-schema.js +10 -21
  375. package/dist/services/import-export.js +68 -143
  376. package/dist/services/items.js +126 -271
  377. package/dist/services/mail/index.js +13 -26
  378. package/dist/services/mail/rate-limiter.js +6 -10
  379. package/dist/services/meta.js +4 -9
  380. package/dist/services/notifications.js +2 -3
  381. package/dist/services/operations.js +3 -6
  382. package/dist/services/payload.js +188 -316
  383. package/dist/services/permissions.js +14 -26
  384. package/dist/services/policies.js +7 -18
  385. package/dist/services/relations.js +82 -181
  386. package/dist/services/revisions.js +8 -15
  387. package/dist/services/roles.js +4 -12
  388. package/dist/services/schema.js +4 -9
  389. package/dist/services/server.js +31 -66
  390. package/dist/services/shares.js +25 -35
  391. package/dist/services/specifications.js +87 -139
  392. package/dist/services/tfa.js +8 -24
  393. package/dist/services/translations.js +6 -12
  394. package/dist/services/tus/data-store.js +23 -55
  395. package/dist/services/tus/lockers.js +4 -10
  396. package/dist/services/tus/server.js +2 -5
  397. package/dist/services/users.js +79 -153
  398. package/dist/services/utils.js +12 -31
  399. package/dist/services/versions.js +52 -96
  400. package/dist/services/websocket.js +8 -12
  401. package/dist/storage/get-storage-driver.js +2 -5
  402. package/dist/storage/register-drivers.js +1 -3
  403. package/dist/storage/register-locations.js +2 -4
  404. package/dist/synchronization.js +6 -17
  405. package/dist/telemetry/counter/use-buffered-counter.js +6 -22
  406. package/dist/telemetry/counter/use-counters.js +2 -6
  407. package/dist/telemetry/lib/send-report.js +2 -6
  408. package/dist/telemetry/lib/track.js +3 -8
  409. package/dist/telemetry/utils/check-user-limits.js +3 -9
  410. package/dist/telemetry/utils/format-api-request-counts.js +1 -3
  411. package/dist/telemetry/utils/get-extension-count.js +3 -8
  412. package/dist/telemetry/utils/get-item-count.js +2 -5
  413. package/dist/telemetry/utils/get-settings.js +2 -3
  414. package/dist/telemetry/utils/get-user-item-count.js +2 -4
  415. package/dist/telemetry/utils/should-check-user-limits.js +1 -3
  416. package/dist/types/index.js +0 -6
  417. package/dist/utils/apply-diff.js +111 -143
  418. package/dist/utils/apply-snapshot.js +1 -2
  419. package/dist/utils/calculate-field-depth.js +6 -19
  420. package/dist/utils/construct-flow-tree.js +5 -12
  421. package/dist/utils/create-admin.js +1 -2
  422. package/dist/utils/deep-map-response.js +31 -35
  423. package/dist/utils/encrypt.js +2 -3
  424. package/dist/utils/fetch-user-count/fetch-access-lookup.js +5 -15
  425. package/dist/utils/fetch-user-count/get-user-count-query.js +4 -12
  426. package/dist/utils/filter-items.js +9 -14
  427. package/dist/utils/freeze-schema.js +3 -8
  428. package/dist/utils/generate-translations.js +87 -137
  429. package/dist/utils/get-accountability-for-role.js +12 -17
  430. package/dist/utils/get-accountability-for-token.js +25 -31
  431. package/dist/utils/get-address.js +2 -7
  432. package/dist/utils/get-allowed-log-levels.js +1 -3
  433. package/dist/utils/get-auth-providers.js +12 -14
  434. package/dist/utils/get-cache-headers.js +2 -4
  435. package/dist/utils/get-cache-key.js +16 -4
  436. package/dist/utils/get-collection-from-alias.js +1 -6
  437. package/dist/utils/get-column-path.js +10 -21
  438. package/dist/utils/get-config-from-env.js +6 -15
  439. package/dist/utils/get-default-index-name.js +2 -4
  440. package/dist/utils/get-default-value.js +5 -9
  441. package/dist/utils/get-field-relational-depth.js +2 -5
  442. package/dist/utils/get-graphql-query-and-variables.js +1 -2
  443. package/dist/utils/get-graphql-type.js +1 -3
  444. package/dist/utils/get-ip-from-req.js +6 -15
  445. package/dist/utils/get-local-type.js +5 -13
  446. package/dist/utils/get-milliseconds.js +1 -3
  447. package/dist/utils/get-module-default.js +1 -3
  448. package/dist/utils/get-schema.js +9 -21
  449. package/dist/utils/get-secret.js +2 -6
  450. package/dist/utils/get-snapshot-diff.js +15 -23
  451. package/dist/utils/get-snapshot.js +6 -17
  452. package/dist/utils/is-directus-jwt.js +1 -2
  453. package/dist/utils/is-field-allowed.js +1 -3
  454. package/dist/utils/job-queue.js +2 -7
  455. package/dist/utils/jwt.js +7 -13
  456. package/dist/utils/md.js +1 -2
  457. package/dist/utils/parse-filter-key.js +2 -4
  458. package/dist/utils/parse-numeric-string.js +5 -11
  459. package/dist/utils/permissions-cacheable.js +9 -22
  460. package/dist/utils/redact-object.js +27 -57
  461. package/dist/utils/reduce-schema.js +8 -25
  462. package/dist/utils/sanitize-query.js +46 -98
  463. package/dist/utils/sanitize-schema.js +2 -3
  464. package/dist/utils/schedule.js +2 -6
  465. package/dist/utils/should-clear-cache.js +2 -6
  466. package/dist/utils/should-skip-cache.js +3 -8
  467. package/dist/utils/split-fields.js +4 -12
  468. package/dist/utils/stall.js +1 -3
  469. package/dist/utils/store.js +2 -5
  470. package/dist/utils/transaction.js +29 -58
  471. package/dist/utils/transformations.js +28 -43
  472. package/dist/utils/translations-shared.js +4 -12
  473. package/dist/utils/url.js +3 -10
  474. package/dist/utils/user-name.js +4 -12
  475. package/dist/utils/validate-diff.js +10 -35
  476. package/dist/utils/validate-env.js +3 -5
  477. package/dist/utils/validate-keys.js +4 -10
  478. package/dist/utils/validate-query.js +67 -118
  479. package/dist/utils/validate-snapshot.js +3 -9
  480. package/dist/utils/validate-storage.js +12 -19
  481. package/dist/utils/validate-user-count-integrity.js +3 -9
  482. package/dist/utils/verify-session-jwt.js +2 -6
  483. package/dist/utils/versioning/handle-version.js +10 -29
  484. package/dist/utils/versioning/merge-version-data.js +1 -5
  485. package/dist/utils/versioning/split-recursive.js +6 -3
  486. package/dist/websocket/authenticate.js +7 -18
  487. package/dist/websocket/collab/calculate-cache-metadata.js +33 -51
  488. package/dist/websocket/collab/collab.js +49 -113
  489. package/dist/websocket/collab/filter-to-fields.js +2 -5
  490. package/dist/websocket/collab/messenger.js +48 -73
  491. package/dist/websocket/collab/payload-permissions.js +20 -51
  492. package/dist/websocket/collab/permissions-cache.js +17 -46
  493. package/dist/websocket/collab/room.js +57 -124
  494. package/dist/websocket/collab/verify-permissions.js +37 -48
  495. package/dist/websocket/controllers/base.js +34 -61
  496. package/dist/websocket/controllers/graphql.js +11 -18
  497. package/dist/websocket/controllers/index.js +3 -12
  498. package/dist/websocket/controllers/logs.js +3 -7
  499. package/dist/websocket/errors.js +2 -5
  500. package/dist/websocket/handlers/heartbeat.js +11 -19
  501. package/dist/websocket/handlers/index.js +5 -15
  502. package/dist/websocket/handlers/items.js +15 -26
  503. package/dist/websocket/handlers/logs.js +24 -41
  504. package/dist/websocket/handlers/subscribe.js +37 -66
  505. package/dist/websocket/utils/get-expires-at-for-token.js +1 -3
  506. package/dist/websocket/utils/items.js +10 -27
  507. package/dist/websocket/utils/message.js +6 -10
  508. package/package.json +23 -23
  509. package/dist/__utils__/items-utils.js +0 -32
  510. package/dist/__utils__/schemas.js +0 -297
  511. package/dist/__utils__/snapshots.js +0 -899
  512. package/dist/database/run-ast/lib/apply-query/mock.js +0 -9
  513. package/dist/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.js +0 -445
  514. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/index.js +0 -176
  515. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/system/policy.js +0 -54
  516. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/any/any.js +0 -13
  517. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/any/index.js +0 -3
  518. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/argument/argument.js +0 -15
  519. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/argument/index.js +0 -3
  520. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/array/array.js +0 -16
  521. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/array/index.js +0 -3
  522. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/async-iterator/async-iterator.js +0 -16
  523. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/async-iterator/index.js +0 -3
  524. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/awaited/awaited.js +0 -37
  525. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/awaited/index.js +0 -3
  526. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/bigint/bigint.js +0 -16
  527. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/bigint/index.js +0 -3
  528. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/boolean/boolean.js +0 -16
  529. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/boolean/index.js +0 -3
  530. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/clone/index.js +0 -4
  531. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/clone/type.js +0 -17
  532. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/clone/value.js +0 -35
  533. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/composite/composite.js +0 -42
  534. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/composite/index.js +0 -3
  535. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/computed/computed.js +0 -16
  536. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/computed/index.js +0 -3
  537. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/const/const.js +0 -52
  538. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/const/index.js +0 -3
  539. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/constructor/constructor.js +0 -17
  540. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/constructor/index.js +0 -3
  541. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/constructor-parameters/constructor-parameters.js +0 -14
  542. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/constructor-parameters/index.js +0 -3
  543. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/create/immutable.js +0 -32
  544. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/create/index.js +0 -3
  545. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/create/type.js +0 -20
  546. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/date/date.js +0 -15
  547. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/date/index.js +0 -3
  548. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/discard/discard.js +0 -12
  549. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/discard/index.js +0 -3
  550. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/enum/enum.js +0 -23
  551. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/enum/index.js +0 -3
  552. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/error/error.js +0 -10
  553. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/error/index.js +0 -3
  554. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/exclude/exclude-from-mapped-result.js +0 -20
  555. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/exclude/exclude-from-template-literal.js +0 -11
  556. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/exclude/exclude.js +0 -25
  557. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/exclude/index.js +0 -5
  558. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/extends/extends-check.js +0 -267
  559. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/extends/extends-from-mapped-key.js +0 -29
  560. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/extends/extends-from-mapped-result.js +0 -21
  561. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/extends/extends-undefined.js +0 -21
  562. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/extends/extends.js +0 -20
  563. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/extends/index.js +0 -7
  564. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/extract/extract-from-mapped-result.js +0 -20
  565. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/extract/extract-from-template-literal.js +0 -11
  566. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/extract/extract.js +0 -25
  567. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/extract/index.js +0 -5
  568. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/function/function.js +0 -17
  569. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/function/index.js +0 -3
  570. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/guard/index.js +0 -5
  571. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/guard/kind.js +0 -204
  572. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/guard/type.js +0 -293
  573. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/guard/value.js +0 -68
  574. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/helpers/helpers.js +0 -8
  575. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/helpers/index.js +0 -3
  576. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/indexed/index.js +0 -6
  577. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-from-mapped-key.js +0 -27
  578. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-from-mapped-result.js +0 -24
  579. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-property-keys.js +0 -24
  580. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/indexed/indexed.js +0 -67
  581. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/instance-type/index.js +0 -3
  582. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/instance-type/instance-type.js +0 -13
  583. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/instantiate/index.js +0 -3
  584. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/instantiate/instantiate.js +0 -102
  585. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/integer/index.js +0 -3
  586. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/integer/integer.js +0 -15
  587. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/intersect/index.js +0 -5
  588. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/intersect/intersect-create.js +0 -23
  589. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/intersect/intersect-evaluated.js +0 -35
  590. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/intersect/intersect-type.js +0 -3
  591. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/intersect/intersect.js +0 -17
  592. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/intrinsic/capitalize.js +0 -10
  593. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/intrinsic/index.js +0 -8
  594. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/intrinsic/intrinsic-from-mapped-key.js +0 -30
  595. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/intrinsic/intrinsic.js +0 -54
  596. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/intrinsic/lowercase.js +0 -10
  597. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/intrinsic/uncapitalize.js +0 -10
  598. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/intrinsic/uppercase.js +0 -10
  599. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/iterator/index.js +0 -3
  600. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/iterator/iterator.js +0 -16
  601. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/keyof/index.js +0 -6
  602. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/keyof/keyof-from-mapped-result.js +0 -21
  603. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/keyof/keyof-property-entries.js +0 -17
  604. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/keyof/keyof-property-keys.js +0 -52
  605. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/keyof/keyof.js +0 -38
  606. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/literal/index.js +0 -3
  607. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/literal/literal.js +0 -16
  608. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/mapped/index.js +0 -5
  609. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/mapped/mapped-key.js +0 -14
  610. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/mapped/mapped-result.js +0 -14
  611. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/mapped/mapped.js +0 -86
  612. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/module/compute.js +0 -144
  613. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/module/index.js +0 -3
  614. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/module/module.js +0 -44
  615. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/never/index.js +0 -3
  616. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/never/never.js +0 -15
  617. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/not/index.js +0 -3
  618. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/not/not.js +0 -15
  619. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/null/index.js +0 -3
  620. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/null/null.js +0 -15
  621. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/number/index.js +0 -3
  622. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/number/number.js +0 -15
  623. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/object/index.js +0 -3
  624. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/object/object.js +0 -33
  625. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/omit/index.js +0 -5
  626. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/omit/omit-from-mapped-key.js +0 -27
  627. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/omit/omit-from-mapped-result.js +0 -21
  628. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/omit/omit.js +0 -65
  629. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/optional/index.js +0 -4
  630. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/optional/optional-from-mapped-result.js +0 -20
  631. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/optional/optional.js +0 -29
  632. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/parameters/index.js +0 -3
  633. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/parameters/parameters.js +0 -14
  634. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/partial/index.js +0 -4
  635. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/partial/partial-from-mapped-result.js +0 -21
  636. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/partial/partial.js +0 -62
  637. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/patterns/index.js +0 -3
  638. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/patterns/patterns.js +0 -12
  639. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/pick/index.js +0 -5
  640. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/pick/pick-from-mapped-key.js +0 -27
  641. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/pick/pick-from-mapped-result.js +0 -21
  642. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/pick/pick.js +0 -63
  643. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/promise/index.js +0 -3
  644. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/promise/promise.js +0 -16
  645. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/readonly/index.js +0 -4
  646. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/readonly/readonly-from-mapped-result.js +0 -20
  647. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/readonly/readonly.js +0 -29
  648. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/readonly-optional/index.js +0 -3
  649. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/readonly-optional/readonly-optional.js +0 -13
  650. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/record/index.js +0 -3
  651. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/record/record.js +0 -92
  652. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/recursive/index.js +0 -3
  653. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/recursive/recursive.js +0 -24
  654. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/ref/index.js +0 -3
  655. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/ref/ref.js +0 -19
  656. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/regexp/index.js +0 -3
  657. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/regexp/regexp.js +0 -19
  658. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/registry/format.js +0 -30
  659. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/registry/index.js +0 -4
  660. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/registry/type.js +0 -30
  661. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/required/index.js +0 -4
  662. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/required/required-from-mapped-result.js +0 -20
  663. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/required/required.js +0 -60
  664. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/rest/index.js +0 -3
  665. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/rest/rest.js +0 -13
  666. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/return-type/index.js +0 -3
  667. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/return-type/return-type.js +0 -13
  668. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/schema/anyschema.js +0 -1
  669. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/schema/index.js +0 -4
  670. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/schema/schema.js +0 -3
  671. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/sets/index.js +0 -3
  672. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/sets/set.js +0 -42
  673. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/static/index.js +0 -3
  674. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/static/static.js +0 -1
  675. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/string/index.js +0 -3
  676. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/string/string.js +0 -15
  677. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/symbol/index.js +0 -3
  678. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/symbol/symbol.js +0 -15
  679. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/symbols/index.js +0 -3
  680. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/symbols/symbols.js +0 -14
  681. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/template-literal/finite.js +0 -28
  682. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/template-literal/generate.js +0 -37
  683. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/template-literal/index.js +0 -9
  684. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/template-literal/parse.js +0 -125
  685. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/template-literal/pattern.js +0 -24
  686. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/template-literal/syntax.js +0 -55
  687. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/template-literal/template-literal.js +0 -20
  688. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/template-literal/union.js +0 -16
  689. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/transform/index.js +0 -3
  690. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/transform/transform.js +0 -51
  691. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/tuple/index.js +0 -3
  692. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/tuple/tuple.js +0 -24
  693. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/type/index.js +0 -10
  694. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/type/javascript.js +0 -123
  695. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/type/json.js +0 -263
  696. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/type/type.js +0 -191
  697. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/uint8array/index.js +0 -3
  698. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/uint8array/uint8array.js +0 -15
  699. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/undefined/index.js +0 -3
  700. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/undefined/undefined.js +0 -15
  701. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/union/index.js +0 -5
  702. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/union/union-create.js +0 -14
  703. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/union/union-evaluated.js +0 -33
  704. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/union/union-type.js +0 -3
  705. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/union/union.js +0 -13
  706. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/unknown/index.js +0 -3
  707. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/unknown/unknown.js +0 -12
  708. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/unsafe/index.js +0 -3
  709. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/unsafe/unsafe.js +0 -12
  710. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/void/index.js +0 -3
  711. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/void/void.js +0 -15
  712. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/value/guard/guard.js +0 -140
  713. package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/value/guard/index.js +0 -3
  714. package/dist/node_modules/.pnpm/@vitest_expect@3.2.4/node_modules/@vitest/expect/dist/index.js +0 -1714
  715. package/dist/node_modules/.pnpm/@vitest_pretty-format@3.2.4/node_modules/@vitest/pretty-format/dist/index.js +0 -1287
  716. package/dist/node_modules/.pnpm/@vitest_runner@3.2.4/node_modules/@vitest/runner/dist/chunk-hooks.js +0 -2151
  717. package/dist/node_modules/.pnpm/@vitest_runner@3.2.4/node_modules/@vitest/runner/dist/index.js +0 -8
  718. package/dist/node_modules/.pnpm/@vitest_runner@3.2.4/node_modules/@vitest/runner/dist/utils.js +0 -8
  719. package/dist/node_modules/.pnpm/@vitest_snapshot@3.2.4/node_modules/@vitest/snapshot/dist/index.js +0 -2082
  720. package/dist/node_modules/.pnpm/@vitest_spy@3.2.4/node_modules/@vitest/spy/dist/index.js +0 -192
  721. package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/chunk-_commonjsHelpers.js +0 -158
  722. package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/diff.js +0 -1535
  723. package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/error.js +0 -155
  724. package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/helpers.js +0 -244
  725. package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/index.js +0 -621
  726. package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/source-map.js +0 -890
  727. package/dist/node_modules/.pnpm/chai@5.3.3/node_modules/chai/index.js +0 -3558
  728. package/dist/node_modules/.pnpm/expect-type@1.2.2/node_modules/expect-type/dist/branding.js +0 -13
  729. package/dist/node_modules/.pnpm/expect-type@1.2.2/node_modules/expect-type/dist/index.js +0 -115
  730. package/dist/node_modules/.pnpm/expect-type@1.2.2/node_modules/expect-type/dist/messages.js +0 -77
  731. package/dist/node_modules/.pnpm/expect-type@1.2.2/node_modules/expect-type/dist/overloads.js +0 -13
  732. package/dist/node_modules/.pnpm/expect-type@1.2.2/node_modules/expect-type/dist/utils.js +0 -30
  733. package/dist/node_modules/.pnpm/js-tokens@9.0.1/node_modules/js-tokens/index.js +0 -398
  734. package/dist/node_modules/.pnpm/knex-mock-client@3.0.2_knex@3.1.0_mysql2@3.15.3_pg@8.16.3_sqlite3@5.1.7_tedious@18.6.1_/node_modules/knex-mock-client/dist/MockClient.js +0 -79
  735. package/dist/node_modules/.pnpm/knex-mock-client@3.0.2_knex@3.1.0_mysql2@3.15.3_pg@8.16.3_sqlite3@5.1.7_tedious@18.6.1_/node_modules/knex-mock-client/dist/MockConnection.js +0 -64
  736. package/dist/node_modules/.pnpm/knex-mock-client@3.0.2_knex@3.1.0_mysql2@3.15.3_pg@8.16.3_sqlite3@5.1.7_tedious@18.6.1_/node_modules/knex-mock-client/dist/Tracker.js +0 -185
  737. package/dist/node_modules/.pnpm/knex-mock-client@3.0.2_knex@3.1.0_mysql2@3.15.3_pg@8.16.3_sqlite3@5.1.7_tedious@18.6.1_/node_modules/knex-mock-client/dist/constants.js +0 -30
  738. package/dist/node_modules/.pnpm/knex-mock-client@3.0.2_knex@3.1.0_mysql2@3.15.3_pg@8.16.3_sqlite3@5.1.7_tedious@18.6.1_/node_modules/knex-mock-client/dist/index.js +0 -37
  739. package/dist/node_modules/.pnpm/knex-mock-client@3.0.2_knex@3.1.0_mysql2@3.15.3_pg@8.16.3_sqlite3@5.1.7_tedious@18.6.1_/node_modules/knex-mock-client/dist/utils.js +0 -17
  740. package/dist/node_modules/.pnpm/lodash.clonedeep@4.5.0/node_modules/lodash.clonedeep/index.js +0 -1486
  741. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/arguments.js +0 -11
  742. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/array.js +0 -18
  743. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/bigint.js +0 -11
  744. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/class.js +0 -19
  745. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/date.js +0 -15
  746. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/error.js +0 -39
  747. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/function.js +0 -14
  748. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/helpers.js +0 -141
  749. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/html.js +0 -43
  750. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/index.js +0 -138
  751. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/map.js +0 -25
  752. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/number.js +0 -22
  753. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/object.js +0 -27
  754. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/promise.js +0 -6
  755. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/regexp.js +0 -12
  756. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/set.js +0 -18
  757. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/string.js +0 -27
  758. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/symbol.js +0 -10
  759. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/typedarray.js +0 -36
  760. package/dist/node_modules/.pnpm/magic-string@0.30.21/node_modules/magic-string/dist/magic-string.es.js +0 -1258
  761. package/dist/node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/index.js +0 -21
  762. package/dist/node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.js +0 -478
  763. package/dist/node_modules/.pnpm/strip-literal@3.1.0/node_modules/strip-literal/dist/index.js +0 -84
  764. package/dist/node_modules/.pnpm/tinyrainbow@2.0.0/node_modules/tinyrainbow/dist/chunk-BVHSVHOK.js +0 -85
  765. package/dist/node_modules/.pnpm/tinyrainbow@2.0.0/node_modules/tinyrainbow/dist/node.js +0 -15
  766. package/dist/node_modules/.pnpm/tinyspy@4.0.4/node_modules/tinyspy/dist/index.js +0 -158
  767. package/dist/node_modules/.pnpm/vitest@3.2.4_@types_node@22.13.14_@vitest_ui@3.2.4_happy-dom@20.8.9_jiti@2.6.1_jsdom@20_c24d183060b6f93f55300b66d0779768/node_modules/vitest/dist/chunks/_commonjsHelpers.BFTU3MAI.js +0 -8
  768. package/dist/node_modules/.pnpm/vitest@3.2.4_@types_node@22.13.14_@vitest_ui@3.2.4_happy-dom@20.8.9_jiti@2.6.1_jsdom@20_c24d183060b6f93f55300b66d0779768/node_modules/vitest/dist/chunks/benchmark.CYdenmiT.js +0 -41
  769. package/dist/node_modules/.pnpm/vitest@3.2.4_@types_node@22.13.14_@vitest_ui@3.2.4_happy-dom@20.8.9_jiti@2.6.1_jsdom@20_c24d183060b6f93f55300b66d0779768/node_modules/vitest/dist/chunks/date.Bq6ZW5rf.js +0 -50
  770. package/dist/node_modules/.pnpm/vitest@3.2.4_@types_node@22.13.14_@vitest_ui@3.2.4_happy-dom@20.8.9_jiti@2.6.1_jsdom@20_c24d183060b6f93f55300b66d0779768/node_modules/vitest/dist/chunks/index.CdQS2e2Q.js +0 -38
  771. package/dist/node_modules/.pnpm/vitest@3.2.4_@types_node@22.13.14_@vitest_ui@3.2.4_happy-dom@20.8.9_jiti@2.6.1_jsdom@20_c24d183060b6f93f55300b66d0779768/node_modules/vitest/dist/chunks/utils.XdZDrNZV.js +0 -66
  772. package/dist/node_modules/.pnpm/vitest@3.2.4_@types_node@22.13.14_@vitest_ui@3.2.4_happy-dom@20.8.9_jiti@2.6.1_jsdom@20_c24d183060b6f93f55300b66d0779768/node_modules/vitest/dist/chunks/vi.bdSIJ99Y.js +0 -2986
  773. package/dist/node_modules/.pnpm/vitest@3.2.4_@types_node@22.13.14_@vitest_ui@3.2.4_happy-dom@20.8.9_jiti@2.6.1_jsdom@20_c24d183060b6f93f55300b66d0779768/node_modules/vitest/dist/index.js +0 -24
  774. package/dist/test-utils/cache.js +0 -64
  775. package/dist/test-utils/controllers.js +0 -101
  776. package/dist/test-utils/database.js +0 -54
  777. package/dist/test-utils/emitter.js +0 -38
  778. package/dist/test-utils/env.js +0 -77
  779. package/dist/test-utils/knex.js +0 -222
  780. package/dist/test-utils/schema.js +0 -35
  781. package/dist/test-utils/services/fields-service.js +0 -38
  782. package/dist/test-utils/services/files-service.js +0 -35
  783. package/dist/test-utils/services/folders-service.js +0 -34
  784. package/dist/test-utils/services/items-service.js +0 -52
  785. package/dist/test-utils/storage.js +0 -150
@@ -1,2082 +0,0 @@
1
- import { format, plugins } from "../../../../../@vitest_pretty-format@3.2.4/node_modules/@vitest/pretty-format/dist/index.js";
2
- import { resolve } from "../../../../../pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.js";
3
- import "../../../../../pathe@2.0.3/node_modules/pathe/dist/index.js";
4
-
5
- //#region ../node_modules/.pnpm/@vitest+snapshot@3.2.4/node_modules/@vitest/snapshot/dist/index.js
6
- const comma = ",".charCodeAt(0);
7
- const chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
8
- const intToChar = new Uint8Array(64);
9
- const charToInt = new Uint8Array(128);
10
- for (let i = 0; i < chars.length; i++) {
11
- const c = chars.charCodeAt(i);
12
- intToChar[i] = c;
13
- charToInt[c] = i;
14
- }
15
- function decodeInteger(reader, relative) {
16
- let value = 0;
17
- let shift = 0;
18
- let integer = 0;
19
- do {
20
- const c = reader.next();
21
- integer = charToInt[c];
22
- value |= (integer & 31) << shift;
23
- shift += 5;
24
- } while (integer & 32);
25
- const shouldNegate = value & 1;
26
- value >>>= 1;
27
- if (shouldNegate) {
28
- value = -2147483648 | -value;
29
- }
30
- return relative + value;
31
- }
32
- function hasMoreVlq(reader, max) {
33
- if (reader.pos >= max) return false;
34
- return reader.peek() !== comma;
35
- }
36
- var StringReader = class {
37
- constructor(buffer) {
38
- this.pos = 0;
39
- this.buffer = buffer;
40
- }
41
- next() {
42
- return this.buffer.charCodeAt(this.pos++);
43
- }
44
- peek() {
45
- return this.buffer.charCodeAt(this.pos);
46
- }
47
- indexOf(char) {
48
- const { buffer, pos } = this;
49
- const idx = buffer.indexOf(char, pos);
50
- return idx === -1 ? buffer.length : idx;
51
- }
52
- };
53
- function decode(mappings) {
54
- const { length } = mappings;
55
- const reader = new StringReader(mappings);
56
- const decoded = [];
57
- let genColumn = 0;
58
- let sourcesIndex = 0;
59
- let sourceLine = 0;
60
- let sourceColumn = 0;
61
- let namesIndex = 0;
62
- do {
63
- const semi = reader.indexOf(";");
64
- const line = [];
65
- let sorted = true;
66
- let lastCol = 0;
67
- genColumn = 0;
68
- while (reader.pos < semi) {
69
- let seg;
70
- genColumn = decodeInteger(reader, genColumn);
71
- if (genColumn < lastCol) sorted = false;
72
- lastCol = genColumn;
73
- if (hasMoreVlq(reader, semi)) {
74
- sourcesIndex = decodeInteger(reader, sourcesIndex);
75
- sourceLine = decodeInteger(reader, sourceLine);
76
- sourceColumn = decodeInteger(reader, sourceColumn);
77
- if (hasMoreVlq(reader, semi)) {
78
- namesIndex = decodeInteger(reader, namesIndex);
79
- seg = [
80
- genColumn,
81
- sourcesIndex,
82
- sourceLine,
83
- sourceColumn,
84
- namesIndex
85
- ];
86
- } else {
87
- seg = [
88
- genColumn,
89
- sourcesIndex,
90
- sourceLine,
91
- sourceColumn
92
- ];
93
- }
94
- } else {
95
- seg = [genColumn];
96
- }
97
- line.push(seg);
98
- reader.pos++;
99
- }
100
- if (!sorted) sort(line);
101
- decoded.push(line);
102
- reader.pos = semi + 1;
103
- } while (reader.pos <= length);
104
- return decoded;
105
- }
106
- function sort(line) {
107
- line.sort(sortComparator$1);
108
- }
109
- function sortComparator$1(a$1, b) {
110
- return a$1[0] - b[0];
111
- }
112
- const schemeRegex = /^[\w+.-]+:\/\//;
113
- /**
114
- * Matches the parts of a URL:
115
- * 1. Scheme, including ":", guaranteed.
116
- * 2. User/password, including "@", optional.
117
- * 3. Host, guaranteed.
118
- * 4. Port, including ":", optional.
119
- * 5. Path, including "/", optional.
120
- * 6. Query, including "?", optional.
121
- * 7. Hash, including "#", optional.
122
- */
123
- const urlRegex = /^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?(\?[^#]*)?(#.*)?/;
124
- /**
125
- * File URLs are weird. They dont' need the regular `//` in the scheme, they may or may not start
126
- * with a leading `/`, they can have a domain (but only if they don't start with a Windows drive).
127
- *
128
- * 1. Host, optional.
129
- * 2. Path, which may include "/", guaranteed.
130
- * 3. Query, including "?", optional.
131
- * 4. Hash, including "#", optional.
132
- */
133
- const fileRegex = /^file:(?:\/\/((?![a-z]:)[^/#?]*)?)?(\/?[^#?]*)(\?[^#]*)?(#.*)?/i;
134
- var UrlType;
135
- (function(UrlType$1) {
136
- UrlType$1[UrlType$1["Empty"] = 1] = "Empty";
137
- UrlType$1[UrlType$1["Hash"] = 2] = "Hash";
138
- UrlType$1[UrlType$1["Query"] = 3] = "Query";
139
- UrlType$1[UrlType$1["RelativePath"] = 4] = "RelativePath";
140
- UrlType$1[UrlType$1["AbsolutePath"] = 5] = "AbsolutePath";
141
- UrlType$1[UrlType$1["SchemeRelative"] = 6] = "SchemeRelative";
142
- UrlType$1[UrlType$1["Absolute"] = 7] = "Absolute";
143
- })(UrlType || (UrlType = {}));
144
- function isAbsoluteUrl(input) {
145
- return schemeRegex.test(input);
146
- }
147
- function isSchemeRelativeUrl(input) {
148
- return input.startsWith("//");
149
- }
150
- function isAbsolutePath(input) {
151
- return input.startsWith("/");
152
- }
153
- function isFileUrl(input) {
154
- return input.startsWith("file:");
155
- }
156
- function isRelative(input) {
157
- return /^[.?#]/.test(input);
158
- }
159
- function parseAbsoluteUrl(input) {
160
- const match = urlRegex.exec(input);
161
- return makeUrl(match[1], match[2] || "", match[3], match[4] || "", match[5] || "/", match[6] || "", match[7] || "");
162
- }
163
- function parseFileUrl(input) {
164
- const match = fileRegex.exec(input);
165
- const path = match[2];
166
- return makeUrl("file:", "", match[1] || "", "", isAbsolutePath(path) ? path : "/" + path, match[3] || "", match[4] || "");
167
- }
168
- function makeUrl(scheme, user, host, port, path, query, hash) {
169
- return {
170
- scheme,
171
- user,
172
- host,
173
- port,
174
- path,
175
- query,
176
- hash,
177
- type: UrlType.Absolute
178
- };
179
- }
180
- function parseUrl(input) {
181
- if (isSchemeRelativeUrl(input)) {
182
- const url$1 = parseAbsoluteUrl("http:" + input);
183
- url$1.scheme = "";
184
- url$1.type = UrlType.SchemeRelative;
185
- return url$1;
186
- }
187
- if (isAbsolutePath(input)) {
188
- const url$1 = parseAbsoluteUrl("http://foo.com" + input);
189
- url$1.scheme = "";
190
- url$1.host = "";
191
- url$1.type = UrlType.AbsolutePath;
192
- return url$1;
193
- }
194
- if (isFileUrl(input)) return parseFileUrl(input);
195
- if (isAbsoluteUrl(input)) return parseAbsoluteUrl(input);
196
- const url = parseAbsoluteUrl("http://foo.com/" + input);
197
- url.scheme = "";
198
- url.host = "";
199
- url.type = input ? input.startsWith("?") ? UrlType.Query : input.startsWith("#") ? UrlType.Hash : UrlType.RelativePath : UrlType.Empty;
200
- return url;
201
- }
202
- function stripPathFilename(path) {
203
- if (path.endsWith("/..")) return path;
204
- const index = path.lastIndexOf("/");
205
- return path.slice(0, index + 1);
206
- }
207
- function mergePaths(url, base) {
208
- normalizePath(base, base.type);
209
- if (url.path === "/") {
210
- url.path = base.path;
211
- } else {
212
- url.path = stripPathFilename(base.path) + url.path;
213
- }
214
- }
215
- /**
216
- * The path can have empty directories "//", unneeded parents "foo/..", or current directory
217
- * "foo/.". We need to normalize to a standard representation.
218
- */
219
- function normalizePath(url, type) {
220
- const rel = type <= UrlType.RelativePath;
221
- const pieces = url.path.split("/");
222
- let pointer = 1;
223
- let positive = 0;
224
- let addTrailingSlash = false;
225
- for (let i = 1; i < pieces.length; i++) {
226
- const piece = pieces[i];
227
- if (!piece) {
228
- addTrailingSlash = true;
229
- continue;
230
- }
231
- addTrailingSlash = false;
232
- if (piece === ".") continue;
233
- if (piece === "..") {
234
- if (positive) {
235
- addTrailingSlash = true;
236
- positive--;
237
- pointer--;
238
- } else if (rel) {
239
- pieces[pointer++] = piece;
240
- }
241
- continue;
242
- }
243
- pieces[pointer++] = piece;
244
- positive++;
245
- }
246
- let path = "";
247
- for (let i = 1; i < pointer; i++) {
248
- path += "/" + pieces[i];
249
- }
250
- if (!path || addTrailingSlash && !path.endsWith("/..")) {
251
- path += "/";
252
- }
253
- url.path = path;
254
- }
255
- /**
256
- * Attempts to resolve `input` URL/path relative to `base`.
257
- */
258
- function resolve$1(input, base) {
259
- if (!input && !base) return "";
260
- const url = parseUrl(input);
261
- let inputType = url.type;
262
- if (base && inputType !== UrlType.Absolute) {
263
- const baseUrl = parseUrl(base);
264
- const baseType = baseUrl.type;
265
- switch (inputType) {
266
- case UrlType.Empty: url.hash = baseUrl.hash;
267
- case UrlType.Hash: url.query = baseUrl.query;
268
- case UrlType.Query:
269
- case UrlType.RelativePath: mergePaths(url, baseUrl);
270
- case UrlType.AbsolutePath:
271
- url.user = baseUrl.user;
272
- url.host = baseUrl.host;
273
- url.port = baseUrl.port;
274
- case UrlType.SchemeRelative: url.scheme = baseUrl.scheme;
275
- }
276
- if (baseType > inputType) inputType = baseType;
277
- }
278
- normalizePath(url, inputType);
279
- const queryHash = url.query + url.hash;
280
- switch (inputType) {
281
- case UrlType.Hash:
282
- case UrlType.Query: return queryHash;
283
- case UrlType.RelativePath: {
284
- const path = url.path.slice(1);
285
- if (!path) return queryHash || ".";
286
- if (isRelative(base || input) && !isRelative(path)) {
287
- return "./" + path + queryHash;
288
- }
289
- return path + queryHash;
290
- }
291
- case UrlType.AbsolutePath: return url.path + queryHash;
292
- default: return url.scheme + "//" + url.user + url.host + url.port + url.path + queryHash;
293
- }
294
- }
295
- function resolve$2(input, base) {
296
- if (base && !base.endsWith("/")) base += "/";
297
- return resolve$1(input, base);
298
- }
299
- /**
300
- * Removes everything after the last "/", but leaves the slash.
301
- */
302
- function stripFilename(path) {
303
- if (!path) return "";
304
- const index = path.lastIndexOf("/");
305
- return path.slice(0, index + 1);
306
- }
307
- const COLUMN = 0;
308
- const SOURCES_INDEX = 1;
309
- const SOURCE_LINE = 2;
310
- const SOURCE_COLUMN = 3;
311
- const NAMES_INDEX = 4;
312
- function maybeSort(mappings, owned) {
313
- const unsortedIndex = nextUnsortedSegmentLine(mappings, 0);
314
- if (unsortedIndex === mappings.length) return mappings;
315
- if (!owned) mappings = mappings.slice();
316
- for (let i = unsortedIndex; i < mappings.length; i = nextUnsortedSegmentLine(mappings, i + 1)) {
317
- mappings[i] = sortSegments(mappings[i], owned);
318
- }
319
- return mappings;
320
- }
321
- function nextUnsortedSegmentLine(mappings, start) {
322
- for (let i = start; i < mappings.length; i++) {
323
- if (!isSorted(mappings[i])) return i;
324
- }
325
- return mappings.length;
326
- }
327
- function isSorted(line) {
328
- for (let j = 1; j < line.length; j++) {
329
- if (line[j][COLUMN] < line[j - 1][COLUMN]) {
330
- return false;
331
- }
332
- }
333
- return true;
334
- }
335
- function sortSegments(line, owned) {
336
- if (!owned) line = line.slice();
337
- return line.sort(sortComparator);
338
- }
339
- function sortComparator(a$1, b) {
340
- return a$1[COLUMN] - b[COLUMN];
341
- }
342
- let found = false;
343
- /**
344
- * A binary search implementation that returns the index if a match is found.
345
- * If no match is found, then the left-index (the index associated with the item that comes just
346
- * before the desired index) is returned. To maintain proper sort order, a splice would happen at
347
- * the next index:
348
- *
349
- * ```js
350
- * const array = [1, 3];
351
- * const needle = 2;
352
- * const index = binarySearch(array, needle, (item, needle) => item - needle);
353
- *
354
- * assert.equal(index, 0);
355
- * array.splice(index + 1, 0, needle);
356
- * assert.deepEqual(array, [1, 2, 3]);
357
- * ```
358
- */
359
- function binarySearch(haystack, needle, low, high) {
360
- while (low <= high) {
361
- const mid = low + (high - low >> 1);
362
- const cmp = haystack[mid][COLUMN] - needle;
363
- if (cmp === 0) {
364
- found = true;
365
- return mid;
366
- }
367
- if (cmp < 0) {
368
- low = mid + 1;
369
- } else {
370
- high = mid - 1;
371
- }
372
- }
373
- found = false;
374
- return low - 1;
375
- }
376
- function upperBound(haystack, needle, index) {
377
- for (let i = index + 1; i < haystack.length; index = i++) {
378
- if (haystack[i][COLUMN] !== needle) break;
379
- }
380
- return index;
381
- }
382
- function lowerBound(haystack, needle, index) {
383
- for (let i = index - 1; i >= 0; index = i--) {
384
- if (haystack[i][COLUMN] !== needle) break;
385
- }
386
- return index;
387
- }
388
- function memoizedState() {
389
- return {
390
- lastKey: -1,
391
- lastNeedle: -1,
392
- lastIndex: -1
393
- };
394
- }
395
- /**
396
- * This overly complicated beast is just to record the last tested line/column and the resulting
397
- * index, allowing us to skip a few tests if mappings are monotonically increasing.
398
- */
399
- function memoizedBinarySearch(haystack, needle, state, key) {
400
- const { lastKey, lastNeedle, lastIndex } = state;
401
- let low = 0;
402
- let high = haystack.length - 1;
403
- if (key === lastKey) {
404
- if (needle === lastNeedle) {
405
- found = lastIndex !== -1 && haystack[lastIndex][COLUMN] === needle;
406
- return lastIndex;
407
- }
408
- if (needle >= lastNeedle) {
409
- low = lastIndex === -1 ? 0 : lastIndex;
410
- } else {
411
- high = lastIndex;
412
- }
413
- }
414
- state.lastKey = key;
415
- state.lastNeedle = needle;
416
- return state.lastIndex = binarySearch(haystack, needle, low, high);
417
- }
418
- const LINE_GTR_ZERO = "`line` must be greater than 0 (lines start at line 1)";
419
- const COL_GTR_EQ_ZERO = "`column` must be greater than or equal to 0 (columns start at column 0)";
420
- const LEAST_UPPER_BOUND = -1;
421
- const GREATEST_LOWER_BOUND = 1;
422
- var TraceMap = class {
423
- constructor(map, mapUrl) {
424
- const isString = typeof map === "string";
425
- if (!isString && map._decodedMemo) return map;
426
- const parsed = isString ? JSON.parse(map) : map;
427
- const { version, file, names, sourceRoot, sources, sourcesContent } = parsed;
428
- this.version = version;
429
- this.file = file;
430
- this.names = names || [];
431
- this.sourceRoot = sourceRoot;
432
- this.sources = sources;
433
- this.sourcesContent = sourcesContent;
434
- this.ignoreList = parsed.ignoreList || parsed.x_google_ignoreList || undefined;
435
- const from = resolve$2(sourceRoot || "", stripFilename(mapUrl));
436
- this.resolvedSources = sources.map((s) => resolve$2(s || "", from));
437
- const { mappings } = parsed;
438
- if (typeof mappings === "string") {
439
- this._encoded = mappings;
440
- this._decoded = undefined;
441
- } else {
442
- this._encoded = undefined;
443
- this._decoded = maybeSort(mappings, isString);
444
- }
445
- this._decodedMemo = memoizedState();
446
- this._bySources = undefined;
447
- this._bySourceMemos = undefined;
448
- }
449
- };
450
- /**
451
- * Typescript doesn't allow friend access to private fields, so this just casts the map into a type
452
- * with public access modifiers.
453
- */
454
- function cast(map) {
455
- return map;
456
- }
457
- /**
458
- * Returns the decoded (array of lines of segments) form of the SourceMap's mappings field.
459
- */
460
- function decodedMappings(map) {
461
- var _a;
462
- return (_a = cast(map))._decoded || (_a._decoded = decode(cast(map)._encoded));
463
- }
464
- /**
465
- * A higher-level API to find the source/line/column associated with a generated line/column
466
- * (think, from a stack trace). Line is 1-based, but column is 0-based, due to legacy behavior in
467
- * `source-map` library.
468
- */
469
- function originalPositionFor(map, needle) {
470
- let { line, column, bias } = needle;
471
- line--;
472
- if (line < 0) throw new Error(LINE_GTR_ZERO);
473
- if (column < 0) throw new Error(COL_GTR_EQ_ZERO);
474
- const decoded = decodedMappings(map);
475
- if (line >= decoded.length) return OMapping(null, null, null, null);
476
- const segments = decoded[line];
477
- const index = traceSegmentInternal(segments, cast(map)._decodedMemo, line, column, bias || GREATEST_LOWER_BOUND);
478
- if (index === -1) return OMapping(null, null, null, null);
479
- const segment = segments[index];
480
- if (segment.length === 1) return OMapping(null, null, null, null);
481
- const { names, resolvedSources } = map;
482
- return OMapping(resolvedSources[segment[SOURCES_INDEX]], segment[SOURCE_LINE] + 1, segment[SOURCE_COLUMN], segment.length === 5 ? names[segment[NAMES_INDEX]] : null);
483
- }
484
- function OMapping(source, line, column, name) {
485
- return {
486
- source,
487
- line,
488
- column,
489
- name
490
- };
491
- }
492
- function traceSegmentInternal(segments, memo, line, column, bias) {
493
- let index = memoizedBinarySearch(segments, column, memo, line);
494
- if (found) {
495
- index = (bias === LEAST_UPPER_BOUND ? upperBound : lowerBound)(segments, column, index);
496
- } else if (bias === LEAST_UPPER_BOUND) index++;
497
- if (index === -1 || index === segments.length) return -1;
498
- return index;
499
- }
500
- /**
501
- * Get original stacktrace without source map support the most performant way.
502
- * - Create only 1 stack frame.
503
- * - Rewrite prepareStackTrace to bypass "support-stack-trace" (usually takes ~250ms).
504
- */
505
- function notNullish(v) {
506
- return v != null;
507
- }
508
- function isPrimitive(value) {
509
- return value === null || typeof value !== "function" && typeof value !== "object";
510
- }
511
- function isObject(item) {
512
- return item != null && typeof item === "object" && !Array.isArray(item);
513
- }
514
- /**
515
- * If code starts with a function call, will return its last index, respecting arguments.
516
- * This will return 25 - last ending character of toMatch ")"
517
- * Also works with callbacks
518
- * ```
519
- * toMatch({ test: '123' });
520
- * toBeAliased('123')
521
- * ```
522
- */
523
- function getCallLastIndex(code) {
524
- let charIndex = -1;
525
- let inString = null;
526
- let startedBracers = 0;
527
- let endedBracers = 0;
528
- let beforeChar = null;
529
- while (charIndex <= code.length) {
530
- beforeChar = code[charIndex];
531
- charIndex++;
532
- const char = code[charIndex];
533
- const isCharString = char === "\"" || char === "'" || char === "`";
534
- if (isCharString && beforeChar !== "\\") {
535
- if (inString === char) {
536
- inString = null;
537
- } else if (!inString) {
538
- inString = char;
539
- }
540
- }
541
- if (!inString) {
542
- if (char === "(") {
543
- startedBracers++;
544
- }
545
- if (char === ")") {
546
- endedBracers++;
547
- }
548
- }
549
- if (startedBracers && endedBracers && startedBracers === endedBracers) {
550
- return charIndex;
551
- }
552
- }
553
- return null;
554
- }
555
- const CHROME_IE_STACK_REGEXP = /^\s*at .*(?:\S:\d+|\(native\))/m;
556
- const SAFARI_NATIVE_CODE_REGEXP = /^(?:eval@)?(?:\[native code\])?$/;
557
- const stackIgnorePatterns = [
558
- "node:internal",
559
- /\/packages\/\w+\/dist\//,
560
- /\/@vitest\/\w+\/dist\//,
561
- "/vitest/dist/",
562
- "/vitest/src/",
563
- "/vite-node/dist/",
564
- "/vite-node/src/",
565
- "/node_modules/chai/",
566
- "/node_modules/tinypool/",
567
- "/node_modules/tinyspy/",
568
- "/deps/chunk-",
569
- "/deps/@vitest",
570
- "/deps/loupe",
571
- "/deps/chai",
572
- /node:\w+/,
573
- /__vitest_test__/,
574
- /__vitest_browser__/,
575
- /\/deps\/vitest_/
576
- ];
577
- function extractLocation(urlLike) {
578
- if (!urlLike.includes(":")) {
579
- return [urlLike];
580
- }
581
- const regExp = /(.+?)(?::(\d+))?(?::(\d+))?$/;
582
- const parts = regExp.exec(urlLike.replace(/^\(|\)$/g, ""));
583
- if (!parts) {
584
- return [urlLike];
585
- }
586
- let url = parts[1];
587
- if (url.startsWith("async ")) {
588
- url = url.slice(6);
589
- }
590
- if (url.startsWith("http:") || url.startsWith("https:")) {
591
- const urlObj = new URL(url);
592
- urlObj.searchParams.delete("import");
593
- urlObj.searchParams.delete("browserv");
594
- url = urlObj.pathname + urlObj.hash + urlObj.search;
595
- }
596
- if (url.startsWith("/@fs/")) {
597
- const isWindows = /^\/@fs\/[a-zA-Z]:\//.test(url);
598
- url = url.slice(isWindows ? 5 : 4);
599
- }
600
- return [
601
- url,
602
- parts[2] || undefined,
603
- parts[3] || undefined
604
- ];
605
- }
606
- function parseSingleFFOrSafariStack(raw) {
607
- let line = raw.trim();
608
- if (SAFARI_NATIVE_CODE_REGEXP.test(line)) {
609
- return null;
610
- }
611
- if (line.includes(" > eval")) {
612
- line = line.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g, ":$1");
613
- }
614
- if (!line.includes("@") && !line.includes(":")) {
615
- return null;
616
- }
617
- const functionNameRegex = /((.*".+"[^@]*)?[^@]*)(@)/;
618
- const matches = line.match(functionNameRegex);
619
- const functionName = matches && matches[1] ? matches[1] : undefined;
620
- const [url, lineNumber, columnNumber] = extractLocation(line.replace(functionNameRegex, ""));
621
- if (!url || !lineNumber || !columnNumber) {
622
- return null;
623
- }
624
- return {
625
- file: url,
626
- method: functionName || "",
627
- line: Number.parseInt(lineNumber),
628
- column: Number.parseInt(columnNumber)
629
- };
630
- }
631
- function parseSingleV8Stack(raw) {
632
- let line = raw.trim();
633
- if (!CHROME_IE_STACK_REGEXP.test(line)) {
634
- return null;
635
- }
636
- if (line.includes("(eval ")) {
637
- line = line.replace(/eval code/g, "eval").replace(/(\(eval at [^()]*)|(,.*$)/g, "");
638
- }
639
- let sanitizedLine = line.replace(/^\s+/, "").replace(/\(eval code/g, "(").replace(/^.*?\s+/, "");
640
- const location = sanitizedLine.match(/ (\(.+\)$)/);
641
- sanitizedLine = location ? sanitizedLine.replace(location[0], "") : sanitizedLine;
642
- const [url, lineNumber, columnNumber] = extractLocation(location ? location[1] : sanitizedLine);
643
- let method = location && sanitizedLine || "";
644
- let file = url && ["eval", "<anonymous>"].includes(url) ? undefined : url;
645
- if (!file || !lineNumber || !columnNumber) {
646
- return null;
647
- }
648
- if (method.startsWith("async ")) {
649
- method = method.slice(6);
650
- }
651
- if (file.startsWith("file://")) {
652
- file = file.slice(7);
653
- }
654
- file = file.startsWith("node:") || file.startsWith("internal:") ? file : resolve(file);
655
- if (method) {
656
- method = method.replace(/__vite_ssr_import_\d+__\./g, "");
657
- }
658
- return {
659
- method,
660
- file,
661
- line: Number.parseInt(lineNumber),
662
- column: Number.parseInt(columnNumber)
663
- };
664
- }
665
- function parseStacktrace(stack, options = {}) {
666
- const { ignoreStackEntries = stackIgnorePatterns } = options;
667
- const stacks = !CHROME_IE_STACK_REGEXP.test(stack) ? parseFFOrSafariStackTrace(stack) : parseV8Stacktrace(stack);
668
- return stacks.map((stack$1) => {
669
- var _options$getSourceMap;
670
- if (options.getUrlId) {
671
- stack$1.file = options.getUrlId(stack$1.file);
672
- }
673
- const map = (_options$getSourceMap = options.getSourceMap) === null || _options$getSourceMap === void 0 ? void 0 : _options$getSourceMap.call(options, stack$1.file);
674
- if (!map || typeof map !== "object" || !map.version) {
675
- return shouldFilter(ignoreStackEntries, stack$1.file) ? null : stack$1;
676
- }
677
- const traceMap = new TraceMap(map);
678
- const { line, column, source, name } = originalPositionFor(traceMap, stack$1);
679
- let file = stack$1.file;
680
- if (source) {
681
- const fileUrl = stack$1.file.startsWith("file://") ? stack$1.file : `file://${stack$1.file}`;
682
- const sourceRootUrl = map.sourceRoot ? new URL(map.sourceRoot, fileUrl) : fileUrl;
683
- file = new URL(source, sourceRootUrl).pathname;
684
- if (file.match(/\/\w:\//)) {
685
- file = file.slice(1);
686
- }
687
- }
688
- if (shouldFilter(ignoreStackEntries, file)) {
689
- return null;
690
- }
691
- if (line != null && column != null) {
692
- return {
693
- line,
694
- column,
695
- file,
696
- method: name || stack$1.method
697
- };
698
- }
699
- return stack$1;
700
- }).filter((s) => s != null);
701
- }
702
- function shouldFilter(ignoreStackEntries, file) {
703
- return ignoreStackEntries.some((p$1) => file.match(p$1));
704
- }
705
- function parseFFOrSafariStackTrace(stack) {
706
- return stack.split("\n").map((line) => parseSingleFFOrSafariStack(line)).filter(notNullish);
707
- }
708
- function parseV8Stacktrace(stack) {
709
- return stack.split("\n").map((line) => parseSingleV8Stack(line)).filter(notNullish);
710
- }
711
- function parseErrorStacktrace(e, options = {}) {
712
- if (!e || isPrimitive(e)) {
713
- return [];
714
- }
715
- if (e.stacks) {
716
- return e.stacks;
717
- }
718
- const stackStr = e.stack || "";
719
- let stackFrames = typeof stackStr === "string" ? parseStacktrace(stackStr, options) : [];
720
- if (!stackFrames.length) {
721
- const e_ = e;
722
- if (e_.fileName != null && e_.lineNumber != null && e_.columnNumber != null) {
723
- stackFrames = parseStacktrace(`${e_.fileName}:${e_.lineNumber}:${e_.columnNumber}`, options);
724
- }
725
- if (e_.sourceURL != null && e_.line != null && e_._column != null) {
726
- stackFrames = parseStacktrace(`${e_.sourceURL}:${e_.line}:${e_.column}`, options);
727
- }
728
- }
729
- if (options.frameFilter) {
730
- stackFrames = stackFrames.filter((f$1) => options.frameFilter(e, f$1) !== false);
731
- }
732
- e.stacks = stackFrames;
733
- return stackFrames;
734
- }
735
- let getPromiseValue = () => "Promise{…}";
736
- try {
737
- const { getPromiseDetails, kPending, kRejected } = process.binding("util");
738
- if (Array.isArray(getPromiseDetails(Promise.resolve()))) {
739
- getPromiseValue = (value, options) => {
740
- const [state, innerValue] = getPromiseDetails(value);
741
- if (state === kPending) {
742
- return "Promise{<pending>}";
743
- }
744
- return `Promise${state === kRejected ? "!" : ""}{${options.inspect(innerValue, options)}}`;
745
- };
746
- }
747
- } catch (notNode) {}
748
- const { AsymmetricMatcher: AsymmetricMatcher$1, DOMCollection: DOMCollection$1, DOMElement: DOMElement$1, Immutable: Immutable$1, ReactElement: ReactElement$1, ReactTestComponent: ReactTestComponent$1 } = plugins;
749
- function getDefaultExportFromCjs(x) {
750
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
751
- }
752
- var jsTokens_1;
753
- var hasRequiredJsTokens;
754
- function requireJsTokens() {
755
- if (hasRequiredJsTokens) return jsTokens_1;
756
- hasRequiredJsTokens = 1;
757
- var Identifier, JSXIdentifier, JSXPunctuator, JSXString, JSXText, KeywordsWithExpressionAfter, KeywordsWithNoLineTerminatorAfter, LineTerminatorSequence, MultiLineComment, Newline, NumericLiteral, Punctuator, RegularExpressionLiteral, SingleLineComment, StringLiteral, Template, TokensNotPrecedingObjectLiteral, TokensPrecedingExpression, WhiteSpace;
758
- RegularExpressionLiteral = /\/(?![*\/])(?:\[(?:(?![\]\\]).|\\.)*\]|(?![\/\\]).|\\.)*(\/[$_\u200C\u200D\p{ID_Continue}]*|\\)?/uy;
759
- Punctuator = /--|\+\+|=>|\.{3}|\??\.(?!\d)|(?:&&|\|\||\?\?|[+\-%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2}|\/(?![\/*]))=?|[?~,:;[\](){}]/y;
760
- Identifier = /(\x23?)(?=[$_\p{ID_Start}\\])(?:[$_\u200C\u200D\p{ID_Continue}]|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+/uy;
761
- StringLiteral = /(['"])(?:(?!\1)[^\\\n\r]|\\(?:\r\n|[^]))*(\1)?/y;
762
- NumericLiteral = /(?:0[xX][\da-fA-F](?:_?[\da-fA-F])*|0[oO][0-7](?:_?[0-7])*|0[bB][01](?:_?[01])*)n?|0n|[1-9](?:_?\d)*n|(?:(?:0(?!\d)|0\d*[89]\d*|[1-9](?:_?\d)*)(?:\.(?:\d(?:_?\d)*)?)?|\.\d(?:_?\d)*)(?:[eE][+-]?\d(?:_?\d)*)?|0[0-7]+/y;
763
- Template = /[`}](?:[^`\\$]|\\[^]|\$(?!\{))*(`|\$\{)?/y;
764
- WhiteSpace = /[\t\v\f\ufeff\p{Zs}]+/uy;
765
- LineTerminatorSequence = /\r?\n|[\r\u2028\u2029]/y;
766
- MultiLineComment = /\/\*(?:[^*]|\*(?!\/))*(\*\/)?/y;
767
- SingleLineComment = /\/\/.*/y;
768
- JSXPunctuator = /[<>.:={}]|\/(?![\/*])/y;
769
- JSXIdentifier = /[$_\p{ID_Start}][$_\u200C\u200D\p{ID_Continue}-]*/uy;
770
- JSXString = /(['"])(?:(?!\1)[^])*(\1)?/y;
771
- JSXText = /[^<>{}]+/y;
772
- TokensPrecedingExpression = /^(?:[\/+-]|\.{3}|\?(?:InterpolationIn(?:JSX|Template)|NoLineTerminatorHere|NonExpressionParenEnd|UnaryIncDec))?$|[{}([,;<>=*%&|^!~?:]$/;
773
- TokensNotPrecedingObjectLiteral = /^(?:=>|[;\]){}]|else|\?(?:NoLineTerminatorHere|NonExpressionParenEnd))?$/;
774
- KeywordsWithExpressionAfter = /^(?:await|case|default|delete|do|else|instanceof|new|return|throw|typeof|void|yield)$/;
775
- KeywordsWithNoLineTerminatorAfter = /^(?:return|throw|yield)$/;
776
- Newline = RegExp(LineTerminatorSequence.source);
777
- jsTokens_1 = function* (input, { jsx = false } = {}) {
778
- var braces, firstCodePoint, isExpression, lastIndex, lastSignificantToken, length, match, mode, nextLastIndex, nextLastSignificantToken, parenNesting, postfixIncDec, punctuator, stack;
779
- ({length} = input);
780
- lastIndex = 0;
781
- lastSignificantToken = "";
782
- stack = [{ tag: "JS" }];
783
- braces = [];
784
- parenNesting = 0;
785
- postfixIncDec = false;
786
- while (lastIndex < length) {
787
- mode = stack[stack.length - 1];
788
- switch (mode.tag) {
789
- case "JS":
790
- case "JSNonExpressionParen":
791
- case "InterpolationInTemplate":
792
- case "InterpolationInJSX":
793
- if (input[lastIndex] === "/" && (TokensPrecedingExpression.test(lastSignificantToken) || KeywordsWithExpressionAfter.test(lastSignificantToken))) {
794
- RegularExpressionLiteral.lastIndex = lastIndex;
795
- if (match = RegularExpressionLiteral.exec(input)) {
796
- lastIndex = RegularExpressionLiteral.lastIndex;
797
- lastSignificantToken = match[0];
798
- postfixIncDec = true;
799
- yield {
800
- type: "RegularExpressionLiteral",
801
- value: match[0],
802
- closed: match[1] !== void 0 && match[1] !== "\\"
803
- };
804
- continue;
805
- }
806
- }
807
- Punctuator.lastIndex = lastIndex;
808
- if (match = Punctuator.exec(input)) {
809
- punctuator = match[0];
810
- nextLastIndex = Punctuator.lastIndex;
811
- nextLastSignificantToken = punctuator;
812
- switch (punctuator) {
813
- case "(":
814
- if (lastSignificantToken === "?NonExpressionParenKeyword") {
815
- stack.push({
816
- tag: "JSNonExpressionParen",
817
- nesting: parenNesting
818
- });
819
- }
820
- parenNesting++;
821
- postfixIncDec = false;
822
- break;
823
- case ")":
824
- parenNesting--;
825
- postfixIncDec = true;
826
- if (mode.tag === "JSNonExpressionParen" && parenNesting === mode.nesting) {
827
- stack.pop();
828
- nextLastSignificantToken = "?NonExpressionParenEnd";
829
- postfixIncDec = false;
830
- }
831
- break;
832
- case "{":
833
- Punctuator.lastIndex = 0;
834
- isExpression = !TokensNotPrecedingObjectLiteral.test(lastSignificantToken) && (TokensPrecedingExpression.test(lastSignificantToken) || KeywordsWithExpressionAfter.test(lastSignificantToken));
835
- braces.push(isExpression);
836
- postfixIncDec = false;
837
- break;
838
- case "}":
839
- switch (mode.tag) {
840
- case "InterpolationInTemplate":
841
- if (braces.length === mode.nesting) {
842
- Template.lastIndex = lastIndex;
843
- match = Template.exec(input);
844
- lastIndex = Template.lastIndex;
845
- lastSignificantToken = match[0];
846
- if (match[1] === "${") {
847
- lastSignificantToken = "?InterpolationInTemplate";
848
- postfixIncDec = false;
849
- yield {
850
- type: "TemplateMiddle",
851
- value: match[0]
852
- };
853
- } else {
854
- stack.pop();
855
- postfixIncDec = true;
856
- yield {
857
- type: "TemplateTail",
858
- value: match[0],
859
- closed: match[1] === "`"
860
- };
861
- }
862
- continue;
863
- }
864
- break;
865
- case "InterpolationInJSX": if (braces.length === mode.nesting) {
866
- stack.pop();
867
- lastIndex += 1;
868
- lastSignificantToken = "}";
869
- yield {
870
- type: "JSXPunctuator",
871
- value: "}"
872
- };
873
- continue;
874
- }
875
- }
876
- postfixIncDec = braces.pop();
877
- nextLastSignificantToken = postfixIncDec ? "?ExpressionBraceEnd" : "}";
878
- break;
879
- case "]":
880
- postfixIncDec = true;
881
- break;
882
- case "++":
883
- case "--":
884
- nextLastSignificantToken = postfixIncDec ? "?PostfixIncDec" : "?UnaryIncDec";
885
- break;
886
- case "<":
887
- if (jsx && (TokensPrecedingExpression.test(lastSignificantToken) || KeywordsWithExpressionAfter.test(lastSignificantToken))) {
888
- stack.push({ tag: "JSXTag" });
889
- lastIndex += 1;
890
- lastSignificantToken = "<";
891
- yield {
892
- type: "JSXPunctuator",
893
- value: punctuator
894
- };
895
- continue;
896
- }
897
- postfixIncDec = false;
898
- break;
899
- default: postfixIncDec = false;
900
- }
901
- lastIndex = nextLastIndex;
902
- lastSignificantToken = nextLastSignificantToken;
903
- yield {
904
- type: "Punctuator",
905
- value: punctuator
906
- };
907
- continue;
908
- }
909
- Identifier.lastIndex = lastIndex;
910
- if (match = Identifier.exec(input)) {
911
- lastIndex = Identifier.lastIndex;
912
- nextLastSignificantToken = match[0];
913
- switch (match[0]) {
914
- case "for":
915
- case "if":
916
- case "while":
917
- case "with": if (lastSignificantToken !== "." && lastSignificantToken !== "?.") {
918
- nextLastSignificantToken = "?NonExpressionParenKeyword";
919
- }
920
- }
921
- lastSignificantToken = nextLastSignificantToken;
922
- postfixIncDec = !KeywordsWithExpressionAfter.test(match[0]);
923
- yield {
924
- type: match[1] === "#" ? "PrivateIdentifier" : "IdentifierName",
925
- value: match[0]
926
- };
927
- continue;
928
- }
929
- StringLiteral.lastIndex = lastIndex;
930
- if (match = StringLiteral.exec(input)) {
931
- lastIndex = StringLiteral.lastIndex;
932
- lastSignificantToken = match[0];
933
- postfixIncDec = true;
934
- yield {
935
- type: "StringLiteral",
936
- value: match[0],
937
- closed: match[2] !== void 0
938
- };
939
- continue;
940
- }
941
- NumericLiteral.lastIndex = lastIndex;
942
- if (match = NumericLiteral.exec(input)) {
943
- lastIndex = NumericLiteral.lastIndex;
944
- lastSignificantToken = match[0];
945
- postfixIncDec = true;
946
- yield {
947
- type: "NumericLiteral",
948
- value: match[0]
949
- };
950
- continue;
951
- }
952
- Template.lastIndex = lastIndex;
953
- if (match = Template.exec(input)) {
954
- lastIndex = Template.lastIndex;
955
- lastSignificantToken = match[0];
956
- if (match[1] === "${") {
957
- lastSignificantToken = "?InterpolationInTemplate";
958
- stack.push({
959
- tag: "InterpolationInTemplate",
960
- nesting: braces.length
961
- });
962
- postfixIncDec = false;
963
- yield {
964
- type: "TemplateHead",
965
- value: match[0]
966
- };
967
- } else {
968
- postfixIncDec = true;
969
- yield {
970
- type: "NoSubstitutionTemplate",
971
- value: match[0],
972
- closed: match[1] === "`"
973
- };
974
- }
975
- continue;
976
- }
977
- break;
978
- case "JSXTag":
979
- case "JSXTagEnd":
980
- JSXPunctuator.lastIndex = lastIndex;
981
- if (match = JSXPunctuator.exec(input)) {
982
- lastIndex = JSXPunctuator.lastIndex;
983
- nextLastSignificantToken = match[0];
984
- switch (match[0]) {
985
- case "<":
986
- stack.push({ tag: "JSXTag" });
987
- break;
988
- case ">":
989
- stack.pop();
990
- if (lastSignificantToken === "/" || mode.tag === "JSXTagEnd") {
991
- nextLastSignificantToken = "?JSX";
992
- postfixIncDec = true;
993
- } else {
994
- stack.push({ tag: "JSXChildren" });
995
- }
996
- break;
997
- case "{":
998
- stack.push({
999
- tag: "InterpolationInJSX",
1000
- nesting: braces.length
1001
- });
1002
- nextLastSignificantToken = "?InterpolationInJSX";
1003
- postfixIncDec = false;
1004
- break;
1005
- case "/": if (lastSignificantToken === "<") {
1006
- stack.pop();
1007
- if (stack[stack.length - 1].tag === "JSXChildren") {
1008
- stack.pop();
1009
- }
1010
- stack.push({ tag: "JSXTagEnd" });
1011
- }
1012
- }
1013
- lastSignificantToken = nextLastSignificantToken;
1014
- yield {
1015
- type: "JSXPunctuator",
1016
- value: match[0]
1017
- };
1018
- continue;
1019
- }
1020
- JSXIdentifier.lastIndex = lastIndex;
1021
- if (match = JSXIdentifier.exec(input)) {
1022
- lastIndex = JSXIdentifier.lastIndex;
1023
- lastSignificantToken = match[0];
1024
- yield {
1025
- type: "JSXIdentifier",
1026
- value: match[0]
1027
- };
1028
- continue;
1029
- }
1030
- JSXString.lastIndex = lastIndex;
1031
- if (match = JSXString.exec(input)) {
1032
- lastIndex = JSXString.lastIndex;
1033
- lastSignificantToken = match[0];
1034
- yield {
1035
- type: "JSXString",
1036
- value: match[0],
1037
- closed: match[2] !== void 0
1038
- };
1039
- continue;
1040
- }
1041
- break;
1042
- case "JSXChildren":
1043
- JSXText.lastIndex = lastIndex;
1044
- if (match = JSXText.exec(input)) {
1045
- lastIndex = JSXText.lastIndex;
1046
- lastSignificantToken = match[0];
1047
- yield {
1048
- type: "JSXText",
1049
- value: match[0]
1050
- };
1051
- continue;
1052
- }
1053
- switch (input[lastIndex]) {
1054
- case "<":
1055
- stack.push({ tag: "JSXTag" });
1056
- lastIndex++;
1057
- lastSignificantToken = "<";
1058
- yield {
1059
- type: "JSXPunctuator",
1060
- value: "<"
1061
- };
1062
- continue;
1063
- case "{":
1064
- stack.push({
1065
- tag: "InterpolationInJSX",
1066
- nesting: braces.length
1067
- });
1068
- lastIndex++;
1069
- lastSignificantToken = "?InterpolationInJSX";
1070
- postfixIncDec = false;
1071
- yield {
1072
- type: "JSXPunctuator",
1073
- value: "{"
1074
- };
1075
- continue;
1076
- }
1077
- }
1078
- WhiteSpace.lastIndex = lastIndex;
1079
- if (match = WhiteSpace.exec(input)) {
1080
- lastIndex = WhiteSpace.lastIndex;
1081
- yield {
1082
- type: "WhiteSpace",
1083
- value: match[0]
1084
- };
1085
- continue;
1086
- }
1087
- LineTerminatorSequence.lastIndex = lastIndex;
1088
- if (match = LineTerminatorSequence.exec(input)) {
1089
- lastIndex = LineTerminatorSequence.lastIndex;
1090
- postfixIncDec = false;
1091
- if (KeywordsWithNoLineTerminatorAfter.test(lastSignificantToken)) {
1092
- lastSignificantToken = "?NoLineTerminatorHere";
1093
- }
1094
- yield {
1095
- type: "LineTerminatorSequence",
1096
- value: match[0]
1097
- };
1098
- continue;
1099
- }
1100
- MultiLineComment.lastIndex = lastIndex;
1101
- if (match = MultiLineComment.exec(input)) {
1102
- lastIndex = MultiLineComment.lastIndex;
1103
- if (Newline.test(match[0])) {
1104
- postfixIncDec = false;
1105
- if (KeywordsWithNoLineTerminatorAfter.test(lastSignificantToken)) {
1106
- lastSignificantToken = "?NoLineTerminatorHere";
1107
- }
1108
- }
1109
- yield {
1110
- type: "MultiLineComment",
1111
- value: match[0],
1112
- closed: match[1] !== void 0
1113
- };
1114
- continue;
1115
- }
1116
- SingleLineComment.lastIndex = lastIndex;
1117
- if (match = SingleLineComment.exec(input)) {
1118
- lastIndex = SingleLineComment.lastIndex;
1119
- postfixIncDec = false;
1120
- yield {
1121
- type: "SingleLineComment",
1122
- value: match[0]
1123
- };
1124
- continue;
1125
- }
1126
- firstCodePoint = String.fromCodePoint(input.codePointAt(lastIndex));
1127
- lastIndex += firstCodePoint.length;
1128
- lastSignificantToken = firstCodePoint;
1129
- postfixIncDec = false;
1130
- yield {
1131
- type: mode.tag.startsWith("JSX") ? "JSXInvalid" : "Invalid",
1132
- value: firstCodePoint
1133
- };
1134
- }
1135
- return void 0;
1136
- };
1137
- return jsTokens_1;
1138
- }
1139
- requireJsTokens();
1140
- var reservedWords = {
1141
- keyword: [
1142
- "break",
1143
- "case",
1144
- "catch",
1145
- "continue",
1146
- "debugger",
1147
- "default",
1148
- "do",
1149
- "else",
1150
- "finally",
1151
- "for",
1152
- "function",
1153
- "if",
1154
- "return",
1155
- "switch",
1156
- "throw",
1157
- "try",
1158
- "var",
1159
- "const",
1160
- "while",
1161
- "with",
1162
- "new",
1163
- "this",
1164
- "super",
1165
- "class",
1166
- "extends",
1167
- "export",
1168
- "import",
1169
- "null",
1170
- "true",
1171
- "false",
1172
- "in",
1173
- "instanceof",
1174
- "typeof",
1175
- "void",
1176
- "delete"
1177
- ],
1178
- strict: [
1179
- "implements",
1180
- "interface",
1181
- "let",
1182
- "package",
1183
- "private",
1184
- "protected",
1185
- "public",
1186
- "static",
1187
- "yield"
1188
- ]
1189
- };
1190
- new Set(reservedWords.keyword);
1191
- new Set(reservedWords.strict);
1192
- var f = {
1193
- reset: [0, 0],
1194
- bold: [
1195
- 1,
1196
- 22,
1197
- "\x1B[22m\x1B[1m"
1198
- ],
1199
- dim: [
1200
- 2,
1201
- 22,
1202
- "\x1B[22m\x1B[2m"
1203
- ],
1204
- italic: [3, 23],
1205
- underline: [4, 24],
1206
- inverse: [7, 27],
1207
- hidden: [8, 28],
1208
- strikethrough: [9, 29],
1209
- black: [30, 39],
1210
- red: [31, 39],
1211
- green: [32, 39],
1212
- yellow: [33, 39],
1213
- blue: [34, 39],
1214
- magenta: [35, 39],
1215
- cyan: [36, 39],
1216
- white: [37, 39],
1217
- gray: [90, 39],
1218
- bgBlack: [40, 49],
1219
- bgRed: [41, 49],
1220
- bgGreen: [42, 49],
1221
- bgYellow: [43, 49],
1222
- bgBlue: [44, 49],
1223
- bgMagenta: [45, 49],
1224
- bgCyan: [46, 49],
1225
- bgWhite: [47, 49],
1226
- blackBright: [90, 39],
1227
- redBright: [91, 39],
1228
- greenBright: [92, 39],
1229
- yellowBright: [93, 39],
1230
- blueBright: [94, 39],
1231
- magentaBright: [95, 39],
1232
- cyanBright: [96, 39],
1233
- whiteBright: [97, 39],
1234
- bgBlackBright: [100, 49],
1235
- bgRedBright: [101, 49],
1236
- bgGreenBright: [102, 49],
1237
- bgYellowBright: [103, 49],
1238
- bgBlueBright: [104, 49],
1239
- bgMagentaBright: [105, 49],
1240
- bgCyanBright: [106, 49],
1241
- bgWhiteBright: [107, 49]
1242
- }, h = Object.entries(f);
1243
- function a(n) {
1244
- return String(n);
1245
- }
1246
- a.open = "";
1247
- a.close = "";
1248
- function C(n = false) {
1249
- let e = typeof process != "undefined" ? process : void 0, i = (e == null ? void 0 : e.env) || {}, g = (e == null ? void 0 : e.argv) || [];
1250
- return !("NO_COLOR" in i || g.includes("--no-color")) && ("FORCE_COLOR" in i || g.includes("--color") || (e == null ? void 0 : e.platform) === "win32" || n && i.TERM !== "dumb" || "CI" in i) || typeof window != "undefined" && !!window.chrome;
1251
- }
1252
- function p(n = false) {
1253
- let e = C(n), i = (r, t, c, o) => {
1254
- let l = "", s = 0;
1255
- do
1256
- l += r.substring(s, o) + c, s = o + t.length, o = r.indexOf(t, s);
1257
- while (~o);
1258
- return l + r.substring(s);
1259
- }, g = (r, t, c = r) => {
1260
- let o = (l) => {
1261
- let s = String(l), b = s.indexOf(t, r.length);
1262
- return ~b ? r + i(s, t, c, b) + t : r + s + t;
1263
- };
1264
- return o.open = r, o.close = t, o;
1265
- }, u = { isColorSupported: e }, d = (r) => `\x1B[${r}m`;
1266
- for (let [r, t] of h) u[r] = e ? g(d(t[0]), d(t[1]), t[2]) : a;
1267
- return u;
1268
- }
1269
- p();
1270
- const lineSplitRE = /\r?\n/;
1271
- function positionToOffset(source, lineNumber, columnNumber) {
1272
- const lines = source.split(lineSplitRE);
1273
- const nl = /\r\n/.test(source) ? 2 : 1;
1274
- let start = 0;
1275
- if (lineNumber > lines.length) {
1276
- return source.length;
1277
- }
1278
- for (let i = 0; i < lineNumber - 1; i++) {
1279
- start += lines[i].length + nl;
1280
- }
1281
- return start + columnNumber;
1282
- }
1283
- function offsetToLineNumber(source, offset) {
1284
- if (offset > source.length) {
1285
- throw new Error(`offset is longer than source length! offset ${offset} > length ${source.length}`);
1286
- }
1287
- const lines = source.split(lineSplitRE);
1288
- const nl = /\r\n/.test(source) ? 2 : 1;
1289
- let counted = 0;
1290
- let line = 0;
1291
- for (; line < lines.length; line++) {
1292
- const lineLength = lines[line].length + nl;
1293
- if (counted + lineLength >= offset) {
1294
- break;
1295
- }
1296
- counted += lineLength;
1297
- }
1298
- return line + 1;
1299
- }
1300
- async function saveInlineSnapshots(environment, snapshots) {
1301
- const MagicString = (await import("../../../../../magic-string@0.30.21/node_modules/magic-string/dist/magic-string.es.js")).default;
1302
- const files = new Set(snapshots.map((i) => i.file));
1303
- await Promise.all(Array.from(files).map(async (file) => {
1304
- const snaps = snapshots.filter((i) => i.file === file);
1305
- const code = await environment.readSnapshotFile(file);
1306
- const s = new MagicString(code);
1307
- for (const snap of snaps) {
1308
- const index = positionToOffset(code, snap.line, snap.column);
1309
- replaceInlineSnap(code, s, index, snap.snapshot);
1310
- }
1311
- const transformed = s.toString();
1312
- if (transformed !== code) {
1313
- await environment.saveSnapshotFile(file, transformed);
1314
- }
1315
- }));
1316
- }
1317
- const startObjectRegex = /(?:toMatchInlineSnapshot|toThrowErrorMatchingInlineSnapshot)\s*\(\s*(?:\/\*[\s\S]*\*\/\s*|\/\/.*(?:[\n\r\u2028\u2029]\s*|[\t\v\f \xA0\u1680\u2000-\u200A\u202F\u205F\u3000\uFEFF]))*\{/;
1318
- function replaceObjectSnap(code, s, index, newSnap) {
1319
- let _code = code.slice(index);
1320
- const startMatch = startObjectRegex.exec(_code);
1321
- if (!startMatch) {
1322
- return false;
1323
- }
1324
- _code = _code.slice(startMatch.index);
1325
- let callEnd = getCallLastIndex(_code);
1326
- if (callEnd === null) {
1327
- return false;
1328
- }
1329
- callEnd += index + startMatch.index;
1330
- const shapeStart = index + startMatch.index + startMatch[0].length;
1331
- const shapeEnd = getObjectShapeEndIndex(code, shapeStart);
1332
- const snap = `, ${prepareSnapString(newSnap, code, index)}`;
1333
- if (shapeEnd === callEnd) {
1334
- s.appendLeft(callEnd, snap);
1335
- } else {
1336
- s.overwrite(shapeEnd, callEnd, snap);
1337
- }
1338
- return true;
1339
- }
1340
- function getObjectShapeEndIndex(code, index) {
1341
- let startBraces = 1;
1342
- let endBraces = 0;
1343
- while (startBraces !== endBraces && index < code.length) {
1344
- const s = code[index++];
1345
- if (s === "{") {
1346
- startBraces++;
1347
- } else if (s === "}") {
1348
- endBraces++;
1349
- }
1350
- }
1351
- return index;
1352
- }
1353
- function prepareSnapString(snap, source, index) {
1354
- const lineNumber = offsetToLineNumber(source, index);
1355
- const line = source.split(lineSplitRE)[lineNumber - 1];
1356
- const indent = line.match(/^\s*/)[0] || "";
1357
- const indentNext = indent.includes(" ") ? `${indent}\t` : `${indent} `;
1358
- const lines = snap.trim().replace(/\\/g, "\\\\").split(/\n/g);
1359
- const isOneline = lines.length <= 1;
1360
- const quote = "`";
1361
- if (isOneline) {
1362
- return `${quote}${lines.join("\n").replace(/`/g, "\\`").replace(/\$\{/g, "\\${")}${quote}`;
1363
- }
1364
- return `${quote}\n${lines.map((i) => i ? indentNext + i : "").join("\n").replace(/`/g, "\\`").replace(/\$\{/g, "\\${")}\n${indent}${quote}`;
1365
- }
1366
- const toMatchInlineName = "toMatchInlineSnapshot";
1367
- const toThrowErrorMatchingInlineName = "toThrowErrorMatchingInlineSnapshot";
1368
- function getCodeStartingAtIndex(code, index) {
1369
- const indexInline = index - toMatchInlineName.length;
1370
- if (code.slice(indexInline, index) === toMatchInlineName) {
1371
- return {
1372
- code: code.slice(indexInline),
1373
- index: indexInline
1374
- };
1375
- }
1376
- const indexThrowInline = index - toThrowErrorMatchingInlineName.length;
1377
- if (code.slice(index - indexThrowInline, index) === toThrowErrorMatchingInlineName) {
1378
- return {
1379
- code: code.slice(index - indexThrowInline),
1380
- index: index - indexThrowInline
1381
- };
1382
- }
1383
- return {
1384
- code: code.slice(index),
1385
- index
1386
- };
1387
- }
1388
- const startRegex = /(?:toMatchInlineSnapshot|toThrowErrorMatchingInlineSnapshot)\s*\(\s*(?:\/\*[\s\S]*\*\/\s*|\/\/.*(?:[\n\r\u2028\u2029]\s*|[\t\v\f \xA0\u1680\u2000-\u200A\u202F\u205F\u3000\uFEFF]))*[\w$]*(['"`)])/;
1389
- function replaceInlineSnap(code, s, currentIndex, newSnap) {
1390
- const { code: codeStartingAtIndex, index } = getCodeStartingAtIndex(code, currentIndex);
1391
- const startMatch = startRegex.exec(codeStartingAtIndex);
1392
- const firstKeywordMatch = /toMatchInlineSnapshot|toThrowErrorMatchingInlineSnapshot/.exec(codeStartingAtIndex);
1393
- if (!startMatch || startMatch.index !== (firstKeywordMatch === null || firstKeywordMatch === void 0 ? void 0 : firstKeywordMatch.index)) {
1394
- return replaceObjectSnap(code, s, index, newSnap);
1395
- }
1396
- const quote = startMatch[1];
1397
- const startIndex = index + startMatch.index + startMatch[0].length;
1398
- const snapString = prepareSnapString(newSnap, code, index);
1399
- if (quote === ")") {
1400
- s.appendRight(startIndex - 1, snapString);
1401
- return true;
1402
- }
1403
- const quoteEndRE = new RegExp(`(?:^|[^\\\\])${quote}`);
1404
- const endMatch = quoteEndRE.exec(code.slice(startIndex));
1405
- if (!endMatch) {
1406
- return false;
1407
- }
1408
- const endIndex = startIndex + endMatch.index + endMatch[0].length;
1409
- s.overwrite(startIndex - 1, endIndex, snapString);
1410
- return true;
1411
- }
1412
- const INDENTATION_REGEX = /^([^\S\n]*)\S/m;
1413
- function stripSnapshotIndentation(inlineSnapshot) {
1414
- const match = inlineSnapshot.match(INDENTATION_REGEX);
1415
- if (!match || !match[1]) {
1416
- return inlineSnapshot;
1417
- }
1418
- const indentation = match[1];
1419
- const lines = inlineSnapshot.split(/\n/g);
1420
- if (lines.length <= 2) {
1421
- return inlineSnapshot;
1422
- }
1423
- if (lines[0].trim() !== "" || lines[lines.length - 1].trim() !== "") {
1424
- return inlineSnapshot;
1425
- }
1426
- for (let i = 1; i < lines.length - 1; i++) {
1427
- if (lines[i] !== "") {
1428
- if (lines[i].indexOf(indentation) !== 0) {
1429
- return inlineSnapshot;
1430
- }
1431
- lines[i] = lines[i].substring(indentation.length);
1432
- }
1433
- }
1434
- lines[lines.length - 1] = "";
1435
- inlineSnapshot = lines.join("\n");
1436
- return inlineSnapshot;
1437
- }
1438
- async function saveRawSnapshots(environment, snapshots) {
1439
- await Promise.all(snapshots.map(async (snap) => {
1440
- if (!snap.readonly) {
1441
- await environment.saveSnapshotFile(snap.file, snap.snapshot);
1442
- }
1443
- }));
1444
- }
1445
- var naturalCompare$1 = { exports: {} };
1446
- var hasRequiredNaturalCompare;
1447
- function requireNaturalCompare() {
1448
- if (hasRequiredNaturalCompare) return naturalCompare$1.exports;
1449
- hasRequiredNaturalCompare = 1;
1450
- /*
1451
- * @version 1.4.0
1452
- * @date 2015-10-26
1453
- * @stability 3 - Stable
1454
- * @author Lauri Rooden (https://github.com/litejs/natural-compare-lite)
1455
- * @license MIT License
1456
- */
1457
- var naturalCompare$2 = function(a$1, b) {
1458
- var i, codeA, codeB = 1, posA = 0, posB = 0, alphabet = String.alphabet;
1459
- function getCode(str, pos, code) {
1460
- if (code) {
1461
- for (i = pos; code = getCode(str, i), code < 76 && code > 65;) ++i;
1462
- return +str.slice(pos - 1, i);
1463
- }
1464
- code = alphabet && alphabet.indexOf(str.charAt(pos));
1465
- return code > -1 ? code + 76 : (code = str.charCodeAt(pos) || 0, code < 45 || code > 127) ? code : code < 46 ? 65 : code < 48 ? code - 1 : code < 58 ? code + 18 : code < 65 ? code - 11 : code < 91 ? code + 11 : code < 97 ? code - 37 : code < 123 ? code + 5 : code - 63;
1466
- }
1467
- if ((a$1 += "") != (b += "")) for (; codeB;) {
1468
- codeA = getCode(a$1, posA++);
1469
- codeB = getCode(b, posB++);
1470
- if (codeA < 76 && codeB < 76 && codeA > 66 && codeB > 66) {
1471
- codeA = getCode(a$1, posA, posA);
1472
- codeB = getCode(b, posB, posA = i);
1473
- posB = i;
1474
- }
1475
- if (codeA != codeB) return codeA < codeB ? -1 : 1;
1476
- }
1477
- return 0;
1478
- };
1479
- try {
1480
- naturalCompare$1.exports = naturalCompare$2;
1481
- } catch (e) {
1482
- String.naturalCompare = naturalCompare$2;
1483
- }
1484
- return naturalCompare$1.exports;
1485
- }
1486
- var naturalCompareExports = requireNaturalCompare();
1487
- var naturalCompare = /* @__PURE__ */ getDefaultExportFromCjs(naturalCompareExports);
1488
- const serialize$1 = (val, config, indentation, depth, refs, printer) => {
1489
- const name = val.getMockName();
1490
- const nameString = name === "vi.fn()" ? "" : ` ${name}`;
1491
- let callsString = "";
1492
- if (val.mock.calls.length !== 0) {
1493
- const indentationNext = indentation + config.indent;
1494
- callsString = ` {${config.spacingOuter}${indentationNext}"calls": ${printer(val.mock.calls, config, indentationNext, depth, refs)}${config.min ? ", " : ","}${config.spacingOuter}${indentationNext}"results": ${printer(val.mock.results, config, indentationNext, depth, refs)}${config.min ? "" : ","}${config.spacingOuter}${indentation}}`;
1495
- }
1496
- return `[MockFunction${nameString}]${callsString}`;
1497
- };
1498
- const test = (val) => val && !!val._isMockFunction;
1499
- const plugin = {
1500
- serialize: serialize$1,
1501
- test
1502
- };
1503
- const { DOMCollection, DOMElement, Immutable, ReactElement, ReactTestComponent, AsymmetricMatcher } = plugins;
1504
- let PLUGINS = [
1505
- ReactTestComponent,
1506
- ReactElement,
1507
- DOMElement,
1508
- DOMCollection,
1509
- Immutable,
1510
- AsymmetricMatcher,
1511
- plugin
1512
- ];
1513
- function addSerializer(plugin$1) {
1514
- PLUGINS = [plugin$1].concat(PLUGINS);
1515
- }
1516
- function getSerializers() {
1517
- return PLUGINS;
1518
- }
1519
- function testNameToKey(testName, count) {
1520
- return `${testName} ${count}`;
1521
- }
1522
- function keyToTestName(key) {
1523
- if (!/ \d+$/.test(key)) {
1524
- throw new Error("Snapshot keys must end with a number.");
1525
- }
1526
- return key.replace(/ \d+$/, "");
1527
- }
1528
- function getSnapshotData(content, options) {
1529
- const update = options.updateSnapshot;
1530
- const data = Object.create(null);
1531
- let snapshotContents = "";
1532
- let dirty = false;
1533
- if (content != null) {
1534
- try {
1535
- snapshotContents = content;
1536
- const populate = new Function("exports", snapshotContents);
1537
- populate(data);
1538
- } catch {}
1539
- }
1540
- const isInvalid = snapshotContents;
1541
- if ((update === "all" || update === "new") && isInvalid) {
1542
- dirty = true;
1543
- }
1544
- return {
1545
- data,
1546
- dirty
1547
- };
1548
- }
1549
- function addExtraLineBreaks(string) {
1550
- return string.includes("\n") ? `\n${string}\n` : string;
1551
- }
1552
- function removeExtraLineBreaks(string) {
1553
- return string.length > 2 && string.startsWith("\n") && string.endsWith("\n") ? string.slice(1, -1) : string;
1554
- }
1555
- const escapeRegex = true;
1556
- const printFunctionName = false;
1557
- function serialize(val, indent = 2, formatOverrides = {}) {
1558
- return normalizeNewlines(format(val, {
1559
- escapeRegex,
1560
- indent,
1561
- plugins: getSerializers(),
1562
- printFunctionName,
1563
- ...formatOverrides
1564
- }));
1565
- }
1566
- function escapeBacktickString(str) {
1567
- return str.replace(/`|\\|\$\{/g, "\\$&");
1568
- }
1569
- function printBacktickString(str) {
1570
- return `\`${escapeBacktickString(str)}\``;
1571
- }
1572
- function normalizeNewlines(string) {
1573
- return string.replace(/\r\n|\r/g, "\n");
1574
- }
1575
- async function saveSnapshotFile(environment, snapshotData, snapshotPath) {
1576
- const snapshots = Object.keys(snapshotData).sort(naturalCompare).map((key) => `exports[${printBacktickString(key)}] = ${printBacktickString(normalizeNewlines(snapshotData[key]))};`);
1577
- const content = `${environment.getHeader()}\n\n${snapshots.join("\n\n")}\n`;
1578
- const oldContent = await environment.readSnapshotFile(snapshotPath);
1579
- const skipWriting = oldContent != null && oldContent === content;
1580
- if (skipWriting) {
1581
- return;
1582
- }
1583
- await environment.saveSnapshotFile(snapshotPath, content);
1584
- }
1585
- function deepMergeArray(target = [], source = []) {
1586
- const mergedOutput = Array.from(target);
1587
- source.forEach((sourceElement, index) => {
1588
- const targetElement = mergedOutput[index];
1589
- if (Array.isArray(target[index])) {
1590
- mergedOutput[index] = deepMergeArray(target[index], sourceElement);
1591
- } else if (isObject(targetElement)) {
1592
- mergedOutput[index] = deepMergeSnapshot(target[index], sourceElement);
1593
- } else {
1594
- mergedOutput[index] = sourceElement;
1595
- }
1596
- });
1597
- return mergedOutput;
1598
- }
1599
- /**
1600
- * Deep merge, but considers asymmetric matchers. Unlike base util's deep merge,
1601
- * will merge any object-like instance.
1602
- * Compatible with Jest's snapshot matcher. Should not be used outside of snapshot.
1603
- *
1604
- * @example
1605
- * ```ts
1606
- * toMatchSnapshot({
1607
- * name: expect.stringContaining('text')
1608
- * })
1609
- * ```
1610
- */
1611
- function deepMergeSnapshot(target, source) {
1612
- if (isObject(target) && isObject(source)) {
1613
- const mergedOutput = { ...target };
1614
- Object.keys(source).forEach((key) => {
1615
- if (isObject(source[key]) && !source[key].$$typeof) {
1616
- if (!(key in target)) {
1617
- Object.assign(mergedOutput, { [key]: source[key] });
1618
- } else {
1619
- mergedOutput[key] = deepMergeSnapshot(target[key], source[key]);
1620
- }
1621
- } else if (Array.isArray(source[key])) {
1622
- mergedOutput[key] = deepMergeArray(target[key], source[key]);
1623
- } else {
1624
- Object.assign(mergedOutput, { [key]: source[key] });
1625
- }
1626
- });
1627
- return mergedOutput;
1628
- } else if (Array.isArray(target) && Array.isArray(source)) {
1629
- return deepMergeArray(target, source);
1630
- }
1631
- return target;
1632
- }
1633
- var DefaultMap = class extends Map {
1634
- constructor(defaultFn, entries) {
1635
- super(entries);
1636
- this.defaultFn = defaultFn;
1637
- }
1638
- get(key) {
1639
- if (!this.has(key)) {
1640
- this.set(key, this.defaultFn(key));
1641
- }
1642
- return super.get(key);
1643
- }
1644
- };
1645
- var CounterMap = class extends DefaultMap {
1646
- constructor() {
1647
- super(() => 0);
1648
- }
1649
- _total;
1650
- valueOf() {
1651
- return this._total = this.total();
1652
- }
1653
- increment(key) {
1654
- if (typeof this._total !== "undefined") {
1655
- this._total++;
1656
- }
1657
- this.set(key, this.get(key) + 1);
1658
- }
1659
- total() {
1660
- if (typeof this._total !== "undefined") {
1661
- return this._total;
1662
- }
1663
- let total = 0;
1664
- for (const x of this.values()) {
1665
- total += x;
1666
- }
1667
- return total;
1668
- }
1669
- };
1670
- function isSameStackPosition(x, y) {
1671
- return x.file === y.file && x.column === y.column && x.line === y.line;
1672
- }
1673
- var SnapshotState = class SnapshotState {
1674
- _counters = new CounterMap();
1675
- _dirty;
1676
- _updateSnapshot;
1677
- _snapshotData;
1678
- _initialData;
1679
- _inlineSnapshots;
1680
- _inlineSnapshotStacks;
1681
- _testIdToKeys = new DefaultMap(() => []);
1682
- _rawSnapshots;
1683
- _uncheckedKeys;
1684
- _snapshotFormat;
1685
- _environment;
1686
- _fileExists;
1687
- expand;
1688
- _added = new CounterMap();
1689
- _matched = new CounterMap();
1690
- _unmatched = new CounterMap();
1691
- _updated = new CounterMap();
1692
- get added() {
1693
- return this._added;
1694
- }
1695
- set added(value) {
1696
- this._added._total = value;
1697
- }
1698
- get matched() {
1699
- return this._matched;
1700
- }
1701
- set matched(value) {
1702
- this._matched._total = value;
1703
- }
1704
- get unmatched() {
1705
- return this._unmatched;
1706
- }
1707
- set unmatched(value) {
1708
- this._unmatched._total = value;
1709
- }
1710
- get updated() {
1711
- return this._updated;
1712
- }
1713
- set updated(value) {
1714
- this._updated._total = value;
1715
- }
1716
- constructor(testFilePath, snapshotPath, snapshotContent, options) {
1717
- this.testFilePath = testFilePath;
1718
- this.snapshotPath = snapshotPath;
1719
- const { data, dirty } = getSnapshotData(snapshotContent, options);
1720
- this._fileExists = snapshotContent != null;
1721
- this._initialData = { ...data };
1722
- this._snapshotData = { ...data };
1723
- this._dirty = dirty;
1724
- this._inlineSnapshots = [];
1725
- this._inlineSnapshotStacks = [];
1726
- this._rawSnapshots = [];
1727
- this._uncheckedKeys = new Set(Object.keys(this._snapshotData));
1728
- this.expand = options.expand || false;
1729
- this._updateSnapshot = options.updateSnapshot;
1730
- this._snapshotFormat = {
1731
- printBasicPrototype: false,
1732
- escapeString: false,
1733
- ...options.snapshotFormat
1734
- };
1735
- this._environment = options.snapshotEnvironment;
1736
- }
1737
- static async create(testFilePath, options) {
1738
- const snapshotPath = await options.snapshotEnvironment.resolvePath(testFilePath);
1739
- const content = await options.snapshotEnvironment.readSnapshotFile(snapshotPath);
1740
- return new SnapshotState(testFilePath, snapshotPath, content, options);
1741
- }
1742
- get environment() {
1743
- return this._environment;
1744
- }
1745
- markSnapshotsAsCheckedForTest(testName) {
1746
- this._uncheckedKeys.forEach((uncheckedKey) => {
1747
- if (/ \d+$| > /.test(uncheckedKey.slice(testName.length))) {
1748
- this._uncheckedKeys.delete(uncheckedKey);
1749
- }
1750
- });
1751
- }
1752
- clearTest(testId) {
1753
- this._inlineSnapshots = this._inlineSnapshots.filter((s) => s.testId !== testId);
1754
- this._inlineSnapshotStacks = this._inlineSnapshotStacks.filter((s) => s.testId !== testId);
1755
- for (const key of this._testIdToKeys.get(testId)) {
1756
- const name = keyToTestName(key);
1757
- const count = this._counters.get(name);
1758
- if (count > 0) {
1759
- if (key in this._snapshotData || key in this._initialData) {
1760
- this._snapshotData[key] = this._initialData[key];
1761
- }
1762
- this._counters.set(name, count - 1);
1763
- }
1764
- }
1765
- this._testIdToKeys.delete(testId);
1766
- this.added.delete(testId);
1767
- this.updated.delete(testId);
1768
- this.matched.delete(testId);
1769
- this.unmatched.delete(testId);
1770
- }
1771
- _inferInlineSnapshotStack(stacks) {
1772
- const promiseIndex = stacks.findIndex((i) => i.method.match(/__VITEST_(RESOLVES|REJECTS)__/));
1773
- if (promiseIndex !== -1) {
1774
- return stacks[promiseIndex + 3];
1775
- }
1776
- const stackIndex = stacks.findIndex((i) => i.method.includes("__INLINE_SNAPSHOT__"));
1777
- return stackIndex !== -1 ? stacks[stackIndex + 2] : null;
1778
- }
1779
- _addSnapshot(key, receivedSerialized, options) {
1780
- this._dirty = true;
1781
- if (options.stack) {
1782
- this._inlineSnapshots.push({
1783
- snapshot: receivedSerialized,
1784
- testId: options.testId,
1785
- ...options.stack
1786
- });
1787
- } else if (options.rawSnapshot) {
1788
- this._rawSnapshots.push({
1789
- ...options.rawSnapshot,
1790
- snapshot: receivedSerialized
1791
- });
1792
- } else {
1793
- this._snapshotData[key] = receivedSerialized;
1794
- }
1795
- }
1796
- async save() {
1797
- const hasExternalSnapshots = Object.keys(this._snapshotData).length;
1798
- const hasInlineSnapshots = this._inlineSnapshots.length;
1799
- const hasRawSnapshots = this._rawSnapshots.length;
1800
- const isEmpty = !hasExternalSnapshots && !hasInlineSnapshots && !hasRawSnapshots;
1801
- const status = {
1802
- deleted: false,
1803
- saved: false
1804
- };
1805
- if ((this._dirty || this._uncheckedKeys.size) && !isEmpty) {
1806
- if (hasExternalSnapshots) {
1807
- await saveSnapshotFile(this._environment, this._snapshotData, this.snapshotPath);
1808
- this._fileExists = true;
1809
- }
1810
- if (hasInlineSnapshots) {
1811
- await saveInlineSnapshots(this._environment, this._inlineSnapshots);
1812
- }
1813
- if (hasRawSnapshots) {
1814
- await saveRawSnapshots(this._environment, this._rawSnapshots);
1815
- }
1816
- status.saved = true;
1817
- } else if (!hasExternalSnapshots && this._fileExists) {
1818
- if (this._updateSnapshot === "all") {
1819
- await this._environment.removeSnapshotFile(this.snapshotPath);
1820
- this._fileExists = false;
1821
- }
1822
- status.deleted = true;
1823
- }
1824
- return status;
1825
- }
1826
- getUncheckedCount() {
1827
- return this._uncheckedKeys.size || 0;
1828
- }
1829
- getUncheckedKeys() {
1830
- return Array.from(this._uncheckedKeys);
1831
- }
1832
- removeUncheckedKeys() {
1833
- if (this._updateSnapshot === "all" && this._uncheckedKeys.size) {
1834
- this._dirty = true;
1835
- this._uncheckedKeys.forEach((key) => delete this._snapshotData[key]);
1836
- this._uncheckedKeys.clear();
1837
- }
1838
- }
1839
- match({ testId, testName, received, key, inlineSnapshot, isInline, error, rawSnapshot }) {
1840
- this._counters.increment(testName);
1841
- const count = this._counters.get(testName);
1842
- if (!key) {
1843
- key = testNameToKey(testName, count);
1844
- }
1845
- this._testIdToKeys.get(testId).push(key);
1846
- if (!(isInline && this._snapshotData[key] !== undefined)) {
1847
- this._uncheckedKeys.delete(key);
1848
- }
1849
- let receivedSerialized = rawSnapshot && typeof received === "string" ? received : serialize(received, undefined, this._snapshotFormat);
1850
- if (!rawSnapshot) {
1851
- receivedSerialized = addExtraLineBreaks(receivedSerialized);
1852
- }
1853
- if (rawSnapshot) {
1854
- if (rawSnapshot.content && rawSnapshot.content.match(/\r\n/) && !receivedSerialized.match(/\r\n/)) {
1855
- rawSnapshot.content = normalizeNewlines(rawSnapshot.content);
1856
- }
1857
- }
1858
- const expected = isInline ? inlineSnapshot : rawSnapshot ? rawSnapshot.content : this._snapshotData[key];
1859
- const expectedTrimmed = rawSnapshot ? expected : expected === null || expected === void 0 ? void 0 : expected.trim();
1860
- const pass = expectedTrimmed === (rawSnapshot ? receivedSerialized : receivedSerialized.trim());
1861
- const hasSnapshot = expected !== undefined;
1862
- const snapshotIsPersisted = isInline || this._fileExists || rawSnapshot && rawSnapshot.content != null;
1863
- if (pass && !isInline && !rawSnapshot) {
1864
- this._snapshotData[key] = receivedSerialized;
1865
- }
1866
- let stack;
1867
- if (isInline) {
1868
- var _this$environment$pro, _this$environment;
1869
- const stacks = parseErrorStacktrace(error || new Error("snapshot"), { ignoreStackEntries: [] });
1870
- const _stack = this._inferInlineSnapshotStack(stacks);
1871
- if (!_stack) {
1872
- throw new Error(`@vitest/snapshot: Couldn't infer stack frame for inline snapshot.\n${JSON.stringify(stacks)}`);
1873
- }
1874
- stack = ((_this$environment$pro = (_this$environment = this.environment).processStackTrace) === null || _this$environment$pro === void 0 ? void 0 : _this$environment$pro.call(_this$environment, _stack)) || _stack;
1875
- stack.column--;
1876
- const snapshotsWithSameStack = this._inlineSnapshotStacks.filter((s) => isSameStackPosition(s, stack));
1877
- if (snapshotsWithSameStack.length > 0) {
1878
- this._inlineSnapshots = this._inlineSnapshots.filter((s) => !isSameStackPosition(s, stack));
1879
- const differentSnapshot = snapshotsWithSameStack.find((s) => s.snapshot !== receivedSerialized);
1880
- if (differentSnapshot) {
1881
- throw Object.assign(new Error("toMatchInlineSnapshot with different snapshots cannot be called at the same location"), {
1882
- actual: receivedSerialized,
1883
- expected: differentSnapshot.snapshot
1884
- });
1885
- }
1886
- }
1887
- this._inlineSnapshotStacks.push({
1888
- ...stack,
1889
- testId,
1890
- snapshot: receivedSerialized
1891
- });
1892
- }
1893
- if (hasSnapshot && this._updateSnapshot === "all" || (!hasSnapshot || !snapshotIsPersisted) && (this._updateSnapshot === "new" || this._updateSnapshot === "all")) {
1894
- if (this._updateSnapshot === "all") {
1895
- if (!pass) {
1896
- if (hasSnapshot) {
1897
- this.updated.increment(testId);
1898
- } else {
1899
- this.added.increment(testId);
1900
- }
1901
- this._addSnapshot(key, receivedSerialized, {
1902
- stack,
1903
- testId,
1904
- rawSnapshot
1905
- });
1906
- } else {
1907
- this.matched.increment(testId);
1908
- }
1909
- } else {
1910
- this._addSnapshot(key, receivedSerialized, {
1911
- stack,
1912
- testId,
1913
- rawSnapshot
1914
- });
1915
- this.added.increment(testId);
1916
- }
1917
- return {
1918
- actual: "",
1919
- count,
1920
- expected: "",
1921
- key,
1922
- pass: true
1923
- };
1924
- } else {
1925
- if (!pass) {
1926
- this.unmatched.increment(testId);
1927
- return {
1928
- actual: rawSnapshot ? receivedSerialized : removeExtraLineBreaks(receivedSerialized),
1929
- count,
1930
- expected: expectedTrimmed !== undefined ? rawSnapshot ? expectedTrimmed : removeExtraLineBreaks(expectedTrimmed) : undefined,
1931
- key,
1932
- pass: false
1933
- };
1934
- } else {
1935
- this.matched.increment(testId);
1936
- return {
1937
- actual: "",
1938
- count,
1939
- expected: "",
1940
- key,
1941
- pass: true
1942
- };
1943
- }
1944
- }
1945
- }
1946
- async pack() {
1947
- const snapshot = {
1948
- filepath: this.testFilePath,
1949
- added: 0,
1950
- fileDeleted: false,
1951
- matched: 0,
1952
- unchecked: 0,
1953
- uncheckedKeys: [],
1954
- unmatched: 0,
1955
- updated: 0
1956
- };
1957
- const uncheckedCount = this.getUncheckedCount();
1958
- const uncheckedKeys = this.getUncheckedKeys();
1959
- if (uncheckedCount) {
1960
- this.removeUncheckedKeys();
1961
- }
1962
- const status = await this.save();
1963
- snapshot.fileDeleted = status.deleted;
1964
- snapshot.added = this.added.total();
1965
- snapshot.matched = this.matched.total();
1966
- snapshot.unmatched = this.unmatched.total();
1967
- snapshot.updated = this.updated.total();
1968
- snapshot.unchecked = !status.deleted ? uncheckedCount : 0;
1969
- snapshot.uncheckedKeys = Array.from(uncheckedKeys);
1970
- return snapshot;
1971
- }
1972
- };
1973
- function createMismatchError(message, expand, actual, expected) {
1974
- const error = new Error(message);
1975
- Object.defineProperty(error, "actual", {
1976
- value: actual,
1977
- enumerable: true,
1978
- configurable: true,
1979
- writable: true
1980
- });
1981
- Object.defineProperty(error, "expected", {
1982
- value: expected,
1983
- enumerable: true,
1984
- configurable: true,
1985
- writable: true
1986
- });
1987
- Object.defineProperty(error, "diffOptions", { value: { expand } });
1988
- return error;
1989
- }
1990
- var SnapshotClient = class {
1991
- snapshotStateMap = new Map();
1992
- constructor(options = {}) {
1993
- this.options = options;
1994
- }
1995
- async setup(filepath, options) {
1996
- if (this.snapshotStateMap.has(filepath)) {
1997
- return;
1998
- }
1999
- this.snapshotStateMap.set(filepath, await SnapshotState.create(filepath, options));
2000
- }
2001
- async finish(filepath) {
2002
- const state = this.getSnapshotState(filepath);
2003
- const result = await state.pack();
2004
- this.snapshotStateMap.delete(filepath);
2005
- return result;
2006
- }
2007
- skipTest(filepath, testName) {
2008
- const state = this.getSnapshotState(filepath);
2009
- state.markSnapshotsAsCheckedForTest(testName);
2010
- }
2011
- clearTest(filepath, testId) {
2012
- const state = this.getSnapshotState(filepath);
2013
- state.clearTest(testId);
2014
- }
2015
- getSnapshotState(filepath) {
2016
- const state = this.snapshotStateMap.get(filepath);
2017
- if (!state) {
2018
- throw new Error(`The snapshot state for '${filepath}' is not found. Did you call 'SnapshotClient.setup()'?`);
2019
- }
2020
- return state;
2021
- }
2022
- assert(options) {
2023
- const { filepath, name, testId = name, message, isInline = false, properties, inlineSnapshot, error, errorMessage, rawSnapshot } = options;
2024
- let { received } = options;
2025
- if (!filepath) {
2026
- throw new Error("Snapshot cannot be used outside of test");
2027
- }
2028
- const snapshotState = this.getSnapshotState(filepath);
2029
- if (typeof properties === "object") {
2030
- if (typeof received !== "object" || !received) {
2031
- throw new Error("Received value must be an object when the matcher has properties");
2032
- }
2033
- try {
2034
- var _this$options$isEqual, _this$options;
2035
- const pass$1 = ((_this$options$isEqual = (_this$options = this.options).isEqual) === null || _this$options$isEqual === void 0 ? void 0 : _this$options$isEqual.call(_this$options, received, properties)) ?? false;
2036
- if (!pass$1) {
2037
- throw createMismatchError("Snapshot properties mismatched", snapshotState.expand, received, properties);
2038
- } else {
2039
- received = deepMergeSnapshot(received, properties);
2040
- }
2041
- } catch (err) {
2042
- err.message = errorMessage || "Snapshot mismatched";
2043
- throw err;
2044
- }
2045
- }
2046
- const testName = [name, ...message ? [message] : []].join(" > ");
2047
- const { actual, expected, key, pass } = snapshotState.match({
2048
- testId,
2049
- testName,
2050
- received,
2051
- isInline,
2052
- error,
2053
- inlineSnapshot,
2054
- rawSnapshot
2055
- });
2056
- if (!pass) {
2057
- throw createMismatchError(`Snapshot \`${key || "unknown"}\` mismatched`, snapshotState.expand, rawSnapshot ? actual : actual === null || actual === void 0 ? void 0 : actual.trim(), rawSnapshot ? expected : expected === null || expected === void 0 ? void 0 : expected.trim());
2058
- }
2059
- }
2060
- async assertRaw(options) {
2061
- if (!options.rawSnapshot) {
2062
- throw new Error("Raw snapshot is required");
2063
- }
2064
- const { filepath, rawSnapshot } = options;
2065
- if (rawSnapshot.content == null) {
2066
- if (!filepath) {
2067
- throw new Error("Snapshot cannot be used outside of test");
2068
- }
2069
- const snapshotState = this.getSnapshotState(filepath);
2070
- options.filepath || (options.filepath = filepath);
2071
- rawSnapshot.file = await snapshotState.environment.resolveRawPath(filepath, rawSnapshot.file);
2072
- rawSnapshot.content = await snapshotState.environment.readSnapshotFile(rawSnapshot.file) ?? undefined;
2073
- }
2074
- return this.assert(options);
2075
- }
2076
- clear() {
2077
- this.snapshotStateMap.clear();
2078
- }
2079
- };
2080
-
2081
- //#endregion
2082
- export { SnapshotClient, addSerializer, stripSnapshotIndentation };