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