@scalar/workspace-store 0.12.0 → 0.14.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/CHANGELOG.md +54 -0
- package/dist/client.d.ts +252 -30
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +144 -277
- package/dist/client.js.map +2 -2
- package/dist/helpers/apply-selective-updates.d.ts +1 -1
- package/dist/helpers/apply-selective-updates.d.ts.map +1 -1
- package/dist/helpers/apply-selective-updates.js +1 -1
- package/dist/helpers/apply-selective-updates.js.map +2 -2
- package/dist/helpers/deep-clone.d.ts +21 -0
- package/dist/helpers/deep-clone.d.ts.map +1 -0
- package/dist/helpers/deep-clone.js +18 -0
- package/dist/helpers/deep-clone.js.map +7 -0
- package/dist/helpers/get-resolved-ref.d.ts +19 -0
- package/dist/helpers/get-resolved-ref.d.ts.map +1 -0
- package/dist/helpers/get-resolved-ref.js +13 -0
- package/dist/helpers/get-resolved-ref.js.map +7 -0
- package/dist/helpers/merge-object.d.ts +9 -1
- package/dist/helpers/merge-object.d.ts.map +1 -1
- package/dist/helpers/merge-object.js +10 -2
- package/dist/helpers/merge-object.js.map +2 -2
- package/dist/helpers/overrides-proxy.d.ts +43 -1
- package/dist/helpers/overrides-proxy.d.ts.map +1 -1
- package/dist/helpers/overrides-proxy.js +2 -2
- package/dist/helpers/overrides-proxy.js.map +2 -2
- package/dist/mutators/helpers.d.ts +2 -34830
- package/dist/mutators/helpers.d.ts.map +1 -1
- package/dist/mutators/helpers.js.map +2 -2
- package/dist/mutators/request-example.d.ts.map +1 -1
- package/dist/mutators/request-example.js +4 -7
- package/dist/mutators/request-example.js.map +2 -2
- package/dist/navigation/helpers/traverse-document.js +2 -2
- package/dist/navigation/helpers/traverse-document.js.map +2 -2
- package/dist/navigation/helpers/traverse-paths.d.ts.map +1 -1
- package/dist/navigation/helpers/traverse-paths.js +8 -5
- package/dist/navigation/helpers/traverse-paths.js.map +2 -2
- package/dist/navigation/helpers/traverse-schemas.d.ts.map +1 -1
- package/dist/navigation/helpers/traverse-schemas.js +8 -5
- package/dist/navigation/helpers/traverse-schemas.js.map +2 -2
- package/dist/navigation/helpers/traverse-webhooks.d.ts.map +1 -1
- package/dist/navigation/helpers/traverse-webhooks.js +9 -5
- package/dist/navigation/helpers/traverse-webhooks.js.map +2 -2
- package/dist/navigation/types.d.ts +3 -3
- package/dist/navigation/types.d.ts.map +1 -1
- package/dist/plugins.d.ts +93 -0
- package/dist/plugins.d.ts.map +1 -0
- package/dist/plugins.js +107 -0
- package/dist/plugins.js.map +7 -0
- package/dist/schemas/extensions/document/x-internal.d.ts +4 -0
- package/dist/schemas/extensions/document/x-internal.d.ts.map +1 -0
- package/dist/schemas/extensions/document/x-internal.js +8 -0
- package/dist/schemas/extensions/document/x-internal.js.map +7 -0
- package/dist/schemas/extensions/document/x-scalar-icon.d.ts +4 -0
- package/dist/schemas/extensions/document/x-scalar-icon.d.ts.map +1 -0
- package/dist/schemas/extensions/document/x-scalar-icon.js +8 -0
- package/dist/schemas/extensions/document/x-scalar-icon.js.map +7 -0
- package/dist/schemas/extensions/document/x-scalar-ignore.d.ts +4 -0
- package/dist/schemas/extensions/document/x-scalar-ignore.d.ts.map +1 -0
- package/dist/schemas/extensions/document/x-scalar-ignore.js +8 -0
- package/dist/schemas/extensions/document/x-scalar-ignore.js.map +7 -0
- package/dist/schemas/extensions/document/x-scalar-sdk-installation.d.ts +8 -0
- package/dist/schemas/extensions/document/x-scalar-sdk-installation.d.ts.map +1 -0
- package/dist/schemas/extensions/document/x-scalar-sdk-installation.js +16 -0
- package/dist/schemas/extensions/document/x-scalar-sdk-installation.js.map +7 -0
- package/dist/schemas/extensions/operation/x-badge.d.ts +58 -0
- package/dist/schemas/extensions/operation/x-badge.d.ts.map +1 -0
- package/dist/schemas/extensions/operation/x-badge.js +41 -0
- package/dist/schemas/extensions/operation/x-badge.js.map +7 -0
- package/dist/schemas/extensions/operation/x-code-samples.d.ts +23 -0
- package/dist/schemas/extensions/operation/x-code-samples.d.ts.map +1 -0
- package/dist/schemas/extensions/operation/x-code-samples.js +16 -0
- package/dist/schemas/extensions/operation/x-code-samples.js.map +7 -0
- package/dist/schemas/extensions/operation/x-post-response.d.ts +19 -0
- package/dist/schemas/extensions/operation/x-post-response.d.ts.map +1 -0
- package/dist/schemas/extensions/operation/x-post-response.js +8 -0
- package/dist/schemas/extensions/operation/x-post-response.js.map +7 -0
- package/dist/schemas/extensions/operation/x-scalar-stability.d.ts +18 -0
- package/dist/schemas/extensions/operation/x-scalar-stability.d.ts.map +1 -0
- package/dist/schemas/extensions/operation/x-scalar-stability.js +16 -0
- package/dist/schemas/extensions/operation/x-scalar-stability.js.map +7 -0
- package/dist/schemas/extensions/schema/x-additional-properties-name.d.ts +11 -0
- package/dist/schemas/extensions/schema/x-additional-properties-name.d.ts.map +1 -0
- package/dist/schemas/extensions/schema/x-additional-properties-name.js +8 -0
- package/dist/schemas/extensions/schema/x-additional-properties-name.js.map +7 -0
- package/dist/schemas/extensions/schema/x-enum-descriptions.d.ts +17 -0
- package/dist/schemas/extensions/schema/x-enum-descriptions.d.ts.map +1 -0
- package/dist/schemas/extensions/schema/x-enum-descriptions.js +8 -0
- package/dist/schemas/extensions/schema/x-enum-descriptions.js.map +7 -0
- package/dist/schemas/extensions/schema/x-variable.d.ts +4 -0
- package/dist/schemas/extensions/schema/x-variable.d.ts.map +1 -0
- package/dist/schemas/extensions/schema/x-variable.js +8 -0
- package/dist/schemas/extensions/schema/x-variable.js.map +7 -0
- package/dist/schemas/extensions/security/x-scalar-credentials-location.d.ts +17 -0
- package/dist/schemas/extensions/security/x-scalar-credentials-location.d.ts.map +1 -0
- package/dist/schemas/extensions/security/x-scalar-credentials-location.js +8 -0
- package/dist/schemas/extensions/security/x-scalar-credentials-location.js.map +7 -0
- package/dist/schemas/extensions/security/x-scalar-redirect-uri.d.ts +4 -0
- package/dist/schemas/extensions/security/x-scalar-redirect-uri.d.ts.map +1 -0
- package/dist/schemas/extensions/security/x-scalar-redirect-uri.js +8 -0
- package/dist/schemas/extensions/security/x-scalar-redirect-uri.js.map +7 -0
- package/dist/schemas/extensions/security/x-scalar-security-body.d.ts +15 -0
- package/dist/schemas/extensions/security/x-scalar-security-body.d.ts.map +1 -0
- package/dist/schemas/extensions/security/x-scalar-security-body.js +8 -0
- package/dist/schemas/extensions/security/x-scalar-security-body.js.map +7 -0
- package/dist/schemas/extensions/security/x-scalar-security-query.d.ts +15 -0
- package/dist/schemas/extensions/security/x-scalar-security-query.d.ts.map +1 -0
- package/dist/schemas/extensions/security/x-scalar-security-query.js +8 -0
- package/dist/schemas/extensions/security/x-scalar-security-query.js.map +7 -0
- package/dist/schemas/extensions/security/x-scalar-security-secrets.d.ts +18 -0
- package/dist/schemas/extensions/security/x-scalar-security-secrets.d.ts.map +1 -0
- package/dist/schemas/extensions/security/x-scalar-security-secrets.js +13 -0
- package/dist/schemas/extensions/security/x-scalar-security-secrets.js.map +7 -0
- package/dist/schemas/extensions/security/x-tokenName.d.ts +12 -0
- package/dist/schemas/extensions/security/x-tokenName.d.ts.map +1 -0
- package/dist/schemas/extensions/security/x-tokenName.js +8 -0
- package/dist/schemas/extensions/security/x-tokenName.js.map +7 -0
- package/dist/schemas/extensions/security/x-use-pkce.d.ts +7 -0
- package/dist/schemas/extensions/security/x-use-pkce.d.ts.map +1 -0
- package/dist/schemas/extensions/security/x-use-pkce.js +13 -0
- package/dist/schemas/extensions/security/x-use-pkce.js.map +7 -0
- package/dist/schemas/extensions/tag/x-display-name.d.ts +12 -0
- package/dist/schemas/extensions/tag/x-display-name.d.ts.map +1 -0
- package/dist/schemas/extensions/tag/x-display-name.js +8 -0
- package/dist/schemas/extensions/tag/x-display-name.js.map +7 -0
- package/dist/schemas/extensions/tag/x-tag-groups.d.ts +28 -0
- package/dist/schemas/extensions/tag/x-tag-groups.d.ts.map +1 -0
- package/dist/schemas/extensions/tag/x-tag-groups.js +19 -0
- package/dist/schemas/extensions/tag/x-tag-groups.js.map +7 -0
- package/dist/schemas/inmemory-workspace.d.ts +48 -5545
- package/dist/schemas/inmemory-workspace.d.ts.map +1 -1
- package/dist/schemas/inmemory-workspace.js +12 -3
- package/dist/schemas/inmemory-workspace.js.map +2 -2
- package/dist/schemas/reference-config/index.d.ts +12 -4
- package/dist/schemas/reference-config/index.d.ts.map +1 -1
- package/dist/schemas/reference-config/index.js +0 -6
- package/dist/schemas/reference-config/index.js.map +2 -2
- package/dist/schemas/reference-config/settings.d.ts +12 -1
- package/dist/schemas/reference-config/settings.d.ts.map +1 -1
- package/dist/schemas/reference-config/settings.js +9 -2
- package/dist/schemas/reference-config/settings.js.map +2 -2
- package/dist/schemas/typebox-coerce.d.ts.map +1 -1
- package/dist/schemas/typebox-coerce.js +1 -3
- package/dist/schemas/typebox-coerce.js.map +2 -2
- package/dist/schemas/v3.1/loose/callback.d.ts +10 -0
- package/dist/schemas/v3.1/loose/callback.d.ts.map +1 -0
- package/dist/schemas/v3.1/loose/callback.js +11 -0
- package/dist/schemas/v3.1/loose/callback.js.map +7 -0
- package/dist/schemas/v3.1/loose/client-config-extensions/x-scalar-client-config-cookies.d.ts +16 -0
- package/dist/schemas/v3.1/loose/client-config-extensions/x-scalar-client-config-cookies.d.ts.map +1 -0
- package/dist/schemas/v3.1/loose/client-config-extensions/x-scalar-client-config-cookies.js +13 -0
- package/dist/schemas/v3.1/loose/client-config-extensions/x-scalar-client-config-cookies.js.map +7 -0
- package/dist/schemas/v3.1/loose/client-config-extensions/x-scalar-client-config-environments.d.ts +27 -0
- package/dist/schemas/v3.1/loose/client-config-extensions/x-scalar-client-config-environments.d.ts.map +1 -0
- package/dist/schemas/v3.1/loose/client-config-extensions/x-scalar-client-config-environments.js +23 -0
- package/dist/schemas/v3.1/loose/client-config-extensions/x-scalar-client-config-environments.js.map +7 -0
- package/dist/schemas/v3.1/loose/client-config-extensions/x-scalar-client-config-request-example.d.ts +38 -0
- package/dist/schemas/v3.1/loose/client-config-extensions/x-scalar-client-config-request-example.d.ts.map +1 -0
- package/dist/schemas/v3.1/loose/client-config-extensions/x-scalar-client-config-request-example.js +45 -0
- package/dist/schemas/v3.1/loose/client-config-extensions/x-scalar-client-config-request-example.js.map +7 -0
- package/dist/schemas/v3.1/loose/components.d.ts +43 -0
- package/dist/schemas/v3.1/loose/components.d.ts.map +1 -0
- package/dist/schemas/v3.1/loose/components.js +41 -0
- package/dist/schemas/v3.1/loose/components.js.map +7 -0
- package/dist/schemas/v3.1/loose/contact.d.ts +10 -0
- package/dist/schemas/v3.1/loose/contact.d.ts.map +1 -0
- package/dist/schemas/v3.1/loose/contact.js +13 -0
- package/dist/schemas/v3.1/loose/contact.js.map +7 -0
- package/dist/schemas/v3.1/loose/discriminator.d.ts +12 -0
- package/dist/schemas/v3.1/loose/discriminator.d.ts.map +1 -0
- package/dist/schemas/v3.1/loose/discriminator.js +11 -0
- package/dist/schemas/v3.1/loose/discriminator.js.map +7 -0
- package/dist/schemas/v3.1/loose/encoding.d.ts +15 -0
- package/dist/schemas/v3.1/loose/encoding.d.ts.map +1 -0
- package/dist/schemas/v3.1/loose/encoding.js +12 -0
- package/dist/schemas/v3.1/loose/encoding.js.map +7 -0
- package/dist/schemas/v3.1/loose/example.d.ts +16 -0
- package/dist/schemas/v3.1/loose/example.d.ts.map +1 -0
- package/dist/schemas/v3.1/loose/example.js +15 -0
- package/dist/schemas/v3.1/loose/example.js.map +7 -0
- package/dist/schemas/v3.1/loose/external-documentation.d.ts +8 -0
- package/dist/schemas/v3.1/loose/external-documentation.d.ts.map +1 -0
- package/dist/schemas/v3.1/loose/external-documentation.js +11 -0
- package/dist/schemas/v3.1/loose/external-documentation.js.map +7 -0
- package/dist/schemas/v3.1/loose/header.d.ts +355 -0
- package/dist/schemas/v3.1/loose/header.d.ts.map +1 -0
- package/dist/schemas/v3.1/loose/header.js +43 -0
- package/dist/schemas/v3.1/loose/header.js.map +7 -0
- package/dist/schemas/v3.1/loose/info.d.ts +48 -0
- package/dist/schemas/v3.1/loose/info.d.ts.map +1 -0
- package/dist/schemas/v3.1/loose/info.js +29 -0
- package/dist/schemas/v3.1/loose/info.js.map +7 -0
- package/dist/schemas/v3.1/loose/license.d.ts +10 -0
- package/dist/schemas/v3.1/loose/license.d.ts.map +1 -0
- package/dist/schemas/v3.1/loose/license.js +13 -0
- package/dist/schemas/v3.1/loose/license.js.map +7 -0
- package/dist/schemas/v3.1/loose/link.d.ts +30 -0
- package/dist/schemas/v3.1/loose/link.d.ts.map +1 -0
- package/dist/schemas/v3.1/loose/link.js +20 -0
- package/dist/schemas/v3.1/loose/link.js.map +7 -0
- package/dist/schemas/v3.1/loose/media-header-encoding.d.ts +1012 -0
- package/dist/schemas/v3.1/loose/media-header-encoding.d.ts.map +1 -0
- package/dist/schemas/v3.1/loose/media-header-encoding.js +19 -0
- package/dist/schemas/v3.1/loose/media-header-encoding.js.map +7 -0
- package/dist/schemas/v3.1/loose/media-type.d.ts +161 -0
- package/dist/schemas/v3.1/loose/media-type.d.ts.map +1 -0
- package/dist/schemas/v3.1/loose/media-type.js +18 -0
- package/dist/schemas/v3.1/loose/media-type.js.map +7 -0
- package/dist/schemas/v3.1/loose/oauth-flow.d.ts +95 -0
- package/dist/schemas/v3.1/loose/oauth-flow.d.ts.map +1 -0
- package/dist/schemas/v3.1/loose/oauth-flow.js +57 -0
- package/dist/schemas/v3.1/loose/oauth-flow.js.map +7 -0
- package/dist/schemas/v3.1/loose/oauthflows.d.ts +43 -0
- package/dist/schemas/v3.1/loose/oauthflows.d.ts.map +1 -0
- package/dist/schemas/v3.1/loose/oauthflows.js +21 -0
- package/dist/schemas/v3.1/loose/oauthflows.js.map +7 -0
- package/dist/schemas/v3.1/loose/openapi-document.d.ts +115 -0
- package/dist/schemas/v3.1/loose/openapi-document.d.ts.map +1 -0
- package/dist/schemas/v3.1/loose/openapi-document.js +64 -0
- package/dist/schemas/v3.1/loose/openapi-document.js.map +7 -0
- package/dist/schemas/v3.1/loose/operation.d.ts +1645 -0
- package/dist/schemas/v3.1/loose/operation.d.ts.map +1 -0
- package/dist/schemas/v3.1/loose/operation.js +61 -0
- package/dist/schemas/v3.1/loose/operation.js.map +7 -0
- package/dist/schemas/v3.1/loose/parameter.d.ts +1074 -0
- package/dist/schemas/v3.1/loose/parameter.d.ts.map +1 -0
- package/dist/schemas/v3.1/loose/parameter.js +54 -0
- package/dist/schemas/v3.1/loose/parameter.js.map +7 -0
- package/dist/schemas/v3.1/loose/path-item.d.ts +551 -0
- package/dist/schemas/v3.1/loose/path-item.d.ts.map +1 -0
- package/dist/schemas/v3.1/loose/path-item.js +42 -0
- package/dist/schemas/v3.1/loose/path-item.js.map +7 -0
- package/dist/schemas/v3.1/loose/path-operations.d.ts +2196 -0
- package/dist/schemas/v3.1/loose/path-operations.d.ts.map +1 -0
- package/dist/schemas/v3.1/loose/path-operations.js +21 -0
- package/dist/schemas/v3.1/loose/path-operations.js.map +7 -0
- package/dist/schemas/v3.1/loose/paths.d.ts +20 -0
- package/dist/schemas/v3.1/loose/paths.d.ts.map +1 -0
- package/dist/schemas/v3.1/loose/paths.js +11 -0
- package/dist/schemas/v3.1/loose/paths.js.map +7 -0
- package/dist/schemas/v3.1/loose/reference.d.ts +26 -0
- package/dist/schemas/v3.1/loose/reference.d.ts.map +1 -0
- package/dist/schemas/v3.1/loose/reference.js +24 -0
- package/dist/schemas/v3.1/loose/reference.js.map +7 -0
- package/dist/schemas/v3.1/loose/request-body.d.ts +339 -0
- package/dist/schemas/v3.1/loose/request-body.d.ts.map +1 -0
- package/dist/schemas/v3.1/loose/request-body.js +14 -0
- package/dist/schemas/v3.1/loose/request-body.js.map +7 -0
- package/dist/schemas/v3.1/loose/response.d.ts +698 -0
- package/dist/schemas/v3.1/loose/response.d.ts.map +1 -0
- package/dist/schemas/v3.1/loose/response.js +18 -0
- package/dist/schemas/v3.1/loose/response.js.map +7 -0
- package/dist/schemas/v3.1/loose/responses.d.ts +710 -0
- package/dist/schemas/v3.1/loose/responses.d.ts.map +1 -0
- package/dist/schemas/v3.1/loose/responses.js +11 -0
- package/dist/schemas/v3.1/loose/responses.js.map +7 -0
- package/dist/schemas/v3.1/loose/schema.d.ts +373 -0
- package/dist/schemas/v3.1/loose/schema.d.ts.map +1 -0
- package/dist/schemas/v3.1/loose/schema.js +146 -0
- package/dist/schemas/v3.1/loose/schema.js.map +7 -0
- package/dist/schemas/v3.1/loose/security-requirement.d.ts +11 -0
- package/dist/schemas/v3.1/loose/security-requirement.d.ts.map +1 -0
- package/dist/schemas/v3.1/loose/security-requirement.js +10 -0
- package/dist/schemas/v3.1/loose/security-requirement.js.map +7 -0
- package/dist/schemas/v3.1/loose/security-scheme.d.ts +169 -0
- package/dist/schemas/v3.1/loose/security-scheme.d.ts.map +1 -0
- package/dist/schemas/v3.1/loose/security-scheme.js +64 -0
- package/dist/schemas/v3.1/loose/security-scheme.js.map +7 -0
- package/dist/schemas/v3.1/loose/server-variable.d.ts +10 -0
- package/dist/schemas/v3.1/loose/server-variable.d.ts.map +1 -0
- package/dist/schemas/v3.1/loose/server-variable.js +13 -0
- package/dist/schemas/v3.1/loose/server-variable.js.map +7 -0
- package/dist/schemas/v3.1/loose/server.d.ts +14 -0
- package/dist/schemas/v3.1/loose/server.d.ts.map +1 -0
- package/dist/schemas/v3.1/loose/server.js +14 -0
- package/dist/schemas/v3.1/loose/server.js.map +7 -0
- package/dist/schemas/v3.1/loose/tag.d.ts +19 -0
- package/dist/schemas/v3.1/loose/tag.d.ts.map +1 -0
- package/dist/schemas/v3.1/loose/tag.js +23 -0
- package/dist/schemas/v3.1/loose/tag.js.map +7 -0
- package/dist/schemas/v3.1/loose/xml.d.ts +18 -0
- package/dist/schemas/v3.1/loose/xml.d.ts.map +1 -0
- package/dist/schemas/v3.1/loose/xml.js +17 -0
- package/dist/schemas/v3.1/loose/xml.js.map +7 -0
- package/dist/schemas/v3.1/strict/callback.d.ts +1 -8
- package/dist/schemas/v3.1/strict/callback.d.ts.map +1 -1
- package/dist/schemas/v3.1/strict/callback.js +5 -10
- package/dist/schemas/v3.1/strict/callback.js.map +2 -2
- package/dist/schemas/v3.1/strict/components.d.ts +24 -28
- package/dist/schemas/v3.1/strict/components.d.ts.map +1 -1
- package/dist/schemas/v3.1/strict/components.js +35 -32
- package/dist/schemas/v3.1/strict/components.js.map +2 -2
- package/dist/schemas/v3.1/strict/contact.d.ts +2 -2
- package/dist/schemas/v3.1/strict/contact.d.ts.map +1 -1
- package/dist/schemas/v3.1/strict/contact.js +8 -13
- package/dist/schemas/v3.1/strict/contact.js.map +2 -2
- package/dist/schemas/v3.1/strict/discriminator.d.ts +2 -2
- package/dist/schemas/v3.1/strict/discriminator.d.ts.map +1 -1
- package/dist/schemas/v3.1/strict/discriminator.js +6 -11
- package/dist/schemas/v3.1/strict/discriminator.js.map +2 -2
- package/dist/schemas/v3.1/strict/encoding.d.ts +3 -10
- package/dist/schemas/v3.1/strict/encoding.d.ts.map +1 -1
- package/dist/schemas/v3.1/strict/encoding.js +7 -12
- package/dist/schemas/v3.1/strict/encoding.js.map +2 -2
- package/dist/schemas/v3.1/strict/example.d.ts +2 -2
- package/dist/schemas/v3.1/strict/example.d.ts.map +1 -1
- package/dist/schemas/v3.1/strict/example.js +10 -15
- package/dist/schemas/v3.1/strict/example.js.map +2 -2
- package/dist/schemas/v3.1/strict/external-documentation.d.ts +2 -2
- package/dist/schemas/v3.1/strict/external-documentation.d.ts.map +1 -1
- package/dist/schemas/v3.1/strict/external-documentation.js +6 -11
- package/dist/schemas/v3.1/strict/external-documentation.js.map +2 -2
- package/dist/schemas/v3.1/strict/header.d.ts +292 -54
- package/dist/schemas/v3.1/strict/header.d.ts.map +1 -1
- package/dist/schemas/v3.1/strict/header.js +14 -17
- package/dist/schemas/v3.1/strict/header.js.map +2 -2
- package/dist/schemas/v3.1/strict/info.d.ts +11 -5
- package/dist/schemas/v3.1/strict/info.d.ts.map +1 -1
- package/dist/schemas/v3.1/strict/info.js +2 -2
- package/dist/schemas/v3.1/strict/info.js.map +2 -2
- package/dist/schemas/v3.1/strict/license.d.ts +2 -2
- package/dist/schemas/v3.1/strict/license.d.ts.map +1 -1
- package/dist/schemas/v3.1/strict/license.js +8 -13
- package/dist/schemas/v3.1/strict/license.js.map +2 -2
- package/dist/schemas/v3.1/strict/link.d.ts +6 -6
- package/dist/schemas/v3.1/strict/link.d.ts.map +1 -1
- package/dist/schemas/v3.1/strict/link.js +14 -19
- package/dist/schemas/v3.1/strict/link.js.map +2 -2
- package/dist/schemas/v3.1/strict/media-header-encoding.d.ts +1389 -164
- package/dist/schemas/v3.1/strict/media-header-encoding.d.ts.map +1 -1
- package/dist/schemas/v3.1/strict/media-type.d.ts +145 -19
- package/dist/schemas/v3.1/strict/media-type.d.ts.map +1 -1
- package/dist/schemas/v3.1/strict/media-type.js +13 -20
- package/dist/schemas/v3.1/strict/media-type.js.map +2 -2
- package/dist/schemas/v3.1/strict/oauth-flow.d.ts +24 -8
- package/dist/schemas/v3.1/strict/oauth-flow.d.ts.map +1 -1
- package/dist/schemas/v3.1/strict/oauth-flow.js +9 -9
- package/dist/schemas/v3.1/strict/oauth-flow.js.map +2 -2
- package/dist/schemas/v3.1/strict/oauthflows.d.ts +12 -4
- package/dist/schemas/v3.1/strict/oauthflows.d.ts.map +1 -1
- package/dist/schemas/v3.1/strict/oauthflows.js +10 -13
- package/dist/schemas/v3.1/strict/oauthflows.js.map +2 -2
- package/dist/schemas/v3.1/strict/openapi-document.d.ts +7 -5
- package/dist/schemas/v3.1/strict/openapi-document.d.ts.map +1 -1
- package/dist/schemas/v3.1/strict/openapi-document.js +0 -2
- package/dist/schemas/v3.1/strict/openapi-document.js.map +2 -2
- package/dist/schemas/v3.1/strict/operation.d.ts +4711 -343
- package/dist/schemas/v3.1/strict/operation.d.ts.map +1 -1
- package/dist/schemas/v3.1/strict/operation.js +40 -35
- package/dist/schemas/v3.1/strict/operation.js.map +2 -2
- package/dist/schemas/v3.1/strict/parameter.d.ts +1226 -164
- package/dist/schemas/v3.1/strict/parameter.d.ts.map +1 -1
- package/dist/schemas/v3.1/strict/parameter.js +23 -25
- package/dist/schemas/v3.1/strict/parameter.js.map +2 -2
- package/dist/schemas/v3.1/strict/path-item.d.ts +1320 -102
- package/dist/schemas/v3.1/strict/path-item.d.ts.map +1 -1
- package/dist/schemas/v3.1/strict/path-item.js +35 -40
- package/dist/schemas/v3.1/strict/path-item.js.map +2 -2
- package/dist/schemas/v3.1/strict/path-operations.d.ts +10601 -11739
- package/dist/schemas/v3.1/strict/path-operations.d.ts.map +1 -1
- package/dist/schemas/v3.1/strict/path-operations.js +3 -1
- package/dist/schemas/v3.1/strict/path-operations.js.map +2 -2
- package/dist/schemas/v3.1/strict/paths.d.ts +3 -5514
- package/dist/schemas/v3.1/strict/paths.d.ts.map +1 -1
- package/dist/schemas/v3.1/strict/paths.js +4 -9
- package/dist/schemas/v3.1/strict/paths.js.map +2 -2
- package/dist/schemas/v3.1/strict/reference.d.ts +12 -5
- package/dist/schemas/v3.1/strict/reference.d.ts.map +1 -1
- package/dist/schemas/v3.1/strict/reference.js +4 -4
- package/dist/schemas/v3.1/strict/reference.js.map +2 -2
- package/dist/schemas/v3.1/strict/request-body.d.ts +468 -56
- package/dist/schemas/v3.1/strict/request-body.d.ts.map +1 -1
- package/dist/schemas/v3.1/strict/request-body.js +8 -13
- package/dist/schemas/v3.1/strict/request-body.js.map +2 -2
- package/dist/schemas/v3.1/strict/response.d.ts +1121 -130
- package/dist/schemas/v3.1/strict/response.d.ts.map +1 -1
- package/dist/schemas/v3.1/strict/response.js +11 -16
- package/dist/schemas/v3.1/strict/response.js.map +2 -2
- package/dist/schemas/v3.1/strict/responses.d.ts +2352 -139
- package/dist/schemas/v3.1/strict/responses.d.ts.map +1 -1
- package/dist/schemas/v3.1/strict/responses.js +4 -6
- package/dist/schemas/v3.1/strict/responses.js.map +2 -2
- package/dist/schemas/v3.1/strict/schema.d.ts +232 -15
- package/dist/schemas/v3.1/strict/schema.d.ts.map +1 -1
- package/dist/schemas/v3.1/strict/schema.js +206 -31
- package/dist/schemas/v3.1/strict/schema.js.map +2 -2
- package/dist/schemas/v3.1/strict/security-requirement.d.ts +1 -1
- package/dist/schemas/v3.1/strict/security-requirement.d.ts.map +1 -1
- package/dist/schemas/v3.1/strict/security-requirement.js +4 -9
- package/dist/schemas/v3.1/strict/security-requirement.js.map +2 -2
- package/dist/schemas/v3.1/strict/security-scheme.d.ts +56 -26
- package/dist/schemas/v3.1/strict/security-scheme.d.ts.map +1 -1
- package/dist/schemas/v3.1/strict/security-scheme.js +11 -8
- package/dist/schemas/v3.1/strict/security-scheme.js.map +2 -2
- package/dist/schemas/v3.1/strict/server-variable.d.ts +2 -2
- package/dist/schemas/v3.1/strict/server-variable.d.ts.map +1 -1
- package/dist/schemas/v3.1/strict/server-variable.js +8 -13
- package/dist/schemas/v3.1/strict/server-variable.js.map +2 -2
- package/dist/schemas/v3.1/strict/server.d.ts +4 -4
- package/dist/schemas/v3.1/strict/server.d.ts.map +1 -1
- package/dist/schemas/v3.1/strict/server.js +8 -13
- package/dist/schemas/v3.1/strict/server.js.map +2 -2
- package/dist/schemas/v3.1/strict/tag.d.ts +7 -3
- package/dist/schemas/v3.1/strict/tag.d.ts.map +1 -1
- package/dist/schemas/v3.1/strict/tag.js +6 -8
- package/dist/schemas/v3.1/strict/tag.js.map +2 -2
- package/dist/schemas/v3.1/strict/xml.d.ts +2 -2
- package/dist/schemas/v3.1/strict/xml.d.ts.map +1 -1
- package/dist/schemas/v3.1/strict/xml.js +12 -17
- package/dist/schemas/v3.1/strict/xml.js.map +2 -2
- package/dist/schemas/workspace-specification/config.d.ts +10 -2
- package/dist/schemas/workspace-specification/config.d.ts.map +1 -1
- package/dist/schemas/workspace-specification/index.d.ts +39 -13
- package/dist/schemas/workspace-specification/index.d.ts.map +1 -1
- package/dist/schemas/workspace.d.ts +63 -34
- package/dist/schemas/workspace.d.ts.map +1 -1
- package/dist/schemas/workspace.js +1 -0
- package/dist/schemas/workspace.js.map +2 -2
- package/dist/server.d.ts +2 -3290
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js.map +2 -2
- package/dist/types.d.ts +0 -6
- package/dist/types.d.ts.map +1 -1
- package/package.json +17 -11
- package/dist/schemas/v3.1/strict/extensions.d.ts +0 -4
- package/dist/schemas/v3.1/strict/extensions.d.ts.map +0 -1
- package/dist/schemas/v3.1/strict/extensions.js +0 -6
- package/dist/schemas/v3.1/strict/extensions.js.map +0 -7
- package/dist/schemas/v3.1/type-guard.d.ts +0 -10
- package/dist/schemas/v3.1/type-guard.d.ts.map +0 -1
- package/dist/schemas/v3.1/type-guard.js +0 -7
- package/dist/schemas/v3.1/type-guard.js.map +0 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,59 @@
|
|
|
1
1
|
# @scalar/workspace-store
|
|
2
2
|
|
|
3
|
+
## 0.14.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- b93e1fe: feat(workspace-store): support relative external references
|
|
8
|
+
- 5208f06: feat(workspace-store): validate that the bundle produces valid openapi document
|
|
9
|
+
- 4d509fb: feat(workspace-store): use the configuration fetcher to bundle the document
|
|
10
|
+
- 9be6eec: feat(workspace-store): preprocess documents to make them compliant
|
|
11
|
+
- c4bf497: fix(workspace-store): correctly propagate documents from one state to the other
|
|
12
|
+
- d8adbed: feat(workspace-store): resolve multi level refs
|
|
13
|
+
- 0c80ef0: feat(json-magic): change the way we resolve refs
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- bbef120: fix: remove extra coerces and cleanUp plugin from bundler
|
|
18
|
+
- a1429ca: chore: move to new extensions system for better type safety
|
|
19
|
+
- 66b18fc: feat: update the references to handle $refs from the magic proxy
|
|
20
|
+
- 0fcd446: feat(workspace-store): performance improvements
|
|
21
|
+
- c838a3f: chore: added measurements to workspace store
|
|
22
|
+
- Updated dependencies [b93e1fe]
|
|
23
|
+
- Updated dependencies [d4adeba]
|
|
24
|
+
- Updated dependencies [66b18fc]
|
|
25
|
+
- Updated dependencies [5f022b5]
|
|
26
|
+
- Updated dependencies [0fcd446]
|
|
27
|
+
- Updated dependencies [6a88108]
|
|
28
|
+
- Updated dependencies [c418e92]
|
|
29
|
+
- Updated dependencies [c4bf497]
|
|
30
|
+
- Updated dependencies [d8adbed]
|
|
31
|
+
- Updated dependencies [0c80ef0]
|
|
32
|
+
- @scalar/json-magic@0.3.0
|
|
33
|
+
- @scalar/openapi-parser@0.20.0
|
|
34
|
+
- @scalar/helpers@0.0.8
|
|
35
|
+
- @scalar/types@0.2.12
|
|
36
|
+
- @scalar/code-highlight@0.1.9
|
|
37
|
+
|
|
38
|
+
## 0.13.0
|
|
39
|
+
|
|
40
|
+
### Minor Changes
|
|
41
|
+
|
|
42
|
+
- 0d502cb: chore(workspace-store): clean up client store
|
|
43
|
+
- 0afc40c: feat(json-magic): introduce type-safe apply function with tracked target type in diff results
|
|
44
|
+
- 128af48: feat(workspace-store, json-magic): support `externalValue` fields on example object
|
|
45
|
+
|
|
46
|
+
### Patch Changes
|
|
47
|
+
|
|
48
|
+
- Updated dependencies [e203e90]
|
|
49
|
+
- Updated dependencies [0afc40c]
|
|
50
|
+
- Updated dependencies [128af48]
|
|
51
|
+
- @scalar/openapi-parser@0.19.1
|
|
52
|
+
- @scalar/json-magic@0.2.0
|
|
53
|
+
- @scalar/code-highlight@0.1.9
|
|
54
|
+
- @scalar/helpers@0.0.7
|
|
55
|
+
- @scalar/types@0.2.11
|
|
56
|
+
|
|
3
57
|
## 0.12.0
|
|
4
58
|
|
|
5
59
|
### Minor Changes
|
package/dist/client.d.ts
CHANGED
|
@@ -1,25 +1,56 @@
|
|
|
1
|
-
import type { DeepPartial, DeepRequired } from './types.js';
|
|
2
|
-
import { type createNavigationOptions } from './navigation/index.js';
|
|
3
|
-
import { type OpenApiDocument } from './schemas/v3.1/strict/openapi-document.js';
|
|
4
1
|
import type { Config } from './schemas/workspace-specification/config.js';
|
|
2
|
+
import { type InMemoryWorkspace } from './schemas/inmemory-workspace.js';
|
|
5
3
|
import type { WorkspaceSpecification } from './schemas/workspace-specification/index.js';
|
|
6
4
|
import type { Workspace, WorkspaceDocumentMeta, WorkspaceMeta } from './schemas/workspace.js';
|
|
7
5
|
import { merge, type Difference } from '@scalar/json-magic/diff';
|
|
6
|
+
import type { TraverseSpecOptions } from './navigation/types.js';
|
|
7
|
+
import type { PartialDeep, RequiredDeep } from 'type-fest';
|
|
8
|
+
export type DocumentConfiguration = Config & PartialDeep<{
|
|
9
|
+
'x-scalar-reference-config': {
|
|
10
|
+
tagSort: TraverseSpecOptions['tagsSorter'];
|
|
11
|
+
operationsSorter: TraverseSpecOptions['operationsSorter'];
|
|
12
|
+
getHeadingId: TraverseSpecOptions['getHeadingId'];
|
|
13
|
+
getOperationId: TraverseSpecOptions['getOperationId'];
|
|
14
|
+
getWebhookId: TraverseSpecOptions['getWebhookId'];
|
|
15
|
+
getModelId: TraverseSpecOptions['getModelId'];
|
|
16
|
+
getTagId: TraverseSpecOptions['getTagId'];
|
|
17
|
+
generateOperationSlug?: (details: {
|
|
18
|
+
path: string;
|
|
19
|
+
operationId?: string;
|
|
20
|
+
method: string;
|
|
21
|
+
summary?: string;
|
|
22
|
+
}) => string;
|
|
23
|
+
generateHeadingSlug?: (details: {
|
|
24
|
+
slug?: string;
|
|
25
|
+
}) => string;
|
|
26
|
+
generateTagSlug?: (details: {
|
|
27
|
+
name?: string;
|
|
28
|
+
}) => string;
|
|
29
|
+
generateModelSlug?: (details: {
|
|
30
|
+
name?: string;
|
|
31
|
+
}) => string;
|
|
32
|
+
generateWebhookSlug?: (details: {
|
|
33
|
+
name: string;
|
|
34
|
+
method: string;
|
|
35
|
+
}) => string;
|
|
36
|
+
};
|
|
37
|
+
}>;
|
|
38
|
+
declare const defaultConfig: RequiredDeep<Config>;
|
|
8
39
|
/**
|
|
9
40
|
* Input type for workspace document metadata and configuration.
|
|
10
41
|
* This type defines the required and optional fields for initializing a document in the workspace.
|
|
11
|
-
*
|
|
12
|
-
* TODO: merge navigation options with the document config
|
|
13
42
|
*/
|
|
14
43
|
type WorkspaceDocumentMetaInput = {
|
|
15
44
|
/** Optional metadata about the document like title, description, etc */
|
|
16
45
|
meta?: WorkspaceDocumentMeta;
|
|
17
46
|
/** Required unique identifier for the document */
|
|
18
47
|
name: string;
|
|
19
|
-
/** Optional configuration
|
|
20
|
-
config?:
|
|
48
|
+
/** Optional configuration options */
|
|
49
|
+
config?: DocumentConfiguration;
|
|
21
50
|
/** Overrides for the document */
|
|
22
|
-
overrides?:
|
|
51
|
+
overrides?: InMemoryWorkspace['overrides'][string];
|
|
52
|
+
/** Optional custom fetch implementation to use when retrieving the document. By default the global fetch implementation will be used */
|
|
53
|
+
fetch?: (input: string | URL | globalThis.Request, init?: RequestInit) => Promise<Response>;
|
|
23
54
|
};
|
|
24
55
|
/**
|
|
25
56
|
* Represents a document that is loaded from a URL.
|
|
@@ -28,8 +59,6 @@ type WorkspaceDocumentMetaInput = {
|
|
|
28
59
|
export type UrlDoc = {
|
|
29
60
|
/** URL to fetch the OpenAPI document from */
|
|
30
61
|
url: string;
|
|
31
|
-
/** Optional custom fetch implementation to use when retrieving the document. By default the global fetch implementation will be used */
|
|
32
|
-
fetch?: (input: string | URL | globalThis.Request, init?: RequestInit) => Promise<Response>;
|
|
33
62
|
} & WorkspaceDocumentMetaInput;
|
|
34
63
|
/** Represents a document that is provided directly as an object rather than loaded from a URL */
|
|
35
64
|
export type ObjectDoc = {
|
|
@@ -42,7 +71,6 @@ export type ObjectDoc = {
|
|
|
42
71
|
* - ObjectDoc: Direct document object with metadata
|
|
43
72
|
*/
|
|
44
73
|
export type WorkspaceDocumentInput = UrlDoc | ObjectDoc;
|
|
45
|
-
declare const defaultConfig: DeepRequired<Config>;
|
|
46
74
|
/**
|
|
47
75
|
* Configuration object for initializing a workspace store.
|
|
48
76
|
* Defines the initial state and documents for the workspace.
|
|
@@ -52,6 +80,8 @@ type WorkspaceProps = {
|
|
|
52
80
|
meta?: WorkspaceMeta;
|
|
53
81
|
/** Workspace configuration */
|
|
54
82
|
config?: Config;
|
|
83
|
+
/** Fetch function for retrieving documents */
|
|
84
|
+
fetch?: WorkspaceDocumentInput['fetch'];
|
|
55
85
|
};
|
|
56
86
|
/**
|
|
57
87
|
* Type definition for the workspace store return object.
|
|
@@ -60,36 +90,228 @@ type WorkspaceProps = {
|
|
|
60
90
|
* @see https://github.com/microsoft/TypeScript/issues/43817#issuecomment-827746462
|
|
61
91
|
*/
|
|
62
92
|
export type WorkspaceStore = {
|
|
63
|
-
/**
|
|
93
|
+
/**
|
|
94
|
+
* Returns the reactive workspace object with an additional activeDocument getter
|
|
95
|
+
*/
|
|
64
96
|
readonly workspace: Workspace;
|
|
65
|
-
/**
|
|
97
|
+
/**
|
|
98
|
+
* Updates a specific metadata field in the workspace
|
|
99
|
+
* @param key - The metadata field to update
|
|
100
|
+
* @param value - The new value for the field
|
|
101
|
+
* @example
|
|
102
|
+
* // Update the workspace title
|
|
103
|
+
* update('x-scalar-active-document', 'document-name')
|
|
104
|
+
*/
|
|
66
105
|
update<K extends keyof WorkspaceMeta>(key: K, value: WorkspaceMeta[K]): void;
|
|
67
|
-
/**
|
|
106
|
+
/**
|
|
107
|
+
* Updates a specific metadata field in a document
|
|
108
|
+
* @param name - The name of the document to update ('active' or a specific document name)
|
|
109
|
+
* @param key - The metadata field to update
|
|
110
|
+
* @param value - The new value for the field
|
|
111
|
+
* @throws Error if the specified document doesn't exist
|
|
112
|
+
* @example
|
|
113
|
+
* // Update the auth of the active document
|
|
114
|
+
* updateDocument('active', 'x-scalar-active-auth', 'Bearer')
|
|
115
|
+
* // Update the auth of a specific document
|
|
116
|
+
* updateDocument('document-name', 'x-scalar-active-auth', 'Bearer')
|
|
117
|
+
*/
|
|
68
118
|
updateDocument<K extends keyof WorkspaceDocumentMeta>(name: 'active' | (string & {}), key: K, value: WorkspaceDocumentMeta[K]): void;
|
|
69
|
-
/**
|
|
70
|
-
|
|
71
|
-
|
|
119
|
+
/**
|
|
120
|
+
* Replaces the content of a specific document in the workspace with the provided input.
|
|
121
|
+
* This method computes the difference between the current document and the new input,
|
|
122
|
+
* then applies only the necessary changes in place. The updates are applied atomically,
|
|
123
|
+
* ensuring the document is updated in a single operation.
|
|
124
|
+
*
|
|
125
|
+
* @param documentName - The name of the document to update.
|
|
126
|
+
* @param input - The new content to apply to the document (as a plain object).
|
|
127
|
+
* @example
|
|
128
|
+
* // Replace the content of the 'api' document with new data
|
|
129
|
+
* store.replaceDocument('api', {
|
|
130
|
+
* openapi: '3.1.0',
|
|
131
|
+
* info: { title: 'Updated API', version: '1.0.1' },
|
|
132
|
+
* paths: {},
|
|
133
|
+
* })
|
|
134
|
+
*/
|
|
135
|
+
replaceDocument(documentName: string, input: Record<string, unknown>): Promise<void>;
|
|
136
|
+
/**
|
|
137
|
+
* Resolves a reference in the active document by following the provided path and resolving any external $ref references.
|
|
138
|
+
* This method traverses the document structure following the given path and resolves any $ref references it encounters.
|
|
139
|
+
* During resolution, it sets a loading status and updates the reference with the resolved content.
|
|
140
|
+
*
|
|
141
|
+
* @param path - Array of strings representing the path to the reference (e.g. ['paths', '/users', 'get', 'responses', '200'])
|
|
142
|
+
* @throws Error if the path is invalid or empty
|
|
143
|
+
* @example
|
|
144
|
+
* // Resolve a reference in the active document
|
|
145
|
+
* resolve(['paths', '/users', 'get', 'responses', '200'])
|
|
146
|
+
*/
|
|
72
147
|
resolve(path: string[]): Promise<unknown>;
|
|
73
|
-
/**
|
|
148
|
+
/**
|
|
149
|
+
* Adds a new document to the workspace
|
|
150
|
+
* @param document - The document content to add. This should be a valid OpenAPI/Swagger document or other supported format
|
|
151
|
+
* @param meta - Metadata for the document, including its name and other properties defined in WorkspaceDocumentMeta
|
|
152
|
+
* @example
|
|
153
|
+
* // Add a new OpenAPI document to the workspace
|
|
154
|
+
* store.addDocument({
|
|
155
|
+
* name: 'name',
|
|
156
|
+
* document: {
|
|
157
|
+
* openapi: '3.0.0',
|
|
158
|
+
* info: { title: 'title' },
|
|
159
|
+
* },
|
|
160
|
+
* meta: {
|
|
161
|
+
* 'x-scalar-active-auth': 'Bearer',
|
|
162
|
+
* 'x-scalar-active-server': 'production'
|
|
163
|
+
* }
|
|
164
|
+
* })
|
|
165
|
+
*/
|
|
74
166
|
addDocument(input: WorkspaceDocumentInput): Promise<void>;
|
|
75
|
-
/**
|
|
167
|
+
/**
|
|
168
|
+
* Returns the merged configuration for the active document.
|
|
169
|
+
*
|
|
170
|
+
* This getter merges configurations in the following order of precedence:
|
|
171
|
+
* 1. Document-specific configuration (highest priority)
|
|
172
|
+
* 2. Workspace-level configuration
|
|
173
|
+
* 3. Default configuration (lowest priority)
|
|
174
|
+
*
|
|
175
|
+
* The active document is determined by the workspace's activeDocument extension,
|
|
176
|
+
* falling back to the first document if none is specified.
|
|
177
|
+
*/
|
|
76
178
|
readonly config: typeof defaultConfig;
|
|
77
|
-
/**
|
|
179
|
+
/**
|
|
180
|
+
* Exports the specified document in the requested format.
|
|
181
|
+
*
|
|
182
|
+
* This method serializes the most recently saved local version of the document (from the intermediateDocuments map)
|
|
183
|
+
* to either JSON or YAML. The exported document reflects the last locally saved state, including any edits
|
|
184
|
+
* that have been saved but not yet synced to a remote registry. Runtime/in-memory changes that have not been saved
|
|
185
|
+
* will not be included.
|
|
186
|
+
*
|
|
187
|
+
* @param documentName - The name of the document to export.
|
|
188
|
+
* @param format - The output format: 'json' for a JSON string, or 'yaml' for a YAML string.
|
|
189
|
+
* @returns The document as a string in the requested format, or undefined if the document does not exist.
|
|
190
|
+
*
|
|
191
|
+
* @example
|
|
192
|
+
* // Export a document as JSON
|
|
193
|
+
* const jsonString = store.exportDocument('api', 'json')
|
|
194
|
+
*
|
|
195
|
+
* // Export a document as YAML
|
|
196
|
+
* const yamlString = store.exportDocument('api', 'yaml')
|
|
197
|
+
*/
|
|
78
198
|
exportDocument(documentName: string, format: 'json' | 'yaml'): string | undefined;
|
|
79
|
-
/**
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
199
|
+
/**
|
|
200
|
+
* Saves the current state of the specified document to the intermediate documents map.
|
|
201
|
+
*
|
|
202
|
+
* This function captures the latest (reactive) state of the document from the workspace and
|
|
203
|
+
* applies its changes to the corresponding entry in the `intermediateDocuments` map.
|
|
204
|
+
* The `intermediateDocuments` map represents the most recently "saved" local version of the document,
|
|
205
|
+
* which may include edits not yet synced to the remote registry.
|
|
206
|
+
*
|
|
207
|
+
* The update is performed in-place. A deep clone of the current document
|
|
208
|
+
* state is used to avoid mutating the reactive object directly.
|
|
209
|
+
*
|
|
210
|
+
* @param documentName - The name of the document to save.
|
|
211
|
+
* @returns An array of diffs that were excluded from being applied (such as changes to ignored keys),
|
|
212
|
+
* or undefined if the document does not exist or cannot be updated.
|
|
213
|
+
*
|
|
214
|
+
* @example
|
|
215
|
+
* // Save the current state of the document named 'api'
|
|
216
|
+
* const excludedDiffs = store.saveDocument('api')
|
|
217
|
+
*/
|
|
218
|
+
saveDocument(documentName: string): Promise<unknown[] | undefined>;
|
|
219
|
+
/**
|
|
220
|
+
* Restores the specified document to its last locally saved state.
|
|
221
|
+
*
|
|
222
|
+
* This method updates the current reactive document (in the workspace) with the contents of the
|
|
223
|
+
* corresponding intermediate document (from the `intermediateDocuments` map), effectively discarding
|
|
224
|
+
* any unsaved in-memory changes and reverting to the last saved version.
|
|
225
|
+
* Vue reactivity is preserved by updating the existing reactive object in place.
|
|
226
|
+
*
|
|
227
|
+
* **Warning:** This operation will discard all unsaved (in-memory) changes to the specified document.
|
|
228
|
+
*
|
|
229
|
+
* @param documentName - The name of the document to restore.
|
|
230
|
+
* @returns void
|
|
231
|
+
*
|
|
232
|
+
* @example
|
|
233
|
+
* // Restore the document named 'api' to its last saved state
|
|
234
|
+
* store.revertDocumentChanges('api')
|
|
235
|
+
*/
|
|
236
|
+
revertDocumentChanges(documentName: string): Promise<void>;
|
|
237
|
+
/**
|
|
238
|
+
* Commits the specified document.
|
|
239
|
+
*
|
|
240
|
+
* This method is intended to finalize and persist the current state of the document,
|
|
241
|
+
* potentially syncing it with a remote registry or marking it as the latest committed version.
|
|
242
|
+
*
|
|
243
|
+
* @param documentName - The name of the document to commit.
|
|
244
|
+
* @remarks
|
|
245
|
+
* The actual commit logic is not implemented yet.
|
|
246
|
+
*/
|
|
84
247
|
commitDocument(documentName: string): void;
|
|
85
|
-
/**
|
|
248
|
+
/**
|
|
249
|
+
* Serializes the current workspace state to a JSON string for backup, persistence, or sharing.
|
|
250
|
+
*
|
|
251
|
+
* This method exports all workspace documents (removing Vue reactivity proxies), workspace metadata,
|
|
252
|
+
* document configurations, and both the original and intermediate document states. The resulting JSON
|
|
253
|
+
* can be imported later to fully restore the workspace to this exact state, including all documents
|
|
254
|
+
* and their configurations.
|
|
255
|
+
*
|
|
256
|
+
* @returns A JSON string representing the complete workspace state.
|
|
257
|
+
*/
|
|
86
258
|
exportWorkspace(): string;
|
|
87
|
-
/**
|
|
259
|
+
/**
|
|
260
|
+
* Imports a workspace from a serialized JSON string.
|
|
261
|
+
*
|
|
262
|
+
* This method parses the input string using the InMemoryWorkspaceSchema,
|
|
263
|
+
* then updates the current workspace state, including documents, metadata,
|
|
264
|
+
* and configuration, with the imported values.
|
|
265
|
+
*
|
|
266
|
+
* @param input - The serialized workspace JSON string to import.
|
|
267
|
+
*/
|
|
88
268
|
loadWorkspace(input: string): void;
|
|
89
|
-
/**
|
|
269
|
+
/**
|
|
270
|
+
* Imports a workspace from a WorkspaceSpecification object.
|
|
271
|
+
*
|
|
272
|
+
* This method assigns workspace metadata and adds all documents defined in the specification.
|
|
273
|
+
* Each document is added using its $ref and optional overrides.
|
|
274
|
+
*
|
|
275
|
+
* @example
|
|
276
|
+
* ```ts
|
|
277
|
+
* await store.importWorkspaceFromSpecification({
|
|
278
|
+
* documents: {
|
|
279
|
+
* api: { $ref: '/specs/api.yaml' },
|
|
280
|
+
* petstore: { $ref: '/specs/petstore.yaml' }
|
|
281
|
+
* },
|
|
282
|
+
* overrides: {
|
|
283
|
+
* api: { config: { features: { showModels: true } } }
|
|
284
|
+
* },
|
|
285
|
+
* info: { title: 'My Workspace' },
|
|
286
|
+
* workspace: 'v1',
|
|
287
|
+
* "x-scalar-dark-mode": true
|
|
288
|
+
* })
|
|
289
|
+
* ```
|
|
290
|
+
*
|
|
291
|
+
* @param specification - The workspace specification to import.
|
|
292
|
+
*/
|
|
90
293
|
importWorkspaceFromSpecification(specification: WorkspaceSpecification): Promise<void[]>;
|
|
91
|
-
/**
|
|
92
|
-
|
|
294
|
+
/**
|
|
295
|
+
* Rebases a document in the workspace with a new origin, resolving conflicts if provided.
|
|
296
|
+
*
|
|
297
|
+
* This method is used to rebase a document (e.g., after pulling remote changes) by applying the changes
|
|
298
|
+
* from the new origin and merging them with local edits. If there are conflicts, they can be resolved
|
|
299
|
+
* by providing a list of resolved conflicts.
|
|
300
|
+
*
|
|
301
|
+
* @param documentName - The name of the document to rebase.
|
|
302
|
+
* @param newDocumentOrigin - The new origin document (as an object) to rebase onto.
|
|
303
|
+
* @param resolvedConflicts - (Optional) An array of resolved conflicts to apply.
|
|
304
|
+
* @returns If there are unresolved conflicts and no resolution is provided, returns the list of conflicts.
|
|
305
|
+
*
|
|
306
|
+
* @example
|
|
307
|
+
* // Example: Rebase a document with a new origin and resolve conflicts
|
|
308
|
+
* const conflicts = store.rebaseDocument('api', newOriginDoc)
|
|
309
|
+
* if (conflicts && conflicts.length > 0) {
|
|
310
|
+
* // User resolves conflicts here...
|
|
311
|
+
* store.rebaseDocument('api', newOriginDoc, userResolvedConflicts)
|
|
312
|
+
* }
|
|
313
|
+
*/
|
|
314
|
+
rebaseDocument: (documentName: string, newDocumentOrigin: Record<string, unknown>, resolvedConflicts?: Difference<unknown>[]) => void | ReturnType<typeof merge>['conflicts'];
|
|
93
315
|
};
|
|
94
316
|
/**
|
|
95
317
|
* Creates a reactive workspace store that manages documents and their metadata.
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","s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