@scalar/workspace-store 0.40.2 → 0.40.4
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/CHANGELOG.md +13 -0
- package/dist/client.d.ts +7 -2
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +820 -681
- package/dist/entities/auth/index.js +96 -101
- package/dist/entities/auth/schema.d.ts +10 -0
- package/dist/entities/auth/schema.d.ts.map +1 -1
- package/dist/entities/auth/schema.js +42 -116
- package/dist/entities/history/index.js +80 -60
- package/dist/entities/history/schema.js +94 -88
- package/dist/events/bus.js +146 -93
- package/dist/events/definitions/analytics.js +1 -1
- package/dist/events/definitions/auth.js +1 -1
- package/dist/events/definitions/common.js +1 -1
- package/dist/events/definitions/cookie.js +1 -1
- package/dist/events/definitions/document.js +1 -1
- package/dist/events/definitions/environment.js +1 -1
- package/dist/events/definitions/hooks.js +1 -1
- package/dist/events/definitions/index.js +1 -1
- package/dist/events/definitions/meta.js +1 -1
- package/dist/events/definitions/operation.js +1 -1
- package/dist/events/definitions/server.js +1 -1
- package/dist/events/definitions/tabs.js +1 -1
- package/dist/events/definitions/tag.js +1 -1
- package/dist/events/definitions/ui.js +1 -1
- package/dist/events/definitions/workspace.js +1 -1
- package/dist/events/index.js +3 -9
- package/dist/events/listeners.js +20 -22
- package/dist/events/old-definitions.js +15 -12
- package/dist/helpers/deep-clone.js +33 -17
- package/dist/helpers/detect-changes-proxy.js +95 -57
- package/dist/helpers/general.js +78 -23
- package/dist/helpers/generate-unique-value.js +77 -45
- package/dist/helpers/get-fetch.js +12 -10
- package/dist/helpers/get-resolved-ref.js +11 -10
- package/dist/helpers/is-non-optional-security-requirement.js +3 -6
- package/dist/helpers/merge-object.js +71 -30
- package/dist/helpers/overrides-proxy.js +98 -58
- package/dist/helpers/unpack-proxy.js +60 -58
- package/dist/mutators/auth.js +358 -230
- package/dist/mutators/cookie.js +59 -42
- package/dist/mutators/document.js +104 -66
- package/dist/mutators/environment.js +97 -72
- package/dist/mutators/helpers.js +9 -13
- package/dist/mutators/index.js +62 -49
- package/dist/mutators/operation/body.js +88 -57
- package/dist/mutators/operation/extensions.js +20 -12
- package/dist/mutators/operation/helpers/fetch-request-to-har.js +144 -107
- package/dist/mutators/operation/helpers/fetch-response-to-har.js +143 -95
- package/dist/mutators/operation/helpers/get-parameter-position.js +12 -12
- package/dist/mutators/operation/helpers/har-to-operation.js +169 -132
- package/dist/mutators/operation/helpers/sync-path-parameters.js +109 -60
- package/dist/mutators/operation/history.js +60 -64
- package/dist/mutators/operation/index.js +25 -49
- package/dist/mutators/operation/operation.js +349 -240
- package/dist/mutators/operation/parameters.js +157 -93
- package/dist/mutators/server.js +213 -152
- package/dist/mutators/tabs.js +173 -130
- package/dist/mutators/tag.js +131 -97
- package/dist/mutators/workspace.js +72 -42
- package/dist/navigation/get-navigation-options.js +97 -84
- package/dist/navigation/helpers/get-openapi-object.js +46 -29
- package/dist/navigation/helpers/get-operation-entries.js +72 -32
- package/dist/navigation/helpers/get-parent-entry.js +16 -12
- package/dist/navigation/helpers/get-tag-entries.js +56 -29
- package/dist/navigation/helpers/get-tag.js +22 -23
- package/dist/navigation/helpers/get-x-keys.js +13 -9
- package/dist/navigation/helpers/traverse-description.js +90 -72
- package/dist/navigation/helpers/traverse-document.js +111 -98
- package/dist/navigation/helpers/traverse-examples.js +35 -31
- package/dist/navigation/helpers/traverse-paths.js +118 -106
- package/dist/navigation/helpers/traverse-schemas.js +65 -64
- package/dist/navigation/helpers/traverse-tags.js +158 -129
- package/dist/navigation/helpers/traverse-webhooks.js +96 -90
- package/dist/navigation/helpers/update-order-ids.js +59 -51
- package/dist/navigation/helpers/utils.js +71 -21
- package/dist/navigation/index.js +5 -13
- package/dist/navigation/types.js +1 -1
- package/dist/persistence/index.js +283 -285
- package/dist/persistence/indexdb.js +263 -126
- package/dist/plugins/bundler/helpers.js +21 -12
- package/dist/plugins/bundler/index.d.ts +7 -0
- package/dist/plugins/bundler/index.d.ts.map +1 -1
- package/dist/plugins/bundler/index.js +305 -171
- package/dist/plugins/client/index.js +1 -5
- package/dist/plugins/client/persistence.js +95 -90
- package/dist/resolve.js +18 -25
- package/dist/schemas/compose.js +6 -7
- package/dist/schemas/extensions/document/x-internal.js +3 -7
- package/dist/schemas/extensions/document/x-scalar-environments.js +16 -22
- package/dist/schemas/extensions/document/x-scalar-icon.js +3 -7
- package/dist/schemas/extensions/document/x-scalar-ignore.js +3 -7
- package/dist/schemas/extensions/document/x-scalar-is-dirty.js +21 -8
- package/dist/schemas/extensions/document/x-scalar-original-document-hash.js +17 -8
- package/dist/schemas/extensions/document/x-scalar-registry-meta.js +15 -21
- package/dist/schemas/extensions/document/x-scalar-sdk-installation.js +5 -13
- package/dist/schemas/extensions/document/x-scalar-watch-mode.js +4 -8
- package/dist/schemas/extensions/document/x-tags.js +3 -7
- package/dist/schemas/extensions/example/x-disabled.js +17 -7
- package/dist/schemas/extensions/general/x-scalar-active-environment.js +4 -7
- package/dist/schemas/extensions/general/x-scalar-cookies.js +9 -14
- package/dist/schemas/extensions/general/x-scalar-order.js +8 -7
- package/dist/schemas/extensions/operation/index.js +4 -23
- package/dist/schemas/extensions/operation/x-badge.js +42 -50
- package/dist/schemas/extensions/operation/x-code-samples.js +8 -12
- package/dist/schemas/extensions/operation/x-draft-examples.js +3 -7
- package/dist/schemas/extensions/operation/x-post-response.js +18 -7
- package/dist/schemas/extensions/operation/x-scalar-disable-parameters.js +57 -13
- package/dist/schemas/extensions/operation/x-scalar-selected-content-type.js +9 -7
- package/dist/schemas/extensions/operation/x-scalar-stability.js +15 -14
- package/dist/schemas/extensions/parameter/x-global.js +12 -7
- package/dist/schemas/extensions/schema/x-additional-properties-name.js +10 -7
- package/dist/schemas/extensions/schema/x-enum-descriptions.js +17 -12
- package/dist/schemas/extensions/schema/x-enum-varnames.js +21 -8
- package/dist/schemas/extensions/schema/x-examples.js +3 -7
- package/dist/schemas/extensions/schema/x-variable.js +3 -7
- package/dist/schemas/extensions/security/index.js +1 -1
- package/dist/schemas/extensions/security/x-default-scopes.js +16 -7
- package/dist/schemas/extensions/security/x-scalar-credentials-location.js +16 -7
- package/dist/schemas/extensions/security/x-scalar-security-body.js +14 -7
- package/dist/schemas/extensions/security/x-scalar-security-query.js +14 -7
- package/dist/schemas/extensions/security/x-scalar-security-secrets.js +66 -37
- package/dist/schemas/extensions/security/x-tokenName.js +11 -7
- package/dist/schemas/extensions/security/x-use-pkce.js +6 -10
- package/dist/schemas/extensions/server/x-scalar-selected-server.js +3 -7
- package/dist/schemas/extensions/tag/index.js +1 -1
- package/dist/schemas/extensions/tag/x-display-name.js +11 -7
- package/dist/schemas/extensions/tag/x-tag-groups.js +13 -15
- package/dist/schemas/extensions/workspace/index.js +2 -11
- package/dist/schemas/extensions/workspace/x-scalar-active-proxy.js +13 -7
- package/dist/schemas/extensions/workspace/x-scalar-tabs.js +15 -13
- package/dist/schemas/extensions.js +11 -15
- package/dist/schemas/inmemory-workspace.d.ts +6 -0
- package/dist/schemas/inmemory-workspace.d.ts.map +1 -1
- package/dist/schemas/inmemory-workspace.js +13 -21
- package/dist/schemas/navigation.js +48 -85
- package/dist/schemas/reference-config/appearance.js +15 -22
- package/dist/schemas/reference-config/features.js +14 -21
- package/dist/schemas/reference-config/index.d.ts +2 -0
- package/dist/schemas/reference-config/index.d.ts.map +1 -1
- package/dist/schemas/reference-config/index.js +42 -44
- package/dist/schemas/reference-config/meta.js +11 -18
- package/dist/schemas/reference-config/routing.js +7 -14
- package/dist/schemas/reference-config/settings.d.ts +2 -0
- package/dist/schemas/reference-config/settings.d.ts.map +1 -1
- package/dist/schemas/reference-config/settings.js +10 -17
- package/dist/schemas/typebox-coerce.js +23 -6
- package/dist/schemas/v3.1/strict/callback.js +6 -12
- package/dist/schemas/v3.1/strict/components.js +26 -48
- package/dist/schemas/v3.1/strict/contact.js +9 -12
- package/dist/schemas/v3.1/strict/discriminator.js +11 -10
- package/dist/schemas/v3.1/strict/encoding.js +15 -12
- package/dist/schemas/v3.1/strict/example.js +11 -13
- package/dist/schemas/v3.1/strict/external-documentation.js +7 -10
- package/dist/schemas/v3.1/strict/header.js +27 -28
- package/dist/schemas/v3.1/strict/info.js +10 -16
- package/dist/schemas/v3.1/strict/license.js +9 -12
- package/dist/schemas/v3.1/strict/link.js +22 -19
- package/dist/schemas/v3.1/strict/media-type.js +17 -16
- package/dist/schemas/v3.1/strict/oauth-flow.js +28 -62
- package/dist/schemas/v3.1/strict/oauthflows.js +14 -20
- package/dist/schemas/v3.1/strict/openapi-document.d.ts +70 -0
- package/dist/schemas/v3.1/strict/openapi-document.d.ts.map +1 -1
- package/dist/schemas/v3.1/strict/openapi-document.js +126 -210
- package/dist/schemas/v3.1/strict/operation.js +16 -43
- package/dist/schemas/v3.1/strict/parameter.d.ts +6 -0
- package/dist/schemas/v3.1/strict/parameter.d.ts.map +1 -1
- package/dist/schemas/v3.1/strict/parameter.js +29 -35
- package/dist/schemas/v3.1/strict/path-item.js +36 -40
- package/dist/schemas/v3.1/strict/paths.js +8 -11
- package/dist/schemas/v3.1/strict/ref-definitions.js +76 -100
- package/dist/schemas/v3.1/strict/reference.js +18 -21
- package/dist/schemas/v3.1/strict/request-body.js +8 -16
- package/dist/schemas/v3.1/strict/response.js +12 -16
- package/dist/schemas/v3.1/strict/responses.js +13 -11
- package/dist/schemas/v3.1/strict/schema.js +149 -157
- package/dist/schemas/v3.1/strict/security-requirement.js +13 -12
- package/dist/schemas/v3.1/strict/security-scheme.js +29 -41
- package/dist/schemas/v3.1/strict/server-variable.js +9 -12
- package/dist/schemas/v3.1/strict/server.js +10 -13
- package/dist/schemas/v3.1/strict/tag.js +11 -20
- package/dist/schemas/v3.1/strict/type-guards.js +20 -20
- package/dist/schemas/v3.1/strict/xml.js +17 -16
- package/dist/schemas/workspace-specification/index.js +11 -23
- package/dist/schemas/workspace-specification/info.js +4 -8
- package/dist/schemas/workspace.d.ts +6 -0
- package/dist/schemas/workspace.d.ts.map +1 -1
- package/dist/schemas/workspace.js +25 -51
- package/dist/schemas.js +2 -6
- package/dist/server.js +286 -176
- package/dist/workspace-plugin.js +1 -1
- package/package.json +13 -19
- package/dist/client.js.map +0 -7
- package/dist/entities/auth/index.js.map +0 -7
- package/dist/entities/auth/schema.js.map +0 -7
- package/dist/entities/history/index.js.map +0 -7
- package/dist/entities/history/schema.js.map +0 -7
- package/dist/events/bus.js.map +0 -7
- package/dist/events/definitions/analytics.js.map +0 -7
- package/dist/events/definitions/auth.js.map +0 -7
- package/dist/events/definitions/common.js.map +0 -7
- package/dist/events/definitions/cookie.js.map +0 -7
- package/dist/events/definitions/document.js.map +0 -7
- package/dist/events/definitions/environment.js.map +0 -7
- package/dist/events/definitions/hooks.js.map +0 -7
- package/dist/events/definitions/index.js.map +0 -7
- package/dist/events/definitions/meta.js.map +0 -7
- package/dist/events/definitions/operation.js.map +0 -7
- package/dist/events/definitions/server.js.map +0 -7
- package/dist/events/definitions/tabs.js.map +0 -7
- package/dist/events/definitions/tag.js.map +0 -7
- package/dist/events/definitions/ui.js.map +0 -7
- package/dist/events/definitions/workspace.js.map +0 -7
- package/dist/events/index.js.map +0 -7
- package/dist/events/listeners.js.map +0 -7
- package/dist/events/old-definitions.js.map +0 -7
- package/dist/helpers/apply-selective-updates.d.ts +0 -19
- package/dist/helpers/apply-selective-updates.d.ts.map +0 -1
- package/dist/helpers/apply-selective-updates.js +0 -37
- package/dist/helpers/apply-selective-updates.js.map +0 -7
- package/dist/helpers/deep-clone.js.map +0 -7
- package/dist/helpers/detect-changes-proxy.js.map +0 -7
- package/dist/helpers/general.js.map +0 -7
- package/dist/helpers/generate-unique-value.js.map +0 -7
- package/dist/helpers/get-fetch.js.map +0 -7
- package/dist/helpers/get-resolved-ref.js.map +0 -7
- package/dist/helpers/is-non-optional-security-requirement.js.map +0 -7
- package/dist/helpers/merge-object.js.map +0 -7
- package/dist/helpers/overrides-proxy.js.map +0 -7
- package/dist/helpers/unpack-proxy.js.map +0 -7
- package/dist/mutators/auth.js.map +0 -7
- package/dist/mutators/cookie.js.map +0 -7
- package/dist/mutators/document.js.map +0 -7
- package/dist/mutators/environment.js.map +0 -7
- package/dist/mutators/helpers.js.map +0 -7
- package/dist/mutators/index.js.map +0 -7
- package/dist/mutators/operation/body.js.map +0 -7
- package/dist/mutators/operation/extensions.js.map +0 -7
- package/dist/mutators/operation/helpers/fetch-request-to-har.js.map +0 -7
- package/dist/mutators/operation/helpers/fetch-response-to-har.js.map +0 -7
- package/dist/mutators/operation/helpers/get-parameter-position.js.map +0 -7
- package/dist/mutators/operation/helpers/har-to-operation.js.map +0 -7
- package/dist/mutators/operation/helpers/sync-path-parameters.js.map +0 -7
- package/dist/mutators/operation/history.js.map +0 -7
- package/dist/mutators/operation/index.js.map +0 -7
- package/dist/mutators/operation/operation.js.map +0 -7
- package/dist/mutators/operation/parameters.js.map +0 -7
- package/dist/mutators/server.js.map +0 -7
- package/dist/mutators/tabs.js.map +0 -7
- package/dist/mutators/tag.js.map +0 -7
- package/dist/mutators/workspace.js.map +0 -7
- package/dist/navigation/get-navigation-options.js.map +0 -7
- package/dist/navigation/helpers/get-openapi-object.js.map +0 -7
- package/dist/navigation/helpers/get-operation-entries.js.map +0 -7
- package/dist/navigation/helpers/get-parent-entry.js.map +0 -7
- package/dist/navigation/helpers/get-tag-entries.js.map +0 -7
- package/dist/navigation/helpers/get-tag.js.map +0 -7
- package/dist/navigation/helpers/get-x-keys.js.map +0 -7
- package/dist/navigation/helpers/traverse-description.js.map +0 -7
- package/dist/navigation/helpers/traverse-document.js.map +0 -7
- package/dist/navigation/helpers/traverse-examples.js.map +0 -7
- package/dist/navigation/helpers/traverse-paths.js.map +0 -7
- package/dist/navigation/helpers/traverse-schemas.js.map +0 -7
- package/dist/navigation/helpers/traverse-tags.js.map +0 -7
- package/dist/navigation/helpers/traverse-webhooks.js.map +0 -7
- package/dist/navigation/helpers/update-order-ids.js.map +0 -7
- package/dist/navigation/helpers/utils.js.map +0 -7
- package/dist/navigation/index.js.map +0 -7
- package/dist/navigation/types.js.map +0 -7
- package/dist/persistence/index.js.map +0 -7
- package/dist/persistence/indexdb.js.map +0 -7
- package/dist/plugins/bundler/helpers.js.map +0 -7
- package/dist/plugins/bundler/index.js.map +0 -7
- package/dist/plugins/client/index.js.map +0 -7
- package/dist/plugins/client/persistence.js.map +0 -7
- package/dist/resolve.js.map +0 -7
- package/dist/schemas/compose.js.map +0 -7
- package/dist/schemas/extensions/document/x-internal.js.map +0 -7
- package/dist/schemas/extensions/document/x-scalar-environments.js.map +0 -7
- package/dist/schemas/extensions/document/x-scalar-icon.js.map +0 -7
- package/dist/schemas/extensions/document/x-scalar-ignore.js.map +0 -7
- package/dist/schemas/extensions/document/x-scalar-is-dirty.js.map +0 -7
- package/dist/schemas/extensions/document/x-scalar-original-document-hash.js.map +0 -7
- package/dist/schemas/extensions/document/x-scalar-registry-meta.js.map +0 -7
- package/dist/schemas/extensions/document/x-scalar-sdk-installation.js.map +0 -7
- package/dist/schemas/extensions/document/x-scalar-watch-mode.js.map +0 -7
- package/dist/schemas/extensions/document/x-tags.js.map +0 -7
- package/dist/schemas/extensions/example/x-disabled.js.map +0 -7
- package/dist/schemas/extensions/general/x-scalar-active-environment.js.map +0 -7
- package/dist/schemas/extensions/general/x-scalar-cookies.js.map +0 -7
- package/dist/schemas/extensions/general/x-scalar-order.js.map +0 -7
- package/dist/schemas/extensions/operation/index.js.map +0 -7
- package/dist/schemas/extensions/operation/x-badge.js.map +0 -7
- package/dist/schemas/extensions/operation/x-code-samples.js.map +0 -7
- package/dist/schemas/extensions/operation/x-draft-examples.js.map +0 -7
- package/dist/schemas/extensions/operation/x-post-response.js.map +0 -7
- package/dist/schemas/extensions/operation/x-scalar-disable-parameters.js.map +0 -7
- package/dist/schemas/extensions/operation/x-scalar-selected-content-type.js.map +0 -7
- package/dist/schemas/extensions/operation/x-scalar-stability.js.map +0 -7
- package/dist/schemas/extensions/parameter/x-global.js.map +0 -7
- package/dist/schemas/extensions/schema/x-additional-properties-name.js.map +0 -7
- package/dist/schemas/extensions/schema/x-enum-descriptions.js.map +0 -7
- package/dist/schemas/extensions/schema/x-enum-varnames.js.map +0 -7
- package/dist/schemas/extensions/schema/x-examples.js.map +0 -7
- package/dist/schemas/extensions/schema/x-variable.js.map +0 -7
- package/dist/schemas/extensions/security/index.js.map +0 -7
- package/dist/schemas/extensions/security/x-default-scopes.js.map +0 -7
- package/dist/schemas/extensions/security/x-scalar-credentials-location.js.map +0 -7
- package/dist/schemas/extensions/security/x-scalar-security-body.js.map +0 -7
- package/dist/schemas/extensions/security/x-scalar-security-query.js.map +0 -7
- package/dist/schemas/extensions/security/x-scalar-security-secrets.js.map +0 -7
- package/dist/schemas/extensions/security/x-tokenName.js.map +0 -7
- package/dist/schemas/extensions/security/x-use-pkce.js.map +0 -7
- package/dist/schemas/extensions/server/x-scalar-selected-server.js.map +0 -7
- package/dist/schemas/extensions/tag/index.js.map +0 -7
- package/dist/schemas/extensions/tag/x-display-name.js.map +0 -7
- package/dist/schemas/extensions/tag/x-tag-groups.js.map +0 -7
- package/dist/schemas/extensions/workspace/index.js.map +0 -7
- package/dist/schemas/extensions/workspace/x-scalar-active-proxy.js.map +0 -7
- package/dist/schemas/extensions/workspace/x-scalar-tabs.js.map +0 -7
- package/dist/schemas/extensions.js.map +0 -7
- package/dist/schemas/inmemory-workspace.js.map +0 -7
- package/dist/schemas/navigation.js.map +0 -7
- package/dist/schemas/reference-config/appearance.js.map +0 -7
- package/dist/schemas/reference-config/features.js.map +0 -7
- package/dist/schemas/reference-config/index.js.map +0 -7
- package/dist/schemas/reference-config/meta.js.map +0 -7
- package/dist/schemas/reference-config/routing.js.map +0 -7
- package/dist/schemas/reference-config/settings.js.map +0 -7
- package/dist/schemas/typebox-coerce.js.map +0 -7
- package/dist/schemas/v3.1/strict/callback.js.map +0 -7
- package/dist/schemas/v3.1/strict/components.js.map +0 -7
- package/dist/schemas/v3.1/strict/contact.js.map +0 -7
- package/dist/schemas/v3.1/strict/discriminator.js.map +0 -7
- package/dist/schemas/v3.1/strict/encoding.js.map +0 -7
- package/dist/schemas/v3.1/strict/example.js.map +0 -7
- package/dist/schemas/v3.1/strict/external-documentation.js.map +0 -7
- package/dist/schemas/v3.1/strict/header.js.map +0 -7
- package/dist/schemas/v3.1/strict/info.js.map +0 -7
- package/dist/schemas/v3.1/strict/license.js.map +0 -7
- package/dist/schemas/v3.1/strict/link.js.map +0 -7
- package/dist/schemas/v3.1/strict/media-type.js.map +0 -7
- package/dist/schemas/v3.1/strict/oauth-flow.js.map +0 -7
- package/dist/schemas/v3.1/strict/oauthflows.js.map +0 -7
- package/dist/schemas/v3.1/strict/openapi-document.js.map +0 -7
- package/dist/schemas/v3.1/strict/operation.js.map +0 -7
- package/dist/schemas/v3.1/strict/parameter.js.map +0 -7
- package/dist/schemas/v3.1/strict/path-item.js.map +0 -7
- package/dist/schemas/v3.1/strict/paths.js.map +0 -7
- package/dist/schemas/v3.1/strict/ref-definitions.js.map +0 -7
- package/dist/schemas/v3.1/strict/reference.js.map +0 -7
- package/dist/schemas/v3.1/strict/request-body.js.map +0 -7
- package/dist/schemas/v3.1/strict/response.js.map +0 -7
- package/dist/schemas/v3.1/strict/responses.js.map +0 -7
- package/dist/schemas/v3.1/strict/schema.js.map +0 -7
- package/dist/schemas/v3.1/strict/security-requirement.js.map +0 -7
- package/dist/schemas/v3.1/strict/security-scheme.js.map +0 -7
- package/dist/schemas/v3.1/strict/server-variable.js.map +0 -7
- package/dist/schemas/v3.1/strict/server.js.map +0 -7
- package/dist/schemas/v3.1/strict/tag.js.map +0 -7
- package/dist/schemas/v3.1/strict/type-guards.js.map +0 -7
- package/dist/schemas/v3.1/strict/xml.js.map +0 -7
- package/dist/schemas/workspace-specification/index.js.map +0 -7
- package/dist/schemas/workspace-specification/info.js.map +0 -7
- package/dist/schemas/workspace.js.map +0 -7
- package/dist/schemas.js.map +0 -7
- package/dist/server.js.map +0 -7
- package/dist/workspace-plugin.js.map +0 -7
|
@@ -1,98 +1,103 @@
|
|
|
1
|
-
import { debounce } from
|
|
2
|
-
import { createWorkspaceStorePersistence } from
|
|
3
|
-
const pendingFlushes =
|
|
1
|
+
import { debounce } from '@scalar/helpers/general/debounce';
|
|
2
|
+
import { createWorkspaceStorePersistence } from '../../persistence/index.js';
|
|
3
|
+
const pendingFlushes = new Set();
|
|
4
|
+
// Flag to ensure lifecycle event listeners are only initialized once
|
|
4
5
|
let persistenceLifecycleListenersInitialized = false;
|
|
6
|
+
/**
|
|
7
|
+
* Runs (calls) all pending flush functions.
|
|
8
|
+
*/
|
|
5
9
|
const runPendingFlushes = () => {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
};
|
|
10
|
-
const initializePersistenceLifecycleListeners = () => {
|
|
11
|
-
if (persistenceLifecycleListenersInitialized || typeof window === "undefined" || typeof document === "undefined") {
|
|
12
|
-
return;
|
|
13
|
-
}
|
|
14
|
-
persistenceLifecycleListenersInitialized = true;
|
|
15
|
-
window.addEventListener("pagehide", runPendingFlushes);
|
|
16
|
-
window.addEventListener("beforeunload", runPendingFlushes);
|
|
17
|
-
document.addEventListener("visibilitychange", () => {
|
|
18
|
-
if (document.visibilityState === "hidden") {
|
|
19
|
-
runPendingFlushes();
|
|
10
|
+
for (const flush of pendingFlushes) {
|
|
11
|
+
flush(); // Call the flush function
|
|
20
12
|
}
|
|
21
|
-
});
|
|
22
13
|
};
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
const { execute, flushAll } = debounce({ delay: debounceDelay, maxWait });
|
|
31
|
-
pendingFlushes.add(flushAll);
|
|
32
|
-
initializePersistenceLifecycleListeners();
|
|
33
|
-
const dispose = () => {
|
|
34
|
-
flushAll();
|
|
35
|
-
pendingFlushes.delete(flushAll);
|
|
36
|
-
};
|
|
37
|
-
return {
|
|
38
|
-
dispose,
|
|
39
|
-
hooks: {
|
|
40
|
-
/**
|
|
41
|
-
* Handles all workspace state change events.
|
|
42
|
-
* Each write is debounced by a composite key to prevent frequent writes for the same entity.
|
|
43
|
-
*/
|
|
44
|
-
onWorkspaceStateChanges(event) {
|
|
45
|
-
if (event.type === "meta") {
|
|
46
|
-
return execute(`meta-${workspaceId}`, () => persistence.meta.setItem(workspaceId, event.value));
|
|
47
|
-
}
|
|
48
|
-
if (event.type === "documents") {
|
|
49
|
-
return execute(
|
|
50
|
-
`documents-${workspaceId}-${event.documentName}`,
|
|
51
|
-
() => persistence.documents.setItem(workspaceId, event.documentName, event.value)
|
|
52
|
-
);
|
|
53
|
-
}
|
|
54
|
-
if (event.type === "intermediateDocuments") {
|
|
55
|
-
return execute(
|
|
56
|
-
`intermediateDocuments-${workspaceId}-${event.documentName}`,
|
|
57
|
-
() => persistence.intermediateDocuments.setItem(workspaceId, event.documentName, event.value)
|
|
58
|
-
);
|
|
59
|
-
}
|
|
60
|
-
if (event.type === "originalDocuments") {
|
|
61
|
-
return execute(
|
|
62
|
-
`originalDocuments-${workspaceId}-${event.documentName}`,
|
|
63
|
-
() => persistence.originalDocuments.setItem(workspaceId, event.documentName, event.value)
|
|
64
|
-
);
|
|
65
|
-
}
|
|
66
|
-
if (event.type === "overrides") {
|
|
67
|
-
return execute(
|
|
68
|
-
`overrides-${workspaceId}-${event.documentName}`,
|
|
69
|
-
() => persistence.overrides.setItem(workspaceId, event.documentName, event.value)
|
|
70
|
-
);
|
|
71
|
-
}
|
|
72
|
-
if (event.type === "history") {
|
|
73
|
-
return execute(
|
|
74
|
-
`history-${workspaceId}-${event.documentName}`,
|
|
75
|
-
() => persistence.history.setItem(workspaceId, event.documentName, event.value)
|
|
76
|
-
);
|
|
77
|
-
}
|
|
78
|
-
if (event.type === "auth") {
|
|
79
|
-
return execute(
|
|
80
|
-
`auth-${workspaceId}-${event.documentName}`,
|
|
81
|
-
() => persistence.auth.setItem(workspaceId, event.documentName, event.value)
|
|
82
|
-
);
|
|
83
|
-
}
|
|
84
|
-
if (event.type === "deleteDocument") {
|
|
85
|
-
return execute(
|
|
86
|
-
`deleteDocument-${workspaceId}-${event.documentName}`,
|
|
87
|
-
() => persistence.workspace.deleteDocument(workspaceId, event.documentName)
|
|
88
|
-
);
|
|
89
|
-
}
|
|
14
|
+
/**
|
|
15
|
+
* Adds event listeners to ensure flushing on important lifecycle events
|
|
16
|
+
* (like navigation away or page hide). Ensures they're registered only once.
|
|
17
|
+
*/
|
|
18
|
+
const initializePersistenceLifecycleListeners = () => {
|
|
19
|
+
// Avoid adding listeners multiple times or during SSR/non-browser environments
|
|
20
|
+
if (persistenceLifecycleListenersInitialized || typeof window === 'undefined' || typeof document === 'undefined') {
|
|
90
21
|
return;
|
|
91
|
-
}
|
|
92
22
|
}
|
|
93
|
-
|
|
23
|
+
persistenceLifecycleListenersInitialized = true;
|
|
24
|
+
// Trigger flush on pagehide (browser is unloading or navigating away)
|
|
25
|
+
window.addEventListener('pagehide', runPendingFlushes);
|
|
26
|
+
// Also trigger flush on beforeunload as a fallback
|
|
27
|
+
window.addEventListener('beforeunload', runPendingFlushes);
|
|
28
|
+
// For SPAs: trigger flush when the page goes hidden (such as switching tabs)
|
|
29
|
+
document.addEventListener('visibilitychange', () => {
|
|
30
|
+
if (document.visibilityState === 'hidden') {
|
|
31
|
+
runPendingFlushes();
|
|
32
|
+
}
|
|
33
|
+
});
|
|
94
34
|
};
|
|
95
|
-
|
|
96
|
-
|
|
35
|
+
/**
|
|
36
|
+
* Plugin to persist workspace state changes with debounced writes.
|
|
37
|
+
* Each type of change (meta, documentConfigs, documents, etc.) is debounced by key (type + workspaceId + optional documentName).
|
|
38
|
+
* The debounce delay can be customized, defaults to 500ms.
|
|
39
|
+
*
|
|
40
|
+
* This avoids excessive writes to IndexedDB or other persistence layer when changes occur rapidly.
|
|
41
|
+
*/
|
|
42
|
+
export const persistencePlugin = async ({ workspaceId, debounceDelay = 500,
|
|
43
|
+
/** Maximum time in milliseconds to wait before forcing execution, even with continuous calls. */
|
|
44
|
+
maxWait = 10000, }) => {
|
|
45
|
+
// Create the persistence instance (e.g., IndexedDB, localForage, etc.)
|
|
46
|
+
const persistence = await createWorkspaceStorePersistence();
|
|
47
|
+
// Debounced execute function for batching similar state changes
|
|
48
|
+
const { execute, flushAll } = debounce({ delay: debounceDelay, maxWait });
|
|
49
|
+
pendingFlushes.add(flushAll);
|
|
50
|
+
initializePersistenceLifecycleListeners();
|
|
51
|
+
const dispose = () => {
|
|
52
|
+
// Flush any pending writes and clear timers before removing from the set.
|
|
53
|
+
// Otherwise pending data can be lost if the workspace is torn down and a
|
|
54
|
+
// lifecycle event (e.g. pagehide) never fires or fires after the callback was removed.
|
|
55
|
+
flushAll();
|
|
56
|
+
pendingFlushes.delete(flushAll);
|
|
57
|
+
};
|
|
58
|
+
return {
|
|
59
|
+
dispose,
|
|
60
|
+
hooks: {
|
|
61
|
+
/**
|
|
62
|
+
* Handles all workspace state change events.
|
|
63
|
+
* Each write is debounced by a composite key to prevent frequent writes for the same entity.
|
|
64
|
+
*/
|
|
65
|
+
onWorkspaceStateChanges(event) {
|
|
66
|
+
// If the event is for workspace meta data, debounce by workspaceId
|
|
67
|
+
if (event.type === 'meta') {
|
|
68
|
+
return execute(`meta-${workspaceId}`, () => persistence.meta.setItem(workspaceId, event.value));
|
|
69
|
+
}
|
|
70
|
+
// Debounce per document content and workspace
|
|
71
|
+
if (event.type === 'documents') {
|
|
72
|
+
return execute(`documents-${workspaceId}-${event.documentName}`, () => persistence.documents.setItem(workspaceId, event.documentName, event.value));
|
|
73
|
+
}
|
|
74
|
+
// Debounce per intermediate document and workspace
|
|
75
|
+
if (event.type === 'intermediateDocuments') {
|
|
76
|
+
return execute(`intermediateDocuments-${workspaceId}-${event.documentName}`, () => persistence.intermediateDocuments.setItem(workspaceId, event.documentName, event.value));
|
|
77
|
+
}
|
|
78
|
+
// Debounce per original document and workspace
|
|
79
|
+
if (event.type === 'originalDocuments') {
|
|
80
|
+
return execute(`originalDocuments-${workspaceId}-${event.documentName}`, () => persistence.originalDocuments.setItem(workspaceId, event.documentName, event.value));
|
|
81
|
+
}
|
|
82
|
+
// Debounce per document override and workspace
|
|
83
|
+
if (event.type === 'overrides') {
|
|
84
|
+
return execute(`overrides-${workspaceId}-${event.documentName}`, () => persistence.overrides.setItem(workspaceId, event.documentName, event.value));
|
|
85
|
+
}
|
|
86
|
+
// Debounce per document history and workspace
|
|
87
|
+
if (event.type === 'history') {
|
|
88
|
+
return execute(`history-${workspaceId}-${event.documentName}`, () => persistence.history.setItem(workspaceId, event.documentName, event.value));
|
|
89
|
+
}
|
|
90
|
+
// Debounce per document auth and workspace
|
|
91
|
+
if (event.type === 'auth') {
|
|
92
|
+
return execute(`auth-${workspaceId}-${event.documentName}`, () => persistence.auth.setItem(workspaceId, event.documentName, event.value));
|
|
93
|
+
}
|
|
94
|
+
// Delete document
|
|
95
|
+
if (event.type === 'deleteDocument') {
|
|
96
|
+
return execute(`deleteDocument-${workspaceId}-${event.documentName}`, () => persistence.workspace.deleteDocument(workspaceId, event.documentName));
|
|
97
|
+
}
|
|
98
|
+
// No action for other event types
|
|
99
|
+
return;
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
};
|
|
97
103
|
};
|
|
98
|
-
//# sourceMappingURL=persistence.js.map
|
package/dist/resolve.js
CHANGED
|
@@ -1,28 +1,21 @@
|
|
|
1
|
-
import { Type } from
|
|
2
|
-
import { getResolvedRef } from
|
|
3
|
-
import { compose } from
|
|
4
|
-
import { coerceValue } from
|
|
5
|
-
import { SchemaObjectSchema } from
|
|
1
|
+
import { Type } from '@scalar/typebox';
|
|
2
|
+
import { getResolvedRef } from './helpers/get-resolved-ref.js';
|
|
3
|
+
import { compose } from './schemas/compose.js';
|
|
4
|
+
import { coerceValue } from './schemas/typebox-coerce.js';
|
|
5
|
+
import { SchemaObjectSchema } from './schemas/v3.1/strict/openapi-document.js';
|
|
6
6
|
const mergeSiblingReferences = (node) => {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
const { '$ref-value': value, ...rest } = node;
|
|
8
|
+
return {
|
|
9
|
+
...value,
|
|
10
|
+
...rest,
|
|
11
|
+
};
|
|
12
12
|
};
|
|
13
|
-
const resolve = {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
resoled
|
|
22
|
-
);
|
|
23
|
-
}
|
|
13
|
+
export const resolve = {
|
|
14
|
+
schema: (schema) => {
|
|
15
|
+
if (schema === undefined) {
|
|
16
|
+
return undefined;
|
|
17
|
+
}
|
|
18
|
+
const resoled = getResolvedRef(schema, mergeSiblingReferences);
|
|
19
|
+
return coerceValue(compose(SchemaObjectSchema, Type.Object({ $ref: Type.Optional(Type.String()) })), resoled);
|
|
20
|
+
},
|
|
24
21
|
};
|
|
25
|
-
export {
|
|
26
|
-
resolve
|
|
27
|
-
};
|
|
28
|
-
//# sourceMappingURL=resolve.js.map
|
package/dist/schemas/compose.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { Type } from
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { Type } from '@scalar/typebox';
|
|
2
|
+
/**
|
|
3
|
+
* Work around for: https://github.com/sinclairzx81/typebox/issues/1264
|
|
4
|
+
*/
|
|
5
|
+
export const compose = (...args) => {
|
|
6
|
+
return Type.Composite(args);
|
|
4
7
|
};
|
|
5
|
-
export {
|
|
6
|
-
compose
|
|
7
|
-
};
|
|
8
|
-
//# sourceMappingURL=compose.js.map
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import { Type } from
|
|
2
|
-
const XInternalSchema = Type.Object({
|
|
3
|
-
|
|
1
|
+
import { Type } from '@scalar/typebox';
|
|
2
|
+
export const XInternalSchema = Type.Object({
|
|
3
|
+
'x-internal': Type.Optional(Type.Boolean()),
|
|
4
4
|
});
|
|
5
|
-
export {
|
|
6
|
-
XInternalSchema
|
|
7
|
-
};
|
|
8
|
-
//# sourceMappingURL=x-internal.js.map
|
|
@@ -1,25 +1,19 @@
|
|
|
1
|
-
import { Type } from
|
|
2
|
-
const xScalarEnvVarSchema = Type.Object({
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { Type } from '@scalar/typebox';
|
|
2
|
+
export const xScalarEnvVarSchema = Type.Object({
|
|
3
|
+
name: Type.String(),
|
|
4
|
+
value: Type.Union([
|
|
5
|
+
Type.Object({
|
|
6
|
+
description: Type.Optional(Type.String()),
|
|
7
|
+
default: Type.String({ default: '' }),
|
|
8
|
+
}),
|
|
9
|
+
Type.String(),
|
|
10
|
+
]),
|
|
11
11
|
});
|
|
12
|
-
const xScalarEnvironmentSchema = Type.Object({
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
export const xScalarEnvironmentSchema = Type.Object({
|
|
13
|
+
description: Type.Optional(Type.String()),
|
|
14
|
+
color: Type.String({ default: '#FFFFFF' }),
|
|
15
|
+
variables: Type.Array(xScalarEnvVarSchema),
|
|
16
16
|
});
|
|
17
|
-
const xScalarEnvironmentsSchema = Type.Object({
|
|
18
|
-
|
|
17
|
+
export const xScalarEnvironmentsSchema = Type.Object({
|
|
18
|
+
'x-scalar-environments': Type.Optional(Type.Record(Type.String(), xScalarEnvironmentSchema)),
|
|
19
19
|
});
|
|
20
|
-
export {
|
|
21
|
-
xScalarEnvVarSchema,
|
|
22
|
-
xScalarEnvironmentSchema,
|
|
23
|
-
xScalarEnvironmentsSchema
|
|
24
|
-
};
|
|
25
|
-
//# sourceMappingURL=x-scalar-environments.js.map
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import { Type } from
|
|
2
|
-
const XScalarIconSchema = Type.Object({
|
|
3
|
-
|
|
1
|
+
import { Type } from '@scalar/typebox';
|
|
2
|
+
export const XScalarIconSchema = Type.Object({
|
|
3
|
+
'x-scalar-icon': Type.Optional(Type.String()),
|
|
4
4
|
});
|
|
5
|
-
export {
|
|
6
|
-
XScalarIconSchema
|
|
7
|
-
};
|
|
8
|
-
//# sourceMappingURL=x-scalar-icon.js.map
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import { Type } from
|
|
2
|
-
const XScalarIgnoreSchema = Type.Object({
|
|
3
|
-
|
|
1
|
+
import { Type } from '@scalar/typebox';
|
|
2
|
+
export const XScalarIgnoreSchema = Type.Object({
|
|
3
|
+
'x-scalar-ignore': Type.Optional(Type.Boolean()),
|
|
4
4
|
});
|
|
5
|
-
export {
|
|
6
|
-
XScalarIgnoreSchema
|
|
7
|
-
};
|
|
8
|
-
//# sourceMappingURL=x-scalar-ignore.js.map
|
|
@@ -1,9 +1,22 @@
|
|
|
1
|
-
import { Type } from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { Type } from '@scalar/typebox';
|
|
2
|
+
/**
|
|
3
|
+
* Schema for the "x-scalar-is-dirty" OpenAPI extension.
|
|
4
|
+
* This extension allows specifying an optional boolean value,
|
|
5
|
+
* which can be used to track if the document state is dirty.
|
|
6
|
+
*
|
|
7
|
+
* This is used to track if the document has been modified since it was last saved.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```yaml
|
|
11
|
+
* x-scalar-is-dirty: true
|
|
12
|
+
* ```
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```yaml
|
|
16
|
+
* x-scalar-is-dirty: false
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export const XScalarIsDirtySchema = Type.Object({
|
|
20
|
+
/** Whether the document state is dirty, this is used to track if the document has been modified since it was last saved */
|
|
21
|
+
'x-scalar-is-dirty': Type.Optional(Type.Boolean()),
|
|
5
22
|
});
|
|
6
|
-
export {
|
|
7
|
-
XScalarIsDirtySchema
|
|
8
|
-
};
|
|
9
|
-
//# sourceMappingURL=x-scalar-is-dirty.js.map
|
|
@@ -1,9 +1,18 @@
|
|
|
1
|
-
import { Type } from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { Type } from '@scalar/typebox';
|
|
2
|
+
/**
|
|
3
|
+
* Schema for the "x-scalar-original-document-hash" OpenAPI extension.
|
|
4
|
+
* This extension allows specifying an optional string value,
|
|
5
|
+
* which can be used to track the original document hash.
|
|
6
|
+
*
|
|
7
|
+
* This is used to track the original document hash when loading a document from an external source.
|
|
8
|
+
* Which can be helpful to track if the document has been modified since it was last saved.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```yaml
|
|
12
|
+
* x-scalar-original-document-hash: "1234567890"
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
export const XScalarOriginalDocumentHashSchema = Type.Object({
|
|
16
|
+
/** Original input document hash */
|
|
17
|
+
'x-scalar-original-document-hash': Type.String(),
|
|
5
18
|
});
|
|
6
|
-
export {
|
|
7
|
-
XScalarOriginalDocumentHashSchema
|
|
8
|
-
};
|
|
9
|
-
//# sourceMappingURL=x-scalar-original-document-hash.js.map
|
|
@@ -1,22 +1,16 @@
|
|
|
1
|
-
import { Type } from
|
|
2
|
-
const XScalarRegistryMetaSchema = Type.Object({
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
})
|
|
17
|
-
)
|
|
1
|
+
import { Type } from '@scalar/typebox';
|
|
2
|
+
export const XScalarRegistryMetaSchema = Type.Object({
|
|
3
|
+
/**
|
|
4
|
+
* The registry meta for the document.
|
|
5
|
+
*/
|
|
6
|
+
'x-scalar-registry-meta': Type.Optional(Type.Object({
|
|
7
|
+
/**
|
|
8
|
+
* The namespace under which this registry meta is scoped.
|
|
9
|
+
*/
|
|
10
|
+
'namespace': Type.String(),
|
|
11
|
+
/**
|
|
12
|
+
* A unique slug identifier for this registry meta within the namespace.
|
|
13
|
+
*/
|
|
14
|
+
'slug': Type.String(),
|
|
15
|
+
})),
|
|
18
16
|
});
|
|
19
|
-
export {
|
|
20
|
-
XScalarRegistryMetaSchema
|
|
21
|
-
};
|
|
22
|
-
//# sourceMappingURL=x-scalar-registry-meta.js.map
|
|
@@ -1,16 +1,8 @@
|
|
|
1
|
-
import { Type } from
|
|
2
|
-
const XScalarSdkInstallationSchema = Type.Object({
|
|
3
|
-
|
|
4
|
-
Type.Array(
|
|
5
|
-
Type.Object({
|
|
1
|
+
import { Type } from '@scalar/typebox';
|
|
2
|
+
export const XScalarSdkInstallationSchema = Type.Object({
|
|
3
|
+
'x-scalar-sdk-installation': Type.Optional(Type.Array(Type.Object({
|
|
6
4
|
lang: Type.String(),
|
|
7
5
|
source: Type.Optional(Type.String()),
|
|
8
|
-
description: Type.Optional(Type.String())
|
|
9
|
-
|
|
10
|
-
)
|
|
11
|
-
)
|
|
6
|
+
description: Type.Optional(Type.String()),
|
|
7
|
+
}))),
|
|
12
8
|
});
|
|
13
|
-
export {
|
|
14
|
-
XScalarSdkInstallationSchema
|
|
15
|
-
};
|
|
16
|
-
//# sourceMappingURL=x-scalar-sdk-installation.js.map
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
import { Type } from
|
|
2
|
-
const XScalarWatchModeSchema = Type.Object({
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { Type } from '@scalar/typebox';
|
|
2
|
+
export const XScalarWatchModeSchema = Type.Object({
|
|
3
|
+
/** Whether the document is in watch mode */
|
|
4
|
+
'x-scalar-watch-mode': Type.Optional(Type.Boolean()),
|
|
5
5
|
});
|
|
6
|
-
export {
|
|
7
|
-
XScalarWatchModeSchema
|
|
8
|
-
};
|
|
9
|
-
//# sourceMappingURL=x-scalar-watch-mode.js.map
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import { Type } from
|
|
2
|
-
const XTags = Type.Object({
|
|
3
|
-
|
|
1
|
+
import { Type } from '@scalar/typebox';
|
|
2
|
+
export const XTags = Type.Object({
|
|
3
|
+
'x-tags': Type.Optional(Type.Array(Type.String())),
|
|
4
4
|
});
|
|
5
|
-
export {
|
|
6
|
-
XTags
|
|
7
|
-
};
|
|
8
|
-
//# sourceMappingURL=x-tags.js.map
|
|
@@ -1,8 +1,18 @@
|
|
|
1
|
-
import { Type } from
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { Type } from '@scalar/typebox';
|
|
2
|
+
/**
|
|
3
|
+
* OpenAPI extension to control whether a parameter example is enabled (checkbox on) or disabled (checkbox off).
|
|
4
|
+
*
|
|
5
|
+
* This extension is typically used in API tools to determine if a parameter (such as a header, query, or cookie)
|
|
6
|
+
* should be included in the request when sending an example. If `x-disabled: true`, the parameter example is considered
|
|
7
|
+
* "off" (checkbox unchecked) and will not be sent with the request. If `x-disabled: false` or omitted, the parameter
|
|
8
|
+
* example is "on" (checkbox checked) and will be sent.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```yaml
|
|
12
|
+
* x-disabled: true # Do not send this parameter example in the request
|
|
13
|
+
* x-disabled: false # Send this parameter example in the request
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export const XDisabled = Type.Object({
|
|
17
|
+
'x-disabled': Type.Optional(Type.Boolean()),
|
|
4
18
|
});
|
|
5
|
-
export {
|
|
6
|
-
XDisabled
|
|
7
|
-
};
|
|
8
|
-
//# sourceMappingURL=x-disabled.js.map
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import { Type } from
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { Type } from '@scalar/typebox';
|
|
2
|
+
// Schema for the optional 'x-scalar-active-environment' extension property
|
|
3
|
+
export const XScalarActiveEnvironmentSchema = Type.Object({
|
|
4
|
+
'x-scalar-active-environment': Type.Optional(Type.String()),
|
|
4
5
|
});
|
|
5
|
-
export {
|
|
6
|
-
XScalarActiveEnvironmentSchema
|
|
7
|
-
};
|
|
8
|
-
//# sourceMappingURL=x-scalar-active-environment.js.map
|
|
@@ -1,16 +1,11 @@
|
|
|
1
|
-
import { Type } from
|
|
2
|
-
const xScalarCookieSchema = Type.Object({
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { Type } from '@scalar/typebox';
|
|
2
|
+
export const xScalarCookieSchema = Type.Object({
|
|
3
|
+
name: Type.String(),
|
|
4
|
+
value: Type.String(),
|
|
5
|
+
domain: Type.Optional(Type.String()),
|
|
6
|
+
path: Type.Optional(Type.String()),
|
|
7
|
+
isDisabled: Type.Optional(Type.Boolean()),
|
|
8
8
|
});
|
|
9
|
-
const xScalarCookiesSchema = Type.Object({
|
|
10
|
-
|
|
9
|
+
export const xScalarCookiesSchema = Type.Object({
|
|
10
|
+
'x-scalar-cookies': Type.Optional(Type.Array(xScalarCookieSchema)),
|
|
11
11
|
});
|
|
12
|
-
export {
|
|
13
|
-
xScalarCookieSchema,
|
|
14
|
-
xScalarCookiesSchema
|
|
15
|
-
};
|
|
16
|
-
//# sourceMappingURL=x-scalar-cookies.js.map
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { Type } from
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { Type } from '@scalar/typebox';
|
|
2
|
+
/**
|
|
3
|
+
* Schema for the "x-scalar-order" OpenAPI extension.
|
|
4
|
+
* This extension allows specifying an optional array of strings,
|
|
5
|
+
* which can be used to represent a custom order for elements (e.g., tags, operations) in the Scalar UI.
|
|
6
|
+
*/
|
|
7
|
+
export const XScalarOrderSchema = Type.Object({
|
|
8
|
+
'x-scalar-order': Type.Optional(Type.Array(Type.String())),
|
|
4
9
|
});
|
|
5
|
-
export {
|
|
6
|
-
XScalarOrderSchema
|
|
7
|
-
};
|
|
8
|
-
//# sourceMappingURL=x-scalar-order.js.map
|
|
@@ -1,23 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
} from
|
|
5
|
-
import {
|
|
6
|
-
XCodeSamplesSchema
|
|
7
|
-
} from "./x-code-samples.js";
|
|
8
|
-
import {
|
|
9
|
-
XScalarSelectedContentTypeSchema
|
|
10
|
-
} from "./x-scalar-selected-content-type.js";
|
|
11
|
-
import {
|
|
12
|
-
XScalarStabilitySchema,
|
|
13
|
-
XScalarStabilityValues
|
|
14
|
-
} from "./x-scalar-stability.js";
|
|
15
|
-
export {
|
|
16
|
-
XBadgeSchema,
|
|
17
|
-
XBadgesSchema,
|
|
18
|
-
XCodeSamplesSchema,
|
|
19
|
-
XScalarSelectedContentTypeSchema,
|
|
20
|
-
XScalarStabilitySchema,
|
|
21
|
-
XScalarStabilityValues
|
|
22
|
-
};
|
|
23
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
export { XBadgeSchema, XBadgesSchema, } from './x-badge.js';
|
|
2
|
+
export { XCodeSamplesSchema, } from './x-code-samples.js';
|
|
3
|
+
export { XScalarSelectedContentTypeSchema, } from './x-scalar-selected-content-type.js';
|
|
4
|
+
export { XScalarStabilitySchema, XScalarStabilityValues, } from './x-scalar-stability.js';
|