@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
|
@@ -0,0 +1,1258 @@
|
|
|
1
|
+
import { encode } from "../../../../@jridgewell_sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.js";
|
|
2
|
+
|
|
3
|
+
//#region ../node_modules/.pnpm/magic-string@0.30.21/node_modules/magic-string/dist/magic-string.es.mjs
|
|
4
|
+
var BitSet = class BitSet {
|
|
5
|
+
constructor(arg) {
|
|
6
|
+
this.bits = arg instanceof BitSet ? arg.bits.slice() : [];
|
|
7
|
+
}
|
|
8
|
+
add(n$1) {
|
|
9
|
+
this.bits[n$1 >> 5] |= 1 << (n$1 & 31);
|
|
10
|
+
}
|
|
11
|
+
has(n$1) {
|
|
12
|
+
return !!(this.bits[n$1 >> 5] & 1 << (n$1 & 31));
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
var Chunk = class Chunk {
|
|
16
|
+
constructor(start, end, content) {
|
|
17
|
+
this.start = start;
|
|
18
|
+
this.end = end;
|
|
19
|
+
this.original = content;
|
|
20
|
+
this.intro = "";
|
|
21
|
+
this.outro = "";
|
|
22
|
+
this.content = content;
|
|
23
|
+
this.storeName = false;
|
|
24
|
+
this.edited = false;
|
|
25
|
+
{
|
|
26
|
+
this.previous = null;
|
|
27
|
+
this.next = null;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
appendLeft(content) {
|
|
31
|
+
this.outro += content;
|
|
32
|
+
}
|
|
33
|
+
appendRight(content) {
|
|
34
|
+
this.intro = this.intro + content;
|
|
35
|
+
}
|
|
36
|
+
clone() {
|
|
37
|
+
const chunk = new Chunk(this.start, this.end, this.original);
|
|
38
|
+
chunk.intro = this.intro;
|
|
39
|
+
chunk.outro = this.outro;
|
|
40
|
+
chunk.content = this.content;
|
|
41
|
+
chunk.storeName = this.storeName;
|
|
42
|
+
chunk.edited = this.edited;
|
|
43
|
+
return chunk;
|
|
44
|
+
}
|
|
45
|
+
contains(index) {
|
|
46
|
+
return this.start < index && index < this.end;
|
|
47
|
+
}
|
|
48
|
+
eachNext(fn) {
|
|
49
|
+
let chunk = this;
|
|
50
|
+
while (chunk) {
|
|
51
|
+
fn(chunk);
|
|
52
|
+
chunk = chunk.next;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
eachPrevious(fn) {
|
|
56
|
+
let chunk = this;
|
|
57
|
+
while (chunk) {
|
|
58
|
+
fn(chunk);
|
|
59
|
+
chunk = chunk.previous;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
edit(content, storeName, contentOnly) {
|
|
63
|
+
this.content = content;
|
|
64
|
+
if (!contentOnly) {
|
|
65
|
+
this.intro = "";
|
|
66
|
+
this.outro = "";
|
|
67
|
+
}
|
|
68
|
+
this.storeName = storeName;
|
|
69
|
+
this.edited = true;
|
|
70
|
+
return this;
|
|
71
|
+
}
|
|
72
|
+
prependLeft(content) {
|
|
73
|
+
this.outro = content + this.outro;
|
|
74
|
+
}
|
|
75
|
+
prependRight(content) {
|
|
76
|
+
this.intro = content + this.intro;
|
|
77
|
+
}
|
|
78
|
+
reset() {
|
|
79
|
+
this.intro = "";
|
|
80
|
+
this.outro = "";
|
|
81
|
+
if (this.edited) {
|
|
82
|
+
this.content = this.original;
|
|
83
|
+
this.storeName = false;
|
|
84
|
+
this.edited = false;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
split(index) {
|
|
88
|
+
const sliceIndex = index - this.start;
|
|
89
|
+
const originalBefore = this.original.slice(0, sliceIndex);
|
|
90
|
+
const originalAfter = this.original.slice(sliceIndex);
|
|
91
|
+
this.original = originalBefore;
|
|
92
|
+
const newChunk = new Chunk(index, this.end, originalAfter);
|
|
93
|
+
newChunk.outro = this.outro;
|
|
94
|
+
this.outro = "";
|
|
95
|
+
this.end = index;
|
|
96
|
+
if (this.edited) {
|
|
97
|
+
newChunk.edit("", false);
|
|
98
|
+
this.content = "";
|
|
99
|
+
} else {
|
|
100
|
+
this.content = originalBefore;
|
|
101
|
+
}
|
|
102
|
+
newChunk.next = this.next;
|
|
103
|
+
if (newChunk.next) newChunk.next.previous = newChunk;
|
|
104
|
+
newChunk.previous = this;
|
|
105
|
+
this.next = newChunk;
|
|
106
|
+
return newChunk;
|
|
107
|
+
}
|
|
108
|
+
toString() {
|
|
109
|
+
return this.intro + this.content + this.outro;
|
|
110
|
+
}
|
|
111
|
+
trimEnd(rx) {
|
|
112
|
+
this.outro = this.outro.replace(rx, "");
|
|
113
|
+
if (this.outro.length) return true;
|
|
114
|
+
const trimmed = this.content.replace(rx, "");
|
|
115
|
+
if (trimmed.length) {
|
|
116
|
+
if (trimmed !== this.content) {
|
|
117
|
+
this.split(this.start + trimmed.length).edit("", undefined, true);
|
|
118
|
+
if (this.edited) {
|
|
119
|
+
this.edit(trimmed, this.storeName, true);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
return true;
|
|
123
|
+
} else {
|
|
124
|
+
this.edit("", undefined, true);
|
|
125
|
+
this.intro = this.intro.replace(rx, "");
|
|
126
|
+
if (this.intro.length) return true;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
trimStart(rx) {
|
|
130
|
+
this.intro = this.intro.replace(rx, "");
|
|
131
|
+
if (this.intro.length) return true;
|
|
132
|
+
const trimmed = this.content.replace(rx, "");
|
|
133
|
+
if (trimmed.length) {
|
|
134
|
+
if (trimmed !== this.content) {
|
|
135
|
+
const newChunk = this.split(this.end - trimmed.length);
|
|
136
|
+
if (this.edited) {
|
|
137
|
+
newChunk.edit(trimmed, this.storeName, true);
|
|
138
|
+
}
|
|
139
|
+
this.edit("", undefined, true);
|
|
140
|
+
}
|
|
141
|
+
return true;
|
|
142
|
+
} else {
|
|
143
|
+
this.edit("", undefined, true);
|
|
144
|
+
this.outro = this.outro.replace(rx, "");
|
|
145
|
+
if (this.outro.length) return true;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
function getBtoa() {
|
|
150
|
+
if (typeof globalThis !== "undefined" && typeof globalThis.btoa === "function") {
|
|
151
|
+
return (str) => globalThis.btoa(unescape(encodeURIComponent(str)));
|
|
152
|
+
} else if (typeof Buffer === "function") {
|
|
153
|
+
return (str) => Buffer.from(str, "utf-8").toString("base64");
|
|
154
|
+
} else {
|
|
155
|
+
return () => {
|
|
156
|
+
throw new Error("Unsupported environment: `window.btoa` or `Buffer` should be supported.");
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
const btoa = /* @__PURE__ */ getBtoa();
|
|
161
|
+
var SourceMap = class {
|
|
162
|
+
constructor(properties) {
|
|
163
|
+
this.version = 3;
|
|
164
|
+
this.file = properties.file;
|
|
165
|
+
this.sources = properties.sources;
|
|
166
|
+
this.sourcesContent = properties.sourcesContent;
|
|
167
|
+
this.names = properties.names;
|
|
168
|
+
this.mappings = encode(properties.mappings);
|
|
169
|
+
if (typeof properties.x_google_ignoreList !== "undefined") {
|
|
170
|
+
this.x_google_ignoreList = properties.x_google_ignoreList;
|
|
171
|
+
}
|
|
172
|
+
if (typeof properties.debugId !== "undefined") {
|
|
173
|
+
this.debugId = properties.debugId;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
toString() {
|
|
177
|
+
return JSON.stringify(this);
|
|
178
|
+
}
|
|
179
|
+
toUrl() {
|
|
180
|
+
return "data:application/json;charset=utf-8;base64," + btoa(this.toString());
|
|
181
|
+
}
|
|
182
|
+
};
|
|
183
|
+
function guessIndent(code) {
|
|
184
|
+
const lines = code.split("\n");
|
|
185
|
+
const tabbed = lines.filter((line) => /^\t+/.test(line));
|
|
186
|
+
const spaced = lines.filter((line) => /^ {2,}/.test(line));
|
|
187
|
+
if (tabbed.length === 0 && spaced.length === 0) {
|
|
188
|
+
return null;
|
|
189
|
+
}
|
|
190
|
+
if (tabbed.length >= spaced.length) {
|
|
191
|
+
return " ";
|
|
192
|
+
}
|
|
193
|
+
const min = spaced.reduce((previous, current) => {
|
|
194
|
+
const numSpaces = /^ +/.exec(current)[0].length;
|
|
195
|
+
return Math.min(numSpaces, previous);
|
|
196
|
+
}, Infinity);
|
|
197
|
+
return new Array(min + 1).join(" ");
|
|
198
|
+
}
|
|
199
|
+
function getRelativePath(from, to) {
|
|
200
|
+
const fromParts = from.split(/[/\\]/);
|
|
201
|
+
const toParts = to.split(/[/\\]/);
|
|
202
|
+
fromParts.pop();
|
|
203
|
+
while (fromParts[0] === toParts[0]) {
|
|
204
|
+
fromParts.shift();
|
|
205
|
+
toParts.shift();
|
|
206
|
+
}
|
|
207
|
+
if (fromParts.length) {
|
|
208
|
+
let i = fromParts.length;
|
|
209
|
+
while (i--) fromParts[i] = "..";
|
|
210
|
+
}
|
|
211
|
+
return fromParts.concat(toParts).join("/");
|
|
212
|
+
}
|
|
213
|
+
const toString = Object.prototype.toString;
|
|
214
|
+
function isObject(thing) {
|
|
215
|
+
return toString.call(thing) === "[object Object]";
|
|
216
|
+
}
|
|
217
|
+
function getLocator(source) {
|
|
218
|
+
const originalLines = source.split("\n");
|
|
219
|
+
const lineOffsets = [];
|
|
220
|
+
for (let i = 0, pos = 0; i < originalLines.length; i++) {
|
|
221
|
+
lineOffsets.push(pos);
|
|
222
|
+
pos += originalLines[i].length + 1;
|
|
223
|
+
}
|
|
224
|
+
return function locate(index) {
|
|
225
|
+
let i = 0;
|
|
226
|
+
let j = lineOffsets.length;
|
|
227
|
+
while (i < j) {
|
|
228
|
+
const m = i + j >> 1;
|
|
229
|
+
if (index < lineOffsets[m]) {
|
|
230
|
+
j = m;
|
|
231
|
+
} else {
|
|
232
|
+
i = m + 1;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
const line = i - 1;
|
|
236
|
+
const column = index - lineOffsets[line];
|
|
237
|
+
return {
|
|
238
|
+
line,
|
|
239
|
+
column
|
|
240
|
+
};
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
const wordRegex = /\w/;
|
|
244
|
+
var Mappings = class {
|
|
245
|
+
constructor(hires) {
|
|
246
|
+
this.hires = hires;
|
|
247
|
+
this.generatedCodeLine = 0;
|
|
248
|
+
this.generatedCodeColumn = 0;
|
|
249
|
+
this.raw = [];
|
|
250
|
+
this.rawSegments = this.raw[this.generatedCodeLine] = [];
|
|
251
|
+
this.pending = null;
|
|
252
|
+
}
|
|
253
|
+
addEdit(sourceIndex, content, loc, nameIndex) {
|
|
254
|
+
if (content.length) {
|
|
255
|
+
const contentLengthMinusOne = content.length - 1;
|
|
256
|
+
let contentLineEnd = content.indexOf("\n", 0);
|
|
257
|
+
let previousContentLineEnd = -1;
|
|
258
|
+
while (contentLineEnd >= 0 && contentLengthMinusOne > contentLineEnd) {
|
|
259
|
+
const segment$1 = [
|
|
260
|
+
this.generatedCodeColumn,
|
|
261
|
+
sourceIndex,
|
|
262
|
+
loc.line,
|
|
263
|
+
loc.column
|
|
264
|
+
];
|
|
265
|
+
if (nameIndex >= 0) {
|
|
266
|
+
segment$1.push(nameIndex);
|
|
267
|
+
}
|
|
268
|
+
this.rawSegments.push(segment$1);
|
|
269
|
+
this.generatedCodeLine += 1;
|
|
270
|
+
this.raw[this.generatedCodeLine] = this.rawSegments = [];
|
|
271
|
+
this.generatedCodeColumn = 0;
|
|
272
|
+
previousContentLineEnd = contentLineEnd;
|
|
273
|
+
contentLineEnd = content.indexOf("\n", contentLineEnd + 1);
|
|
274
|
+
}
|
|
275
|
+
const segment = [
|
|
276
|
+
this.generatedCodeColumn,
|
|
277
|
+
sourceIndex,
|
|
278
|
+
loc.line,
|
|
279
|
+
loc.column
|
|
280
|
+
];
|
|
281
|
+
if (nameIndex >= 0) {
|
|
282
|
+
segment.push(nameIndex);
|
|
283
|
+
}
|
|
284
|
+
this.rawSegments.push(segment);
|
|
285
|
+
this.advance(content.slice(previousContentLineEnd + 1));
|
|
286
|
+
} else if (this.pending) {
|
|
287
|
+
this.rawSegments.push(this.pending);
|
|
288
|
+
this.advance(content);
|
|
289
|
+
}
|
|
290
|
+
this.pending = null;
|
|
291
|
+
}
|
|
292
|
+
addUneditedChunk(sourceIndex, chunk, original, loc, sourcemapLocations) {
|
|
293
|
+
let originalCharIndex = chunk.start;
|
|
294
|
+
let first = true;
|
|
295
|
+
let charInHiresBoundary = false;
|
|
296
|
+
while (originalCharIndex < chunk.end) {
|
|
297
|
+
if (original[originalCharIndex] === "\n") {
|
|
298
|
+
loc.line += 1;
|
|
299
|
+
loc.column = 0;
|
|
300
|
+
this.generatedCodeLine += 1;
|
|
301
|
+
this.raw[this.generatedCodeLine] = this.rawSegments = [];
|
|
302
|
+
this.generatedCodeColumn = 0;
|
|
303
|
+
first = true;
|
|
304
|
+
charInHiresBoundary = false;
|
|
305
|
+
} else {
|
|
306
|
+
if (this.hires || first || sourcemapLocations.has(originalCharIndex)) {
|
|
307
|
+
const segment = [
|
|
308
|
+
this.generatedCodeColumn,
|
|
309
|
+
sourceIndex,
|
|
310
|
+
loc.line,
|
|
311
|
+
loc.column
|
|
312
|
+
];
|
|
313
|
+
if (this.hires === "boundary") {
|
|
314
|
+
if (wordRegex.test(original[originalCharIndex])) {
|
|
315
|
+
if (!charInHiresBoundary) {
|
|
316
|
+
this.rawSegments.push(segment);
|
|
317
|
+
charInHiresBoundary = true;
|
|
318
|
+
}
|
|
319
|
+
} else {
|
|
320
|
+
this.rawSegments.push(segment);
|
|
321
|
+
charInHiresBoundary = false;
|
|
322
|
+
}
|
|
323
|
+
} else {
|
|
324
|
+
this.rawSegments.push(segment);
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
loc.column += 1;
|
|
328
|
+
this.generatedCodeColumn += 1;
|
|
329
|
+
first = false;
|
|
330
|
+
}
|
|
331
|
+
originalCharIndex += 1;
|
|
332
|
+
}
|
|
333
|
+
this.pending = null;
|
|
334
|
+
}
|
|
335
|
+
advance(str) {
|
|
336
|
+
if (!str) return;
|
|
337
|
+
const lines = str.split("\n");
|
|
338
|
+
if (lines.length > 1) {
|
|
339
|
+
for (let i = 0; i < lines.length - 1; i++) {
|
|
340
|
+
this.generatedCodeLine++;
|
|
341
|
+
this.raw[this.generatedCodeLine] = this.rawSegments = [];
|
|
342
|
+
}
|
|
343
|
+
this.generatedCodeColumn = 0;
|
|
344
|
+
}
|
|
345
|
+
this.generatedCodeColumn += lines[lines.length - 1].length;
|
|
346
|
+
}
|
|
347
|
+
};
|
|
348
|
+
const n = "\n";
|
|
349
|
+
const warned = {
|
|
350
|
+
insertLeft: false,
|
|
351
|
+
insertRight: false,
|
|
352
|
+
storeName: false
|
|
353
|
+
};
|
|
354
|
+
var MagicString = class MagicString {
|
|
355
|
+
constructor(string, options = {}) {
|
|
356
|
+
const chunk = new Chunk(0, string.length, string);
|
|
357
|
+
Object.defineProperties(this, {
|
|
358
|
+
original: {
|
|
359
|
+
writable: true,
|
|
360
|
+
value: string
|
|
361
|
+
},
|
|
362
|
+
outro: {
|
|
363
|
+
writable: true,
|
|
364
|
+
value: ""
|
|
365
|
+
},
|
|
366
|
+
intro: {
|
|
367
|
+
writable: true,
|
|
368
|
+
value: ""
|
|
369
|
+
},
|
|
370
|
+
firstChunk: {
|
|
371
|
+
writable: true,
|
|
372
|
+
value: chunk
|
|
373
|
+
},
|
|
374
|
+
lastChunk: {
|
|
375
|
+
writable: true,
|
|
376
|
+
value: chunk
|
|
377
|
+
},
|
|
378
|
+
lastSearchedChunk: {
|
|
379
|
+
writable: true,
|
|
380
|
+
value: chunk
|
|
381
|
+
},
|
|
382
|
+
byStart: {
|
|
383
|
+
writable: true,
|
|
384
|
+
value: {}
|
|
385
|
+
},
|
|
386
|
+
byEnd: {
|
|
387
|
+
writable: true,
|
|
388
|
+
value: {}
|
|
389
|
+
},
|
|
390
|
+
filename: {
|
|
391
|
+
writable: true,
|
|
392
|
+
value: options.filename
|
|
393
|
+
},
|
|
394
|
+
indentExclusionRanges: {
|
|
395
|
+
writable: true,
|
|
396
|
+
value: options.indentExclusionRanges
|
|
397
|
+
},
|
|
398
|
+
sourcemapLocations: {
|
|
399
|
+
writable: true,
|
|
400
|
+
value: new BitSet()
|
|
401
|
+
},
|
|
402
|
+
storedNames: {
|
|
403
|
+
writable: true,
|
|
404
|
+
value: {}
|
|
405
|
+
},
|
|
406
|
+
indentStr: {
|
|
407
|
+
writable: true,
|
|
408
|
+
value: undefined
|
|
409
|
+
},
|
|
410
|
+
ignoreList: {
|
|
411
|
+
writable: true,
|
|
412
|
+
value: options.ignoreList
|
|
413
|
+
},
|
|
414
|
+
offset: {
|
|
415
|
+
writable: true,
|
|
416
|
+
value: options.offset || 0
|
|
417
|
+
}
|
|
418
|
+
});
|
|
419
|
+
this.byStart[0] = chunk;
|
|
420
|
+
this.byEnd[string.length] = chunk;
|
|
421
|
+
}
|
|
422
|
+
addSourcemapLocation(char) {
|
|
423
|
+
this.sourcemapLocations.add(char);
|
|
424
|
+
}
|
|
425
|
+
append(content) {
|
|
426
|
+
if (typeof content !== "string") throw new TypeError("outro content must be a string");
|
|
427
|
+
this.outro += content;
|
|
428
|
+
return this;
|
|
429
|
+
}
|
|
430
|
+
appendLeft(index, content) {
|
|
431
|
+
index = index + this.offset;
|
|
432
|
+
if (typeof content !== "string") throw new TypeError("inserted content must be a string");
|
|
433
|
+
this._split(index);
|
|
434
|
+
const chunk = this.byEnd[index];
|
|
435
|
+
if (chunk) {
|
|
436
|
+
chunk.appendLeft(content);
|
|
437
|
+
} else {
|
|
438
|
+
this.intro += content;
|
|
439
|
+
}
|
|
440
|
+
return this;
|
|
441
|
+
}
|
|
442
|
+
appendRight(index, content) {
|
|
443
|
+
index = index + this.offset;
|
|
444
|
+
if (typeof content !== "string") throw new TypeError("inserted content must be a string");
|
|
445
|
+
this._split(index);
|
|
446
|
+
const chunk = this.byStart[index];
|
|
447
|
+
if (chunk) {
|
|
448
|
+
chunk.appendRight(content);
|
|
449
|
+
} else {
|
|
450
|
+
this.outro += content;
|
|
451
|
+
}
|
|
452
|
+
return this;
|
|
453
|
+
}
|
|
454
|
+
clone() {
|
|
455
|
+
const cloned = new MagicString(this.original, {
|
|
456
|
+
filename: this.filename,
|
|
457
|
+
offset: this.offset
|
|
458
|
+
});
|
|
459
|
+
let originalChunk = this.firstChunk;
|
|
460
|
+
let clonedChunk = cloned.firstChunk = cloned.lastSearchedChunk = originalChunk.clone();
|
|
461
|
+
while (originalChunk) {
|
|
462
|
+
cloned.byStart[clonedChunk.start] = clonedChunk;
|
|
463
|
+
cloned.byEnd[clonedChunk.end] = clonedChunk;
|
|
464
|
+
const nextOriginalChunk = originalChunk.next;
|
|
465
|
+
const nextClonedChunk = nextOriginalChunk && nextOriginalChunk.clone();
|
|
466
|
+
if (nextClonedChunk) {
|
|
467
|
+
clonedChunk.next = nextClonedChunk;
|
|
468
|
+
nextClonedChunk.previous = clonedChunk;
|
|
469
|
+
clonedChunk = nextClonedChunk;
|
|
470
|
+
}
|
|
471
|
+
originalChunk = nextOriginalChunk;
|
|
472
|
+
}
|
|
473
|
+
cloned.lastChunk = clonedChunk;
|
|
474
|
+
if (this.indentExclusionRanges) {
|
|
475
|
+
cloned.indentExclusionRanges = this.indentExclusionRanges.slice();
|
|
476
|
+
}
|
|
477
|
+
cloned.sourcemapLocations = new BitSet(this.sourcemapLocations);
|
|
478
|
+
cloned.intro = this.intro;
|
|
479
|
+
cloned.outro = this.outro;
|
|
480
|
+
return cloned;
|
|
481
|
+
}
|
|
482
|
+
generateDecodedMap(options) {
|
|
483
|
+
options = options || {};
|
|
484
|
+
const sourceIndex = 0;
|
|
485
|
+
const names = Object.keys(this.storedNames);
|
|
486
|
+
const mappings = new Mappings(options.hires);
|
|
487
|
+
const locate = getLocator(this.original);
|
|
488
|
+
if (this.intro) {
|
|
489
|
+
mappings.advance(this.intro);
|
|
490
|
+
}
|
|
491
|
+
this.firstChunk.eachNext((chunk) => {
|
|
492
|
+
const loc = locate(chunk.start);
|
|
493
|
+
if (chunk.intro.length) mappings.advance(chunk.intro);
|
|
494
|
+
if (chunk.edited) {
|
|
495
|
+
mappings.addEdit(sourceIndex, chunk.content, loc, chunk.storeName ? names.indexOf(chunk.original) : -1);
|
|
496
|
+
} else {
|
|
497
|
+
mappings.addUneditedChunk(sourceIndex, chunk, this.original, loc, this.sourcemapLocations);
|
|
498
|
+
}
|
|
499
|
+
if (chunk.outro.length) mappings.advance(chunk.outro);
|
|
500
|
+
});
|
|
501
|
+
if (this.outro) {
|
|
502
|
+
mappings.advance(this.outro);
|
|
503
|
+
}
|
|
504
|
+
return {
|
|
505
|
+
file: options.file ? options.file.split(/[/\\]/).pop() : undefined,
|
|
506
|
+
sources: [options.source ? getRelativePath(options.file || "", options.source) : options.file || ""],
|
|
507
|
+
sourcesContent: options.includeContent ? [this.original] : undefined,
|
|
508
|
+
names,
|
|
509
|
+
mappings: mappings.raw,
|
|
510
|
+
x_google_ignoreList: this.ignoreList ? [sourceIndex] : undefined
|
|
511
|
+
};
|
|
512
|
+
}
|
|
513
|
+
generateMap(options) {
|
|
514
|
+
return new SourceMap(this.generateDecodedMap(options));
|
|
515
|
+
}
|
|
516
|
+
_ensureindentStr() {
|
|
517
|
+
if (this.indentStr === undefined) {
|
|
518
|
+
this.indentStr = guessIndent(this.original);
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
_getRawIndentString() {
|
|
522
|
+
this._ensureindentStr();
|
|
523
|
+
return this.indentStr;
|
|
524
|
+
}
|
|
525
|
+
getIndentString() {
|
|
526
|
+
this._ensureindentStr();
|
|
527
|
+
return this.indentStr === null ? " " : this.indentStr;
|
|
528
|
+
}
|
|
529
|
+
indent(indentStr, options) {
|
|
530
|
+
const pattern = /^[^\r\n]/gm;
|
|
531
|
+
if (isObject(indentStr)) {
|
|
532
|
+
options = indentStr;
|
|
533
|
+
indentStr = undefined;
|
|
534
|
+
}
|
|
535
|
+
if (indentStr === undefined) {
|
|
536
|
+
this._ensureindentStr();
|
|
537
|
+
indentStr = this.indentStr || " ";
|
|
538
|
+
}
|
|
539
|
+
if (indentStr === "") return this;
|
|
540
|
+
options = options || {};
|
|
541
|
+
const isExcluded = {};
|
|
542
|
+
if (options.exclude) {
|
|
543
|
+
const exclusions = typeof options.exclude[0] === "number" ? [options.exclude] : options.exclude;
|
|
544
|
+
exclusions.forEach((exclusion) => {
|
|
545
|
+
for (let i = exclusion[0]; i < exclusion[1]; i += 1) {
|
|
546
|
+
isExcluded[i] = true;
|
|
547
|
+
}
|
|
548
|
+
});
|
|
549
|
+
}
|
|
550
|
+
let shouldIndentNextCharacter = options.indentStart !== false;
|
|
551
|
+
const replacer = (match) => {
|
|
552
|
+
if (shouldIndentNextCharacter) return `${indentStr}${match}`;
|
|
553
|
+
shouldIndentNextCharacter = true;
|
|
554
|
+
return match;
|
|
555
|
+
};
|
|
556
|
+
this.intro = this.intro.replace(pattern, replacer);
|
|
557
|
+
let charIndex = 0;
|
|
558
|
+
let chunk = this.firstChunk;
|
|
559
|
+
while (chunk) {
|
|
560
|
+
const end = chunk.end;
|
|
561
|
+
if (chunk.edited) {
|
|
562
|
+
if (!isExcluded[charIndex]) {
|
|
563
|
+
chunk.content = chunk.content.replace(pattern, replacer);
|
|
564
|
+
if (chunk.content.length) {
|
|
565
|
+
shouldIndentNextCharacter = chunk.content[chunk.content.length - 1] === "\n";
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
} else {
|
|
569
|
+
charIndex = chunk.start;
|
|
570
|
+
while (charIndex < end) {
|
|
571
|
+
if (!isExcluded[charIndex]) {
|
|
572
|
+
const char = this.original[charIndex];
|
|
573
|
+
if (char === "\n") {
|
|
574
|
+
shouldIndentNextCharacter = true;
|
|
575
|
+
} else if (char !== "\r" && shouldIndentNextCharacter) {
|
|
576
|
+
shouldIndentNextCharacter = false;
|
|
577
|
+
if (charIndex === chunk.start) {
|
|
578
|
+
chunk.prependRight(indentStr);
|
|
579
|
+
} else {
|
|
580
|
+
this._splitChunk(chunk, charIndex);
|
|
581
|
+
chunk = chunk.next;
|
|
582
|
+
chunk.prependRight(indentStr);
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
charIndex += 1;
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
charIndex = chunk.end;
|
|
590
|
+
chunk = chunk.next;
|
|
591
|
+
}
|
|
592
|
+
this.outro = this.outro.replace(pattern, replacer);
|
|
593
|
+
return this;
|
|
594
|
+
}
|
|
595
|
+
insert() {
|
|
596
|
+
throw new Error("magicString.insert(...) is deprecated. Use prependRight(...) or appendLeft(...)");
|
|
597
|
+
}
|
|
598
|
+
insertLeft(index, content) {
|
|
599
|
+
if (!warned.insertLeft) {
|
|
600
|
+
console.warn("magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead");
|
|
601
|
+
warned.insertLeft = true;
|
|
602
|
+
}
|
|
603
|
+
return this.appendLeft(index, content);
|
|
604
|
+
}
|
|
605
|
+
insertRight(index, content) {
|
|
606
|
+
if (!warned.insertRight) {
|
|
607
|
+
console.warn("magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead");
|
|
608
|
+
warned.insertRight = true;
|
|
609
|
+
}
|
|
610
|
+
return this.prependRight(index, content);
|
|
611
|
+
}
|
|
612
|
+
move(start, end, index) {
|
|
613
|
+
start = start + this.offset;
|
|
614
|
+
end = end + this.offset;
|
|
615
|
+
index = index + this.offset;
|
|
616
|
+
if (index >= start && index <= end) throw new Error("Cannot move a selection inside itself");
|
|
617
|
+
this._split(start);
|
|
618
|
+
this._split(end);
|
|
619
|
+
this._split(index);
|
|
620
|
+
const first = this.byStart[start];
|
|
621
|
+
const last = this.byEnd[end];
|
|
622
|
+
const oldLeft = first.previous;
|
|
623
|
+
const oldRight = last.next;
|
|
624
|
+
const newRight = this.byStart[index];
|
|
625
|
+
if (!newRight && last === this.lastChunk) return this;
|
|
626
|
+
const newLeft = newRight ? newRight.previous : this.lastChunk;
|
|
627
|
+
if (oldLeft) oldLeft.next = oldRight;
|
|
628
|
+
if (oldRight) oldRight.previous = oldLeft;
|
|
629
|
+
if (newLeft) newLeft.next = first;
|
|
630
|
+
if (newRight) newRight.previous = last;
|
|
631
|
+
if (!first.previous) this.firstChunk = last.next;
|
|
632
|
+
if (!last.next) {
|
|
633
|
+
this.lastChunk = first.previous;
|
|
634
|
+
this.lastChunk.next = null;
|
|
635
|
+
}
|
|
636
|
+
first.previous = newLeft;
|
|
637
|
+
last.next = newRight || null;
|
|
638
|
+
if (!newLeft) this.firstChunk = first;
|
|
639
|
+
if (!newRight) this.lastChunk = last;
|
|
640
|
+
return this;
|
|
641
|
+
}
|
|
642
|
+
overwrite(start, end, content, options) {
|
|
643
|
+
options = options || {};
|
|
644
|
+
return this.update(start, end, content, {
|
|
645
|
+
...options,
|
|
646
|
+
overwrite: !options.contentOnly
|
|
647
|
+
});
|
|
648
|
+
}
|
|
649
|
+
update(start, end, content, options) {
|
|
650
|
+
start = start + this.offset;
|
|
651
|
+
end = end + this.offset;
|
|
652
|
+
if (typeof content !== "string") throw new TypeError("replacement content must be a string");
|
|
653
|
+
if (this.original.length !== 0) {
|
|
654
|
+
while (start < 0) start += this.original.length;
|
|
655
|
+
while (end < 0) end += this.original.length;
|
|
656
|
+
}
|
|
657
|
+
if (end > this.original.length) throw new Error("end is out of bounds");
|
|
658
|
+
if (start === end) throw new Error("Cannot overwrite a zero-length range – use appendLeft or prependRight instead");
|
|
659
|
+
this._split(start);
|
|
660
|
+
this._split(end);
|
|
661
|
+
if (options === true) {
|
|
662
|
+
if (!warned.storeName) {
|
|
663
|
+
console.warn("The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string");
|
|
664
|
+
warned.storeName = true;
|
|
665
|
+
}
|
|
666
|
+
options = { storeName: true };
|
|
667
|
+
}
|
|
668
|
+
const storeName = options !== undefined ? options.storeName : false;
|
|
669
|
+
const overwrite = options !== undefined ? options.overwrite : false;
|
|
670
|
+
if (storeName) {
|
|
671
|
+
const original = this.original.slice(start, end);
|
|
672
|
+
Object.defineProperty(this.storedNames, original, {
|
|
673
|
+
writable: true,
|
|
674
|
+
value: true,
|
|
675
|
+
enumerable: true
|
|
676
|
+
});
|
|
677
|
+
}
|
|
678
|
+
const first = this.byStart[start];
|
|
679
|
+
const last = this.byEnd[end];
|
|
680
|
+
if (first) {
|
|
681
|
+
let chunk = first;
|
|
682
|
+
while (chunk !== last) {
|
|
683
|
+
if (chunk.next !== this.byStart[chunk.end]) {
|
|
684
|
+
throw new Error("Cannot overwrite across a split point");
|
|
685
|
+
}
|
|
686
|
+
chunk = chunk.next;
|
|
687
|
+
chunk.edit("", false);
|
|
688
|
+
}
|
|
689
|
+
first.edit(content, storeName, !overwrite);
|
|
690
|
+
} else {
|
|
691
|
+
const newChunk = new Chunk(start, end, "").edit(content, storeName);
|
|
692
|
+
last.next = newChunk;
|
|
693
|
+
newChunk.previous = last;
|
|
694
|
+
}
|
|
695
|
+
return this;
|
|
696
|
+
}
|
|
697
|
+
prepend(content) {
|
|
698
|
+
if (typeof content !== "string") throw new TypeError("outro content must be a string");
|
|
699
|
+
this.intro = content + this.intro;
|
|
700
|
+
return this;
|
|
701
|
+
}
|
|
702
|
+
prependLeft(index, content) {
|
|
703
|
+
index = index + this.offset;
|
|
704
|
+
if (typeof content !== "string") throw new TypeError("inserted content must be a string");
|
|
705
|
+
this._split(index);
|
|
706
|
+
const chunk = this.byEnd[index];
|
|
707
|
+
if (chunk) {
|
|
708
|
+
chunk.prependLeft(content);
|
|
709
|
+
} else {
|
|
710
|
+
this.intro = content + this.intro;
|
|
711
|
+
}
|
|
712
|
+
return this;
|
|
713
|
+
}
|
|
714
|
+
prependRight(index, content) {
|
|
715
|
+
index = index + this.offset;
|
|
716
|
+
if (typeof content !== "string") throw new TypeError("inserted content must be a string");
|
|
717
|
+
this._split(index);
|
|
718
|
+
const chunk = this.byStart[index];
|
|
719
|
+
if (chunk) {
|
|
720
|
+
chunk.prependRight(content);
|
|
721
|
+
} else {
|
|
722
|
+
this.outro = content + this.outro;
|
|
723
|
+
}
|
|
724
|
+
return this;
|
|
725
|
+
}
|
|
726
|
+
remove(start, end) {
|
|
727
|
+
start = start + this.offset;
|
|
728
|
+
end = end + this.offset;
|
|
729
|
+
if (this.original.length !== 0) {
|
|
730
|
+
while (start < 0) start += this.original.length;
|
|
731
|
+
while (end < 0) end += this.original.length;
|
|
732
|
+
}
|
|
733
|
+
if (start === end) return this;
|
|
734
|
+
if (start < 0 || end > this.original.length) throw new Error("Character is out of bounds");
|
|
735
|
+
if (start > end) throw new Error("end must be greater than start");
|
|
736
|
+
this._split(start);
|
|
737
|
+
this._split(end);
|
|
738
|
+
let chunk = this.byStart[start];
|
|
739
|
+
while (chunk) {
|
|
740
|
+
chunk.intro = "";
|
|
741
|
+
chunk.outro = "";
|
|
742
|
+
chunk.edit("");
|
|
743
|
+
chunk = end > chunk.end ? this.byStart[chunk.end] : null;
|
|
744
|
+
}
|
|
745
|
+
return this;
|
|
746
|
+
}
|
|
747
|
+
reset(start, end) {
|
|
748
|
+
start = start + this.offset;
|
|
749
|
+
end = end + this.offset;
|
|
750
|
+
if (this.original.length !== 0) {
|
|
751
|
+
while (start < 0) start += this.original.length;
|
|
752
|
+
while (end < 0) end += this.original.length;
|
|
753
|
+
}
|
|
754
|
+
if (start === end) return this;
|
|
755
|
+
if (start < 0 || end > this.original.length) throw new Error("Character is out of bounds");
|
|
756
|
+
if (start > end) throw new Error("end must be greater than start");
|
|
757
|
+
this._split(start);
|
|
758
|
+
this._split(end);
|
|
759
|
+
let chunk = this.byStart[start];
|
|
760
|
+
while (chunk) {
|
|
761
|
+
chunk.reset();
|
|
762
|
+
chunk = end > chunk.end ? this.byStart[chunk.end] : null;
|
|
763
|
+
}
|
|
764
|
+
return this;
|
|
765
|
+
}
|
|
766
|
+
lastChar() {
|
|
767
|
+
if (this.outro.length) return this.outro[this.outro.length - 1];
|
|
768
|
+
let chunk = this.lastChunk;
|
|
769
|
+
do {
|
|
770
|
+
if (chunk.outro.length) return chunk.outro[chunk.outro.length - 1];
|
|
771
|
+
if (chunk.content.length) return chunk.content[chunk.content.length - 1];
|
|
772
|
+
if (chunk.intro.length) return chunk.intro[chunk.intro.length - 1];
|
|
773
|
+
} while (chunk = chunk.previous);
|
|
774
|
+
if (this.intro.length) return this.intro[this.intro.length - 1];
|
|
775
|
+
return "";
|
|
776
|
+
}
|
|
777
|
+
lastLine() {
|
|
778
|
+
let lineIndex = this.outro.lastIndexOf(n);
|
|
779
|
+
if (lineIndex !== -1) return this.outro.substr(lineIndex + 1);
|
|
780
|
+
let lineStr = this.outro;
|
|
781
|
+
let chunk = this.lastChunk;
|
|
782
|
+
do {
|
|
783
|
+
if (chunk.outro.length > 0) {
|
|
784
|
+
lineIndex = chunk.outro.lastIndexOf(n);
|
|
785
|
+
if (lineIndex !== -1) return chunk.outro.substr(lineIndex + 1) + lineStr;
|
|
786
|
+
lineStr = chunk.outro + lineStr;
|
|
787
|
+
}
|
|
788
|
+
if (chunk.content.length > 0) {
|
|
789
|
+
lineIndex = chunk.content.lastIndexOf(n);
|
|
790
|
+
if (lineIndex !== -1) return chunk.content.substr(lineIndex + 1) + lineStr;
|
|
791
|
+
lineStr = chunk.content + lineStr;
|
|
792
|
+
}
|
|
793
|
+
if (chunk.intro.length > 0) {
|
|
794
|
+
lineIndex = chunk.intro.lastIndexOf(n);
|
|
795
|
+
if (lineIndex !== -1) return chunk.intro.substr(lineIndex + 1) + lineStr;
|
|
796
|
+
lineStr = chunk.intro + lineStr;
|
|
797
|
+
}
|
|
798
|
+
} while (chunk = chunk.previous);
|
|
799
|
+
lineIndex = this.intro.lastIndexOf(n);
|
|
800
|
+
if (lineIndex !== -1) return this.intro.substr(lineIndex + 1) + lineStr;
|
|
801
|
+
return this.intro + lineStr;
|
|
802
|
+
}
|
|
803
|
+
slice(start = 0, end = this.original.length - this.offset) {
|
|
804
|
+
start = start + this.offset;
|
|
805
|
+
end = end + this.offset;
|
|
806
|
+
if (this.original.length !== 0) {
|
|
807
|
+
while (start < 0) start += this.original.length;
|
|
808
|
+
while (end < 0) end += this.original.length;
|
|
809
|
+
}
|
|
810
|
+
let result = "";
|
|
811
|
+
let chunk = this.firstChunk;
|
|
812
|
+
while (chunk && (chunk.start > start || chunk.end <= start)) {
|
|
813
|
+
if (chunk.start < end && chunk.end >= end) {
|
|
814
|
+
return result;
|
|
815
|
+
}
|
|
816
|
+
chunk = chunk.next;
|
|
817
|
+
}
|
|
818
|
+
if (chunk && chunk.edited && chunk.start !== start) throw new Error(`Cannot use replaced character ${start} as slice start anchor.`);
|
|
819
|
+
const startChunk = chunk;
|
|
820
|
+
while (chunk) {
|
|
821
|
+
if (chunk.intro && (startChunk !== chunk || chunk.start === start)) {
|
|
822
|
+
result += chunk.intro;
|
|
823
|
+
}
|
|
824
|
+
const containsEnd = chunk.start < end && chunk.end >= end;
|
|
825
|
+
if (containsEnd && chunk.edited && chunk.end !== end) throw new Error(`Cannot use replaced character ${end} as slice end anchor.`);
|
|
826
|
+
const sliceStart = startChunk === chunk ? start - chunk.start : 0;
|
|
827
|
+
const sliceEnd = containsEnd ? chunk.content.length + end - chunk.end : chunk.content.length;
|
|
828
|
+
result += chunk.content.slice(sliceStart, sliceEnd);
|
|
829
|
+
if (chunk.outro && (!containsEnd || chunk.end === end)) {
|
|
830
|
+
result += chunk.outro;
|
|
831
|
+
}
|
|
832
|
+
if (containsEnd) {
|
|
833
|
+
break;
|
|
834
|
+
}
|
|
835
|
+
chunk = chunk.next;
|
|
836
|
+
}
|
|
837
|
+
return result;
|
|
838
|
+
}
|
|
839
|
+
snip(start, end) {
|
|
840
|
+
const clone = this.clone();
|
|
841
|
+
clone.remove(0, start);
|
|
842
|
+
clone.remove(end, clone.original.length);
|
|
843
|
+
return clone;
|
|
844
|
+
}
|
|
845
|
+
_split(index) {
|
|
846
|
+
if (this.byStart[index] || this.byEnd[index]) return;
|
|
847
|
+
let chunk = this.lastSearchedChunk;
|
|
848
|
+
let previousChunk = chunk;
|
|
849
|
+
const searchForward = index > chunk.end;
|
|
850
|
+
while (chunk) {
|
|
851
|
+
if (chunk.contains(index)) return this._splitChunk(chunk, index);
|
|
852
|
+
chunk = searchForward ? this.byStart[chunk.end] : this.byEnd[chunk.start];
|
|
853
|
+
if (chunk === previousChunk) return;
|
|
854
|
+
previousChunk = chunk;
|
|
855
|
+
}
|
|
856
|
+
}
|
|
857
|
+
_splitChunk(chunk, index) {
|
|
858
|
+
if (chunk.edited && chunk.content.length) {
|
|
859
|
+
const loc = getLocator(this.original)(index);
|
|
860
|
+
throw new Error(`Cannot split a chunk that has already been edited (${loc.line}:${loc.column} – "${chunk.original}")`);
|
|
861
|
+
}
|
|
862
|
+
const newChunk = chunk.split(index);
|
|
863
|
+
this.byEnd[index] = chunk;
|
|
864
|
+
this.byStart[index] = newChunk;
|
|
865
|
+
this.byEnd[newChunk.end] = newChunk;
|
|
866
|
+
if (chunk === this.lastChunk) this.lastChunk = newChunk;
|
|
867
|
+
this.lastSearchedChunk = chunk;
|
|
868
|
+
return true;
|
|
869
|
+
}
|
|
870
|
+
toString() {
|
|
871
|
+
let str = this.intro;
|
|
872
|
+
let chunk = this.firstChunk;
|
|
873
|
+
while (chunk) {
|
|
874
|
+
str += chunk.toString();
|
|
875
|
+
chunk = chunk.next;
|
|
876
|
+
}
|
|
877
|
+
return str + this.outro;
|
|
878
|
+
}
|
|
879
|
+
isEmpty() {
|
|
880
|
+
let chunk = this.firstChunk;
|
|
881
|
+
do {
|
|
882
|
+
if (chunk.intro.length && chunk.intro.trim() || chunk.content.length && chunk.content.trim() || chunk.outro.length && chunk.outro.trim()) return false;
|
|
883
|
+
} while (chunk = chunk.next);
|
|
884
|
+
return true;
|
|
885
|
+
}
|
|
886
|
+
length() {
|
|
887
|
+
let chunk = this.firstChunk;
|
|
888
|
+
let length = 0;
|
|
889
|
+
do {
|
|
890
|
+
length += chunk.intro.length + chunk.content.length + chunk.outro.length;
|
|
891
|
+
} while (chunk = chunk.next);
|
|
892
|
+
return length;
|
|
893
|
+
}
|
|
894
|
+
trimLines() {
|
|
895
|
+
return this.trim("[\\r\\n]");
|
|
896
|
+
}
|
|
897
|
+
trim(charType) {
|
|
898
|
+
return this.trimStart(charType).trimEnd(charType);
|
|
899
|
+
}
|
|
900
|
+
trimEndAborted(charType) {
|
|
901
|
+
const rx = new RegExp((charType || "\\s") + "+$");
|
|
902
|
+
this.outro = this.outro.replace(rx, "");
|
|
903
|
+
if (this.outro.length) return true;
|
|
904
|
+
let chunk = this.lastChunk;
|
|
905
|
+
do {
|
|
906
|
+
const end = chunk.end;
|
|
907
|
+
const aborted = chunk.trimEnd(rx);
|
|
908
|
+
if (chunk.end !== end) {
|
|
909
|
+
if (this.lastChunk === chunk) {
|
|
910
|
+
this.lastChunk = chunk.next;
|
|
911
|
+
}
|
|
912
|
+
this.byEnd[chunk.end] = chunk;
|
|
913
|
+
this.byStart[chunk.next.start] = chunk.next;
|
|
914
|
+
this.byEnd[chunk.next.end] = chunk.next;
|
|
915
|
+
}
|
|
916
|
+
if (aborted) return true;
|
|
917
|
+
chunk = chunk.previous;
|
|
918
|
+
} while (chunk);
|
|
919
|
+
return false;
|
|
920
|
+
}
|
|
921
|
+
trimEnd(charType) {
|
|
922
|
+
this.trimEndAborted(charType);
|
|
923
|
+
return this;
|
|
924
|
+
}
|
|
925
|
+
trimStartAborted(charType) {
|
|
926
|
+
const rx = new RegExp("^" + (charType || "\\s") + "+");
|
|
927
|
+
this.intro = this.intro.replace(rx, "");
|
|
928
|
+
if (this.intro.length) return true;
|
|
929
|
+
let chunk = this.firstChunk;
|
|
930
|
+
do {
|
|
931
|
+
const end = chunk.end;
|
|
932
|
+
const aborted = chunk.trimStart(rx);
|
|
933
|
+
if (chunk.end !== end) {
|
|
934
|
+
if (chunk === this.lastChunk) this.lastChunk = chunk.next;
|
|
935
|
+
this.byEnd[chunk.end] = chunk;
|
|
936
|
+
this.byStart[chunk.next.start] = chunk.next;
|
|
937
|
+
this.byEnd[chunk.next.end] = chunk.next;
|
|
938
|
+
}
|
|
939
|
+
if (aborted) return true;
|
|
940
|
+
chunk = chunk.next;
|
|
941
|
+
} while (chunk);
|
|
942
|
+
return false;
|
|
943
|
+
}
|
|
944
|
+
trimStart(charType) {
|
|
945
|
+
this.trimStartAborted(charType);
|
|
946
|
+
return this;
|
|
947
|
+
}
|
|
948
|
+
hasChanged() {
|
|
949
|
+
return this.original !== this.toString();
|
|
950
|
+
}
|
|
951
|
+
_replaceRegexp(searchValue, replacement) {
|
|
952
|
+
function getReplacement(match, str) {
|
|
953
|
+
if (typeof replacement === "string") {
|
|
954
|
+
return replacement.replace(/\$(\$|&|\d+)/g, (_, i) => {
|
|
955
|
+
if (i === "$") return "$";
|
|
956
|
+
if (i === "&") return match[0];
|
|
957
|
+
const num = +i;
|
|
958
|
+
if (num < match.length) return match[+i];
|
|
959
|
+
return `$${i}`;
|
|
960
|
+
});
|
|
961
|
+
} else {
|
|
962
|
+
return replacement(...match, match.index, str, match.groups);
|
|
963
|
+
}
|
|
964
|
+
}
|
|
965
|
+
function matchAll(re, str) {
|
|
966
|
+
let match;
|
|
967
|
+
const matches = [];
|
|
968
|
+
while (match = re.exec(str)) {
|
|
969
|
+
matches.push(match);
|
|
970
|
+
}
|
|
971
|
+
return matches;
|
|
972
|
+
}
|
|
973
|
+
if (searchValue.global) {
|
|
974
|
+
const matches = matchAll(searchValue, this.original);
|
|
975
|
+
matches.forEach((match) => {
|
|
976
|
+
if (match.index != null) {
|
|
977
|
+
const replacement$1 = getReplacement(match, this.original);
|
|
978
|
+
if (replacement$1 !== match[0]) {
|
|
979
|
+
this.overwrite(match.index, match.index + match[0].length, replacement$1);
|
|
980
|
+
}
|
|
981
|
+
}
|
|
982
|
+
});
|
|
983
|
+
} else {
|
|
984
|
+
const match = this.original.match(searchValue);
|
|
985
|
+
if (match && match.index != null) {
|
|
986
|
+
const replacement$1 = getReplacement(match, this.original);
|
|
987
|
+
if (replacement$1 !== match[0]) {
|
|
988
|
+
this.overwrite(match.index, match.index + match[0].length, replacement$1);
|
|
989
|
+
}
|
|
990
|
+
}
|
|
991
|
+
}
|
|
992
|
+
return this;
|
|
993
|
+
}
|
|
994
|
+
_replaceString(string, replacement) {
|
|
995
|
+
const { original } = this;
|
|
996
|
+
const index = original.indexOf(string);
|
|
997
|
+
if (index !== -1) {
|
|
998
|
+
if (typeof replacement === "function") {
|
|
999
|
+
replacement = replacement(string, index, original);
|
|
1000
|
+
}
|
|
1001
|
+
if (string !== replacement) {
|
|
1002
|
+
this.overwrite(index, index + string.length, replacement);
|
|
1003
|
+
}
|
|
1004
|
+
}
|
|
1005
|
+
return this;
|
|
1006
|
+
}
|
|
1007
|
+
replace(searchValue, replacement) {
|
|
1008
|
+
if (typeof searchValue === "string") {
|
|
1009
|
+
return this._replaceString(searchValue, replacement);
|
|
1010
|
+
}
|
|
1011
|
+
return this._replaceRegexp(searchValue, replacement);
|
|
1012
|
+
}
|
|
1013
|
+
_replaceAllString(string, replacement) {
|
|
1014
|
+
const { original } = this;
|
|
1015
|
+
const stringLength = string.length;
|
|
1016
|
+
for (let index = original.indexOf(string); index !== -1; index = original.indexOf(string, index + stringLength)) {
|
|
1017
|
+
const previous = original.slice(index, index + stringLength);
|
|
1018
|
+
let _replacement = replacement;
|
|
1019
|
+
if (typeof replacement === "function") {
|
|
1020
|
+
_replacement = replacement(previous, index, original);
|
|
1021
|
+
}
|
|
1022
|
+
if (previous !== _replacement) this.overwrite(index, index + stringLength, _replacement);
|
|
1023
|
+
}
|
|
1024
|
+
return this;
|
|
1025
|
+
}
|
|
1026
|
+
replaceAll(searchValue, replacement) {
|
|
1027
|
+
if (typeof searchValue === "string") {
|
|
1028
|
+
return this._replaceAllString(searchValue, replacement);
|
|
1029
|
+
}
|
|
1030
|
+
if (!searchValue.global) {
|
|
1031
|
+
throw new TypeError("MagicString.prototype.replaceAll called with a non-global RegExp argument");
|
|
1032
|
+
}
|
|
1033
|
+
return this._replaceRegexp(searchValue, replacement);
|
|
1034
|
+
}
|
|
1035
|
+
};
|
|
1036
|
+
const hasOwnProp = Object.prototype.hasOwnProperty;
|
|
1037
|
+
var Bundle = class Bundle {
|
|
1038
|
+
constructor(options = {}) {
|
|
1039
|
+
this.intro = options.intro || "";
|
|
1040
|
+
this.separator = options.separator !== undefined ? options.separator : "\n";
|
|
1041
|
+
this.sources = [];
|
|
1042
|
+
this.uniqueSources = [];
|
|
1043
|
+
this.uniqueSourceIndexByFilename = {};
|
|
1044
|
+
}
|
|
1045
|
+
addSource(source) {
|
|
1046
|
+
if (source instanceof MagicString) {
|
|
1047
|
+
return this.addSource({
|
|
1048
|
+
content: source,
|
|
1049
|
+
filename: source.filename,
|
|
1050
|
+
separator: this.separator
|
|
1051
|
+
});
|
|
1052
|
+
}
|
|
1053
|
+
if (!isObject(source) || !source.content) {
|
|
1054
|
+
throw new Error("bundle.addSource() takes an object with a `content` property, which should be an instance of MagicString, and an optional `filename`");
|
|
1055
|
+
}
|
|
1056
|
+
[
|
|
1057
|
+
"filename",
|
|
1058
|
+
"ignoreList",
|
|
1059
|
+
"indentExclusionRanges",
|
|
1060
|
+
"separator"
|
|
1061
|
+
].forEach((option) => {
|
|
1062
|
+
if (!hasOwnProp.call(source, option)) source[option] = source.content[option];
|
|
1063
|
+
});
|
|
1064
|
+
if (source.separator === undefined) {
|
|
1065
|
+
source.separator = this.separator;
|
|
1066
|
+
}
|
|
1067
|
+
if (source.filename) {
|
|
1068
|
+
if (!hasOwnProp.call(this.uniqueSourceIndexByFilename, source.filename)) {
|
|
1069
|
+
this.uniqueSourceIndexByFilename[source.filename] = this.uniqueSources.length;
|
|
1070
|
+
this.uniqueSources.push({
|
|
1071
|
+
filename: source.filename,
|
|
1072
|
+
content: source.content.original
|
|
1073
|
+
});
|
|
1074
|
+
} else {
|
|
1075
|
+
const uniqueSource = this.uniqueSources[this.uniqueSourceIndexByFilename[source.filename]];
|
|
1076
|
+
if (source.content.original !== uniqueSource.content) {
|
|
1077
|
+
throw new Error(`Illegal source: same filename (${source.filename}), different contents`);
|
|
1078
|
+
}
|
|
1079
|
+
}
|
|
1080
|
+
}
|
|
1081
|
+
this.sources.push(source);
|
|
1082
|
+
return this;
|
|
1083
|
+
}
|
|
1084
|
+
append(str, options) {
|
|
1085
|
+
this.addSource({
|
|
1086
|
+
content: new MagicString(str),
|
|
1087
|
+
separator: options && options.separator || ""
|
|
1088
|
+
});
|
|
1089
|
+
return this;
|
|
1090
|
+
}
|
|
1091
|
+
clone() {
|
|
1092
|
+
const bundle = new Bundle({
|
|
1093
|
+
intro: this.intro,
|
|
1094
|
+
separator: this.separator
|
|
1095
|
+
});
|
|
1096
|
+
this.sources.forEach((source) => {
|
|
1097
|
+
bundle.addSource({
|
|
1098
|
+
filename: source.filename,
|
|
1099
|
+
content: source.content.clone(),
|
|
1100
|
+
separator: source.separator
|
|
1101
|
+
});
|
|
1102
|
+
});
|
|
1103
|
+
return bundle;
|
|
1104
|
+
}
|
|
1105
|
+
generateDecodedMap(options = {}) {
|
|
1106
|
+
const names = [];
|
|
1107
|
+
let x_google_ignoreList = undefined;
|
|
1108
|
+
this.sources.forEach((source) => {
|
|
1109
|
+
Object.keys(source.content.storedNames).forEach((name) => {
|
|
1110
|
+
if (!~names.indexOf(name)) names.push(name);
|
|
1111
|
+
});
|
|
1112
|
+
});
|
|
1113
|
+
const mappings = new Mappings(options.hires);
|
|
1114
|
+
if (this.intro) {
|
|
1115
|
+
mappings.advance(this.intro);
|
|
1116
|
+
}
|
|
1117
|
+
this.sources.forEach((source, i) => {
|
|
1118
|
+
if (i > 0) {
|
|
1119
|
+
mappings.advance(this.separator);
|
|
1120
|
+
}
|
|
1121
|
+
const sourceIndex = source.filename ? this.uniqueSourceIndexByFilename[source.filename] : -1;
|
|
1122
|
+
const magicString = source.content;
|
|
1123
|
+
const locate = getLocator(magicString.original);
|
|
1124
|
+
if (magicString.intro) {
|
|
1125
|
+
mappings.advance(magicString.intro);
|
|
1126
|
+
}
|
|
1127
|
+
magicString.firstChunk.eachNext((chunk) => {
|
|
1128
|
+
const loc = locate(chunk.start);
|
|
1129
|
+
if (chunk.intro.length) mappings.advance(chunk.intro);
|
|
1130
|
+
if (source.filename) {
|
|
1131
|
+
if (chunk.edited) {
|
|
1132
|
+
mappings.addEdit(sourceIndex, chunk.content, loc, chunk.storeName ? names.indexOf(chunk.original) : -1);
|
|
1133
|
+
} else {
|
|
1134
|
+
mappings.addUneditedChunk(sourceIndex, chunk, magicString.original, loc, magicString.sourcemapLocations);
|
|
1135
|
+
}
|
|
1136
|
+
} else {
|
|
1137
|
+
mappings.advance(chunk.content);
|
|
1138
|
+
}
|
|
1139
|
+
if (chunk.outro.length) mappings.advance(chunk.outro);
|
|
1140
|
+
});
|
|
1141
|
+
if (magicString.outro) {
|
|
1142
|
+
mappings.advance(magicString.outro);
|
|
1143
|
+
}
|
|
1144
|
+
if (source.ignoreList && sourceIndex !== -1) {
|
|
1145
|
+
if (x_google_ignoreList === undefined) {
|
|
1146
|
+
x_google_ignoreList = [];
|
|
1147
|
+
}
|
|
1148
|
+
x_google_ignoreList.push(sourceIndex);
|
|
1149
|
+
}
|
|
1150
|
+
});
|
|
1151
|
+
return {
|
|
1152
|
+
file: options.file ? options.file.split(/[/\\]/).pop() : undefined,
|
|
1153
|
+
sources: this.uniqueSources.map((source) => {
|
|
1154
|
+
return options.file ? getRelativePath(options.file, source.filename) : source.filename;
|
|
1155
|
+
}),
|
|
1156
|
+
sourcesContent: this.uniqueSources.map((source) => {
|
|
1157
|
+
return options.includeContent ? source.content : null;
|
|
1158
|
+
}),
|
|
1159
|
+
names,
|
|
1160
|
+
mappings: mappings.raw,
|
|
1161
|
+
x_google_ignoreList
|
|
1162
|
+
};
|
|
1163
|
+
}
|
|
1164
|
+
generateMap(options) {
|
|
1165
|
+
return new SourceMap(this.generateDecodedMap(options));
|
|
1166
|
+
}
|
|
1167
|
+
getIndentString() {
|
|
1168
|
+
const indentStringCounts = {};
|
|
1169
|
+
this.sources.forEach((source) => {
|
|
1170
|
+
const indentStr = source.content._getRawIndentString();
|
|
1171
|
+
if (indentStr === null) return;
|
|
1172
|
+
if (!indentStringCounts[indentStr]) indentStringCounts[indentStr] = 0;
|
|
1173
|
+
indentStringCounts[indentStr] += 1;
|
|
1174
|
+
});
|
|
1175
|
+
return Object.keys(indentStringCounts).sort((a, b) => {
|
|
1176
|
+
return indentStringCounts[a] - indentStringCounts[b];
|
|
1177
|
+
})[0] || " ";
|
|
1178
|
+
}
|
|
1179
|
+
indent(indentStr) {
|
|
1180
|
+
if (!arguments.length) {
|
|
1181
|
+
indentStr = this.getIndentString();
|
|
1182
|
+
}
|
|
1183
|
+
if (indentStr === "") return this;
|
|
1184
|
+
let trailingNewline = !this.intro || this.intro.slice(-1) === "\n";
|
|
1185
|
+
this.sources.forEach((source, i) => {
|
|
1186
|
+
const separator = source.separator !== undefined ? source.separator : this.separator;
|
|
1187
|
+
const indentStart = trailingNewline || i > 0 && /\r?\n$/.test(separator);
|
|
1188
|
+
source.content.indent(indentStr, {
|
|
1189
|
+
exclude: source.indentExclusionRanges,
|
|
1190
|
+
indentStart
|
|
1191
|
+
});
|
|
1192
|
+
trailingNewline = source.content.lastChar() === "\n";
|
|
1193
|
+
});
|
|
1194
|
+
if (this.intro) {
|
|
1195
|
+
this.intro = indentStr + this.intro.replace(/^[^\n]/gm, (match, index) => {
|
|
1196
|
+
return index > 0 ? indentStr + match : match;
|
|
1197
|
+
});
|
|
1198
|
+
}
|
|
1199
|
+
return this;
|
|
1200
|
+
}
|
|
1201
|
+
prepend(str) {
|
|
1202
|
+
this.intro = str + this.intro;
|
|
1203
|
+
return this;
|
|
1204
|
+
}
|
|
1205
|
+
toString() {
|
|
1206
|
+
const body = this.sources.map((source, i) => {
|
|
1207
|
+
const separator = source.separator !== undefined ? source.separator : this.separator;
|
|
1208
|
+
const str = (i > 0 ? separator : "") + source.content.toString();
|
|
1209
|
+
return str;
|
|
1210
|
+
}).join("");
|
|
1211
|
+
return this.intro + body;
|
|
1212
|
+
}
|
|
1213
|
+
isEmpty() {
|
|
1214
|
+
if (this.intro.length && this.intro.trim()) return false;
|
|
1215
|
+
if (this.sources.some((source) => !source.content.isEmpty())) return false;
|
|
1216
|
+
return true;
|
|
1217
|
+
}
|
|
1218
|
+
length() {
|
|
1219
|
+
return this.sources.reduce((length, source) => length + source.content.length(), this.intro.length);
|
|
1220
|
+
}
|
|
1221
|
+
trimLines() {
|
|
1222
|
+
return this.trim("[\\r\\n]");
|
|
1223
|
+
}
|
|
1224
|
+
trim(charType) {
|
|
1225
|
+
return this.trimStart(charType).trimEnd(charType);
|
|
1226
|
+
}
|
|
1227
|
+
trimStart(charType) {
|
|
1228
|
+
const rx = new RegExp("^" + (charType || "\\s") + "+");
|
|
1229
|
+
this.intro = this.intro.replace(rx, "");
|
|
1230
|
+
if (!this.intro) {
|
|
1231
|
+
let source;
|
|
1232
|
+
let i = 0;
|
|
1233
|
+
do {
|
|
1234
|
+
source = this.sources[i++];
|
|
1235
|
+
if (!source) {
|
|
1236
|
+
break;
|
|
1237
|
+
}
|
|
1238
|
+
} while (!source.content.trimStartAborted(charType));
|
|
1239
|
+
}
|
|
1240
|
+
return this;
|
|
1241
|
+
}
|
|
1242
|
+
trimEnd(charType) {
|
|
1243
|
+
const rx = new RegExp((charType || "\\s") + "+$");
|
|
1244
|
+
let source;
|
|
1245
|
+
let i = this.sources.length - 1;
|
|
1246
|
+
do {
|
|
1247
|
+
source = this.sources[i--];
|
|
1248
|
+
if (!source) {
|
|
1249
|
+
this.intro = this.intro.replace(rx, "");
|
|
1250
|
+
break;
|
|
1251
|
+
}
|
|
1252
|
+
} while (!source.content.trimEndAborted(charType));
|
|
1253
|
+
return this;
|
|
1254
|
+
}
|
|
1255
|
+
};
|
|
1256
|
+
|
|
1257
|
+
//#endregion
|
|
1258
|
+
export { Bundle, SourceMap, MagicString as default };
|