@scalar/workspace-store 0.40.2 → 0.40.3
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 +7 -0
- package/dist/client.d.ts +7 -2
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +820 -681
- package/dist/entities/auth/index.js +96 -101
- package/dist/entities/auth/schema.js +42 -116
- package/dist/entities/history/index.js +80 -60
- package/dist/entities/history/schema.js +94 -88
- package/dist/events/bus.js +146 -93
- package/dist/events/definitions/analytics.js +1 -1
- package/dist/events/definitions/auth.js +1 -1
- package/dist/events/definitions/common.js +1 -1
- package/dist/events/definitions/cookie.js +1 -1
- package/dist/events/definitions/document.js +1 -1
- package/dist/events/definitions/environment.js +1 -1
- package/dist/events/definitions/hooks.js +1 -1
- package/dist/events/definitions/index.js +1 -1
- package/dist/events/definitions/meta.js +1 -1
- package/dist/events/definitions/operation.js +1 -1
- package/dist/events/definitions/server.js +1 -1
- package/dist/events/definitions/tabs.js +1 -1
- package/dist/events/definitions/tag.js +1 -1
- package/dist/events/definitions/ui.js +1 -1
- package/dist/events/definitions/workspace.js +1 -1
- package/dist/events/index.js +3 -9
- package/dist/events/listeners.js +20 -22
- package/dist/events/old-definitions.js +15 -12
- package/dist/helpers/deep-clone.js +33 -17
- package/dist/helpers/detect-changes-proxy.js +95 -57
- package/dist/helpers/general.js +78 -23
- package/dist/helpers/generate-unique-value.js +77 -45
- package/dist/helpers/get-fetch.js +12 -10
- package/dist/helpers/get-resolved-ref.js +11 -10
- package/dist/helpers/is-non-optional-security-requirement.js +3 -6
- package/dist/helpers/merge-object.js +71 -30
- package/dist/helpers/overrides-proxy.js +98 -58
- package/dist/helpers/unpack-proxy.js +60 -58
- package/dist/mutators/auth.js +358 -230
- package/dist/mutators/cookie.js +59 -42
- package/dist/mutators/document.js +104 -66
- package/dist/mutators/environment.js +97 -72
- package/dist/mutators/helpers.js +9 -13
- package/dist/mutators/index.js +62 -49
- package/dist/mutators/operation/body.js +88 -57
- package/dist/mutators/operation/extensions.js +20 -12
- package/dist/mutators/operation/helpers/fetch-request-to-har.js +144 -107
- package/dist/mutators/operation/helpers/fetch-response-to-har.js +143 -95
- package/dist/mutators/operation/helpers/get-parameter-position.js +12 -12
- package/dist/mutators/operation/helpers/har-to-operation.js +169 -132
- package/dist/mutators/operation/helpers/sync-path-parameters.js +109 -60
- package/dist/mutators/operation/history.js +60 -64
- package/dist/mutators/operation/index.js +25 -49
- package/dist/mutators/operation/operation.js +349 -240
- package/dist/mutators/operation/parameters.js +157 -93
- package/dist/mutators/server.js +213 -152
- package/dist/mutators/tabs.js +173 -130
- package/dist/mutators/tag.js +131 -97
- package/dist/mutators/workspace.js +72 -42
- package/dist/navigation/get-navigation-options.js +97 -84
- package/dist/navigation/helpers/get-openapi-object.js +46 -29
- package/dist/navigation/helpers/get-operation-entries.js +72 -32
- package/dist/navigation/helpers/get-parent-entry.js +16 -12
- package/dist/navigation/helpers/get-tag-entries.js +56 -29
- package/dist/navigation/helpers/get-tag.js +22 -23
- package/dist/navigation/helpers/get-x-keys.js +13 -9
- package/dist/navigation/helpers/traverse-description.js +90 -72
- package/dist/navigation/helpers/traverse-document.js +111 -98
- package/dist/navigation/helpers/traverse-examples.js +35 -31
- package/dist/navigation/helpers/traverse-paths.js +118 -106
- package/dist/navigation/helpers/traverse-schemas.js +65 -64
- package/dist/navigation/helpers/traverse-tags.js +158 -129
- package/dist/navigation/helpers/traverse-webhooks.js +96 -90
- package/dist/navigation/helpers/update-order-ids.js +59 -51
- package/dist/navigation/helpers/utils.js +71 -21
- package/dist/navigation/index.js +5 -13
- package/dist/navigation/types.js +1 -1
- package/dist/persistence/index.js +283 -285
- package/dist/persistence/indexdb.js +263 -126
- package/dist/plugins/bundler/helpers.js +21 -12
- package/dist/plugins/bundler/index.d.ts +7 -0
- package/dist/plugins/bundler/index.d.ts.map +1 -1
- package/dist/plugins/bundler/index.js +305 -171
- package/dist/plugins/client/index.js +1 -5
- package/dist/plugins/client/persistence.js +95 -90
- package/dist/resolve.js +18 -25
- package/dist/schemas/compose.js +6 -7
- package/dist/schemas/extensions/document/x-internal.js +3 -7
- package/dist/schemas/extensions/document/x-scalar-environments.js +16 -22
- package/dist/schemas/extensions/document/x-scalar-icon.js +3 -7
- package/dist/schemas/extensions/document/x-scalar-ignore.js +3 -7
- package/dist/schemas/extensions/document/x-scalar-is-dirty.js +21 -8
- package/dist/schemas/extensions/document/x-scalar-original-document-hash.js +17 -8
- package/dist/schemas/extensions/document/x-scalar-registry-meta.js +15 -21
- package/dist/schemas/extensions/document/x-scalar-sdk-installation.js +5 -13
- package/dist/schemas/extensions/document/x-scalar-watch-mode.js +4 -8
- package/dist/schemas/extensions/document/x-tags.js +3 -7
- package/dist/schemas/extensions/example/x-disabled.js +17 -7
- package/dist/schemas/extensions/general/x-scalar-active-environment.js +4 -7
- package/dist/schemas/extensions/general/x-scalar-cookies.js +9 -14
- package/dist/schemas/extensions/general/x-scalar-order.js +8 -7
- package/dist/schemas/extensions/operation/index.js +4 -23
- package/dist/schemas/extensions/operation/x-badge.js +42 -50
- package/dist/schemas/extensions/operation/x-code-samples.js +8 -12
- package/dist/schemas/extensions/operation/x-draft-examples.js +3 -7
- package/dist/schemas/extensions/operation/x-post-response.js +18 -7
- package/dist/schemas/extensions/operation/x-scalar-disable-parameters.js +57 -13
- package/dist/schemas/extensions/operation/x-scalar-selected-content-type.js +9 -7
- package/dist/schemas/extensions/operation/x-scalar-stability.js +15 -14
- package/dist/schemas/extensions/parameter/x-global.js +12 -7
- package/dist/schemas/extensions/schema/x-additional-properties-name.js +10 -7
- package/dist/schemas/extensions/schema/x-enum-descriptions.js +17 -12
- package/dist/schemas/extensions/schema/x-enum-varnames.js +21 -8
- package/dist/schemas/extensions/schema/x-examples.js +3 -7
- package/dist/schemas/extensions/schema/x-variable.js +3 -7
- package/dist/schemas/extensions/security/index.js +1 -1
- package/dist/schemas/extensions/security/x-default-scopes.js +16 -7
- package/dist/schemas/extensions/security/x-scalar-credentials-location.js +16 -7
- package/dist/schemas/extensions/security/x-scalar-security-body.js +14 -7
- package/dist/schemas/extensions/security/x-scalar-security-query.js +14 -7
- package/dist/schemas/extensions/security/x-scalar-security-secrets.js +66 -37
- package/dist/schemas/extensions/security/x-tokenName.js +11 -7
- package/dist/schemas/extensions/security/x-use-pkce.js +6 -10
- package/dist/schemas/extensions/server/x-scalar-selected-server.js +3 -7
- package/dist/schemas/extensions/tag/index.js +1 -1
- package/dist/schemas/extensions/tag/x-display-name.js +11 -7
- package/dist/schemas/extensions/tag/x-tag-groups.js +13 -15
- package/dist/schemas/extensions/workspace/index.js +2 -11
- package/dist/schemas/extensions/workspace/x-scalar-active-proxy.js +13 -7
- package/dist/schemas/extensions/workspace/x-scalar-tabs.js +15 -13
- package/dist/schemas/extensions.js +11 -15
- package/dist/schemas/inmemory-workspace.js +13 -21
- package/dist/schemas/navigation.js +48 -85
- package/dist/schemas/reference-config/appearance.js +15 -22
- package/dist/schemas/reference-config/features.js +14 -21
- package/dist/schemas/reference-config/index.js +42 -44
- package/dist/schemas/reference-config/meta.js +11 -18
- package/dist/schemas/reference-config/routing.js +7 -14
- package/dist/schemas/reference-config/settings.js +10 -17
- package/dist/schemas/typebox-coerce.js +23 -6
- package/dist/schemas/v3.1/strict/callback.js +6 -12
- package/dist/schemas/v3.1/strict/components.js +26 -48
- package/dist/schemas/v3.1/strict/contact.js +9 -12
- package/dist/schemas/v3.1/strict/discriminator.js +11 -10
- package/dist/schemas/v3.1/strict/encoding.js +15 -12
- package/dist/schemas/v3.1/strict/example.js +11 -13
- package/dist/schemas/v3.1/strict/external-documentation.js +7 -10
- package/dist/schemas/v3.1/strict/header.js +27 -28
- package/dist/schemas/v3.1/strict/info.js +10 -16
- package/dist/schemas/v3.1/strict/license.js +9 -12
- package/dist/schemas/v3.1/strict/link.js +22 -19
- package/dist/schemas/v3.1/strict/media-type.js +17 -16
- package/dist/schemas/v3.1/strict/oauth-flow.js +28 -62
- package/dist/schemas/v3.1/strict/oauthflows.js +14 -20
- package/dist/schemas/v3.1/strict/openapi-document.js +126 -210
- package/dist/schemas/v3.1/strict/operation.js +16 -43
- package/dist/schemas/v3.1/strict/parameter.js +27 -35
- package/dist/schemas/v3.1/strict/path-item.js +36 -40
- package/dist/schemas/v3.1/strict/paths.js +8 -11
- package/dist/schemas/v3.1/strict/ref-definitions.js +76 -100
- package/dist/schemas/v3.1/strict/reference.js +18 -21
- package/dist/schemas/v3.1/strict/request-body.js +8 -16
- package/dist/schemas/v3.1/strict/response.js +12 -16
- package/dist/schemas/v3.1/strict/responses.js +13 -11
- package/dist/schemas/v3.1/strict/schema.js +149 -157
- package/dist/schemas/v3.1/strict/security-requirement.js +13 -12
- package/dist/schemas/v3.1/strict/security-scheme.js +29 -41
- package/dist/schemas/v3.1/strict/server-variable.js +9 -12
- package/dist/schemas/v3.1/strict/server.js +10 -13
- package/dist/schemas/v3.1/strict/tag.js +11 -20
- package/dist/schemas/v3.1/strict/type-guards.js +20 -20
- package/dist/schemas/v3.1/strict/xml.js +17 -16
- package/dist/schemas/workspace-specification/index.js +11 -23
- package/dist/schemas/workspace-specification/info.js +4 -8
- package/dist/schemas/workspace.js +25 -51
- package/dist/schemas.js +2 -6
- package/dist/server.js +286 -176
- package/dist/workspace-plugin.js +1 -1
- package/package.json +13 -19
- package/dist/client.js.map +0 -7
- package/dist/entities/auth/index.js.map +0 -7
- package/dist/entities/auth/schema.js.map +0 -7
- package/dist/entities/history/index.js.map +0 -7
- package/dist/entities/history/schema.js.map +0 -7
- package/dist/events/bus.js.map +0 -7
- package/dist/events/definitions/analytics.js.map +0 -7
- package/dist/events/definitions/auth.js.map +0 -7
- package/dist/events/definitions/common.js.map +0 -7
- package/dist/events/definitions/cookie.js.map +0 -7
- package/dist/events/definitions/document.js.map +0 -7
- package/dist/events/definitions/environment.js.map +0 -7
- package/dist/events/definitions/hooks.js.map +0 -7
- package/dist/events/definitions/index.js.map +0 -7
- package/dist/events/definitions/meta.js.map +0 -7
- package/dist/events/definitions/operation.js.map +0 -7
- package/dist/events/definitions/server.js.map +0 -7
- package/dist/events/definitions/tabs.js.map +0 -7
- package/dist/events/definitions/tag.js.map +0 -7
- package/dist/events/definitions/ui.js.map +0 -7
- package/dist/events/definitions/workspace.js.map +0 -7
- package/dist/events/index.js.map +0 -7
- package/dist/events/listeners.js.map +0 -7
- package/dist/events/old-definitions.js.map +0 -7
- package/dist/helpers/apply-selective-updates.d.ts +0 -19
- package/dist/helpers/apply-selective-updates.d.ts.map +0 -1
- package/dist/helpers/apply-selective-updates.js +0 -37
- package/dist/helpers/apply-selective-updates.js.map +0 -7
- package/dist/helpers/deep-clone.js.map +0 -7
- package/dist/helpers/detect-changes-proxy.js.map +0 -7
- package/dist/helpers/general.js.map +0 -7
- package/dist/helpers/generate-unique-value.js.map +0 -7
- package/dist/helpers/get-fetch.js.map +0 -7
- package/dist/helpers/get-resolved-ref.js.map +0 -7
- package/dist/helpers/is-non-optional-security-requirement.js.map +0 -7
- package/dist/helpers/merge-object.js.map +0 -7
- package/dist/helpers/overrides-proxy.js.map +0 -7
- package/dist/helpers/unpack-proxy.js.map +0 -7
- package/dist/mutators/auth.js.map +0 -7
- package/dist/mutators/cookie.js.map +0 -7
- package/dist/mutators/document.js.map +0 -7
- package/dist/mutators/environment.js.map +0 -7
- package/dist/mutators/helpers.js.map +0 -7
- package/dist/mutators/index.js.map +0 -7
- package/dist/mutators/operation/body.js.map +0 -7
- package/dist/mutators/operation/extensions.js.map +0 -7
- package/dist/mutators/operation/helpers/fetch-request-to-har.js.map +0 -7
- package/dist/mutators/operation/helpers/fetch-response-to-har.js.map +0 -7
- package/dist/mutators/operation/helpers/get-parameter-position.js.map +0 -7
- package/dist/mutators/operation/helpers/har-to-operation.js.map +0 -7
- package/dist/mutators/operation/helpers/sync-path-parameters.js.map +0 -7
- package/dist/mutators/operation/history.js.map +0 -7
- package/dist/mutators/operation/index.js.map +0 -7
- package/dist/mutators/operation/operation.js.map +0 -7
- package/dist/mutators/operation/parameters.js.map +0 -7
- package/dist/mutators/server.js.map +0 -7
- package/dist/mutators/tabs.js.map +0 -7
- package/dist/mutators/tag.js.map +0 -7
- package/dist/mutators/workspace.js.map +0 -7
- package/dist/navigation/get-navigation-options.js.map +0 -7
- package/dist/navigation/helpers/get-openapi-object.js.map +0 -7
- package/dist/navigation/helpers/get-operation-entries.js.map +0 -7
- package/dist/navigation/helpers/get-parent-entry.js.map +0 -7
- package/dist/navigation/helpers/get-tag-entries.js.map +0 -7
- package/dist/navigation/helpers/get-tag.js.map +0 -7
- package/dist/navigation/helpers/get-x-keys.js.map +0 -7
- package/dist/navigation/helpers/traverse-description.js.map +0 -7
- package/dist/navigation/helpers/traverse-document.js.map +0 -7
- package/dist/navigation/helpers/traverse-examples.js.map +0 -7
- package/dist/navigation/helpers/traverse-paths.js.map +0 -7
- package/dist/navigation/helpers/traverse-schemas.js.map +0 -7
- package/dist/navigation/helpers/traverse-tags.js.map +0 -7
- package/dist/navigation/helpers/traverse-webhooks.js.map +0 -7
- package/dist/navigation/helpers/update-order-ids.js.map +0 -7
- package/dist/navigation/helpers/utils.js.map +0 -7
- package/dist/navigation/index.js.map +0 -7
- package/dist/navigation/types.js.map +0 -7
- package/dist/persistence/index.js.map +0 -7
- package/dist/persistence/indexdb.js.map +0 -7
- package/dist/plugins/bundler/helpers.js.map +0 -7
- package/dist/plugins/bundler/index.js.map +0 -7
- package/dist/plugins/client/index.js.map +0 -7
- package/dist/plugins/client/persistence.js.map +0 -7
- package/dist/resolve.js.map +0 -7
- package/dist/schemas/compose.js.map +0 -7
- package/dist/schemas/extensions/document/x-internal.js.map +0 -7
- package/dist/schemas/extensions/document/x-scalar-environments.js.map +0 -7
- package/dist/schemas/extensions/document/x-scalar-icon.js.map +0 -7
- package/dist/schemas/extensions/document/x-scalar-ignore.js.map +0 -7
- package/dist/schemas/extensions/document/x-scalar-is-dirty.js.map +0 -7
- package/dist/schemas/extensions/document/x-scalar-original-document-hash.js.map +0 -7
- package/dist/schemas/extensions/document/x-scalar-registry-meta.js.map +0 -7
- package/dist/schemas/extensions/document/x-scalar-sdk-installation.js.map +0 -7
- package/dist/schemas/extensions/document/x-scalar-watch-mode.js.map +0 -7
- package/dist/schemas/extensions/document/x-tags.js.map +0 -7
- package/dist/schemas/extensions/example/x-disabled.js.map +0 -7
- package/dist/schemas/extensions/general/x-scalar-active-environment.js.map +0 -7
- package/dist/schemas/extensions/general/x-scalar-cookies.js.map +0 -7
- package/dist/schemas/extensions/general/x-scalar-order.js.map +0 -7
- package/dist/schemas/extensions/operation/index.js.map +0 -7
- package/dist/schemas/extensions/operation/x-badge.js.map +0 -7
- package/dist/schemas/extensions/operation/x-code-samples.js.map +0 -7
- package/dist/schemas/extensions/operation/x-draft-examples.js.map +0 -7
- package/dist/schemas/extensions/operation/x-post-response.js.map +0 -7
- package/dist/schemas/extensions/operation/x-scalar-disable-parameters.js.map +0 -7
- package/dist/schemas/extensions/operation/x-scalar-selected-content-type.js.map +0 -7
- package/dist/schemas/extensions/operation/x-scalar-stability.js.map +0 -7
- package/dist/schemas/extensions/parameter/x-global.js.map +0 -7
- package/dist/schemas/extensions/schema/x-additional-properties-name.js.map +0 -7
- package/dist/schemas/extensions/schema/x-enum-descriptions.js.map +0 -7
- package/dist/schemas/extensions/schema/x-enum-varnames.js.map +0 -7
- package/dist/schemas/extensions/schema/x-examples.js.map +0 -7
- package/dist/schemas/extensions/schema/x-variable.js.map +0 -7
- package/dist/schemas/extensions/security/index.js.map +0 -7
- package/dist/schemas/extensions/security/x-default-scopes.js.map +0 -7
- package/dist/schemas/extensions/security/x-scalar-credentials-location.js.map +0 -7
- package/dist/schemas/extensions/security/x-scalar-security-body.js.map +0 -7
- package/dist/schemas/extensions/security/x-scalar-security-query.js.map +0 -7
- package/dist/schemas/extensions/security/x-scalar-security-secrets.js.map +0 -7
- package/dist/schemas/extensions/security/x-tokenName.js.map +0 -7
- package/dist/schemas/extensions/security/x-use-pkce.js.map +0 -7
- package/dist/schemas/extensions/server/x-scalar-selected-server.js.map +0 -7
- package/dist/schemas/extensions/tag/index.js.map +0 -7
- package/dist/schemas/extensions/tag/x-display-name.js.map +0 -7
- package/dist/schemas/extensions/tag/x-tag-groups.js.map +0 -7
- package/dist/schemas/extensions/workspace/index.js.map +0 -7
- package/dist/schemas/extensions/workspace/x-scalar-active-proxy.js.map +0 -7
- package/dist/schemas/extensions/workspace/x-scalar-tabs.js.map +0 -7
- package/dist/schemas/extensions.js.map +0 -7
- package/dist/schemas/inmemory-workspace.js.map +0 -7
- package/dist/schemas/navigation.js.map +0 -7
- package/dist/schemas/reference-config/appearance.js.map +0 -7
- package/dist/schemas/reference-config/features.js.map +0 -7
- package/dist/schemas/reference-config/index.js.map +0 -7
- package/dist/schemas/reference-config/meta.js.map +0 -7
- package/dist/schemas/reference-config/routing.js.map +0 -7
- package/dist/schemas/reference-config/settings.js.map +0 -7
- package/dist/schemas/typebox-coerce.js.map +0 -7
- package/dist/schemas/v3.1/strict/callback.js.map +0 -7
- package/dist/schemas/v3.1/strict/components.js.map +0 -7
- package/dist/schemas/v3.1/strict/contact.js.map +0 -7
- package/dist/schemas/v3.1/strict/discriminator.js.map +0 -7
- package/dist/schemas/v3.1/strict/encoding.js.map +0 -7
- package/dist/schemas/v3.1/strict/example.js.map +0 -7
- package/dist/schemas/v3.1/strict/external-documentation.js.map +0 -7
- package/dist/schemas/v3.1/strict/header.js.map +0 -7
- package/dist/schemas/v3.1/strict/info.js.map +0 -7
- package/dist/schemas/v3.1/strict/license.js.map +0 -7
- package/dist/schemas/v3.1/strict/link.js.map +0 -7
- package/dist/schemas/v3.1/strict/media-type.js.map +0 -7
- package/dist/schemas/v3.1/strict/oauth-flow.js.map +0 -7
- package/dist/schemas/v3.1/strict/oauthflows.js.map +0 -7
- package/dist/schemas/v3.1/strict/openapi-document.js.map +0 -7
- package/dist/schemas/v3.1/strict/operation.js.map +0 -7
- package/dist/schemas/v3.1/strict/parameter.js.map +0 -7
- package/dist/schemas/v3.1/strict/path-item.js.map +0 -7
- package/dist/schemas/v3.1/strict/paths.js.map +0 -7
- package/dist/schemas/v3.1/strict/ref-definitions.js.map +0 -7
- package/dist/schemas/v3.1/strict/reference.js.map +0 -7
- package/dist/schemas/v3.1/strict/request-body.js.map +0 -7
- package/dist/schemas/v3.1/strict/response.js.map +0 -7
- package/dist/schemas/v3.1/strict/responses.js.map +0 -7
- package/dist/schemas/v3.1/strict/schema.js.map +0 -7
- package/dist/schemas/v3.1/strict/security-requirement.js.map +0 -7
- package/dist/schemas/v3.1/strict/security-scheme.js.map +0 -7
- package/dist/schemas/v3.1/strict/server-variable.js.map +0 -7
- package/dist/schemas/v3.1/strict/server.js.map +0 -7
- package/dist/schemas/v3.1/strict/tag.js.map +0 -7
- package/dist/schemas/v3.1/strict/type-guards.js.map +0 -7
- package/dist/schemas/v3.1/strict/xml.js.map +0 -7
- package/dist/schemas/workspace-specification/index.js.map +0 -7
- package/dist/schemas/workspace-specification/info.js.map +0 -7
- package/dist/schemas/workspace.js.map +0 -7
- package/dist/schemas.js.map +0 -7
- package/dist/server.js.map +0 -7
- package/dist/workspace-plugin.js.map +0 -7
|
@@ -1,41 +1,37 @@
|
|
|
1
|
-
import { Type } from
|
|
2
|
-
import { OperationObjectRef, ParameterObjectRef, ServerObjectRef } from
|
|
3
|
-
import { reference } from
|
|
4
|
-
const PathItemObjectSchemaDefinition = Type.Object({
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
1
|
+
import { Type } from '@scalar/typebox';
|
|
2
|
+
import { OperationObjectRef, ParameterObjectRef, ServerObjectRef } from './ref-definitions.js';
|
|
3
|
+
import { reference } from './reference.js';
|
|
4
|
+
export const PathItemObjectSchemaDefinition = Type.Object({
|
|
5
|
+
/**
|
|
6
|
+
* Allows for a referenced definition of this path item. The value MUST be in the form of a URI, and the referenced structure MUST be in the form of a Path Item Object. In case a Path Item Object field appears both in the defined object and the referenced object, the behavior is undefined. See the rules for resolving Relative References.
|
|
7
|
+
*
|
|
8
|
+
* Note: The behavior of $ref with adjacent properties is likely to change in future versions of this specification to bring it into closer alignment with the behavior of the Reference Object.
|
|
9
|
+
*/
|
|
10
|
+
'$ref': Type.Optional(Type.String()),
|
|
11
|
+
/** An optional string summary, intended to apply to all operations in this path. */
|
|
12
|
+
summary: Type.Optional(Type.String()),
|
|
13
|
+
/** An optional string description, intended to apply to all operations in this path. CommonMark syntax MAY be used for rich text representation. */
|
|
14
|
+
description: Type.Optional(Type.String()),
|
|
15
|
+
/** A definition of a GET operation on this path. */
|
|
16
|
+
get: Type.Optional(Type.Union([OperationObjectRef, reference(OperationObjectRef)])),
|
|
17
|
+
/** A definition of a PUT operation on this path. */
|
|
18
|
+
put: Type.Optional(Type.Union([OperationObjectRef, reference(OperationObjectRef)])),
|
|
19
|
+
/** A definition of a POST operation on this path. */
|
|
20
|
+
post: Type.Optional(Type.Union([OperationObjectRef, reference(OperationObjectRef)])),
|
|
21
|
+
/** A definition of a DELETE operation on this path. */
|
|
22
|
+
delete: Type.Optional(Type.Union([OperationObjectRef, reference(OperationObjectRef)])),
|
|
23
|
+
/** A definition of a PATCH operation on this path. */
|
|
24
|
+
patch: Type.Optional(Type.Union([OperationObjectRef, reference(OperationObjectRef)])),
|
|
25
|
+
/** A definition of a CONNECT operation on this path. */
|
|
26
|
+
connect: Type.Optional(Type.Union([OperationObjectRef, reference(OperationObjectRef)])),
|
|
27
|
+
/** A definition of a OPTIONS operation on this path. */
|
|
28
|
+
options: Type.Optional(Type.Union([OperationObjectRef, reference(OperationObjectRef)])),
|
|
29
|
+
/** A definition of a HEAD operation on this path. */
|
|
30
|
+
head: Type.Optional(Type.Union([OperationObjectRef, reference(OperationObjectRef)])),
|
|
31
|
+
/** A definition of a TRACE operation on this path. */
|
|
32
|
+
trace: Type.Optional(Type.Union([OperationObjectRef, reference(OperationObjectRef)])),
|
|
33
|
+
/** An alternative servers array to service all operations in this path. If a servers array is specified at the OpenAPI Object level, it will be overridden by this value. */
|
|
34
|
+
servers: Type.Optional(Type.Array(ServerObjectRef)),
|
|
35
|
+
/** A list of parameters that are applicable for all the operations described under this path. These parameters can be overridden at the operation level, but cannot be removed there. The list MUST NOT include duplicated parameters. A unique parameter is defined by a combination of a name and location. The list can use the Reference Object to link to parameters that are defined in the OpenAPI Object's components.parameters. */
|
|
36
|
+
parameters: Type.Optional(Type.Array(Type.Union([ParameterObjectRef, reference(ParameterObjectRef)]))),
|
|
37
37
|
});
|
|
38
|
-
export {
|
|
39
|
-
PathItemObjectSchemaDefinition
|
|
40
|
-
};
|
|
41
|
-
//# sourceMappingURL=path-item.js.map
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
import { Type } from
|
|
2
|
-
import { PathItemObjectRef } from
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
)
|
|
8
|
-
|
|
9
|
-
PathsObjectSchemaDefinition
|
|
10
|
-
};
|
|
11
|
-
//# sourceMappingURL=paths.js.map
|
|
1
|
+
import { Type } from '@scalar/typebox';
|
|
2
|
+
import { PathItemObjectRef } from './ref-definitions.js';
|
|
3
|
+
/**
|
|
4
|
+
* Holds the relative paths to the individual endpoints and their operations. The path is appended to the URL from the Server Object in order to construct the full URL. The Paths Object MAY be empty, due to Access Control List (ACL) constraints.
|
|
5
|
+
*/
|
|
6
|
+
export const PathsObjectSchemaDefinition = Type.Record(Type.String(),
|
|
7
|
+
/** A relative path to an individual endpoint. The field name MUST begin with a forward slash (/). The path is appended (no relative URL resolution) to the expanded URL from the Server Object's url field in order to construct the full URL. Path templating is allowed. When matching URLs, concrete (non-templated) paths would be matched before their templated counterparts. Templated paths with the same hierarchy but different templated names MUST NOT exist as they are identical. In case of ambiguous matching, it's up to the tooling to decide which one to use. */
|
|
8
|
+
PathItemObjectRef);
|
|
@@ -1,101 +1,77 @@
|
|
|
1
|
-
import { Type } from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
1
|
+
import { Type } from '@scalar/typebox';
|
|
2
|
+
/**
|
|
3
|
+
* Reference definitions for OpenAPI 3.1 objects.
|
|
4
|
+
* These can be used with Type.Ref to create references to these objects in other schemas.
|
|
5
|
+
*
|
|
6
|
+
* Referencing them this way helps avoid circular dependencies in TypeBox schemas while keeping the overhead performance lower.
|
|
7
|
+
*/
|
|
8
|
+
export const REF_DEFINITIONS = {
|
|
9
|
+
ComponentsObject: 'ComponentsObject',
|
|
10
|
+
SecurityRequirementObject: 'SecurityRequirementObject',
|
|
11
|
+
TagObject: 'TagObject',
|
|
12
|
+
CallbackObject: 'CallbackObject',
|
|
13
|
+
PathsObject: 'PathsObject',
|
|
14
|
+
PathItemObject: 'PathItemObject',
|
|
15
|
+
OperationObject: 'OperationObject',
|
|
16
|
+
SchemaObject: 'SchemaObject',
|
|
17
|
+
EncodingObject: 'EncodingObject',
|
|
18
|
+
HeaderObject: 'HeaderObject',
|
|
19
|
+
MediaTypeObject: 'MediaTypeObject',
|
|
20
|
+
ServerObject: 'ServerObject',
|
|
21
|
+
ExternalDocumentationObject: 'ExternalDocumentationObject',
|
|
22
|
+
InfoObject: 'InfoObject',
|
|
23
|
+
ContactObject: 'ContactObject',
|
|
24
|
+
LicenseObject: 'LicenseObject',
|
|
25
|
+
ResponseObject: 'ResponseObject',
|
|
26
|
+
ResponsesObject: 'ResponsesObject',
|
|
27
|
+
ParameterObject: 'ParameterObject',
|
|
28
|
+
ExampleObject: 'ExampleObject',
|
|
29
|
+
RequestBodyObject: 'RequestBodyObject',
|
|
30
|
+
SecuritySchemeObject: 'SecuritySchemeObject',
|
|
31
|
+
SecuritySchemes: 'SecuritySchemes',
|
|
32
|
+
LinkObject: 'LinkObject',
|
|
33
|
+
XMLObject: 'XMLObject',
|
|
34
|
+
DiscriminatorObject: 'DiscriminatorObject',
|
|
35
|
+
OAuthFlowsObject: 'OAuthFlowsObject',
|
|
36
|
+
ServerVariableObject: 'ServerVariableObject',
|
|
37
|
+
// Navigation schemas
|
|
38
|
+
TraversedDescriptionObject: 'TraversedDescriptionObject',
|
|
39
|
+
TraversedOperationObject: 'TraversedOperationObject',
|
|
40
|
+
TraversedSchemaObject: 'TraversedSchemaObject',
|
|
41
|
+
TraversedWebhookObject: 'TraversedWebhookObject',
|
|
42
|
+
TraversedTagObject: 'TraversedTagObject',
|
|
43
|
+
TraversedEntryObject: 'TraversedEntryObject',
|
|
44
|
+
TraversedDocumentObject: 'TraversedDocumentObject',
|
|
39
45
|
};
|
|
40
|
-
|
|
41
|
-
const
|
|
42
|
-
const
|
|
43
|
-
const
|
|
44
|
-
const
|
|
45
|
-
const
|
|
46
|
-
const
|
|
47
|
-
const
|
|
48
|
-
const
|
|
49
|
-
const
|
|
50
|
-
const
|
|
51
|
-
const
|
|
52
|
-
const
|
|
53
|
-
const
|
|
54
|
-
const
|
|
55
|
-
const
|
|
56
|
-
const
|
|
57
|
-
const
|
|
58
|
-
const
|
|
59
|
-
const
|
|
60
|
-
const
|
|
61
|
-
const
|
|
62
|
-
const
|
|
63
|
-
const
|
|
64
|
-
const
|
|
65
|
-
const
|
|
66
|
-
const
|
|
67
|
-
const
|
|
68
|
-
|
|
69
|
-
export
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
ContactObjectRef,
|
|
73
|
-
DiscriminatorObjectRef,
|
|
74
|
-
EncodingObjectRef,
|
|
75
|
-
ExampleObjectRef,
|
|
76
|
-
ExternalDocumentationObjectRef,
|
|
77
|
-
HeaderObjectRef,
|
|
78
|
-
InfoObjectRef,
|
|
79
|
-
LicenseObjectRef,
|
|
80
|
-
LinkObjectRef,
|
|
81
|
-
MediaTypeObjectRef,
|
|
82
|
-
OAuthFlowsObjectRef,
|
|
83
|
-
OperationObjectRef,
|
|
84
|
-
ParameterObjectRef,
|
|
85
|
-
PathItemObjectRef,
|
|
86
|
-
PathsObjectRef,
|
|
87
|
-
REF_DEFINITIONS,
|
|
88
|
-
RequestBodyObjectRef,
|
|
89
|
-
ResponseObjectRef,
|
|
90
|
-
ResponsesObjectRef,
|
|
91
|
-
SchemaObjectRef,
|
|
92
|
-
SecurityRequirementObjectRef,
|
|
93
|
-
SecuritySchemeObjectRef,
|
|
94
|
-
ServerObjectRef,
|
|
95
|
-
ServerVariableObjectRef,
|
|
96
|
-
TagObjectRef,
|
|
97
|
-
TraversedDocumentObjectRef,
|
|
98
|
-
TraversedEntryObjectRef,
|
|
99
|
-
XMLObjectRef
|
|
100
|
-
};
|
|
101
|
-
//# sourceMappingURL=ref-definitions.js.map
|
|
46
|
+
// Type alias for schema definitions
|
|
47
|
+
export const ComponentsObjectRef = Type.Ref(REF_DEFINITIONS.ComponentsObject);
|
|
48
|
+
export const SecurityRequirementObjectRef = Type.Ref(REF_DEFINITIONS.SecurityRequirementObject);
|
|
49
|
+
export const TagObjectRef = Type.Ref(REF_DEFINITIONS.TagObject);
|
|
50
|
+
export const CallbackObjectRef = Type.Ref(REF_DEFINITIONS.CallbackObject);
|
|
51
|
+
export const PathItemObjectRef = Type.Ref(REF_DEFINITIONS.PathItemObject);
|
|
52
|
+
export const PathsObjectRef = Type.Ref(REF_DEFINITIONS.PathsObject);
|
|
53
|
+
export const OperationObjectRef = Type.Ref(REF_DEFINITIONS.OperationObject);
|
|
54
|
+
export const SchemaObjectRef = Type.Ref(REF_DEFINITIONS.SchemaObject);
|
|
55
|
+
export const EncodingObjectRef = Type.Ref(REF_DEFINITIONS.EncodingObject);
|
|
56
|
+
export const HeaderObjectRef = Type.Ref(REF_DEFINITIONS.HeaderObject);
|
|
57
|
+
export const MediaTypeObjectRef = Type.Ref(REF_DEFINITIONS.MediaTypeObject);
|
|
58
|
+
export const ServerObjectRef = Type.Ref(REF_DEFINITIONS.ServerObject);
|
|
59
|
+
export const ExternalDocumentationObjectRef = Type.Ref(REF_DEFINITIONS.ExternalDocumentationObject);
|
|
60
|
+
export const InfoObjectRef = Type.Ref(REF_DEFINITIONS.InfoObject);
|
|
61
|
+
export const ContactObjectRef = Type.Ref(REF_DEFINITIONS.ContactObject);
|
|
62
|
+
export const LicenseObjectRef = Type.Ref(REF_DEFINITIONS.LicenseObject);
|
|
63
|
+
export const ResponseObjectRef = Type.Ref(REF_DEFINITIONS.ResponseObject);
|
|
64
|
+
export const ResponsesObjectRef = Type.Ref(REF_DEFINITIONS.ResponsesObject);
|
|
65
|
+
export const ParameterObjectRef = Type.Ref(REF_DEFINITIONS.ParameterObject);
|
|
66
|
+
export const ExampleObjectRef = Type.Ref(REF_DEFINITIONS.ExampleObject);
|
|
67
|
+
export const RequestBodyObjectRef = Type.Ref(REF_DEFINITIONS.RequestBodyObject);
|
|
68
|
+
export const SecuritySchemeObjectRef = Type.Ref(REF_DEFINITIONS.SecuritySchemeObject);
|
|
69
|
+
export const LinkObjectRef = Type.Ref(REF_DEFINITIONS.LinkObject);
|
|
70
|
+
export const XMLObjectRef = Type.Ref(REF_DEFINITIONS.XMLObject);
|
|
71
|
+
export const DiscriminatorObjectRef = Type.Ref(REF_DEFINITIONS.DiscriminatorObject);
|
|
72
|
+
export const OAuthFlowsObjectRef = Type.Ref(REF_DEFINITIONS.OAuthFlowsObject);
|
|
73
|
+
export const ServerVariableObjectRef = Type.Ref(REF_DEFINITIONS.ServerVariableObject);
|
|
74
|
+
// Navigation schema references
|
|
75
|
+
export const TraversedEntryObjectRef = Type.Ref(REF_DEFINITIONS.TraversedEntryObject);
|
|
76
|
+
// export const TraversedTagObjectRef = Type.Ref(REF_DEFINITIONS.TraversedTagObject)
|
|
77
|
+
export const TraversedDocumentObjectRef = Type.Ref(REF_DEFINITIONS.TraversedDocumentObject);
|
|
@@ -1,26 +1,23 @@
|
|
|
1
|
-
import { Type } from
|
|
2
|
-
import { compose } from
|
|
3
|
-
const ReferenceObjectExtensionsSchema = Type.Object({
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { Type } from '@scalar/typebox';
|
|
2
|
+
import { compose } from '../../../schemas/compose.js';
|
|
3
|
+
export const ReferenceObjectExtensionsSchema = Type.Object({
|
|
4
|
+
/** Indicates the current status of the reference resolution. Can be either 'loading' while fetching the reference or 'error' if the resolution failed. */
|
|
5
|
+
'$status': Type.Optional(Type.Union([Type.Literal('loading'), Type.Literal('error')])),
|
|
6
|
+
/** Indicates whether this reference should be resolved globally across all documents, rather than just within the current document context. */
|
|
7
|
+
'$global': Type.Optional(Type.Boolean()),
|
|
8
8
|
});
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
/**
|
|
10
|
+
* A simple object to allow referencing other components in the OpenAPI Description, internally and externally.
|
|
11
|
+
*
|
|
12
|
+
* The $ref string value contains a URI RFC3986, which identifies the value being referenced.
|
|
13
|
+
*
|
|
14
|
+
* See the rules for resolving Relative References. */
|
|
15
|
+
export const ReferenceObjectSchema = compose(Type.Object({
|
|
11
16
|
/** REQUIRED. The reference identifier. This MUST be in the form of a URI. */
|
|
12
|
-
|
|
17
|
+
'$ref': Type.String(),
|
|
13
18
|
/** A short summary which by default SHOULD override that of the referenced component. If the referenced object-type does not allow a summary field, then this field has no effect. */
|
|
14
19
|
summary: Type.Optional(Type.String()),
|
|
15
20
|
/** A description which by default SHOULD override that of the referenced component. CommonMark syntax MAY be used for rich text representation. If the referenced object-type does not allow a description field, then this field has no effect. */
|
|
16
|
-
description: Type.Optional(Type.String())
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
);
|
|
20
|
-
const reference = (schema) => compose(ReferenceObjectSchema, Type.Object({ "$ref-value": schema }));
|
|
21
|
-
export {
|
|
22
|
-
ReferenceObjectExtensionsSchema,
|
|
23
|
-
ReferenceObjectSchema,
|
|
24
|
-
reference
|
|
25
|
-
};
|
|
26
|
-
//# sourceMappingURL=reference.js.map
|
|
21
|
+
description: Type.Optional(Type.String()),
|
|
22
|
+
}), ReferenceObjectExtensionsSchema);
|
|
23
|
+
export const reference = (schema) => compose(ReferenceObjectSchema, Type.Object({ '$ref-value': schema }));
|
|
@@ -1,21 +1,13 @@
|
|
|
1
|
-
import { Type } from
|
|
2
|
-
import { compose } from
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const RequestBodyObjectSchemaDefinition = compose(
|
|
8
|
-
Type.Object({
|
|
1
|
+
import { Type } from '@scalar/typebox';
|
|
2
|
+
import { compose } from '../../../schemas/compose.js';
|
|
3
|
+
import { XScalarSelectedContentTypeSchema, } from '../../../schemas/extensions/operation/x-scalar-selected-content-type.js';
|
|
4
|
+
import { MediaTypeObjectRef } from './ref-definitions.js';
|
|
5
|
+
/** Describes a single request body. */
|
|
6
|
+
export const RequestBodyObjectSchemaDefinition = compose(Type.Object({
|
|
9
7
|
/** A brief description of the request body. This could contain examples of use. CommonMark syntax MAY be used for rich text representation. */
|
|
10
8
|
description: Type.Optional(Type.String()),
|
|
11
9
|
/** REQUIRED. The content of the request body. The key is a media type or media type range and the value describes it. For requests that match multiple keys, only the most specific key is applicable. e.g. "text/plain" overrides "text/* */
|
|
12
10
|
content: Type.Record(Type.String(), MediaTypeObjectRef),
|
|
13
11
|
/** Determines if the request body is required in the request. Defaults to false. */
|
|
14
|
-
required: Type.Optional(Type.Boolean())
|
|
15
|
-
|
|
16
|
-
XScalarSelectedContentTypeSchema
|
|
17
|
-
);
|
|
18
|
-
export {
|
|
19
|
-
RequestBodyObjectSchemaDefinition
|
|
20
|
-
};
|
|
21
|
-
//# sourceMappingURL=request-body.js.map
|
|
12
|
+
required: Type.Optional(Type.Boolean()),
|
|
13
|
+
}), XScalarSelectedContentTypeSchema);
|
|
@@ -1,17 +1,13 @@
|
|
|
1
|
-
import { Type } from
|
|
2
|
-
import { HeaderObjectRef, LinkObjectRef, MediaTypeObjectRef } from
|
|
3
|
-
import { reference } from
|
|
4
|
-
const ResponseObjectSchemaDefinition = Type.Object({
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { Type } from '@scalar/typebox';
|
|
2
|
+
import { HeaderObjectRef, LinkObjectRef, MediaTypeObjectRef } from './ref-definitions.js';
|
|
3
|
+
import { reference } from './reference.js';
|
|
4
|
+
export const ResponseObjectSchemaDefinition = Type.Object({
|
|
5
|
+
/** REQUIRED. A description of the response. CommonMark syntax MAY be used for rich text representation. */
|
|
6
|
+
description: Type.String(),
|
|
7
|
+
/** Maps a header name to its definition. RFC7230 states header names are case insensitive. If a response header is defined with the name "Content-Type", it SHALL be ignored. */
|
|
8
|
+
headers: Type.Optional(Type.Record(Type.String(), Type.Union([HeaderObjectRef, reference(HeaderObjectRef)]))),
|
|
9
|
+
/** A map containing descriptions of potential response payloads. The key is a media type or media type range and the value describes it. For responses that match multiple keys, only the most specific key is applicable. e.g. "text/plain" overrides "text/*" */
|
|
10
|
+
content: Type.Optional(Type.Record(Type.String(), MediaTypeObjectRef)),
|
|
11
|
+
/** A map of operations links that can be followed from the response. The key of the map is a short name for the link, following the naming constraints of the names for Component Objects. */
|
|
12
|
+
links: Type.Optional(Type.Record(Type.String(), Type.Union([LinkObjectRef, reference(LinkObjectRef)]))),
|
|
13
13
|
});
|
|
14
|
-
export {
|
|
15
|
-
ResponseObjectSchemaDefinition
|
|
16
|
-
};
|
|
17
|
-
//# sourceMappingURL=response.js.map
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import { Type } from
|
|
2
|
-
import { ResponseObjectRef } from
|
|
3
|
-
import { reference } from
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { Type } from '@scalar/typebox';
|
|
2
|
+
import { ResponseObjectRef } from './ref-definitions.js';
|
|
3
|
+
import { reference } from './reference.js';
|
|
4
|
+
/**
|
|
5
|
+
* A container for the expected responses of an operation. The container maps a HTTP response code to the expected response.
|
|
6
|
+
*
|
|
7
|
+
* The documentation is not necessarily expected to cover all possible HTTP response codes because they may not be known in advance. However, documentation is expected to cover a successful operation response and any known errors.
|
|
8
|
+
*
|
|
9
|
+
* The default MAY be used as a default Response Object for all HTTP codes that are not covered individually by the Responses Object.
|
|
10
|
+
*
|
|
11
|
+
* The Responses Object MUST contain at least one response code, and if only one response code is provided it SHOULD be the response for a successful operation call.
|
|
12
|
+
*/
|
|
13
|
+
export const ResponsesObjectSchemaDefinition = Type.Record(Type.String(), Type.Union([ResponseObjectRef, reference(ResponseObjectRef)]));
|