@scalar/api-reference 1.49.4 → 1.49.6
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 +15 -0
- package/dist/browser/standalone.js +2309 -45729
- package/dist/browser/webpack-stats.json +1 -1
- package/dist/components/AgentScalar/AgentScalarChatInterface.vue.d.ts +2 -1
- package/dist/components/AgentScalar/AgentScalarChatInterface.vue.d.ts.map +1 -1
- package/dist/components/AgentScalar/AgentScalarChatInterface.vue.js.map +1 -1
- package/dist/components/AgentScalar/AgentScalarChatInterface.vue.script.js +6 -4
- package/dist/components/AgentScalar/AgentScalarChatInterface.vue.script.js.map +1 -1
- package/dist/components/AgentScalar/AgentScalarDrawer.vue.d.ts +2 -3
- package/dist/components/AgentScalar/AgentScalarDrawer.vue.d.ts.map +1 -1
- package/dist/components/AgentScalar/AgentScalarDrawer.vue.js +1 -1
- package/dist/components/AgentScalar/AgentScalarDrawer.vue.js.map +1 -1
- package/dist/components/AgentScalar/AgentScalarDrawer.vue.script.js +4 -2
- package/dist/components/AgentScalar/AgentScalarDrawer.vue.script.js.map +1 -1
- package/dist/components/AgentScalar/OpenMCPButton.vue.d.ts +2 -0
- package/dist/components/AgentScalar/OpenMCPButton.vue.d.ts.map +1 -1
- package/dist/components/AgentScalar/OpenMCPButton.vue.js +1 -1
- package/dist/components/AgentScalar/OpenMCPButton.vue.js.map +1 -1
- package/dist/components/AgentScalar/OpenMCPButton.vue.script.js +5 -5
- package/dist/components/AgentScalar/OpenMCPButton.vue.script.js.map +1 -1
- package/dist/components/ApiReference.vue.d.ts.map +1 -1
- package/dist/components/ApiReference.vue.js +1 -1
- package/dist/components/ApiReference.vue.js.map +1 -1
- package/dist/components/ApiReference.vue.script.js +6 -0
- package/dist/components/ApiReference.vue.script.js.map +1 -1
- package/dist/components/Content/Schema/Schema.vue.d.ts +4 -0
- package/dist/components/Content/Schema/Schema.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/Schema.vue.js +1 -1
- package/dist/components/Content/Schema/Schema.vue.js.map +1 -1
- package/dist/components/Content/Schema/Schema.vue.script.js +15 -5
- package/dist/components/Content/Schema/Schema.vue.script.js.map +1 -1
- package/dist/components/Content/Schema/SchemaComposition.vue.d.ts +4 -0
- package/dist/components/Content/Schema/SchemaComposition.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaComposition.vue.js.map +1 -1
- package/dist/components/Content/Schema/SchemaComposition.vue.script.js +37 -7
- package/dist/components/Content/Schema/SchemaComposition.vue.script.js.map +1 -1
- package/dist/components/Content/Schema/SchemaObjectProperties.vue.d.ts +2 -0
- package/dist/components/Content/Schema/SchemaObjectProperties.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaObjectProperties.vue.js.map +1 -1
- package/dist/components/Content/Schema/SchemaObjectProperties.vue.script.js +26 -6
- package/dist/components/Content/Schema/SchemaObjectProperties.vue.script.js.map +1 -1
- package/dist/components/Content/Schema/SchemaProperty.vue.d.ts +6 -0
- package/dist/components/Content/Schema/SchemaProperty.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaProperty.vue.js +1 -1
- package/dist/components/Content/Schema/SchemaProperty.vue.js.map +1 -1
- package/dist/components/Content/Schema/SchemaProperty.vue.script.js +20 -3
- package/dist/components/Content/Schema/SchemaProperty.vue.script.js.map +1 -1
- package/dist/features/Operation/components/RequestBody.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/RequestBody.vue.js +1 -1
- package/dist/features/Operation/components/RequestBody.vue.js.map +1 -1
- package/dist/features/Operation/components/RequestBody.vue.script.js +6 -0
- package/dist/features/Operation/components/RequestBody.vue.script.js.map +1 -1
- package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts.map +1 -1
- package/dist/features/Operation/layouts/ClassicLayout.vue.js +1 -1
- package/dist/features/Operation/layouts/ClassicLayout.vue.js.map +1 -1
- package/dist/features/Operation/layouts/ClassicLayout.vue.script.js +16 -5
- package/dist/features/Operation/layouts/ClassicLayout.vue.script.js.map +1 -1
- package/dist/features/Operation/layouts/ModernLayout.vue.d.ts.map +1 -1
- package/dist/features/Operation/layouts/ModernLayout.vue.js +1 -1
- package/dist/features/Operation/layouts/ModernLayout.vue.js.map +1 -1
- package/dist/features/Operation/layouts/ModernLayout.vue.script.js +16 -5
- package/dist/features/Operation/layouts/ModernLayout.vue.script.js.map +1 -1
- package/dist/features/Operation/request-body-composition-index.d.ts +8 -0
- package/dist/features/Operation/request-body-composition-index.d.ts.map +1 -0
- package/dist/features/Operation/request-body-composition-index.js +10 -0
- package/dist/features/Operation/request-body-composition-index.js.map +1 -0
- package/dist/features/developer-tools/DeveloperTools.vue.d.ts +2 -1
- package/dist/features/developer-tools/DeveloperTools.vue.d.ts.map +1 -1
- package/dist/features/developer-tools/DeveloperTools.vue.js.map +1 -1
- package/dist/features/developer-tools/DeveloperTools.vue.script.js +9 -2
- package/dist/features/developer-tools/DeveloperTools.vue.script.js.map +1 -1
- package/dist/features/developer-tools/components/ApiReferenceToolbarRegisterButton.vue.d.ts +2 -0
- package/dist/features/developer-tools/components/ApiReferenceToolbarRegisterButton.vue.d.ts.map +1 -1
- package/dist/features/developer-tools/components/ApiReferenceToolbarRegisterButton.vue.js.map +1 -1
- package/dist/features/developer-tools/components/ApiReferenceToolbarRegisterButton.vue.script.js +3 -3
- package/dist/features/developer-tools/components/ApiReferenceToolbarRegisterButton.vue.script.js.map +1 -1
- package/dist/features/developer-tools/components/ApiReferenceToolbarShareRegister.vue.d.ts +2 -0
- package/dist/features/developer-tools/components/ApiReferenceToolbarShareRegister.vue.d.ts.map +1 -1
- package/dist/features/developer-tools/components/ApiReferenceToolbarShareRegister.vue.js.map +1 -1
- package/dist/features/developer-tools/components/ApiReferenceToolbarShareRegister.vue.script.js +9 -3
- package/dist/features/developer-tools/components/ApiReferenceToolbarShareRegister.vue.script.js.map +1 -1
- package/dist/features/developer-tools/components/ApiReferenceToolbarShareTemporary.vue.d.ts +2 -0
- package/dist/features/developer-tools/components/ApiReferenceToolbarShareTemporary.vue.d.ts.map +1 -1
- package/dist/features/developer-tools/components/ApiReferenceToolbarShareTemporary.vue.js.map +1 -1
- package/dist/features/developer-tools/components/ApiReferenceToolbarShareTemporary.vue.script.js +6 -4
- package/dist/features/developer-tools/components/ApiReferenceToolbarShareTemporary.vue.script.js.map +1 -1
- package/dist/features/developer-tools/components/DeployApiReference.vue.d.ts +2 -0
- package/dist/features/developer-tools/components/DeployApiReference.vue.d.ts.map +1 -1
- package/dist/features/developer-tools/components/DeployApiReference.vue.js.map +1 -1
- package/dist/features/developer-tools/components/DeployApiReference.vue.script.js +8 -2
- package/dist/features/developer-tools/components/DeployApiReference.vue.script.js.map +1 -1
- package/dist/features/developer-tools/components/ShareApiReference.vue.d.ts +2 -0
- package/dist/features/developer-tools/components/ShareApiReference.vue.d.ts.map +1 -1
- package/dist/features/developer-tools/components/ShareApiReference.vue.js.map +1 -1
- package/dist/features/developer-tools/components/ShareApiReference.vue.script.js +8 -2
- package/dist/features/developer-tools/components/ShareApiReference.vue.script.js.map +1 -1
- package/dist/features/example-responses/ExampleResponse.vue.d.ts.map +1 -1
- package/dist/features/example-responses/ExampleResponse.vue.js +1 -1
- package/dist/features/example-responses/ExampleResponse.vue.js.map +1 -1
- package/dist/features/example-responses/ExampleResponse.vue.script.js +1 -2
- package/dist/features/example-responses/ExampleResponse.vue.script.js.map +1 -1
- package/dist/features/test-request-button/TestRequestButton.vue.d.ts +1 -0
- package/dist/features/test-request-button/TestRequestButton.vue.d.ts.map +1 -1
- package/dist/features/test-request-button/TestRequestButton.vue.js +1 -1
- package/dist/features/test-request-button/TestRequestButton.vue.js.map +1 -1
- package/dist/features/test-request-button/TestRequestButton.vue.script.js +4 -2
- package/dist/features/test-request-button/TestRequestButton.vue.script.js.map +1 -1
- package/dist/helpers/upload-temp-document.d.ts +2 -1
- package/dist/helpers/upload-temp-document.d.ts.map +1 -1
- package/dist/helpers/upload-temp-document.js +3 -3
- package/dist/helpers/upload-temp-document.js.map +1 -1
- package/dist/style.css +273 -264
- package/package.json +15 -15
- package/dist/consts/urls.d.ts +0 -13
- package/dist/consts/urls.d.ts.map +0 -1
- package/dist/consts/urls.js +0 -17
- package/dist/consts/urls.js.map +0 -1
|
@@ -5,6 +5,7 @@ import { getXKeysFromObject } from "../../specification-extension/helpers.js";
|
|
|
5
5
|
import SpecificationExtension_default from "../../specification-extension/SpecificationExtension.vue.js";
|
|
6
6
|
import LinkList_default from "../../../components/LinkList/LinkList.vue.js";
|
|
7
7
|
import ExternalDocs_default from "../../external-docs/ExternalDocs.vue.js";
|
|
8
|
+
import { REQUEST_BODY_COMPOSITION_INDEX_SYMBOL } from "../request-body-composition-index.js";
|
|
8
9
|
import HttpMethod_default from "../../../components/HttpMethod/HttpMethod.vue.js";
|
|
9
10
|
import OperationPath_default from "../../../components/OperationPath.vue.js";
|
|
10
11
|
import ExampleResponses_default from "../../example-responses/ExampleResponses.vue.js";
|
|
@@ -13,7 +14,7 @@ import OperationResponses_default from "../components/OperationResponses.vue.js"
|
|
|
13
14
|
import Callbacks_default from "../components/callbacks/Callbacks.vue.js";
|
|
14
15
|
import TestRequestButton_default from "../../test-request-button/TestRequestButton.vue.js";
|
|
15
16
|
import XBadges_default from "../../x-badges/XBadges.vue.js";
|
|
16
|
-
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createTextVNode, createVNode, defineComponent, normalizeClass, openBlock, ref, toDisplayString, unref, withCtx, withModifiers } from "vue";
|
|
17
|
+
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createTextVNode, createVNode, defineComponent, normalizeClass, openBlock, provide, ref, toDisplayString, unref, withCtx, withModifiers } from "vue";
|
|
17
18
|
import { ScalarErrorBoundary, ScalarIconButton, ScalarMarkdown } from "@scalar/components";
|
|
18
19
|
import { useClipboard } from "@scalar/use-hooks/useClipboard";
|
|
19
20
|
import { ScalarIconCopy, ScalarIconPlay, ScalarIconWebhooksLogo } from "@scalar/icons";
|
|
@@ -63,6 +64,11 @@ var ClassicLayout_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */
|
|
|
63
64
|
const operationExtensions = computed(() => getXKeysFromObject(__props.operation));
|
|
64
65
|
/** Track the currently selected example for passing to the modal */
|
|
65
66
|
const selectedExampleKey = ref("");
|
|
67
|
+
/** Selected request body oneOf/anyOf variants; synced with schema dropdowns and code sample */
|
|
68
|
+
const requestBodyCompositionSelection = ref({});
|
|
69
|
+
const requestBodyCompositionSelectionForCodeSample = computed(() => ({ ...requestBodyCompositionSelection.value }));
|
|
70
|
+
const requestBodyCompositionSelectionKey = computed(() => JSON.stringify(requestBodyCompositionSelectionForCodeSample.value));
|
|
71
|
+
provide(REQUEST_BODY_COMPOSITION_INDEX_SYMBOL, requestBodyCompositionSelection);
|
|
66
72
|
const { copyToClipboard } = useClipboard();
|
|
67
73
|
return (_ctx, _cache) => {
|
|
68
74
|
return openBlock(), createBlock(unref(SectionAccordion_default), {
|
|
@@ -122,13 +128,15 @@ var ClassicLayout_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */
|
|
|
122
128
|
eventBus: __props.eventBus,
|
|
123
129
|
exampleName: selectedExampleKey.value,
|
|
124
130
|
method: __props.method,
|
|
125
|
-
path: __props.path
|
|
131
|
+
path: __props.path,
|
|
132
|
+
requestBodyCompositionSelection: requestBodyCompositionSelectionForCodeSample.value
|
|
126
133
|
}, null, 8, [
|
|
127
134
|
"id",
|
|
128
135
|
"eventBus",
|
|
129
136
|
"exampleName",
|
|
130
137
|
"method",
|
|
131
|
-
"path"
|
|
138
|
+
"path",
|
|
139
|
+
"requestBodyCompositionSelection"
|
|
132
140
|
])) : (openBlock(), createBlock(unref(ScalarIconPlay), {
|
|
133
141
|
key: 1,
|
|
134
142
|
class: "endpoint-try-hint size-4.5"
|
|
@@ -187,9 +195,10 @@ var ClassicLayout_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */
|
|
|
187
195
|
default: withCtx(() => [createVNode(unref(ExternalDocs_default), { value: __props.operation.externalDocs }, null, 8, ["value"])]),
|
|
188
196
|
_: 1
|
|
189
197
|
})) : createCommentVNode("", true), createVNode(unref(ScalarErrorBoundary), null, {
|
|
190
|
-
default: withCtx(() => [
|
|
198
|
+
default: withCtx(() => [(openBlock(), createBlock(unref(OperationCodeSample), {
|
|
191
199
|
selectedExample: selectedExampleKey.value,
|
|
192
200
|
"onUpdate:selectedExample": _cache[2] || (_cache[2] = ($event) => selectedExampleKey.value = $event),
|
|
201
|
+
key: requestBodyCompositionSelectionKey.value,
|
|
193
202
|
class: "operation-example-card",
|
|
194
203
|
clientOptions: __props.clientOptions,
|
|
195
204
|
eventBus: __props.eventBus,
|
|
@@ -198,6 +207,7 @@ var ClassicLayout_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */
|
|
|
198
207
|
method: __props.method,
|
|
199
208
|
operation: __props.operation,
|
|
200
209
|
path: __props.path,
|
|
210
|
+
requestBodyCompositionSelection: requestBodyCompositionSelectionForCodeSample.value,
|
|
201
211
|
securitySchemes: __props.selectedSecuritySchemes,
|
|
202
212
|
selectedClient: __props.selectedClient,
|
|
203
213
|
selectedServer: __props.selectedServer
|
|
@@ -209,10 +219,11 @@ var ClassicLayout_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */
|
|
|
209
219
|
"method",
|
|
210
220
|
"operation",
|
|
211
221
|
"path",
|
|
222
|
+
"requestBodyCompositionSelection",
|
|
212
223
|
"securitySchemes",
|
|
213
224
|
"selectedClient",
|
|
214
225
|
"selectedServer"
|
|
215
|
-
])]),
|
|
226
|
+
]))]),
|
|
216
227
|
_: 1
|
|
217
228
|
})])
|
|
218
229
|
])]),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClassicLayout.vue.script.js","names":[],"sources":["../../../../src/features/Operation/layouts/ClassicLayout.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { OperationCodeSample } from '@scalar/api-client/v2/blocks/operation-code-sample'\nimport type { SecuritySchemeObjectSecret } from '@scalar/api-client/v2/blocks/scalar-auth-selector-block'\nimport {\n ScalarErrorBoundary,\n ScalarIconButton,\n ScalarMarkdown,\n} from '@scalar/components'\nimport {\n ScalarIconCopy,\n ScalarIconPlay,\n ScalarIconWebhooksLogo,\n} from '@scalar/icons'\nimport {\n getOperationStability,\n getOperationStabilityColor,\n isOperationDeprecated,\n} from '@scalar/oas-utils/helpers'\nimport { useClipboard } from '@scalar/use-hooks/useClipboard'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport type {\n OperationObject,\n ServerObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed, ref } from 'vue'\n\nimport { Anchor } from '@/components/Anchor'\nimport { Badge } from '@/components/Badge'\nimport { HttpMethod } from '@/components/HttpMethod'\nimport { LinkList } from '@/components/LinkList'\nimport OperationPath from '@/components/OperationPath.vue'\nimport { SectionAccordion } from '@/components/Section'\nimport { ExampleResponses } from '@/features/example-responses'\nimport { ExternalDocs } from '@/features/external-docs'\nimport Callbacks from '@/features/Operation/components/callbacks/Callbacks.vue'\nimport OperationParameters from '@/features/Operation/components/OperationParameters.vue'\nimport OperationResponses from '@/features/Operation/components/OperationResponses.vue'\nimport type { OperationProps } from '@/features/Operation/Operation.vue'\nimport { getXKeysFromObject } from '@/features/specification-extension'\nimport SpecificationExtension from '@/features/specification-extension/SpecificationExtension.vue'\nimport { TestRequestButton } from '@/features/test-request-button'\nimport { XBadges } from '@/features/x-badges'\n\nconst {\n clientOptions,\n eventBus,\n isWebhook,\n method,\n operation,\n options,\n path,\n selectedServer,\n selectedSecuritySchemes,\n selectedClient,\n} = defineProps<\n Omit<\n OperationProps,\n 'document' | 'pathValue' | 'server' | 'securitySchemes' | 'authStore'\n > & {\n /** Operation object with path params */\n operation: OperationObject\n /** The selected server for the operation */\n selectedServer: ServerObject | null\n /** The selected security schemes for the operation */\n selectedSecuritySchemes: SecuritySchemeObjectSecret[]\n }\n>()\n\nconst operationTitle = computed(() => operation.summary || path || '')\nconst operationExtensions = computed(() => getXKeysFromObject(operation))\n\n/** Track the currently selected example for passing to the modal */\nconst selectedExampleKey = ref<string>('')\n\nconst { copyToClipboard } = useClipboard()\n</script>\n<template>\n <SectionAccordion\n :id=\"id\"\n :aria-label=\"operationTitle\"\n class=\"reference-endpoint\"\n :modelValue=\"!isCollapsed\"\n transparent\n @update:modelValue=\"\n (value) => eventBus?.emit('toggle:nav-item', { id, open: value })\n \">\n <template #title>\n <div class=\"operation-title\">\n <div class=\"operation-details\">\n <HttpMethod\n class=\"endpoint-type\"\n :method=\"method\"\n short />\n <Anchor\n class=\"endpoint-anchor\"\n @copyAnchorUrl=\"() => eventBus?.emit('copy-url:nav-item', { id })\">\n <h3 class=\"endpoint-label\">\n <div class=\"endpoint-label-path\">\n <OperationPath\n :deprecated=\"isOperationDeprecated(operation)\"\n :path=\"path\" />\n </div>\n <div class=\"endpoint-label-name\">\n {{ operationTitle }}\n </div>\n <!-- Stability badge -->\n <Badge\n v-if=\"getOperationStability(operation)\"\n class=\"capitalize\"\n :class=\"getOperationStabilityColor(operation)\">\n {{ getOperationStability(operation) }}\n </Badge>\n\n <!-- Webhook badge -->\n <Badge\n v-if=\"isWebhook\"\n class=\"font-code text-green flex w-fit items-center justify-center gap-1\">\n <ScalarIconWebhooksLogo weight=\"bold\" />Webhook\n </Badge>\n\n <!-- x-badges before -->\n <XBadges\n :badges=\"operation['x-badges']\"\n position=\"before\" />\n </h3>\n </Anchor>\n </div>\n </div>\n </template>\n <template #actions=\"{ active }\">\n <!-- x-badges after -->\n <XBadges\n :badges=\"operation['x-badges']\"\n position=\"after\" />\n <template v-if=\"!options.hideTestRequestButton\">\n <TestRequestButton\n v-if=\"active && !isWebhook\"\n :id\n :eventBus\n :exampleName=\"selectedExampleKey\"\n :method\n :path />\n <ScalarIconPlay\n v-else\n class=\"endpoint-try-hint size-4.5\" />\n </template>\n <span\n v-if=\"options.showOperationId && operation.operationId\"\n class=\"font-code text-sm\">\n {{ operation.operationId }}\n </span>\n <ScalarIconButton\n class=\"endpoint-copy p-0.5\"\n :icon=\"ScalarIconCopy\"\n label=\"Copy endpoint URL\"\n size=\"xs\"\n variant=\"ghost\"\n @click.stop=\"copyToClipboard(path)\" />\n </template>\n <template\n v-if=\"operation.description\"\n #description>\n <ScalarMarkdown\n :anchorPrefix=\"id\"\n aria-label=\"Operation Description\"\n role=\"group\"\n transformType=\"heading\"\n :value=\"operation.description\"\n withAnchors\n withImages />\n </template>\n <div class=\"endpoint-content\">\n <div class=\"operation-details-card\">\n <div\n v-if=\"Object.keys(operationExtensions).length > 0\"\n class=\"operation-details-card-item\">\n <SpecificationExtension :value=\"operationExtensions\" />\n </div>\n <div class=\"operation-details-card-item\">\n <OperationParameters\n :eventBus\n :options\n :parameters=\"operation.parameters\"\n :requestBody=\"getResolvedRef(operation.requestBody)\" />\n </div>\n <div class=\"operation-details-card-item\">\n <OperationResponses\n :eventBus\n :options\n :responses=\"operation.responses\" />\n </div>\n\n <!-- Callbacks -->\n <div\n v-if=\"operation?.callbacks\"\n class=\"operation-details-card-item\">\n <Callbacks\n :callbacks=\"operation.callbacks\"\n :eventBus\n :options\n :path />\n </div>\n </div>\n\n <ExampleResponses\n v-if=\"operation.responses\"\n class=\"operation-example-card\"\n :responses=\"operation.responses\" />\n\n <!-- New Example Request -->\n <div>\n <!-- External Docs -->\n <LinkList v-if=\"operation.externalDocs\">\n <ExternalDocs :value=\"operation.externalDocs\" />\n </LinkList>\n <!-- Request Example -->\n <ScalarErrorBoundary>\n <OperationCodeSample\n v-model:selectedExample=\"selectedExampleKey\"\n class=\"operation-example-card\"\n :clientOptions\n :eventBus\n fallback\n :isWebhook\n :method\n :operation\n :path\n :securitySchemes=\"selectedSecuritySchemes\"\n :selectedClient\n :selectedServer />\n </ScalarErrorBoundary>\n </div>\n </div>\n </SectionAccordion>\n</template>\n\n<style scoped>\n@reference \"@/style.css\";\n\n.operation-title {\n display: flex;\n justify-content: space-between;\n}\n.operation-details {\n display: flex;\n align-items: center;\n margin-top: 0;\n gap: 9px;\n\n min-width: 0;\n flex-shrink: 1;\n}\n.operation-details :deep(.endpoint-anchor .scalar-button svg) {\n width: 16px;\n height: 16px;\n}\n.endpoint-type {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 6px;\n\n position: relative;\n z-index: 0;\n\n width: 60px;\n padding: 6px;\n flex-shrink: 0;\n\n font-size: var(--scalar-small);\n\n text-transform: uppercase;\n font-weight: var(--scalar-bold);\n font-family: var(--scalar-font);\n}\n.endpoint-type::after {\n content: '';\n position: absolute;\n inset: 0;\n z-index: -1;\n\n background: currentColor;\n opacity: 0.15;\n\n border-radius: var(--scalar-radius);\n}\n\n.endpoint-anchor {\n display: flex;\n align-items: center;\n min-width: 0;\n flex-shrink: 1;\n}\n.endpoint-anchor.label {\n display: flex;\n}\n.endpoint-label {\n display: flex;\n align-items: baseline;\n gap: 9px;\n\n min-width: 0;\n flex-shrink: 1;\n\n color: var(--scalar-color-1);\n}\n\n.endpoint-label-path {\n font-family: var(--scalar-font-code);\n font-size: var(--scalar-mini);\n\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n}\n.endpoint-label-path :deep(em) {\n color: var(--scalar-color-2);\n}\n.endpoint-label-name {\n color: var(--scalar-color-2);\n font-size: var(--scalar-small);\n\n /* Concatenate the name before we shrink the path */\n flex-shrink: 1000000000;\n\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n}\n\n.endpoint-try-hint {\n padding: 2px;\n flex-shrink: 0;\n}\n.endpoint-copy {\n color: currentColor;\n}\n.endpoint-copy :deep(svg) {\n stroke-width: 2px;\n}\n\n.endpoint-content {\n display: grid;\n grid-auto-columns: 1fr;\n grid-auto-flow: row;\n gap: 9px;\n padding: 9px;\n}\n\n@variant lg {\n .endpoint-content {\n grid-auto-flow: column;\n }\n}\n\n@container (max-width: 900px) {\n .endpoint-content {\n grid-template-columns: 1fr;\n }\n}\n\n.endpoint-content > * {\n min-width: 0;\n}\n\n.operation-details-card {\n display: flex;\n flex-direction: column;\n gap: 12px;\n min-width: 0;\n}\n.operation-details-card-item :deep(.parameter-list),\n.operation-details-card-item :deep(.callbacks-list) {\n border: var(--scalar-border-width) solid var(--scalar-border-color);\n border-radius: var(--scalar-radius-lg);\n margin-top: 0;\n}\n\n.operation-details-card-item {\n display: flex;\n flex-direction: column;\n gap: 12px;\n}\n\n.operation-details-card-item :deep(.parameter-list-items) {\n margin-bottom: 0;\n}\n.operation-details-card :deep(.parameter-item:last-of-type .parameter-schema) {\n padding-bottom: 12px;\n}\n.operation-details-card :deep(.parameter-list .parameter-list) {\n margin-bottom: 12px;\n}\n.operation-details-card :deep(.parameter-item) {\n margin: 0;\n padding: 0;\n}\n.operation-details-card :deep(.property) {\n padding: 9px;\n margin: 0;\n}\n.operation-details-card :deep(.parameter-list-title),\n.operation-details-card :deep(.request-body-title),\n.operation-details-card :deep(.callbacks-title) {\n text-transform: uppercase;\n font-weight: var(--scalar-bold);\n font-size: var(--scalar-mini);\n color: var(--scalar-color-2);\n line-height: 1.33;\n padding: 9px;\n margin: 0;\n}\n\n.operation-details-card :deep(.callback-list-item-title) {\n padding-left: 28px;\n padding-right: 12px;\n}\n\n.operation-details-card :deep(.callback-list-item-icon) {\n left: 6px;\n}\n\n.operation-details-card :deep(.callback-operation-container) {\n padding-inline: 9px;\n padding-bottom: 9px;\n}\n\n.operation-details-card :deep(.callback-operation-container > .request-body),\n.operation-details-card :deep(.callback-operation-container > .parameter-list) {\n border: none;\n}\n\n.operation-details-card\n :deep(.callback-operation-container > .request-body > .request-body-header) {\n padding: 0;\n padding-bottom: 9px;\n border-bottom: var(--scalar-border-width) solid var(--scalar-border-color);\n}\n\n.operation-details-card :deep(.request-body-description) {\n margin-top: 0;\n padding: 9px 9px 0 9px;\n border-top: var(--scalar-border-width) solid var(--scalar-border-color);\n}\n\n.operation-details-card :deep(.request-body) {\n margin-top: 0;\n border-radius: var(--scalar-radius-lg);\n border: var(--scalar-border-width) solid var(--scalar-border-color);\n}\n.operation-details-card\n :deep(.request-body .schema-card--level-0 > .schema-card-description) {\n padding-inline: 9px;\n}\n\n.operation-details-card :deep(.request-body-header) {\n padding-bottom: 0;\n border-bottom: 0;\n}\n\n.operation-details-card :deep(.contents button) {\n margin-right: 9px;\n}\n\n.operation-details-card\n :deep(.schema-card--open + .schema-card:not(.schema-card--open)) {\n margin-inline: 9px;\n margin-bottom: 9px;\n}\n.operation-details-card :deep(.request-body-schema .property--level-0) {\n padding: 0;\n}\n.operation-details-card :deep(.request-body-schema .property--level-0) {\n padding: 0;\n}\n\n.operation-details-card :deep(.selected-content-type) {\n margin-right: 9px;\n}\n\n.operation-example-card {\n position: sticky;\n top: calc(var(--refs-viewport-offset) + 24px);\n max-height: calc(var(--refs-viewport-height) - 48px);\n}\n\n@media (max-width: 600px) {\n .operation-example-card {\n max-height: unset;\n position: static;\n }\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoEA,MAAM,iBAAiB,eAAe,QAAA,UAAU,WAAW,QAAA,QAAQ,GAAE;EACrE,MAAM,sBAAsB,eAAe,mBAAmB,QAAA,UAAU,CAAA;;EAGxE,MAAM,qBAAqB,IAAY,GAAE;EAEzC,MAAM,EAAE,oBAAoB,cAAa;;uBAGvC,YA4JmB,MAAA,yBAAA,EAAA;IA3JhB,IAAI,QAAA;IACJ,cAAY,eAAA;IACb,OAAM;IACL,YAAU,CAAG,QAAA;IACd,aAAA;IACC,uBAAiB,OAAA,OAAA,OAAA,MAAU,UAAU,QAAA,UAAU,KAAI,mBAAA;KAAA,IAAsB,QAAA;KAAE,MAAQ;KAAK,CAAA;;IAG9E,OAAK,cAyCR,CAxCN,mBAwCM,OAxCN,YAwCM,CAvCJ,mBAsCM,OAtCN,YAsCM,CArCJ,YAGU,MAAA,mBAAA,EAAA;KAFR,OAAM;KACL,QAAQ,QAAA;KACT,OAAA;6B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AAA,EAA1B,YAEW,MAAA,iBAAA,EAAA,EAAA,KAAA,GAAA,EAAA;6BADuC,CAAhD,YAAgD,MAAA,qBAAA,EAAA,EAAjC,OAAO,QAAA,UAAU,cAAA,EAAA,MAAA,GAAA,CAAA,QAAA,CAAA,CAAA,CAAA;;yCAGlC,YAcsB,MAAA,oBAAA,EAAA,MAAA;6BADA,CAZpB,YAYoB,MAAA,oBAAA,EAAA;OAXV,iBAAiB,mBAAA;4FAAkB,QAAA;OAC3C,OAAM;OACL,eAAA,QAAA;OACA,UAAA,QAAA;OACD,UAAA;OACC,WAAA,QAAA;OACA,QAAA,QAAA;OACA,WAAA,QAAA;OACA,MAAA,QAAA;OACA,iBAAiB,QAAA;OACjB,gBAAA,QAAA;OACA,gBAAA,QAAA;;;;;;;;;;;;;;;;;OArED,QAAA,UAAU,cAAA;UACf;sBAQc,CAPf,YAOe,MAAA,eAAA,EAAA;KANZ,cAAc,QAAA;KACf,cAAW;KACX,MAAK;KACL,eAAc;KACb,OAAO,QAAA,UAAU;KAClB,aAAA;KACA,YAAA"}
|
|
1
|
+
{"version":3,"file":"ClassicLayout.vue.script.js","names":[],"sources":["../../../../src/features/Operation/layouts/ClassicLayout.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { OperationCodeSample } from '@scalar/api-client/v2/blocks/operation-code-sample'\nimport type { SecuritySchemeObjectSecret } from '@scalar/api-client/v2/blocks/scalar-auth-selector-block'\nimport {\n ScalarErrorBoundary,\n ScalarIconButton,\n ScalarMarkdown,\n} from '@scalar/components'\nimport {\n ScalarIconCopy,\n ScalarIconPlay,\n ScalarIconWebhooksLogo,\n} from '@scalar/icons'\nimport {\n getOperationStability,\n getOperationStabilityColor,\n isOperationDeprecated,\n} from '@scalar/oas-utils/helpers'\nimport { useClipboard } from '@scalar/use-hooks/useClipboard'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport type {\n OperationObject,\n ServerObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed, provide, ref } from 'vue'\n\nimport { Anchor } from '@/components/Anchor'\nimport { Badge } from '@/components/Badge'\nimport { HttpMethod } from '@/components/HttpMethod'\nimport { LinkList } from '@/components/LinkList'\nimport OperationPath from '@/components/OperationPath.vue'\nimport { SectionAccordion } from '@/components/Section'\nimport { ExampleResponses } from '@/features/example-responses'\nimport { ExternalDocs } from '@/features/external-docs'\nimport Callbacks from '@/features/Operation/components/callbacks/Callbacks.vue'\nimport OperationParameters from '@/features/Operation/components/OperationParameters.vue'\nimport OperationResponses from '@/features/Operation/components/OperationResponses.vue'\nimport type { OperationProps } from '@/features/Operation/Operation.vue'\nimport {\n REQUEST_BODY_COMPOSITION_INDEX_SYMBOL,\n type RequestBodyCompositionSelection,\n} from '@/features/Operation/request-body-composition-index'\nimport { getXKeysFromObject } from '@/features/specification-extension'\nimport SpecificationExtension from '@/features/specification-extension/SpecificationExtension.vue'\nimport { TestRequestButton } from '@/features/test-request-button'\nimport { XBadges } from '@/features/x-badges'\n\nconst {\n clientOptions,\n eventBus,\n isWebhook,\n method,\n operation,\n options,\n path,\n selectedServer,\n selectedSecuritySchemes,\n selectedClient,\n} = defineProps<\n Omit<\n OperationProps,\n 'document' | 'pathValue' | 'server' | 'securitySchemes' | 'authStore'\n > & {\n /** Operation object with path params */\n operation: OperationObject\n /** The selected server for the operation */\n selectedServer: ServerObject | null\n /** The selected security schemes for the operation */\n selectedSecuritySchemes: SecuritySchemeObjectSecret[]\n }\n>()\n\nconst operationTitle = computed(() => operation.summary || path || '')\nconst operationExtensions = computed(() => getXKeysFromObject(operation))\n\n/** Track the currently selected example for passing to the modal */\nconst selectedExampleKey = ref<string>('')\n\n/** Selected request body oneOf/anyOf variants; synced with schema dropdowns and code sample */\nconst requestBodyCompositionSelection = ref<RequestBodyCompositionSelection>({})\n\nconst requestBodyCompositionSelectionForCodeSample = computed(\n (): RequestBodyCompositionSelection => ({\n ...requestBodyCompositionSelection.value,\n }),\n)\n\nconst requestBodyCompositionSelectionKey = computed(() =>\n JSON.stringify(requestBodyCompositionSelectionForCodeSample.value),\n)\n\nprovide(REQUEST_BODY_COMPOSITION_INDEX_SYMBOL, requestBodyCompositionSelection)\n\nconst { copyToClipboard } = useClipboard()\n</script>\n<template>\n <SectionAccordion\n :id=\"id\"\n :aria-label=\"operationTitle\"\n class=\"reference-endpoint\"\n :modelValue=\"!isCollapsed\"\n transparent\n @update:modelValue=\"\n (value) => eventBus?.emit('toggle:nav-item', { id, open: value })\n \">\n <template #title>\n <div class=\"operation-title\">\n <div class=\"operation-details\">\n <HttpMethod\n class=\"endpoint-type\"\n :method=\"method\"\n short />\n <Anchor\n class=\"endpoint-anchor\"\n @copyAnchorUrl=\"() => eventBus?.emit('copy-url:nav-item', { id })\">\n <h3 class=\"endpoint-label\">\n <div class=\"endpoint-label-path\">\n <OperationPath\n :deprecated=\"isOperationDeprecated(operation)\"\n :path=\"path\" />\n </div>\n <div class=\"endpoint-label-name\">\n {{ operationTitle }}\n </div>\n <!-- Stability badge -->\n <Badge\n v-if=\"getOperationStability(operation)\"\n class=\"capitalize\"\n :class=\"getOperationStabilityColor(operation)\">\n {{ getOperationStability(operation) }}\n </Badge>\n\n <!-- Webhook badge -->\n <Badge\n v-if=\"isWebhook\"\n class=\"font-code text-green flex w-fit items-center justify-center gap-1\">\n <ScalarIconWebhooksLogo weight=\"bold\" />Webhook\n </Badge>\n\n <!-- x-badges before -->\n <XBadges\n :badges=\"operation['x-badges']\"\n position=\"before\" />\n </h3>\n </Anchor>\n </div>\n </div>\n </template>\n <template #actions=\"{ active }\">\n <!-- x-badges after -->\n <XBadges\n :badges=\"operation['x-badges']\"\n position=\"after\" />\n <template v-if=\"!options.hideTestRequestButton\">\n <TestRequestButton\n v-if=\"active && !isWebhook\"\n :id\n :eventBus\n :exampleName=\"selectedExampleKey\"\n :method\n :path\n :requestBodyCompositionSelection=\"\n requestBodyCompositionSelectionForCodeSample\n \" />\n <ScalarIconPlay\n v-else\n class=\"endpoint-try-hint size-4.5\" />\n </template>\n <span\n v-if=\"options.showOperationId && operation.operationId\"\n class=\"font-code text-sm\">\n {{ operation.operationId }}\n </span>\n <ScalarIconButton\n class=\"endpoint-copy p-0.5\"\n :icon=\"ScalarIconCopy\"\n label=\"Copy endpoint URL\"\n size=\"xs\"\n variant=\"ghost\"\n @click.stop=\"copyToClipboard(path)\" />\n </template>\n <template\n v-if=\"operation.description\"\n #description>\n <ScalarMarkdown\n :anchorPrefix=\"id\"\n aria-label=\"Operation Description\"\n role=\"group\"\n transformType=\"heading\"\n :value=\"operation.description\"\n withAnchors\n withImages />\n </template>\n <div class=\"endpoint-content\">\n <div class=\"operation-details-card\">\n <div\n v-if=\"Object.keys(operationExtensions).length > 0\"\n class=\"operation-details-card-item\">\n <SpecificationExtension :value=\"operationExtensions\" />\n </div>\n <div class=\"operation-details-card-item\">\n <OperationParameters\n :eventBus\n :options\n :parameters=\"operation.parameters\"\n :requestBody=\"getResolvedRef(operation.requestBody)\" />\n </div>\n <div class=\"operation-details-card-item\">\n <OperationResponses\n :eventBus\n :options\n :responses=\"operation.responses\" />\n </div>\n\n <!-- Callbacks -->\n <div\n v-if=\"operation?.callbacks\"\n class=\"operation-details-card-item\">\n <Callbacks\n :callbacks=\"operation.callbacks\"\n :eventBus\n :options\n :path />\n </div>\n </div>\n\n <ExampleResponses\n v-if=\"operation.responses\"\n class=\"operation-example-card\"\n :responses=\"operation.responses\" />\n\n <!-- New Example Request -->\n <div>\n <!-- External Docs -->\n <LinkList v-if=\"operation.externalDocs\">\n <ExternalDocs :value=\"operation.externalDocs\" />\n </LinkList>\n <!-- Request Example -->\n <ScalarErrorBoundary>\n <OperationCodeSample\n v-model:selectedExample=\"selectedExampleKey\"\n :key=\"requestBodyCompositionSelectionKey\"\n class=\"operation-example-card\"\n :clientOptions\n :eventBus\n fallback\n :isWebhook\n :method\n :operation\n :path\n :requestBodyCompositionSelection=\"\n requestBodyCompositionSelectionForCodeSample\n \"\n :securitySchemes=\"selectedSecuritySchemes\"\n :selectedClient\n :selectedServer />\n </ScalarErrorBoundary>\n </div>\n </div>\n </SectionAccordion>\n</template>\n\n<style scoped>\n@reference \"@/style.css\";\n\n.operation-title {\n display: flex;\n justify-content: space-between;\n}\n.operation-details {\n display: flex;\n align-items: center;\n margin-top: 0;\n gap: 9px;\n\n min-width: 0;\n flex-shrink: 1;\n}\n.operation-details :deep(.endpoint-anchor .scalar-button svg) {\n width: 16px;\n height: 16px;\n}\n.endpoint-type {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 6px;\n\n position: relative;\n z-index: 0;\n\n width: 60px;\n padding: 6px;\n flex-shrink: 0;\n\n font-size: var(--scalar-small);\n\n text-transform: uppercase;\n font-weight: var(--scalar-bold);\n font-family: var(--scalar-font);\n}\n.endpoint-type::after {\n content: '';\n position: absolute;\n inset: 0;\n z-index: -1;\n\n background: currentColor;\n opacity: 0.15;\n\n border-radius: var(--scalar-radius);\n}\n\n.endpoint-anchor {\n display: flex;\n align-items: center;\n min-width: 0;\n flex-shrink: 1;\n}\n.endpoint-anchor.label {\n display: flex;\n}\n.endpoint-label {\n display: flex;\n align-items: baseline;\n gap: 9px;\n\n min-width: 0;\n flex-shrink: 1;\n\n color: var(--scalar-color-1);\n}\n\n.endpoint-label-path {\n font-family: var(--scalar-font-code);\n font-size: var(--scalar-mini);\n\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n}\n.endpoint-label-path :deep(em) {\n color: var(--scalar-color-2);\n}\n.endpoint-label-name {\n color: var(--scalar-color-2);\n font-size: var(--scalar-small);\n\n /* Concatenate the name before we shrink the path */\n flex-shrink: 1000000000;\n\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n}\n\n.endpoint-try-hint {\n padding: 2px;\n flex-shrink: 0;\n}\n.endpoint-copy {\n color: currentColor;\n}\n.endpoint-copy :deep(svg) {\n stroke-width: 2px;\n}\n\n.endpoint-content {\n display: grid;\n grid-auto-columns: 1fr;\n grid-auto-flow: row;\n gap: 9px;\n padding: 9px;\n}\n\n@variant lg {\n .endpoint-content {\n grid-auto-flow: column;\n }\n}\n\n@container (max-width: 900px) {\n .endpoint-content {\n grid-template-columns: 1fr;\n }\n}\n\n.endpoint-content > * {\n min-width: 0;\n}\n\n.operation-details-card {\n display: flex;\n flex-direction: column;\n gap: 12px;\n min-width: 0;\n}\n.operation-details-card-item :deep(.parameter-list),\n.operation-details-card-item :deep(.callbacks-list) {\n border: var(--scalar-border-width) solid var(--scalar-border-color);\n border-radius: var(--scalar-radius-lg);\n margin-top: 0;\n}\n\n.operation-details-card-item {\n display: flex;\n flex-direction: column;\n gap: 12px;\n}\n\n.operation-details-card-item :deep(.parameter-list-items) {\n margin-bottom: 0;\n}\n.operation-details-card :deep(.parameter-item:last-of-type .parameter-schema) {\n padding-bottom: 12px;\n}\n.operation-details-card :deep(.parameter-list .parameter-list) {\n margin-bottom: 12px;\n}\n.operation-details-card :deep(.parameter-item) {\n margin: 0;\n padding: 0;\n}\n.operation-details-card :deep(.property) {\n padding: 9px;\n margin: 0;\n}\n.operation-details-card :deep(.parameter-list-title),\n.operation-details-card :deep(.request-body-title),\n.operation-details-card :deep(.callbacks-title) {\n text-transform: uppercase;\n font-weight: var(--scalar-bold);\n font-size: var(--scalar-mini);\n color: var(--scalar-color-2);\n line-height: 1.33;\n padding: 9px;\n margin: 0;\n}\n\n.operation-details-card :deep(.callback-list-item-title) {\n padding-left: 28px;\n padding-right: 12px;\n}\n\n.operation-details-card :deep(.callback-list-item-icon) {\n left: 6px;\n}\n\n.operation-details-card :deep(.callback-operation-container) {\n padding-inline: 9px;\n padding-bottom: 9px;\n}\n\n.operation-details-card :deep(.callback-operation-container > .request-body),\n.operation-details-card :deep(.callback-operation-container > .parameter-list) {\n border: none;\n}\n\n.operation-details-card\n :deep(.callback-operation-container > .request-body > .request-body-header) {\n padding: 0;\n padding-bottom: 9px;\n border-bottom: var(--scalar-border-width) solid var(--scalar-border-color);\n}\n\n.operation-details-card :deep(.request-body-description) {\n margin-top: 0;\n padding: 9px 9px 0 9px;\n border-top: var(--scalar-border-width) solid var(--scalar-border-color);\n}\n\n.operation-details-card :deep(.request-body) {\n margin-top: 0;\n border-radius: var(--scalar-radius-lg);\n border: var(--scalar-border-width) solid var(--scalar-border-color);\n}\n.operation-details-card\n :deep(.request-body .schema-card--level-0 > .schema-card-description) {\n padding-inline: 9px;\n}\n\n.operation-details-card :deep(.request-body-header) {\n padding-bottom: 0;\n border-bottom: 0;\n}\n\n.operation-details-card :deep(.contents button) {\n margin-right: 9px;\n}\n\n.operation-details-card\n :deep(.schema-card--open + .schema-card:not(.schema-card--open)) {\n margin-inline: 9px;\n margin-bottom: 9px;\n}\n.operation-details-card :deep(.request-body-schema .property--level-0) {\n padding: 0;\n}\n.operation-details-card :deep(.request-body-schema .property--level-0) {\n padding: 0;\n}\n\n.operation-details-card :deep(.selected-content-type) {\n margin-right: 9px;\n}\n\n.operation-example-card {\n position: sticky;\n top: calc(var(--refs-viewport-offset) + 24px);\n max-height: calc(var(--refs-viewport-height) - 48px);\n}\n\n@media (max-width: 600px) {\n .operation-example-card {\n max-height: unset;\n position: static;\n }\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwEA,MAAM,iBAAiB,eAAe,QAAA,UAAU,WAAW,QAAA,QAAQ,GAAE;EACrE,MAAM,sBAAsB,eAAe,mBAAmB,QAAA,UAAU,CAAA;;EAGxE,MAAM,qBAAqB,IAAY,GAAE;;EAGzC,MAAM,kCAAkC,IAAqC,EAAE,CAAA;EAE/E,MAAM,+CAA+C,gBACX,EACtC,GAAG,gCAAgC,OACpC,EACH;EAEA,MAAM,qCAAqC,eACzC,KAAK,UAAU,6CAA6C,MAAM,CACpE;AAEA,UAAQ,uCAAuC,gCAA+B;EAE9E,MAAM,EAAE,oBAAoB,cAAa;;uBAGvC,YAmKmB,MAAA,yBAAA,EAAA;IAlKhB,IAA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,QAAA;OACA,SAAA,QAAA;OACA,WAAW,QAAA,UAAU;;;;;;MAKlB,QAAA,WAAW,aAAA,WAAA,EADnB,mBAQM,OARN,aAQM,CALJ,YAIU,mBAAA;OAHP,WAAW,QAAA,UAAU;OACrB,UAAA,QAAA;OACA,SAAA,QAAA;OACA,MAAA,QAAA;;;;;;;;KAKC,QAAA,UAAU,aAAA,WAAA,EADlB,YAGqC,MAAA,yBAAA,EAAA;;MADnC,OAAM;MACL,WAAW,QAAA,UAAU;;KAGxB,mBAyBM,OAAA,MAAA,CAvBY,QAAA,UAAU,gBAAA,WAAA,EAA1B,YAEW,MAAA,iBAAA,EAAA,EAAA,KAAA,GAAA,EAAA;6BADuC,CAAhD,YAAgD,MAAA,qBAAA,EAAA,EAAjC,OAAO,QAAA,UAAU,cAAA,EAAA,MAAA,GAAA,CAAA,QAAA,CAAA,CAAA,CAAA;;yCAGlC,YAkBsB,MAAA,oBAAA,EAAA,MAAA;6BADA,EAAA,WAAA,EAhBpB,YAgBoB,MAAA,oBAAA,EAAA;OAfV,iBAAiB,mBAAA;4FAAkB,QAAA;OAC1C,KAAK,mCAAA;OACN,OAAM;OACL,eAAA,QAAA;OACA,UAAA,QAAA;OACD,UAAA;OACC,WAAA,QAAA;OACA,QAAA,QAAA;OACA,WAAA,QAAA;OACA,MAAA,QAAA;OACA,iCAAgD,6CAAA;OAGhD,iBAAiB,QAAA;OACjB,gBAAA,QAAA;OACA,gBAAA,QAAA;;;;;;;;;;;;;;;;;;OAzED,QAAA,UAAU,cAAA;UACf;sBAQc,CAPf,YAOe,MAAA,eAAA,EAAA;KANZ,cAAc,QAAA;KACf,cAAW;KACX,MAAK;KACL,eAAc;KACb,OAAO,QAAA,UAAU;KAClB,aAAA;KACA,YAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModernLayout.vue.d.ts","sourceRoot":"","sources":["../../../../src/features/Operation/layouts/ModernLayout.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ModernLayout.vue.d.ts","sourceRoot":"","sources":["../../../../src/features/Operation/layouts/ModernLayout.vue"],"names":[],"mappings":"AA0RA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,yDAAyD,CAAA;AASzG,OAAO,KAAK,EACV,eAAe,EACf,YAAY,EACb,MAAM,8DAA8D,CAAA;AAqBrE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAA;AAUxE,KAAK,WAAW,GAAG,IAAI,CACnB,cAAc,EACZ,UAAU,GACV,WAAW,GACX,QAAQ,GACR,aAAa,GACb,iBAAiB,GACjB,WAAW,CACd,GAAG;IACF,wCAAwC;IACxC,SAAS,EAAE,eAAe,CAAA;IAC1B,4CAA4C;IAC5C,cAAc,EAAE,YAAY,GAAG,IAAI,CAAA;IACnC,sDAAsD;IACtD,uBAAuB,EAAE,0BAA0B,EAAE,CAAA;CACtD,CAAC;AAklBJ,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -2,7 +2,7 @@ import _plugin_vue_export_helper_default from "../../../_virtual/_plugin-vue_exp
|
|
|
2
2
|
import ModernLayout_vue_vue_type_script_setup_true_lang_default from "./ModernLayout.vue.script.js";
|
|
3
3
|
/* empty css */
|
|
4
4
|
//#region src/features/Operation/layouts/ModernLayout.vue
|
|
5
|
-
var ModernLayout_default = /* @__PURE__ */ _plugin_vue_export_helper_default(ModernLayout_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-
|
|
5
|
+
var ModernLayout_default = /* @__PURE__ */ _plugin_vue_export_helper_default(ModernLayout_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-9c51b5c5"]]);
|
|
6
6
|
//#endregion
|
|
7
7
|
export { ModernLayout_default as default };
|
|
8
8
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModernLayout.vue.js","names":[],"sources":["../../../../src/features/Operation/layouts/ModernLayout.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { OperationCodeSample } from '@scalar/api-client/v2/blocks/operation-code-sample'\nimport type { SecuritySchemeObjectSecret } from '@scalar/api-client/v2/blocks/scalar-auth-selector-block'\nimport { ScalarErrorBoundary, ScalarMarkdown } from '@scalar/components'\nimport { ScalarIconWebhooksLogo } from '@scalar/icons'\nimport {\n getOperationStability,\n getOperationStabilityColor,\n isOperationDeprecated,\n} from '@scalar/oas-utils/helpers'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport type {\n OperationObject,\n ServerObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed, useId } from 'vue'\n\nimport { Anchor } from '@/components/Anchor'\nimport { Badge } from '@/components/Badge'\nimport { LinkList } from '@/components/LinkList'\nimport OperationPath from '@/components/OperationPath.vue'\nimport {\n Section,\n SectionColumn,\n SectionColumns,\n SectionContent,\n SectionHeader,\n SectionHeaderTag,\n} from '@/components/Section'\nimport AskAgentButton from '@/features/ask-agent-button/AskAgentButton.vue'\nimport { ExampleResponses } from '@/features/example-responses'\nimport { ExternalDocs } from '@/features/external-docs'\nimport Callbacks from '@/features/Operation/components/callbacks/Callbacks.vue'\nimport OperationParameters from '@/features/Operation/components/OperationParameters.vue'\nimport OperationResponses from '@/features/Operation/components/OperationResponses.vue'\nimport type { OperationProps } from '@/features/Operation/Operation.vue'\nimport { getXKeysFromObject } from '@/features/specification-extension'\nimport SpecificationExtension from '@/features/specification-extension/SpecificationExtension.vue'\nimport { TestRequestButton } from '@/features/test-request-button'\nimport { XBadges } from '@/features/x-badges'\n\nconst {\n clientOptions,\n eventBus,\n isWebhook,\n method,\n operation,\n options,\n path,\n selectedServer,\n selectedSecuritySchemes,\n selectedClient,\n} = defineProps<\n Omit<\n OperationProps,\n | 'document'\n | 'pathValue'\n | 'server'\n | 'isCollapsed'\n | 'securitySchemes'\n | 'authStore'\n > & {\n /** Operation object with path params */\n operation: OperationObject\n /** The selected server for the operation */\n selectedServer: ServerObject | null\n /** The selected security schemes for the operation */\n selectedSecuritySchemes: SecuritySchemeObjectSecret[]\n }\n>()\n\nconst operationTitle = computed(() => operation.summary || path || '')\n\nconst labelId = useId()\n\nconst operationExtensions = computed(() => getXKeysFromObject(operation))\n</script>\n\n<template>\n <Section\n :id=\"id\"\n :aria-labelledby=\"labelId\"\n :label=\"operationTitle\"\n tabindex=\"-1\"\n @intersecting=\"() => eventBus?.emit('intersecting:nav-item', { id })\">\n <SectionContent>\n <div class=\"flex flex-row justify-between gap-1\">\n <!-- Left -->\n <div class=\"flex gap-1\">\n <!-- Operation ID -->\n <Badge v-if=\"options?.showOperationId && operation.operationId\">\n {{ operation.operationId }}\n </Badge>\n <!-- Stability badge -->\n <Badge\n v-if=\"getOperationStability(operation)\"\n class=\"capitalize\"\n :class=\"getOperationStabilityColor(operation)\">\n {{ getOperationStability(operation) }}\n </Badge>\n <!-- Webhook badge -->\n <Badge\n v-if=\"isWebhook\"\n class=\"font-code text-green flex w-fit items-center justify-center gap-1\">\n <ScalarIconWebhooksLogo weight=\"bold\" />Webhook\n </Badge>\n <!-- x-badges before -->\n <XBadges\n :badges=\"operation['x-badges']\"\n position=\"before\" />\n </div>\n <!-- Right -->\n <div class=\"flex gap-1\">\n <!-- x-badges after -->\n <XBadges\n :badges=\"operation['x-badges']\"\n position=\"after\" />\n </div>\n </div>\n <div :class=\"isOperationDeprecated(operation) ? 'deprecated' : ''\">\n <SectionHeader>\n <Anchor\n @copyAnchorUrl=\"() => eventBus?.emit('copy-url:nav-item', { id })\">\n <SectionHeaderTag\n :id=\"labelId\"\n :level=\"3\">\n {{ operationTitle }}\n </SectionHeaderTag>\n </Anchor>\n </SectionHeader>\n </div>\n <SectionColumns>\n <SectionColumn>\n <div class=\"operation-details\">\n <SpecificationExtension :value=\"operationExtensions\" />\n <ScalarMarkdown\n :anchorPrefix=\"id\"\n aria-label=\"Operation Description\"\n role=\"group\"\n transformType=\"heading\"\n :value=\"operation.description\"\n withAnchors\n withImages />\n <OperationParameters\n :breadcrumb=\"[id]\"\n :eventBus\n :options\n :parameters=\"operation.parameters\"\n :requestBody=\"getResolvedRef(operation.requestBody)\" />\n <OperationResponses\n :breadcrumb=\"[id]\"\n :collapsableItems=\"!options.expandAllResponses\"\n :eventBus\n :options\n :responses=\"operation.responses\" />\n\n <!-- Callbacks -->\n <ScalarErrorBoundary>\n <Callbacks\n v-if=\"operation.callbacks\"\n :callbacks=\"operation.callbacks\"\n class=\"mt-6\"\n :eventBus\n :options\n :path />\n </ScalarErrorBoundary>\n </div>\n </SectionColumn>\n <SectionColumn>\n <div class=\"examples\">\n <!-- External Docs -->\n <LinkList v-if=\"operation.externalDocs\">\n <ExternalDocs :value=\"operation.externalDocs\" />\n </LinkList>\n\n <!-- New Example Request -->\n <ScalarErrorBoundary>\n <OperationCodeSample\n :clientOptions\n :eventBus\n fallback\n :isWebhook\n :method\n :operation\n :path\n :securitySchemes=\"selectedSecuritySchemes\"\n :selectedClient\n :selectedServer>\n <template #header>\n <OperationPath\n class=\"font-code text-c-2 [&_em]:text-c-1 [&_em]:not-italic\"\n :deprecated=\"operation?.deprecated\"\n :path=\"path\" />\n </template>\n <template\n v-if=\"!isWebhook\"\n #footer=\"{ exampleName }\">\n <div class=\"flex\">\n <AskAgentButton />\n <TestRequestButton\n v-if=\"!options.hideTestRequestButton\"\n :id\n :eventBus\n :exampleName\n :method\n :path />\n </div>\n </template>\n </OperationCodeSample>\n </ScalarErrorBoundary>\n\n <ScalarErrorBoundary>\n <ExampleResponses\n v-if=\"operation.responses\"\n :responses=\"operation.responses\"\n style=\"margin-top: 12px\" />\n </ScalarErrorBoundary>\n </div>\n </SectionColumn>\n </SectionColumns>\n </SectionContent>\n </Section>\n</template>\n\n<style scoped>\n.examples {\n position: sticky;\n top: calc(var(--refs-viewport-offset) + 24px);\n}\n\n.examples > * {\n max-height: calc((var(--refs-viewport-height) - 60px) / 2);\n position: relative;\n}\n\n.examples > *:first-of-type:last-of-type {\n max-height: calc((var(--refs-viewport-height) - 60px));\n}\n\n/*\n * Don't constrain card height on mobile\n * (or zoomed in screens)\n */\n@media (max-width: 600px) {\n .examples > * {\n max-height: unset;\n }\n}\n.deprecated * {\n text-decoration: line-through;\n}\n</style>\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"ModernLayout.vue.js","names":[],"sources":["../../../../src/features/Operation/layouts/ModernLayout.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { OperationCodeSample } from '@scalar/api-client/v2/blocks/operation-code-sample'\nimport type { SecuritySchemeObjectSecret } from '@scalar/api-client/v2/blocks/scalar-auth-selector-block'\nimport { ScalarErrorBoundary, ScalarMarkdown } from '@scalar/components'\nimport { ScalarIconWebhooksLogo } from '@scalar/icons'\nimport {\n getOperationStability,\n getOperationStabilityColor,\n isOperationDeprecated,\n} from '@scalar/oas-utils/helpers'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport type {\n OperationObject,\n ServerObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed, provide, ref, useId } from 'vue'\n\nimport { Anchor } from '@/components/Anchor'\nimport { Badge } from '@/components/Badge'\nimport { LinkList } from '@/components/LinkList'\nimport OperationPath from '@/components/OperationPath.vue'\nimport {\n Section,\n SectionColumn,\n SectionColumns,\n SectionContent,\n SectionHeader,\n SectionHeaderTag,\n} from '@/components/Section'\nimport AskAgentButton from '@/features/ask-agent-button/AskAgentButton.vue'\nimport { ExampleResponses } from '@/features/example-responses'\nimport { ExternalDocs } from '@/features/external-docs'\nimport Callbacks from '@/features/Operation/components/callbacks/Callbacks.vue'\nimport OperationParameters from '@/features/Operation/components/OperationParameters.vue'\nimport OperationResponses from '@/features/Operation/components/OperationResponses.vue'\nimport type { OperationProps } from '@/features/Operation/Operation.vue'\nimport {\n REQUEST_BODY_COMPOSITION_INDEX_SYMBOL,\n type RequestBodyCompositionSelection,\n} from '@/features/Operation/request-body-composition-index'\nimport { getXKeysFromObject } from '@/features/specification-extension'\nimport SpecificationExtension from '@/features/specification-extension/SpecificationExtension.vue'\nimport { TestRequestButton } from '@/features/test-request-button'\nimport { XBadges } from '@/features/x-badges'\n\nconst {\n clientOptions,\n eventBus,\n isWebhook,\n method,\n operation,\n options,\n path,\n selectedServer,\n selectedSecuritySchemes,\n selectedClient,\n} = defineProps<\n Omit<\n OperationProps,\n | 'document'\n | 'pathValue'\n | 'server'\n | 'isCollapsed'\n | 'securitySchemes'\n | 'authStore'\n > & {\n /** Operation object with path params */\n operation: OperationObject\n /** The selected server for the operation */\n selectedServer: ServerObject | null\n /** The selected security schemes for the operation */\n selectedSecuritySchemes: SecuritySchemeObjectSecret[]\n }\n>()\n\nconst operationTitle = computed(() => operation.summary || path || '')\n\nconst labelId = useId()\n\nconst operationExtensions = computed(() => getXKeysFromObject(operation))\n\n/** Selected request body oneOf/anyOf variants; synced with schema dropdowns and code sample */\nconst requestBodyCompositionSelection = ref<RequestBodyCompositionSelection>({})\n\nconst requestBodyCompositionSelectionForCodeSample = computed(\n (): RequestBodyCompositionSelection => ({\n ...requestBodyCompositionSelection.value,\n }),\n)\n\nconst requestBodyCompositionSelectionKey = computed(() =>\n JSON.stringify(requestBodyCompositionSelectionForCodeSample.value),\n)\n\nprovide(REQUEST_BODY_COMPOSITION_INDEX_SYMBOL, requestBodyCompositionSelection)\n</script>\n\n<template>\n <Section\n :id=\"id\"\n :aria-labelledby=\"labelId\"\n :label=\"operationTitle\"\n tabindex=\"-1\"\n @intersecting=\"() => eventBus?.emit('intersecting:nav-item', { id })\">\n <SectionContent>\n <div class=\"flex flex-row justify-between gap-1\">\n <!-- Left -->\n <div class=\"flex gap-1\">\n <!-- Operation ID -->\n <Badge v-if=\"options?.showOperationId && operation.operationId\">\n {{ operation.operationId }}\n </Badge>\n <!-- Stability badge -->\n <Badge\n v-if=\"getOperationStability(operation)\"\n class=\"capitalize\"\n :class=\"getOperationStabilityColor(operation)\">\n {{ getOperationStability(operation) }}\n </Badge>\n <!-- Webhook badge -->\n <Badge\n v-if=\"isWebhook\"\n class=\"font-code text-green flex w-fit items-center justify-center gap-1\">\n <ScalarIconWebhooksLogo weight=\"bold\" />Webhook\n </Badge>\n <!-- x-badges before -->\n <XBadges\n :badges=\"operation['x-badges']\"\n position=\"before\" />\n </div>\n <!-- Right -->\n <div class=\"flex gap-1\">\n <!-- x-badges after -->\n <XBadges\n :badges=\"operation['x-badges']\"\n position=\"after\" />\n </div>\n </div>\n <div :class=\"isOperationDeprecated(operation) ? 'deprecated' : ''\">\n <SectionHeader>\n <Anchor\n @copyAnchorUrl=\"() => eventBus?.emit('copy-url:nav-item', { id })\">\n <SectionHeaderTag\n :id=\"labelId\"\n :level=\"3\">\n {{ operationTitle }}\n </SectionHeaderTag>\n </Anchor>\n </SectionHeader>\n </div>\n <SectionColumns>\n <SectionColumn>\n <div class=\"operation-details\">\n <SpecificationExtension :value=\"operationExtensions\" />\n <ScalarMarkdown\n :anchorPrefix=\"id\"\n aria-label=\"Operation Description\"\n role=\"group\"\n transformType=\"heading\"\n :value=\"operation.description\"\n withAnchors\n withImages />\n <OperationParameters\n :breadcrumb=\"[id]\"\n :eventBus\n :options\n :parameters=\"operation.parameters\"\n :requestBody=\"getResolvedRef(operation.requestBody)\" />\n <OperationResponses\n :breadcrumb=\"[id]\"\n :collapsableItems=\"!options.expandAllResponses\"\n :eventBus\n :options\n :responses=\"operation.responses\" />\n\n <!-- Callbacks -->\n <ScalarErrorBoundary>\n <Callbacks\n v-if=\"operation.callbacks\"\n :callbacks=\"operation.callbacks\"\n class=\"mt-6\"\n :eventBus\n :options\n :path />\n </ScalarErrorBoundary>\n </div>\n </SectionColumn>\n <SectionColumn>\n <div class=\"examples\">\n <!-- External Docs -->\n <LinkList v-if=\"operation.externalDocs\">\n <ExternalDocs :value=\"operation.externalDocs\" />\n </LinkList>\n\n <!-- New Example Request -->\n <ScalarErrorBoundary>\n <OperationCodeSample\n :key=\"requestBodyCompositionSelectionKey\"\n :clientOptions\n :eventBus\n fallback\n :isWebhook\n :method\n :operation\n :path\n :requestBodyCompositionSelection=\"\n requestBodyCompositionSelectionForCodeSample\n \"\n :securitySchemes=\"selectedSecuritySchemes\"\n :selectedClient\n :selectedServer>\n <template #header>\n <OperationPath\n class=\"font-code text-c-2 [&_em]:text-c-1 [&_em]:not-italic\"\n :deprecated=\"operation?.deprecated\"\n :path=\"path\" />\n </template>\n <template\n v-if=\"!isWebhook\"\n #footer=\"{ exampleName }\">\n <div class=\"flex\">\n <AskAgentButton />\n <TestRequestButton\n v-if=\"!options.hideTestRequestButton\"\n :id\n :eventBus\n :exampleName\n :method\n :path\n :requestBodyCompositionSelection=\"\n requestBodyCompositionSelectionForCodeSample\n \" />\n </div>\n </template>\n </OperationCodeSample>\n </ScalarErrorBoundary>\n\n <ScalarErrorBoundary>\n <ExampleResponses\n v-if=\"operation.responses\"\n :responses=\"operation.responses\"\n style=\"margin-top: 12px\" />\n </ScalarErrorBoundary>\n </div>\n </SectionColumn>\n </SectionColumns>\n </SectionContent>\n </Section>\n</template>\n\n<style scoped>\n.examples {\n position: sticky;\n top: calc(var(--refs-viewport-offset) + 24px);\n}\n\n.examples > * {\n max-height: calc((var(--refs-viewport-height) - 60px) / 2);\n position: relative;\n}\n\n.examples > *:first-of-type:last-of-type {\n max-height: calc((var(--refs-viewport-height) - 60px));\n}\n\n/*\n * Don't constrain card height on mobile\n * (or zoomed in screens)\n */\n@media (max-width: 600px) {\n .examples > * {\n max-height: unset;\n }\n}\n.deprecated * {\n text-decoration: line-through;\n}\n</style>\n"],"mappings":""}
|
|
@@ -10,6 +10,7 @@ import { getXKeysFromObject } from "../../specification-extension/helpers.js";
|
|
|
10
10
|
import SpecificationExtension_default from "../../specification-extension/SpecificationExtension.vue.js";
|
|
11
11
|
import LinkList_default from "../../../components/LinkList/LinkList.vue.js";
|
|
12
12
|
import ExternalDocs_default from "../../external-docs/ExternalDocs.vue.js";
|
|
13
|
+
import { REQUEST_BODY_COMPOSITION_INDEX_SYMBOL } from "../request-body-composition-index.js";
|
|
13
14
|
import OperationPath_default from "../../../components/OperationPath.vue.js";
|
|
14
15
|
import ExampleResponses_default from "../../example-responses/ExampleResponses.vue.js";
|
|
15
16
|
import OperationParameters_default from "../components/OperationParameters.vue.js";
|
|
@@ -18,7 +19,7 @@ import Callbacks_default from "../components/callbacks/Callbacks.vue.js";
|
|
|
18
19
|
import TestRequestButton_default from "../../test-request-button/TestRequestButton.vue.js";
|
|
19
20
|
import XBadges_default from "../../x-badges/XBadges.vue.js";
|
|
20
21
|
import AskAgentButton_default from "../../ask-agent-button/AskAgentButton.vue.js";
|
|
21
|
-
import { computed, createBlock, createCommentVNode, createElementVNode, createSlots, createTextVNode, createVNode, defineComponent, normalizeClass, openBlock, toDisplayString, unref, useId, withCtx } from "vue";
|
|
22
|
+
import { computed, createBlock, createCommentVNode, createElementVNode, createSlots, createTextVNode, createVNode, defineComponent, normalizeClass, openBlock, provide, ref, toDisplayString, unref, useId, withCtx } from "vue";
|
|
22
23
|
import { ScalarErrorBoundary, ScalarMarkdown } from "@scalar/components";
|
|
23
24
|
import { ScalarIconWebhooksLogo } from "@scalar/icons";
|
|
24
25
|
import { getOperationStability, getOperationStabilityColor, isOperationDeprecated } from "@scalar/oas-utils/helpers";
|
|
@@ -50,6 +51,11 @@ var ModernLayout_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ d
|
|
|
50
51
|
const operationTitle = computed(() => __props.operation.summary || __props.path || "");
|
|
51
52
|
const labelId = useId();
|
|
52
53
|
const operationExtensions = computed(() => getXKeysFromObject(__props.operation));
|
|
54
|
+
/** Selected request body oneOf/anyOf variants; synced with schema dropdowns and code sample */
|
|
55
|
+
const requestBodyCompositionSelection = ref({});
|
|
56
|
+
const requestBodyCompositionSelectionForCodeSample = computed(() => ({ ...requestBodyCompositionSelection.value }));
|
|
57
|
+
const requestBodyCompositionSelectionKey = computed(() => JSON.stringify(requestBodyCompositionSelectionForCodeSample.value));
|
|
58
|
+
provide(REQUEST_BODY_COMPOSITION_INDEX_SYMBOL, requestBodyCompositionSelection);
|
|
53
59
|
return (_ctx, _cache) => {
|
|
54
60
|
return openBlock(), createBlock(unref(Section_default), {
|
|
55
61
|
id: __props.id,
|
|
@@ -164,7 +170,8 @@ var ModernLayout_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ d
|
|
|
164
170
|
_: 1
|
|
165
171
|
})) : createCommentVNode("", true),
|
|
166
172
|
createVNode(unref(ScalarErrorBoundary), null, {
|
|
167
|
-
default: withCtx(() => [
|
|
173
|
+
default: withCtx(() => [(openBlock(), createBlock(unref(OperationCodeSample), {
|
|
174
|
+
key: requestBodyCompositionSelectionKey.value,
|
|
168
175
|
clientOptions: __props.clientOptions,
|
|
169
176
|
eventBus: __props.eventBus,
|
|
170
177
|
fallback: "",
|
|
@@ -172,6 +179,7 @@ var ModernLayout_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ d
|
|
|
172
179
|
method: __props.method,
|
|
173
180
|
operation: __props.operation,
|
|
174
181
|
path: __props.path,
|
|
182
|
+
requestBodyCompositionSelection: requestBodyCompositionSelectionForCodeSample.value,
|
|
175
183
|
securitySchemes: __props.selectedSecuritySchemes,
|
|
176
184
|
selectedClient: __props.selectedClient,
|
|
177
185
|
selectedServer: __props.selectedServer
|
|
@@ -190,13 +198,15 @@ var ModernLayout_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ d
|
|
|
190
198
|
eventBus: __props.eventBus,
|
|
191
199
|
exampleName,
|
|
192
200
|
method: __props.method,
|
|
193
|
-
path: __props.path
|
|
201
|
+
path: __props.path,
|
|
202
|
+
requestBodyCompositionSelection: requestBodyCompositionSelectionForCodeSample.value
|
|
194
203
|
}, null, 8, [
|
|
195
204
|
"id",
|
|
196
205
|
"eventBus",
|
|
197
206
|
"exampleName",
|
|
198
207
|
"method",
|
|
199
|
-
"path"
|
|
208
|
+
"path",
|
|
209
|
+
"requestBodyCompositionSelection"
|
|
200
210
|
])) : createCommentVNode("", true)])]),
|
|
201
211
|
key: "0"
|
|
202
212
|
} : void 0]), 1032, [
|
|
@@ -206,10 +216,11 @@ var ModernLayout_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ d
|
|
|
206
216
|
"method",
|
|
207
217
|
"operation",
|
|
208
218
|
"path",
|
|
219
|
+
"requestBodyCompositionSelection",
|
|
209
220
|
"securitySchemes",
|
|
210
221
|
"selectedClient",
|
|
211
222
|
"selectedServer"
|
|
212
|
-
])]),
|
|
223
|
+
]))]),
|
|
213
224
|
_: 1
|
|
214
225
|
}),
|
|
215
226
|
createVNode(unref(ScalarErrorBoundary), null, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModernLayout.vue.script.js","names":[],"sources":["../../../../src/features/Operation/layouts/ModernLayout.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { OperationCodeSample } from '@scalar/api-client/v2/blocks/operation-code-sample'\nimport type { SecuritySchemeObjectSecret } from '@scalar/api-client/v2/blocks/scalar-auth-selector-block'\nimport { ScalarErrorBoundary, ScalarMarkdown } from '@scalar/components'\nimport { ScalarIconWebhooksLogo } from '@scalar/icons'\nimport {\n getOperationStability,\n getOperationStabilityColor,\n isOperationDeprecated,\n} from '@scalar/oas-utils/helpers'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport type {\n OperationObject,\n ServerObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed, useId } from 'vue'\n\nimport { Anchor } from '@/components/Anchor'\nimport { Badge } from '@/components/Badge'\nimport { LinkList } from '@/components/LinkList'\nimport OperationPath from '@/components/OperationPath.vue'\nimport {\n Section,\n SectionColumn,\n SectionColumns,\n SectionContent,\n SectionHeader,\n SectionHeaderTag,\n} from '@/components/Section'\nimport AskAgentButton from '@/features/ask-agent-button/AskAgentButton.vue'\nimport { ExampleResponses } from '@/features/example-responses'\nimport { ExternalDocs } from '@/features/external-docs'\nimport Callbacks from '@/features/Operation/components/callbacks/Callbacks.vue'\nimport OperationParameters from '@/features/Operation/components/OperationParameters.vue'\nimport OperationResponses from '@/features/Operation/components/OperationResponses.vue'\nimport type { OperationProps } from '@/features/Operation/Operation.vue'\nimport { getXKeysFromObject } from '@/features/specification-extension'\nimport SpecificationExtension from '@/features/specification-extension/SpecificationExtension.vue'\nimport { TestRequestButton } from '@/features/test-request-button'\nimport { XBadges } from '@/features/x-badges'\n\nconst {\n clientOptions,\n eventBus,\n isWebhook,\n method,\n operation,\n options,\n path,\n selectedServer,\n selectedSecuritySchemes,\n selectedClient,\n} = defineProps<\n Omit<\n OperationProps,\n | 'document'\n | 'pathValue'\n | 'server'\n | 'isCollapsed'\n | 'securitySchemes'\n | 'authStore'\n > & {\n /** Operation object with path params */\n operation: OperationObject\n /** The selected server for the operation */\n selectedServer: ServerObject | null\n /** The selected security schemes for the operation */\n selectedSecuritySchemes: SecuritySchemeObjectSecret[]\n }\n>()\n\nconst operationTitle = computed(() => operation.summary || path || '')\n\nconst labelId = useId()\n\nconst operationExtensions = computed(() => getXKeysFromObject(operation))\n</script>\n\n<template>\n <Section\n :id=\"id\"\n :aria-labelledby=\"labelId\"\n :label=\"operationTitle\"\n tabindex=\"-1\"\n @intersecting=\"() => eventBus?.emit('intersecting:nav-item', { id })\">\n <SectionContent>\n <div class=\"flex flex-row justify-between gap-1\">\n <!-- Left -->\n <div class=\"flex gap-1\">\n <!-- Operation ID -->\n <Badge v-if=\"options?.showOperationId && operation.operationId\">\n {{ operation.operationId }}\n </Badge>\n <!-- Stability badge -->\n <Badge\n v-if=\"getOperationStability(operation)\"\n class=\"capitalize\"\n :class=\"getOperationStabilityColor(operation)\">\n {{ getOperationStability(operation) }}\n </Badge>\n <!-- Webhook badge -->\n <Badge\n v-if=\"isWebhook\"\n class=\"font-code text-green flex w-fit items-center justify-center gap-1\">\n <ScalarIconWebhooksLogo weight=\"bold\" />Webhook\n </Badge>\n <!-- x-badges before -->\n <XBadges\n :badges=\"operation['x-badges']\"\n position=\"before\" />\n </div>\n <!-- Right -->\n <div class=\"flex gap-1\">\n <!-- x-badges after -->\n <XBadges\n :badges=\"operation['x-badges']\"\n position=\"after\" />\n </div>\n </div>\n <div :class=\"isOperationDeprecated(operation) ? 'deprecated' : ''\">\n <SectionHeader>\n <Anchor\n @copyAnchorUrl=\"() => eventBus?.emit('copy-url:nav-item', { id })\">\n <SectionHeaderTag\n :id=\"labelId\"\n :level=\"3\">\n {{ operationTitle }}\n </SectionHeaderTag>\n </Anchor>\n </SectionHeader>\n </div>\n <SectionColumns>\n <SectionColumn>\n <div class=\"operation-details\">\n <SpecificationExtension :value=\"operationExtensions\" />\n <ScalarMarkdown\n :anchorPrefix=\"id\"\n aria-label=\"Operation Description\"\n role=\"group\"\n transformType=\"heading\"\n :value=\"operation.description\"\n withAnchors\n withImages />\n <OperationParameters\n :breadcrumb=\"[id]\"\n :eventBus\n :options\n :parameters=\"operation.parameters\"\n :requestBody=\"getResolvedRef(operation.requestBody)\" />\n <OperationResponses\n :breadcrumb=\"[id]\"\n :collapsableItems=\"!options.expandAllResponses\"\n :eventBus\n :options\n :responses=\"operation.responses\" />\n\n <!-- Callbacks -->\n <ScalarErrorBoundary>\n <Callbacks\n v-if=\"operation.callbacks\"\n :callbacks=\"operation.callbacks\"\n class=\"mt-6\"\n :eventBus\n :options\n :path />\n </ScalarErrorBoundary>\n </div>\n </SectionColumn>\n <SectionColumn>\n <div class=\"examples\">\n <!-- External Docs -->\n <LinkList v-if=\"operation.externalDocs\">\n <ExternalDocs :value=\"operation.externalDocs\" />\n </LinkList>\n\n <!-- New Example Request -->\n <ScalarErrorBoundary>\n <OperationCodeSample\n :clientOptions\n :eventBus\n fallback\n :isWebhook\n :method\n :operation\n :path\n :securitySchemes=\"selectedSecuritySchemes\"\n :selectedClient\n :selectedServer>\n <template #header>\n <OperationPath\n class=\"font-code text-c-2 [&_em]:text-c-1 [&_em]:not-italic\"\n :deprecated=\"operation?.deprecated\"\n :path=\"path\" />\n </template>\n <template\n v-if=\"!isWebhook\"\n #footer=\"{ exampleName }\">\n <div class=\"flex\">\n <AskAgentButton />\n <TestRequestButton\n v-if=\"!options.hideTestRequestButton\"\n :id\n :eventBus\n :exampleName\n :method\n :path />\n </div>\n </template>\n </OperationCodeSample>\n </ScalarErrorBoundary>\n\n <ScalarErrorBoundary>\n <ExampleResponses\n v-if=\"operation.responses\"\n :responses=\"operation.responses\"\n style=\"margin-top: 12px\" />\n </ScalarErrorBoundary>\n </div>\n </SectionColumn>\n </SectionColumns>\n </SectionContent>\n </Section>\n</template>\n\n<style scoped>\n.examples {\n position: sticky;\n top: calc(var(--refs-viewport-offset) + 24px);\n}\n\n.examples > * {\n max-height: calc((var(--refs-viewport-height) - 60px) / 2);\n position: relative;\n}\n\n.examples > *:first-of-type:last-of-type {\n max-height: calc((var(--refs-viewport-height) - 60px));\n}\n\n/*\n * Don't constrain card height on mobile\n * (or zoomed in screens)\n */\n@media (max-width: 600px) {\n .examples > * {\n max-height: unset;\n }\n}\n.deprecated * {\n text-decoration: line-through;\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuEA,MAAM,iBAAiB,eAAe,QAAA,UAAU,WAAW,QAAA,QAAQ,GAAE;EAErE,MAAM,UAAU,OAAM;EAEtB,MAAM,sBAAsB,eAAe,mBAAmB,QAAA,UAAU,CAAA;;uBAItE,YA8IU,MAAA,gBAAA,EAAA;IA7IP,IAAI,QAAA;IACJ,mBAAiB,MAAA,QAAO;IACxB,OAAO,eAAA;IACR,UAAS;IACR,gBAAY,OAAA,OAAA,OAAA,WAAQ,QAAA,UAAU,KAAI,yBAAA,EAAA,IAA4B,QAAA,IAAE,CAAA;;2BAwIhD,CAvIjB,YAuIiB,MAAA,uBAAA,EAAA,MAAA;4BAtGT;MAhCN,mBAgCM,OAhCN,YAgCM,CA9BJ,mBAsBM,OAtBN,YAsBM;OApBS,QAAA,SAAS,mBAAmB,QAAA,UAAU,eAAA,WAAA,EAAnD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QAAA;WACA,WAAA,QAAA;WACA,MAAA,QAAA;WACA,iBAAiB,QAAA;WACjB,gBAAA,QAAA;WACA,gBAAA,QAAA;;WACU,QAAM,cAIE,CAHjB,YAGiB,uBAAA;YAFf,OAAM;YACL,YAAY,QAAA,WAAW;YACvB,MAAM,QAAA;;;eAGF,QAAA,YAAA;iBACN;wBAUK,EAVK,kBAAW,CACtB,mBASM,OATN,YASM,CARJ,YAAkB,uBAAA,EAAA,CAET,QAAA,QAAQ,yBAAA,WAAA,EADjB,YAMU,MAAA,0BAAA,EAAA;;YAJP,IAAA,QAAA;YACA,UAAA,QAAA;YACA;YACA,QAAA,QAAA;YACA,MAAA,QAAA;;;;;;;;;;;;;;;;;;;;;;SAMX,YAKsB,MAAA,oBAAA,EAAA,MAAA;kCAHZ,QAAA,UAAU,aAAA,WAAA,EADlB,YAG6B,MAAA,yBAAA,EAAA;;WAD1B,WAAW,QAAA,UAAU;WACtB,OAAA,EAAA,cAAA,QAAwB"}
|
|
1
|
+
{"version":3,"file":"ModernLayout.vue.script.js","names":[],"sources":["../../../../src/features/Operation/layouts/ModernLayout.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { OperationCodeSample } from '@scalar/api-client/v2/blocks/operation-code-sample'\nimport type { SecuritySchemeObjectSecret } from '@scalar/api-client/v2/blocks/scalar-auth-selector-block'\nimport { ScalarErrorBoundary, ScalarMarkdown } from '@scalar/components'\nimport { ScalarIconWebhooksLogo } from '@scalar/icons'\nimport {\n getOperationStability,\n getOperationStabilityColor,\n isOperationDeprecated,\n} from '@scalar/oas-utils/helpers'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport type {\n OperationObject,\n ServerObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed, provide, ref, useId } from 'vue'\n\nimport { Anchor } from '@/components/Anchor'\nimport { Badge } from '@/components/Badge'\nimport { LinkList } from '@/components/LinkList'\nimport OperationPath from '@/components/OperationPath.vue'\nimport {\n Section,\n SectionColumn,\n SectionColumns,\n SectionContent,\n SectionHeader,\n SectionHeaderTag,\n} from '@/components/Section'\nimport AskAgentButton from '@/features/ask-agent-button/AskAgentButton.vue'\nimport { ExampleResponses } from '@/features/example-responses'\nimport { ExternalDocs } from '@/features/external-docs'\nimport Callbacks from '@/features/Operation/components/callbacks/Callbacks.vue'\nimport OperationParameters from '@/features/Operation/components/OperationParameters.vue'\nimport OperationResponses from '@/features/Operation/components/OperationResponses.vue'\nimport type { OperationProps } from '@/features/Operation/Operation.vue'\nimport {\n REQUEST_BODY_COMPOSITION_INDEX_SYMBOL,\n type RequestBodyCompositionSelection,\n} from '@/features/Operation/request-body-composition-index'\nimport { getXKeysFromObject } from '@/features/specification-extension'\nimport SpecificationExtension from '@/features/specification-extension/SpecificationExtension.vue'\nimport { TestRequestButton } from '@/features/test-request-button'\nimport { XBadges } from '@/features/x-badges'\n\nconst {\n clientOptions,\n eventBus,\n isWebhook,\n method,\n operation,\n options,\n path,\n selectedServer,\n selectedSecuritySchemes,\n selectedClient,\n} = defineProps<\n Omit<\n OperationProps,\n | 'document'\n | 'pathValue'\n | 'server'\n | 'isCollapsed'\n | 'securitySchemes'\n | 'authStore'\n > & {\n /** Operation object with path params */\n operation: OperationObject\n /** The selected server for the operation */\n selectedServer: ServerObject | null\n /** The selected security schemes for the operation */\n selectedSecuritySchemes: SecuritySchemeObjectSecret[]\n }\n>()\n\nconst operationTitle = computed(() => operation.summary || path || '')\n\nconst labelId = useId()\n\nconst operationExtensions = computed(() => getXKeysFromObject(operation))\n\n/** Selected request body oneOf/anyOf variants; synced with schema dropdowns and code sample */\nconst requestBodyCompositionSelection = ref<RequestBodyCompositionSelection>({})\n\nconst requestBodyCompositionSelectionForCodeSample = computed(\n (): RequestBodyCompositionSelection => ({\n ...requestBodyCompositionSelection.value,\n }),\n)\n\nconst requestBodyCompositionSelectionKey = computed(() =>\n JSON.stringify(requestBodyCompositionSelectionForCodeSample.value),\n)\n\nprovide(REQUEST_BODY_COMPOSITION_INDEX_SYMBOL, requestBodyCompositionSelection)\n</script>\n\n<template>\n <Section\n :id=\"id\"\n :aria-labelledby=\"labelId\"\n :label=\"operationTitle\"\n tabindex=\"-1\"\n @intersecting=\"() => eventBus?.emit('intersecting:nav-item', { id })\">\n <SectionContent>\n <div class=\"flex flex-row justify-between gap-1\">\n <!-- Left -->\n <div class=\"flex gap-1\">\n <!-- Operation ID -->\n <Badge v-if=\"options?.showOperationId && operation.operationId\">\n {{ operation.operationId }}\n </Badge>\n <!-- Stability badge -->\n <Badge\n v-if=\"getOperationStability(operation)\"\n class=\"capitalize\"\n :class=\"getOperationStabilityColor(operation)\">\n {{ getOperationStability(operation) }}\n </Badge>\n <!-- Webhook badge -->\n <Badge\n v-if=\"isWebhook\"\n class=\"font-code text-green flex w-fit items-center justify-center gap-1\">\n <ScalarIconWebhooksLogo weight=\"bold\" />Webhook\n </Badge>\n <!-- x-badges before -->\n <XBadges\n :badges=\"operation['x-badges']\"\n position=\"before\" />\n </div>\n <!-- Right -->\n <div class=\"flex gap-1\">\n <!-- x-badges after -->\n <XBadges\n :badges=\"operation['x-badges']\"\n position=\"after\" />\n </div>\n </div>\n <div :class=\"isOperationDeprecated(operation) ? 'deprecated' : ''\">\n <SectionHeader>\n <Anchor\n @copyAnchorUrl=\"() => eventBus?.emit('copy-url:nav-item', { id })\">\n <SectionHeaderTag\n :id=\"labelId\"\n :level=\"3\">\n {{ operationTitle }}\n </SectionHeaderTag>\n </Anchor>\n </SectionHeader>\n </div>\n <SectionColumns>\n <SectionColumn>\n <div class=\"operation-details\">\n <SpecificationExtension :value=\"operationExtensions\" />\n <ScalarMarkdown\n :anchorPrefix=\"id\"\n aria-label=\"Operation Description\"\n role=\"group\"\n transformType=\"heading\"\n :value=\"operation.description\"\n withAnchors\n withImages />\n <OperationParameters\n :breadcrumb=\"[id]\"\n :eventBus\n :options\n :parameters=\"operation.parameters\"\n :requestBody=\"getResolvedRef(operation.requestBody)\" />\n <OperationResponses\n :breadcrumb=\"[id]\"\n :collapsableItems=\"!options.expandAllResponses\"\n :eventBus\n :options\n :responses=\"operation.responses\" />\n\n <!-- Callbacks -->\n <ScalarErrorBoundary>\n <Callbacks\n v-if=\"operation.callbacks\"\n :callbacks=\"operation.callbacks\"\n class=\"mt-6\"\n :eventBus\n :options\n :path />\n </ScalarErrorBoundary>\n </div>\n </SectionColumn>\n <SectionColumn>\n <div class=\"examples\">\n <!-- External Docs -->\n <LinkList v-if=\"operation.externalDocs\">\n <ExternalDocs :value=\"operation.externalDocs\" />\n </LinkList>\n\n <!-- New Example Request -->\n <ScalarErrorBoundary>\n <OperationCodeSample\n :key=\"requestBodyCompositionSelectionKey\"\n :clientOptions\n :eventBus\n fallback\n :isWebhook\n :method\n :operation\n :path\n :requestBodyCompositionSelection=\"\n requestBodyCompositionSelectionForCodeSample\n \"\n :securitySchemes=\"selectedSecuritySchemes\"\n :selectedClient\n :selectedServer>\n <template #header>\n <OperationPath\n class=\"font-code text-c-2 [&_em]:text-c-1 [&_em]:not-italic\"\n :deprecated=\"operation?.deprecated\"\n :path=\"path\" />\n </template>\n <template\n v-if=\"!isWebhook\"\n #footer=\"{ exampleName }\">\n <div class=\"flex\">\n <AskAgentButton />\n <TestRequestButton\n v-if=\"!options.hideTestRequestButton\"\n :id\n :eventBus\n :exampleName\n :method\n :path\n :requestBodyCompositionSelection=\"\n requestBodyCompositionSelectionForCodeSample\n \" />\n </div>\n </template>\n </OperationCodeSample>\n </ScalarErrorBoundary>\n\n <ScalarErrorBoundary>\n <ExampleResponses\n v-if=\"operation.responses\"\n :responses=\"operation.responses\"\n style=\"margin-top: 12px\" />\n </ScalarErrorBoundary>\n </div>\n </SectionColumn>\n </SectionColumns>\n </SectionContent>\n </Section>\n</template>\n\n<style scoped>\n.examples {\n position: sticky;\n top: calc(var(--refs-viewport-offset) + 24px);\n}\n\n.examples > * {\n max-height: calc((var(--refs-viewport-height) - 60px) / 2);\n position: relative;\n}\n\n.examples > *:first-of-type:last-of-type {\n max-height: calc((var(--refs-viewport-height) - 60px));\n}\n\n/*\n * Don't constrain card height on mobile\n * (or zoomed in screens)\n */\n@media (max-width: 600px) {\n .examples > * {\n max-height: unset;\n }\n}\n.deprecated * {\n text-decoration: line-through;\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2EA,MAAM,iBAAiB,eAAe,QAAA,UAAU,WAAW,QAAA,QAAQ,GAAE;EAErE,MAAM,UAAU,OAAM;EAEtB,MAAM,sBAAsB,eAAe,mBAAmB,QAAA,UAAU,CAAA;;EAGxE,MAAM,kCAAkC,IAAqC,EAAE,CAAA;EAE/E,MAAM,+CAA+C,gBACX,EACtC,GAAG,gCAAgC,OACpC,EACH;EAEA,MAAM,qCAAqC,eACzC,KAAK,UAAU,6CAA6C,MAAM,CACpE;AAEA,UAAQ,uCAAuC,gCAA+B;;uBAI5E,YAqJU,MAAA,gBAAA,EAAA;IApJP,IAAI,QAAA;IACJ,mBAAiB,MAAA,QAAO;IACxB,OAAO,eAAA;IACR,UAAS;IACR,gBAAY,OAAA,OAAA,OAAA,WAAQ,QAAA,UAAU,KAAI,yBAAA,EAAA,IAA4B,QAAA,IAAE,CAAA;;2BA+IhD,CA9IjB,YA8IiB,MAAA,uBAAA,EAAA,MAAA;4BA7GT;MAhCN,mBAgCM,OAhCN,YAgCM,CA9BJ,mBAsBM,OAtBN,YAsBM;OApBS,QAAA,SAAS,mBAAmB,QAAA,UAAU,eAAA,WAAA,EAAnD,YAEQ,MAAA,cAAA,EAAA,EAAA,KAAA,GAAA,EAAA;+BADqB,CAAA,gBAAA,gBAAxB,QAAA,UAAU,YAAW,EAAA,EAAA,CAAA,CAAA;;;OAIlB,MAAA,sBAAqB,CAAC,QAAA,UAAS,IAAA,WAAA,EADvC,YAKQ,MAAA,cAAA,EAAA;;QAHN,OAAK,eAAA,CAAC,cACE,MAAA,2BAA0B,CAAC,QAAA,UAAS,CAAA,CAAA;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BAAW,CACtB,mBAYM,OAZN,YAYM,CAXJ,YAAkB,uBAAA,EAAA,CAET,QAAA,QAAQ,yBAAA,WAAA,EADjB,YASM,MAAA,0BAAA,EAAA;;YAPH,IAAA,QAAA;YACA,UAAA,QAAA;YACA;YACA,QAAA,QAAA;YACA,MAAA,QAAA;YACA,iCAA0D,6CAAA;;;;;;;;;;;;;;;;;;;;;;;;SAQrE,YAKsB,MAAA,oBAAA,EAAA,MAAA;kCAHZ,QAAA,UAAU,aAAA,WAAA,EADlB,YAG6B,MAAA,yBAAA,EAAA;;WAD1B,WAAW,QAAA,UAAU;WACtB,OAAA,EAAA,cAAA,QAAwB"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { InjectionKey, Ref } from 'vue';
|
|
2
|
+
export type RequestBodyCompositionSelection = Record<string, number>;
|
|
3
|
+
/**
|
|
4
|
+
* Shares the selected request-body composition variants between the schema
|
|
5
|
+
* dropdowns and the generated request snippet for a single operation layout.
|
|
6
|
+
*/
|
|
7
|
+
export declare const REQUEST_BODY_COMPOSITION_INDEX_SYMBOL: InjectionKey<Ref<RequestBodyCompositionSelection>>;
|
|
8
|
+
//# sourceMappingURL=request-body-composition-index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request-body-composition-index.d.ts","sourceRoot":"","sources":["../../../src/features/Operation/request-body-composition-index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAE5C,MAAM,MAAM,+BAA+B,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;AAEpE;;;GAGG;AACH,eAAO,MAAM,qCAAqC,EAAe,YAAY,CAAC,GAAG,CAAC,+BAA+B,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
//#region src/features/Operation/request-body-composition-index.ts
|
|
2
|
+
/**
|
|
3
|
+
* Shares the selected request-body composition variants between the schema
|
|
4
|
+
* dropdowns and the generated request snippet for a single operation layout.
|
|
5
|
+
*/
|
|
6
|
+
var REQUEST_BODY_COMPOSITION_INDEX_SYMBOL = Symbol();
|
|
7
|
+
//#endregion
|
|
8
|
+
export { REQUEST_BODY_COMPOSITION_INDEX_SYMBOL };
|
|
9
|
+
|
|
10
|
+
//# sourceMappingURL=request-body-composition-index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request-body-composition-index.js","names":[],"sources":["../../../src/features/Operation/request-body-composition-index.ts"],"sourcesContent":["import type { InjectionKey, Ref } from 'vue'\n\nexport type RequestBodyCompositionSelection = Record<string, number>\n\n/**\n * Shares the selected request-body composition variants between the schema\n * dropdowns and the generated request snippet for a single operation layout.\n */\nexport const REQUEST_BODY_COMPOSITION_INDEX_SYMBOL = Symbol() as InjectionKey<Ref<RequestBodyCompositionSelection>>\n"],"mappings":";;;;;AAQA,IAAa,wCAAwC,QAAQ"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import type { ApiReferenceConfiguration } from '@scalar/types/api-reference';
|
|
1
|
+
import type { ApiReferenceConfiguration, ExternalUrls } from '@scalar/types/api-reference';
|
|
2
2
|
import type { WorkspaceStore } from '@scalar/workspace-store/client';
|
|
3
3
|
type __VLS_Props = {
|
|
4
4
|
workspace?: WorkspaceStore;
|
|
5
5
|
configuration?: Partial<ApiReferenceConfiguration>;
|
|
6
|
+
externalUrls: ExternalUrls;
|
|
6
7
|
};
|
|
7
8
|
type __VLS_ModelProps = {
|
|
8
9
|
'overrides'?: Partial<ApiReferenceConfiguration>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeveloperTools.vue.d.ts","sourceRoot":"","sources":["../../../src/features/developer-tools/DeveloperTools.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DeveloperTools.vue.d.ts","sourceRoot":"","sources":["../../../src/features/developer-tools/DeveloperTools.vue"],"names":[],"mappings":"AAkEA,OAAO,KAAK,EACV,yBAAyB,EACzB,YAAY,EACb,MAAM,6BAA6B,CAAA;AACpC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AAQpE,KAAK,WAAW,GAAG;IACjB,SAAS,CAAC,EAAE,cAAc,CAAA;IAC1B,aAAa,CAAC,EAAE,OAAO,CAAC,yBAAyB,CAAC,CAAA;IAClD,YAAY,EAAE,YAAY,CAAA;CAC3B,CAAC;AAuBF,KAAK,gBAAgB,GAAG;IACxB,WAAW,CAAC,EAAE,OAAO,CAAC,yBAAyB,CAAC,CAAC;CAChD,CAAC;AAKF,KAAK,iBAAiB,GAAG,WAAW,GAAG,gBAAgB,CAAC;AA0FxD,QAAA,MAAM,YAAY;;;;kFAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeveloperTools.vue.js","names":[],"sources":["../../../src/features/developer-tools/DeveloperTools.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { isLocalUrl } from '@scalar/helpers/url/is-local-url'\nimport type {
|
|
1
|
+
{"version":3,"file":"DeveloperTools.vue.js","names":[],"sources":["../../../src/features/developer-tools/DeveloperTools.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { isLocalUrl } from '@scalar/helpers/url/is-local-url'\nimport type {\n ApiReferenceConfiguration,\n ExternalUrls,\n} from '@scalar/types/api-reference'\nimport type { WorkspaceStore } from '@scalar/workspace-store/client'\nimport { computed } from 'vue'\n\nimport ApiReferenceToolbarTitle from './components/ApiReferenceToolbarTitle.vue'\nimport DeployApiReference from './components/DeployApiReference.vue'\nimport ModifyConfiguration from './components/ModifyConfiguration.vue'\nimport ShareApiReference from './components/ShareApiReference.vue'\n\nconst { configuration, externalUrls } = defineProps<{\n workspace?: WorkspaceStore\n configuration?: Partial<ApiReferenceConfiguration>\n externalUrls: ExternalUrls\n}>()\n\nconst overrides = defineModel<Partial<ApiReferenceConfiguration>>('overrides')\n\nconst showDeveloperTools = computed<boolean>(() => {\n if (configuration?.showDeveloperTools === 'always') {\n return true\n }\n\n if (configuration?.showDeveloperTools === 'never') {\n return false\n }\n\n if (typeof window === 'undefined') {\n return false\n }\n\n return isLocalUrl(window.location.href)\n})\n</script>\n<template>\n <header\n v-if=\"showDeveloperTools\"\n aria-label=\"Developer Tools\"\n class=\"api-reference-toolbar bg-b-1 relative z-1 flex h-10 justify-center border-b px-15\">\n <div\n class=\"-mx-2 flex max-w-(--refs-content-max-width) flex-1 items-center\">\n <div class=\"flex flex-1 items-center\">\n <ApiReferenceToolbarTitle />\n </div>\n <ModifyConfiguration\n v-model:overrides=\"overrides\"\n :configuration />\n <template v-if=\"workspace\">\n <ShareApiReference\n :externalUrls\n :workspace />\n <DeployApiReference\n :externalUrls\n :workspace />\n </template>\n </div>\n </header>\n</template>\n"],"mappings":""}
|
|
@@ -16,7 +16,8 @@ var DeveloperTools_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */
|
|
|
16
16
|
__name: "DeveloperTools",
|
|
17
17
|
props: /* @__PURE__ */ mergeModels({
|
|
18
18
|
workspace: {},
|
|
19
|
-
configuration: {}
|
|
19
|
+
configuration: {},
|
|
20
|
+
externalUrls: {}
|
|
20
21
|
}, {
|
|
21
22
|
"overrides": {},
|
|
22
23
|
"overridesModifiers": {}
|
|
@@ -38,7 +39,13 @@ var DeveloperTools_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */
|
|
|
38
39
|
"onUpdate:overrides": _cache[0] || (_cache[0] = ($event) => overrides.value = $event),
|
|
39
40
|
configuration: __props.configuration
|
|
40
41
|
}, null, 8, ["overrides", "configuration"]),
|
|
41
|
-
__props.workspace ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createVNode(ShareApiReference_default, {
|
|
42
|
+
__props.workspace ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createVNode(ShareApiReference_default, {
|
|
43
|
+
externalUrls: __props.externalUrls,
|
|
44
|
+
workspace: __props.workspace
|
|
45
|
+
}, null, 8, ["externalUrls", "workspace"]), createVNode(DeployApiReference_default, {
|
|
46
|
+
externalUrls: __props.externalUrls,
|
|
47
|
+
workspace: __props.workspace
|
|
48
|
+
}, null, 8, ["externalUrls", "workspace"])], 64)) : createCommentVNode("", true)
|
|
42
49
|
])])) : createCommentVNode("", true);
|
|
43
50
|
};
|
|
44
51
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeveloperTools.vue.script.js","names":[],"sources":["../../../src/features/developer-tools/DeveloperTools.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { isLocalUrl } from '@scalar/helpers/url/is-local-url'\nimport type {
|
|
1
|
+
{"version":3,"file":"DeveloperTools.vue.script.js","names":[],"sources":["../../../src/features/developer-tools/DeveloperTools.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { isLocalUrl } from '@scalar/helpers/url/is-local-url'\nimport type {\n ApiReferenceConfiguration,\n ExternalUrls,\n} from '@scalar/types/api-reference'\nimport type { WorkspaceStore } from '@scalar/workspace-store/client'\nimport { computed } from 'vue'\n\nimport ApiReferenceToolbarTitle from './components/ApiReferenceToolbarTitle.vue'\nimport DeployApiReference from './components/DeployApiReference.vue'\nimport ModifyConfiguration from './components/ModifyConfiguration.vue'\nimport ShareApiReference from './components/ShareApiReference.vue'\n\nconst { configuration, externalUrls } = defineProps<{\n workspace?: WorkspaceStore\n configuration?: Partial<ApiReferenceConfiguration>\n externalUrls: ExternalUrls\n}>()\n\nconst overrides = defineModel<Partial<ApiReferenceConfiguration>>('overrides')\n\nconst showDeveloperTools = computed<boolean>(() => {\n if (configuration?.showDeveloperTools === 'always') {\n return true\n }\n\n if (configuration?.showDeveloperTools === 'never') {\n return false\n }\n\n if (typeof window === 'undefined') {\n return false\n }\n\n return isLocalUrl(window.location.href)\n})\n</script>\n<template>\n <header\n v-if=\"showDeveloperTools\"\n aria-label=\"Developer Tools\"\n class=\"api-reference-toolbar bg-b-1 relative z-1 flex h-10 justify-center border-b px-15\">\n <div\n class=\"-mx-2 flex max-w-(--refs-content-max-width) flex-1 items-center\">\n <div class=\"flex flex-1 items-center\">\n <ApiReferenceToolbarTitle />\n </div>\n <ModifyConfiguration\n v-model:overrides=\"overrides\"\n :configuration />\n <template v-if=\"workspace\">\n <ShareApiReference\n :externalUrls\n :workspace />\n <DeployApiReference\n :externalUrls\n :workspace />\n </template>\n </div>\n </header>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;EAoBA,MAAM,YAAY,SAA+C,SAAC,YAAW;EAE7E,MAAM,qBAAqB,eAAwB;AACjD,OAAI,QAAA,eAAe,uBAAuB,SACxC,QAAO;AAGT,OAAI,QAAA,eAAe,uBAAuB,QACxC,QAAO;AAGT,OAAI,OAAO,WAAW,YACpB,QAAO;AAGT,UAAO,WAAW,OAAO,SAAS,KAAI;IACvC;;UAIS,mBAAA,SAAA,WAAA,EADR,mBAqBS,UArBT,YAqBS,CAjBP,mBAgBM,OAhBN,YAgBM;IAdJ,mBAEM,OAFN,YAEM,CADJ,YAA4B,iCAAA,CAAA,CAAA;IAE9B,YAEmB,6BAAA;KADT,WAAW,UAAA;2EAAS,QAAA;KAC3B,eAAA,QAAA;;IACa,QAAA,aAAA,WAAA,EAAhB,mBAOW,UAAA,EAAA,KAAA,GAAA,EAAA,CANT,YAEe,2BAAA;KADZ,cAAA,QAAA;KACA,WAAA,QAAA;gDACH,YAEe,4BAAA;KADZ,cAAA,QAAA;KACA,WAAA,QAAA"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import type { ExternalUrls } from '@scalar/types/api-reference';
|
|
1
2
|
import type { WorkspaceStore } from '@scalar/workspace-store/client';
|
|
2
3
|
type __VLS_Props = {
|
|
3
4
|
workspace: WorkspaceStore;
|
|
5
|
+
externalUrls: ExternalUrls;
|
|
4
6
|
sdks?: string[];
|
|
5
7
|
};
|
|
6
8
|
type __VLS_ModelProps = {
|
package/dist/features/developer-tools/components/ApiReferenceToolbarRegisterButton.vue.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApiReferenceToolbarRegisterButton.vue.d.ts","sourceRoot":"","sources":["../../../../src/features/developer-tools/components/ApiReferenceToolbarRegisterButton.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ApiReferenceToolbarRegisterButton.vue.d.ts","sourceRoot":"","sources":["../../../../src/features/developer-tools/components/ApiReferenceToolbarRegisterButton.vue"],"names":[],"mappings":"AAmFA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAA;AAE/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AAKpE,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,cAAc,CAAA;IACzB,YAAY,EAAE,YAAY,CAAA;IAC1B,IAAI,CAAC,EAAE,MAAM,EAAE,CAAA;CAChB,CAAC;AA6DF,KAAK,gBAAgB,GAAG;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAKF,KAAK,iBAAiB,GAAG,WAAW,GAAG,gBAAgB,CAAC;AAiDxD,QAAA,IAAI,QAAQ,IAAW,CAAE;AACzB,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,CAAC;AAKhD,QAAA,MAAM,UAAU;;;;kFAGd,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AACzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
|
package/dist/features/developer-tools/components/ApiReferenceToolbarRegisterButton.vue.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApiReferenceToolbarRegisterButton.vue.js","names":[],"sources":["../../../../src/features/developer-tools/components/ApiReferenceToolbarRegisterButton.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { ScalarButton, useLoadingState } from '@scalar/components'\nimport { useToasts } from '@scalar/use-toasts'\nimport type { WorkspaceStore } from '@scalar/workspace-store/client'\nimport { nextTick } from 'vue'\n\nimport {
|
|
1
|
+
{"version":3,"file":"ApiReferenceToolbarRegisterButton.vue.js","names":[],"sources":["../../../../src/features/developer-tools/components/ApiReferenceToolbarRegisterButton.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { ScalarButton, useLoadingState } from '@scalar/components'\nimport type { ExternalUrls } from '@scalar/types/api-reference'\nimport { useToasts } from '@scalar/use-toasts'\nimport type { WorkspaceStore } from '@scalar/workspace-store/client'\nimport { nextTick } from 'vue'\n\nimport { uploadTempDocument } from '@/helpers/upload-temp-document'\n\nconst {\n sdks = [],\n workspace,\n externalUrls,\n} = defineProps<{\n workspace: WorkspaceStore\n externalUrls: ExternalUrls\n sdks?: string[]\n}>()\n\nconst tempDocUrl = defineModel<string>('url')\n\nconst { toast } = useToasts()\nconst loader = useLoadingState()\n\n/** Open the registration link in a new tab */\nfunction openRegisterLink(docUrl: string) {\n const url = new URL(`${externalUrls.dashboardUrl}/register`)\n url.searchParams.set('url', docUrl)\n sdks.forEach((sdk) => url.searchParams.append('sdk', sdk))\n\n window.open(url.toString(), '_blank')\n}\n\n/** Generate and open the registration link */\nasync function generateRegisterLink() {\n if (loader.isLoading || !workspace) {\n return\n }\n\n // If we have already have a temporary document URL, use it\n if (tempDocUrl.value) {\n openRegisterLink(tempDocUrl.value)\n return\n }\n\n loader.start()\n\n const document = workspace.exportActiveDocument('json')\n\n if (!document) {\n toast('Unable to export active document', 'error')\n await loader.invalidate()\n return\n }\n\n try {\n tempDocUrl.value = await uploadTempDocument(document, externalUrls)\n await loader.validate()\n openRegisterLink(tempDocUrl.value)\n\n await nextTick()\n\n await loader.clear()\n } catch (error) {\n const message =\n error instanceof Error ? error.message : 'An unknown error occurred'\n toast(message, 'error')\n await loader.invalidate()\n }\n}\n</script>\n<template>\n <ScalarButton\n class=\"h-auto p-2.5\"\n :loader\n @click=\"generateRegisterLink\">\n <slot>Generate</slot>\n </ScalarButton>\n</template>\n"],"mappings":""}
|
package/dist/features/developer-tools/components/ApiReferenceToolbarRegisterButton.vue.script.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { DASHBOARD_REGISTER_URL } from "../../../consts/urls.js";
|
|
2
1
|
import { uploadTempDocument } from "../../../helpers/upload-temp-document.js";
|
|
3
2
|
import { createBlock, createTextVNode, defineComponent, mergeModels, nextTick, openBlock, renderSlot, unref, useModel, withCtx } from "vue";
|
|
4
3
|
import { ScalarButton, useLoadingState } from "@scalar/components";
|
|
@@ -8,6 +7,7 @@ var ApiReferenceToolbarRegisterButton_vue_vue_type_script_setup_true_lang_defaul
|
|
|
8
7
|
__name: "ApiReferenceToolbarRegisterButton",
|
|
9
8
|
props: /* @__PURE__ */ mergeModels({
|
|
10
9
|
workspace: {},
|
|
10
|
+
externalUrls: {},
|
|
11
11
|
sdks: { default: () => [] }
|
|
12
12
|
}, {
|
|
13
13
|
"url": {},
|
|
@@ -20,7 +20,7 @@ var ApiReferenceToolbarRegisterButton_vue_vue_type_script_setup_true_lang_defaul
|
|
|
20
20
|
const loader = useLoadingState();
|
|
21
21
|
/** Open the registration link in a new tab */
|
|
22
22
|
function openRegisterLink(docUrl) {
|
|
23
|
-
const url = new URL(
|
|
23
|
+
const url = new URL(`${__props.externalUrls.dashboardUrl}/register`);
|
|
24
24
|
url.searchParams.set("url", docUrl);
|
|
25
25
|
__props.sdks.forEach((sdk) => url.searchParams.append("sdk", sdk));
|
|
26
26
|
window.open(url.toString(), "_blank");
|
|
@@ -40,7 +40,7 @@ var ApiReferenceToolbarRegisterButton_vue_vue_type_script_setup_true_lang_defaul
|
|
|
40
40
|
return;
|
|
41
41
|
}
|
|
42
42
|
try {
|
|
43
|
-
tempDocUrl.value = await uploadTempDocument(document);
|
|
43
|
+
tempDocUrl.value = await uploadTempDocument(document, __props.externalUrls);
|
|
44
44
|
await loader.validate();
|
|
45
45
|
openRegisterLink(tempDocUrl.value);
|
|
46
46
|
await nextTick();
|
package/dist/features/developer-tools/components/ApiReferenceToolbarRegisterButton.vue.script.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApiReferenceToolbarRegisterButton.vue.script.js","names":[],"sources":["../../../../src/features/developer-tools/components/ApiReferenceToolbarRegisterButton.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { ScalarButton, useLoadingState } from '@scalar/components'\nimport { useToasts } from '@scalar/use-toasts'\nimport type { WorkspaceStore } from '@scalar/workspace-store/client'\nimport { nextTick } from 'vue'\n\nimport {
|
|
1
|
+
{"version":3,"file":"ApiReferenceToolbarRegisterButton.vue.script.js","names":[],"sources":["../../../../src/features/developer-tools/components/ApiReferenceToolbarRegisterButton.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { ScalarButton, useLoadingState } from '@scalar/components'\nimport type { ExternalUrls } from '@scalar/types/api-reference'\nimport { useToasts } from '@scalar/use-toasts'\nimport type { WorkspaceStore } from '@scalar/workspace-store/client'\nimport { nextTick } from 'vue'\n\nimport { uploadTempDocument } from '@/helpers/upload-temp-document'\n\nconst {\n sdks = [],\n workspace,\n externalUrls,\n} = defineProps<{\n workspace: WorkspaceStore\n externalUrls: ExternalUrls\n sdks?: string[]\n}>()\n\nconst tempDocUrl = defineModel<string>('url')\n\nconst { toast } = useToasts()\nconst loader = useLoadingState()\n\n/** Open the registration link in a new tab */\nfunction openRegisterLink(docUrl: string) {\n const url = new URL(`${externalUrls.dashboardUrl}/register`)\n url.searchParams.set('url', docUrl)\n sdks.forEach((sdk) => url.searchParams.append('sdk', sdk))\n\n window.open(url.toString(), '_blank')\n}\n\n/** Generate and open the registration link */\nasync function generateRegisterLink() {\n if (loader.isLoading || !workspace) {\n return\n }\n\n // If we have already have a temporary document URL, use it\n if (tempDocUrl.value) {\n openRegisterLink(tempDocUrl.value)\n return\n }\n\n loader.start()\n\n const document = workspace.exportActiveDocument('json')\n\n if (!document) {\n toast('Unable to export active document', 'error')\n await loader.invalidate()\n return\n }\n\n try {\n tempDocUrl.value = await uploadTempDocument(document, externalUrls)\n await loader.validate()\n openRegisterLink(tempDocUrl.value)\n\n await nextTick()\n\n await loader.clear()\n } catch (error) {\n const message =\n error instanceof Error ? error.message : 'An unknown error occurred'\n toast(message, 'error')\n await loader.invalidate()\n }\n}\n</script>\n<template>\n <ScalarButton\n class=\"h-auto p-2.5\"\n :loader\n @click=\"generateRegisterLink\">\n <slot>Generate</slot>\n </ScalarButton>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;EAmBA,MAAM,aAAa,SAAmB,SAAC,MAAK;EAE5C,MAAM,EAAE,UAAU,WAAU;EAC5B,MAAM,SAAS,iBAAgB;;EAG/B,SAAS,iBAAiB,QAAgB;GACxC,MAAM,MAAM,IAAI,IAAI,GAAG,QAAA,aAAa,aAAa,WAAU;AAC3D,OAAI,aAAa,IAAI,OAAO,OAAM;AAClC,WAAA,KAAK,SAAS,QAAQ,IAAI,aAAa,OAAO,OAAO,IAAI,CAAA;AAEzD,UAAO,KAAK,IAAI,UAAU,EAAE,SAAQ;;;EAItC,eAAe,uBAAuB;AACpC,OAAI,OAAO,aAAa,CAAC,QAAA,UACvB;AAIF,OAAI,WAAW,OAAO;AACpB,qBAAiB,WAAW,MAAK;AACjC;;AAGF,UAAO,OAAM;GAEb,MAAM,WAAW,QAAA,UAAU,qBAAqB,OAAM;AAEtD,OAAI,CAAC,UAAU;AACb,UAAM,oCAAoC,QAAO;AACjD,UAAM,OAAO,YAAW;AACxB;;AAGF,OAAI;AACF,eAAW,QAAQ,MAAM,mBAAmB,UAAU,QAAA,aAAY;AAClE,UAAM,OAAO,UAAS;AACtB,qBAAiB,WAAW,MAAK;AAEjC,UAAM,UAAS;AAEf,UAAM,OAAO,OAAM;YACZ,OAAO;AAGd,UADE,iBAAiB,QAAQ,MAAM,UAAU,6BAC5B,QAAO;AACtB,UAAM,OAAO,YAAW;;;;uBAK1B,YAKe,MAAA,aAAA,EAAA;IAJb,OAAM;IACL,QAAA,MAAA,OAAM;IACN,SAAO;;2BACa,CAArB,WAAqB,KAAA,QAAA,WAAA,EAAA,QAAA,CAAA,OAAA,OAAA,OAAA,KAAA,gBAAf,YAAQ,GAAA,EAAA,CAAA,CAAA,CAAA"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import type { ExternalUrls } from '@scalar/types/api-reference';
|
|
1
2
|
import type { WorkspaceStore } from '@scalar/workspace-store/client';
|
|
2
3
|
type __VLS_Props = {
|
|
3
4
|
workspace: WorkspaceStore;
|
|
5
|
+
externalUrls: ExternalUrls;
|
|
4
6
|
};
|
|
5
7
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
6
8
|
declare const _default: typeof __VLS_export;
|