@directus/api 34.0.1 → 35.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/__utils__/items-utils.js +32 -0
- package/dist/__utils__/schemas.js +297 -0
- package/dist/__utils__/snapshots.js +899 -0
- package/dist/_virtual/rolldown_runtime.js +38 -0
- package/dist/ai/chat/constants/system-prompt.js +5 -1
- package/dist/ai/chat/controllers/chat.post.js +69 -61
- package/dist/ai/chat/lib/create-ui-stream.js +71 -45
- package/dist/ai/chat/lib/transform-file-parts.js +43 -32
- package/dist/ai/chat/middleware/load-settings.js +42 -41
- package/dist/ai/chat/models/chat-request.js +77 -69
- package/dist/ai/chat/models/providers.js +23 -18
- package/dist/ai/chat/router.js +10 -5
- package/dist/ai/chat/utils/chat-request-tool-to-ai-sdk-tool.js +40 -36
- package/dist/ai/chat/utils/fix-error-tool-calls.js +30 -28
- package/dist/ai/chat/utils/format-context.js +87 -89
- package/dist/ai/chat/utils/parse-json-schema-7.js +84 -73
- package/dist/ai/devtools/index.js +38 -0
- package/dist/ai/files/adapters/anthropic.js +29 -24
- package/dist/ai/files/adapters/google.js +60 -57
- package/dist/ai/files/adapters/index.js +5 -3
- package/dist/ai/files/adapters/openai.js +26 -21
- package/dist/ai/files/controllers/upload.js +101 -95
- package/dist/ai/files/lib/fetch-provider.js +27 -22
- package/dist/ai/files/lib/upload-to-provider.js +32 -25
- package/dist/ai/files/router.js +10 -5
- package/dist/ai/files/types.js +1 -1
- package/dist/ai/mcp/index.js +3 -1
- package/dist/ai/mcp/server.js +293 -301
- package/dist/ai/mcp/transport.js +22 -18
- package/dist/ai/mcp/types.js +1 -1
- package/dist/ai/providers/anthropic-file-support.js +91 -89
- package/dist/ai/providers/anthropic-tool-search.js +33 -0
- package/dist/ai/providers/index.js +5 -3
- package/dist/ai/providers/options.js +27 -24
- package/dist/ai/providers/registry.js +65 -60
- package/dist/ai/providers/types.js +1 -1
- package/dist/ai/telemetry/braintrust.js +27 -0
- package/dist/ai/telemetry/index.js +79 -0
- package/dist/ai/telemetry/langfuse.js +67 -0
- package/dist/ai/tools/assets/index.js +56 -55
- package/dist/ai/tools/collections/index.js +96 -89
- package/dist/ai/tools/define-tool.js +6 -2
- package/dist/ai/tools/fields/index.js +157 -162
- package/dist/ai/tools/files/index.js +109 -104
- package/dist/ai/tools/flows/index.js +99 -87
- package/dist/ai/tools/folders/index.js +103 -98
- package/dist/ai/tools/index.js +32 -28
- package/dist/ai/tools/items/index.js +149 -146
- package/dist/ai/tools/operations/index.js +88 -80
- package/dist/ai/tools/relations/index.js +100 -91
- package/dist/ai/tools/schema/index.js +240 -302
- package/dist/ai/tools/schema.js +198 -205
- package/dist/ai/tools/system/index.js +23 -22
- package/dist/ai/tools/trigger-flow/index.js +62 -49
- package/dist/ai/tools/types.js +1 -1
- package/dist/ai/tools/utils.js +20 -15
- package/dist/app.js +296 -288
- package/dist/auth/auth.js +46 -41
- package/dist/auth/drivers/index.js +7 -5
- package/dist/auth/drivers/ldap.js +314 -342
- package/dist/auth/drivers/local.js +86 -89
- package/dist/auth/drivers/oauth2.js +369 -385
- package/dist/auth/drivers/openid.js +429 -447
- package/dist/auth/drivers/saml.js +172 -172
- package/dist/auth/utils/generate-callback-url.js +38 -35
- package/dist/auth/utils/resolve-login-redirect.js +54 -60
- package/dist/auth.js +66 -60
- package/dist/bus/index.js +3 -1
- package/dist/bus/lib/use-bus.js +29 -19
- package/dist/cache.js +136 -124
- package/dist/cli/commands/bootstrap/index.js +61 -59
- package/dist/cli/commands/cache/clear.js +33 -0
- package/dist/cli/commands/count/index.js +25 -21
- package/dist/cli/commands/database/install.js +20 -16
- package/dist/cli/commands/database/migrate.js +26 -23
- package/dist/cli/commands/init/index.js +116 -100
- package/dist/cli/commands/init/questions.js +86 -48
- package/dist/cli/commands/roles/create.js +51 -37
- package/dist/cli/commands/schema/apply.js +188 -203
- package/dist/cli/commands/schema/snapshot.js +55 -56
- package/dist/cli/commands/security/key.js +9 -4
- package/dist/cli/commands/security/secret.js +8 -4
- package/dist/cli/commands/users/create.js +35 -23
- package/dist/cli/commands/users/passwd.js +37 -35
- package/dist/cli/index.js +53 -90
- package/dist/cli/load-extensions.js +25 -19
- package/dist/cli/run.js +9 -7
- package/dist/cli/utils/create-db-connection.js +56 -54
- package/dist/cli/utils/create-env/index.js +33 -35
- package/dist/cli/utils/drivers.js +16 -13
- package/dist/constants.js +132 -89
- package/dist/controllers/access.js +137 -140
- package/dist/controllers/activity.js +47 -46
- package/dist/controllers/assets.js +200 -241
- package/dist/controllers/auth.js +175 -175
- package/dist/controllers/collections.js +99 -99
- package/dist/controllers/comments.js +136 -138
- package/dist/controllers/dashboards.js +131 -132
- package/dist/controllers/deployment-webhooks.js +92 -93
- package/dist/controllers/deployment.js +330 -350
- package/dist/controllers/extensions.js +205 -199
- package/dist/controllers/fields.js +155 -164
- package/dist/controllers/files.js +250 -269
- package/dist/controllers/flows.js +150 -151
- package/dist/controllers/folders.js +138 -141
- package/dist/controllers/graphql.js +33 -28
- package/dist/controllers/items.js +157 -172
- package/dist/controllers/mcp.js +33 -31
- package/dist/controllers/metrics.js +33 -29
- package/dist/controllers/not-found.js +35 -28
- package/dist/controllers/notifications.js +138 -141
- package/dist/controllers/operations.js +131 -132
- package/dist/controllers/panels.js +131 -132
- package/dist/controllers/permissions.js +162 -166
- package/dist/controllers/policies.js +155 -160
- package/dist/controllers/presets.js +138 -141
- package/dist/controllers/relations.js +96 -102
- package/dist/controllers/revisions.js +40 -32
- package/dist/controllers/roles.js +152 -152
- package/dist/controllers/schema.js +97 -92
- package/dist/controllers/server.js +84 -81
- package/dist/controllers/settings.js +44 -40
- package/dist/controllers/shares.js +180 -213
- package/dist/controllers/translations.js +138 -141
- package/dist/controllers/tus.js +70 -72
- package/dist/controllers/users.js +303 -308
- package/dist/controllers/utils.js +149 -134
- package/dist/controllers/versions.js +178 -176
- package/dist/database/errors/dialects/mssql.js +137 -153
- package/dist/database/errors/dialects/mysql.js +123 -137
- package/dist/database/errors/dialects/oracle.js +24 -20
- package/dist/database/errors/dialects/postgres.js +91 -94
- package/dist/database/errors/dialects/sqlite.js +48 -46
- package/dist/database/errors/dialects/types.js +1 -1
- package/dist/database/errors/translate.js +47 -42
- package/dist/database/get-ast-from-query/get-ast-from-query.js +51 -52
- package/dist/database/get-ast-from-query/lib/convert-wildcards.js +74 -78
- package/dist/database/get-ast-from-query/lib/parse-fields.js +231 -246
- package/dist/database/get-ast-from-query/utils/get-allowed-sort.js +31 -34
- package/dist/database/get-ast-from-query/utils/get-deep-query.js +20 -15
- package/dist/database/get-ast-from-query/utils/get-related-collection.js +16 -12
- package/dist/database/helpers/capabilities/dialects/default.js +7 -3
- package/dist/database/helpers/capabilities/dialects/mysql.js +11 -9
- package/dist/database/helpers/capabilities/dialects/postgres.js +14 -14
- package/dist/database/helpers/capabilities/index.js +18 -7
- package/dist/database/helpers/capabilities/types.js +20 -15
- package/dist/database/helpers/date/dialects/default.js +7 -3
- package/dist/database/helpers/date/dialects/mssql.js +13 -8
- package/dist/database/helpers/date/dialects/mysql.js +17 -12
- package/dist/database/helpers/date/dialects/oracle.js +27 -27
- package/dist/database/helpers/date/dialects/sqlite.js +27 -28
- package/dist/database/helpers/date/index.js +20 -7
- package/dist/database/helpers/date/types.js +25 -22
- package/dist/database/helpers/fn/dialects/mssql.js +64 -63
- package/dist/database/helpers/fn/dialects/mysql.js +70 -67
- package/dist/database/helpers/fn/dialects/oracle.js +64 -63
- package/dist/database/helpers/fn/dialects/postgres.js +87 -84
- package/dist/database/helpers/fn/dialects/sqlite.js +61 -78
- package/dist/database/helpers/fn/index.js +20 -7
- package/dist/database/helpers/fn/json/parse-function.js +60 -61
- package/dist/database/helpers/fn/types.js +48 -56
- package/dist/database/helpers/geometry/dialects/mssql.js +42 -34
- package/dist/database/helpers/geometry/dialects/mysql.js +21 -12
- package/dist/database/helpers/geometry/dialects/oracle.js +49 -37
- package/dist/database/helpers/geometry/dialects/postgres.js +27 -18
- package/dist/database/helpers/geometry/dialects/redshift.js +21 -12
- package/dist/database/helpers/geometry/dialects/sqlite.js +19 -10
- package/dist/database/helpers/geometry/index.js +21 -7
- package/dist/database/helpers/geometry/types.js +59 -51
- package/dist/database/helpers/index.js +26 -21
- package/dist/database/helpers/number/dialects/default.js +7 -3
- package/dist/database/helpers/number/dialects/mssql.js +16 -11
- package/dist/database/helpers/number/dialects/oracle.js +12 -7
- package/dist/database/helpers/number/dialects/postgres.js +18 -15
- package/dist/database/helpers/number/dialects/sqlite.js +12 -7
- package/dist/database/helpers/number/index.js +20 -7
- package/dist/database/helpers/number/types.js +14 -9
- package/dist/database/helpers/number/utils/decimal-limit.js +17 -9
- package/dist/database/helpers/number/utils/maybe-stringify-big-int.js +9 -5
- package/dist/database/helpers/number/utils/number-in-range.js +18 -19
- package/dist/database/helpers/schema/dialects/cockroachdb.js +63 -81
- package/dist/database/helpers/schema/dialects/default.js +7 -3
- package/dist/database/helpers/schema/dialects/mssql.js +64 -84
- package/dist/database/helpers/schema/dialects/mysql.js +61 -103
- package/dist/database/helpers/schema/dialects/oracle.js +96 -116
- package/dist/database/helpers/schema/dialects/postgres.js +41 -52
- package/dist/database/helpers/schema/dialects/sqlite.js +31 -29
- package/dist/database/helpers/schema/index.js +22 -7
- package/dist/database/helpers/schema/types.js +151 -154
- package/dist/database/helpers/schema/utils/prep-query-params.js +38 -34
- package/dist/database/helpers/sequence/dialects/default.js +7 -3
- package/dist/database/helpers/sequence/dialects/postgres.js +23 -13
- package/dist/database/helpers/sequence/index.js +17 -7
- package/dist/database/helpers/sequence/types.js +11 -6
- package/dist/database/helpers/types.js +9 -6
- package/dist/database/index.js +255 -287
- package/dist/database/migrations/20201028A-remove-collection-foreign-keys.js +44 -40
- package/dist/database/migrations/20201029A-remove-system-relations.js +122 -120
- package/dist/database/migrations/20201029B-remove-system-collections.js +96 -91
- package/dist/database/migrations/20201029C-remove-system-fields.js +1527 -1636
- package/dist/database/migrations/20201105A-add-cascade-system-relations.js +114 -126
- package/dist/database/migrations/20201105B-change-webhook-url-type.js +15 -10
- package/dist/database/migrations/20210225A-add-relations-sort-field.js +30 -28
- package/dist/database/migrations/20210304A-remove-locked-fields.js +12 -8
- package/dist/database/migrations/20210312A-webhooks-collections-text.js +15 -10
- package/dist/database/migrations/20210331A-add-refresh-interval.js +12 -8
- package/dist/database/migrations/20210415A-make-filesize-nullable.js +18 -13
- package/dist/database/migrations/20210416A-add-collections-accountability.js +13 -9
- package/dist/database/migrations/20210422A-remove-files-interface.js +7 -5
- package/dist/database/migrations/20210506A-rename-interfaces.js +77 -70
- package/dist/database/migrations/20210510A-restructure-relations.js +26 -25
- package/dist/database/migrations/20210518A-add-foreign-key-constraints.js +83 -106
- package/dist/database/migrations/20210519A-add-system-fk-triggers.js +143 -162
- package/dist/database/migrations/20210521A-add-collections-icon-color.js +12 -8
- package/dist/database/migrations/20210525A-add-insights.js +33 -29
- package/dist/database/migrations/20210608A-add-deep-clone-config.js +12 -8
- package/dist/database/migrations/20210626A-change-filesize-bigint.js +22 -17
- package/dist/database/migrations/20210716A-add-conditions-to-fields.js +12 -8
- package/dist/database/migrations/20210721A-add-default-folder.js +16 -16
- package/dist/database/migrations/20210802A-replace-groups.js +35 -44
- package/dist/database/migrations/20210803A-add-required-to-fields.js +12 -8
- package/dist/database/migrations/20210805A-update-groups.js +26 -27
- package/dist/database/migrations/20210805B-change-image-metadata-structure.js +67 -82
- package/dist/database/migrations/20210811A-add-geometry-config.js +14 -10
- package/dist/database/migrations/20210831A-remove-limit-column.js +12 -8
- package/dist/database/migrations/20210903A-add-auth-provider.js +38 -33
- package/dist/database/migrations/20210907A-webhooks-collections-not-null.js +14 -11
- package/dist/database/migrations/20210910A-move-module-setup.js +18 -14
- package/dist/database/migrations/20210920A-webhooks-url-not-null.js +18 -19
- package/dist/database/migrations/20210924A-add-collection-organization.js +19 -17
- package/dist/database/migrations/20210927A-replace-fields-group.js +48 -48
- package/dist/database/migrations/20210927B-replace-m2m-interface.js +8 -14
- package/dist/database/migrations/20210929A-rename-login-action.js +8 -12
- package/dist/database/migrations/20211007A-update-presets.js +79 -96
- package/dist/database/migrations/20211009A-add-auth-data.js +12 -8
- package/dist/database/migrations/20211016A-add-webhook-headers.js +12 -8
- package/dist/database/migrations/20211103A-set-unique-to-user-token.js +12 -8
- package/dist/database/migrations/20211103B-update-special-geometry.js +8 -18
- package/dist/database/migrations/20211104A-remove-collections-listing.js +12 -8
- package/dist/database/migrations/20211118A-add-notifications.js +28 -23
- package/dist/database/migrations/20211211A-add-shares.js +37 -37
- package/dist/database/migrations/20211230A-add-project-descriptor.js +12 -8
- package/dist/database/migrations/20220303A-remove-default-project-color.js +20 -15
- package/dist/database/migrations/20220308A-add-bookmark-icon-and-color.js +14 -10
- package/dist/database/migrations/20220314A-add-translation-strings.js +12 -8
- package/dist/database/migrations/20220322A-rename-field-typecast-flags.js +59 -70
- package/dist/database/migrations/20220323A-add-field-validation.js +14 -10
- package/dist/database/migrations/20220325A-fix-typecast-flags.js +36 -43
- package/dist/database/migrations/20220325B-add-default-language.js +26 -21
- package/dist/database/migrations/20220402A-remove-default-value-panel-icon.js +20 -15
- package/dist/database/migrations/20220429A-add-flows.js +80 -75
- package/dist/database/migrations/20220429B-add-color-to-insights-icon.js +12 -8
- package/dist/database/migrations/20220429C-drop-non-null-from-ip-of-activity.js +12 -8
- package/dist/database/migrations/20220429D-drop-non-null-from-sender-of-notifications.js +12 -8
- package/dist/database/migrations/20220614A-rename-hook-trigger-to-event.js +8 -4
- package/dist/database/migrations/20220801A-update-notifications-timestamp-column.js +15 -12
- package/dist/database/migrations/20220802A-add-custom-aspect-ratios.js +12 -8
- package/dist/database/migrations/20220826A-add-origin-to-accountability.js +18 -14
- package/dist/database/migrations/20230401A-update-material-icons.js +22 -17
- package/dist/database/migrations/20230525A-add-preview-settings.js +12 -8
- package/dist/database/migrations/20230526A-migrate-translation-strings.js +56 -48
- package/dist/database/migrations/20230721A-require-shares-fields.js +52 -48
- package/dist/database/migrations/20230823A-add-content-versioning.js +34 -36
- package/dist/database/migrations/20230927A-themes.js +51 -47
- package/dist/database/migrations/20231009A-update-csv-fields-to-text.js +42 -38
- package/dist/database/migrations/20231009B-update-panel-options.js +64 -75
- package/dist/database/migrations/20231010A-add-extensions.js +11 -7
- package/dist/database/migrations/20231215A-add-focalpoints.js +14 -10
- package/dist/database/migrations/20240122A-add-report-url-fields.js +16 -12
- package/dist/database/migrations/20240204A-marketplace.js +98 -99
- package/dist/database/migrations/20240305A-change-useragent-type.js +16 -17
- package/dist/database/migrations/20240311A-deprecate-webhooks.js +97 -121
- package/dist/database/migrations/20240422A-public-registration.js +16 -12
- package/dist/database/migrations/20240515A-add-session-window.js +12 -8
- package/dist/database/migrations/20240701A-add-tus-data.js +14 -10
- package/dist/database/migrations/20240716A-update-files-date-fields.js +29 -27
- package/dist/database/migrations/20240806A-permissions-policies.js +202 -262
- package/dist/database/migrations/20240817A-update-icon-fields-length.js +50 -53
- package/dist/database/migrations/20240909A-separate-comments.js +53 -60
- package/dist/database/migrations/20240909B-consolidate-content-versioning.js +12 -8
- package/dist/database/migrations/20240924A-migrate-legacy-comments.js +67 -79
- package/dist/database/migrations/20240924B-populate-versioning-deltas.js +26 -31
- package/dist/database/migrations/20250224A-visual-editor.js +31 -31
- package/dist/database/migrations/20250609A-license-banner.js +17 -12
- package/dist/database/migrations/20250613A-add-project-id.js +22 -24
- package/dist/database/migrations/20250718A-add-direction.js +12 -8
- package/dist/database/migrations/20250813A-add-mcp.js +20 -16
- package/dist/database/migrations/20251012A-add-field-searchable.js +12 -8
- package/dist/database/migrations/20251014A-add-project-owner.js +40 -35
- package/dist/database/migrations/20251028A-add-retention-indexes.js +53 -40
- package/dist/database/migrations/20251103A-add-ai-settings.js +16 -12
- package/dist/database/migrations/20251224A-remove-webhooks.js +21 -17
- package/dist/database/migrations/20260110A-add-ai-provider-settings.js +45 -33
- package/dist/database/migrations/20260113A-add-revisions-index.js +49 -39
- package/dist/database/migrations/20260128A-add-collaborative-editing.js +12 -8
- package/dist/database/migrations/20260204A-add-deployment.js +34 -30
- package/dist/database/migrations/20260211A-add-deployment-webhooks.js +39 -35
- package/dist/database/migrations/run.js +113 -109
- package/dist/database/run-ast/lib/apply-query/add-join.js +81 -85
- package/dist/database/run-ast/lib/apply-query/aggregate.js +34 -23
- package/dist/database/run-ast/lib/apply-query/filter/get-filter-type.js +27 -19
- package/dist/database/run-ast/lib/apply-query/filter/index.js +136 -150
- package/dist/database/run-ast/lib/apply-query/filter/operator.js +174 -182
- package/dist/database/run-ast/lib/apply-query/filter/validate-operator.js +17 -17
- package/dist/database/run-ast/lib/apply-query/get-filter-path.js +17 -12
- package/dist/database/run-ast/lib/apply-query/get-operation.js +26 -17
- package/dist/database/run-ast/lib/apply-query/index.js +88 -88
- package/dist/database/run-ast/lib/apply-query/join-filter-with-cases.js +13 -11
- package/dist/database/run-ast/lib/apply-query/mock.js +9 -4
- package/dist/database/run-ast/lib/apply-query/pagination.js +14 -9
- package/dist/database/run-ast/lib/apply-query/search.js +75 -77
- package/dist/database/run-ast/lib/apply-query/sort.js +90 -86
- package/dist/database/run-ast/lib/get-db-query.js +181 -241
- package/dist/database/run-ast/lib/parse-current-level.js +54 -47
- package/dist/database/run-ast/modules/fetch-permitted-ast-root-fields.js +44 -27
- package/dist/database/run-ast/run-ast.js +131 -129
- package/dist/database/run-ast/types.js +1 -1
- package/dist/database/run-ast/utils/apply-case-when.js +29 -26
- package/dist/database/run-ast/utils/apply-function-to-column-name.js +29 -26
- package/dist/database/run-ast/utils/apply-parent-filters.js +58 -56
- package/dist/database/run-ast/utils/generate-alias.js +48 -52
- package/dist/database/run-ast/utils/get-column-pre-processor.js +66 -66
- package/dist/database/run-ast/utils/get-column.js +64 -64
- package/dist/database/run-ast/utils/get-field-alias.js +9 -5
- package/dist/database/run-ast/utils/get-inner-query-column-pre-processor.js +30 -23
- package/dist/database/run-ast/utils/merge-with-parent-items.js +127 -137
- package/dist/database/run-ast/utils/remove-temporary-fields.js +70 -78
- package/dist/database/run-ast/utils/with-preprocess-bindings.js +17 -14
- package/dist/database/seeds/run.js +77 -78
- package/dist/deployment/deployment.js +34 -29
- package/dist/deployment/drivers/index.js +4 -2
- package/dist/deployment/drivers/netlify.js +372 -358
- package/dist/deployment/drivers/vercel.js +276 -285
- package/dist/deployment/index.js +6 -2
- package/dist/deployment.js +66 -62
- package/dist/emitter.js +101 -89
- package/dist/extensions/index.js +12 -7
- package/dist/extensions/lib/get-extensions-path.js +13 -8
- package/dist/extensions/lib/get-extensions-settings.js +117 -128
- package/dist/extensions/lib/get-extensions.js +20 -11
- package/dist/extensions/lib/get-shared-deps-mapping.js +30 -26
- package/dist/extensions/lib/installation/index.js +12 -7
- package/dist/extensions/lib/installation/manager.js +100 -95
- package/dist/extensions/lib/sandbox/generate-api-extensions-sandbox-entrypoint.js +66 -43
- package/dist/extensions/lib/sandbox/generate-host-function-reference.js +19 -16
- package/dist/extensions/lib/sandbox/register/action.js +23 -17
- package/dist/extensions/lib/sandbox/register/call-reference.js +28 -21
- package/dist/extensions/lib/sandbox/register/filter.js +26 -20
- package/dist/extensions/lib/sandbox/register/index.js +7 -5
- package/dist/extensions/lib/sandbox/register/operation.js +27 -21
- package/dist/extensions/lib/sandbox/register/route.js +52 -43
- package/dist/extensions/lib/sandbox/sdk/generators/index.js +5 -3
- package/dist/extensions/lib/sandbox/sdk/generators/log.js +14 -11
- package/dist/extensions/lib/sandbox/sdk/generators/request.js +56 -48
- package/dist/extensions/lib/sandbox/sdk/generators/sleep.js +13 -10
- package/dist/extensions/lib/sandbox/sdk/index.js +4 -2
- package/dist/extensions/lib/sandbox/sdk/instantiate.js +32 -26
- package/dist/extensions/lib/sandbox/sdk/sdk.js +32 -9
- package/dist/extensions/lib/sandbox/sdk/utils/index.js +3 -1
- package/dist/extensions/lib/sandbox/sdk/utils/wrap.js +50 -47
- package/dist/extensions/lib/sync/status.js +30 -29
- package/dist/extensions/lib/sync/sync.js +83 -89
- package/dist/extensions/lib/sync/tracker.js +68 -71
- package/dist/extensions/lib/sync/utils.js +53 -54
- package/dist/extensions/lib/wrap-embeds.js +9 -6
- package/dist/extensions/manager.js +718 -746
- package/dist/flows.js +574 -427
- package/dist/index.js +3 -1
- package/dist/lock/index.js +3 -1
- package/dist/lock/lib/use-lock.js +28 -18
- package/dist/logger/index.js +186 -179
- package/dist/logger/logs-stream.js +45 -40
- package/dist/logger/redact-query.js +16 -12
- package/dist/mailer.js +61 -60
- package/dist/metrics/index.js +3 -1
- package/dist/metrics/lib/create-metrics.js +250 -233
- package/dist/metrics/lib/use-metrics.js +19 -14
- package/dist/metrics/types/metric.js +1 -1
- package/dist/middleware/authenticate.js +46 -47
- package/dist/middleware/cache.js +61 -57
- package/dist/middleware/collection-exists.js +24 -24
- package/dist/middleware/cors.js +17 -12
- package/dist/middleware/error-handler.js +77 -86
- package/dist/middleware/extract-token.js +37 -43
- package/dist/middleware/graphql.js +70 -68
- package/dist/middleware/rate-limiter-global.js +41 -38
- package/dist/middleware/rate-limiter-ip.js +36 -29
- package/dist/middleware/rate-limiter-registration.js +32 -29
- package/dist/middleware/request-counter.js +28 -0
- package/dist/middleware/respond.js +97 -109
- package/dist/middleware/sanitize-query.js +25 -27
- package/dist/middleware/schema.js +11 -6
- package/dist/middleware/use-collection.js +10 -5
- package/dist/middleware/validate-batch.js +41 -42
- package/dist/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.js +445 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/index.js +176 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/system/policy.js +54 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/any/any.js +13 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/any/index.js +3 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/argument/argument.js +15 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/argument/index.js +3 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/array/array.js +16 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/array/index.js +3 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/async-iterator/async-iterator.js +16 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/async-iterator/index.js +3 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/awaited/awaited.js +37 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/awaited/index.js +3 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/bigint/bigint.js +16 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/bigint/index.js +3 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/boolean/boolean.js +16 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/boolean/index.js +3 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/clone/index.js +4 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/clone/type.js +17 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/clone/value.js +35 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/composite/composite.js +42 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/composite/index.js +3 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/computed/computed.js +16 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/computed/index.js +3 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/const/const.js +52 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/const/index.js +3 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/constructor/constructor.js +17 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/constructor/index.js +3 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/constructor-parameters/constructor-parameters.js +14 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/constructor-parameters/index.js +3 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/create/immutable.js +32 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/create/index.js +3 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/create/type.js +20 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/date/date.js +15 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/date/index.js +3 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/discard/discard.js +12 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/discard/index.js +3 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/enum/enum.js +23 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/enum/index.js +3 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/error/error.js +10 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/error/index.js +3 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/exclude/exclude-from-mapped-result.js +20 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/exclude/exclude-from-template-literal.js +11 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/exclude/exclude.js +25 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/exclude/index.js +5 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/extends/extends-check.js +267 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/extends/extends-from-mapped-key.js +29 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/extends/extends-from-mapped-result.js +21 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/extends/extends-undefined.js +21 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/extends/extends.js +20 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/extends/index.js +7 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/extract/extract-from-mapped-result.js +20 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/extract/extract-from-template-literal.js +11 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/extract/extract.js +25 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/extract/index.js +5 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/function/function.js +17 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/function/index.js +3 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/guard/index.js +5 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/guard/kind.js +204 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/guard/type.js +293 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/guard/value.js +68 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/helpers/helpers.js +8 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/helpers/index.js +3 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/indexed/index.js +6 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-from-mapped-key.js +27 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-from-mapped-result.js +24 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-property-keys.js +24 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/indexed/indexed.js +67 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/instance-type/index.js +3 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/instance-type/instance-type.js +13 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/instantiate/index.js +3 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/instantiate/instantiate.js +102 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/integer/index.js +3 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/integer/integer.js +15 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/intersect/index.js +5 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/intersect/intersect-create.js +23 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/intersect/intersect-evaluated.js +35 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/intersect/intersect-type.js +3 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/intersect/intersect.js +17 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/intrinsic/capitalize.js +10 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/intrinsic/index.js +8 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/intrinsic/intrinsic-from-mapped-key.js +30 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/intrinsic/intrinsic.js +54 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/intrinsic/lowercase.js +10 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/intrinsic/uncapitalize.js +10 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/intrinsic/uppercase.js +10 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/iterator/index.js +3 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/iterator/iterator.js +16 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/keyof/index.js +6 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/keyof/keyof-from-mapped-result.js +21 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/keyof/keyof-property-entries.js +17 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/keyof/keyof-property-keys.js +52 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/keyof/keyof.js +38 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/literal/index.js +3 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/literal/literal.js +16 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/mapped/index.js +5 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/mapped/mapped-key.js +14 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/mapped/mapped-result.js +14 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/mapped/mapped.js +86 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/module/compute.js +144 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/module/index.js +3 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/module/module.js +44 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/never/index.js +3 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/never/never.js +15 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/not/index.js +3 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/not/not.js +15 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/null/index.js +3 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/null/null.js +15 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/number/index.js +3 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/number/number.js +15 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/object/index.js +3 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/object/object.js +33 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/omit/index.js +5 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/omit/omit-from-mapped-key.js +27 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/omit/omit-from-mapped-result.js +21 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/omit/omit.js +65 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/optional/index.js +4 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/optional/optional-from-mapped-result.js +20 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/optional/optional.js +29 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/parameters/index.js +3 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/parameters/parameters.js +14 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/partial/index.js +4 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/partial/partial-from-mapped-result.js +21 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/partial/partial.js +62 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/patterns/index.js +3 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/patterns/patterns.js +12 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/pick/index.js +5 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/pick/pick-from-mapped-key.js +27 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/pick/pick-from-mapped-result.js +21 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/pick/pick.js +63 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/promise/index.js +3 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/promise/promise.js +16 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/readonly/index.js +4 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/readonly/readonly-from-mapped-result.js +20 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/readonly/readonly.js +29 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/readonly-optional/index.js +3 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/readonly-optional/readonly-optional.js +13 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/record/index.js +3 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/record/record.js +92 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/recursive/index.js +3 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/recursive/recursive.js +24 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/ref/index.js +3 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/ref/ref.js +19 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/regexp/index.js +3 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/regexp/regexp.js +19 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/registry/format.js +30 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/registry/index.js +4 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/registry/type.js +30 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/required/index.js +4 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/required/required-from-mapped-result.js +20 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/required/required.js +60 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/rest/index.js +3 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/rest/rest.js +13 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/return-type/index.js +3 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/return-type/return-type.js +13 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/schema/anyschema.js +1 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/schema/index.js +4 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/schema/schema.js +3 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/sets/index.js +3 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/sets/set.js +42 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/static/index.js +3 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/static/static.js +1 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/string/index.js +3 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/string/string.js +15 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/symbol/index.js +3 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/symbol/symbol.js +15 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/symbols/index.js +3 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/symbols/symbols.js +14 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/template-literal/finite.js +28 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/template-literal/generate.js +37 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/template-literal/index.js +9 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/template-literal/parse.js +125 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/template-literal/pattern.js +24 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/template-literal/syntax.js +55 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/template-literal/template-literal.js +20 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/template-literal/union.js +16 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/transform/index.js +3 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/transform/transform.js +51 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/tuple/index.js +3 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/tuple/tuple.js +24 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/type/index.js +10 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/type/javascript.js +123 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/type/json.js +263 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/type/type.js +191 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/uint8array/index.js +3 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/uint8array/uint8array.js +15 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/undefined/index.js +3 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/undefined/undefined.js +15 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/union/index.js +5 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/union/union-create.js +14 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/union/union-evaluated.js +33 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/union/union-type.js +3 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/union/union.js +13 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/unknown/index.js +3 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/unknown/unknown.js +12 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/unsafe/index.js +3 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/unsafe/unsafe.js +12 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/void/index.js +3 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/void/void.js +15 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/value/guard/guard.js +140 -0
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/value/guard/index.js +3 -0
- package/dist/node_modules/.pnpm/@vitest_expect@3.2.4/node_modules/@vitest/expect/dist/index.js +1714 -0
- package/dist/node_modules/.pnpm/@vitest_pretty-format@3.2.4/node_modules/@vitest/pretty-format/dist/index.js +1287 -0
- package/dist/node_modules/.pnpm/@vitest_runner@3.2.4/node_modules/@vitest/runner/dist/chunk-hooks.js +2151 -0
- package/dist/node_modules/.pnpm/@vitest_runner@3.2.4/node_modules/@vitest/runner/dist/index.js +8 -0
- package/dist/node_modules/.pnpm/@vitest_runner@3.2.4/node_modules/@vitest/runner/dist/utils.js +8 -0
- package/dist/node_modules/.pnpm/@vitest_snapshot@3.2.4/node_modules/@vitest/snapshot/dist/index.js +2082 -0
- package/dist/node_modules/.pnpm/@vitest_spy@3.2.4/node_modules/@vitest/spy/dist/index.js +192 -0
- package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/chunk-_commonjsHelpers.js +158 -0
- package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/diff.js +1535 -0
- package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/error.js +155 -0
- package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/helpers.js +244 -0
- package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/index.js +621 -0
- package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/source-map.js +890 -0
- package/dist/node_modules/.pnpm/chai@5.3.3/node_modules/chai/index.js +3558 -0
- package/dist/node_modules/.pnpm/expect-type@1.2.2/node_modules/expect-type/dist/branding.js +13 -0
- package/dist/node_modules/.pnpm/expect-type@1.2.2/node_modules/expect-type/dist/index.js +115 -0
- package/dist/node_modules/.pnpm/expect-type@1.2.2/node_modules/expect-type/dist/messages.js +77 -0
- package/dist/node_modules/.pnpm/expect-type@1.2.2/node_modules/expect-type/dist/overloads.js +13 -0
- package/dist/node_modules/.pnpm/expect-type@1.2.2/node_modules/expect-type/dist/utils.js +30 -0
- package/dist/node_modules/.pnpm/js-tokens@9.0.1/node_modules/js-tokens/index.js +398 -0
- package/dist/node_modules/.pnpm/knex-mock-client@3.0.2_knex@3.1.0_mysql2@3.15.3_pg@8.16.3_sqlite3@5.1.7_tedious@18.6.1_/node_modules/knex-mock-client/dist/MockClient.js +79 -0
- package/dist/node_modules/.pnpm/knex-mock-client@3.0.2_knex@3.1.0_mysql2@3.15.3_pg@8.16.3_sqlite3@5.1.7_tedious@18.6.1_/node_modules/knex-mock-client/dist/MockConnection.js +64 -0
- package/dist/node_modules/.pnpm/knex-mock-client@3.0.2_knex@3.1.0_mysql2@3.15.3_pg@8.16.3_sqlite3@5.1.7_tedious@18.6.1_/node_modules/knex-mock-client/dist/Tracker.js +185 -0
- package/dist/node_modules/.pnpm/knex-mock-client@3.0.2_knex@3.1.0_mysql2@3.15.3_pg@8.16.3_sqlite3@5.1.7_tedious@18.6.1_/node_modules/knex-mock-client/dist/constants.js +30 -0
- package/dist/node_modules/.pnpm/knex-mock-client@3.0.2_knex@3.1.0_mysql2@3.15.3_pg@8.16.3_sqlite3@5.1.7_tedious@18.6.1_/node_modules/knex-mock-client/dist/index.js +37 -0
- package/dist/node_modules/.pnpm/knex-mock-client@3.0.2_knex@3.1.0_mysql2@3.15.3_pg@8.16.3_sqlite3@5.1.7_tedious@18.6.1_/node_modules/knex-mock-client/dist/utils.js +17 -0
- package/dist/node_modules/.pnpm/lodash.clonedeep@4.5.0/node_modules/lodash.clonedeep/index.js +1486 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/arguments.js +11 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/array.js +18 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/bigint.js +11 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/class.js +19 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/date.js +15 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/error.js +39 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/function.js +14 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/helpers.js +141 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/html.js +43 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/index.js +138 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/map.js +25 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/number.js +22 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/object.js +27 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/promise.js +6 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/regexp.js +12 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/set.js +18 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/string.js +27 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/symbol.js +10 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/typedarray.js +36 -0
- package/dist/node_modules/.pnpm/magic-string@0.30.21/node_modules/magic-string/dist/magic-string.es.js +1258 -0
- package/dist/node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/index.js +21 -0
- package/dist/node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.js +478 -0
- package/dist/node_modules/.pnpm/strip-literal@3.1.0/node_modules/strip-literal/dist/index.js +84 -0
- package/dist/node_modules/.pnpm/tinyrainbow@2.0.0/node_modules/tinyrainbow/dist/chunk-BVHSVHOK.js +85 -0
- package/dist/node_modules/.pnpm/tinyrainbow@2.0.0/node_modules/tinyrainbow/dist/node.js +15 -0
- package/dist/node_modules/.pnpm/tinyspy@4.0.4/node_modules/tinyspy/dist/index.js +158 -0
- package/dist/node_modules/.pnpm/vitest@3.2.4_@types_node@22.13.14_@vitest_ui@3.2.4_happy-dom@20.0.10_jiti@2.6.1_jsdom@2_4abc0aa80426c2cc5a9175f21e1d4ebb/node_modules/vitest/dist/chunks/_commonjsHelpers.BFTU3MAI.js +8 -0
- package/dist/node_modules/.pnpm/vitest@3.2.4_@types_node@22.13.14_@vitest_ui@3.2.4_happy-dom@20.0.10_jiti@2.6.1_jsdom@2_4abc0aa80426c2cc5a9175f21e1d4ebb/node_modules/vitest/dist/chunks/benchmark.CYdenmiT.js +41 -0
- package/dist/node_modules/.pnpm/vitest@3.2.4_@types_node@22.13.14_@vitest_ui@3.2.4_happy-dom@20.0.10_jiti@2.6.1_jsdom@2_4abc0aa80426c2cc5a9175f21e1d4ebb/node_modules/vitest/dist/chunks/date.Bq6ZW5rf.js +50 -0
- package/dist/node_modules/.pnpm/vitest@3.2.4_@types_node@22.13.14_@vitest_ui@3.2.4_happy-dom@20.0.10_jiti@2.6.1_jsdom@2_4abc0aa80426c2cc5a9175f21e1d4ebb/node_modules/vitest/dist/chunks/index.CdQS2e2Q.js +38 -0
- package/dist/node_modules/.pnpm/vitest@3.2.4_@types_node@22.13.14_@vitest_ui@3.2.4_happy-dom@20.0.10_jiti@2.6.1_jsdom@2_4abc0aa80426c2cc5a9175f21e1d4ebb/node_modules/vitest/dist/chunks/utils.XdZDrNZV.js +66 -0
- package/dist/node_modules/.pnpm/vitest@3.2.4_@types_node@22.13.14_@vitest_ui@3.2.4_happy-dom@20.0.10_jiti@2.6.1_jsdom@2_4abc0aa80426c2cc5a9175f21e1d4ebb/node_modules/vitest/dist/chunks/vi.bdSIJ99Y.js +2986 -0
- package/dist/node_modules/.pnpm/vitest@3.2.4_@types_node@22.13.14_@vitest_ui@3.2.4_happy-dom@20.0.10_jiti@2.6.1_jsdom@2_4abc0aa80426c2cc5a9175f21e1d4ebb/node_modules/vitest/dist/index.js +24 -0
- package/dist/operations/condition/index.js +23 -21
- package/dist/operations/exec/index.js +49 -44
- package/dist/operations/item-create/index.js +49 -36
- package/dist/operations/item-delete/index.js +56 -44
- package/dist/operations/item-read/index.js +56 -44
- package/dist/operations/item-update/index.js +62 -51
- package/dist/operations/json-web-token/index.js +33 -35
- package/dist/operations/log/index.js +14 -9
- package/dist/operations/mail/index.js +39 -25
- package/dist/operations/mail/rate-limiter.js +26 -25
- package/dist/operations/notification/index.js +52 -42
- package/dist/operations/request/index.js +47 -39
- package/dist/operations/sleep/index.js +11 -6
- package/dist/operations/throw-error/index.js +14 -9
- package/dist/operations/transform/index.js +12 -7
- package/dist/operations/trigger/index.js +42 -37
- package/dist/packages/types/dist/index.js +403 -0
- package/dist/permissions/cache.js +28 -25
- package/dist/permissions/lib/fetch-permissions.js +33 -26
- package/dist/permissions/lib/fetch-policies.js +42 -41
- package/dist/permissions/lib/fetch-roles-tree.js +10 -5
- package/dist/permissions/lib/with-app-minimal-permissions.js +14 -9
- package/dist/permissions/modules/fetch-accountability-collection-access/fetch-accountability-collection-access.js +56 -54
- package/dist/permissions/modules/fetch-accountability-policy-globals/fetch-accountability-policy-globals.js +14 -15
- package/dist/permissions/modules/fetch-allowed-collections/fetch-allowed-collections.js +26 -11
- package/dist/permissions/modules/fetch-allowed-field-map/fetch-allowed-field-map.js +40 -25
- package/dist/permissions/modules/fetch-allowed-fields/fetch-allowed-fields.js +34 -19
- package/dist/permissions/modules/fetch-global-access/fetch-global-access.js +33 -26
- package/dist/permissions/modules/fetch-inconsistent-field-map/fetch-inconsistent-field-map.js +38 -25
- package/dist/permissions/modules/fetch-policies-ip-access/fetch-policies-ip-access.js +27 -27
- package/dist/permissions/modules/process-ast/lib/extract-fields-from-children.js +33 -48
- package/dist/permissions/modules/process-ast/lib/extract-fields-from-query.js +55 -55
- package/dist/permissions/modules/process-ast/lib/field-map-from-ast.js +15 -7
- package/dist/permissions/modules/process-ast/lib/get-cases.js +30 -39
- package/dist/permissions/modules/process-ast/lib/inject-cases.js +44 -50
- package/dist/permissions/modules/process-ast/process-ast.js +45 -38
- package/dist/permissions/modules/process-ast/types.js +1 -1
- package/dist/permissions/modules/process-ast/utils/collections-in-field-map.js +10 -6
- package/dist/permissions/modules/process-ast/utils/context-has-dynamic-variables.js +6 -2
- package/dist/permissions/modules/process-ast/utils/dedupe-access.js +32 -28
- package/dist/permissions/modules/process-ast/utils/extract-paths-from-query.js +54 -58
- package/dist/permissions/modules/process-ast/utils/find-related-collection.js +12 -8
- package/dist/permissions/modules/process-ast/utils/flatten-filter.js +30 -33
- package/dist/permissions/modules/process-ast/utils/format-a2o-key.js +6 -2
- package/dist/permissions/modules/process-ast/utils/get-info-for-path.js +13 -6
- package/dist/permissions/modules/process-ast/utils/has-item-permissions.js +6 -2
- package/dist/permissions/modules/process-ast/utils/stringify-query-path.js +6 -2
- package/dist/permissions/modules/process-ast/utils/validate-path/create-error.js +13 -14
- package/dist/permissions/modules/process-ast/utils/validate-path/validate-path-existence.js +16 -11
- package/dist/permissions/modules/process-ast/utils/validate-path/validate-path-permissions.js +28 -27
- package/dist/permissions/modules/process-payload/lib/is-field-nullable.js +13 -10
- package/dist/permissions/modules/process-payload/process-payload.js +77 -82
- package/dist/permissions/modules/validate-access/lib/validate-collection-access.js +19 -9
- package/dist/permissions/modules/validate-access/lib/validate-item-access.js +108 -99
- package/dist/permissions/modules/validate-access/validate-access.js +33 -39
- package/dist/permissions/modules/validate-remaining-admin/validate-remaining-admin-count.js +10 -7
- package/dist/permissions/modules/validate-remaining-admin/validate-remaining-admin-users.js +14 -9
- package/dist/permissions/types.js +1 -1
- package/dist/permissions/utils/create-default-accountability.js +14 -10
- package/dist/permissions/utils/default-permission.js +10 -6
- package/dist/permissions/utils/extract-required-dynamic-variable-context.js +47 -42
- package/dist/permissions/utils/fetch-dynamic-variable-data.js +62 -69
- package/dist/permissions/utils/fetch-raw-permissions.js +33 -37
- package/dist/permissions/utils/fetch-share-info.js +17 -8
- package/dist/permissions/utils/filter-policies-by-ip.js +16 -14
- package/dist/permissions/utils/get-permissions-for-share.js +163 -176
- package/dist/permissions/utils/get-unaliased-field-key.js +21 -23
- package/dist/permissions/utils/merge-fields.js +23 -28
- package/dist/permissions/utils/merge-permissions.js +78 -104
- package/dist/permissions/utils/process-permissions.js +15 -10
- package/dist/permissions/utils/with-cache.js +30 -25
- package/dist/rate-limiter.js +28 -26
- package/dist/redis/index.js +5 -3
- package/dist/redis/lib/create-redis.js +15 -10
- package/dist/redis/lib/use-redis.js +21 -19
- package/dist/redis/utils/redis-config-available.js +14 -9
- package/dist/request/agent-with-ip-validation.js +27 -35
- package/dist/request/index.js +19 -14
- package/dist/request/is-denied-ip.js +41 -39
- package/dist/schedules/metrics.js +45 -42
- package/dist/schedules/project.js +26 -25
- package/dist/schedules/retention.js +105 -106
- package/dist/schedules/telemetry.js +30 -26
- package/dist/schedules/tus.js +24 -21
- package/dist/server.js +155 -151
- package/dist/services/access.js +43 -43
- package/dist/services/activity.js +11 -6
- package/dist/services/assets/name-deduper.js +28 -23
- package/dist/services/assets.js +292 -300
- package/dist/services/authentication.js +410 -444
- package/dist/services/collections.js +592 -646
- package/dist/services/comments.js +143 -132
- package/dist/services/dashboards.js +11 -6
- package/dist/services/deployment-projects.js +135 -138
- package/dist/services/deployment-runs.js +87 -92
- package/dist/services/deployment.js +459 -449
- package/dist/services/extensions.js +211 -227
- package/dist/services/fields/build-collection-and-field-relations.js +53 -53
- package/dist/services/fields/get-collection-meta-updates.js +68 -69
- package/dist/services/fields/get-collection-relation-list.js +26 -26
- package/dist/services/fields.js +732 -810
- package/dist/services/files/lib/extract-metadata.js +34 -31
- package/dist/services/files/lib/get-sharp-instance.js +14 -9
- package/dist/services/files/utils/get-metadata.js +101 -105
- package/dist/services/files/utils/parse-image-metadata.js +70 -64
- package/dist/services/files.js +409 -328
- package/dist/services/flows.js +34 -27
- package/dist/services/folders.js +83 -81
- package/dist/services/graphql/errors/execution.js +7 -2
- package/dist/services/graphql/errors/format.js +16 -11
- package/dist/services/graphql/errors/index.js +4 -2
- package/dist/services/graphql/errors/validation.js +7 -2
- package/dist/services/graphql/index.js +95 -94
- package/dist/services/graphql/resolvers/get-collection-type.js +34 -33
- package/dist/services/graphql/resolvers/get-field-type.js +51 -50
- package/dist/services/graphql/resolvers/get-relation-type.js +41 -38
- package/dist/services/graphql/resolvers/mutation.js +68 -73
- package/dist/services/graphql/resolvers/query.js +68 -68
- package/dist/services/graphql/resolvers/system-admin.js +279 -286
- package/dist/services/graphql/resolvers/system-global.js +414 -432
- package/dist/services/graphql/resolvers/system.js +406 -459
- package/dist/services/graphql/schema/get-types.js +182 -220
- package/dist/services/graphql/schema/index.js +189 -185
- package/dist/services/graphql/schema/parse-args.js +28 -33
- package/dist/services/graphql/schema/parse-query.js +106 -103
- package/dist/services/graphql/schema/read.js +451 -735
- package/dist/services/graphql/schema/write.js +119 -141
- package/dist/services/graphql/schema-cache.js +13 -7
- package/dist/services/graphql/subscription.js +91 -94
- package/dist/services/graphql/types/bigint.js +41 -42
- package/dist/services/graphql/types/date.js +10 -5
- package/dist/services/graphql/types/geojson.js +11 -6
- package/dist/services/graphql/types/hash.js +10 -5
- package/dist/services/graphql/types/string-or-float.js +31 -29
- package/dist/services/graphql/types/void.js +18 -13
- package/dist/services/graphql/utils/add-path-to-validation-error.js +18 -14
- package/dist/services/graphql/utils/aggregate-query.js +33 -37
- package/dist/services/graphql/utils/dedupe-resolvers.js +62 -0
- package/dist/services/graphql/utils/filter-replace-m2a.js +66 -63
- package/dist/services/graphql/utils/process-error.js +40 -41
- package/dist/services/graphql/utils/replace-fragments.js +30 -19
- package/dist/services/graphql/utils/replace-funcs.js +23 -19
- package/dist/services/graphql/utils/sanitize-gql-schema.js +79 -73
- package/dist/services/import-export.js +671 -633
- package/dist/services/index.js +95 -41
- package/dist/services/items.js +854 -945
- package/dist/services/mail/index.js +106 -104
- package/dist/services/mail/rate-limiter.js +26 -25
- package/dist/services/meta.js +71 -63
- package/dist/services/notifications.js +66 -58
- package/dist/services/operations.js +30 -25
- package/dist/services/panels.js +11 -6
- package/dist/services/payload.js +745 -832
- package/dist/services/permissions.js +143 -132
- package/dist/services/policies.js +74 -87
- package/dist/services/presets.js +11 -6
- package/dist/services/relations.js +438 -494
- package/dist/services/revisions.js +50 -44
- package/dist/services/roles.js +81 -87
- package/dist/services/schema.js +50 -52
- package/dist/services/server.js +320 -384
- package/dist/services/settings.js +31 -21
- package/dist/services/shares.js +138 -141
- package/dist/services/specifications.js +396 -526
- package/dist/services/tfa.js +64 -65
- package/dist/services/translations.js +46 -36
- package/dist/services/tus/data-store.js +186 -214
- package/dist/services/tus/index.js +4 -2
- package/dist/services/tus/lockers.js +77 -81
- package/dist/services/tus/server.js +109 -113
- package/dist/services/tus/utils/wait-timeout.js +16 -12
- package/dist/services/users.js +490 -525
- package/dist/services/utils.js +102 -129
- package/dist/services/versions.js +303 -314
- package/dist/services/websocket.js +45 -36
- package/dist/start.js +6 -1
- package/dist/storage/get-storage-driver.js +18 -15
- package/dist/storage/index.js +18 -16
- package/dist/storage/register-drivers.js +20 -17
- package/dist/storage/register-locations.js +28 -17
- package/dist/synchronization.js +106 -103
- package/dist/telemetry/counter/use-buffered-counter.js +138 -0
- package/dist/telemetry/counter/use-counters.js +32 -0
- package/dist/telemetry/index.js +5 -3
- package/dist/telemetry/lib/get-report.js +72 -58
- package/dist/telemetry/lib/send-report.js +24 -23
- package/dist/telemetry/lib/track.js +32 -28
- package/dist/telemetry/types/report.js +1 -1
- package/dist/telemetry/utils/check-user-limits.js +20 -16
- package/dist/telemetry/utils/format-api-request-counts.js +26 -0
- package/dist/telemetry/utils/get-extension-count.js +21 -18
- package/dist/telemetry/utils/get-field-count.js +12 -11
- package/dist/telemetry/utils/get-filesize-sum.js +9 -6
- package/dist/telemetry/utils/get-item-count.js +40 -34
- package/dist/telemetry/utils/get-random-wait-time.js +8 -4
- package/dist/telemetry/utils/get-settings.js +37 -34
- package/dist/telemetry/utils/get-user-item-count.js +24 -18
- package/dist/telemetry/utils/should-check-user-limits.js +14 -11
- package/dist/test-utils/README.md +316 -5
- package/dist/test-utils/cache.js +62 -57
- package/dist/test-utils/controllers.js +94 -93
- package/dist/test-utils/database.js +50 -50
- package/dist/test-utils/emitter.js +36 -36
- package/dist/test-utils/env.js +77 -0
- package/dist/test-utils/knex.js +208 -254
- package/dist/test-utils/schema.js +33 -33
- package/dist/test-utils/services/fields-service.js +36 -35
- package/dist/test-utils/services/files-service.js +33 -32
- package/dist/test-utils/services/folders-service.js +32 -31
- package/dist/test-utils/services/items-service.js +50 -35
- package/dist/test-utils/storage.js +150 -0
- package/dist/types/ast.js +1 -1
- package/dist/types/auth.js +1 -1
- package/dist/types/collection.js +1 -1
- package/dist/types/events.js +1 -1
- package/dist/types/index.js +9 -7
- package/dist/types/meta.js +9 -5
- package/dist/types/migration.js +1 -1
- package/dist/types/revision.js +1 -1
- package/dist/types/rolemap.js +1 -1
- package/dist/utils/apply-diff.js +276 -291
- package/dist/utils/apply-snapshot.js +27 -13
- package/dist/utils/async-handler.js +5 -1
- package/dist/utils/calculate-field-depth.js +70 -69
- package/dist/utils/compress.js +13 -10
- package/dist/utils/construct-flow-tree.js +29 -24
- package/dist/utils/create-admin.js +54 -46
- package/dist/utils/deep-map-response.js +64 -59
- package/dist/utils/delete-from-require-cache.js +15 -11
- package/dist/utils/destroy-piped-stream.js +13 -0
- package/dist/utils/encrypt.js +59 -59
- package/dist/utils/fetch-user-count/fetch-access-lookup.js +22 -22
- package/dist/utils/fetch-user-count/fetch-access-roles.js +31 -35
- package/dist/utils/fetch-user-count/fetch-active-users.js +6 -2
- package/dist/utils/fetch-user-count/fetch-user-count.js +56 -62
- package/dist/utils/fetch-user-count/get-user-count-query.js +19 -16
- package/dist/utils/filter-items.js +27 -30
- package/dist/utils/freeze-schema.js +28 -29
- package/dist/utils/generate-hash.js +11 -8
- package/dist/utils/generate-translations.js +436 -0
- package/dist/utils/get-accountability-for-role.js +35 -30
- package/dist/utils/get-accountability-for-token.js +50 -53
- package/dist/utils/get-address.js +20 -17
- package/dist/utils/get-allowed-log-levels.js +12 -9
- package/dist/utils/get-auth-providers.js +30 -23
- package/dist/utils/get-cache-headers.js +30 -37
- package/dist/utils/get-cache-key.js +29 -26
- package/dist/utils/get-collection-from-alias.js +14 -10
- package/dist/utils/get-column-path.js +62 -61
- package/dist/utils/get-config-from-env.js +43 -45
- package/dist/utils/get-default-index-name.js +23 -20
- package/dist/utils/get-default-value.js +43 -52
- package/dist/utils/get-field-relational-depth.js +24 -20
- package/dist/utils/get-field-system-rows.js +19 -16
- package/dist/utils/get-graphql-query-and-variables.js +9 -4
- package/dist/utils/get-graphql-type.js +32 -38
- package/dist/utils/get-ip-from-req.js +38 -42
- package/dist/utils/get-local-type.js +119 -129
- package/dist/utils/get-milliseconds.js +13 -8
- package/dist/utils/get-module-default.js +9 -5
- package/dist/utils/get-schema.js +160 -165
- package/dist/utils/get-secret.js +18 -13
- package/dist/utils/get-service.js +63 -59
- package/dist/utils/get-snapshot-diff.js +106 -134
- package/dist/utils/get-snapshot.js +70 -55
- package/dist/utils/get-string-byte-size.js +8 -4
- package/dist/utils/get-versioned-hash.js +12 -4
- package/dist/utils/import-file-url.js +10 -5
- package/dist/utils/is-directus-jwt.js +17 -14
- package/dist/utils/is-field-allowed.js +11 -7
- package/dist/utils/is-url-allowed.js +29 -29
- package/dist/utils/is-valid-uuid.js +22 -18
- package/dist/utils/job-queue.js +29 -25
- package/dist/utils/jwt.js +30 -27
- package/dist/utils/md.js +12 -7
- package/dist/utils/parse-filter-key.js +21 -14
- package/dist/utils/parse-numeric-string.js +20 -20
- package/dist/utils/parse-value.js +12 -9
- package/dist/utils/permissions-cacheable.js +45 -37
- package/dist/utils/redact-object.js +120 -125
- package/dist/utils/reduce-schema.js +53 -60
- package/dist/utils/require-text.js +8 -3
- package/dist/utils/require-yaml.js +10 -5
- package/dist/utils/sanitize-query.js +195 -213
- package/dist/utils/sanitize-schema.js +102 -83
- package/dist/utils/schedule.js +28 -24
- package/dist/utils/should-clear-cache.js +23 -18
- package/dist/utils/should-skip-cache.js +39 -40
- package/dist/utils/split-fields.js +33 -30
- package/dist/utils/stall.js +36 -32
- package/dist/utils/store.js +40 -0
- package/dist/utils/transaction.js +82 -81
- package/dist/utils/transformations.js +125 -129
- package/dist/utils/translations-shared.js +56 -0
- package/dist/utils/translations-validation.js +9 -0
- package/dist/utils/url.js +67 -66
- package/dist/utils/user-name.js +18 -14
- package/dist/utils/validate-diff.js +124 -150
- package/dist/utils/validate-env.js +16 -11
- package/dist/utils/validate-keys.js +22 -19
- package/dist/utils/validate-query.js +185 -198
- package/dist/utils/validate-snapshot.js +63 -73
- package/dist/utils/validate-storage.js +37 -35
- package/dist/utils/validate-user-count-integrity.js +28 -20
- package/dist/utils/verify-session-jwt.js +21 -21
- package/dist/utils/versioning/handle-version.js +96 -95
- package/dist/utils/versioning/merge-version-data.js +14 -9
- package/dist/utils/versioning/split-recursive.js +40 -26
- package/dist/websocket/authenticate.js +67 -66
- package/dist/websocket/collab/calculate-cache-metadata.js +99 -118
- package/dist/websocket/collab/collab.js +420 -479
- package/dist/websocket/collab/constants.js +16 -12
- package/dist/websocket/collab/filter-to-fields.js +18 -10
- package/dist/websocket/collab/messenger.js +252 -224
- package/dist/websocket/collab/payload-permissions.js +140 -149
- package/dist/websocket/collab/permissions-cache.js +188 -202
- package/dist/websocket/collab/room.js +569 -588
- package/dist/websocket/collab/store.js +9 -31
- package/dist/websocket/collab/types.js +1 -1
- package/dist/websocket/collab/verify-permissions.js +116 -98
- package/dist/websocket/controllers/base.js +331 -352
- package/dist/websocket/controllers/graphql.js +98 -104
- package/dist/websocket/controllers/hooks.js +117 -118
- package/dist/websocket/controllers/index.js +31 -29
- package/dist/websocket/controllers/logs.js +65 -53
- package/dist/websocket/controllers/rest.js +59 -47
- package/dist/websocket/errors.js +62 -55
- package/dist/websocket/handlers/heartbeat.js +77 -77
- package/dist/websocket/handlers/index.js +36 -35
- package/dist/websocket/handlers/items.js +111 -109
- package/dist/websocket/handlers/logs.js +122 -120
- package/dist/websocket/handlers/subscribe.js +165 -182
- package/dist/websocket/messages.js +90 -93
- package/dist/websocket/types.js +1 -1
- package/dist/websocket/utils/get-expires-at-for-token.js +12 -7
- package/dist/websocket/utils/items.js +123 -123
- package/dist/websocket/utils/message.js +26 -24
- package/dist/websocket/utils/wait-for-message.js +46 -43
- package/package.json +35 -32
- package/dist/ai/chat/constants/system-prompt.d.ts +0 -1
- package/dist/ai/chat/controllers/chat.post.d.ts +0 -2
- package/dist/ai/chat/lib/create-ui-stream.d.ts +0 -16
- package/dist/ai/chat/lib/transform-file-parts.d.ts +0 -12
- package/dist/ai/chat/middleware/load-settings.d.ts +0 -2
- package/dist/ai/chat/models/chat-request.d.ts +0 -167
- package/dist/ai/chat/models/providers.d.ts +0 -23
- package/dist/ai/chat/router.d.ts +0 -1
- package/dist/ai/chat/utils/chat-request-tool-to-ai-sdk-tool.d.ts +0 -9
- package/dist/ai/chat/utils/fix-error-tool-calls.d.ts +0 -12
- package/dist/ai/chat/utils/format-context.d.ts +0 -5
- package/dist/ai/chat/utils/parse-json-schema-7.d.ts +0 -13
- package/dist/ai/files/adapters/anthropic.d.ts +0 -3
- package/dist/ai/files/adapters/google.d.ts +0 -3
- package/dist/ai/files/adapters/index.d.ts +0 -3
- package/dist/ai/files/adapters/openai.d.ts +0 -3
- package/dist/ai/files/controllers/upload.d.ts +0 -2
- package/dist/ai/files/lib/fetch-provider.d.ts +0 -1
- package/dist/ai/files/lib/upload-to-provider.d.ts +0 -4
- package/dist/ai/files/router.d.ts +0 -1
- package/dist/ai/files/types.d.ts +0 -5
- package/dist/ai/mcp/index.d.ts +0 -1
- package/dist/ai/mcp/server.d.ts +0 -126
- package/dist/ai/mcp/transport.d.ts +0 -13
- package/dist/ai/mcp/types.d.ts +0 -15
- package/dist/ai/providers/anthropic-file-support.d.ts +0 -12
- package/dist/ai/providers/index.d.ts +0 -3
- package/dist/ai/providers/options.d.ts +0 -14
- package/dist/ai/providers/registry.d.ts +0 -6
- package/dist/ai/providers/types.d.ts +0 -34
- package/dist/ai/tools/assets/index.d.ts +0 -3
- package/dist/ai/tools/collections/index.d.ts +0 -84
- package/dist/ai/tools/define-tool.d.ts +0 -2
- package/dist/ai/tools/fields/index.d.ts +0 -101
- package/dist/ai/tools/files/index.d.ts +0 -235
- package/dist/ai/tools/flows/index.d.ts +0 -323
- package/dist/ai/tools/folders/index.d.ts +0 -95
- package/dist/ai/tools/index.d.ts +0 -15
- package/dist/ai/tools/items/index.d.ts +0 -87
- package/dist/ai/tools/operations/index.d.ts +0 -217
- package/dist/ai/tools/relations/index.d.ts +0 -73
- package/dist/ai/tools/schema/index.d.ts +0 -54
- package/dist/ai/tools/schema.d.ts +0 -485
- package/dist/ai/tools/system/index.d.ts +0 -3
- package/dist/ai/tools/trigger-flow/index.d.ts +0 -8
- package/dist/ai/tools/types.d.ts +0 -40
- package/dist/ai/tools/utils.d.ts +0 -9
- package/dist/app.d.ts +0 -2
- package/dist/auth/auth.d.ts +0 -47
- package/dist/auth/drivers/index.d.ts +0 -5
- package/dist/auth/drivers/ldap.d.ts +0 -18
- package/dist/auth/drivers/local.d.ts +0 -9
- package/dist/auth/drivers/oauth2.d.ts +0 -18
- package/dist/auth/drivers/openid.d.ts +0 -19
- package/dist/auth/drivers/saml.d.ts +0 -13
- package/dist/auth/utils/generate-callback-url.d.ts +0 -11
- package/dist/auth/utils/resolve-login-redirect.d.ts +0 -11
- package/dist/auth.d.ts +0 -3
- package/dist/bus/index.d.ts +0 -1
- package/dist/bus/lib/use-bus.d.ts +0 -9
- package/dist/cache.d.ts +0 -31
- package/dist/cli/commands/bootstrap/index.d.ts +0 -3
- package/dist/cli/commands/count/index.d.ts +0 -1
- package/dist/cli/commands/database/install.d.ts +0 -1
- package/dist/cli/commands/database/migrate.d.ts +0 -1
- package/dist/cli/commands/init/index.d.ts +0 -1
- package/dist/cli/commands/init/questions.d.ts +0 -21
- package/dist/cli/commands/roles/create.d.ts +0 -5
- package/dist/cli/commands/schema/apply.d.ts +0 -9
- package/dist/cli/commands/schema/snapshot.d.ts +0 -4
- package/dist/cli/commands/security/key.d.ts +0 -1
- package/dist/cli/commands/security/secret.d.ts +0 -1
- package/dist/cli/commands/users/create.d.ts +0 -5
- package/dist/cli/commands/users/passwd.d.ts +0 -4
- package/dist/cli/index.d.ts +0 -2
- package/dist/cli/load-extensions.d.ts +0 -1
- package/dist/cli/run.d.ts +0 -1
- package/dist/cli/utils/create-db-connection.d.ts +0 -13
- package/dist/cli/utils/create-env/index.d.ts +0 -3
- package/dist/cli/utils/drivers.d.ts +0 -3
- package/dist/constants.d.ts +0 -30
- package/dist/controllers/access.d.ts +0 -2
- package/dist/controllers/activity.d.ts +0 -2
- package/dist/controllers/assets.d.ts +0 -2
- package/dist/controllers/auth.d.ts +0 -2
- package/dist/controllers/collections.d.ts +0 -2
- package/dist/controllers/comments.d.ts +0 -2
- package/dist/controllers/dashboards.d.ts +0 -2
- package/dist/controllers/deployment-webhooks.d.ts +0 -2
- package/dist/controllers/deployment.d.ts +0 -2
- package/dist/controllers/extensions.d.ts +0 -2
- package/dist/controllers/fields.d.ts +0 -2
- package/dist/controllers/files.d.ts +0 -4
- package/dist/controllers/flows.d.ts +0 -2
- package/dist/controllers/folders.d.ts +0 -2
- package/dist/controllers/graphql.d.ts +0 -2
- package/dist/controllers/items.d.ts +0 -2
- package/dist/controllers/mcp.d.ts +0 -2
- package/dist/controllers/metrics.d.ts +0 -2
- package/dist/controllers/not-found.d.ts +0 -14
- package/dist/controllers/notifications.d.ts +0 -2
- package/dist/controllers/operations.d.ts +0 -2
- package/dist/controllers/panels.d.ts +0 -2
- package/dist/controllers/permissions.d.ts +0 -2
- package/dist/controllers/policies.d.ts +0 -2
- package/dist/controllers/presets.d.ts +0 -2
- package/dist/controllers/relations.d.ts +0 -2
- package/dist/controllers/revisions.d.ts +0 -2
- package/dist/controllers/roles.d.ts +0 -2
- package/dist/controllers/schema.d.ts +0 -2
- package/dist/controllers/server.d.ts +0 -2
- package/dist/controllers/settings.d.ts +0 -2
- package/dist/controllers/shares.d.ts +0 -2
- package/dist/controllers/translations.d.ts +0 -2
- package/dist/controllers/tus.d.ts +0 -2
- package/dist/controllers/users.d.ts +0 -2
- package/dist/controllers/utils.d.ts +0 -2
- package/dist/controllers/versions.d.ts +0 -2
- package/dist/database/errors/dialects/mssql.d.ts +0 -3
- package/dist/database/errors/dialects/mysql.d.ts +0 -3
- package/dist/database/errors/dialects/oracle.d.ts +0 -2
- package/dist/database/errors/dialects/postgres.d.ts +0 -3
- package/dist/database/errors/dialects/sqlite.d.ts +0 -3
- package/dist/database/errors/dialects/types.d.ts +0 -41
- package/dist/database/errors/translate.d.ts +0 -12
- package/dist/database/get-ast-from-query/get-ast-from-query.d.ts +0 -16
- package/dist/database/get-ast-from-query/lib/convert-wildcards.d.ts +0 -15
- package/dist/database/get-ast-from-query/lib/parse-fields.d.ts +0 -17
- package/dist/database/get-ast-from-query/utils/get-allowed-sort.d.ts +0 -9
- package/dist/database/get-ast-from-query/utils/get-deep-query.d.ts +0 -14
- package/dist/database/get-ast-from-query/utils/get-related-collection.d.ts +0 -2
- package/dist/database/helpers/capabilities/dialects/default.d.ts +0 -3
- package/dist/database/helpers/capabilities/dialects/mysql.d.ts +0 -4
- package/dist/database/helpers/capabilities/dialects/postgres.d.ts +0 -5
- package/dist/database/helpers/capabilities/index.d.ts +0 -7
- package/dist/database/helpers/capabilities/types.d.ts +0 -11
- package/dist/database/helpers/date/dialects/default.d.ts +0 -3
- package/dist/database/helpers/date/dialects/mssql.d.ts +0 -4
- package/dist/database/helpers/date/dialects/mysql.d.ts +0 -5
- package/dist/database/helpers/date/dialects/oracle.d.ts +0 -5
- package/dist/database/helpers/date/dialects/sqlite.d.ts +0 -5
- package/dist/database/helpers/date/index.d.ts +0 -7
- package/dist/database/helpers/date/types.d.ts +0 -7
- package/dist/database/helpers/fn/dialects/mssql.d.ts +0 -15
- package/dist/database/helpers/fn/dialects/mysql.d.ts +0 -16
- package/dist/database/helpers/fn/dialects/oracle.d.ts +0 -15
- package/dist/database/helpers/fn/dialects/postgres.d.ts +0 -28
- package/dist/database/helpers/fn/dialects/sqlite.d.ts +0 -15
- package/dist/database/helpers/fn/index.d.ts +0 -7
- package/dist/database/helpers/fn/json/parse-function.d.ts +0 -19
- package/dist/database/helpers/fn/types.d.ts +0 -34
- package/dist/database/helpers/geometry/dialects/mssql.d.ts +0 -14
- package/dist/database/helpers/geometry/dialects/mysql.d.ts +0 -7
- package/dist/database/helpers/geometry/dialects/oracle.d.ts +0 -15
- package/dist/database/helpers/geometry/dialects/postgres.d.ts +0 -10
- package/dist/database/helpers/geometry/dialects/redshift.d.ts +0 -7
- package/dist/database/helpers/geometry/dialects/sqlite.d.ts +0 -6
- package/dist/database/helpers/geometry/index.d.ts +0 -7
- package/dist/database/helpers/geometry/types.d.ts +0 -20
- package/dist/database/helpers/index.d.ts +0 -19
- package/dist/database/helpers/number/dialects/default.d.ts +0 -3
- package/dist/database/helpers/number/dialects/mssql.d.ts +0 -7
- package/dist/database/helpers/number/dialects/oracle.d.ts +0 -6
- package/dist/database/helpers/number/dialects/postgres.d.ts +0 -5
- package/dist/database/helpers/number/dialects/sqlite.d.ts +0 -6
- package/dist/database/helpers/number/index.d.ts +0 -7
- package/dist/database/helpers/number/types.d.ts +0 -12
- package/dist/database/helpers/number/utils/decimal-limit.d.ts +0 -4
- package/dist/database/helpers/number/utils/maybe-stringify-big-int.d.ts +0 -1
- package/dist/database/helpers/number/utils/number-in-range.d.ts +0 -3
- package/dist/database/helpers/schema/dialects/cockroachdb.d.ts +0 -12
- package/dist/database/helpers/schema/dialects/default.d.ts +0 -3
- package/dist/database/helpers/schema/dialects/mssql.d.ts +0 -14
- package/dist/database/helpers/schema/dialects/mysql.d.ts +0 -10
- package/dist/database/helpers/schema/dialects/oracle.d.ts +0 -24
- package/dist/database/helpers/schema/dialects/postgres.d.ts +0 -8
- package/dist/database/helpers/schema/dialects/sqlite.d.ts +0 -8
- package/dist/database/helpers/schema/index.d.ts +0 -7
- package/dist/database/helpers/schema/types.d.ts +0 -63
- package/dist/database/helpers/schema/utils/prep-query-params.d.ts +0 -12
- package/dist/database/helpers/sequence/dialects/default.d.ts +0 -3
- package/dist/database/helpers/sequence/dialects/postgres.d.ts +0 -12
- package/dist/database/helpers/sequence/index.d.ts +0 -7
- package/dist/database/helpers/sequence/types.d.ts +0 -5
- package/dist/database/helpers/types.d.ts +0 -5
- package/dist/database/index.d.ts +0 -15
- package/dist/database/migrations/20201028A-remove-collection-foreign-keys.d.ts +0 -3
- package/dist/database/migrations/20201029A-remove-system-relations.d.ts +0 -3
- package/dist/database/migrations/20201029B-remove-system-collections.d.ts +0 -3
- package/dist/database/migrations/20201029C-remove-system-fields.d.ts +0 -3
- package/dist/database/migrations/20201105A-add-cascade-system-relations.d.ts +0 -8
- package/dist/database/migrations/20201105B-change-webhook-url-type.d.ts +0 -3
- package/dist/database/migrations/20210225A-add-relations-sort-field.d.ts +0 -3
- package/dist/database/migrations/20210304A-remove-locked-fields.d.ts +0 -3
- package/dist/database/migrations/20210312A-webhooks-collections-text.d.ts +0 -3
- package/dist/database/migrations/20210331A-add-refresh-interval.d.ts +0 -3
- package/dist/database/migrations/20210415A-make-filesize-nullable.d.ts +0 -3
- package/dist/database/migrations/20210416A-add-collections-accountability.d.ts +0 -3
- package/dist/database/migrations/20210422A-remove-files-interface.d.ts +0 -3
- package/dist/database/migrations/20210506A-rename-interfaces.d.ts +0 -3
- package/dist/database/migrations/20210510A-restructure-relations.d.ts +0 -3
- package/dist/database/migrations/20210518A-add-foreign-key-constraints.d.ts +0 -3
- package/dist/database/migrations/20210519A-add-system-fk-triggers.d.ts +0 -3
- package/dist/database/migrations/20210521A-add-collections-icon-color.d.ts +0 -3
- package/dist/database/migrations/20210525A-add-insights.d.ts +0 -3
- package/dist/database/migrations/20210608A-add-deep-clone-config.d.ts +0 -3
- package/dist/database/migrations/20210626A-change-filesize-bigint.d.ts +0 -3
- package/dist/database/migrations/20210716A-add-conditions-to-fields.d.ts +0 -3
- package/dist/database/migrations/20210721A-add-default-folder.d.ts +0 -3
- package/dist/database/migrations/20210802A-replace-groups.d.ts +0 -3
- package/dist/database/migrations/20210803A-add-required-to-fields.d.ts +0 -3
- package/dist/database/migrations/20210805A-update-groups.d.ts +0 -3
- package/dist/database/migrations/20210805B-change-image-metadata-structure.d.ts +0 -3
- package/dist/database/migrations/20210811A-add-geometry-config.d.ts +0 -3
- package/dist/database/migrations/20210831A-remove-limit-column.d.ts +0 -3
- package/dist/database/migrations/20210903A-add-auth-provider.d.ts +0 -3
- package/dist/database/migrations/20210907A-webhooks-collections-not-null.d.ts +0 -3
- package/dist/database/migrations/20210910A-move-module-setup.d.ts +0 -3
- package/dist/database/migrations/20210920A-webhooks-url-not-null.d.ts +0 -3
- package/dist/database/migrations/20210924A-add-collection-organization.d.ts +0 -3
- package/dist/database/migrations/20210927A-replace-fields-group.d.ts +0 -3
- package/dist/database/migrations/20210927B-replace-m2m-interface.d.ts +0 -3
- package/dist/database/migrations/20210929A-rename-login-action.d.ts +0 -3
- package/dist/database/migrations/20211007A-update-presets.d.ts +0 -3
- package/dist/database/migrations/20211009A-add-auth-data.d.ts +0 -3
- package/dist/database/migrations/20211016A-add-webhook-headers.d.ts +0 -3
- package/dist/database/migrations/20211103A-set-unique-to-user-token.d.ts +0 -3
- package/dist/database/migrations/20211103B-update-special-geometry.d.ts +0 -3
- package/dist/database/migrations/20211104A-remove-collections-listing.d.ts +0 -3
- package/dist/database/migrations/20211118A-add-notifications.d.ts +0 -3
- package/dist/database/migrations/20211211A-add-shares.d.ts +0 -3
- package/dist/database/migrations/20211230A-add-project-descriptor.d.ts +0 -3
- package/dist/database/migrations/20220303A-remove-default-project-color.d.ts +0 -3
- package/dist/database/migrations/20220308A-add-bookmark-icon-and-color.d.ts +0 -3
- package/dist/database/migrations/20220314A-add-translation-strings.d.ts +0 -3
- package/dist/database/migrations/20220322A-rename-field-typecast-flags.d.ts +0 -3
- package/dist/database/migrations/20220323A-add-field-validation.d.ts +0 -3
- package/dist/database/migrations/20220325A-fix-typecast-flags.d.ts +0 -3
- package/dist/database/migrations/20220325B-add-default-language.d.ts +0 -3
- package/dist/database/migrations/20220402A-remove-default-value-panel-icon.d.ts +0 -3
- package/dist/database/migrations/20220429A-add-flows.d.ts +0 -3
- package/dist/database/migrations/20220429B-add-color-to-insights-icon.d.ts +0 -3
- package/dist/database/migrations/20220429C-drop-non-null-from-ip-of-activity.d.ts +0 -3
- package/dist/database/migrations/20220429D-drop-non-null-from-sender-of-notifications.d.ts +0 -3
- package/dist/database/migrations/20220614A-rename-hook-trigger-to-event.d.ts +0 -3
- package/dist/database/migrations/20220801A-update-notifications-timestamp-column.d.ts +0 -3
- package/dist/database/migrations/20220802A-add-custom-aspect-ratios.d.ts +0 -3
- package/dist/database/migrations/20220826A-add-origin-to-accountability.d.ts +0 -3
- package/dist/database/migrations/20230401A-update-material-icons.d.ts +0 -3
- package/dist/database/migrations/20230525A-add-preview-settings.d.ts +0 -3
- package/dist/database/migrations/20230526A-migrate-translation-strings.d.ts +0 -3
- package/dist/database/migrations/20230721A-require-shares-fields.d.ts +0 -3
- package/dist/database/migrations/20230823A-add-content-versioning.d.ts +0 -3
- package/dist/database/migrations/20230927A-themes.d.ts +0 -3
- package/dist/database/migrations/20231009A-update-csv-fields-to-text.d.ts +0 -3
- package/dist/database/migrations/20231009B-update-panel-options.d.ts +0 -3
- package/dist/database/migrations/20231010A-add-extensions.d.ts +0 -3
- package/dist/database/migrations/20231215A-add-focalpoints.d.ts +0 -3
- package/dist/database/migrations/20240122A-add-report-url-fields.d.ts +0 -3
- package/dist/database/migrations/20240204A-marketplace.d.ts +0 -3
- package/dist/database/migrations/20240305A-change-useragent-type.d.ts +0 -3
- package/dist/database/migrations/20240311A-deprecate-webhooks.d.ts +0 -28
- package/dist/database/migrations/20240422A-public-registration.d.ts +0 -3
- package/dist/database/migrations/20240515A-add-session-window.d.ts +0 -3
- package/dist/database/migrations/20240701A-add-tus-data.d.ts +0 -3
- package/dist/database/migrations/20240716A-update-files-date-fields.d.ts +0 -3
- package/dist/database/migrations/20240806A-permissions-policies.d.ts +0 -3
- package/dist/database/migrations/20240817A-update-icon-fields-length.d.ts +0 -3
- package/dist/database/migrations/20240909A-separate-comments.d.ts +0 -3
- package/dist/database/migrations/20240909B-consolidate-content-versioning.d.ts +0 -3
- package/dist/database/migrations/20240924A-migrate-legacy-comments.d.ts +0 -3
- package/dist/database/migrations/20240924B-populate-versioning-deltas.d.ts +0 -3
- package/dist/database/migrations/20250224A-visual-editor.d.ts +0 -3
- package/dist/database/migrations/20250609A-license-banner.d.ts +0 -3
- package/dist/database/migrations/20250613A-add-project-id.d.ts +0 -3
- package/dist/database/migrations/20250718A-add-direction.d.ts +0 -3
- package/dist/database/migrations/20250813A-add-mcp.d.ts +0 -3
- package/dist/database/migrations/20251012A-add-field-searchable.d.ts +0 -3
- package/dist/database/migrations/20251014A-add-project-owner.d.ts +0 -3
- package/dist/database/migrations/20251028A-add-retention-indexes.d.ts +0 -3
- package/dist/database/migrations/20251103A-add-ai-settings.d.ts +0 -3
- package/dist/database/migrations/20251224A-remove-webhooks.d.ts +0 -3
- package/dist/database/migrations/20260110A-add-ai-provider-settings.d.ts +0 -3
- package/dist/database/migrations/20260113A-add-revisions-index.d.ts +0 -3
- package/dist/database/migrations/20260128A-add-collaborative-editing.d.ts +0 -3
- package/dist/database/migrations/20260204A-add-deployment.d.ts +0 -3
- package/dist/database/migrations/20260211A-add-deployment-webhooks.d.ts +0 -3
- package/dist/database/migrations/run.d.ts +0 -2
- package/dist/database/run-ast/lib/apply-query/add-join.d.ts +0 -54
- package/dist/database/run-ast/lib/apply-query/aggregate.d.ts +0 -3
- package/dist/database/run-ast/lib/apply-query/filter/get-filter-type.d.ts +0 -8
- package/dist/database/run-ast/lib/apply-query/filter/index.d.ts +0 -8
- package/dist/database/run-ast/lib/apply-query/filter/operator.d.ts +0 -3
- package/dist/database/run-ast/lib/apply-query/filter/validate-operator.d.ts +0 -2
- package/dist/database/run-ast/lib/apply-query/get-filter-path.d.ts +0 -1
- package/dist/database/run-ast/lib/apply-query/get-operation.d.ts +0 -7
- package/dist/database/run-ast/lib/apply-query/index.d.ts +0 -19
- package/dist/database/run-ast/lib/apply-query/join-filter-with-cases.d.ts +0 -2
- package/dist/database/run-ast/lib/apply-query/mock.d.ts +0 -3
- package/dist/database/run-ast/lib/apply-query/pagination.d.ts +0 -3
- package/dist/database/run-ast/lib/apply-query/search.d.ts +0 -4
- package/dist/database/run-ast/lib/apply-query/sort.d.ts +0 -19
- package/dist/database/run-ast/lib/get-db-query.d.ts +0 -14
- package/dist/database/run-ast/lib/parse-current-level.d.ts +0 -7
- package/dist/database/run-ast/modules/fetch-permitted-ast-root-fields.d.ts +0 -15
- package/dist/database/run-ast/run-ast.d.ts +0 -7
- package/dist/database/run-ast/types.d.ts +0 -20
- package/dist/database/run-ast/utils/apply-case-when.d.ts +0 -17
- package/dist/database/run-ast/utils/apply-function-to-column-name.d.ts +0 -12
- package/dist/database/run-ast/utils/apply-parent-filters.d.ts +0 -3
- package/dist/database/run-ast/utils/generate-alias.d.ts +0 -6
- package/dist/database/run-ast/utils/get-column-pre-processor.d.ts +0 -10
- package/dist/database/run-ast/utils/get-column.d.ts +0 -25
- package/dist/database/run-ast/utils/get-field-alias.d.ts +0 -2
- package/dist/database/run-ast/utils/get-inner-query-column-pre-processor.d.ts +0 -5
- package/dist/database/run-ast/utils/merge-with-parent-items.d.ts +0 -3
- package/dist/database/run-ast/utils/remove-temporary-fields.d.ts +0 -3
- package/dist/database/run-ast/utils/with-preprocess-bindings.d.ts +0 -2
- package/dist/database/seeds/run.d.ts +0 -2
- package/dist/deployment/deployment.d.ts +0 -117
- package/dist/deployment/drivers/index.d.ts +0 -2
- package/dist/deployment/drivers/netlify.d.ts +0 -37
- package/dist/deployment/drivers/vercel.d.ts +0 -35
- package/dist/deployment/index.d.ts +0 -2
- package/dist/deployment.d.ts +0 -29
- package/dist/emitter.d.ts +0 -21
- package/dist/extensions/index.d.ts +0 -2
- package/dist/extensions/lib/get-extensions-path.d.ts +0 -1
- package/dist/extensions/lib/get-extensions-settings.d.ts +0 -11
- package/dist/extensions/lib/get-extensions.d.ts +0 -5
- package/dist/extensions/lib/get-shared-deps-mapping.d.ts +0 -1
- package/dist/extensions/lib/installation/index.d.ts +0 -2
- package/dist/extensions/lib/installation/manager.d.ts +0 -5
- package/dist/extensions/lib/sandbox/generate-api-extensions-sandbox-entrypoint.d.ts +0 -28
- package/dist/extensions/lib/sandbox/generate-host-function-reference.d.ts +0 -11
- package/dist/extensions/lib/sandbox/register/action.d.ts +0 -6
- package/dist/extensions/lib/sandbox/register/call-reference.d.ts +0 -5
- package/dist/extensions/lib/sandbox/register/filter.d.ts +0 -6
- package/dist/extensions/lib/sandbox/register/index.d.ts +0 -5
- package/dist/extensions/lib/sandbox/register/operation.d.ts +0 -6
- package/dist/extensions/lib/sandbox/register/route.d.ts +0 -17
- package/dist/extensions/lib/sandbox/sdk/generators/index.d.ts +0 -3
- package/dist/extensions/lib/sandbox/sdk/generators/log.d.ts +0 -3
- package/dist/extensions/lib/sandbox/sdk/generators/request.d.ts +0 -12
- package/dist/extensions/lib/sandbox/sdk/generators/sleep.d.ts +0 -3
- package/dist/extensions/lib/sandbox/sdk/index.d.ts +0 -2
- package/dist/extensions/lib/sandbox/sdk/instantiate.d.ts +0 -11
- package/dist/extensions/lib/sandbox/sdk/sdk.d.ts +0 -20
- package/dist/extensions/lib/sandbox/sdk/utils/index.d.ts +0 -1
- package/dist/extensions/lib/sandbox/sdk/utils/wrap.d.ts +0 -13
- package/dist/extensions/lib/sync/status.d.ts +0 -11
- package/dist/extensions/lib/sync/sync.d.ts +0 -6
- package/dist/extensions/lib/sync/tracker.d.ts +0 -18
- package/dist/extensions/lib/sync/utils.d.ts +0 -24
- package/dist/extensions/lib/wrap-embeds.d.ts +0 -4
- package/dist/extensions/manager.d.ts +0 -164
- package/dist/flows.d.ts +0 -29
- package/dist/index.d.ts +0 -1
- package/dist/lock/index.d.ts +0 -1
- package/dist/lock/lib/use-lock.d.ts +0 -8
- package/dist/logger/index.d.ts +0 -14
- package/dist/logger/logs-stream.d.ts +0 -10
- package/dist/logger/redact-query.d.ts +0 -1
- package/dist/mailer.d.ts +0 -2
- package/dist/metrics/index.d.ts +0 -1
- package/dist/metrics/lib/create-metrics.d.ts +0 -15
- package/dist/metrics/lib/use-metrics.d.ts +0 -17
- package/dist/metrics/types/metric.d.ts +0 -1
- package/dist/middleware/authenticate.d.ts +0 -7
- package/dist/middleware/cache.d.ts +0 -3
- package/dist/middleware/collection-exists.d.ts +0 -6
- package/dist/middleware/cors.d.ts +0 -3
- package/dist/middleware/error-handler.d.ts +0 -2
- package/dist/middleware/extract-token.d.ts +0 -12
- package/dist/middleware/graphql.d.ts +0 -2
- package/dist/middleware/rate-limiter-global.d.ts +0 -5
- package/dist/middleware/rate-limiter-ip.d.ts +0 -5
- package/dist/middleware/rate-limiter-registration.d.ts +0 -5
- package/dist/middleware/respond.d.ts +0 -2
- package/dist/middleware/sanitize-query.d.ts +0 -7
- package/dist/middleware/schema.d.ts +0 -3
- package/dist/middleware/use-collection.d.ts +0 -7
- package/dist/middleware/validate-batch.d.ts +0 -1
- package/dist/operations/condition/index.d.ts +0 -6
- package/dist/operations/exec/index.d.ts +0 -5
- package/dist/operations/item-create/index.d.ts +0 -8
- package/dist/operations/item-delete/index.d.ts +0 -10
- package/dist/operations/item-read/index.d.ts +0 -10
- package/dist/operations/item-update/index.d.ts +0 -11
- package/dist/operations/json-web-token/index.d.ts +0 -10
- package/dist/operations/log/index.d.ts +0 -5
- package/dist/operations/mail/index.d.ts +0 -13
- package/dist/operations/mail/rate-limiter.d.ts +0 -1
- package/dist/operations/notification/index.d.ts +0 -10
- package/dist/operations/request/index.d.ts +0 -11
- package/dist/operations/sleep/index.d.ts +0 -5
- package/dist/operations/throw-error/index.d.ts +0 -7
- package/dist/operations/transform/index.d.ts +0 -5
- package/dist/operations/trigger/index.d.ts +0 -8
- package/dist/permissions/cache.d.ts +0 -2
- package/dist/permissions/lib/fetch-permissions.d.ts +0 -20
- package/dist/permissions/lib/fetch-policies.d.ts +0 -14
- package/dist/permissions/lib/fetch-roles-tree.d.ts +0 -6
- package/dist/permissions/lib/with-app-minimal-permissions.d.ts +0 -2
- package/dist/permissions/modules/fetch-accountability-collection-access/fetch-accountability-collection-access.d.ts +0 -7
- package/dist/permissions/modules/fetch-accountability-policy-globals/fetch-accountability-policy-globals.d.ts +0 -3
- package/dist/permissions/modules/fetch-allowed-collections/fetch-allowed-collections.d.ts +0 -7
- package/dist/permissions/modules/fetch-allowed-field-map/fetch-allowed-field-map.d.ts +0 -8
- package/dist/permissions/modules/fetch-allowed-fields/fetch-allowed-fields.d.ts +0 -15
- package/dist/permissions/modules/fetch-global-access/fetch-global-access.d.ts +0 -12
- package/dist/permissions/modules/fetch-inconsistent-field-map/fetch-inconsistent-field-map.d.ts +0 -11
- package/dist/permissions/modules/fetch-policies-ip-access/fetch-policies-ip-access.d.ts +0 -4
- package/dist/permissions/modules/process-ast/lib/extract-fields-from-children.d.ts +0 -4
- package/dist/permissions/modules/process-ast/lib/extract-fields-from-query.d.ts +0 -3
- package/dist/permissions/modules/process-ast/lib/field-map-from-ast.d.ts +0 -4
- package/dist/permissions/modules/process-ast/lib/get-cases.d.ts +0 -6
- package/dist/permissions/modules/process-ast/lib/inject-cases.d.ts +0 -9
- package/dist/permissions/modules/process-ast/process-ast.d.ts +0 -9
- package/dist/permissions/modules/process-ast/types.d.ts +0 -18
- package/dist/permissions/modules/process-ast/utils/collections-in-field-map.d.ts +0 -2
- package/dist/permissions/modules/process-ast/utils/context-has-dynamic-variables.d.ts +0 -2
- package/dist/permissions/modules/process-ast/utils/dedupe-access.d.ts +0 -12
- package/dist/permissions/modules/process-ast/utils/extract-paths-from-query.d.ts +0 -15
- package/dist/permissions/modules/process-ast/utils/find-related-collection.d.ts +0 -3
- package/dist/permissions/modules/process-ast/utils/flatten-filter.d.ts +0 -3
- package/dist/permissions/modules/process-ast/utils/format-a2o-key.d.ts +0 -1
- package/dist/permissions/modules/process-ast/utils/get-info-for-path.d.ts +0 -5
- package/dist/permissions/modules/process-ast/utils/has-item-permissions.d.ts +0 -2
- package/dist/permissions/modules/process-ast/utils/stringify-query-path.d.ts +0 -2
- package/dist/permissions/modules/process-ast/utils/validate-path/create-error.d.ts +0 -3
- package/dist/permissions/modules/process-ast/utils/validate-path/validate-path-existence.d.ts +0 -2
- package/dist/permissions/modules/process-ast/utils/validate-path/validate-path-permissions.d.ts +0 -2
- package/dist/permissions/modules/process-payload/lib/is-field-nullable.d.ts +0 -5
- package/dist/permissions/modules/process-payload/process-payload.d.ts +0 -14
- package/dist/permissions/modules/validate-access/lib/validate-collection-access.d.ts +0 -12
- package/dist/permissions/modules/validate-access/lib/validate-item-access.d.ts +0 -22
- package/dist/permissions/modules/validate-access/validate-access.d.ts +0 -16
- package/dist/permissions/modules/validate-remaining-admin/validate-remaining-admin-count.d.ts +0 -1
- package/dist/permissions/modules/validate-remaining-admin/validate-remaining-admin-users.d.ts +0 -4
- package/dist/permissions/types.d.ts +0 -7
- package/dist/permissions/utils/create-default-accountability.d.ts +0 -2
- package/dist/permissions/utils/default-permission.d.ts +0 -7
- package/dist/permissions/utils/extract-required-dynamic-variable-context.d.ts +0 -9
- package/dist/permissions/utils/fetch-dynamic-variable-data.d.ts +0 -9
- package/dist/permissions/utils/fetch-raw-permissions.d.ts +0 -11
- package/dist/permissions/utils/fetch-share-info.d.ts +0 -12
- package/dist/permissions/utils/filter-policies-by-ip.d.ts +0 -2
- package/dist/permissions/utils/get-permissions-for-share.d.ts +0 -4
- package/dist/permissions/utils/get-unaliased-field-key.d.ts +0 -5
- package/dist/permissions/utils/merge-fields.d.ts +0 -1
- package/dist/permissions/utils/merge-permissions.d.ts +0 -9
- package/dist/permissions/utils/process-permissions.d.ts +0 -17
- package/dist/permissions/utils/with-cache.d.ts +0 -12
- package/dist/rate-limiter.d.ts +0 -5
- package/dist/redis/index.d.ts +0 -3
- package/dist/redis/lib/create-redis.d.ts +0 -7
- package/dist/redis/lib/use-redis.d.ts +0 -16
- package/dist/redis/utils/redis-config-available.d.ts +0 -4
- package/dist/request/agent-with-ip-validation.d.ts +0 -10
- package/dist/request/index.d.ts +0 -5
- package/dist/request/is-denied-ip.d.ts +0 -1
- package/dist/schedules/metrics.d.ts +0 -7
- package/dist/schedules/project.d.ts +0 -4
- package/dist/schedules/retention.d.ts +0 -14
- package/dist/schedules/telemetry.d.ts +0 -11
- package/dist/schedules/tus.d.ts +0 -6
- package/dist/server.d.ts +0 -4
- package/dist/services/access.d.ts +0 -9
- package/dist/services/activity.d.ts +0 -5
- package/dist/services/assets/name-deduper.d.ts +0 -7
- package/dist/services/assets.d.ts +0 -35
- package/dist/services/authentication.d.ts +0 -26
- package/dist/services/collections.d.ts +0 -57
- package/dist/services/comments.d.ts +0 -12
- package/dist/services/dashboards.d.ts +0 -5
- package/dist/services/deployment-projects.d.ts +0 -49
- package/dist/services/deployment-runs.d.ts +0 -31
- package/dist/services/deployment.d.ts +0 -81
- package/dist/services/extensions.d.ts +0 -34
- package/dist/services/fields/build-collection-and-field-relations.d.ts +0 -21
- package/dist/services/fields/get-collection-meta-updates.d.ts +0 -11
- package/dist/services/fields/get-collection-relation-list.d.ts +0 -5
- package/dist/services/fields.d.ts +0 -49
- package/dist/services/files/lib/extract-metadata.d.ts +0 -3
- package/dist/services/files/lib/get-sharp-instance.d.ts +0 -2
- package/dist/services/files/utils/get-metadata.d.ts +0 -4
- package/dist/services/files/utils/parse-image-metadata.d.ts +0 -2
- package/dist/services/files.d.ts +0 -31
- package/dist/services/flows.d.ts +0 -8
- package/dist/services/folders.d.ts +0 -30
- package/dist/services/graphql/errors/execution.d.ts +0 -6
- package/dist/services/graphql/errors/format.d.ts +0 -6
- package/dist/services/graphql/errors/index.d.ts +0 -2
- package/dist/services/graphql/errors/validation.d.ts +0 -6
- package/dist/services/graphql/index.d.ts +0 -30
- package/dist/services/graphql/resolvers/get-collection-type.d.ts +0 -3
- package/dist/services/graphql/resolvers/get-field-type.d.ts +0 -3
- package/dist/services/graphql/resolvers/get-relation-type.d.ts +0 -3
- package/dist/services/graphql/resolvers/mutation.d.ts +0 -4
- package/dist/services/graphql/resolvers/query.d.ts +0 -8
- package/dist/services/graphql/resolvers/system-admin.d.ts +0 -5
- package/dist/services/graphql/resolvers/system-global.d.ts +0 -7
- package/dist/services/graphql/resolvers/system.d.ts +0 -5
- package/dist/services/graphql/schema/get-types.d.ts +0 -12
- package/dist/services/graphql/schema/index.d.ts +0 -32
- package/dist/services/graphql/schema/parse-args.d.ts +0 -9
- package/dist/services/graphql/schema/parse-query.d.ts +0 -7
- package/dist/services/graphql/schema/read.d.ts +0 -12
- package/dist/services/graphql/schema/write.d.ts +0 -9
- package/dist/services/graphql/schema-cache.d.ts +0 -3
- package/dist/services/graphql/subscription.d.ts +0 -22
- package/dist/services/graphql/types/bigint.d.ts +0 -2
- package/dist/services/graphql/types/date.d.ts +0 -2
- package/dist/services/graphql/types/geojson.d.ts +0 -2
- package/dist/services/graphql/types/hash.d.ts +0 -2
- package/dist/services/graphql/types/string-or-float.d.ts +0 -5
- package/dist/services/graphql/types/void.d.ts +0 -2
- package/dist/services/graphql/utils/add-path-to-validation-error.d.ts +0 -2
- package/dist/services/graphql/utils/aggregate-query.d.ts +0 -6
- package/dist/services/graphql/utils/filter-replace-m2a.d.ts +0 -7
- package/dist/services/graphql/utils/process-error.d.ts +0 -7
- package/dist/services/graphql/utils/replace-fragments.d.ts +0 -6
- package/dist/services/graphql/utils/replace-funcs.d.ts +0 -5
- package/dist/services/graphql/utils/sanitize-gql-schema.d.ts +0 -8
- package/dist/services/import-export.d.ts +0 -44
- package/dist/services/index.d.ts +0 -41
- package/dist/services/items.d.ts +0 -105
- package/dist/services/mail/index.d.ts +0 -32
- package/dist/services/mail/rate-limiter.d.ts +0 -1
- package/dist/services/meta.d.ts +0 -11
- package/dist/services/notifications.d.ts +0 -7
- package/dist/services/operations.d.ts +0 -8
- package/dist/services/panels.d.ts +0 -5
- package/dist/services/payload.d.ts +0 -77
- package/dist/services/permissions.d.ts +0 -14
- package/dist/services/policies.d.ts +0 -11
- package/dist/services/presets.d.ts +0 -5
- package/dist/services/relations.d.ts +0 -55
- package/dist/services/revisions.d.ts +0 -11
- package/dist/services/roles.d.ts +0 -9
- package/dist/services/schema.d.ts +0 -14
- package/dist/services/server.d.ts +0 -13
- package/dist/services/settings.d.ts +0 -6
- package/dist/services/shares.d.ts +0 -19
- package/dist/services/specifications.d.ts +0 -39
- package/dist/services/tfa.d.ts +0 -12
- package/dist/services/translations.d.ts +0 -8
- package/dist/services/tus/data-store.d.ts +0 -33
- package/dist/services/tus/index.d.ts +0 -2
- package/dist/services/tus/lockers.d.ts +0 -36
- package/dist/services/tus/server.d.ts +0 -8
- package/dist/services/tus/utils/wait-timeout.d.ts +0 -1
- package/dist/services/users.d.ts +0 -54
- package/dist/services/utils.d.ts +0 -15
- package/dist/services/versions.d.ts +0 -19
- package/dist/services/websocket.d.ts +0 -12
- package/dist/start.d.ts +0 -1
- package/dist/storage/get-storage-driver.d.ts +0 -3
- package/dist/storage/index.d.ts +0 -5
- package/dist/storage/register-drivers.d.ts +0 -2
- package/dist/storage/register-locations.d.ts +0 -2
- package/dist/synchronization.d.ts +0 -7
- package/dist/telemetry/index.d.ts +0 -3
- package/dist/telemetry/lib/get-report.d.ts +0 -5
- package/dist/telemetry/lib/send-report.d.ts +0 -10
- package/dist/telemetry/lib/track.d.ts +0 -10
- package/dist/telemetry/types/report.d.ts +0 -102
- package/dist/telemetry/utils/check-user-limits.d.ts +0 -5
- package/dist/telemetry/utils/get-extension-count.d.ts +0 -9
- package/dist/telemetry/utils/get-field-count.d.ts +0 -6
- package/dist/telemetry/utils/get-filesize-sum.d.ts +0 -5
- package/dist/telemetry/utils/get-item-count.d.ts +0 -30
- package/dist/telemetry/utils/get-random-wait-time.d.ts +0 -5
- package/dist/telemetry/utils/get-settings.d.ts +0 -26
- package/dist/telemetry/utils/get-user-item-count.d.ts +0 -13
- package/dist/telemetry/utils/should-check-user-limits.d.ts +0 -4
- package/dist/test-utils/cache.d.ts +0 -51
- package/dist/test-utils/controllers.d.ts +0 -65
- package/dist/test-utils/database.d.ts +0 -48
- package/dist/test-utils/emitter.d.ts +0 -35
- package/dist/test-utils/knex.d.ts +0 -164
- package/dist/test-utils/schema.d.ts +0 -26
- package/dist/test-utils/services/fields-service.d.ts +0 -28
- package/dist/test-utils/services/files-service.d.ts +0 -28
- package/dist/test-utils/services/folders-service.d.ts +0 -28
- package/dist/test-utils/services/items-service.d.ts +0 -23
- package/dist/types/ast.d.ts +0 -100
- package/dist/types/auth.d.ts +0 -42
- package/dist/types/collection.d.ts +0 -9
- package/dist/types/events.d.ts +0 -18
- package/dist/types/index.d.ts +0 -7
- package/dist/types/meta.d.ts +0 -4
- package/dist/types/migration.d.ts +0 -5
- package/dist/types/revision.d.ts +0 -7
- package/dist/types/rolemap.d.ts +0 -3
- package/dist/utils/apply-diff.d.ts +0 -8
- package/dist/utils/apply-snapshot.d.ts +0 -8
- package/dist/utils/async-handler.d.ts +0 -3
- package/dist/utils/calculate-field-depth.d.ts +0 -33
- package/dist/utils/compress.d.ts +0 -2
- package/dist/utils/construct-flow-tree.d.ts +0 -2
- package/dist/utils/create-admin.d.ts +0 -11
- package/dist/utils/deep-map-response.d.ts +0 -17
- package/dist/utils/delete-from-require-cache.d.ts +0 -1
- package/dist/utils/encrypt.d.ts +0 -2
- package/dist/utils/fetch-user-count/fetch-access-lookup.d.ts +0 -19
- package/dist/utils/fetch-user-count/fetch-access-roles.d.ts +0 -16
- package/dist/utils/fetch-user-count/fetch-active-users.d.ts +0 -6
- package/dist/utils/fetch-user-count/fetch-user-count.d.ts +0 -11
- package/dist/utils/fetch-user-count/get-user-count-query.d.ts +0 -20
- package/dist/utils/filter-items.d.ts +0 -2
- package/dist/utils/freeze-schema.d.ts +0 -3
- package/dist/utils/generate-hash.d.ts +0 -1
- package/dist/utils/get-accountability-for-role.d.ts +0 -7
- package/dist/utils/get-accountability-for-token.d.ts +0 -2
- package/dist/utils/get-address.d.ts +0 -2
- package/dist/utils/get-allowed-log-levels.d.ts +0 -3
- package/dist/utils/get-auth-providers.d.ts +0 -10
- package/dist/utils/get-cache-headers.d.ts +0 -10
- package/dist/utils/get-cache-key.d.ts +0 -2
- package/dist/utils/get-collection-from-alias.d.ts +0 -6
- package/dist/utils/get-column-path.d.ts +0 -26
- package/dist/utils/get-config-from-env.d.ts +0 -6
- package/dist/utils/get-default-index-name.d.ts +0 -13
- package/dist/utils/get-default-value.d.ts +0 -5
- package/dist/utils/get-field-relational-depth.d.ts +0 -13
- package/dist/utils/get-field-system-rows.d.ts +0 -2
- package/dist/utils/get-graphql-query-and-variables.d.ts +0 -2
- package/dist/utils/get-graphql-type.d.ts +0 -4
- package/dist/utils/get-ip-from-req.d.ts +0 -3
- package/dist/utils/get-local-type.d.ts +0 -9
- package/dist/utils/get-milliseconds.d.ts +0 -4
- package/dist/utils/get-module-default.d.ts +0 -3
- package/dist/utils/get-schema.d.ts +0 -10
- package/dist/utils/get-secret.d.ts +0 -4
- package/dist/utils/get-service.d.ts +0 -7
- package/dist/utils/get-snapshot-diff.d.ts +0 -2
- package/dist/utils/get-snapshot.d.ts +0 -6
- package/dist/utils/get-string-byte-size.d.ts +0 -4
- package/dist/utils/get-versioned-hash.d.ts +0 -1
- package/dist/utils/import-file-url.d.ts +0 -5
- package/dist/utils/is-directus-jwt.d.ts +0 -5
- package/dist/utils/is-field-allowed.d.ts +0 -4
- package/dist/utils/is-url-allowed.d.ts +0 -4
- package/dist/utils/is-valid-uuid.d.ts +0 -3
- package/dist/utils/job-queue.d.ts +0 -9
- package/dist/utils/jwt.d.ts +0 -3
- package/dist/utils/md.d.ts +0 -4
- package/dist/utils/parse-filter-key.d.ts +0 -7
- package/dist/utils/parse-numeric-string.d.ts +0 -2
- package/dist/utils/parse-value.d.ts +0 -4
- package/dist/utils/permissions-cacheable.d.ts +0 -8
- package/dist/utils/redact-object.d.ts +0 -23
- package/dist/utils/reduce-schema.d.ts +0 -7
- package/dist/utils/require-text.d.ts +0 -1
- package/dist/utils/require-yaml.d.ts +0 -1
- package/dist/utils/sanitize-query.d.ts +0 -5
- package/dist/utils/sanitize-schema.d.ts +0 -33
- package/dist/utils/schedule.d.ts +0 -5
- package/dist/utils/should-clear-cache.d.ts +0 -10
- package/dist/utils/should-skip-cache.d.ts +0 -7
- package/dist/utils/split-fields.d.ts +0 -4
- package/dist/utils/stall.d.ts +0 -26
- package/dist/utils/transaction.d.ts +0 -9
- package/dist/utils/transformations.d.ts +0 -6
- package/dist/utils/url.d.ts +0 -18
- package/dist/utils/user-name.d.ts +0 -2
- package/dist/utils/validate-diff.d.ts +0 -7
- package/dist/utils/validate-env.d.ts +0 -1
- package/dist/utils/validate-keys.d.ts +0 -5
- package/dist/utils/validate-query.d.ts +0 -4
- package/dist/utils/validate-snapshot.d.ts +0 -5
- package/dist/utils/validate-storage.d.ts +0 -1
- package/dist/utils/validate-user-count-integrity.d.ts +0 -6
- package/dist/utils/verify-session-jwt.d.ts +0 -7
- package/dist/utils/versioning/handle-version.d.ts +0 -3
- package/dist/utils/versioning/merge-version-data.d.ts +0 -2
- package/dist/utils/versioning/split-recursive.d.ts +0 -4
- package/dist/websocket/authenticate.d.ts +0 -5
- package/dist/websocket/collab/calculate-cache-metadata.d.ts +0 -9
- package/dist/websocket/collab/collab.d.ts +0 -63
- package/dist/websocket/collab/constants.d.ts +0 -1
- package/dist/websocket/collab/filter-to-fields.d.ts +0 -2
- package/dist/websocket/collab/messenger.d.ts +0 -43
- package/dist/websocket/collab/payload-permissions.d.ts +0 -18
- package/dist/websocket/collab/permissions-cache.d.ts +0 -52
- package/dist/websocket/collab/room.d.ts +0 -125
- package/dist/websocket/collab/store.d.ts +0 -7
- package/dist/websocket/collab/types.d.ts +0 -21
- package/dist/websocket/collab/verify-permissions.d.ts +0 -11
- package/dist/websocket/controllers/base.d.ts +0 -35
- package/dist/websocket/controllers/graphql.d.ts +0 -11
- package/dist/websocket/controllers/hooks.d.ts +0 -1
- package/dist/websocket/controllers/index.d.ts +0 -13
- package/dist/websocket/controllers/logs.d.ts +0 -17
- package/dist/websocket/controllers/rest.d.ts +0 -8
- package/dist/websocket/errors.d.ts +0 -16
- package/dist/websocket/handlers/heartbeat.d.ts +0 -11
- package/dist/websocket/handlers/index.d.ts +0 -7
- package/dist/websocket/handlers/items.d.ts +0 -6
- package/dist/websocket/handlers/logs.d.ts +0 -31
- package/dist/websocket/handlers/subscribe.d.ts +0 -38
- package/dist/websocket/messages.d.ts +0 -114
- package/dist/websocket/types.d.ts +0 -38
- package/dist/websocket/utils/get-expires-at-for-token.d.ts +0 -1
- package/dist/websocket/utils/items.d.ts +0 -43
- package/dist/websocket/utils/message.d.ts +0 -4
- package/dist/websocket/utils/wait-for-message.d.ts +0 -4
package/dist/node_modules/.pnpm/@vitest_runner@3.2.4/node_modules/@vitest/runner/dist/chunk-hooks.js
ADDED
|
@@ -0,0 +1,2151 @@
|
|
|
1
|
+
import { format, objDisplay } from "../../../../../@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/chunk-_commonjsHelpers.js";
|
|
2
|
+
import { assertTypes, createDefer, isNegativeNaN, isObject, objectAttr, toArray } from "../../../../../@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/helpers.js";
|
|
3
|
+
import { getSafeTimers, shuffle } from "../../../../../@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/index.js";
|
|
4
|
+
import { processError } from "../../../../../@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/error.js";
|
|
5
|
+
import { parseSingleStack } from "../../../../../@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/source-map.js";
|
|
6
|
+
import { stripLiteral } from "../../../../../strip-literal@3.1.0/node_modules/strip-literal/dist/index.js";
|
|
7
|
+
import { relative } from "../../../../../pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.js";
|
|
8
|
+
import "../../../../../pathe@2.0.3/node_modules/pathe/dist/index.js";
|
|
9
|
+
|
|
10
|
+
//#region ../node_modules/.pnpm/@vitest+runner@3.2.4/node_modules/@vitest/runner/dist/chunk-hooks.js
|
|
11
|
+
var PendingError = class extends Error {
|
|
12
|
+
code = "VITEST_PENDING";
|
|
13
|
+
taskId;
|
|
14
|
+
constructor(message, task, note) {
|
|
15
|
+
super(message);
|
|
16
|
+
this.message = message;
|
|
17
|
+
this.note = note;
|
|
18
|
+
this.taskId = task.id;
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
var TestRunAbortError = class extends Error {
|
|
22
|
+
name = "TestRunAbortError";
|
|
23
|
+
reason;
|
|
24
|
+
constructor(message, reason) {
|
|
25
|
+
super(message);
|
|
26
|
+
this.reason = reason;
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
const fnMap = new WeakMap();
|
|
30
|
+
const testFixtureMap = new WeakMap();
|
|
31
|
+
const hooksMap = new WeakMap();
|
|
32
|
+
function setFn(key, fn) {
|
|
33
|
+
fnMap.set(key, fn);
|
|
34
|
+
}
|
|
35
|
+
function getFn(key) {
|
|
36
|
+
return fnMap.get(key);
|
|
37
|
+
}
|
|
38
|
+
function setTestFixture(key, fixture) {
|
|
39
|
+
testFixtureMap.set(key, fixture);
|
|
40
|
+
}
|
|
41
|
+
function getTestFixture(key) {
|
|
42
|
+
return testFixtureMap.get(key);
|
|
43
|
+
}
|
|
44
|
+
function setHooks(key, hooks) {
|
|
45
|
+
hooksMap.set(key, hooks);
|
|
46
|
+
}
|
|
47
|
+
function getHooks(key) {
|
|
48
|
+
return hooksMap.get(key);
|
|
49
|
+
}
|
|
50
|
+
async function runSetupFiles(config, files, runner$1) {
|
|
51
|
+
if (config.sequence.setupFiles === "parallel") {
|
|
52
|
+
await Promise.all(files.map(async (fsPath) => {
|
|
53
|
+
await runner$1.importFile(fsPath, "setup");
|
|
54
|
+
}));
|
|
55
|
+
} else {
|
|
56
|
+
for (const fsPath of files) {
|
|
57
|
+
await runner$1.importFile(fsPath, "setup");
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
function mergeScopedFixtures(testFixtures, scopedFixtures) {
|
|
62
|
+
const scopedFixturesMap = scopedFixtures.reduce((map, fixture) => {
|
|
63
|
+
map[fixture.prop] = fixture;
|
|
64
|
+
return map;
|
|
65
|
+
}, {});
|
|
66
|
+
const newFixtures = {};
|
|
67
|
+
testFixtures.forEach((fixture) => {
|
|
68
|
+
const useFixture = scopedFixturesMap[fixture.prop] || { ...fixture };
|
|
69
|
+
newFixtures[useFixture.prop] = useFixture;
|
|
70
|
+
});
|
|
71
|
+
for (const fixtureKep in newFixtures) {
|
|
72
|
+
var _fixture$deps;
|
|
73
|
+
const fixture = newFixtures[fixtureKep];
|
|
74
|
+
fixture.deps = (_fixture$deps = fixture.deps) === null || _fixture$deps === void 0 ? void 0 : _fixture$deps.map((dep) => newFixtures[dep.prop]);
|
|
75
|
+
}
|
|
76
|
+
return Object.values(newFixtures);
|
|
77
|
+
}
|
|
78
|
+
function mergeContextFixtures(fixtures, context, runner$1) {
|
|
79
|
+
const fixtureOptionKeys = [
|
|
80
|
+
"auto",
|
|
81
|
+
"injected",
|
|
82
|
+
"scope"
|
|
83
|
+
];
|
|
84
|
+
const fixtureArray = Object.entries(fixtures).map(([prop, value]) => {
|
|
85
|
+
const fixtureItem = { value };
|
|
86
|
+
if (Array.isArray(value) && value.length >= 2 && isObject(value[1]) && Object.keys(value[1]).some((key) => fixtureOptionKeys.includes(key))) {
|
|
87
|
+
var _runner$injectValue;
|
|
88
|
+
Object.assign(fixtureItem, value[1]);
|
|
89
|
+
const userValue = value[0];
|
|
90
|
+
fixtureItem.value = fixtureItem.injected ? ((_runner$injectValue = runner$1.injectValue) === null || _runner$injectValue === void 0 ? void 0 : _runner$injectValue.call(runner$1, prop)) ?? userValue : userValue;
|
|
91
|
+
}
|
|
92
|
+
fixtureItem.scope = fixtureItem.scope || "test";
|
|
93
|
+
if (fixtureItem.scope === "worker" && !runner$1.getWorkerContext) {
|
|
94
|
+
fixtureItem.scope = "file";
|
|
95
|
+
}
|
|
96
|
+
fixtureItem.prop = prop;
|
|
97
|
+
fixtureItem.isFn = typeof fixtureItem.value === "function";
|
|
98
|
+
return fixtureItem;
|
|
99
|
+
});
|
|
100
|
+
if (Array.isArray(context.fixtures)) {
|
|
101
|
+
context.fixtures = context.fixtures.concat(fixtureArray);
|
|
102
|
+
} else {
|
|
103
|
+
context.fixtures = fixtureArray;
|
|
104
|
+
}
|
|
105
|
+
fixtureArray.forEach((fixture) => {
|
|
106
|
+
if (fixture.isFn) {
|
|
107
|
+
const usedProps = getUsedProps(fixture.value);
|
|
108
|
+
if (usedProps.length) {
|
|
109
|
+
fixture.deps = context.fixtures.filter(({ prop }) => prop !== fixture.prop && usedProps.includes(prop));
|
|
110
|
+
}
|
|
111
|
+
if (fixture.scope !== "test") {
|
|
112
|
+
var _fixture$deps2;
|
|
113
|
+
(_fixture$deps2 = fixture.deps) === null || _fixture$deps2 === void 0 ? void 0 : _fixture$deps2.forEach((dep) => {
|
|
114
|
+
if (!dep.isFn) {
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
if (fixture.scope === "worker" && dep.scope === "worker") {
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
if (fixture.scope === "file" && dep.scope !== "test") {
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
throw new SyntaxError(`cannot use the ${dep.scope} fixture "${dep.prop}" inside the ${fixture.scope} fixture "${fixture.prop}"`);
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
return context;
|
|
129
|
+
}
|
|
130
|
+
const fixtureValueMaps = new Map();
|
|
131
|
+
const cleanupFnArrayMap = new Map();
|
|
132
|
+
async function callFixtureCleanup(context) {
|
|
133
|
+
const cleanupFnArray = cleanupFnArrayMap.get(context) ?? [];
|
|
134
|
+
for (const cleanup of cleanupFnArray.reverse()) {
|
|
135
|
+
await cleanup();
|
|
136
|
+
}
|
|
137
|
+
cleanupFnArrayMap.delete(context);
|
|
138
|
+
}
|
|
139
|
+
function withFixtures(runner$1, fn, testContext) {
|
|
140
|
+
return (hookContext) => {
|
|
141
|
+
const context = hookContext || testContext;
|
|
142
|
+
if (!context) {
|
|
143
|
+
return fn({});
|
|
144
|
+
}
|
|
145
|
+
const fixtures = getTestFixture(context);
|
|
146
|
+
if (!(fixtures === null || fixtures === void 0 ? void 0 : fixtures.length)) {
|
|
147
|
+
return fn(context);
|
|
148
|
+
}
|
|
149
|
+
const usedProps = getUsedProps(fn);
|
|
150
|
+
const hasAutoFixture = fixtures.some(({ auto }) => auto);
|
|
151
|
+
if (!usedProps.length && !hasAutoFixture) {
|
|
152
|
+
return fn(context);
|
|
153
|
+
}
|
|
154
|
+
if (!fixtureValueMaps.get(context)) {
|
|
155
|
+
fixtureValueMaps.set(context, new Map());
|
|
156
|
+
}
|
|
157
|
+
const fixtureValueMap = fixtureValueMaps.get(context);
|
|
158
|
+
if (!cleanupFnArrayMap.has(context)) {
|
|
159
|
+
cleanupFnArrayMap.set(context, []);
|
|
160
|
+
}
|
|
161
|
+
const cleanupFnArray = cleanupFnArrayMap.get(context);
|
|
162
|
+
const usedFixtures = fixtures.filter(({ prop, auto }) => auto || usedProps.includes(prop));
|
|
163
|
+
const pendingFixtures = resolveDeps(usedFixtures);
|
|
164
|
+
if (!pendingFixtures.length) {
|
|
165
|
+
return fn(context);
|
|
166
|
+
}
|
|
167
|
+
async function resolveFixtures() {
|
|
168
|
+
for (const fixture of pendingFixtures) {
|
|
169
|
+
if (fixtureValueMap.has(fixture)) {
|
|
170
|
+
continue;
|
|
171
|
+
}
|
|
172
|
+
const resolvedValue = await resolveFixtureValue(runner$1, fixture, context, cleanupFnArray);
|
|
173
|
+
context[fixture.prop] = resolvedValue;
|
|
174
|
+
fixtureValueMap.set(fixture, resolvedValue);
|
|
175
|
+
if (fixture.scope === "test") {
|
|
176
|
+
cleanupFnArray.unshift(() => {
|
|
177
|
+
fixtureValueMap.delete(fixture);
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
return resolveFixtures().then(() => fn(context));
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
const globalFixturePromise = new WeakMap();
|
|
186
|
+
function resolveFixtureValue(runner$1, fixture, context, cleanupFnArray) {
|
|
187
|
+
var _runner$getWorkerCont;
|
|
188
|
+
const fileContext = getFileContext(context.task.file);
|
|
189
|
+
const workerContext = (_runner$getWorkerCont = runner$1.getWorkerContext) === null || _runner$getWorkerCont === void 0 ? void 0 : _runner$getWorkerCont.call(runner$1);
|
|
190
|
+
if (!fixture.isFn) {
|
|
191
|
+
var _fixture$prop;
|
|
192
|
+
fileContext[_fixture$prop = fixture.prop] ?? (fileContext[_fixture$prop] = fixture.value);
|
|
193
|
+
if (workerContext) {
|
|
194
|
+
var _fixture$prop2;
|
|
195
|
+
workerContext[_fixture$prop2 = fixture.prop] ?? (workerContext[_fixture$prop2] = fixture.value);
|
|
196
|
+
}
|
|
197
|
+
return fixture.value;
|
|
198
|
+
}
|
|
199
|
+
if (fixture.scope === "test") {
|
|
200
|
+
return resolveFixtureFunction(fixture.value, context, cleanupFnArray);
|
|
201
|
+
}
|
|
202
|
+
if (globalFixturePromise.has(fixture)) {
|
|
203
|
+
return globalFixturePromise.get(fixture);
|
|
204
|
+
}
|
|
205
|
+
let fixtureContext;
|
|
206
|
+
if (fixture.scope === "worker") {
|
|
207
|
+
if (!workerContext) {
|
|
208
|
+
throw new TypeError("[@vitest/runner] The worker context is not available in the current test runner. Please, provide the `getWorkerContext` method when initiating the runner.");
|
|
209
|
+
}
|
|
210
|
+
fixtureContext = workerContext;
|
|
211
|
+
} else {
|
|
212
|
+
fixtureContext = fileContext;
|
|
213
|
+
}
|
|
214
|
+
if (fixture.prop in fixtureContext) {
|
|
215
|
+
return fixtureContext[fixture.prop];
|
|
216
|
+
}
|
|
217
|
+
if (!cleanupFnArrayMap.has(fixtureContext)) {
|
|
218
|
+
cleanupFnArrayMap.set(fixtureContext, []);
|
|
219
|
+
}
|
|
220
|
+
const cleanupFnFileArray = cleanupFnArrayMap.get(fixtureContext);
|
|
221
|
+
const promise = resolveFixtureFunction(fixture.value, fixtureContext, cleanupFnFileArray).then((value) => {
|
|
222
|
+
fixtureContext[fixture.prop] = value;
|
|
223
|
+
globalFixturePromise.delete(fixture);
|
|
224
|
+
return value;
|
|
225
|
+
});
|
|
226
|
+
globalFixturePromise.set(fixture, promise);
|
|
227
|
+
return promise;
|
|
228
|
+
}
|
|
229
|
+
async function resolveFixtureFunction(fixtureFn, context, cleanupFnArray) {
|
|
230
|
+
const useFnArgPromise = createDefer();
|
|
231
|
+
let isUseFnArgResolved = false;
|
|
232
|
+
const fixtureReturn = fixtureFn(context, async (useFnArg) => {
|
|
233
|
+
isUseFnArgResolved = true;
|
|
234
|
+
useFnArgPromise.resolve(useFnArg);
|
|
235
|
+
const useReturnPromise = createDefer();
|
|
236
|
+
cleanupFnArray.push(async () => {
|
|
237
|
+
useReturnPromise.resolve();
|
|
238
|
+
await fixtureReturn;
|
|
239
|
+
});
|
|
240
|
+
await useReturnPromise;
|
|
241
|
+
}).catch((e) => {
|
|
242
|
+
if (!isUseFnArgResolved) {
|
|
243
|
+
useFnArgPromise.reject(e);
|
|
244
|
+
return;
|
|
245
|
+
}
|
|
246
|
+
throw e;
|
|
247
|
+
});
|
|
248
|
+
return useFnArgPromise;
|
|
249
|
+
}
|
|
250
|
+
function resolveDeps(fixtures, depSet = new Set(), pendingFixtures = []) {
|
|
251
|
+
fixtures.forEach((fixture) => {
|
|
252
|
+
if (pendingFixtures.includes(fixture)) {
|
|
253
|
+
return;
|
|
254
|
+
}
|
|
255
|
+
if (!fixture.isFn || !fixture.deps) {
|
|
256
|
+
pendingFixtures.push(fixture);
|
|
257
|
+
return;
|
|
258
|
+
}
|
|
259
|
+
if (depSet.has(fixture)) {
|
|
260
|
+
throw new Error(`Circular fixture dependency detected: ${fixture.prop} <- ${[...depSet].reverse().map((d) => d.prop).join(" <- ")}`);
|
|
261
|
+
}
|
|
262
|
+
depSet.add(fixture);
|
|
263
|
+
resolveDeps(fixture.deps, depSet, pendingFixtures);
|
|
264
|
+
pendingFixtures.push(fixture);
|
|
265
|
+
depSet.clear();
|
|
266
|
+
});
|
|
267
|
+
return pendingFixtures;
|
|
268
|
+
}
|
|
269
|
+
function getUsedProps(fn) {
|
|
270
|
+
let fnString = stripLiteral(fn.toString());
|
|
271
|
+
if (/__async\((?:this|null), (?:null|arguments|\[[_0-9, ]*\]), function\*/.test(fnString)) {
|
|
272
|
+
fnString = fnString.split(/__async\((?:this|null),/)[1];
|
|
273
|
+
}
|
|
274
|
+
const match = fnString.match(/[^(]*\(([^)]*)/);
|
|
275
|
+
if (!match) {
|
|
276
|
+
return [];
|
|
277
|
+
}
|
|
278
|
+
const args = splitByComma(match[1]);
|
|
279
|
+
if (!args.length) {
|
|
280
|
+
return [];
|
|
281
|
+
}
|
|
282
|
+
let first = args[0];
|
|
283
|
+
if ("__VITEST_FIXTURE_INDEX__" in fn) {
|
|
284
|
+
first = args[fn.__VITEST_FIXTURE_INDEX__];
|
|
285
|
+
if (!first) {
|
|
286
|
+
return [];
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
if (!(first.startsWith("{") && first.endsWith("}"))) {
|
|
290
|
+
throw new Error(`The first argument inside a fixture must use object destructuring pattern, e.g. ({ test } => {}). Instead, received "${first}".`);
|
|
291
|
+
}
|
|
292
|
+
const _first = first.slice(1, -1).replace(/\s/g, "");
|
|
293
|
+
const props = splitByComma(_first).map((prop) => {
|
|
294
|
+
return prop.replace(/:.*|=.*/g, "");
|
|
295
|
+
});
|
|
296
|
+
const last = props.at(-1);
|
|
297
|
+
if (last && last.startsWith("...")) {
|
|
298
|
+
throw new Error(`Rest parameters are not supported in fixtures, received "${last}".`);
|
|
299
|
+
}
|
|
300
|
+
return props;
|
|
301
|
+
}
|
|
302
|
+
function splitByComma(s) {
|
|
303
|
+
const result = [];
|
|
304
|
+
const stack = [];
|
|
305
|
+
let start = 0;
|
|
306
|
+
for (let i = 0; i < s.length; i++) {
|
|
307
|
+
if (s[i] === "{" || s[i] === "[") {
|
|
308
|
+
stack.push(s[i] === "{" ? "}" : "]");
|
|
309
|
+
} else if (s[i] === stack[stack.length - 1]) {
|
|
310
|
+
stack.pop();
|
|
311
|
+
} else if (!stack.length && s[i] === ",") {
|
|
312
|
+
const token = s.substring(start, i).trim();
|
|
313
|
+
if (token) {
|
|
314
|
+
result.push(token);
|
|
315
|
+
}
|
|
316
|
+
start = i + 1;
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
const lastToken = s.substring(start).trim();
|
|
320
|
+
if (lastToken) {
|
|
321
|
+
result.push(lastToken);
|
|
322
|
+
}
|
|
323
|
+
return result;
|
|
324
|
+
}
|
|
325
|
+
let _test;
|
|
326
|
+
function setCurrentTest(test$1) {
|
|
327
|
+
_test = test$1;
|
|
328
|
+
}
|
|
329
|
+
function getCurrentTest() {
|
|
330
|
+
return _test;
|
|
331
|
+
}
|
|
332
|
+
const tests = [];
|
|
333
|
+
function addRunningTest(test$1) {
|
|
334
|
+
tests.push(test$1);
|
|
335
|
+
return () => {
|
|
336
|
+
tests.splice(tests.indexOf(test$1));
|
|
337
|
+
};
|
|
338
|
+
}
|
|
339
|
+
function getRunningTests() {
|
|
340
|
+
return tests;
|
|
341
|
+
}
|
|
342
|
+
function createChainable(keys, fn) {
|
|
343
|
+
function create(context) {
|
|
344
|
+
const chain$1 = function(...args) {
|
|
345
|
+
return fn.apply(context, args);
|
|
346
|
+
};
|
|
347
|
+
Object.assign(chain$1, fn);
|
|
348
|
+
chain$1.withContext = () => chain$1.bind(context);
|
|
349
|
+
chain$1.setContext = (key, value) => {
|
|
350
|
+
context[key] = value;
|
|
351
|
+
};
|
|
352
|
+
chain$1.mergeContext = (ctx) => {
|
|
353
|
+
Object.assign(context, ctx);
|
|
354
|
+
};
|
|
355
|
+
for (const key of keys) {
|
|
356
|
+
Object.defineProperty(chain$1, key, { get() {
|
|
357
|
+
return create({
|
|
358
|
+
...context,
|
|
359
|
+
[key]: true
|
|
360
|
+
});
|
|
361
|
+
} });
|
|
362
|
+
}
|
|
363
|
+
return chain$1;
|
|
364
|
+
}
|
|
365
|
+
const chain = create({});
|
|
366
|
+
chain.fn = fn;
|
|
367
|
+
return chain;
|
|
368
|
+
}
|
|
369
|
+
/**
|
|
370
|
+
* Creates a suite of tests, allowing for grouping and hierarchical organization of tests.
|
|
371
|
+
* Suites can contain both tests and other suites, enabling complex test structures.
|
|
372
|
+
*
|
|
373
|
+
* @param {string} name - The name of the suite, used for identification and reporting.
|
|
374
|
+
* @param {Function} fn - A function that defines the tests and suites within this suite.
|
|
375
|
+
* @example
|
|
376
|
+
* ```ts
|
|
377
|
+
* // Define a suite with two tests
|
|
378
|
+
* suite('Math operations', () => {
|
|
379
|
+
* test('should add two numbers', () => {
|
|
380
|
+
* expect(add(1, 2)).toBe(3);
|
|
381
|
+
* });
|
|
382
|
+
*
|
|
383
|
+
* test('should subtract two numbers', () => {
|
|
384
|
+
* expect(subtract(5, 2)).toBe(3);
|
|
385
|
+
* });
|
|
386
|
+
* });
|
|
387
|
+
* ```
|
|
388
|
+
* @example
|
|
389
|
+
* ```ts
|
|
390
|
+
* // Define nested suites
|
|
391
|
+
* suite('String operations', () => {
|
|
392
|
+
* suite('Trimming', () => {
|
|
393
|
+
* test('should trim whitespace from start and end', () => {
|
|
394
|
+
* expect(' hello '.trim()).toBe('hello');
|
|
395
|
+
* });
|
|
396
|
+
* });
|
|
397
|
+
*
|
|
398
|
+
* suite('Concatenation', () => {
|
|
399
|
+
* test('should concatenate two strings', () => {
|
|
400
|
+
* expect('hello' + ' ' + 'world').toBe('hello world');
|
|
401
|
+
* });
|
|
402
|
+
* });
|
|
403
|
+
* });
|
|
404
|
+
* ```
|
|
405
|
+
*/
|
|
406
|
+
const suite = createSuite();
|
|
407
|
+
/**
|
|
408
|
+
* Defines a test case with a given name and test function. The test function can optionally be configured with test options.
|
|
409
|
+
*
|
|
410
|
+
* @param {string | Function} name - The name of the test or a function that will be used as a test name.
|
|
411
|
+
* @param {TestOptions | TestFunction} [optionsOrFn] - Optional. The test options or the test function if no explicit name is provided.
|
|
412
|
+
* @param {number | TestOptions | TestFunction} [optionsOrTest] - Optional. The test function or options, depending on the previous parameters.
|
|
413
|
+
* @throws {Error} If called inside another test function.
|
|
414
|
+
* @example
|
|
415
|
+
* ```ts
|
|
416
|
+
* // Define a simple test
|
|
417
|
+
* test('should add two numbers', () => {
|
|
418
|
+
* expect(add(1, 2)).toBe(3);
|
|
419
|
+
* });
|
|
420
|
+
* ```
|
|
421
|
+
* @example
|
|
422
|
+
* ```ts
|
|
423
|
+
* // Define a test with options
|
|
424
|
+
* test('should subtract two numbers', { retry: 3 }, () => {
|
|
425
|
+
* expect(subtract(5, 2)).toBe(3);
|
|
426
|
+
* });
|
|
427
|
+
* ```
|
|
428
|
+
*/
|
|
429
|
+
const test = createTest(function(name, optionsOrFn, optionsOrTest) {
|
|
430
|
+
if (getCurrentTest()) {
|
|
431
|
+
throw new Error("Calling the test function inside another test function is not allowed. Please put it inside \"describe\" or \"suite\" so it can be properly collected.");
|
|
432
|
+
}
|
|
433
|
+
getCurrentSuite().test.fn.call(this, formatName(name), optionsOrFn, optionsOrTest);
|
|
434
|
+
});
|
|
435
|
+
/**
|
|
436
|
+
* Creates a suite of tests, allowing for grouping and hierarchical organization of tests.
|
|
437
|
+
* Suites can contain both tests and other suites, enabling complex test structures.
|
|
438
|
+
*
|
|
439
|
+
* @param {string} name - The name of the suite, used for identification and reporting.
|
|
440
|
+
* @param {Function} fn - A function that defines the tests and suites within this suite.
|
|
441
|
+
* @example
|
|
442
|
+
* ```ts
|
|
443
|
+
* // Define a suite with two tests
|
|
444
|
+
* describe('Math operations', () => {
|
|
445
|
+
* test('should add two numbers', () => {
|
|
446
|
+
* expect(add(1, 2)).toBe(3);
|
|
447
|
+
* });
|
|
448
|
+
*
|
|
449
|
+
* test('should subtract two numbers', () => {
|
|
450
|
+
* expect(subtract(5, 2)).toBe(3);
|
|
451
|
+
* });
|
|
452
|
+
* });
|
|
453
|
+
* ```
|
|
454
|
+
* @example
|
|
455
|
+
* ```ts
|
|
456
|
+
* // Define nested suites
|
|
457
|
+
* describe('String operations', () => {
|
|
458
|
+
* describe('Trimming', () => {
|
|
459
|
+
* test('should trim whitespace from start and end', () => {
|
|
460
|
+
* expect(' hello '.trim()).toBe('hello');
|
|
461
|
+
* });
|
|
462
|
+
* });
|
|
463
|
+
*
|
|
464
|
+
* describe('Concatenation', () => {
|
|
465
|
+
* test('should concatenate two strings', () => {
|
|
466
|
+
* expect('hello' + ' ' + 'world').toBe('hello world');
|
|
467
|
+
* });
|
|
468
|
+
* });
|
|
469
|
+
* });
|
|
470
|
+
* ```
|
|
471
|
+
*/
|
|
472
|
+
const describe = suite;
|
|
473
|
+
/**
|
|
474
|
+
* Defines a test case with a given name and test function. The test function can optionally be configured with test options.
|
|
475
|
+
*
|
|
476
|
+
* @param {string | Function} name - The name of the test or a function that will be used as a test name.
|
|
477
|
+
* @param {TestOptions | TestFunction} [optionsOrFn] - Optional. The test options or the test function if no explicit name is provided.
|
|
478
|
+
* @param {number | TestOptions | TestFunction} [optionsOrTest] - Optional. The test function or options, depending on the previous parameters.
|
|
479
|
+
* @throws {Error} If called inside another test function.
|
|
480
|
+
* @example
|
|
481
|
+
* ```ts
|
|
482
|
+
* // Define a simple test
|
|
483
|
+
* it('adds two numbers', () => {
|
|
484
|
+
* expect(add(1, 2)).toBe(3);
|
|
485
|
+
* });
|
|
486
|
+
* ```
|
|
487
|
+
* @example
|
|
488
|
+
* ```ts
|
|
489
|
+
* // Define a test with options
|
|
490
|
+
* it('subtracts two numbers', { retry: 3 }, () => {
|
|
491
|
+
* expect(subtract(5, 2)).toBe(3);
|
|
492
|
+
* });
|
|
493
|
+
* ```
|
|
494
|
+
*/
|
|
495
|
+
const it = test;
|
|
496
|
+
let runner;
|
|
497
|
+
let defaultSuite;
|
|
498
|
+
let currentTestFilepath;
|
|
499
|
+
function assert(condition, message) {
|
|
500
|
+
if (!condition) {
|
|
501
|
+
throw new Error(`Vitest failed to find ${message}. This is a bug in Vitest. Please, open an issue with reproduction.`);
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
function getDefaultSuite() {
|
|
505
|
+
assert(defaultSuite, "the default suite");
|
|
506
|
+
return defaultSuite;
|
|
507
|
+
}
|
|
508
|
+
function getTestFilepath() {
|
|
509
|
+
return currentTestFilepath;
|
|
510
|
+
}
|
|
511
|
+
function getRunner() {
|
|
512
|
+
assert(runner, "the runner");
|
|
513
|
+
return runner;
|
|
514
|
+
}
|
|
515
|
+
function createDefaultSuite(runner$1) {
|
|
516
|
+
const config = runner$1.config.sequence;
|
|
517
|
+
const collector = suite("", { concurrent: config.concurrent }, () => {});
|
|
518
|
+
delete collector.suite;
|
|
519
|
+
return collector;
|
|
520
|
+
}
|
|
521
|
+
function clearCollectorContext(filepath, currentRunner) {
|
|
522
|
+
if (!defaultSuite) {
|
|
523
|
+
defaultSuite = createDefaultSuite(currentRunner);
|
|
524
|
+
}
|
|
525
|
+
runner = currentRunner;
|
|
526
|
+
currentTestFilepath = filepath;
|
|
527
|
+
collectorContext.tasks.length = 0;
|
|
528
|
+
defaultSuite.clear();
|
|
529
|
+
collectorContext.currentSuite = defaultSuite;
|
|
530
|
+
}
|
|
531
|
+
function getCurrentSuite() {
|
|
532
|
+
const currentSuite = collectorContext.currentSuite || defaultSuite;
|
|
533
|
+
assert(currentSuite, "the current suite");
|
|
534
|
+
return currentSuite;
|
|
535
|
+
}
|
|
536
|
+
function createSuiteHooks() {
|
|
537
|
+
return {
|
|
538
|
+
beforeAll: [],
|
|
539
|
+
afterAll: [],
|
|
540
|
+
beforeEach: [],
|
|
541
|
+
afterEach: []
|
|
542
|
+
};
|
|
543
|
+
}
|
|
544
|
+
function parseArguments(optionsOrFn, optionsOrTest) {
|
|
545
|
+
let options = {};
|
|
546
|
+
let fn = () => {};
|
|
547
|
+
if (typeof optionsOrTest === "object") {
|
|
548
|
+
if (typeof optionsOrFn === "object") {
|
|
549
|
+
throw new TypeError("Cannot use two objects as arguments. Please provide options and a function callback in that order.");
|
|
550
|
+
}
|
|
551
|
+
console.warn("Using an object as a third argument is deprecated. Vitest 4 will throw an error if the third argument is not a timeout number. Please use the second argument for options. See more at https://vitest.dev/guide/migration");
|
|
552
|
+
options = optionsOrTest;
|
|
553
|
+
} else if (typeof optionsOrTest === "number") {
|
|
554
|
+
options = { timeout: optionsOrTest };
|
|
555
|
+
} else if (typeof optionsOrFn === "object") {
|
|
556
|
+
options = optionsOrFn;
|
|
557
|
+
}
|
|
558
|
+
if (typeof optionsOrFn === "function") {
|
|
559
|
+
if (typeof optionsOrTest === "function") {
|
|
560
|
+
throw new TypeError("Cannot use two functions as arguments. Please use the second argument for options.");
|
|
561
|
+
}
|
|
562
|
+
fn = optionsOrFn;
|
|
563
|
+
} else if (typeof optionsOrTest === "function") {
|
|
564
|
+
fn = optionsOrTest;
|
|
565
|
+
}
|
|
566
|
+
return {
|
|
567
|
+
options,
|
|
568
|
+
handler: fn
|
|
569
|
+
};
|
|
570
|
+
}
|
|
571
|
+
function createSuiteCollector(name, factory = () => {}, mode, each, suiteOptions, parentCollectorFixtures) {
|
|
572
|
+
const tasks = [];
|
|
573
|
+
let suite$1;
|
|
574
|
+
initSuite(true);
|
|
575
|
+
const task = function(name$1 = "", options = {}) {
|
|
576
|
+
var _collectorContext$cur;
|
|
577
|
+
const timeout = (options === null || options === void 0 ? void 0 : options.timeout) ?? runner.config.testTimeout;
|
|
578
|
+
const task$1 = {
|
|
579
|
+
id: "",
|
|
580
|
+
name: name$1,
|
|
581
|
+
suite: (_collectorContext$cur = collectorContext.currentSuite) === null || _collectorContext$cur === void 0 ? void 0 : _collectorContext$cur.suite,
|
|
582
|
+
each: options.each,
|
|
583
|
+
fails: options.fails,
|
|
584
|
+
context: undefined,
|
|
585
|
+
type: "test",
|
|
586
|
+
file: undefined,
|
|
587
|
+
timeout,
|
|
588
|
+
retry: options.retry ?? runner.config.retry,
|
|
589
|
+
repeats: options.repeats,
|
|
590
|
+
mode: options.only ? "only" : options.skip ? "skip" : options.todo ? "todo" : "run",
|
|
591
|
+
meta: options.meta ?? Object.create(null),
|
|
592
|
+
annotations: []
|
|
593
|
+
};
|
|
594
|
+
const handler = options.handler;
|
|
595
|
+
if (options.concurrent || !options.sequential && runner.config.sequence.concurrent) {
|
|
596
|
+
task$1.concurrent = true;
|
|
597
|
+
}
|
|
598
|
+
task$1.shuffle = suiteOptions === null || suiteOptions === void 0 ? void 0 : suiteOptions.shuffle;
|
|
599
|
+
const context = createTestContext(task$1, runner);
|
|
600
|
+
Object.defineProperty(task$1, "context", {
|
|
601
|
+
value: context,
|
|
602
|
+
enumerable: false
|
|
603
|
+
});
|
|
604
|
+
setTestFixture(context, options.fixtures);
|
|
605
|
+
const limit = Error.stackTraceLimit;
|
|
606
|
+
Error.stackTraceLimit = 15;
|
|
607
|
+
const stackTraceError = new Error("STACK_TRACE_ERROR");
|
|
608
|
+
Error.stackTraceLimit = limit;
|
|
609
|
+
if (handler) {
|
|
610
|
+
setFn(task$1, withTimeout(withAwaitAsyncAssertions(withFixtures(runner, handler, context), task$1), timeout, false, stackTraceError, (_, error) => abortIfTimeout([context], error)));
|
|
611
|
+
}
|
|
612
|
+
if (runner.config.includeTaskLocation) {
|
|
613
|
+
const error = stackTraceError.stack;
|
|
614
|
+
const stack = findTestFileStackTrace(error);
|
|
615
|
+
if (stack) {
|
|
616
|
+
task$1.location = stack;
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
tasks.push(task$1);
|
|
620
|
+
return task$1;
|
|
621
|
+
};
|
|
622
|
+
const test$1 = createTest(function(name$1, optionsOrFn, optionsOrTest) {
|
|
623
|
+
let { options, handler } = parseArguments(optionsOrFn, optionsOrTest);
|
|
624
|
+
if (typeof suiteOptions === "object") {
|
|
625
|
+
options = Object.assign({}, suiteOptions, options);
|
|
626
|
+
}
|
|
627
|
+
options.concurrent = this.concurrent || !this.sequential && (options === null || options === void 0 ? void 0 : options.concurrent);
|
|
628
|
+
options.sequential = this.sequential || !this.concurrent && (options === null || options === void 0 ? void 0 : options.sequential);
|
|
629
|
+
const test$2 = task(formatName(name$1), {
|
|
630
|
+
...this,
|
|
631
|
+
...options,
|
|
632
|
+
handler
|
|
633
|
+
});
|
|
634
|
+
test$2.type = "test";
|
|
635
|
+
});
|
|
636
|
+
let collectorFixtures = parentCollectorFixtures;
|
|
637
|
+
const collector = {
|
|
638
|
+
type: "collector",
|
|
639
|
+
name,
|
|
640
|
+
mode,
|
|
641
|
+
suite: suite$1,
|
|
642
|
+
options: suiteOptions,
|
|
643
|
+
test: test$1,
|
|
644
|
+
tasks,
|
|
645
|
+
collect,
|
|
646
|
+
task,
|
|
647
|
+
clear,
|
|
648
|
+
on: addHook,
|
|
649
|
+
fixtures() {
|
|
650
|
+
return collectorFixtures;
|
|
651
|
+
},
|
|
652
|
+
scoped(fixtures) {
|
|
653
|
+
const parsed = mergeContextFixtures(fixtures, { fixtures: collectorFixtures }, runner);
|
|
654
|
+
if (parsed.fixtures) {
|
|
655
|
+
collectorFixtures = parsed.fixtures;
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
};
|
|
659
|
+
function addHook(name$1, ...fn) {
|
|
660
|
+
getHooks(suite$1)[name$1].push(...fn);
|
|
661
|
+
}
|
|
662
|
+
function initSuite(includeLocation) {
|
|
663
|
+
var _collectorContext$cur2;
|
|
664
|
+
if (typeof suiteOptions === "number") {
|
|
665
|
+
suiteOptions = { timeout: suiteOptions };
|
|
666
|
+
}
|
|
667
|
+
suite$1 = {
|
|
668
|
+
id: "",
|
|
669
|
+
type: "suite",
|
|
670
|
+
name,
|
|
671
|
+
suite: (_collectorContext$cur2 = collectorContext.currentSuite) === null || _collectorContext$cur2 === void 0 ? void 0 : _collectorContext$cur2.suite,
|
|
672
|
+
mode,
|
|
673
|
+
each,
|
|
674
|
+
file: undefined,
|
|
675
|
+
shuffle: suiteOptions === null || suiteOptions === void 0 ? void 0 : suiteOptions.shuffle,
|
|
676
|
+
tasks: [],
|
|
677
|
+
meta: Object.create(null),
|
|
678
|
+
concurrent: suiteOptions === null || suiteOptions === void 0 ? void 0 : suiteOptions.concurrent
|
|
679
|
+
};
|
|
680
|
+
if (runner && includeLocation && runner.config.includeTaskLocation) {
|
|
681
|
+
const limit = Error.stackTraceLimit;
|
|
682
|
+
Error.stackTraceLimit = 15;
|
|
683
|
+
const error = new Error("stacktrace").stack;
|
|
684
|
+
Error.stackTraceLimit = limit;
|
|
685
|
+
const stack = findTestFileStackTrace(error);
|
|
686
|
+
if (stack) {
|
|
687
|
+
suite$1.location = stack;
|
|
688
|
+
}
|
|
689
|
+
}
|
|
690
|
+
setHooks(suite$1, createSuiteHooks());
|
|
691
|
+
}
|
|
692
|
+
function clear() {
|
|
693
|
+
tasks.length = 0;
|
|
694
|
+
initSuite(false);
|
|
695
|
+
}
|
|
696
|
+
async function collect(file) {
|
|
697
|
+
if (!file) {
|
|
698
|
+
throw new TypeError("File is required to collect tasks.");
|
|
699
|
+
}
|
|
700
|
+
if (factory) {
|
|
701
|
+
await runWithSuite(collector, () => factory(test$1));
|
|
702
|
+
}
|
|
703
|
+
const allChildren = [];
|
|
704
|
+
for (const i of tasks) {
|
|
705
|
+
allChildren.push(i.type === "collector" ? await i.collect(file) : i);
|
|
706
|
+
}
|
|
707
|
+
suite$1.file = file;
|
|
708
|
+
suite$1.tasks = allChildren;
|
|
709
|
+
allChildren.forEach((task$1) => {
|
|
710
|
+
task$1.file = file;
|
|
711
|
+
});
|
|
712
|
+
return suite$1;
|
|
713
|
+
}
|
|
714
|
+
collectTask(collector);
|
|
715
|
+
return collector;
|
|
716
|
+
}
|
|
717
|
+
function withAwaitAsyncAssertions(fn, task) {
|
|
718
|
+
return async (...args) => {
|
|
719
|
+
const fnResult = await fn(...args);
|
|
720
|
+
if (task.promises) {
|
|
721
|
+
const result = await Promise.allSettled(task.promises);
|
|
722
|
+
const errors = result.map((r) => r.status === "rejected" ? r.reason : undefined).filter(Boolean);
|
|
723
|
+
if (errors.length) {
|
|
724
|
+
throw errors;
|
|
725
|
+
}
|
|
726
|
+
}
|
|
727
|
+
return fnResult;
|
|
728
|
+
};
|
|
729
|
+
}
|
|
730
|
+
function createSuite() {
|
|
731
|
+
function suiteFn(name, factoryOrOptions, optionsOrFactory) {
|
|
732
|
+
var _currentSuite$options;
|
|
733
|
+
const mode = this.only ? "only" : this.skip ? "skip" : this.todo ? "todo" : "run";
|
|
734
|
+
const currentSuite = collectorContext.currentSuite || defaultSuite;
|
|
735
|
+
let { options, handler: factory } = parseArguments(factoryOrOptions, optionsOrFactory);
|
|
736
|
+
const isConcurrentSpecified = options.concurrent || this.concurrent || options.sequential === false;
|
|
737
|
+
const isSequentialSpecified = options.sequential || this.sequential || options.concurrent === false;
|
|
738
|
+
options = {
|
|
739
|
+
...currentSuite === null || currentSuite === void 0 ? void 0 : currentSuite.options,
|
|
740
|
+
...options,
|
|
741
|
+
shuffle: this.shuffle ?? options.shuffle ?? (currentSuite === null || currentSuite === void 0 || (_currentSuite$options = currentSuite.options) === null || _currentSuite$options === void 0 ? void 0 : _currentSuite$options.shuffle) ?? (runner === null || runner === void 0 ? void 0 : runner.config.sequence.shuffle)
|
|
742
|
+
};
|
|
743
|
+
const isConcurrent = isConcurrentSpecified || options.concurrent && !isSequentialSpecified;
|
|
744
|
+
const isSequential = isSequentialSpecified || options.sequential && !isConcurrentSpecified;
|
|
745
|
+
options.concurrent = isConcurrent && !isSequential;
|
|
746
|
+
options.sequential = isSequential && !isConcurrent;
|
|
747
|
+
return createSuiteCollector(formatName(name), factory, mode, this.each, options, currentSuite === null || currentSuite === void 0 ? void 0 : currentSuite.fixtures());
|
|
748
|
+
}
|
|
749
|
+
suiteFn.each = function(cases, ...args) {
|
|
750
|
+
const suite$1 = this.withContext();
|
|
751
|
+
this.setContext("each", true);
|
|
752
|
+
if (Array.isArray(cases) && args.length) {
|
|
753
|
+
cases = formatTemplateString(cases, args);
|
|
754
|
+
}
|
|
755
|
+
return (name, optionsOrFn, fnOrOptions) => {
|
|
756
|
+
const _name = formatName(name);
|
|
757
|
+
const arrayOnlyCases = cases.every(Array.isArray);
|
|
758
|
+
const { options, handler } = parseArguments(optionsOrFn, fnOrOptions);
|
|
759
|
+
const fnFirst = typeof optionsOrFn === "function" && typeof fnOrOptions === "object";
|
|
760
|
+
cases.forEach((i, idx) => {
|
|
761
|
+
const items = Array.isArray(i) ? i : [i];
|
|
762
|
+
if (fnFirst) {
|
|
763
|
+
if (arrayOnlyCases) {
|
|
764
|
+
suite$1(formatTitle(_name, items, idx), () => handler(...items), options);
|
|
765
|
+
} else {
|
|
766
|
+
suite$1(formatTitle(_name, items, idx), () => handler(i), options);
|
|
767
|
+
}
|
|
768
|
+
} else {
|
|
769
|
+
if (arrayOnlyCases) {
|
|
770
|
+
suite$1(formatTitle(_name, items, idx), options, () => handler(...items));
|
|
771
|
+
} else {
|
|
772
|
+
suite$1(formatTitle(_name, items, idx), options, () => handler(i));
|
|
773
|
+
}
|
|
774
|
+
}
|
|
775
|
+
});
|
|
776
|
+
this.setContext("each", undefined);
|
|
777
|
+
};
|
|
778
|
+
};
|
|
779
|
+
suiteFn.for = function(cases, ...args) {
|
|
780
|
+
if (Array.isArray(cases) && args.length) {
|
|
781
|
+
cases = formatTemplateString(cases, args);
|
|
782
|
+
}
|
|
783
|
+
return (name, optionsOrFn, fnOrOptions) => {
|
|
784
|
+
const name_ = formatName(name);
|
|
785
|
+
const { options, handler } = parseArguments(optionsOrFn, fnOrOptions);
|
|
786
|
+
cases.forEach((item, idx) => {
|
|
787
|
+
suite(formatTitle(name_, toArray(item), idx), options, () => handler(item));
|
|
788
|
+
});
|
|
789
|
+
};
|
|
790
|
+
};
|
|
791
|
+
suiteFn.skipIf = (condition) => condition ? suite.skip : suite;
|
|
792
|
+
suiteFn.runIf = (condition) => condition ? suite : suite.skip;
|
|
793
|
+
return createChainable([
|
|
794
|
+
"concurrent",
|
|
795
|
+
"sequential",
|
|
796
|
+
"shuffle",
|
|
797
|
+
"skip",
|
|
798
|
+
"only",
|
|
799
|
+
"todo"
|
|
800
|
+
], suiteFn);
|
|
801
|
+
}
|
|
802
|
+
function createTaskCollector(fn, context) {
|
|
803
|
+
const taskFn = fn;
|
|
804
|
+
taskFn.each = function(cases, ...args) {
|
|
805
|
+
const test$1 = this.withContext();
|
|
806
|
+
this.setContext("each", true);
|
|
807
|
+
if (Array.isArray(cases) && args.length) {
|
|
808
|
+
cases = formatTemplateString(cases, args);
|
|
809
|
+
}
|
|
810
|
+
return (name, optionsOrFn, fnOrOptions) => {
|
|
811
|
+
const _name = formatName(name);
|
|
812
|
+
const arrayOnlyCases = cases.every(Array.isArray);
|
|
813
|
+
const { options, handler } = parseArguments(optionsOrFn, fnOrOptions);
|
|
814
|
+
const fnFirst = typeof optionsOrFn === "function" && typeof fnOrOptions === "object";
|
|
815
|
+
cases.forEach((i, idx) => {
|
|
816
|
+
const items = Array.isArray(i) ? i : [i];
|
|
817
|
+
if (fnFirst) {
|
|
818
|
+
if (arrayOnlyCases) {
|
|
819
|
+
test$1(formatTitle(_name, items, idx), () => handler(...items), options);
|
|
820
|
+
} else {
|
|
821
|
+
test$1(formatTitle(_name, items, idx), () => handler(i), options);
|
|
822
|
+
}
|
|
823
|
+
} else {
|
|
824
|
+
if (arrayOnlyCases) {
|
|
825
|
+
test$1(formatTitle(_name, items, idx), options, () => handler(...items));
|
|
826
|
+
} else {
|
|
827
|
+
test$1(formatTitle(_name, items, idx), options, () => handler(i));
|
|
828
|
+
}
|
|
829
|
+
}
|
|
830
|
+
});
|
|
831
|
+
this.setContext("each", undefined);
|
|
832
|
+
};
|
|
833
|
+
};
|
|
834
|
+
taskFn.for = function(cases, ...args) {
|
|
835
|
+
const test$1 = this.withContext();
|
|
836
|
+
if (Array.isArray(cases) && args.length) {
|
|
837
|
+
cases = formatTemplateString(cases, args);
|
|
838
|
+
}
|
|
839
|
+
return (name, optionsOrFn, fnOrOptions) => {
|
|
840
|
+
const _name = formatName(name);
|
|
841
|
+
const { options, handler } = parseArguments(optionsOrFn, fnOrOptions);
|
|
842
|
+
cases.forEach((item, idx) => {
|
|
843
|
+
const handlerWrapper = (ctx) => handler(item, ctx);
|
|
844
|
+
handlerWrapper.__VITEST_FIXTURE_INDEX__ = 1;
|
|
845
|
+
handlerWrapper.toString = () => handler.toString();
|
|
846
|
+
test$1(formatTitle(_name, toArray(item), idx), options, handlerWrapper);
|
|
847
|
+
});
|
|
848
|
+
};
|
|
849
|
+
};
|
|
850
|
+
taskFn.skipIf = function(condition) {
|
|
851
|
+
return condition ? this.skip : this;
|
|
852
|
+
};
|
|
853
|
+
taskFn.runIf = function(condition) {
|
|
854
|
+
return condition ? this : this.skip;
|
|
855
|
+
};
|
|
856
|
+
taskFn.scoped = function(fixtures) {
|
|
857
|
+
const collector = getCurrentSuite();
|
|
858
|
+
collector.scoped(fixtures);
|
|
859
|
+
};
|
|
860
|
+
taskFn.extend = function(fixtures) {
|
|
861
|
+
const _context = mergeContextFixtures(fixtures, context || {}, runner);
|
|
862
|
+
const originalWrapper = fn;
|
|
863
|
+
return createTest(function(name, optionsOrFn, optionsOrTest) {
|
|
864
|
+
const collector = getCurrentSuite();
|
|
865
|
+
const scopedFixtures = collector.fixtures();
|
|
866
|
+
const context$1 = { ...this };
|
|
867
|
+
if (scopedFixtures) {
|
|
868
|
+
context$1.fixtures = mergeScopedFixtures(context$1.fixtures || [], scopedFixtures);
|
|
869
|
+
}
|
|
870
|
+
const { handler, options } = parseArguments(optionsOrFn, optionsOrTest);
|
|
871
|
+
const timeout = options.timeout ?? (runner === null || runner === void 0 ? void 0 : runner.config.testTimeout);
|
|
872
|
+
originalWrapper.call(context$1, formatName(name), handler, timeout);
|
|
873
|
+
}, _context);
|
|
874
|
+
};
|
|
875
|
+
const _test$1 = createChainable([
|
|
876
|
+
"concurrent",
|
|
877
|
+
"sequential",
|
|
878
|
+
"skip",
|
|
879
|
+
"only",
|
|
880
|
+
"todo",
|
|
881
|
+
"fails"
|
|
882
|
+
], taskFn);
|
|
883
|
+
if (context) {
|
|
884
|
+
_test$1.mergeContext(context);
|
|
885
|
+
}
|
|
886
|
+
return _test$1;
|
|
887
|
+
}
|
|
888
|
+
function createTest(fn, context) {
|
|
889
|
+
return createTaskCollector(fn, context);
|
|
890
|
+
}
|
|
891
|
+
function formatName(name) {
|
|
892
|
+
return typeof name === "string" ? name : typeof name === "function" ? name.name || "<anonymous>" : String(name);
|
|
893
|
+
}
|
|
894
|
+
function formatTitle(template, items, idx) {
|
|
895
|
+
if (template.includes("%#") || template.includes("%$")) {
|
|
896
|
+
template = template.replace(/%%/g, "__vitest_escaped_%__").replace(/%#/g, `${idx}`).replace(/%\$/g, `${idx + 1}`).replace(/__vitest_escaped_%__/g, "%%");
|
|
897
|
+
}
|
|
898
|
+
const count = template.split("%").length - 1;
|
|
899
|
+
if (template.includes("%f")) {
|
|
900
|
+
const placeholders = template.match(/%f/g) || [];
|
|
901
|
+
placeholders.forEach((_, i) => {
|
|
902
|
+
if (isNegativeNaN(items[i]) || Object.is(items[i], -0)) {
|
|
903
|
+
let occurrence = 0;
|
|
904
|
+
template = template.replace(/%f/g, (match) => {
|
|
905
|
+
occurrence++;
|
|
906
|
+
return occurrence === i + 1 ? "-%f" : match;
|
|
907
|
+
});
|
|
908
|
+
}
|
|
909
|
+
});
|
|
910
|
+
}
|
|
911
|
+
let formatted = format(template, ...items.slice(0, count));
|
|
912
|
+
const isObjectItem = isObject(items[0]);
|
|
913
|
+
formatted = formatted.replace(/\$([$\w.]+)/g, (_, key) => {
|
|
914
|
+
var _runner$config;
|
|
915
|
+
const isArrayKey = /^\d+$/.test(key);
|
|
916
|
+
if (!isObjectItem && !isArrayKey) {
|
|
917
|
+
return `$${key}`;
|
|
918
|
+
}
|
|
919
|
+
const arrayElement = isArrayKey ? objectAttr(items, key) : undefined;
|
|
920
|
+
const value = isObjectItem ? objectAttr(items[0], key, arrayElement) : arrayElement;
|
|
921
|
+
return objDisplay(value, { truncate: runner === null || runner === void 0 || (_runner$config = runner.config) === null || _runner$config === void 0 || (_runner$config = _runner$config.chaiConfig) === null || _runner$config === void 0 ? void 0 : _runner$config.truncateThreshold });
|
|
922
|
+
});
|
|
923
|
+
return formatted;
|
|
924
|
+
}
|
|
925
|
+
function formatTemplateString(cases, args) {
|
|
926
|
+
const header = cases.join("").trim().replace(/ /g, "").split("\n").map((i) => i.split("|"))[0];
|
|
927
|
+
const res = [];
|
|
928
|
+
for (let i = 0; i < Math.floor(args.length / header.length); i++) {
|
|
929
|
+
const oneCase = {};
|
|
930
|
+
for (let j = 0; j < header.length; j++) {
|
|
931
|
+
oneCase[header[j]] = args[i * header.length + j];
|
|
932
|
+
}
|
|
933
|
+
res.push(oneCase);
|
|
934
|
+
}
|
|
935
|
+
return res;
|
|
936
|
+
}
|
|
937
|
+
function findTestFileStackTrace(error) {
|
|
938
|
+
const testFilePath = getTestFilepath();
|
|
939
|
+
const lines = error.split("\n").slice(1);
|
|
940
|
+
for (const line of lines) {
|
|
941
|
+
const stack = parseSingleStack(line);
|
|
942
|
+
if (stack && stack.file === testFilePath) {
|
|
943
|
+
return {
|
|
944
|
+
line: stack.line,
|
|
945
|
+
column: stack.column
|
|
946
|
+
};
|
|
947
|
+
}
|
|
948
|
+
}
|
|
949
|
+
}
|
|
950
|
+
/**
|
|
951
|
+
* If any tasks been marked as `only`, mark all other tasks as `skip`.
|
|
952
|
+
*/
|
|
953
|
+
function interpretTaskModes(file, namePattern, testLocations, onlyMode, parentIsOnly, allowOnly) {
|
|
954
|
+
const matchedLocations = [];
|
|
955
|
+
const traverseSuite = (suite$1, parentIsOnly$1, parentMatchedWithLocation) => {
|
|
956
|
+
const suiteIsOnly = parentIsOnly$1 || suite$1.mode === "only";
|
|
957
|
+
suite$1.tasks.forEach((t) => {
|
|
958
|
+
const includeTask = suiteIsOnly || t.mode === "only";
|
|
959
|
+
if (onlyMode) {
|
|
960
|
+
if (t.type === "suite" && (includeTask || someTasksAreOnly(t))) {
|
|
961
|
+
if (t.mode === "only") {
|
|
962
|
+
checkAllowOnly(t, allowOnly);
|
|
963
|
+
t.mode = "run";
|
|
964
|
+
}
|
|
965
|
+
} else if (t.mode === "run" && !includeTask) {
|
|
966
|
+
t.mode = "skip";
|
|
967
|
+
} else if (t.mode === "only") {
|
|
968
|
+
checkAllowOnly(t, allowOnly);
|
|
969
|
+
t.mode = "run";
|
|
970
|
+
}
|
|
971
|
+
}
|
|
972
|
+
let hasLocationMatch = parentMatchedWithLocation;
|
|
973
|
+
if (testLocations !== undefined && testLocations.length !== 0) {
|
|
974
|
+
if (t.location && (testLocations === null || testLocations === void 0 ? void 0 : testLocations.includes(t.location.line))) {
|
|
975
|
+
t.mode = "run";
|
|
976
|
+
matchedLocations.push(t.location.line);
|
|
977
|
+
hasLocationMatch = true;
|
|
978
|
+
} else if (parentMatchedWithLocation) {
|
|
979
|
+
t.mode = "run";
|
|
980
|
+
} else if (t.type === "test") {
|
|
981
|
+
t.mode = "skip";
|
|
982
|
+
}
|
|
983
|
+
}
|
|
984
|
+
if (t.type === "test") {
|
|
985
|
+
if (namePattern && !getTaskFullName(t).match(namePattern)) {
|
|
986
|
+
t.mode = "skip";
|
|
987
|
+
}
|
|
988
|
+
} else if (t.type === "suite") {
|
|
989
|
+
if (t.mode === "skip") {
|
|
990
|
+
skipAllTasks(t);
|
|
991
|
+
} else if (t.mode === "todo") {
|
|
992
|
+
todoAllTasks(t);
|
|
993
|
+
} else {
|
|
994
|
+
traverseSuite(t, includeTask, hasLocationMatch);
|
|
995
|
+
}
|
|
996
|
+
}
|
|
997
|
+
});
|
|
998
|
+
if (suite$1.mode === "run" || suite$1.mode === "queued") {
|
|
999
|
+
if (suite$1.tasks.length && suite$1.tasks.every((i) => i.mode !== "run" && i.mode !== "queued")) {
|
|
1000
|
+
suite$1.mode = "skip";
|
|
1001
|
+
}
|
|
1002
|
+
}
|
|
1003
|
+
};
|
|
1004
|
+
traverseSuite(file, parentIsOnly, false);
|
|
1005
|
+
const nonMatching = testLocations === null || testLocations === void 0 ? void 0 : testLocations.filter((loc) => !matchedLocations.includes(loc));
|
|
1006
|
+
if (nonMatching && nonMatching.length !== 0) {
|
|
1007
|
+
const message = nonMatching.length === 1 ? `line ${nonMatching[0]}` : `lines ${nonMatching.join(", ")}`;
|
|
1008
|
+
if (file.result === undefined) {
|
|
1009
|
+
file.result = {
|
|
1010
|
+
state: "fail",
|
|
1011
|
+
errors: []
|
|
1012
|
+
};
|
|
1013
|
+
}
|
|
1014
|
+
if (file.result.errors === undefined) {
|
|
1015
|
+
file.result.errors = [];
|
|
1016
|
+
}
|
|
1017
|
+
file.result.errors.push(processError(new Error(`No test found in ${file.name} in ${message}`)));
|
|
1018
|
+
}
|
|
1019
|
+
}
|
|
1020
|
+
function getTaskFullName(task) {
|
|
1021
|
+
return `${task.suite ? `${getTaskFullName(task.suite)} ` : ""}${task.name}`;
|
|
1022
|
+
}
|
|
1023
|
+
function someTasksAreOnly(suite$1) {
|
|
1024
|
+
return suite$1.tasks.some((t) => t.mode === "only" || t.type === "suite" && someTasksAreOnly(t));
|
|
1025
|
+
}
|
|
1026
|
+
function skipAllTasks(suite$1) {
|
|
1027
|
+
suite$1.tasks.forEach((t) => {
|
|
1028
|
+
if (t.mode === "run" || t.mode === "queued") {
|
|
1029
|
+
t.mode = "skip";
|
|
1030
|
+
if (t.type === "suite") {
|
|
1031
|
+
skipAllTasks(t);
|
|
1032
|
+
}
|
|
1033
|
+
}
|
|
1034
|
+
});
|
|
1035
|
+
}
|
|
1036
|
+
function todoAllTasks(suite$1) {
|
|
1037
|
+
suite$1.tasks.forEach((t) => {
|
|
1038
|
+
if (t.mode === "run" || t.mode === "queued") {
|
|
1039
|
+
t.mode = "todo";
|
|
1040
|
+
if (t.type === "suite") {
|
|
1041
|
+
todoAllTasks(t);
|
|
1042
|
+
}
|
|
1043
|
+
}
|
|
1044
|
+
});
|
|
1045
|
+
}
|
|
1046
|
+
function checkAllowOnly(task, allowOnly) {
|
|
1047
|
+
if (allowOnly) {
|
|
1048
|
+
return;
|
|
1049
|
+
}
|
|
1050
|
+
const error = processError(new Error("[Vitest] Unexpected .only modifier. Remove it or pass --allowOnly argument to bypass this error"));
|
|
1051
|
+
task.result = {
|
|
1052
|
+
state: "fail",
|
|
1053
|
+
errors: [error]
|
|
1054
|
+
};
|
|
1055
|
+
}
|
|
1056
|
+
function generateHash(str) {
|
|
1057
|
+
let hash = 0;
|
|
1058
|
+
if (str.length === 0) {
|
|
1059
|
+
return `${hash}`;
|
|
1060
|
+
}
|
|
1061
|
+
for (let i = 0; i < str.length; i++) {
|
|
1062
|
+
const char = str.charCodeAt(i);
|
|
1063
|
+
hash = (hash << 5) - hash + char;
|
|
1064
|
+
hash = hash & hash;
|
|
1065
|
+
}
|
|
1066
|
+
return `${hash}`;
|
|
1067
|
+
}
|
|
1068
|
+
function calculateSuiteHash(parent) {
|
|
1069
|
+
parent.tasks.forEach((t, idx) => {
|
|
1070
|
+
t.id = `${parent.id}_${idx}`;
|
|
1071
|
+
if (t.type === "suite") {
|
|
1072
|
+
calculateSuiteHash(t);
|
|
1073
|
+
}
|
|
1074
|
+
});
|
|
1075
|
+
}
|
|
1076
|
+
function createFileTask(filepath, root, projectName, pool) {
|
|
1077
|
+
const path = relative(root, filepath);
|
|
1078
|
+
const file = {
|
|
1079
|
+
id: generateFileHash(path, projectName),
|
|
1080
|
+
name: path,
|
|
1081
|
+
type: "suite",
|
|
1082
|
+
mode: "queued",
|
|
1083
|
+
filepath,
|
|
1084
|
+
tasks: [],
|
|
1085
|
+
meta: Object.create(null),
|
|
1086
|
+
projectName,
|
|
1087
|
+
file: undefined,
|
|
1088
|
+
pool
|
|
1089
|
+
};
|
|
1090
|
+
file.file = file;
|
|
1091
|
+
setFileContext(file, Object.create(null));
|
|
1092
|
+
return file;
|
|
1093
|
+
}
|
|
1094
|
+
/**
|
|
1095
|
+
* Generate a unique ID for a file based on its path and project name
|
|
1096
|
+
* @param file File relative to the root of the project to keep ID the same between different machines
|
|
1097
|
+
* @param projectName The name of the test project
|
|
1098
|
+
*/
|
|
1099
|
+
function generateFileHash(file, projectName) {
|
|
1100
|
+
return generateHash(`${file}${projectName || ""}`);
|
|
1101
|
+
}
|
|
1102
|
+
const now$2 = globalThis.performance ? globalThis.performance.now.bind(globalThis.performance) : Date.now;
|
|
1103
|
+
async function collectTests(specs, runner$1) {
|
|
1104
|
+
const files = [];
|
|
1105
|
+
const config = runner$1.config;
|
|
1106
|
+
for (const spec of specs) {
|
|
1107
|
+
var _runner$onCollectStar;
|
|
1108
|
+
const filepath = typeof spec === "string" ? spec : spec.filepath;
|
|
1109
|
+
const testLocations = typeof spec === "string" ? undefined : spec.testLocations;
|
|
1110
|
+
const file = createFileTask(filepath, config.root, config.name, runner$1.pool);
|
|
1111
|
+
file.shuffle = config.sequence.shuffle;
|
|
1112
|
+
(_runner$onCollectStar = runner$1.onCollectStart) === null || _runner$onCollectStar === void 0 ? void 0 : _runner$onCollectStar.call(runner$1, file);
|
|
1113
|
+
clearCollectorContext(filepath, runner$1);
|
|
1114
|
+
try {
|
|
1115
|
+
var _runner$getImportDura;
|
|
1116
|
+
const setupFiles = toArray(config.setupFiles);
|
|
1117
|
+
if (setupFiles.length) {
|
|
1118
|
+
const setupStart = now$2();
|
|
1119
|
+
await runSetupFiles(config, setupFiles, runner$1);
|
|
1120
|
+
const setupEnd = now$2();
|
|
1121
|
+
file.setupDuration = setupEnd - setupStart;
|
|
1122
|
+
} else {
|
|
1123
|
+
file.setupDuration = 0;
|
|
1124
|
+
}
|
|
1125
|
+
const collectStart = now$2();
|
|
1126
|
+
await runner$1.importFile(filepath, "collect");
|
|
1127
|
+
const durations = (_runner$getImportDura = runner$1.getImportDurations) === null || _runner$getImportDura === void 0 ? void 0 : _runner$getImportDura.call(runner$1);
|
|
1128
|
+
if (durations) {
|
|
1129
|
+
file.importDurations = durations;
|
|
1130
|
+
}
|
|
1131
|
+
const defaultTasks = await getDefaultSuite().collect(file);
|
|
1132
|
+
const fileHooks = createSuiteHooks();
|
|
1133
|
+
mergeHooks(fileHooks, getHooks(defaultTasks));
|
|
1134
|
+
for (const c of [...defaultTasks.tasks, ...collectorContext.tasks]) {
|
|
1135
|
+
if (c.type === "test" || c.type === "suite") {
|
|
1136
|
+
file.tasks.push(c);
|
|
1137
|
+
} else if (c.type === "collector") {
|
|
1138
|
+
const suite$1 = await c.collect(file);
|
|
1139
|
+
if (suite$1.name || suite$1.tasks.length) {
|
|
1140
|
+
mergeHooks(fileHooks, getHooks(suite$1));
|
|
1141
|
+
file.tasks.push(suite$1);
|
|
1142
|
+
}
|
|
1143
|
+
} else {
|
|
1144
|
+
c;
|
|
1145
|
+
}
|
|
1146
|
+
}
|
|
1147
|
+
setHooks(file, fileHooks);
|
|
1148
|
+
file.collectDuration = now$2() - collectStart;
|
|
1149
|
+
} catch (e) {
|
|
1150
|
+
var _runner$getImportDura2;
|
|
1151
|
+
const error = processError(e);
|
|
1152
|
+
file.result = {
|
|
1153
|
+
state: "fail",
|
|
1154
|
+
errors: [error]
|
|
1155
|
+
};
|
|
1156
|
+
const durations = (_runner$getImportDura2 = runner$1.getImportDurations) === null || _runner$getImportDura2 === void 0 ? void 0 : _runner$getImportDura2.call(runner$1);
|
|
1157
|
+
if (durations) {
|
|
1158
|
+
file.importDurations = durations;
|
|
1159
|
+
}
|
|
1160
|
+
}
|
|
1161
|
+
calculateSuiteHash(file);
|
|
1162
|
+
const hasOnlyTasks = someTasksAreOnly(file);
|
|
1163
|
+
interpretTaskModes(file, config.testNamePattern, testLocations, hasOnlyTasks, false, config.allowOnly);
|
|
1164
|
+
if (file.mode === "queued") {
|
|
1165
|
+
file.mode = "run";
|
|
1166
|
+
}
|
|
1167
|
+
files.push(file);
|
|
1168
|
+
}
|
|
1169
|
+
return files;
|
|
1170
|
+
}
|
|
1171
|
+
function mergeHooks(baseHooks, hooks) {
|
|
1172
|
+
for (const _key in hooks) {
|
|
1173
|
+
const key = _key;
|
|
1174
|
+
baseHooks[key].push(...hooks[key]);
|
|
1175
|
+
}
|
|
1176
|
+
return baseHooks;
|
|
1177
|
+
}
|
|
1178
|
+
/**
|
|
1179
|
+
* Return a function for running multiple async operations with limited concurrency.
|
|
1180
|
+
*/
|
|
1181
|
+
function limitConcurrency(concurrency = Infinity) {
|
|
1182
|
+
let count = 0;
|
|
1183
|
+
let head;
|
|
1184
|
+
let tail;
|
|
1185
|
+
const finish = () => {
|
|
1186
|
+
count--;
|
|
1187
|
+
if (head) {
|
|
1188
|
+
head[0]();
|
|
1189
|
+
head = head[1];
|
|
1190
|
+
tail = head && tail;
|
|
1191
|
+
}
|
|
1192
|
+
};
|
|
1193
|
+
return (func, ...args) => {
|
|
1194
|
+
return new Promise((resolve) => {
|
|
1195
|
+
if (count++ < concurrency) {
|
|
1196
|
+
resolve();
|
|
1197
|
+
} else if (tail) {
|
|
1198
|
+
tail = tail[1] = [resolve];
|
|
1199
|
+
} else {
|
|
1200
|
+
head = tail = [resolve];
|
|
1201
|
+
}
|
|
1202
|
+
}).then(() => {
|
|
1203
|
+
return func(...args);
|
|
1204
|
+
}).finally(finish);
|
|
1205
|
+
};
|
|
1206
|
+
}
|
|
1207
|
+
/**
|
|
1208
|
+
* Partition in tasks groups by consecutive concurrent
|
|
1209
|
+
*/
|
|
1210
|
+
function partitionSuiteChildren(suite$1) {
|
|
1211
|
+
let tasksGroup = [];
|
|
1212
|
+
const tasksGroups = [];
|
|
1213
|
+
for (const c of suite$1.tasks) {
|
|
1214
|
+
if (tasksGroup.length === 0 || c.concurrent === tasksGroup[0].concurrent) {
|
|
1215
|
+
tasksGroup.push(c);
|
|
1216
|
+
} else {
|
|
1217
|
+
tasksGroups.push(tasksGroup);
|
|
1218
|
+
tasksGroup = [c];
|
|
1219
|
+
}
|
|
1220
|
+
}
|
|
1221
|
+
if (tasksGroup.length > 0) {
|
|
1222
|
+
tasksGroups.push(tasksGroup);
|
|
1223
|
+
}
|
|
1224
|
+
return tasksGroups;
|
|
1225
|
+
}
|
|
1226
|
+
/**
|
|
1227
|
+
* @deprecated use `isTestCase` instead
|
|
1228
|
+
*/
|
|
1229
|
+
function isAtomTest(s) {
|
|
1230
|
+
return isTestCase(s);
|
|
1231
|
+
}
|
|
1232
|
+
function isTestCase(s) {
|
|
1233
|
+
return s.type === "test";
|
|
1234
|
+
}
|
|
1235
|
+
function getTests(suite$1) {
|
|
1236
|
+
const tests$1 = [];
|
|
1237
|
+
const arraySuites = toArray(suite$1);
|
|
1238
|
+
for (const s of arraySuites) {
|
|
1239
|
+
if (isTestCase(s)) {
|
|
1240
|
+
tests$1.push(s);
|
|
1241
|
+
} else {
|
|
1242
|
+
for (const task of s.tasks) {
|
|
1243
|
+
if (isTestCase(task)) {
|
|
1244
|
+
tests$1.push(task);
|
|
1245
|
+
} else {
|
|
1246
|
+
const taskTests = getTests(task);
|
|
1247
|
+
for (const test$1 of taskTests) {
|
|
1248
|
+
tests$1.push(test$1);
|
|
1249
|
+
}
|
|
1250
|
+
}
|
|
1251
|
+
}
|
|
1252
|
+
}
|
|
1253
|
+
}
|
|
1254
|
+
return tests$1;
|
|
1255
|
+
}
|
|
1256
|
+
function getTasks(tasks = []) {
|
|
1257
|
+
return toArray(tasks).flatMap((s) => isTestCase(s) ? [s] : [s, ...getTasks(s.tasks)]);
|
|
1258
|
+
}
|
|
1259
|
+
function getSuites(suite$1) {
|
|
1260
|
+
return toArray(suite$1).flatMap((s) => s.type === "suite" ? [s, ...getSuites(s.tasks)] : []);
|
|
1261
|
+
}
|
|
1262
|
+
function hasTests(suite$1) {
|
|
1263
|
+
return toArray(suite$1).some((s) => s.tasks.some((c) => isTestCase(c) || hasTests(c)));
|
|
1264
|
+
}
|
|
1265
|
+
function hasFailed(suite$1) {
|
|
1266
|
+
return toArray(suite$1).some((s) => {
|
|
1267
|
+
var _s$result;
|
|
1268
|
+
return ((_s$result = s.result) === null || _s$result === void 0 ? void 0 : _s$result.state) === "fail" || s.type === "suite" && hasFailed(s.tasks);
|
|
1269
|
+
});
|
|
1270
|
+
}
|
|
1271
|
+
function getNames(task) {
|
|
1272
|
+
const names = [task.name];
|
|
1273
|
+
let current = task;
|
|
1274
|
+
while (current === null || current === void 0 ? void 0 : current.suite) {
|
|
1275
|
+
current = current.suite;
|
|
1276
|
+
if (current === null || current === void 0 ? void 0 : current.name) {
|
|
1277
|
+
names.unshift(current.name);
|
|
1278
|
+
}
|
|
1279
|
+
}
|
|
1280
|
+
if (current !== task.file) {
|
|
1281
|
+
names.unshift(task.file.name);
|
|
1282
|
+
}
|
|
1283
|
+
return names;
|
|
1284
|
+
}
|
|
1285
|
+
function getFullName(task, separator = " > ") {
|
|
1286
|
+
return getNames(task).join(separator);
|
|
1287
|
+
}
|
|
1288
|
+
function getTestName(task, separator = " > ") {
|
|
1289
|
+
return getNames(task).slice(1).join(separator);
|
|
1290
|
+
}
|
|
1291
|
+
const now$1 = globalThis.performance ? globalThis.performance.now.bind(globalThis.performance) : Date.now;
|
|
1292
|
+
const unixNow = Date.now;
|
|
1293
|
+
const { clearTimeout, setTimeout } = getSafeTimers();
|
|
1294
|
+
function updateSuiteHookState(task, name, state, runner$1) {
|
|
1295
|
+
if (!task.result) {
|
|
1296
|
+
task.result = { state: "run" };
|
|
1297
|
+
}
|
|
1298
|
+
if (!task.result.hooks) {
|
|
1299
|
+
task.result.hooks = {};
|
|
1300
|
+
}
|
|
1301
|
+
const suiteHooks = task.result.hooks;
|
|
1302
|
+
if (suiteHooks) {
|
|
1303
|
+
suiteHooks[name] = state;
|
|
1304
|
+
let event = state === "run" ? "before-hook-start" : "before-hook-end";
|
|
1305
|
+
if (name === "afterAll" || name === "afterEach") {
|
|
1306
|
+
event = state === "run" ? "after-hook-start" : "after-hook-end";
|
|
1307
|
+
}
|
|
1308
|
+
updateTask(event, task, runner$1);
|
|
1309
|
+
}
|
|
1310
|
+
}
|
|
1311
|
+
function getSuiteHooks(suite$1, name, sequence) {
|
|
1312
|
+
const hooks = getHooks(suite$1)[name];
|
|
1313
|
+
if (sequence === "stack" && (name === "afterAll" || name === "afterEach")) {
|
|
1314
|
+
return hooks.slice().reverse();
|
|
1315
|
+
}
|
|
1316
|
+
return hooks;
|
|
1317
|
+
}
|
|
1318
|
+
async function callTestHooks(runner$1, test$1, hooks, sequence) {
|
|
1319
|
+
if (sequence === "stack") {
|
|
1320
|
+
hooks = hooks.slice().reverse();
|
|
1321
|
+
}
|
|
1322
|
+
if (!hooks.length) {
|
|
1323
|
+
return;
|
|
1324
|
+
}
|
|
1325
|
+
const context = test$1.context;
|
|
1326
|
+
const onTestFailed$1 = test$1.context.onTestFailed;
|
|
1327
|
+
const onTestFinished$1 = test$1.context.onTestFinished;
|
|
1328
|
+
context.onTestFailed = () => {
|
|
1329
|
+
throw new Error(`Cannot call "onTestFailed" inside a test hook.`);
|
|
1330
|
+
};
|
|
1331
|
+
context.onTestFinished = () => {
|
|
1332
|
+
throw new Error(`Cannot call "onTestFinished" inside a test hook.`);
|
|
1333
|
+
};
|
|
1334
|
+
if (sequence === "parallel") {
|
|
1335
|
+
try {
|
|
1336
|
+
await Promise.all(hooks.map((fn) => fn(test$1.context)));
|
|
1337
|
+
} catch (e) {
|
|
1338
|
+
failTask(test$1.result, e, runner$1.config.diffOptions);
|
|
1339
|
+
}
|
|
1340
|
+
} else {
|
|
1341
|
+
for (const fn of hooks) {
|
|
1342
|
+
try {
|
|
1343
|
+
await fn(test$1.context);
|
|
1344
|
+
} catch (e) {
|
|
1345
|
+
failTask(test$1.result, e, runner$1.config.diffOptions);
|
|
1346
|
+
}
|
|
1347
|
+
}
|
|
1348
|
+
}
|
|
1349
|
+
context.onTestFailed = onTestFailed$1;
|
|
1350
|
+
context.onTestFinished = onTestFinished$1;
|
|
1351
|
+
}
|
|
1352
|
+
async function callSuiteHook(suite$1, currentTask, name, runner$1, args) {
|
|
1353
|
+
const sequence = runner$1.config.sequence.hooks;
|
|
1354
|
+
const callbacks = [];
|
|
1355
|
+
const parentSuite = "filepath" in suite$1 ? null : suite$1.suite || suite$1.file;
|
|
1356
|
+
if (name === "beforeEach" && parentSuite) {
|
|
1357
|
+
callbacks.push(...await callSuiteHook(parentSuite, currentTask, name, runner$1, args));
|
|
1358
|
+
}
|
|
1359
|
+
const hooks = getSuiteHooks(suite$1, name, sequence);
|
|
1360
|
+
if (hooks.length > 0) {
|
|
1361
|
+
updateSuiteHookState(currentTask, name, "run", runner$1);
|
|
1362
|
+
}
|
|
1363
|
+
async function runHook(hook) {
|
|
1364
|
+
return getBeforeHookCleanupCallback(hook, await hook(...args), name === "beforeEach" ? args[0] : undefined);
|
|
1365
|
+
}
|
|
1366
|
+
if (sequence === "parallel") {
|
|
1367
|
+
callbacks.push(...await Promise.all(hooks.map((hook) => runHook(hook))));
|
|
1368
|
+
} else {
|
|
1369
|
+
for (const hook of hooks) {
|
|
1370
|
+
callbacks.push(await runHook(hook));
|
|
1371
|
+
}
|
|
1372
|
+
}
|
|
1373
|
+
if (hooks.length > 0) {
|
|
1374
|
+
updateSuiteHookState(currentTask, name, "pass", runner$1);
|
|
1375
|
+
}
|
|
1376
|
+
if (name === "afterEach" && parentSuite) {
|
|
1377
|
+
callbacks.push(...await callSuiteHook(parentSuite, currentTask, name, runner$1, args));
|
|
1378
|
+
}
|
|
1379
|
+
return callbacks;
|
|
1380
|
+
}
|
|
1381
|
+
const packs = new Map();
|
|
1382
|
+
const eventsPacks = [];
|
|
1383
|
+
const pendingTasksUpdates = [];
|
|
1384
|
+
function sendTasksUpdate(runner$1) {
|
|
1385
|
+
if (packs.size) {
|
|
1386
|
+
var _runner$onTaskUpdate;
|
|
1387
|
+
const taskPacks = Array.from(packs).map(([id, task]) => {
|
|
1388
|
+
return [
|
|
1389
|
+
id,
|
|
1390
|
+
task[0],
|
|
1391
|
+
task[1]
|
|
1392
|
+
];
|
|
1393
|
+
});
|
|
1394
|
+
const p = (_runner$onTaskUpdate = runner$1.onTaskUpdate) === null || _runner$onTaskUpdate === void 0 ? void 0 : _runner$onTaskUpdate.call(runner$1, taskPacks, eventsPacks);
|
|
1395
|
+
if (p) {
|
|
1396
|
+
pendingTasksUpdates.push(p);
|
|
1397
|
+
p.then(() => pendingTasksUpdates.splice(pendingTasksUpdates.indexOf(p), 1), () => {});
|
|
1398
|
+
}
|
|
1399
|
+
eventsPacks.length = 0;
|
|
1400
|
+
packs.clear();
|
|
1401
|
+
}
|
|
1402
|
+
}
|
|
1403
|
+
async function finishSendTasksUpdate(runner$1) {
|
|
1404
|
+
sendTasksUpdate(runner$1);
|
|
1405
|
+
await Promise.all(pendingTasksUpdates);
|
|
1406
|
+
}
|
|
1407
|
+
function throttle(fn, ms) {
|
|
1408
|
+
let last = 0;
|
|
1409
|
+
let pendingCall;
|
|
1410
|
+
return function call(...args) {
|
|
1411
|
+
const now$3 = unixNow();
|
|
1412
|
+
if (now$3 - last > ms) {
|
|
1413
|
+
last = now$3;
|
|
1414
|
+
clearTimeout(pendingCall);
|
|
1415
|
+
pendingCall = undefined;
|
|
1416
|
+
return fn.apply(this, args);
|
|
1417
|
+
}
|
|
1418
|
+
pendingCall ?? (pendingCall = setTimeout(() => call.bind(this)(...args), ms));
|
|
1419
|
+
};
|
|
1420
|
+
}
|
|
1421
|
+
const sendTasksUpdateThrottled = throttle(sendTasksUpdate, 100);
|
|
1422
|
+
function updateTask(event, task, runner$1) {
|
|
1423
|
+
eventsPacks.push([
|
|
1424
|
+
task.id,
|
|
1425
|
+
event,
|
|
1426
|
+
undefined
|
|
1427
|
+
]);
|
|
1428
|
+
packs.set(task.id, [task.result, task.meta]);
|
|
1429
|
+
sendTasksUpdateThrottled(runner$1);
|
|
1430
|
+
}
|
|
1431
|
+
async function callCleanupHooks(runner$1, cleanups) {
|
|
1432
|
+
const sequence = runner$1.config.sequence.hooks;
|
|
1433
|
+
if (sequence === "stack") {
|
|
1434
|
+
cleanups = cleanups.slice().reverse();
|
|
1435
|
+
}
|
|
1436
|
+
if (sequence === "parallel") {
|
|
1437
|
+
await Promise.all(cleanups.map(async (fn) => {
|
|
1438
|
+
if (typeof fn !== "function") {
|
|
1439
|
+
return;
|
|
1440
|
+
}
|
|
1441
|
+
await fn();
|
|
1442
|
+
}));
|
|
1443
|
+
} else {
|
|
1444
|
+
for (const fn of cleanups) {
|
|
1445
|
+
if (typeof fn !== "function") {
|
|
1446
|
+
continue;
|
|
1447
|
+
}
|
|
1448
|
+
await fn();
|
|
1449
|
+
}
|
|
1450
|
+
}
|
|
1451
|
+
}
|
|
1452
|
+
async function runTest(test$1, runner$1) {
|
|
1453
|
+
var _runner$onBeforeRunTa, _test$result, _runner$onAfterRunTas;
|
|
1454
|
+
await ((_runner$onBeforeRunTa = runner$1.onBeforeRunTask) === null || _runner$onBeforeRunTa === void 0 ? void 0 : _runner$onBeforeRunTa.call(runner$1, test$1));
|
|
1455
|
+
if (test$1.mode !== "run" && test$1.mode !== "queued") {
|
|
1456
|
+
updateTask("test-prepare", test$1, runner$1);
|
|
1457
|
+
updateTask("test-finished", test$1, runner$1);
|
|
1458
|
+
return;
|
|
1459
|
+
}
|
|
1460
|
+
if (((_test$result = test$1.result) === null || _test$result === void 0 ? void 0 : _test$result.state) === "fail") {
|
|
1461
|
+
updateTask("test-failed-early", test$1, runner$1);
|
|
1462
|
+
return;
|
|
1463
|
+
}
|
|
1464
|
+
const start = now$1();
|
|
1465
|
+
test$1.result = {
|
|
1466
|
+
state: "run",
|
|
1467
|
+
startTime: unixNow(),
|
|
1468
|
+
retryCount: 0
|
|
1469
|
+
};
|
|
1470
|
+
updateTask("test-prepare", test$1, runner$1);
|
|
1471
|
+
const cleanupRunningTest = addRunningTest(test$1);
|
|
1472
|
+
setCurrentTest(test$1);
|
|
1473
|
+
const suite$1 = test$1.suite || test$1.file;
|
|
1474
|
+
const repeats = test$1.repeats ?? 0;
|
|
1475
|
+
for (let repeatCount = 0; repeatCount <= repeats; repeatCount++) {
|
|
1476
|
+
const retry = test$1.retry ?? 0;
|
|
1477
|
+
for (let retryCount = 0; retryCount <= retry; retryCount++) {
|
|
1478
|
+
var _test$result2, _test$result3;
|
|
1479
|
+
let beforeEachCleanups = [];
|
|
1480
|
+
try {
|
|
1481
|
+
var _runner$onBeforeTryTa, _runner$onAfterTryTas;
|
|
1482
|
+
await ((_runner$onBeforeTryTa = runner$1.onBeforeTryTask) === null || _runner$onBeforeTryTa === void 0 ? void 0 : _runner$onBeforeTryTa.call(runner$1, test$1, {
|
|
1483
|
+
retry: retryCount,
|
|
1484
|
+
repeats: repeatCount
|
|
1485
|
+
}));
|
|
1486
|
+
test$1.result.repeatCount = repeatCount;
|
|
1487
|
+
beforeEachCleanups = await callSuiteHook(suite$1, test$1, "beforeEach", runner$1, [test$1.context, suite$1]);
|
|
1488
|
+
if (runner$1.runTask) {
|
|
1489
|
+
await runner$1.runTask(test$1);
|
|
1490
|
+
} else {
|
|
1491
|
+
const fn = getFn(test$1);
|
|
1492
|
+
if (!fn) {
|
|
1493
|
+
throw new Error("Test function is not found. Did you add it using `setFn`?");
|
|
1494
|
+
}
|
|
1495
|
+
await fn();
|
|
1496
|
+
}
|
|
1497
|
+
await ((_runner$onAfterTryTas = runner$1.onAfterTryTask) === null || _runner$onAfterTryTas === void 0 ? void 0 : _runner$onAfterTryTas.call(runner$1, test$1, {
|
|
1498
|
+
retry: retryCount,
|
|
1499
|
+
repeats: repeatCount
|
|
1500
|
+
}));
|
|
1501
|
+
if (test$1.result.state !== "fail") {
|
|
1502
|
+
if (!test$1.repeats) {
|
|
1503
|
+
test$1.result.state = "pass";
|
|
1504
|
+
} else if (test$1.repeats && retry === retryCount) {
|
|
1505
|
+
test$1.result.state = "pass";
|
|
1506
|
+
}
|
|
1507
|
+
}
|
|
1508
|
+
} catch (e) {
|
|
1509
|
+
failTask(test$1.result, e, runner$1.config.diffOptions);
|
|
1510
|
+
}
|
|
1511
|
+
try {
|
|
1512
|
+
var _runner$onTaskFinishe;
|
|
1513
|
+
await ((_runner$onTaskFinishe = runner$1.onTaskFinished) === null || _runner$onTaskFinishe === void 0 ? void 0 : _runner$onTaskFinishe.call(runner$1, test$1));
|
|
1514
|
+
} catch (e) {
|
|
1515
|
+
failTask(test$1.result, e, runner$1.config.diffOptions);
|
|
1516
|
+
}
|
|
1517
|
+
try {
|
|
1518
|
+
await callSuiteHook(suite$1, test$1, "afterEach", runner$1, [test$1.context, suite$1]);
|
|
1519
|
+
await callCleanupHooks(runner$1, beforeEachCleanups);
|
|
1520
|
+
await callFixtureCleanup(test$1.context);
|
|
1521
|
+
} catch (e) {
|
|
1522
|
+
failTask(test$1.result, e, runner$1.config.diffOptions);
|
|
1523
|
+
}
|
|
1524
|
+
await callTestHooks(runner$1, test$1, test$1.onFinished || [], "stack");
|
|
1525
|
+
if (test$1.result.state === "fail") {
|
|
1526
|
+
await callTestHooks(runner$1, test$1, test$1.onFailed || [], runner$1.config.sequence.hooks);
|
|
1527
|
+
}
|
|
1528
|
+
test$1.onFailed = undefined;
|
|
1529
|
+
test$1.onFinished = undefined;
|
|
1530
|
+
if (((_test$result2 = test$1.result) === null || _test$result2 === void 0 ? void 0 : _test$result2.pending) || ((_test$result3 = test$1.result) === null || _test$result3 === void 0 ? void 0 : _test$result3.state) === "skip") {
|
|
1531
|
+
var _test$result4;
|
|
1532
|
+
test$1.mode = "skip";
|
|
1533
|
+
test$1.result = {
|
|
1534
|
+
state: "skip",
|
|
1535
|
+
note: (_test$result4 = test$1.result) === null || _test$result4 === void 0 ? void 0 : _test$result4.note,
|
|
1536
|
+
pending: true,
|
|
1537
|
+
duration: now$1() - start
|
|
1538
|
+
};
|
|
1539
|
+
updateTask("test-finished", test$1, runner$1);
|
|
1540
|
+
setCurrentTest(undefined);
|
|
1541
|
+
cleanupRunningTest();
|
|
1542
|
+
return;
|
|
1543
|
+
}
|
|
1544
|
+
if (test$1.result.state === "pass") {
|
|
1545
|
+
break;
|
|
1546
|
+
}
|
|
1547
|
+
if (retryCount < retry) {
|
|
1548
|
+
test$1.result.state = "run";
|
|
1549
|
+
test$1.result.retryCount = (test$1.result.retryCount ?? 0) + 1;
|
|
1550
|
+
}
|
|
1551
|
+
updateTask("test-retried", test$1, runner$1);
|
|
1552
|
+
}
|
|
1553
|
+
}
|
|
1554
|
+
if (test$1.fails) {
|
|
1555
|
+
if (test$1.result.state === "pass") {
|
|
1556
|
+
const error = processError(new Error("Expect test to fail"));
|
|
1557
|
+
test$1.result.state = "fail";
|
|
1558
|
+
test$1.result.errors = [error];
|
|
1559
|
+
} else {
|
|
1560
|
+
test$1.result.state = "pass";
|
|
1561
|
+
test$1.result.errors = undefined;
|
|
1562
|
+
}
|
|
1563
|
+
}
|
|
1564
|
+
cleanupRunningTest();
|
|
1565
|
+
setCurrentTest(undefined);
|
|
1566
|
+
test$1.result.duration = now$1() - start;
|
|
1567
|
+
await ((_runner$onAfterRunTas = runner$1.onAfterRunTask) === null || _runner$onAfterRunTas === void 0 ? void 0 : _runner$onAfterRunTas.call(runner$1, test$1));
|
|
1568
|
+
updateTask("test-finished", test$1, runner$1);
|
|
1569
|
+
}
|
|
1570
|
+
function failTask(result, err, diffOptions) {
|
|
1571
|
+
if (err instanceof PendingError) {
|
|
1572
|
+
result.state = "skip";
|
|
1573
|
+
result.note = err.note;
|
|
1574
|
+
result.pending = true;
|
|
1575
|
+
return;
|
|
1576
|
+
}
|
|
1577
|
+
result.state = "fail";
|
|
1578
|
+
const errors = Array.isArray(err) ? err : [err];
|
|
1579
|
+
for (const e of errors) {
|
|
1580
|
+
const error = processError(e, diffOptions);
|
|
1581
|
+
result.errors ?? (result.errors = []);
|
|
1582
|
+
result.errors.push(error);
|
|
1583
|
+
}
|
|
1584
|
+
}
|
|
1585
|
+
function markTasksAsSkipped(suite$1, runner$1) {
|
|
1586
|
+
suite$1.tasks.forEach((t) => {
|
|
1587
|
+
t.mode = "skip";
|
|
1588
|
+
t.result = {
|
|
1589
|
+
...t.result,
|
|
1590
|
+
state: "skip"
|
|
1591
|
+
};
|
|
1592
|
+
updateTask("test-finished", t, runner$1);
|
|
1593
|
+
if (t.type === "suite") {
|
|
1594
|
+
markTasksAsSkipped(t, runner$1);
|
|
1595
|
+
}
|
|
1596
|
+
});
|
|
1597
|
+
}
|
|
1598
|
+
async function runSuite(suite$1, runner$1) {
|
|
1599
|
+
var _runner$onBeforeRunSu, _suite$result;
|
|
1600
|
+
await ((_runner$onBeforeRunSu = runner$1.onBeforeRunSuite) === null || _runner$onBeforeRunSu === void 0 ? void 0 : _runner$onBeforeRunSu.call(runner$1, suite$1));
|
|
1601
|
+
if (((_suite$result = suite$1.result) === null || _suite$result === void 0 ? void 0 : _suite$result.state) === "fail") {
|
|
1602
|
+
markTasksAsSkipped(suite$1, runner$1);
|
|
1603
|
+
updateTask("suite-failed-early", suite$1, runner$1);
|
|
1604
|
+
return;
|
|
1605
|
+
}
|
|
1606
|
+
const start = now$1();
|
|
1607
|
+
const mode = suite$1.mode;
|
|
1608
|
+
suite$1.result = {
|
|
1609
|
+
state: mode === "skip" || mode === "todo" ? mode : "run",
|
|
1610
|
+
startTime: unixNow()
|
|
1611
|
+
};
|
|
1612
|
+
updateTask("suite-prepare", suite$1, runner$1);
|
|
1613
|
+
let beforeAllCleanups = [];
|
|
1614
|
+
if (suite$1.mode === "skip") {
|
|
1615
|
+
suite$1.result.state = "skip";
|
|
1616
|
+
updateTask("suite-finished", suite$1, runner$1);
|
|
1617
|
+
} else if (suite$1.mode === "todo") {
|
|
1618
|
+
suite$1.result.state = "todo";
|
|
1619
|
+
updateTask("suite-finished", suite$1, runner$1);
|
|
1620
|
+
} else {
|
|
1621
|
+
var _runner$onAfterRunSui;
|
|
1622
|
+
try {
|
|
1623
|
+
try {
|
|
1624
|
+
beforeAllCleanups = await callSuiteHook(suite$1, suite$1, "beforeAll", runner$1, [suite$1]);
|
|
1625
|
+
} catch (e) {
|
|
1626
|
+
markTasksAsSkipped(suite$1, runner$1);
|
|
1627
|
+
throw e;
|
|
1628
|
+
}
|
|
1629
|
+
if (runner$1.runSuite) {
|
|
1630
|
+
await runner$1.runSuite(suite$1);
|
|
1631
|
+
} else {
|
|
1632
|
+
for (let tasksGroup of partitionSuiteChildren(suite$1)) {
|
|
1633
|
+
if (tasksGroup[0].concurrent === true) {
|
|
1634
|
+
await Promise.all(tasksGroup.map((c) => runSuiteChild(c, runner$1)));
|
|
1635
|
+
} else {
|
|
1636
|
+
const { sequence } = runner$1.config;
|
|
1637
|
+
if (suite$1.shuffle) {
|
|
1638
|
+
const suites = tasksGroup.filter((group) => group.type === "suite");
|
|
1639
|
+
const tests$1 = tasksGroup.filter((group) => group.type === "test");
|
|
1640
|
+
const groups = shuffle([suites, tests$1], sequence.seed);
|
|
1641
|
+
tasksGroup = groups.flatMap((group) => shuffle(group, sequence.seed));
|
|
1642
|
+
}
|
|
1643
|
+
for (const c of tasksGroup) {
|
|
1644
|
+
await runSuiteChild(c, runner$1);
|
|
1645
|
+
}
|
|
1646
|
+
}
|
|
1647
|
+
}
|
|
1648
|
+
}
|
|
1649
|
+
} catch (e) {
|
|
1650
|
+
failTask(suite$1.result, e, runner$1.config.diffOptions);
|
|
1651
|
+
}
|
|
1652
|
+
try {
|
|
1653
|
+
await callSuiteHook(suite$1, suite$1, "afterAll", runner$1, [suite$1]);
|
|
1654
|
+
await callCleanupHooks(runner$1, beforeAllCleanups);
|
|
1655
|
+
if (suite$1.file === suite$1) {
|
|
1656
|
+
const context = getFileContext(suite$1);
|
|
1657
|
+
await callFixtureCleanup(context);
|
|
1658
|
+
}
|
|
1659
|
+
} catch (e) {
|
|
1660
|
+
failTask(suite$1.result, e, runner$1.config.diffOptions);
|
|
1661
|
+
}
|
|
1662
|
+
if (suite$1.mode === "run" || suite$1.mode === "queued") {
|
|
1663
|
+
if (!runner$1.config.passWithNoTests && !hasTests(suite$1)) {
|
|
1664
|
+
var _suite$result$errors;
|
|
1665
|
+
suite$1.result.state = "fail";
|
|
1666
|
+
if (!((_suite$result$errors = suite$1.result.errors) === null || _suite$result$errors === void 0 ? void 0 : _suite$result$errors.length)) {
|
|
1667
|
+
const error = processError(new Error(`No test found in suite ${suite$1.name}`));
|
|
1668
|
+
suite$1.result.errors = [error];
|
|
1669
|
+
}
|
|
1670
|
+
} else if (hasFailed(suite$1)) {
|
|
1671
|
+
suite$1.result.state = "fail";
|
|
1672
|
+
} else {
|
|
1673
|
+
suite$1.result.state = "pass";
|
|
1674
|
+
}
|
|
1675
|
+
}
|
|
1676
|
+
suite$1.result.duration = now$1() - start;
|
|
1677
|
+
updateTask("suite-finished", suite$1, runner$1);
|
|
1678
|
+
await ((_runner$onAfterRunSui = runner$1.onAfterRunSuite) === null || _runner$onAfterRunSui === void 0 ? void 0 : _runner$onAfterRunSui.call(runner$1, suite$1));
|
|
1679
|
+
}
|
|
1680
|
+
}
|
|
1681
|
+
let limitMaxConcurrency;
|
|
1682
|
+
async function runSuiteChild(c, runner$1) {
|
|
1683
|
+
if (c.type === "test") {
|
|
1684
|
+
return limitMaxConcurrency(() => runTest(c, runner$1));
|
|
1685
|
+
} else if (c.type === "suite") {
|
|
1686
|
+
return runSuite(c, runner$1);
|
|
1687
|
+
}
|
|
1688
|
+
}
|
|
1689
|
+
async function runFiles(files, runner$1) {
|
|
1690
|
+
limitMaxConcurrency ?? (limitMaxConcurrency = limitConcurrency(runner$1.config.maxConcurrency));
|
|
1691
|
+
for (const file of files) {
|
|
1692
|
+
if (!file.tasks.length && !runner$1.config.passWithNoTests) {
|
|
1693
|
+
var _file$result;
|
|
1694
|
+
if (!((_file$result = file.result) === null || _file$result === void 0 || (_file$result = _file$result.errors) === null || _file$result === void 0 ? void 0 : _file$result.length)) {
|
|
1695
|
+
const error = processError(new Error(`No test suite found in file ${file.filepath}`));
|
|
1696
|
+
file.result = {
|
|
1697
|
+
state: "fail",
|
|
1698
|
+
errors: [error]
|
|
1699
|
+
};
|
|
1700
|
+
}
|
|
1701
|
+
}
|
|
1702
|
+
await runSuite(file, runner$1);
|
|
1703
|
+
}
|
|
1704
|
+
}
|
|
1705
|
+
const workerRunners = new WeakSet();
|
|
1706
|
+
async function startTests(specs, runner$1) {
|
|
1707
|
+
var _runner$cancel;
|
|
1708
|
+
const cancel = (_runner$cancel = runner$1.cancel) === null || _runner$cancel === void 0 ? void 0 : _runner$cancel.bind(runner$1);
|
|
1709
|
+
runner$1.cancel = (reason) => {
|
|
1710
|
+
const error = new TestRunAbortError("The test run was aborted by the user.", reason);
|
|
1711
|
+
getRunningTests().forEach((test$1) => abortContextSignal(test$1.context, error));
|
|
1712
|
+
return cancel === null || cancel === void 0 ? void 0 : cancel(reason);
|
|
1713
|
+
};
|
|
1714
|
+
if (!workerRunners.has(runner$1)) {
|
|
1715
|
+
var _runner$onCleanupWork;
|
|
1716
|
+
(_runner$onCleanupWork = runner$1.onCleanupWorkerContext) === null || _runner$onCleanupWork === void 0 ? void 0 : _runner$onCleanupWork.call(runner$1, async () => {
|
|
1717
|
+
var _runner$getWorkerCont;
|
|
1718
|
+
const context = (_runner$getWorkerCont = runner$1.getWorkerContext) === null || _runner$getWorkerCont === void 0 ? void 0 : _runner$getWorkerCont.call(runner$1);
|
|
1719
|
+
if (context) {
|
|
1720
|
+
await callFixtureCleanup(context);
|
|
1721
|
+
}
|
|
1722
|
+
});
|
|
1723
|
+
workerRunners.add(runner$1);
|
|
1724
|
+
}
|
|
1725
|
+
try {
|
|
1726
|
+
var _runner$onBeforeColle, _runner$onCollected, _runner$onBeforeRunFi, _runner$onAfterRunFil;
|
|
1727
|
+
const paths = specs.map((f) => typeof f === "string" ? f : f.filepath);
|
|
1728
|
+
await ((_runner$onBeforeColle = runner$1.onBeforeCollect) === null || _runner$onBeforeColle === void 0 ? void 0 : _runner$onBeforeColle.call(runner$1, paths));
|
|
1729
|
+
const files = await collectTests(specs, runner$1);
|
|
1730
|
+
await ((_runner$onCollected = runner$1.onCollected) === null || _runner$onCollected === void 0 ? void 0 : _runner$onCollected.call(runner$1, files));
|
|
1731
|
+
await ((_runner$onBeforeRunFi = runner$1.onBeforeRunFiles) === null || _runner$onBeforeRunFi === void 0 ? void 0 : _runner$onBeforeRunFi.call(runner$1, files));
|
|
1732
|
+
await runFiles(files, runner$1);
|
|
1733
|
+
await ((_runner$onAfterRunFil = runner$1.onAfterRunFiles) === null || _runner$onAfterRunFil === void 0 ? void 0 : _runner$onAfterRunFil.call(runner$1, files));
|
|
1734
|
+
await finishSendTasksUpdate(runner$1);
|
|
1735
|
+
return files;
|
|
1736
|
+
} finally {
|
|
1737
|
+
runner$1.cancel = cancel;
|
|
1738
|
+
}
|
|
1739
|
+
}
|
|
1740
|
+
async function publicCollect(specs, runner$1) {
|
|
1741
|
+
var _runner$onBeforeColle2, _runner$onCollected2;
|
|
1742
|
+
const paths = specs.map((f) => typeof f === "string" ? f : f.filepath);
|
|
1743
|
+
await ((_runner$onBeforeColle2 = runner$1.onBeforeCollect) === null || _runner$onBeforeColle2 === void 0 ? void 0 : _runner$onBeforeColle2.call(runner$1, paths));
|
|
1744
|
+
const files = await collectTests(specs, runner$1);
|
|
1745
|
+
await ((_runner$onCollected2 = runner$1.onCollected) === null || _runner$onCollected2 === void 0 ? void 0 : _runner$onCollected2.call(runner$1, files));
|
|
1746
|
+
return files;
|
|
1747
|
+
}
|
|
1748
|
+
const now = Date.now;
|
|
1749
|
+
const collectorContext = {
|
|
1750
|
+
tasks: [],
|
|
1751
|
+
currentSuite: null
|
|
1752
|
+
};
|
|
1753
|
+
function collectTask(task) {
|
|
1754
|
+
var _collectorContext$cur;
|
|
1755
|
+
(_collectorContext$cur = collectorContext.currentSuite) === null || _collectorContext$cur === void 0 ? void 0 : _collectorContext$cur.tasks.push(task);
|
|
1756
|
+
}
|
|
1757
|
+
async function runWithSuite(suite$1, fn) {
|
|
1758
|
+
const prev = collectorContext.currentSuite;
|
|
1759
|
+
collectorContext.currentSuite = suite$1;
|
|
1760
|
+
await fn();
|
|
1761
|
+
collectorContext.currentSuite = prev;
|
|
1762
|
+
}
|
|
1763
|
+
function withTimeout(fn, timeout, isHook = false, stackTraceError, onTimeout) {
|
|
1764
|
+
if (timeout <= 0 || timeout === Number.POSITIVE_INFINITY) {
|
|
1765
|
+
return fn;
|
|
1766
|
+
}
|
|
1767
|
+
const { setTimeout: setTimeout$1, clearTimeout: clearTimeout$1 } = getSafeTimers();
|
|
1768
|
+
return function runWithTimeout(...args) {
|
|
1769
|
+
const startTime = now();
|
|
1770
|
+
const runner$1 = getRunner();
|
|
1771
|
+
runner$1._currentTaskStartTime = startTime;
|
|
1772
|
+
runner$1._currentTaskTimeout = timeout;
|
|
1773
|
+
return new Promise((resolve_, reject_) => {
|
|
1774
|
+
var _timer$unref;
|
|
1775
|
+
const timer = setTimeout$1(() => {
|
|
1776
|
+
clearTimeout$1(timer);
|
|
1777
|
+
rejectTimeoutError();
|
|
1778
|
+
}, timeout);
|
|
1779
|
+
(_timer$unref = timer.unref) === null || _timer$unref === void 0 ? void 0 : _timer$unref.call(timer);
|
|
1780
|
+
function rejectTimeoutError() {
|
|
1781
|
+
const error = makeTimeoutError(isHook, timeout, stackTraceError);
|
|
1782
|
+
onTimeout === null || onTimeout === void 0 ? void 0 : onTimeout(args, error);
|
|
1783
|
+
reject_(error);
|
|
1784
|
+
}
|
|
1785
|
+
function resolve(result) {
|
|
1786
|
+
runner$1._currentTaskStartTime = undefined;
|
|
1787
|
+
runner$1._currentTaskTimeout = undefined;
|
|
1788
|
+
clearTimeout$1(timer);
|
|
1789
|
+
if (now() - startTime >= timeout) {
|
|
1790
|
+
rejectTimeoutError();
|
|
1791
|
+
return;
|
|
1792
|
+
}
|
|
1793
|
+
resolve_(result);
|
|
1794
|
+
}
|
|
1795
|
+
function reject(error) {
|
|
1796
|
+
runner$1._currentTaskStartTime = undefined;
|
|
1797
|
+
runner$1._currentTaskTimeout = undefined;
|
|
1798
|
+
clearTimeout$1(timer);
|
|
1799
|
+
reject_(error);
|
|
1800
|
+
}
|
|
1801
|
+
try {
|
|
1802
|
+
const result = fn(...args);
|
|
1803
|
+
if (typeof result === "object" && result != null && typeof result.then === "function") {
|
|
1804
|
+
result.then(resolve, reject);
|
|
1805
|
+
} else {
|
|
1806
|
+
resolve(result);
|
|
1807
|
+
}
|
|
1808
|
+
} catch (error) {
|
|
1809
|
+
reject(error);
|
|
1810
|
+
}
|
|
1811
|
+
});
|
|
1812
|
+
};
|
|
1813
|
+
}
|
|
1814
|
+
const abortControllers = new WeakMap();
|
|
1815
|
+
function abortIfTimeout([context], error) {
|
|
1816
|
+
if (context) {
|
|
1817
|
+
abortContextSignal(context, error);
|
|
1818
|
+
}
|
|
1819
|
+
}
|
|
1820
|
+
function abortContextSignal(context, error) {
|
|
1821
|
+
const abortController = abortControllers.get(context);
|
|
1822
|
+
abortController === null || abortController === void 0 ? void 0 : abortController.abort(error);
|
|
1823
|
+
}
|
|
1824
|
+
function createTestContext(test$1, runner$1) {
|
|
1825
|
+
var _runner$extendTaskCon;
|
|
1826
|
+
const context = function() {
|
|
1827
|
+
throw new Error("done() callback is deprecated, use promise instead");
|
|
1828
|
+
};
|
|
1829
|
+
let abortController = abortControllers.get(context);
|
|
1830
|
+
if (!abortController) {
|
|
1831
|
+
abortController = new AbortController();
|
|
1832
|
+
abortControllers.set(context, abortController);
|
|
1833
|
+
}
|
|
1834
|
+
context.signal = abortController.signal;
|
|
1835
|
+
context.task = test$1;
|
|
1836
|
+
context.skip = (condition, note) => {
|
|
1837
|
+
if (condition === false) {
|
|
1838
|
+
return undefined;
|
|
1839
|
+
}
|
|
1840
|
+
test$1.result ?? (test$1.result = { state: "skip" });
|
|
1841
|
+
test$1.result.pending = true;
|
|
1842
|
+
throw new PendingError("test is skipped; abort execution", test$1, typeof condition === "string" ? condition : note);
|
|
1843
|
+
};
|
|
1844
|
+
async function annotate(message, location, type, attachment) {
|
|
1845
|
+
const annotation = {
|
|
1846
|
+
message,
|
|
1847
|
+
type: type || "notice"
|
|
1848
|
+
};
|
|
1849
|
+
if (attachment) {
|
|
1850
|
+
if (!attachment.body && !attachment.path) {
|
|
1851
|
+
throw new TypeError(`Test attachment requires body or path to be set. Both are missing.`);
|
|
1852
|
+
}
|
|
1853
|
+
if (attachment.body && attachment.path) {
|
|
1854
|
+
throw new TypeError(`Test attachment requires only one of "body" or "path" to be set. Both are specified.`);
|
|
1855
|
+
}
|
|
1856
|
+
annotation.attachment = attachment;
|
|
1857
|
+
if (attachment.body instanceof Uint8Array) {
|
|
1858
|
+
attachment.body = encodeUint8Array(attachment.body);
|
|
1859
|
+
}
|
|
1860
|
+
}
|
|
1861
|
+
if (location) {
|
|
1862
|
+
annotation.location = location;
|
|
1863
|
+
}
|
|
1864
|
+
if (!runner$1.onTestAnnotate) {
|
|
1865
|
+
throw new Error(`Test runner doesn't support test annotations.`);
|
|
1866
|
+
}
|
|
1867
|
+
await finishSendTasksUpdate(runner$1);
|
|
1868
|
+
const resolvedAnnotation = await runner$1.onTestAnnotate(test$1, annotation);
|
|
1869
|
+
test$1.annotations.push(resolvedAnnotation);
|
|
1870
|
+
return resolvedAnnotation;
|
|
1871
|
+
}
|
|
1872
|
+
context.annotate = (message, type, attachment) => {
|
|
1873
|
+
if (test$1.result && test$1.result.state !== "run") {
|
|
1874
|
+
throw new Error(`Cannot annotate tests outside of the test run. The test "${test$1.name}" finished running with the "${test$1.result.state}" state already.`);
|
|
1875
|
+
}
|
|
1876
|
+
let location;
|
|
1877
|
+
const stack = new Error("STACK_TRACE").stack;
|
|
1878
|
+
const index = stack.includes("STACK_TRACE") ? 2 : 1;
|
|
1879
|
+
const stackLine = stack.split("\n")[index];
|
|
1880
|
+
const parsed = parseSingleStack(stackLine);
|
|
1881
|
+
if (parsed) {
|
|
1882
|
+
location = {
|
|
1883
|
+
file: parsed.file,
|
|
1884
|
+
line: parsed.line,
|
|
1885
|
+
column: parsed.column
|
|
1886
|
+
};
|
|
1887
|
+
}
|
|
1888
|
+
if (typeof type === "object") {
|
|
1889
|
+
return recordAsyncAnnotation(test$1, annotate(message, location, undefined, type));
|
|
1890
|
+
} else {
|
|
1891
|
+
return recordAsyncAnnotation(test$1, annotate(message, location, type, attachment));
|
|
1892
|
+
}
|
|
1893
|
+
};
|
|
1894
|
+
context.onTestFailed = (handler, timeout) => {
|
|
1895
|
+
test$1.onFailed || (test$1.onFailed = []);
|
|
1896
|
+
test$1.onFailed.push(withTimeout(handler, timeout ?? runner$1.config.hookTimeout, true, new Error("STACK_TRACE_ERROR"), (_, error) => abortController.abort(error)));
|
|
1897
|
+
};
|
|
1898
|
+
context.onTestFinished = (handler, timeout) => {
|
|
1899
|
+
test$1.onFinished || (test$1.onFinished = []);
|
|
1900
|
+
test$1.onFinished.push(withTimeout(handler, timeout ?? runner$1.config.hookTimeout, true, new Error("STACK_TRACE_ERROR"), (_, error) => abortController.abort(error)));
|
|
1901
|
+
};
|
|
1902
|
+
return ((_runner$extendTaskCon = runner$1.extendTaskContext) === null || _runner$extendTaskCon === void 0 ? void 0 : _runner$extendTaskCon.call(runner$1, context)) || context;
|
|
1903
|
+
}
|
|
1904
|
+
function makeTimeoutError(isHook, timeout, stackTraceError) {
|
|
1905
|
+
const message = `${isHook ? "Hook" : "Test"} timed out in ${timeout}ms.\nIf this is a long-running ${isHook ? "hook" : "test"}, pass a timeout value as the last argument or configure it globally with "${isHook ? "hookTimeout" : "testTimeout"}".`;
|
|
1906
|
+
const error = new Error(message);
|
|
1907
|
+
if (stackTraceError === null || stackTraceError === void 0 ? void 0 : stackTraceError.stack) {
|
|
1908
|
+
error.stack = stackTraceError.stack.replace(error.message, stackTraceError.message);
|
|
1909
|
+
}
|
|
1910
|
+
return error;
|
|
1911
|
+
}
|
|
1912
|
+
const fileContexts = new WeakMap();
|
|
1913
|
+
function getFileContext(file) {
|
|
1914
|
+
const context = fileContexts.get(file);
|
|
1915
|
+
if (!context) {
|
|
1916
|
+
throw new Error(`Cannot find file context for ${file.name}`);
|
|
1917
|
+
}
|
|
1918
|
+
return context;
|
|
1919
|
+
}
|
|
1920
|
+
function setFileContext(file, context) {
|
|
1921
|
+
fileContexts.set(file, context);
|
|
1922
|
+
}
|
|
1923
|
+
const table = [];
|
|
1924
|
+
for (let i = 65; i < 91; i++) {
|
|
1925
|
+
table.push(String.fromCharCode(i));
|
|
1926
|
+
}
|
|
1927
|
+
for (let i = 97; i < 123; i++) {
|
|
1928
|
+
table.push(String.fromCharCode(i));
|
|
1929
|
+
}
|
|
1930
|
+
for (let i = 0; i < 10; i++) {
|
|
1931
|
+
table.push(i.toString(10));
|
|
1932
|
+
}
|
|
1933
|
+
function encodeUint8Array(bytes) {
|
|
1934
|
+
let base64 = "";
|
|
1935
|
+
const len = bytes.byteLength;
|
|
1936
|
+
for (let i = 0; i < len; i += 3) {
|
|
1937
|
+
if (len === i + 1) {
|
|
1938
|
+
const a = (bytes[i] & 252) >> 2;
|
|
1939
|
+
const b = (bytes[i] & 3) << 4;
|
|
1940
|
+
base64 += table[a];
|
|
1941
|
+
base64 += table[b];
|
|
1942
|
+
base64 += "==";
|
|
1943
|
+
} else if (len === i + 2) {
|
|
1944
|
+
const a = (bytes[i] & 252) >> 2;
|
|
1945
|
+
const b = (bytes[i] & 3) << 4 | (bytes[i + 1] & 240) >> 4;
|
|
1946
|
+
const c = (bytes[i + 1] & 15) << 2;
|
|
1947
|
+
base64 += table[a];
|
|
1948
|
+
base64 += table[b];
|
|
1949
|
+
base64 += table[c];
|
|
1950
|
+
base64 += "=";
|
|
1951
|
+
} else {
|
|
1952
|
+
const a = (bytes[i] & 252) >> 2;
|
|
1953
|
+
const b = (bytes[i] & 3) << 4 | (bytes[i + 1] & 240) >> 4;
|
|
1954
|
+
const c = (bytes[i + 1] & 15) << 2 | (bytes[i + 2] & 192) >> 6;
|
|
1955
|
+
const d = bytes[i + 2] & 63;
|
|
1956
|
+
base64 += table[a];
|
|
1957
|
+
base64 += table[b];
|
|
1958
|
+
base64 += table[c];
|
|
1959
|
+
base64 += table[d];
|
|
1960
|
+
}
|
|
1961
|
+
}
|
|
1962
|
+
return base64;
|
|
1963
|
+
}
|
|
1964
|
+
function recordAsyncAnnotation(test$1, promise) {
|
|
1965
|
+
promise = promise.finally(() => {
|
|
1966
|
+
if (!test$1.promises) {
|
|
1967
|
+
return;
|
|
1968
|
+
}
|
|
1969
|
+
const index = test$1.promises.indexOf(promise);
|
|
1970
|
+
if (index !== -1) {
|
|
1971
|
+
test$1.promises.splice(index, 1);
|
|
1972
|
+
}
|
|
1973
|
+
});
|
|
1974
|
+
if (!test$1.promises) {
|
|
1975
|
+
test$1.promises = [];
|
|
1976
|
+
}
|
|
1977
|
+
test$1.promises.push(promise);
|
|
1978
|
+
return promise;
|
|
1979
|
+
}
|
|
1980
|
+
function getDefaultHookTimeout() {
|
|
1981
|
+
return getRunner().config.hookTimeout;
|
|
1982
|
+
}
|
|
1983
|
+
const CLEANUP_TIMEOUT_KEY = Symbol.for("VITEST_CLEANUP_TIMEOUT");
|
|
1984
|
+
const CLEANUP_STACK_TRACE_KEY = Symbol.for("VITEST_CLEANUP_STACK_TRACE");
|
|
1985
|
+
function getBeforeHookCleanupCallback(hook, result, context) {
|
|
1986
|
+
if (typeof result === "function") {
|
|
1987
|
+
const timeout = CLEANUP_TIMEOUT_KEY in hook && typeof hook[CLEANUP_TIMEOUT_KEY] === "number" ? hook[CLEANUP_TIMEOUT_KEY] : getDefaultHookTimeout();
|
|
1988
|
+
const stackTraceError = CLEANUP_STACK_TRACE_KEY in hook && hook[CLEANUP_STACK_TRACE_KEY] instanceof Error ? hook[CLEANUP_STACK_TRACE_KEY] : undefined;
|
|
1989
|
+
return withTimeout(result, timeout, true, stackTraceError, (_, error) => {
|
|
1990
|
+
if (context) {
|
|
1991
|
+
abortContextSignal(context, error);
|
|
1992
|
+
}
|
|
1993
|
+
});
|
|
1994
|
+
}
|
|
1995
|
+
}
|
|
1996
|
+
/**
|
|
1997
|
+
* Registers a callback function to be executed once before all tests within the current suite.
|
|
1998
|
+
* This hook is useful for scenarios where you need to perform setup operations that are common to all tests in a suite, such as initializing a database connection or setting up a test environment.
|
|
1999
|
+
*
|
|
2000
|
+
* **Note:** The `beforeAll` hooks are executed in the order they are defined one after another. You can configure this by changing the `sequence.hooks` option in the config file.
|
|
2001
|
+
*
|
|
2002
|
+
* @param {Function} fn - The callback function to be executed before all tests.
|
|
2003
|
+
* @param {number} [timeout] - Optional timeout in milliseconds for the hook. If not provided, the default hook timeout from the runner's configuration is used.
|
|
2004
|
+
* @returns {void}
|
|
2005
|
+
* @example
|
|
2006
|
+
* ```ts
|
|
2007
|
+
* // Example of using beforeAll to set up a database connection
|
|
2008
|
+
* beforeAll(async () => {
|
|
2009
|
+
* await database.connect();
|
|
2010
|
+
* });
|
|
2011
|
+
* ```
|
|
2012
|
+
*/
|
|
2013
|
+
function beforeAll(fn, timeout = getDefaultHookTimeout()) {
|
|
2014
|
+
assertTypes(fn, "\"beforeAll\" callback", ["function"]);
|
|
2015
|
+
const stackTraceError = new Error("STACK_TRACE_ERROR");
|
|
2016
|
+
return getCurrentSuite().on("beforeAll", Object.assign(withTimeout(fn, timeout, true, stackTraceError), {
|
|
2017
|
+
[CLEANUP_TIMEOUT_KEY]: timeout,
|
|
2018
|
+
[CLEANUP_STACK_TRACE_KEY]: stackTraceError
|
|
2019
|
+
}));
|
|
2020
|
+
}
|
|
2021
|
+
/**
|
|
2022
|
+
* Registers a callback function to be executed once after all tests within the current suite have completed.
|
|
2023
|
+
* This hook is useful for scenarios where you need to perform cleanup operations after all tests in a suite have run, such as closing database connections or cleaning up temporary files.
|
|
2024
|
+
*
|
|
2025
|
+
* **Note:** The `afterAll` hooks are running in reverse order of their registration. You can configure this by changing the `sequence.hooks` option in the config file.
|
|
2026
|
+
*
|
|
2027
|
+
* @param {Function} fn - The callback function to be executed after all tests.
|
|
2028
|
+
* @param {number} [timeout] - Optional timeout in milliseconds for the hook. If not provided, the default hook timeout from the runner's configuration is used.
|
|
2029
|
+
* @returns {void}
|
|
2030
|
+
* @example
|
|
2031
|
+
* ```ts
|
|
2032
|
+
* // Example of using afterAll to close a database connection
|
|
2033
|
+
* afterAll(async () => {
|
|
2034
|
+
* await database.disconnect();
|
|
2035
|
+
* });
|
|
2036
|
+
* ```
|
|
2037
|
+
*/
|
|
2038
|
+
function afterAll(fn, timeout) {
|
|
2039
|
+
assertTypes(fn, "\"afterAll\" callback", ["function"]);
|
|
2040
|
+
return getCurrentSuite().on("afterAll", withTimeout(fn, timeout ?? getDefaultHookTimeout(), true, new Error("STACK_TRACE_ERROR")));
|
|
2041
|
+
}
|
|
2042
|
+
/**
|
|
2043
|
+
* Registers a callback function to be executed before each test within the current suite.
|
|
2044
|
+
* This hook is useful for scenarios where you need to reset or reinitialize the test environment before each test runs, such as resetting database states, clearing caches, or reinitializing variables.
|
|
2045
|
+
*
|
|
2046
|
+
* **Note:** The `beforeEach` hooks are executed in the order they are defined one after another. You can configure this by changing the `sequence.hooks` option in the config file.
|
|
2047
|
+
*
|
|
2048
|
+
* @param {Function} fn - The callback function to be executed before each test. This function receives an `TestContext` parameter if additional test context is needed.
|
|
2049
|
+
* @param {number} [timeout] - Optional timeout in milliseconds for the hook. If not provided, the default hook timeout from the runner's configuration is used.
|
|
2050
|
+
* @returns {void}
|
|
2051
|
+
* @example
|
|
2052
|
+
* ```ts
|
|
2053
|
+
* // Example of using beforeEach to reset a database state
|
|
2054
|
+
* beforeEach(async () => {
|
|
2055
|
+
* await database.reset();
|
|
2056
|
+
* });
|
|
2057
|
+
* ```
|
|
2058
|
+
*/
|
|
2059
|
+
function beforeEach(fn, timeout = getDefaultHookTimeout()) {
|
|
2060
|
+
assertTypes(fn, "\"beforeEach\" callback", ["function"]);
|
|
2061
|
+
const stackTraceError = new Error("STACK_TRACE_ERROR");
|
|
2062
|
+
const runner$1 = getRunner();
|
|
2063
|
+
return getCurrentSuite().on("beforeEach", Object.assign(withTimeout(withFixtures(runner$1, fn), timeout ?? getDefaultHookTimeout(), true, stackTraceError, abortIfTimeout), {
|
|
2064
|
+
[CLEANUP_TIMEOUT_KEY]: timeout,
|
|
2065
|
+
[CLEANUP_STACK_TRACE_KEY]: stackTraceError
|
|
2066
|
+
}));
|
|
2067
|
+
}
|
|
2068
|
+
/**
|
|
2069
|
+
* Registers a callback function to be executed after each test within the current suite has completed.
|
|
2070
|
+
* This hook is useful for scenarios where you need to clean up or reset the test environment after each test runs, such as deleting temporary files, clearing test-specific database entries, or resetting mocked functions.
|
|
2071
|
+
*
|
|
2072
|
+
* **Note:** The `afterEach` hooks are running in reverse order of their registration. You can configure this by changing the `sequence.hooks` option in the config file.
|
|
2073
|
+
*
|
|
2074
|
+
* @param {Function} fn - The callback function to be executed after each test. This function receives an `TestContext` parameter if additional test context is needed.
|
|
2075
|
+
* @param {number} [timeout] - Optional timeout in milliseconds for the hook. If not provided, the default hook timeout from the runner's configuration is used.
|
|
2076
|
+
* @returns {void}
|
|
2077
|
+
* @example
|
|
2078
|
+
* ```ts
|
|
2079
|
+
* // Example of using afterEach to delete temporary files created during a test
|
|
2080
|
+
* afterEach(async () => {
|
|
2081
|
+
* await fileSystem.deleteTempFiles();
|
|
2082
|
+
* });
|
|
2083
|
+
* ```
|
|
2084
|
+
*/
|
|
2085
|
+
function afterEach(fn, timeout) {
|
|
2086
|
+
assertTypes(fn, "\"afterEach\" callback", ["function"]);
|
|
2087
|
+
const runner$1 = getRunner();
|
|
2088
|
+
return getCurrentSuite().on("afterEach", withTimeout(withFixtures(runner$1, fn), timeout ?? getDefaultHookTimeout(), true, new Error("STACK_TRACE_ERROR"), abortIfTimeout));
|
|
2089
|
+
}
|
|
2090
|
+
/**
|
|
2091
|
+
* Registers a callback function to be executed when a test fails within the current suite.
|
|
2092
|
+
* This function allows for custom actions to be performed in response to test failures, such as logging, cleanup, or additional diagnostics.
|
|
2093
|
+
*
|
|
2094
|
+
* **Note:** The `onTestFailed` hooks are running in reverse order of their registration. You can configure this by changing the `sequence.hooks` option in the config file.
|
|
2095
|
+
*
|
|
2096
|
+
* @param {Function} fn - The callback function to be executed upon a test failure. The function receives the test result (including errors).
|
|
2097
|
+
* @param {number} [timeout] - Optional timeout in milliseconds for the hook. If not provided, the default hook timeout from the runner's configuration is used.
|
|
2098
|
+
* @throws {Error} Throws an error if the function is not called within a test.
|
|
2099
|
+
* @returns {void}
|
|
2100
|
+
* @example
|
|
2101
|
+
* ```ts
|
|
2102
|
+
* // Example of using onTestFailed to log failure details
|
|
2103
|
+
* onTestFailed(({ errors }) => {
|
|
2104
|
+
* console.log(`Test failed: ${test.name}`, errors);
|
|
2105
|
+
* });
|
|
2106
|
+
* ```
|
|
2107
|
+
*/
|
|
2108
|
+
const onTestFailed = createTestHook("onTestFailed", (test$1, handler, timeout) => {
|
|
2109
|
+
test$1.onFailed || (test$1.onFailed = []);
|
|
2110
|
+
test$1.onFailed.push(withTimeout(handler, timeout ?? getDefaultHookTimeout(), true, new Error("STACK_TRACE_ERROR"), abortIfTimeout));
|
|
2111
|
+
});
|
|
2112
|
+
/**
|
|
2113
|
+
* Registers a callback function to be executed when the current test finishes, regardless of the outcome (pass or fail).
|
|
2114
|
+
* This function is ideal for performing actions that should occur after every test execution, such as cleanup, logging, or resetting shared resources.
|
|
2115
|
+
*
|
|
2116
|
+
* This hook is useful if you have access to a resource in the test itself and you want to clean it up after the test finishes. It is a more compact way to clean up resources than using the combination of `beforeEach` and `afterEach`.
|
|
2117
|
+
*
|
|
2118
|
+
* **Note:** The `onTestFinished` hooks are running in reverse order of their registration. You can configure this by changing the `sequence.hooks` option in the config file.
|
|
2119
|
+
*
|
|
2120
|
+
* **Note:** The `onTestFinished` hook is not called if the test is canceled with a dynamic `ctx.skip()` call.
|
|
2121
|
+
*
|
|
2122
|
+
* @param {Function} fn - The callback function to be executed after a test finishes. The function can receive parameters providing details about the completed test, including its success or failure status.
|
|
2123
|
+
* @param {number} [timeout] - Optional timeout in milliseconds for the hook. If not provided, the default hook timeout from the runner's configuration is used.
|
|
2124
|
+
* @throws {Error} Throws an error if the function is not called within a test.
|
|
2125
|
+
* @returns {void}
|
|
2126
|
+
* @example
|
|
2127
|
+
* ```ts
|
|
2128
|
+
* // Example of using onTestFinished for cleanup
|
|
2129
|
+
* const db = await connectToDatabase();
|
|
2130
|
+
* onTestFinished(async () => {
|
|
2131
|
+
* await db.disconnect();
|
|
2132
|
+
* });
|
|
2133
|
+
* ```
|
|
2134
|
+
*/
|
|
2135
|
+
const onTestFinished = createTestHook("onTestFinished", (test$1, handler, timeout) => {
|
|
2136
|
+
test$1.onFinished || (test$1.onFinished = []);
|
|
2137
|
+
test$1.onFinished.push(withTimeout(handler, timeout ?? getDefaultHookTimeout(), true, new Error("STACK_TRACE_ERROR"), abortIfTimeout));
|
|
2138
|
+
});
|
|
2139
|
+
function createTestHook(name, handler) {
|
|
2140
|
+
return (fn, timeout) => {
|
|
2141
|
+
assertTypes(fn, `"${name}" callback`, ["function"]);
|
|
2142
|
+
const current = getCurrentTest();
|
|
2143
|
+
if (!current) {
|
|
2144
|
+
throw new Error(`Hook ${name}() can only be called inside a test`);
|
|
2145
|
+
}
|
|
2146
|
+
return handler(current, fn, timeout);
|
|
2147
|
+
};
|
|
2148
|
+
}
|
|
2149
|
+
|
|
2150
|
+
//#endregion
|
|
2151
|
+
export { afterAll, afterEach, beforeAll, beforeEach, calculateSuiteHash, createChainable, createFileTask, createTaskCollector, describe, generateFileHash, generateHash, getCurrentSuite, getCurrentTest, getFn, getFullName, getHooks, getNames, getSuites, getTasks, getTestName, getTests, hasFailed, hasTests, interpretTaskModes, isAtomTest, isTestCase, it, limitConcurrency, onTestFailed, onTestFinished, partitionSuiteChildren, publicCollect, setFn, setHooks, someTasksAreOnly, startTests, suite, test, updateTask };
|