@scalar/schemas 0.2.0 → 0.3.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 +19 -0
- package/dist/api-reference/api-reference-configuration.d.ts +18 -16
- package/dist/api-reference/api-reference-configuration.d.ts.map +1 -1
- package/dist/api-reference/api-reference-configuration.js +11 -1
- package/dist/api-reference/base-configuration.d.ts +6 -6
- package/dist/api-reference/source-configuration.d.ts +2 -2
- package/dist/api-reference/source-configuration.d.ts.map +1 -1
- package/dist/asyncapi/3.1/asyncapi-object.d.ts +50 -0
- package/dist/asyncapi/3.1/asyncapi-object.d.ts.map +1 -0
- package/dist/asyncapi/3.1/asyncapi-object.js +48 -0
- package/dist/asyncapi/3.1/bindings.d.ts +6 -0
- package/dist/asyncapi/3.1/bindings.d.ts.map +1 -0
- package/dist/asyncapi/3.1/bindings.js +42 -0
- package/dist/asyncapi/3.1/channel.d.ts +4 -0
- package/dist/asyncapi/3.1/channel.d.ts.map +1 -0
- package/dist/asyncapi/3.1/channel.js +29 -0
- package/dist/asyncapi/3.1/components.d.ts +22 -0
- package/dist/asyncapi/3.1/components.d.ts.map +1 -0
- package/dist/asyncapi/3.1/components.js +44 -0
- package/dist/asyncapi/3.1/contact.d.ts +6 -0
- package/dist/asyncapi/3.1/contact.d.ts.map +1 -0
- package/dist/asyncapi/3.1/contact.js +8 -0
- package/dist/asyncapi/3.1/correlation-id.d.ts +3 -0
- package/dist/asyncapi/3.1/correlation-id.d.ts.map +1 -0
- package/dist/asyncapi/3.1/correlation-id.js +11 -0
- package/dist/asyncapi/3.1/external-documentation.d.ts +3 -0
- package/dist/asyncapi/3.1/external-documentation.d.ts.map +1 -0
- package/dist/asyncapi/3.1/external-documentation.js +11 -0
- package/dist/asyncapi/3.1/index.d.ts +26 -0
- package/dist/asyncapi/3.1/index.d.ts.map +1 -0
- package/dist/asyncapi/3.1/index.js +25 -0
- package/dist/asyncapi/3.1/info.d.ts +15 -0
- package/dist/asyncapi/3.1/info.d.ts.map +1 -0
- package/dist/asyncapi/3.1/info.js +19 -0
- package/dist/asyncapi/3.1/license.d.ts +3 -0
- package/dist/asyncapi/3.1/license.d.ts.map +1 -0
- package/dist/asyncapi/3.1/license.js +9 -0
- package/dist/asyncapi/3.1/message-example.d.ts +7 -0
- package/dist/asyncapi/3.1/message-example.d.ts.map +1 -0
- package/dist/asyncapi/3.1/message-example.js +9 -0
- package/dist/asyncapi/3.1/message-trait.d.ts +3 -0
- package/dist/asyncapi/3.1/message-trait.d.ts.map +1 -0
- package/dist/asyncapi/3.1/message-trait.js +26 -0
- package/dist/asyncapi/3.1/message.d.ts +4 -0
- package/dist/asyncapi/3.1/message.d.ts.map +1 -0
- package/dist/asyncapi/3.1/message.js +33 -0
- package/dist/asyncapi/3.1/oauth.d.ts +13 -0
- package/dist/asyncapi/3.1/oauth.d.ts.map +1 -0
- package/dist/asyncapi/3.1/oauth.js +22 -0
- package/dist/asyncapi/3.1/operation-reply-address.d.ts +3 -0
- package/dist/asyncapi/3.1/operation-reply-address.d.ts.map +1 -0
- package/dist/asyncapi/3.1/operation-reply-address.js +11 -0
- package/dist/asyncapi/3.1/operation-reply.d.ts +3 -0
- package/dist/asyncapi/3.1/operation-reply.d.ts.map +1 -0
- package/dist/asyncapi/3.1/operation-reply.js +13 -0
- package/dist/asyncapi/3.1/operation-trait.d.ts +3 -0
- package/dist/asyncapi/3.1/operation-trait.d.ts.map +1 -0
- package/dist/asyncapi/3.1/operation-trait.js +20 -0
- package/dist/asyncapi/3.1/operation.d.ts +4 -0
- package/dist/asyncapi/3.1/operation.d.ts.map +1 -0
- package/dist/asyncapi/3.1/operation.js +37 -0
- package/dist/asyncapi/3.1/parameter.d.ts +3 -0
- package/dist/asyncapi/3.1/parameter.d.ts.map +1 -0
- package/dist/asyncapi/3.1/parameter.js +14 -0
- package/dist/asyncapi/3.1/parameters.d.ts +2 -0
- package/dist/asyncapi/3.1/parameters.d.ts.map +1 -0
- package/dist/asyncapi/3.1/parameters.js +6 -0
- package/dist/asyncapi/3.1/reference.d.ts +25 -0
- package/dist/asyncapi/3.1/reference.d.ts.map +1 -0
- package/dist/asyncapi/3.1/reference.js +25 -0
- package/dist/asyncapi/3.1/schema-payload.d.ts +7 -0
- package/dist/asyncapi/3.1/schema-payload.d.ts.map +1 -0
- package/dist/asyncapi/3.1/schema-payload.js +22 -0
- package/dist/asyncapi/3.1/security-scheme.d.ts +3 -0
- package/dist/asyncapi/3.1/security-scheme.d.ts.map +1 -0
- package/dist/asyncapi/3.1/security-scheme.js +39 -0
- package/dist/asyncapi/3.1/server-variable.d.ts +3 -0
- package/dist/asyncapi/3.1/server-variable.d.ts.map +1 -0
- package/dist/asyncapi/3.1/server-variable.js +13 -0
- package/dist/asyncapi/3.1/server.d.ts +4 -0
- package/dist/asyncapi/3.1/server.d.ts.map +1 -0
- package/dist/asyncapi/3.1/server.js +36 -0
- package/dist/asyncapi/3.1/tag.d.ts +4 -0
- package/dist/asyncapi/3.1/tag.d.ts.map +1 -0
- package/dist/asyncapi/3.1/tag.js +15 -0
- package/dist/extensions/document/index.d.ts +21 -0
- package/dist/extensions/document/index.d.ts.map +1 -0
- package/dist/extensions/document/index.js +20 -0
- package/dist/extensions/document/x-internal.d.ts +4 -0
- package/dist/extensions/document/x-internal.d.ts.map +1 -0
- package/dist/extensions/document/x-internal.js +11 -0
- package/dist/extensions/document/x-original-aas-version.d.ts +4 -0
- package/dist/extensions/document/x-original-aas-version.d.ts.map +1 -0
- package/dist/extensions/document/x-original-aas-version.js +8 -0
- package/dist/extensions/document/x-original-oas-version.d.ts +4 -0
- package/dist/extensions/document/x-original-oas-version.d.ts.map +1 -0
- package/dist/extensions/document/x-original-oas-version.js +8 -0
- package/dist/extensions/document/x-scalar-environments.d.ts +34 -0
- package/dist/extensions/document/x-scalar-environments.d.ts.map +1 -0
- package/dist/extensions/document/x-scalar-environments.js +41 -0
- package/dist/extensions/document/x-scalar-icon.d.ts +4 -0
- package/dist/extensions/document/x-scalar-icon.d.ts.map +1 -0
- package/dist/extensions/document/x-scalar-icon.js +11 -0
- package/dist/extensions/document/x-scalar-ignore.d.ts +5 -0
- package/dist/extensions/document/x-scalar-ignore.d.ts.map +1 -0
- package/dist/extensions/document/x-scalar-ignore.js +12 -0
- package/dist/extensions/document/x-scalar-is-dirty.d.ts +4 -0
- package/dist/extensions/document/x-scalar-is-dirty.d.ts.map +1 -0
- package/dist/extensions/document/x-scalar-is-dirty.js +13 -0
- package/dist/extensions/document/x-scalar-navigation.d.ts +4 -0
- package/dist/extensions/document/x-scalar-navigation.d.ts.map +1 -0
- package/dist/extensions/document/x-scalar-navigation.js +9 -0
- package/dist/extensions/document/x-scalar-original-document-hash.d.ts +4 -0
- package/dist/extensions/document/x-scalar-original-document-hash.d.ts.map +1 -0
- package/dist/extensions/document/x-scalar-original-document-hash.js +10 -0
- package/dist/extensions/document/x-scalar-original-source-url.d.ts +4 -0
- package/dist/extensions/document/x-scalar-original-source-url.d.ts.map +1 -0
- package/dist/extensions/document/x-scalar-original-source-url.js +8 -0
- package/dist/extensions/document/x-scalar-registry-meta.d.ts +11 -0
- package/dist/extensions/document/x-scalar-registry-meta.d.ts.map +1 -0
- package/dist/extensions/document/x-scalar-registry-meta.js +31 -0
- package/dist/extensions/document/x-scalar-sdk-installation.d.ts +8 -0
- package/dist/extensions/document/x-scalar-sdk-installation.d.ts.map +1 -0
- package/dist/extensions/document/x-scalar-sdk-installation.js +23 -0
- package/dist/extensions/document/x-scalar-watch-mode.d.ts +4 -0
- package/dist/extensions/document/x-scalar-watch-mode.d.ts.map +1 -0
- package/dist/extensions/document/x-scalar-watch-mode.js +8 -0
- package/dist/extensions/document/x-tags.d.ts +4 -0
- package/dist/extensions/document/x-tags.d.ts.map +1 -0
- package/dist/extensions/document/x-tags.js +15 -0
- package/dist/extensions/example/index.d.ts +7 -0
- package/dist/extensions/example/index.d.ts.map +1 -0
- package/dist/extensions/example/index.js +6 -0
- package/dist/extensions/example/x-disabled.d.ts +17 -0
- package/dist/extensions/example/x-disabled.d.ts.map +1 -0
- package/dist/extensions/example/x-disabled.js +23 -0
- package/dist/extensions/general/index.d.ts +12 -0
- package/dist/extensions/general/index.d.ts.map +1 -0
- package/dist/extensions/general/index.js +11 -0
- package/dist/extensions/general/x-post-response.d.ts +19 -0
- package/dist/extensions/general/x-post-response.d.ts.map +1 -0
- package/dist/extensions/general/x-post-response.js +31 -0
- package/dist/extensions/general/x-pre-request.d.ts +19 -0
- package/dist/extensions/general/x-pre-request.d.ts.map +1 -0
- package/dist/extensions/general/x-pre-request.js +30 -0
- package/dist/extensions/general/x-scalar-active-environment.d.ts +5 -0
- package/dist/extensions/general/x-scalar-active-environment.d.ts.map +1 -0
- package/dist/extensions/general/x-scalar-active-environment.js +12 -0
- package/dist/extensions/general/x-scalar-cookies.d.ts +17 -0
- package/dist/extensions/general/x-scalar-cookies.d.ts.map +1 -0
- package/dist/extensions/general/x-scalar-cookies.js +26 -0
- package/dist/extensions/general/x-scalar-order.d.ts +4 -0
- package/dist/extensions/general/x-scalar-order.d.ts.map +1 -0
- package/dist/extensions/general/x-scalar-order.js +16 -0
- package/dist/extensions/operation/index.d.ts +13 -0
- package/dist/extensions/operation/index.d.ts.map +1 -0
- package/dist/extensions/operation/index.js +12 -0
- package/dist/extensions/operation/x-badge.d.ts +38 -0
- package/dist/extensions/operation/x-badge.d.ts.map +1 -0
- package/dist/extensions/operation/x-badge.js +60 -0
- package/dist/extensions/operation/x-code-samples.d.ts +23 -0
- package/dist/extensions/operation/x-code-samples.d.ts.map +1 -0
- package/dist/extensions/operation/x-code-samples.js +24 -0
- package/dist/extensions/operation/x-draft-examples.d.ts +4 -0
- package/dist/extensions/operation/x-draft-examples.d.ts.map +1 -0
- package/dist/extensions/operation/x-draft-examples.js +15 -0
- package/dist/extensions/operation/x-scalar-disable-parameters.d.ts +8 -0
- package/dist/extensions/operation/x-scalar-disable-parameters.d.ts.map +1 -0
- package/dist/extensions/operation/x-scalar-disable-parameters.js +74 -0
- package/dist/extensions/operation/x-scalar-selected-content-type.d.ts +10 -0
- package/dist/extensions/operation/x-scalar-selected-content-type.d.ts.map +1 -0
- package/dist/extensions/operation/x-scalar-selected-content-type.js +21 -0
- package/dist/extensions/operation/x-scalar-stability.d.ts +9 -0
- package/dist/extensions/operation/x-scalar-stability.d.ts.map +1 -0
- package/dist/extensions/operation/x-scalar-stability.js +18 -0
- package/dist/extensions/parameter/index.d.ts +8 -0
- package/dist/extensions/parameter/index.d.ts.map +1 -0
- package/dist/extensions/parameter/index.js +7 -0
- package/dist/extensions/parameter/x-global.d.ts +13 -0
- package/dist/extensions/parameter/x-global.d.ts.map +1 -0
- package/dist/extensions/parameter/x-global.js +22 -0
- package/dist/extensions/schema/index.d.ts +12 -0
- package/dist/extensions/schema/index.d.ts.map +1 -0
- package/dist/extensions/schema/index.js +11 -0
- package/dist/extensions/schema/x-additional-properties-name.d.ts +10 -0
- package/dist/extensions/schema/x-additional-properties-name.d.ts.map +1 -0
- package/dist/extensions/schema/x-additional-properties-name.js +19 -0
- package/dist/extensions/schema/x-enum-descriptions.d.ts +20 -0
- package/dist/extensions/schema/x-enum-descriptions.d.ts.map +1 -0
- package/dist/extensions/schema/x-enum-descriptions.js +33 -0
- package/dist/extensions/schema/x-enum-varnames.d.ts +22 -0
- package/dist/extensions/schema/x-enum-varnames.d.ts.map +1 -0
- package/dist/extensions/schema/x-enum-varnames.js +34 -0
- package/dist/extensions/schema/x-examples.d.ts +4 -0
- package/dist/extensions/schema/x-examples.d.ts.map +1 -0
- package/dist/extensions/schema/x-examples.js +16 -0
- package/dist/extensions/schema/x-variable.d.ts +4 -0
- package/dist/extensions/schema/x-variable.d.ts.map +1 -0
- package/dist/extensions/schema/x-variable.js +11 -0
- package/dist/extensions/security/index.d.ts +14 -0
- package/dist/extensions/security/index.d.ts.map +1 -0
- package/dist/extensions/security/index.js +13 -0
- package/dist/extensions/security/x-default-scopes.d.ts +14 -0
- package/dist/extensions/security/x-default-scopes.d.ts.map +1 -0
- package/dist/extensions/security/x-default-scopes.js +23 -0
- package/dist/extensions/security/x-scalar-credentials-location.d.ts +17 -0
- package/dist/extensions/security/x-scalar-credentials-location.d.ts.map +1 -0
- package/dist/extensions/security/x-scalar-credentials-location.js +26 -0
- package/dist/extensions/security/x-scalar-security-body.d.ts +14 -0
- package/dist/extensions/security/x-scalar-security-body.d.ts.map +1 -0
- package/dist/extensions/security/x-scalar-security-body.js +25 -0
- package/dist/extensions/security/x-scalar-security-query.d.ts +14 -0
- package/dist/extensions/security/x-scalar-security-query.d.ts.map +1 -0
- package/dist/extensions/security/x-scalar-security-query.js +25 -0
- package/dist/extensions/security/x-scalar-security-secrets.d.ts +26 -0
- package/dist/extensions/security/x-scalar-security-secrets.d.ts.map +1 -0
- package/dist/extensions/security/x-scalar-security-secrets.js +57 -0
- package/dist/extensions/security/x-tokenName.d.ts +12 -0
- package/dist/extensions/security/x-tokenName.d.ts.map +1 -0
- package/dist/extensions/security/x-tokenName.js +21 -0
- package/dist/extensions/security/x-use-pkce.d.ts +7 -0
- package/dist/extensions/security/x-use-pkce.d.ts.map +1 -0
- package/dist/extensions/security/x-use-pkce.js +13 -0
- package/dist/extensions/server/index.d.ts +7 -0
- package/dist/extensions/server/index.d.ts.map +1 -0
- package/dist/extensions/server/index.js +6 -0
- package/dist/extensions/server/x-scalar-selected-server.d.ts +4 -0
- package/dist/extensions/server/x-scalar-selected-server.d.ts.map +1 -0
- package/dist/extensions/server/x-scalar-selected-server.js +11 -0
- package/dist/extensions/tag/index.d.ts +8 -0
- package/dist/extensions/tag/index.d.ts.map +1 -0
- package/dist/extensions/tag/index.js +7 -0
- package/dist/extensions/tag/x-display-name.d.ts +12 -0
- package/dist/extensions/tag/x-display-name.d.ts.map +1 -0
- package/dist/extensions/tag/x-display-name.js +21 -0
- package/dist/extensions/tag/x-tag-groups.d.ts +20 -0
- package/dist/extensions/tag/x-tag-groups.d.ts.map +1 -0
- package/dist/extensions/tag/x-tag-groups.js +33 -0
- package/dist/extensions/type-comment.d.ts +17 -0
- package/dist/extensions/type-comment.d.ts.map +1 -0
- package/dist/extensions/type-comment.js +14 -0
- package/dist/extensions/workspace/index.d.ts +9 -0
- package/dist/extensions/workspace/index.d.ts.map +1 -0
- package/dist/extensions/workspace/index.js +8 -0
- package/dist/extensions/workspace/x-scalar-active-proxy.d.ts +14 -0
- package/dist/extensions/workspace/x-scalar-active-proxy.d.ts.map +1 -0
- package/dist/extensions/workspace/x-scalar-active-proxy.js +23 -0
- package/dist/extensions/workspace/x-scalar-tabs.d.ts +20 -0
- package/dist/extensions/workspace/x-scalar-tabs.d.ts.map +1 -0
- package/dist/extensions/workspace/x-scalar-tabs.js +33 -0
- package/dist/general/bundler-extensions.d.ts +5 -0
- package/dist/general/bundler-extensions.d.ts.map +1 -0
- package/dist/general/bundler-extensions.js +9 -0
- package/dist/openapi/3.1/callback.d.ts +2 -0
- package/dist/openapi/3.1/callback.d.ts.map +1 -0
- package/dist/openapi/3.1/callback.js +6 -0
- package/dist/openapi/3.1/components.d.ts +36 -0
- package/dist/openapi/3.1/components.d.ts.map +1 -0
- package/dist/openapi/3.1/components.js +24 -0
- package/dist/openapi/3.1/contact.d.ts +6 -0
- package/dist/openapi/3.1/contact.d.ts.map +1 -0
- package/dist/openapi/3.1/contact.js +8 -0
- package/dist/openapi/3.1/discriminator.d.ts +5 -0
- package/dist/openapi/3.1/discriminator.d.ts.map +1 -0
- package/dist/openapi/3.1/discriminator.js +9 -0
- package/dist/openapi/3.1/document.d.ts +201 -0
- package/dist/openapi/3.1/document.d.ts.map +1 -0
- package/dist/openapi/3.1/document.js +67 -0
- package/dist/openapi/3.1/example.d.ts +9 -0
- package/dist/openapi/3.1/example.d.ts.map +1 -0
- package/dist/openapi/3.1/example.js +17 -0
- package/dist/openapi/3.1/external-docs.d.ts +5 -0
- package/dist/openapi/3.1/external-docs.d.ts.map +1 -0
- package/dist/openapi/3.1/external-docs.js +9 -0
- package/dist/openapi/3.1/index.d.ts +25 -0
- package/dist/openapi/3.1/index.d.ts.map +1 -0
- package/dist/openapi/3.1/index.js +24 -0
- package/dist/openapi/3.1/info.d.ts +24 -0
- package/dist/openapi/3.1/info.d.ts.map +1 -0
- package/dist/openapi/3.1/info.js +20 -0
- package/dist/openapi/3.1/license.d.ts +6 -0
- package/dist/openapi/3.1/license.d.ts.map +1 -0
- package/dist/openapi/3.1/license.js +10 -0
- package/dist/openapi/3.1/link.d.ts +17 -0
- package/dist/openapi/3.1/link.d.ts.map +1 -0
- package/dist/openapi/3.1/link.js +21 -0
- package/dist/openapi/3.1/media-type.d.ts +16 -0
- package/dist/openapi/3.1/media-type.d.ts.map +1 -0
- package/dist/openapi/3.1/media-type.js +49 -0
- package/dist/openapi/3.1/operation.d.ts +68 -0
- package/dist/openapi/3.1/operation.d.ts.map +1 -0
- package/dist/openapi/3.1/operation.js +48 -0
- package/dist/openapi/3.1/parameter.d.ts +44 -0
- package/dist/openapi/3.1/parameter.d.ts.map +1 -0
- package/dist/openapi/3.1/parameter.js +76 -0
- package/dist/openapi/3.1/path-item.d.ts +25 -0
- package/dist/openapi/3.1/path-item.d.ts.map +1 -0
- package/dist/openapi/3.1/path-item.js +27 -0
- package/dist/openapi/3.1/reference.d.ts +16 -0
- package/dist/openapi/3.1/reference.d.ts.map +1 -0
- package/dist/openapi/3.1/reference.js +34 -0
- package/dist/openapi/3.1/request-body.d.ts +16 -0
- package/dist/openapi/3.1/request-body.d.ts.map +1 -0
- package/dist/openapi/3.1/request-body.js +16 -0
- package/dist/openapi/3.1/response.d.ts +16 -0
- package/dist/openapi/3.1/response.d.ts.map +1 -0
- package/dist/openapi/3.1/response.js +15 -0
- package/dist/openapi/3.1/schema.d.ts +3 -0
- package/dist/openapi/3.1/schema.d.ts.map +1 -0
- package/dist/openapi/3.1/schema.js +100 -0
- package/dist/openapi/3.1/security-requirement.d.ts +2 -0
- package/dist/openapi/3.1/security-requirement.d.ts.map +1 -0
- package/dist/openapi/3.1/security-requirement.js +5 -0
- package/dist/openapi/3.1/security-schemes.d.ts +96 -0
- package/dist/openapi/3.1/security-schemes.d.ts.map +1 -0
- package/dist/openapi/3.1/security-schemes.js +107 -0
- package/dist/openapi/3.1/server-variable.d.ts +6 -0
- package/dist/openapi/3.1/server-variable.d.ts.map +1 -0
- package/dist/openapi/3.1/server-variable.js +12 -0
- package/dist/openapi/3.1/server.d.ts +10 -0
- package/dist/openapi/3.1/server.d.ts.map +1 -0
- package/dist/openapi/3.1/server.js +13 -0
- package/dist/openapi/3.1/tag.d.ts +17 -0
- package/dist/openapi/3.1/tag.d.ts.map +1 -0
- package/dist/openapi/3.1/tag.js +18 -0
- package/dist/openapi/3.1/xml.d.ts +8 -0
- package/dist/openapi/3.1/xml.d.ts.map +1 -0
- package/dist/openapi/3.1/xml.js +16 -0
- package/package.json +16 -4
- package/LICENSE +0 -21
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/extensions/example/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OpenAPI extension to control whether a parameter example is enabled (checkbox on) or disabled (checkbox off).
|
|
3
|
+
*
|
|
4
|
+
* This extension is typically used in API tools to determine if a parameter (such as a header, query, or cookie)
|
|
5
|
+
* should be included in the request when sending an example. If `x-disabled: true`, the parameter example is considered
|
|
6
|
+
* "off" (checkbox unchecked) and will not be sent with the request. If `x-disabled: false` or omitted, the parameter
|
|
7
|
+
* example is "on" (checkbox checked) and will be sent.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```yaml
|
|
11
|
+
* x-disabled: true
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
export declare const XDisabled: import("@scalar/validation").ObjectSchema<{
|
|
15
|
+
'x-disabled': import("@scalar/validation").OptionalSchema<import("@scalar/validation").BooleanSchema>;
|
|
16
|
+
}>;
|
|
17
|
+
//# sourceMappingURL=x-disabled.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"x-disabled.d.ts","sourceRoot":"","sources":["../../../src/extensions/example/x-disabled.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,SAAS;;EAerB,CAAA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { boolean, object, optional } from '@scalar/validation';
|
|
2
|
+
import { typeCommentInlineCode, typeCommentWithExample } from '../type-comment.js';
|
|
3
|
+
/**
|
|
4
|
+
* OpenAPI extension to control whether a parameter example is enabled (checkbox on) or disabled (checkbox off).
|
|
5
|
+
*
|
|
6
|
+
* This extension is typically used in API tools to determine if a parameter (such as a header, query, or cookie)
|
|
7
|
+
* should be included in the request when sending an example. If `x-disabled: true`, the parameter example is considered
|
|
8
|
+
* "off" (checkbox unchecked) and will not be sent with the request. If `x-disabled: false` or omitted, the parameter
|
|
9
|
+
* example is "on" (checkbox checked) and will be sent.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```yaml
|
|
13
|
+
* x-disabled: true
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export const XDisabled = object({
|
|
17
|
+
'x-disabled': optional(boolean({
|
|
18
|
+
typeComment: 'When true, the parameter example is not sent with the request',
|
|
19
|
+
})),
|
|
20
|
+
}, {
|
|
21
|
+
typeName: 'XDisabled',
|
|
22
|
+
typeComment: typeCommentWithExample(`Whether a parameter example is disabled in the API client (${typeCommentInlineCode('true')} = not sent).`, { language: 'yaml', body: 'x-disabled: true' }),
|
|
23
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* General Scalar extensions.
|
|
3
|
+
*
|
|
4
|
+
* May appear on multiple OpenAPI object types (operations, parameters, etc.). Includes request/response
|
|
5
|
+
* scripts, workspace cookies, environment selection, and custom ordering.
|
|
6
|
+
*/
|
|
7
|
+
export { XPostResponse } from './x-post-response.js';
|
|
8
|
+
export { XPreRequest } from './x-pre-request.js';
|
|
9
|
+
export { XScalarActiveEnvironment } from './x-scalar-active-environment.js';
|
|
10
|
+
export { XScalarCookie, XScalarCookies } from './x-scalar-cookies.js';
|
|
11
|
+
export { XScalarOrder } from './x-scalar-order.js';
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/extensions/general/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAC7C,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAA;AACxE,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* General Scalar extensions.
|
|
3
|
+
*
|
|
4
|
+
* May appear on multiple OpenAPI object types (operations, parameters, etc.). Includes request/response
|
|
5
|
+
* scripts, workspace cookies, environment selection, and custom ordering.
|
|
6
|
+
*/
|
|
7
|
+
export { XPostResponse } from './x-post-response.js';
|
|
8
|
+
export { XPreRequest } from './x-pre-request.js';
|
|
9
|
+
export { XScalarActiveEnvironment } from './x-scalar-active-environment.js';
|
|
10
|
+
export { XScalarCookie, XScalarCookies } from './x-scalar-cookies.js';
|
|
11
|
+
export { XScalarOrder } from './x-scalar-order.js';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Post response scripts allow to execute arbitrary code after a response is received.
|
|
3
|
+
*
|
|
4
|
+
* This is useful for:
|
|
5
|
+
* - Extracting data from the response, or
|
|
6
|
+
* - Testing the response
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```yaml
|
|
10
|
+
* x-post-response: |
|
|
11
|
+
* pm.test("Status code is 200", () => {
|
|
12
|
+
* pm.response.to.have.status(200)
|
|
13
|
+
* })
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export declare const XPostResponse: import("@scalar/validation").ObjectSchema<{
|
|
17
|
+
'x-post-response': import("@scalar/validation").OptionalSchema<import("@scalar/validation").StringSchema>;
|
|
18
|
+
}>;
|
|
19
|
+
//# sourceMappingURL=x-post-response.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"x-post-response.d.ts","sourceRoot":"","sources":["../../../src/extensions/general/x-post-response.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,aAAa;;EAqBzB,CAAA"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { object, optional, string } from '@scalar/validation';
|
|
2
|
+
import { typeCommentWithExample } from '../type-comment.js';
|
|
3
|
+
/**
|
|
4
|
+
* Post response scripts allow to execute arbitrary code after a response is received.
|
|
5
|
+
*
|
|
6
|
+
* This is useful for:
|
|
7
|
+
* - Extracting data from the response, or
|
|
8
|
+
* - Testing the response
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```yaml
|
|
12
|
+
* x-post-response: |
|
|
13
|
+
* pm.test("Status code is 200", () => {
|
|
14
|
+
* pm.response.to.have.status(200)
|
|
15
|
+
* })
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export const XPostResponse = object({
|
|
19
|
+
'x-post-response': optional(string({
|
|
20
|
+
typeComment: 'Script executed after a response is received',
|
|
21
|
+
})),
|
|
22
|
+
}, {
|
|
23
|
+
typeName: 'XPostResponse',
|
|
24
|
+
typeComment: typeCommentWithExample('Post-response script for an operation. Use to extract response data or assert on the response.', {
|
|
25
|
+
language: 'yaml',
|
|
26
|
+
body: `x-post-response: |
|
|
27
|
+
pm.test("Status code is 200", () => {
|
|
28
|
+
pm.response.to.have.status(200)
|
|
29
|
+
})`,
|
|
30
|
+
}),
|
|
31
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pre-request scripts run before a request is sent. They are used to prepare or modify anything needed for the request to succeed.
|
|
3
|
+
*
|
|
4
|
+
* Common uses:
|
|
5
|
+
* - Set up data and variables
|
|
6
|
+
* - Generate timestamps, random values, IDs, or nonces
|
|
7
|
+
* - Set environment or collection variables for use in the URL, headers, or body
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```yaml
|
|
11
|
+
* x-pre-request: |
|
|
12
|
+
* var token = pm.environment.get("token")
|
|
13
|
+
* pm.request.headers.set("Authorization", `Bearer ${token}`)
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export declare const XPreRequest: import("@scalar/validation").ObjectSchema<{
|
|
17
|
+
'x-pre-request': import("@scalar/validation").OptionalSchema<import("@scalar/validation").StringSchema>;
|
|
18
|
+
}>;
|
|
19
|
+
//# sourceMappingURL=x-pre-request.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"x-pre-request.d.ts","sourceRoot":"","sources":["../../../src/extensions/general/x-pre-request.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,WAAW;;EAoBvB,CAAA"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { object, optional, string } from '@scalar/validation';
|
|
2
|
+
import { typeCommentWithExample } from '../type-comment.js';
|
|
3
|
+
/**
|
|
4
|
+
* Pre-request scripts run before a request is sent. They are used to prepare or modify anything needed for the request to succeed.
|
|
5
|
+
*
|
|
6
|
+
* Common uses:
|
|
7
|
+
* - Set up data and variables
|
|
8
|
+
* - Generate timestamps, random values, IDs, or nonces
|
|
9
|
+
* - Set environment or collection variables for use in the URL, headers, or body
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```yaml
|
|
13
|
+
* x-pre-request: |
|
|
14
|
+
* var token = pm.environment.get("token")
|
|
15
|
+
* pm.request.headers.set("Authorization", `Bearer ${token}`)
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export const XPreRequest = object({
|
|
19
|
+
'x-pre-request': optional(string({
|
|
20
|
+
typeComment: 'Script executed before the request is sent',
|
|
21
|
+
})),
|
|
22
|
+
}, {
|
|
23
|
+
typeName: 'XPreRequest',
|
|
24
|
+
typeComment: typeCommentWithExample('Pre-request script to run before the request is sent. Use to set variables, generate values, or modify headers.', {
|
|
25
|
+
language: 'yaml',
|
|
26
|
+
body: `x-pre-request: |
|
|
27
|
+
var token = pm.environment.get("token")
|
|
28
|
+
pm.request.headers.set("Authorization", \`Bearer \${token}\`)`,
|
|
29
|
+
}),
|
|
30
|
+
});
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** The currently selected environment for this API description */
|
|
2
|
+
export declare const XScalarActiveEnvironment: import("@scalar/validation").ObjectSchema<{
|
|
3
|
+
'x-scalar-active-environment': import("@scalar/validation").OptionalSchema<import("@scalar/validation").StringSchema>;
|
|
4
|
+
}>;
|
|
5
|
+
//# sourceMappingURL=x-scalar-active-environment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"x-scalar-active-environment.d.ts","sourceRoot":"","sources":["../../../src/extensions/general/x-scalar-active-environment.ts"],"names":[],"mappings":"AAIA,kEAAkE;AAClE,eAAO,MAAM,wBAAwB;;EAWpC,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { object, optional, string } from '@scalar/validation';
|
|
2
|
+
import { typeCommentWithExample } from '../type-comment.js';
|
|
3
|
+
/** The currently selected environment for this API description */
|
|
4
|
+
export const XScalarActiveEnvironment = object({
|
|
5
|
+
'x-scalar-active-environment': optional(string({ typeComment: 'The currently selected environment name' })),
|
|
6
|
+
}, {
|
|
7
|
+
typeName: 'XScalarActiveEnvironment',
|
|
8
|
+
typeComment: typeCommentWithExample('The currently selected environment for this API description.', {
|
|
9
|
+
language: 'yaml',
|
|
10
|
+
body: 'x-scalar-active-environment: production',
|
|
11
|
+
}),
|
|
12
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const XScalarCookie: import("@scalar/validation").ObjectSchema<{
|
|
2
|
+
name: import("@scalar/validation").StringSchema;
|
|
3
|
+
value: import("@scalar/validation").StringSchema;
|
|
4
|
+
domain: import("@scalar/validation").OptionalSchema<import("@scalar/validation").StringSchema>;
|
|
5
|
+
path: import("@scalar/validation").OptionalSchema<import("@scalar/validation").StringSchema>;
|
|
6
|
+
isDisabled: import("@scalar/validation").OptionalSchema<import("@scalar/validation").BooleanSchema>;
|
|
7
|
+
}>;
|
|
8
|
+
export declare const XScalarCookies: import("@scalar/validation").ObjectSchema<{
|
|
9
|
+
'x-scalar-cookies': import("@scalar/validation").OptionalSchema<import("@scalar/validation").ArraySchema<import("@scalar/validation").ObjectSchema<{
|
|
10
|
+
name: import("@scalar/validation").StringSchema;
|
|
11
|
+
value: import("@scalar/validation").StringSchema;
|
|
12
|
+
domain: import("@scalar/validation").OptionalSchema<import("@scalar/validation").StringSchema>;
|
|
13
|
+
path: import("@scalar/validation").OptionalSchema<import("@scalar/validation").StringSchema>;
|
|
14
|
+
isDisabled: import("@scalar/validation").OptionalSchema<import("@scalar/validation").BooleanSchema>;
|
|
15
|
+
}>>>;
|
|
16
|
+
}>;
|
|
17
|
+
//# sourceMappingURL=x-scalar-cookies.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"x-scalar-cookies.d.ts","sourceRoot":"","sources":["../../../src/extensions/general/x-scalar-cookies.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,aAAa;;;;;;EAYzB,CAAA;AAED,eAAO,MAAM,cAAc;;;;;;;;EAkB1B,CAAA"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { array, boolean, object, optional, string } from '@scalar/validation';
|
|
2
|
+
import { typeCommentWithExample } from '../type-comment.js';
|
|
3
|
+
export const XScalarCookie = object({
|
|
4
|
+
name: string({ typeComment: 'Cookie name' }),
|
|
5
|
+
value: string({ typeComment: 'Cookie value' }),
|
|
6
|
+
domain: optional(string({ typeComment: 'Domain scope (includes subdomains when set)' })),
|
|
7
|
+
path: optional(string({ typeComment: 'Path scope — cookie is sent only for requests matching this path' })),
|
|
8
|
+
isDisabled: optional(boolean({ typeComment: 'When true, the cookie is not sent with requests' })),
|
|
9
|
+
}, {
|
|
10
|
+
typeName: 'XScalarCookie',
|
|
11
|
+
typeComment: 'A persisted cookie definition for the workspace',
|
|
12
|
+
});
|
|
13
|
+
export const XScalarCookies = object({
|
|
14
|
+
'x-scalar-cookies': optional(array(XScalarCookie, {
|
|
15
|
+
typeComment: 'Cookies persisted for the workspace and injected into requests',
|
|
16
|
+
})),
|
|
17
|
+
}, {
|
|
18
|
+
typeName: 'XScalarCookies',
|
|
19
|
+
typeComment: typeCommentWithExample('Persisted workspace cookies shared across requests.', {
|
|
20
|
+
language: 'yaml',
|
|
21
|
+
body: `x-scalar-cookies:
|
|
22
|
+
- name: session
|
|
23
|
+
value: abc123
|
|
24
|
+
path: /`,
|
|
25
|
+
}),
|
|
26
|
+
});
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const XScalarOrder: import("@scalar/validation").ObjectSchema<{
|
|
2
|
+
'x-scalar-order': import("@scalar/validation").OptionalSchema<import("@scalar/validation").ArraySchema<import("@scalar/validation").StringSchema>>;
|
|
3
|
+
}>;
|
|
4
|
+
//# sourceMappingURL=x-scalar-order.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"x-scalar-order.d.ts","sourceRoot":"","sources":["../../../src/extensions/general/x-scalar-order.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,YAAY;;EAqBxB,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { array, object, optional, string } from '@scalar/validation';
|
|
2
|
+
import { typeCommentWithExample } from '../type-comment.js';
|
|
3
|
+
export const XScalarOrder = object({
|
|
4
|
+
'x-scalar-order': optional(array(string(), {
|
|
5
|
+
typeComment: 'Ordered list of element identifiers (tags, operations, etc.)',
|
|
6
|
+
})),
|
|
7
|
+
}, {
|
|
8
|
+
typeName: 'XScalarOrder',
|
|
9
|
+
typeComment: typeCommentWithExample('Custom display order for elements in the Scalar UI (tags, operations, tag groups).', {
|
|
10
|
+
language: 'yaml',
|
|
11
|
+
body: `x-scalar-order:
|
|
12
|
+
- users
|
|
13
|
+
- pets
|
|
14
|
+
- admin`,
|
|
15
|
+
}),
|
|
16
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Operation-level Scalar extensions.
|
|
3
|
+
*
|
|
4
|
+
* Applied on OpenAPI `paths` operations. Covers UI badges, code samples, stability, scripts,
|
|
5
|
+
* and client state such as selected content types and disabled parameters.
|
|
6
|
+
*/
|
|
7
|
+
export { XBadge, XBadges } from './x-badge.js';
|
|
8
|
+
export { XCodeSample, XCodeSamples } from './x-code-samples.js';
|
|
9
|
+
export { XDraftExamples } from './x-draft-examples.js';
|
|
10
|
+
export { XScalarDisableParameters } from './x-scalar-disable-parameters.js';
|
|
11
|
+
export { XScalarSelectedContentType } from './x-scalar-selected-content-type.js';
|
|
12
|
+
export { XScalarStability, XScalarStabilityValues } from './x-scalar-stability.js';
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/extensions/operation/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAC3C,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AACnD,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAA;AACxE,OAAO,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAA;AAC7E,OAAO,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Operation-level Scalar extensions.
|
|
3
|
+
*
|
|
4
|
+
* Applied on OpenAPI `paths` operations. Covers UI badges, code samples, stability, scripts,
|
|
5
|
+
* and client state such as selected content types and disabled parameters.
|
|
6
|
+
*/
|
|
7
|
+
export { XBadge, XBadges } from './x-badge.js';
|
|
8
|
+
export { XCodeSample, XCodeSamples } from './x-code-samples.js';
|
|
9
|
+
export { XDraftExamples } from './x-draft-examples.js';
|
|
10
|
+
export { XScalarDisableParameters } from './x-scalar-disable-parameters.js';
|
|
11
|
+
export { XScalarSelectedContentType } from './x-scalar-selected-content-type.js';
|
|
12
|
+
export { XScalarStability, XScalarStabilityValues } from './x-scalar-stability.js';
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Schema for individual badge configuration in the x-badges extension.
|
|
3
|
+
* Badges are indicators that can be displayed in API documentation.
|
|
4
|
+
*/
|
|
5
|
+
export declare const XBadge: import("@scalar/validation").ObjectSchema<{
|
|
6
|
+
name: import("@scalar/validation").StringSchema;
|
|
7
|
+
position: import("@scalar/validation").OptionalSchema<import("@scalar/validation").UnionSchema<readonly [import("@scalar/validation").LiteralSchema<"before">, import("@scalar/validation").LiteralSchema<"after">]>>;
|
|
8
|
+
color: import("@scalar/validation").OptionalSchema<import("@scalar/validation").StringSchema>;
|
|
9
|
+
}>;
|
|
10
|
+
/**
|
|
11
|
+
* Badges for an operation in the Scalar UI.
|
|
12
|
+
*
|
|
13
|
+
* You can add badges to operations to use as indicators in documentation. Each operation can have multiple badges,
|
|
14
|
+
* and the displayed color is also configurable.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```yaml
|
|
18
|
+
* paths:
|
|
19
|
+
* /hello-world:
|
|
20
|
+
* get:
|
|
21
|
+
* summary: Hello World
|
|
22
|
+
* x-badges:
|
|
23
|
+
* - name: Alpha
|
|
24
|
+
* - name: Beta
|
|
25
|
+
* position: before
|
|
26
|
+
* - name: Gamma
|
|
27
|
+
* position: after
|
|
28
|
+
* color: "#ffcc00"
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
export declare const XBadges: import("@scalar/validation").ObjectSchema<{
|
|
32
|
+
'x-badges': import("@scalar/validation").OptionalSchema<import("@scalar/validation").ArraySchema<import("@scalar/validation").ObjectSchema<{
|
|
33
|
+
name: import("@scalar/validation").StringSchema;
|
|
34
|
+
position: import("@scalar/validation").OptionalSchema<import("@scalar/validation").UnionSchema<readonly [import("@scalar/validation").LiteralSchema<"before">, import("@scalar/validation").LiteralSchema<"after">]>>;
|
|
35
|
+
color: import("@scalar/validation").OptionalSchema<import("@scalar/validation").StringSchema>;
|
|
36
|
+
}>>>;
|
|
37
|
+
}>;
|
|
38
|
+
//# sourceMappingURL=x-badge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"x-badge.d.ts","sourceRoot":"","sources":["../../../src/extensions/operation/x-badge.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,eAAO,MAAM,MAAM;;;;EAyBlB,CAAA;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,OAAO;;;;;;EAqBnB,CAAA"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { array, literal, object, optional, string, union } from '@scalar/validation';
|
|
2
|
+
import { typeCommentWithExample } from '../type-comment.js';
|
|
3
|
+
/**
|
|
4
|
+
* Schema for individual badge configuration in the x-badges extension.
|
|
5
|
+
* Badges are indicators that can be displayed in API documentation.
|
|
6
|
+
*/
|
|
7
|
+
export const XBadge = object({
|
|
8
|
+
name: string({
|
|
9
|
+
typeComment: 'The text that displays in the badge. This is required for all badges.',
|
|
10
|
+
}),
|
|
11
|
+
position: optional(union([literal('before'), literal('after')], {
|
|
12
|
+
typeComment: 'The position of the badge in relation to the header. Defaults to `after` when omitted.',
|
|
13
|
+
})),
|
|
14
|
+
color: optional(string({
|
|
15
|
+
typeComment: 'The color of the badge in various formats (keywords, RGB, RGBA, HSL, HSLA, Hexadecimal)',
|
|
16
|
+
})),
|
|
17
|
+
}, {
|
|
18
|
+
typeName: 'XBadge',
|
|
19
|
+
typeComment: typeCommentWithExample('Configuration for a single badge in the x-badges extension.', {
|
|
20
|
+
language: 'yaml',
|
|
21
|
+
body: `name: Beta
|
|
22
|
+
position: before
|
|
23
|
+
color: "#ffcc00"`,
|
|
24
|
+
}),
|
|
25
|
+
});
|
|
26
|
+
/**
|
|
27
|
+
* Badges for an operation in the Scalar UI.
|
|
28
|
+
*
|
|
29
|
+
* You can add badges to operations to use as indicators in documentation. Each operation can have multiple badges,
|
|
30
|
+
* and the displayed color is also configurable.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```yaml
|
|
34
|
+
* paths:
|
|
35
|
+
* /hello-world:
|
|
36
|
+
* get:
|
|
37
|
+
* summary: Hello World
|
|
38
|
+
* x-badges:
|
|
39
|
+
* - name: Alpha
|
|
40
|
+
* - name: Beta
|
|
41
|
+
* position: before
|
|
42
|
+
* - name: Gamma
|
|
43
|
+
* position: after
|
|
44
|
+
* color: "#ffcc00"
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
export const XBadges = object({
|
|
48
|
+
'x-badges': optional(array(XBadge, {
|
|
49
|
+
typeComment: 'Badges displayed for this operation in documentation',
|
|
50
|
+
})),
|
|
51
|
+
}, {
|
|
52
|
+
typeName: 'XBadges',
|
|
53
|
+
typeComment: typeCommentWithExample('Badges for an operation in the Scalar UI. Use as visual indicators in documentation.', {
|
|
54
|
+
language: 'yaml',
|
|
55
|
+
body: `x-badges:
|
|
56
|
+
- name: Alpha
|
|
57
|
+
- name: Beta
|
|
58
|
+
position: before`,
|
|
59
|
+
}),
|
|
60
|
+
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export declare const XCodeSample: import("@scalar/validation").ObjectSchema<{
|
|
2
|
+
lang: import("@scalar/validation").OptionalSchema<import("@scalar/validation").StringSchema>;
|
|
3
|
+
label: import("@scalar/validation").OptionalSchema<import("@scalar/validation").StringSchema>;
|
|
4
|
+
source: import("@scalar/validation").StringSchema;
|
|
5
|
+
}>;
|
|
6
|
+
export declare const XCodeSamples: import("@scalar/validation").ObjectSchema<{
|
|
7
|
+
'x-codeSamples': import("@scalar/validation").OptionalSchema<import("@scalar/validation").ArraySchema<import("@scalar/validation").ObjectSchema<{
|
|
8
|
+
lang: import("@scalar/validation").OptionalSchema<import("@scalar/validation").StringSchema>;
|
|
9
|
+
label: import("@scalar/validation").OptionalSchema<import("@scalar/validation").StringSchema>;
|
|
10
|
+
source: import("@scalar/validation").StringSchema;
|
|
11
|
+
}>>>;
|
|
12
|
+
'x-code-samples': import("@scalar/validation").OptionalSchema<import("@scalar/validation").ArraySchema<import("@scalar/validation").ObjectSchema<{
|
|
13
|
+
lang: import("@scalar/validation").OptionalSchema<import("@scalar/validation").StringSchema>;
|
|
14
|
+
label: import("@scalar/validation").OptionalSchema<import("@scalar/validation").StringSchema>;
|
|
15
|
+
source: import("@scalar/validation").StringSchema;
|
|
16
|
+
}>>>;
|
|
17
|
+
'x-custom-examples': import("@scalar/validation").OptionalSchema<import("@scalar/validation").ArraySchema<import("@scalar/validation").ObjectSchema<{
|
|
18
|
+
lang: import("@scalar/validation").OptionalSchema<import("@scalar/validation").StringSchema>;
|
|
19
|
+
label: import("@scalar/validation").OptionalSchema<import("@scalar/validation").StringSchema>;
|
|
20
|
+
source: import("@scalar/validation").StringSchema;
|
|
21
|
+
}>>>;
|
|
22
|
+
}>;
|
|
23
|
+
//# sourceMappingURL=x-code-samples.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"x-code-samples.d.ts","sourceRoot":"","sources":["../../../src/extensions/operation/x-code-samples.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,WAAW;;;;EAUvB,CAAA;AAED,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;EAmBxB,CAAA"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { array, object, optional, string } from '@scalar/validation';
|
|
2
|
+
import { typeCommentInlineCode, typeCommentWithExample } from '../type-comment.js';
|
|
3
|
+
export const XCodeSample = object({
|
|
4
|
+
lang: optional(string({ typeComment: 'Programming language for syntax highlighting' })),
|
|
5
|
+
label: optional(string({ typeComment: 'Label shown in the code sample picker' })),
|
|
6
|
+
source: string({ typeComment: 'Source code for the sample' }),
|
|
7
|
+
}, {
|
|
8
|
+
typeName: 'XCodeSample',
|
|
9
|
+
typeComment: 'A single code sample for documentation or examples',
|
|
10
|
+
});
|
|
11
|
+
export const XCodeSamples = object({
|
|
12
|
+
'x-codeSamples': optional(array(XCodeSample, { typeComment: 'Code samples (camelCase spelling)' })),
|
|
13
|
+
'x-code-samples': optional(array(XCodeSample, { typeComment: 'Code samples (kebab-case spelling)' })),
|
|
14
|
+
'x-custom-examples': optional(array(XCodeSample, { typeComment: 'Custom code examples for the operation' })),
|
|
15
|
+
}, {
|
|
16
|
+
typeName: 'XCodeSamples',
|
|
17
|
+
typeComment: typeCommentWithExample(`Code samples attached to an operation. Supports ${typeCommentInlineCode('x-codeSamples')}, ${typeCommentInlineCode('x-code-samples')}, and ${typeCommentInlineCode('x-custom-examples')}.`, {
|
|
18
|
+
language: 'yaml',
|
|
19
|
+
body: `x-code-samples:
|
|
20
|
+
- lang: curl
|
|
21
|
+
label: cURL
|
|
22
|
+
source: curl https://api.example.com`,
|
|
23
|
+
}),
|
|
24
|
+
});
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const XDraftExamples: import("@scalar/validation").ObjectSchema<{
|
|
2
|
+
'x-draft-examples': import("@scalar/validation").OptionalSchema<import("@scalar/validation").ArraySchema<import("@scalar/validation").StringSchema>>;
|
|
3
|
+
}>;
|
|
4
|
+
//# sourceMappingURL=x-draft-examples.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"x-draft-examples.d.ts","sourceRoot":"","sources":["../../../src/extensions/operation/x-draft-examples.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,cAAc;;EAoB1B,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { array, object, optional, string } from '@scalar/validation';
|
|
2
|
+
import { typeCommentWithExample } from '../type-comment.js';
|
|
3
|
+
export const XDraftExamples = object({
|
|
4
|
+
'x-draft-examples': optional(array(string(), {
|
|
5
|
+
typeComment: 'Identifiers of draft examples attached to this operation',
|
|
6
|
+
})),
|
|
7
|
+
}, {
|
|
8
|
+
typeName: 'XDraftExamples',
|
|
9
|
+
typeComment: typeCommentWithExample('Draft example identifiers for an operation (in-progress examples not yet committed).', {
|
|
10
|
+
language: 'yaml',
|
|
11
|
+
body: `x-draft-examples:
|
|
12
|
+
- default
|
|
13
|
+
- error-case`,
|
|
14
|
+
}),
|
|
15
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const XScalarDisableParameters: import("@scalar/validation").ObjectSchema<{
|
|
2
|
+
'x-scalar-disable-parameters': import("@scalar/validation").OptionalSchema<import("@scalar/validation").ObjectSchema<{
|
|
3
|
+
'global-cookies': import("@scalar/validation").OptionalSchema<import("@scalar/validation").RecordSchema<import("@scalar/validation").StringSchema, import("@scalar/validation").RecordSchema<import("@scalar/validation").StringSchema, import("@scalar/validation").BooleanSchema>>>;
|
|
4
|
+
'global-headers': import("@scalar/validation").OptionalSchema<import("@scalar/validation").RecordSchema<import("@scalar/validation").StringSchema, import("@scalar/validation").RecordSchema<import("@scalar/validation").StringSchema, import("@scalar/validation").BooleanSchema>>>;
|
|
5
|
+
'default-headers': import("@scalar/validation").OptionalSchema<import("@scalar/validation").RecordSchema<import("@scalar/validation").StringSchema, import("@scalar/validation").RecordSchema<import("@scalar/validation").StringSchema, import("@scalar/validation").BooleanSchema>>>;
|
|
6
|
+
}>>;
|
|
7
|
+
}>;
|
|
8
|
+
//# sourceMappingURL=x-scalar-disable-parameters.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"x-scalar-disable-parameters.d.ts","sourceRoot":"","sources":["../../../src/extensions/operation/x-scalar-disable-parameters.ts"],"names":[],"mappings":"AAoEA,eAAO,MAAM,wBAAwB;;;;;;EAuBpC,CAAA"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { boolean, object, optional, record, string } from '@scalar/validation';
|
|
2
|
+
import { typeCommentExample, typeCommentSections } from '../type-comment.js';
|
|
3
|
+
/**
|
|
4
|
+
* Custom OpenAPI extension to track which parameters are disabled across different contexts.
|
|
5
|
+
*
|
|
6
|
+
* This extension allows the API client to persist disabled states for different types of
|
|
7
|
+
* parameters (global cookies, global headers, default headers) across multiple examples.
|
|
8
|
+
*
|
|
9
|
+
* This is necessary because:
|
|
10
|
+
* - Different parameter types have different scopes and behaviors
|
|
11
|
+
* - Users need to disable specific parameters per example without affecting others
|
|
12
|
+
* - The disabled state must persist across sessions
|
|
13
|
+
* - Global parameters can be disabled independently of operation-specific ones
|
|
14
|
+
*
|
|
15
|
+
* Structure:
|
|
16
|
+
* - Top level: Parameter category ("global-cookies", "global-headers", "default-headers")
|
|
17
|
+
* - Second level: Example keys (like "default", "custom-example")
|
|
18
|
+
* - Third level: Parameter names (like "Content-Type", "Cookie")
|
|
19
|
+
* - Values: true = disabled, false = enabled
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```json
|
|
23
|
+
* {
|
|
24
|
+
* "x-scalar-disable-parameters": {
|
|
25
|
+
* "global-cookies": {
|
|
26
|
+
* "default": {
|
|
27
|
+
* "session": true
|
|
28
|
+
* }
|
|
29
|
+
* },
|
|
30
|
+
* "global-headers": {
|
|
31
|
+
* "default": {
|
|
32
|
+
* "X-API-Key": false
|
|
33
|
+
* }
|
|
34
|
+
* },
|
|
35
|
+
* "default-headers": {
|
|
36
|
+
* "default": {
|
|
37
|
+
* "Content-Type": true,
|
|
38
|
+
* "Accept": false
|
|
39
|
+
* }
|
|
40
|
+
* }
|
|
41
|
+
* }
|
|
42
|
+
* }
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
const ExampleParameterState = record(string(), boolean());
|
|
46
|
+
const ExamplesParameterStates = record(string(), ExampleParameterState);
|
|
47
|
+
const DisableParametersInner = object({
|
|
48
|
+
'global-cookies': optional(ExamplesParameterStates, {
|
|
49
|
+
typeComment: 'Disabled state for global cookie parameters across examples',
|
|
50
|
+
}),
|
|
51
|
+
'global-headers': optional(ExamplesParameterStates, {
|
|
52
|
+
typeComment: 'Disabled state for global header parameters across examples',
|
|
53
|
+
}),
|
|
54
|
+
'default-headers': optional(ExamplesParameterStates, {
|
|
55
|
+
typeComment: 'Disabled state for default header parameters across examples',
|
|
56
|
+
}),
|
|
57
|
+
}, {
|
|
58
|
+
typeName: 'DisableParametersConfig',
|
|
59
|
+
typeComment: 'Disabled parameter state by category and example',
|
|
60
|
+
});
|
|
61
|
+
export const XScalarDisableParameters = object({
|
|
62
|
+
'x-scalar-disable-parameters': optional(DisableParametersInner, {
|
|
63
|
+
typeComment: 'Disabled parameter state organized by category, example, and parameter name',
|
|
64
|
+
}),
|
|
65
|
+
}, {
|
|
66
|
+
typeName: 'XScalarDisableParameters',
|
|
67
|
+
typeComment: typeCommentSections('Tracks which parameters are disabled across examples in the API client.', 'Structure: category (global-cookies, global-headers, default-headers) → example key → parameter name → true if disabled.', typeCommentExample('json', `{
|
|
68
|
+
"x-scalar-disable-parameters": {
|
|
69
|
+
"default-headers": {
|
|
70
|
+
"default": { "Content-Type": true, "Accept": false }
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}`)),
|
|
74
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Schema for the x-scalar-selected-content-type extension on an OpenAPI operation.
|
|
3
|
+
*
|
|
4
|
+
* The key represents the example name, and the value is the selected content type string.
|
|
5
|
+
* Used by Scalar to track which content type is selected for each example in request or response bodies.
|
|
6
|
+
*/
|
|
7
|
+
export declare const XScalarSelectedContentType: import("@scalar/validation").ObjectSchema<{
|
|
8
|
+
'x-scalar-selected-content-type': import("@scalar/validation").OptionalSchema<import("@scalar/validation").RecordSchema<import("@scalar/validation").StringSchema, import("@scalar/validation").StringSchema>>;
|
|
9
|
+
}>;
|
|
10
|
+
//# sourceMappingURL=x-scalar-selected-content-type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"x-scalar-selected-content-type.d.ts","sourceRoot":"","sources":["../../../src/extensions/operation/x-scalar-selected-content-type.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AACH,eAAO,MAAM,0BAA0B;;EAoBtC,CAAA"}
|