@scalar/api-client 3.16.1 → 3.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +46 -0
- package/README.md +18 -0
- package/dist/style.css +27 -38
- package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts +2 -0
- package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/OperationBlock.vue.js.map +1 -1
- package/dist/v2/blocks/operation-block/OperationBlock.vue.script.js +36 -10
- package/dist/v2/blocks/operation-block/OperationBlock.vue.script.js.map +1 -1
- package/dist/v2/blocks/operation-block/components/Header.vue.d.ts +4 -0
- package/dist/v2/blocks/operation-block/components/Header.vue.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/components/Header.vue.js +1 -1
- package/dist/v2/blocks/operation-block/components/Header.vue.js.map +1 -1
- package/dist/v2/blocks/operation-block/components/Header.vue.script.js +14 -9
- package/dist/v2/blocks/operation-block/components/Header.vue.script.js.map +1 -1
- package/dist/v2/blocks/request-block/RequestBlock.vue.script.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestBody.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestBody.vue.js +1 -1
- package/dist/v2/blocks/request-block/components/RequestBody.vue.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestBody.vue.script.js +15 -1
- package/dist/v2/blocks/request-block/components/RequestBody.vue.script.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTable.vue.js +1 -1
- package/dist/v2/blocks/request-block/components/RequestTable.vue.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTable.vue.script.js +13 -1
- package/dist/v2/blocks/request-block/components/RequestTable.vue.script.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue.script.js +5 -1
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue.script.js.map +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts +4 -0
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.js +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.js.map +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.script.js +61 -24
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.script.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.script.js.map +1 -1
- package/dist/v2/components/code-input/CodeInputLite.vue.d.ts.map +1 -1
- package/dist/v2/components/code-input/CodeInputLite.vue.js +1 -1
- package/dist/v2/components/code-input/CodeInputLite.vue.js.map +1 -1
- package/dist/v2/components/code-input/CodeInputLite.vue.script.js +7 -0
- package/dist/v2/components/code-input/CodeInputLite.vue.script.js.map +1 -1
- package/dist/v2/constants.js +1 -1
- package/dist/v2/features/modal/Modal.vue.d.ts +2 -0
- package/dist/v2/features/modal/Modal.vue.d.ts.map +1 -1
- package/dist/v2/features/modal/Modal.vue.js.map +1 -1
- package/dist/v2/features/modal/Modal.vue.script.js +3 -0
- package/dist/v2/features/modal/Modal.vue.script.js.map +1 -1
- package/dist/v2/features/modal/helpers/create-api-client-modal.d.ts.map +1 -1
- package/dist/v2/features/modal/helpers/create-api-client-modal.js +6 -6
- package/dist/v2/features/modal/helpers/create-api-client-modal.js.map +1 -1
- package/dist/v2/features/modal/helpers/resolve-route-parameters.d.ts +12 -3
- package/dist/v2/features/modal/helpers/resolve-route-parameters.d.ts.map +1 -1
- package/dist/v2/features/modal/helpers/resolve-route-parameters.js +13 -9
- package/dist/v2/features/modal/helpers/resolve-route-parameters.js.map +1 -1
- package/dist/v2/features/modal/hooks/use-modal-sidebar.d.ts +3 -1
- package/dist/v2/features/modal/hooks/use-modal-sidebar.d.ts.map +1 -1
- package/dist/v2/features/modal/hooks/use-modal-sidebar.js +28 -7
- package/dist/v2/features/modal/hooks/use-modal-sidebar.js.map +1 -1
- package/dist/v2/features/modal/modal-events.d.ts.map +1 -1
- package/dist/v2/features/modal/modal-events.js +5 -2
- package/dist/v2/features/modal/modal-events.js.map +1 -1
- package/dist/v2/features/operation/Operation.vue.d.ts +2 -0
- package/dist/v2/features/operation/Operation.vue.d.ts.map +1 -1
- package/dist/v2/features/operation/Operation.vue.js.map +1 -1
- package/dist/v2/features/operation/Operation.vue.script.js +8 -1
- package/dist/v2/features/operation/Operation.vue.script.js.map +1 -1
- package/dist/v2/features/search/helpers/create-search-index.js +2 -2
- package/dist/v2/features/search/helpers/create-search-index.js.map +1 -1
- package/dist/v2/helpers/generate-location-id.d.ts +3 -1
- package/dist/v2/helpers/generate-location-id.d.ts.map +1 -1
- package/dist/v2/helpers/generate-location-id.js +2 -1
- package/dist/v2/helpers/generate-location-id.js.map +1 -1
- package/dist/vue-styles.css +26 -26
- package/package.json +18 -18
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Operation.vue.js","names":[],"sources":["../../../../src/v2/features/operation/Operation.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Operation example page\n *\n * Displays an operation with a specific example selected\n * - View example request data\n * - Modify example request data\n * - Send example request\n */\nexport default {}\n\nexport type OperationProps = {\n /** The slug of the currently selected document in the workspace */\n documentSlug: string\n /** The currently active document — OpenAPI-only, the operation page has no AsyncAPI path */\n document: OpenApiDocument | null\n /** The workspace event bus */\n eventBus: WorkspaceEventBus\n /** The layout of the client */\n layout: ClientLayout\n /** The API path currently selected (e.g. \"/users/{id}\") */\n path?: string\n /** The HTTP method for the currently selected API path (e.g. GET, POST) */\n method?: HttpMethod\n /** The name of the currently selected example (for examples within an endpoint) */\n exampleName?: string\n /** The currently active environment */\n environment: XScalarEnvironment\n /** The workspace store */\n workspaceStore: WorkspaceStore\n /** Client plugins */\n plugins: ClientPlugin[]\n /** App or modal options forwarded to operation/auth blocks */\n options?: MaybeRefOrGetter<ApiClientOptions>\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { isElectron } from '@scalar/helpers/general/is-electron'\nimport type { HttpMethod } from '@scalar/helpers/http/http-methods'\nimport type { ClientPlugin } from '@scalar/oas-utils/helpers'\nimport type { WorkspaceStore } from '@scalar/workspace-store/client'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport {\n getActiveProxyUrl,\n getRequestExampleContext,\n} from '@scalar/workspace-store/request-example'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport type { OpenApiDocument } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed, toValue, type MaybeRefOrGetter } from 'vue'\n\nimport { OperationBlock } from '@/v2/blocks/operation-block'\nimport { APP_VERSION } from '@/v2/constants'\nimport { mapHiddenClientsConfig } from '@/v2/features/modal/helpers/map-hidden-clients-config'\nimport type { ClientLayout } from '@/v2/types/layout'\nimport type { ApiClientOptions } from '@/v2/types/options'\n\nconst {\n document,\n layout,\n eventBus,\n path,\n method,\n environment,\n exampleName,\n options,\n workspaceStore,\n plugins,\n documentSlug,\n} = defineProps<\n OperationProps & {\n /** Selected anyOf/oneOf request-body variants keyed by schema path */\n requestBodyCompositionSelection?: Record<string, number>\n }\n>()\n\n/**\n * Shared request-example context (operation, servers, auth scope, cookies). Recomputed when any\n * underlying workspace or route input changes — same reactivity as the previous local computeds.\n */\nconst requestExample = computed(() => {\n if (!path || !method || !exampleName || !document) {\n return null\n }\n\n const result = getRequestExampleContext(\n workspaceStore,\n documentSlug,\n { path, method, exampleName },\n {\n baseServerUrl: toValue(options)?.baseServerURL,\n fallbackDocument: document,\n isElectron: isElectron(),\n layout: layout === 'web' ? 'web' : 'other',\n servers: toValue(options)?.servers,\n appVersion: APP_VERSION,\n authentication: toValue(options)?.authentication,\n },\n )\n\n return result.ok ? result.data : null\n})\n\nconst operation = computed(() => requestExample.value?.operation ?? null)\nconst workspaceCookies = computed(\n () => requestExample.value?.cookies.workspace ?? [],\n)\nconst documentCookies = computed(\n () => requestExample.value?.cookies.document ?? [],\n)\nconst servers = computed(() => requestExample.value?.servers.list ?? [])\nconst selectedServer = computed(\n () => requestExample.value?.servers.selected ?? null,\n)\nconst serverMeta = computed(\n () => requestExample.value?.servers.meta ?? { type: 'document' as const },\n)\n\nconst securitySchemes = computed(\n () => requestExample.value?.security.schemes ?? {},\n)\n\nconst selectedSecurity = computed(\n () =>\n requestExample.value?.security.selected ?? {\n selectedIndex: -1,\n selectedSchemes: [],\n },\n)\nconst selectedSecuritySchemes = computed(\n () => requestExample.value?.security.selectedSchemes ?? [],\n)\nconst securityRequirements = computed(\n () => requestExample.value?.security.requirements ?? [],\n)\nconst authMeta = computed(\n () => requestExample.value?.security.meta ?? { type: 'document' as const },\n)\n\nconst defaultHeaders = computed(\n () => requestExample.value?.headers.default ?? {},\n)\n\n/** Combine environments from document and workspace into a unique array of environment names */\nconst environments = computed(() => {\n return Array.from(\n new Set(\n Object.keys({\n ...document?.['x-scalar-environments'],\n ...workspaceStore.workspace['x-scalar-environments'],\n }),\n ),\n )\n})\n\n/** Temporarily use the old config.hiddenClients until we migrate to the new httpClients config */\nconst httpClients = computed(() =>\n mapHiddenClientsConfig(toValue(options)?.hiddenClients),\n)\n</script>\n\n<template>\n <!-- Operation exists -->\n <template v-if=\"path && method && exampleName && operation && document\">\n <OperationBlock\n :activeEnvironment=\"\n workspaceStore.workspace['x-scalar-active-environment']\n \"\n :appVersion=\"APP_VERSION\"\n :authMeta\n :defaultHeaders\n :document\n :documentCookies\n :documentSecurity=\"document?.security ?? []\"\n :documentSlug\n :documentUrl=\"document?.['x-scalar-original-source-url']\"\n :environment\n :environments\n :eventBus\n :exampleKey=\"exampleName\"\n :hideClientButton=\"toValue(options)?.hideClientButton ?? false\"\n :history=\"workspaceStore.history.getHistory(documentSlug, path, method)\"\n :httpClients\n :layout\n :method\n :operation\n :options\n :path\n :plugins=\"plugins\"\n :proxyUrl=\"\n getActiveProxyUrl(\n workspaceStore.workspace['x-scalar-active-proxy'],\n layout === 'web' ? 'web' : 'other',\n ) ?? ''\n \"\n :requestBodyCompositionSelection\n :securityRequirements=\"securityRequirements\"\n :securitySchemes\n :selectedClient=\"workspaceStore.workspace['x-scalar-default-client']\"\n :selectedSecurity=\"selectedSecurity\"\n :selectedSecuritySchemes=\"selectedSecuritySchemes\"\n :server=\"selectedServer\"\n :serverMeta\n :servers\n :workspaceCookies />\n </template>\n\n <!-- Empty state -->\n <div\n v-else\n class=\"flex h-full w-full items-center justify-center\">\n <span class=\"text-c-3\">Select an operation to view details</span>\n </div>\n</template>\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"Operation.vue.js","names":[],"sources":["../../../../src/v2/features/operation/Operation.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Operation example page\n *\n * Displays an operation with a specific example selected\n * - View example request data\n * - Modify example request data\n * - Send example request\n */\nexport default {}\n\nexport type OperationProps = {\n /** The slug of the currently selected document in the workspace */\n documentSlug: string\n /** The currently active document — OpenAPI-only, the operation page has no AsyncAPI path */\n document: OpenApiDocument | null\n /** The workspace event bus */\n eventBus: WorkspaceEventBus\n /** The layout of the client */\n layout: ClientLayout\n /** The API path currently selected (e.g. \"/users/{id}\") */\n path?: string\n /** The HTTP method for the currently selected API path (e.g. GET, POST) */\n method?: HttpMethod\n /** The name of the currently selected example (for examples within an endpoint) */\n exampleName?: string\n /** Resolve the selected entry from the OpenAPI webhooks map. */\n isWebhook?: boolean\n /** The currently active environment */\n environment: XScalarEnvironment\n /** The workspace store */\n workspaceStore: WorkspaceStore\n /** Client plugins */\n plugins: ClientPlugin[]\n /** App or modal options forwarded to operation/auth blocks */\n options?: MaybeRefOrGetter<ApiClientOptions>\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { isElectron } from '@scalar/helpers/general/is-electron'\nimport type { HttpMethod } from '@scalar/helpers/http/http-methods'\nimport type { ClientPlugin } from '@scalar/oas-utils/helpers'\nimport type { WorkspaceStore } from '@scalar/workspace-store/client'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport {\n getActiveProxyUrl,\n getRequestExampleContext,\n} from '@scalar/workspace-store/request-example'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport type { OpenApiDocument } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed, toValue, type MaybeRefOrGetter } from 'vue'\n\nimport { OperationBlock } from '@/v2/blocks/operation-block'\nimport { APP_VERSION } from '@/v2/constants'\nimport { mapHiddenClientsConfig } from '@/v2/features/modal/helpers/map-hidden-clients-config'\nimport type { ClientLayout } from '@/v2/types/layout'\nimport type { ApiClientOptions } from '@/v2/types/options'\n\nconst {\n document,\n layout,\n eventBus,\n path,\n method,\n environment,\n exampleName,\n options,\n workspaceStore,\n plugins,\n documentSlug,\n isWebhook = false,\n} = defineProps<\n OperationProps & {\n /** Selected anyOf/oneOf request-body variants keyed by schema path */\n requestBodyCompositionSelection?: Record<string, number>\n }\n>()\n\n/**\n * Shared request-example context (operation, servers, auth scope, cookies). Recomputed when any\n * underlying workspace or route input changes — same reactivity as the previous local computeds.\n */\nconst requestExample = computed(() => {\n if (!path || !method || !exampleName || !document) {\n return null\n }\n\n const result = getRequestExampleContext(\n workspaceStore,\n documentSlug,\n { path, method, exampleName, isWebhook },\n {\n baseServerUrl: toValue(options)?.baseServerURL,\n fallbackDocument: document,\n isElectron: isElectron(),\n layout: layout === 'web' ? 'web' : 'other',\n servers: toValue(options)?.servers,\n appVersion: APP_VERSION,\n authentication: toValue(options)?.authentication,\n },\n )\n\n return result.ok ? result.data : null\n})\n\nconst operation = computed(() => requestExample.value?.operation ?? null)\nconst workspaceCookies = computed(\n () => requestExample.value?.cookies.workspace ?? [],\n)\nconst documentCookies = computed(\n () => requestExample.value?.cookies.document ?? [],\n)\nconst servers = computed(() => requestExample.value?.servers.list ?? [])\nconst selectedServer = computed(\n () => requestExample.value?.servers.selected ?? null,\n)\nconst serverMeta = computed(\n () => requestExample.value?.servers.meta ?? { type: 'document' as const },\n)\n\nconst securitySchemes = computed(\n () => requestExample.value?.security.schemes ?? {},\n)\n\nconst selectedSecurity = computed(\n () =>\n requestExample.value?.security.selected ?? {\n selectedIndex: -1,\n selectedSchemes: [],\n },\n)\nconst selectedSecuritySchemes = computed(\n () => requestExample.value?.security.selectedSchemes ?? [],\n)\nconst securityRequirements = computed(\n () => requestExample.value?.security.requirements ?? [],\n)\nconst authMeta = computed(\n () => requestExample.value?.security.meta ?? { type: 'document' as const },\n)\n\nconst defaultHeaders = computed(\n () => requestExample.value?.headers.default ?? {},\n)\n\n/** Combine environments from document and workspace into a unique array of environment names */\nconst environments = computed(() => {\n return Array.from(\n new Set(\n Object.keys({\n ...document?.['x-scalar-environments'],\n ...workspaceStore.workspace['x-scalar-environments'],\n }),\n ),\n )\n})\n\n/** Temporarily use the old config.hiddenClients until we migrate to the new httpClients config */\nconst httpClients = computed(() =>\n mapHiddenClientsConfig(toValue(options)?.hiddenClients),\n)\n</script>\n\n<template>\n <!-- Operation exists -->\n <template v-if=\"path && method && exampleName && operation && document\">\n <OperationBlock\n :activeEnvironment=\"\n workspaceStore.workspace['x-scalar-active-environment']\n \"\n :appVersion=\"APP_VERSION\"\n :authMeta\n :defaultHeaders\n :document\n :documentCookies\n :documentSecurity=\"document?.security ?? []\"\n :documentSlug\n :documentUrl=\"document?.['x-scalar-original-source-url']\"\n :environment\n :environments\n :eventBus\n :exampleKey=\"exampleName\"\n :hideClientButton=\"toValue(options)?.hideClientButton ?? false\"\n :history=\"workspaceStore.history.getHistory(documentSlug, path, method)\"\n :httpClients\n :layout\n :method\n :isWebhook\n :operation\n :options\n :path\n :plugins=\"plugins\"\n :proxyUrl=\"\n getActiveProxyUrl(\n workspaceStore.workspace['x-scalar-active-proxy'],\n layout === 'web' ? 'web' : 'other',\n ) ?? ''\n \"\n :requestBodyCompositionSelection\n :securityRequirements=\"securityRequirements\"\n :securitySchemes\n :selectedClient=\"workspaceStore.workspace['x-scalar-default-client']\"\n :selectedSecurity=\"selectedSecurity\"\n :selectedSecuritySchemes=\"selectedSecuritySchemes\"\n :server=\"selectedServer\"\n :serverMeta\n :servers\n :workspaceCookies />\n </template>\n\n <!-- Empty state -->\n <div\n v-else\n class=\"flex h-full w-full items-center justify-center\">\n <span class=\"text-c-3\">Select an operation to view details</span>\n </div>\n</template>\n"],"mappings":""}
|
|
@@ -19,6 +19,10 @@ var Operation_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ define
|
|
|
19
19
|
path: {},
|
|
20
20
|
method: {},
|
|
21
21
|
exampleName: {},
|
|
22
|
+
isWebhook: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
default: false
|
|
25
|
+
},
|
|
22
26
|
environment: {},
|
|
23
27
|
workspaceStore: {},
|
|
24
28
|
plugins: {},
|
|
@@ -35,7 +39,8 @@ var Operation_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ define
|
|
|
35
39
|
const result = getRequestExampleContext(__props.workspaceStore, __props.documentSlug, {
|
|
36
40
|
path: __props.path,
|
|
37
41
|
method: __props.method,
|
|
38
|
-
exampleName: __props.exampleName
|
|
42
|
+
exampleName: __props.exampleName,
|
|
43
|
+
isWebhook: __props.isWebhook
|
|
39
44
|
}, {
|
|
40
45
|
baseServerUrl: toValue(__props.options)?.baseServerURL,
|
|
41
46
|
fallbackDocument: __props.document,
|
|
@@ -92,6 +97,7 @@ var Operation_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ define
|
|
|
92
97
|
httpClients: httpClients.value,
|
|
93
98
|
layout: __props.layout,
|
|
94
99
|
method: __props.method,
|
|
100
|
+
isWebhook: __props.isWebhook,
|
|
95
101
|
operation: operation.value,
|
|
96
102
|
options: __props.options,
|
|
97
103
|
path: __props.path,
|
|
@@ -126,6 +132,7 @@ var Operation_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ define
|
|
|
126
132
|
"httpClients",
|
|
127
133
|
"layout",
|
|
128
134
|
"method",
|
|
135
|
+
"isWebhook",
|
|
129
136
|
"operation",
|
|
130
137
|
"options",
|
|
131
138
|
"path",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Operation.vue.script.js","names":[],"sources":["../../../../src/v2/features/operation/Operation.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Operation example page\n *\n * Displays an operation with a specific example selected\n * - View example request data\n * - Modify example request data\n * - Send example request\n */\nexport default {}\n\nexport type OperationProps = {\n /** The slug of the currently selected document in the workspace */\n documentSlug: string\n /** The currently active document — OpenAPI-only, the operation page has no AsyncAPI path */\n document: OpenApiDocument | null\n /** The workspace event bus */\n eventBus: WorkspaceEventBus\n /** The layout of the client */\n layout: ClientLayout\n /** The API path currently selected (e.g. \"/users/{id}\") */\n path?: string\n /** The HTTP method for the currently selected API path (e.g. GET, POST) */\n method?: HttpMethod\n /** The name of the currently selected example (for examples within an endpoint) */\n exampleName?: string\n /** The currently active environment */\n environment: XScalarEnvironment\n /** The workspace store */\n workspaceStore: WorkspaceStore\n /** Client plugins */\n plugins: ClientPlugin[]\n /** App or modal options forwarded to operation/auth blocks */\n options?: MaybeRefOrGetter<ApiClientOptions>\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { isElectron } from '@scalar/helpers/general/is-electron'\nimport type { HttpMethod } from '@scalar/helpers/http/http-methods'\nimport type { ClientPlugin } from '@scalar/oas-utils/helpers'\nimport type { WorkspaceStore } from '@scalar/workspace-store/client'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport {\n getActiveProxyUrl,\n getRequestExampleContext,\n} from '@scalar/workspace-store/request-example'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport type { OpenApiDocument } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed, toValue, type MaybeRefOrGetter } from 'vue'\n\nimport { OperationBlock } from '@/v2/blocks/operation-block'\nimport { APP_VERSION } from '@/v2/constants'\nimport { mapHiddenClientsConfig } from '@/v2/features/modal/helpers/map-hidden-clients-config'\nimport type { ClientLayout } from '@/v2/types/layout'\nimport type { ApiClientOptions } from '@/v2/types/options'\n\nconst {\n document,\n layout,\n eventBus,\n path,\n method,\n environment,\n exampleName,\n options,\n workspaceStore,\n plugins,\n documentSlug,\n} = defineProps<\n OperationProps & {\n /** Selected anyOf/oneOf request-body variants keyed by schema path */\n requestBodyCompositionSelection?: Record<string, number>\n }\n>()\n\n/**\n * Shared request-example context (operation, servers, auth scope, cookies). Recomputed when any\n * underlying workspace or route input changes — same reactivity as the previous local computeds.\n */\nconst requestExample = computed(() => {\n if (!path || !method || !exampleName || !document) {\n return null\n }\n\n const result = getRequestExampleContext(\n workspaceStore,\n documentSlug,\n { path, method, exampleName },\n {\n baseServerUrl: toValue(options)?.baseServerURL,\n fallbackDocument: document,\n isElectron: isElectron(),\n layout: layout === 'web' ? 'web' : 'other',\n servers: toValue(options)?.servers,\n appVersion: APP_VERSION,\n authentication: toValue(options)?.authentication,\n },\n )\n\n return result.ok ? result.data : null\n})\n\nconst operation = computed(() => requestExample.value?.operation ?? null)\nconst workspaceCookies = computed(\n () => requestExample.value?.cookies.workspace ?? [],\n)\nconst documentCookies = computed(\n () => requestExample.value?.cookies.document ?? [],\n)\nconst servers = computed(() => requestExample.value?.servers.list ?? [])\nconst selectedServer = computed(\n () => requestExample.value?.servers.selected ?? null,\n)\nconst serverMeta = computed(\n () => requestExample.value?.servers.meta ?? { type: 'document' as const },\n)\n\nconst securitySchemes = computed(\n () => requestExample.value?.security.schemes ?? {},\n)\n\nconst selectedSecurity = computed(\n () =>\n requestExample.value?.security.selected ?? {\n selectedIndex: -1,\n selectedSchemes: [],\n },\n)\nconst selectedSecuritySchemes = computed(\n () => requestExample.value?.security.selectedSchemes ?? [],\n)\nconst securityRequirements = computed(\n () => requestExample.value?.security.requirements ?? [],\n)\nconst authMeta = computed(\n () => requestExample.value?.security.meta ?? { type: 'document' as const },\n)\n\nconst defaultHeaders = computed(\n () => requestExample.value?.headers.default ?? {},\n)\n\n/** Combine environments from document and workspace into a unique array of environment names */\nconst environments = computed(() => {\n return Array.from(\n new Set(\n Object.keys({\n ...document?.['x-scalar-environments'],\n ...workspaceStore.workspace['x-scalar-environments'],\n }),\n ),\n )\n})\n\n/** Temporarily use the old config.hiddenClients until we migrate to the new httpClients config */\nconst httpClients = computed(() =>\n mapHiddenClientsConfig(toValue(options)?.hiddenClients),\n)\n</script>\n\n<template>\n <!-- Operation exists -->\n <template v-if=\"path && method && exampleName && operation && document\">\n <OperationBlock\n :activeEnvironment=\"\n workspaceStore.workspace['x-scalar-active-environment']\n \"\n :appVersion=\"APP_VERSION\"\n :authMeta\n :defaultHeaders\n :document\n :documentCookies\n :documentSecurity=\"document?.security ?? []\"\n :documentSlug\n :documentUrl=\"document?.['x-scalar-original-source-url']\"\n :environment\n :environments\n :eventBus\n :exampleKey=\"exampleName\"\n :hideClientButton=\"toValue(options)?.hideClientButton ?? false\"\n :history=\"workspaceStore.history.getHistory(documentSlug, path, method)\"\n :httpClients\n :layout\n :method\n :operation\n :options\n :path\n :plugins=\"plugins\"\n :proxyUrl=\"\n getActiveProxyUrl(\n workspaceStore.workspace['x-scalar-active-proxy'],\n layout === 'web' ? 'web' : 'other',\n ) ?? ''\n \"\n :requestBodyCompositionSelection\n :securityRequirements=\"securityRequirements\"\n :securitySchemes\n :selectedClient=\"workspaceStore.workspace['x-scalar-default-client']\"\n :selectedSecurity=\"selectedSecurity\"\n :selectedSecuritySchemes=\"selectedSecuritySchemes\"\n :server=\"selectedServer\"\n :serverMeta\n :servers\n :workspaceCookies />\n </template>\n\n <!-- Empty state -->\n <div\n v-else\n class=\"flex h-full w-full items-center justify-center\">\n <span class=\"text-c-3\">Select an operation to view details</span>\n </div>\n</template>\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Operation.vue.script.js","names":[],"sources":["../../../../src/v2/features/operation/Operation.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Operation example page\n *\n * Displays an operation with a specific example selected\n * - View example request data\n * - Modify example request data\n * - Send example request\n */\nexport default {}\n\nexport type OperationProps = {\n /** The slug of the currently selected document in the workspace */\n documentSlug: string\n /** The currently active document — OpenAPI-only, the operation page has no AsyncAPI path */\n document: OpenApiDocument | null\n /** The workspace event bus */\n eventBus: WorkspaceEventBus\n /** The layout of the client */\n layout: ClientLayout\n /** The API path currently selected (e.g. \"/users/{id}\") */\n path?: string\n /** The HTTP method for the currently selected API path (e.g. GET, POST) */\n method?: HttpMethod\n /** The name of the currently selected example (for examples within an endpoint) */\n exampleName?: string\n /** Resolve the selected entry from the OpenAPI webhooks map. */\n isWebhook?: boolean\n /** The currently active environment */\n environment: XScalarEnvironment\n /** The workspace store */\n workspaceStore: WorkspaceStore\n /** Client plugins */\n plugins: ClientPlugin[]\n /** App or modal options forwarded to operation/auth blocks */\n options?: MaybeRefOrGetter<ApiClientOptions>\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { isElectron } from '@scalar/helpers/general/is-electron'\nimport type { HttpMethod } from '@scalar/helpers/http/http-methods'\nimport type { ClientPlugin } from '@scalar/oas-utils/helpers'\nimport type { WorkspaceStore } from '@scalar/workspace-store/client'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport {\n getActiveProxyUrl,\n getRequestExampleContext,\n} from '@scalar/workspace-store/request-example'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport type { OpenApiDocument } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed, toValue, type MaybeRefOrGetter } from 'vue'\n\nimport { OperationBlock } from '@/v2/blocks/operation-block'\nimport { APP_VERSION } from '@/v2/constants'\nimport { mapHiddenClientsConfig } from '@/v2/features/modal/helpers/map-hidden-clients-config'\nimport type { ClientLayout } from '@/v2/types/layout'\nimport type { ApiClientOptions } from '@/v2/types/options'\n\nconst {\n document,\n layout,\n eventBus,\n path,\n method,\n environment,\n exampleName,\n options,\n workspaceStore,\n plugins,\n documentSlug,\n isWebhook = false,\n} = defineProps<\n OperationProps & {\n /** Selected anyOf/oneOf request-body variants keyed by schema path */\n requestBodyCompositionSelection?: Record<string, number>\n }\n>()\n\n/**\n * Shared request-example context (operation, servers, auth scope, cookies). Recomputed when any\n * underlying workspace or route input changes — same reactivity as the previous local computeds.\n */\nconst requestExample = computed(() => {\n if (!path || !method || !exampleName || !document) {\n return null\n }\n\n const result = getRequestExampleContext(\n workspaceStore,\n documentSlug,\n { path, method, exampleName, isWebhook },\n {\n baseServerUrl: toValue(options)?.baseServerURL,\n fallbackDocument: document,\n isElectron: isElectron(),\n layout: layout === 'web' ? 'web' : 'other',\n servers: toValue(options)?.servers,\n appVersion: APP_VERSION,\n authentication: toValue(options)?.authentication,\n },\n )\n\n return result.ok ? result.data : null\n})\n\nconst operation = computed(() => requestExample.value?.operation ?? null)\nconst workspaceCookies = computed(\n () => requestExample.value?.cookies.workspace ?? [],\n)\nconst documentCookies = computed(\n () => requestExample.value?.cookies.document ?? [],\n)\nconst servers = computed(() => requestExample.value?.servers.list ?? [])\nconst selectedServer = computed(\n () => requestExample.value?.servers.selected ?? null,\n)\nconst serverMeta = computed(\n () => requestExample.value?.servers.meta ?? { type: 'document' as const },\n)\n\nconst securitySchemes = computed(\n () => requestExample.value?.security.schemes ?? {},\n)\n\nconst selectedSecurity = computed(\n () =>\n requestExample.value?.security.selected ?? {\n selectedIndex: -1,\n selectedSchemes: [],\n },\n)\nconst selectedSecuritySchemes = computed(\n () => requestExample.value?.security.selectedSchemes ?? [],\n)\nconst securityRequirements = computed(\n () => requestExample.value?.security.requirements ?? [],\n)\nconst authMeta = computed(\n () => requestExample.value?.security.meta ?? { type: 'document' as const },\n)\n\nconst defaultHeaders = computed(\n () => requestExample.value?.headers.default ?? {},\n)\n\n/** Combine environments from document and workspace into a unique array of environment names */\nconst environments = computed(() => {\n return Array.from(\n new Set(\n Object.keys({\n ...document?.['x-scalar-environments'],\n ...workspaceStore.workspace['x-scalar-environments'],\n }),\n ),\n )\n})\n\n/** Temporarily use the old config.hiddenClients until we migrate to the new httpClients config */\nconst httpClients = computed(() =>\n mapHiddenClientsConfig(toValue(options)?.hiddenClients),\n)\n</script>\n\n<template>\n <!-- Operation exists -->\n <template v-if=\"path && method && exampleName && operation && document\">\n <OperationBlock\n :activeEnvironment=\"\n workspaceStore.workspace['x-scalar-active-environment']\n \"\n :appVersion=\"APP_VERSION\"\n :authMeta\n :defaultHeaders\n :document\n :documentCookies\n :documentSecurity=\"document?.security ?? []\"\n :documentSlug\n :documentUrl=\"document?.['x-scalar-original-source-url']\"\n :environment\n :environments\n :eventBus\n :exampleKey=\"exampleName\"\n :hideClientButton=\"toValue(options)?.hideClientButton ?? false\"\n :history=\"workspaceStore.history.getHistory(documentSlug, path, method)\"\n :httpClients\n :layout\n :method\n :isWebhook\n :operation\n :options\n :path\n :plugins=\"plugins\"\n :proxyUrl=\"\n getActiveProxyUrl(\n workspaceStore.workspace['x-scalar-active-proxy'],\n layout === 'web' ? 'web' : 'other',\n ) ?? ''\n \"\n :requestBodyCompositionSelection\n :securityRequirements=\"securityRequirements\"\n :securitySchemes\n :selectedClient=\"workspaceStore.workspace['x-scalar-default-client']\"\n :selectedSecurity=\"selectedSecurity\"\n :selectedSecuritySchemes=\"selectedSecuritySchemes\"\n :server=\"selectedServer\"\n :serverMeta\n :servers\n :workspaceCookies />\n </template>\n\n <!-- Empty state -->\n <div\n v-else\n class=\"flex h-full w-full items-center justify-center\">\n <span class=\"text-c-3\">Select an operation to view details</span>\n </div>\n</template>\n"],"mappings":"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"}
|
|
@@ -37,7 +37,7 @@ function addEntryToIndex(entry, index, document) {
|
|
|
37
37
|
});
|
|
38
38
|
return;
|
|
39
39
|
}
|
|
40
|
-
if (entry.type === "tag" && entry.
|
|
40
|
+
if (entry.type === "tag" && entry.isTagGroup !== true) {
|
|
41
41
|
index.push({
|
|
42
42
|
id: entry.id,
|
|
43
43
|
title: entry.title,
|
|
@@ -48,7 +48,7 @@ function addEntryToIndex(entry, index, document) {
|
|
|
48
48
|
});
|
|
49
49
|
return;
|
|
50
50
|
}
|
|
51
|
-
if (entry.type === "tag" && entry.
|
|
51
|
+
if (entry.type === "tag" && entry.isTagGroup === true) {
|
|
52
52
|
index.push({
|
|
53
53
|
id: entry.id,
|
|
54
54
|
title: entry.title,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-search-index.js","names":[],"sources":["../../../../../src/v2/features/search/helpers/create-search-index.ts"],"sourcesContent":["import { getPathItemOperation } from '@scalar/workspace-store/helpers/for-each-path-item-operation'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport type { TraversedEntry } from '@scalar/workspace-store/schemas/navigation'\nimport type { OpenApiDocument } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\n\nimport type { FuseData } from '@/v2/features/search/types'\n\n/**\n * Create a search index from a list of entries.\n */\nexport function createSearchIndex(documents: OpenApiDocument[]): FuseData[] {\n const index: FuseData[] = []\n\n /**\n * Recursively processes entries and their children to build the search index.\n */\n function processEntries(entriesToProcess: TraversedEntry[], document?: OpenApiDocument): void {\n entriesToProcess.forEach((entry) => {\n addEntryToIndex(entry, index, document)\n\n // Recursively process children if they exist\n if ('children' in entry && entry.children) {\n processEntries(entry.children, document)\n }\n })\n }\n\n documents?.forEach((document) => processEntries(document['x-scalar-navigation']?.children ?? [], document))\n\n return index\n}\n\n/**\n * Adds a single entry to the search index, handling all entry types recursively.\n */\nfunction addEntryToIndex(entry: TraversedEntry, index: FuseData[], document?: OpenApiDocument): void {\n // Operation\n if (entry.type === 'operation') {\n const operation = getResolvedRef(getPathItemOperation(document?.paths?.[entry.path], entry.method)) ?? {}\n\n index.push({\n type: 'operation',\n title: entry.title,\n id: entry.id,\n description: operation.description || '',\n method: entry.method,\n path: entry.path,\n operationId: operation.operationId,\n entry,\n documentName: document?.info.title ?? '',\n })\n\n return\n }\n\n if (entry.type === 'tag' && entry.
|
|
1
|
+
{"version":3,"file":"create-search-index.js","names":[],"sources":["../../../../../src/v2/features/search/helpers/create-search-index.ts"],"sourcesContent":["import { getPathItemOperation } from '@scalar/workspace-store/helpers/for-each-path-item-operation'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport type { TraversedEntry } from '@scalar/workspace-store/schemas/navigation'\nimport type { OpenApiDocument } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\n\nimport type { FuseData } from '@/v2/features/search/types'\n\n/**\n * Create a search index from a list of entries.\n */\nexport function createSearchIndex(documents: OpenApiDocument[]): FuseData[] {\n const index: FuseData[] = []\n\n /**\n * Recursively processes entries and their children to build the search index.\n */\n function processEntries(entriesToProcess: TraversedEntry[], document?: OpenApiDocument): void {\n entriesToProcess.forEach((entry) => {\n addEntryToIndex(entry, index, document)\n\n // Recursively process children if they exist\n if ('children' in entry && entry.children) {\n processEntries(entry.children, document)\n }\n })\n }\n\n documents?.forEach((document) => processEntries(document['x-scalar-navigation']?.children ?? [], document))\n\n return index\n}\n\n/**\n * Adds a single entry to the search index, handling all entry types recursively.\n */\nfunction addEntryToIndex(entry: TraversedEntry, index: FuseData[], document?: OpenApiDocument): void {\n // Operation\n if (entry.type === 'operation') {\n const operation = getResolvedRef(getPathItemOperation(document?.paths?.[entry.path], entry.method)) ?? {}\n\n index.push({\n type: 'operation',\n title: entry.title,\n id: entry.id,\n description: operation.description || '',\n method: entry.method,\n path: entry.path,\n operationId: operation.operationId,\n entry,\n documentName: document?.info.title ?? '',\n })\n\n return\n }\n\n // Regular tags, including OpenAPI 3.2 operation-less parent sections (which are `isGroup: true`\n // but real tags), keep their own description.\n if (entry.type === 'tag' && entry.isTagGroup !== true) {\n index.push({\n id: entry.id,\n title: entry.title,\n description: entry.description || '',\n type: 'tag',\n entry,\n documentName: document?.info.title ?? '',\n })\n\n return\n }\n\n // Legacy `x-tagGroups` wrappers are not real tags, so they carry the generic group label.\n if (entry.type === 'tag' && entry.isTagGroup === true) {\n index.push({\n id: entry.id,\n title: entry.title,\n description: 'Tag Group',\n type: 'tag',\n entry,\n documentName: document?.info.title ?? '',\n })\n\n return\n }\n\n // Headings from info.description\n if (entry.type === 'text') {\n index.push({\n id: entry.id,\n type: 'heading',\n title: entry.title ?? '',\n description: 'Heading',\n entry,\n documentName: document?.info.title ?? '',\n })\n\n return\n }\n}\n"],"mappings":";;;;;;AAUA,SAAgB,kBAAkB,WAA0C;CAC1E,MAAM,QAAoB,CAAC;;;;CAK3B,SAAS,eAAe,kBAAoC,UAAkC;EAC5F,iBAAiB,SAAS,UAAU;GAClC,gBAAgB,OAAO,OAAO,QAAQ;GAGtC,IAAI,cAAc,SAAS,MAAM,UAC/B,eAAe,MAAM,UAAU,QAAQ;EAE3C,CAAC;CACH;CAEA,WAAW,SAAS,aAAa,eAAe,SAAS,sBAAsB,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC;CAE1G,OAAO;AACT;;;;AAKA,SAAS,gBAAgB,OAAuB,OAAmB,UAAkC;CAEnG,IAAI,MAAM,SAAS,aAAa;EAC9B,MAAM,YAAY,eAAe,qBAAqB,UAAU,QAAQ,MAAM,OAAO,MAAM,MAAM,CAAC,KAAK,CAAC;EAExG,MAAM,KAAK;GACT,MAAM;GACN,OAAO,MAAM;GACb,IAAI,MAAM;GACV,aAAa,UAAU,eAAe;GACtC,QAAQ,MAAM;GACd,MAAM,MAAM;GACZ,aAAa,UAAU;GACvB;GACA,cAAc,UAAU,KAAK,SAAS;EACxC,CAAC;EAED;CACF;CAIA,IAAI,MAAM,SAAS,SAAS,MAAM,eAAe,MAAM;EACrD,MAAM,KAAK;GACT,IAAI,MAAM;GACV,OAAO,MAAM;GACb,aAAa,MAAM,eAAe;GAClC,MAAM;GACN;GACA,cAAc,UAAU,KAAK,SAAS;EACxC,CAAC;EAED;CACF;CAGA,IAAI,MAAM,SAAS,SAAS,MAAM,eAAe,MAAM;EACrD,MAAM,KAAK;GACT,IAAI,MAAM;GACV,OAAO,MAAM;GACb,aAAa;GACb,MAAM;GACN;GACA,cAAc,UAAU,KAAK,SAAS;EACxC,CAAC;EAED;CACF;CAGA,IAAI,MAAM,SAAS,QAAQ;EACzB,MAAM,KAAK;GACT,IAAI,MAAM;GACV,MAAM;GACN,OAAO,MAAM,SAAS;GACtB,aAAa;GACb;GACA,cAAc,UAAU,KAAK,SAAS;EACxC,CAAC;EAED;CACF;AACF"}
|
|
@@ -10,10 +10,12 @@ import type { HttpMethod } from '@scalar/helpers/http/http-methods';
|
|
|
10
10
|
* generateLocationId({ document: 'mydoc', path: '/users', method: 'get', example: 'default' })
|
|
11
11
|
* // => '["mydoc","/users","get","default"]'
|
|
12
12
|
*/
|
|
13
|
-
export declare const generateLocationId: ({ document, path, method, example, }: {
|
|
13
|
+
export declare const generateLocationId: ({ document, path, method, example, isWebhook, }: {
|
|
14
14
|
document: string;
|
|
15
15
|
path?: string;
|
|
16
16
|
method?: HttpMethod;
|
|
17
17
|
example?: string;
|
|
18
|
+
/** Namespace webhook entries without changing existing operation IDs. */
|
|
19
|
+
isWebhook?: boolean;
|
|
18
20
|
}) => string;
|
|
19
21
|
//# sourceMappingURL=generate-location-id.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-location-id.d.ts","sourceRoot":"","sources":["../../../src/v2/helpers/generate-location-id.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AAEnE;;;;;;;;;;GAUG;AACH,eAAO,MAAM,kBAAkB,GAAI,
|
|
1
|
+
{"version":3,"file":"generate-location-id.d.ts","sourceRoot":"","sources":["../../../src/v2/helpers/generate-location-id.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AAEnE;;;;;;;;;;GAUG;AACH,eAAO,MAAM,kBAAkB,GAAI,iDAMhC;IACD,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,UAAU,CAAA;IACnB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,yEAAyE;IACzE,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB,WAEA,CAAA"}
|
|
@@ -11,9 +11,10 @@ import { isDefined } from "@scalar/helpers/array/is-defined";
|
|
|
11
11
|
* generateLocationId({ document: 'mydoc', path: '/users', method: 'get', example: 'default' })
|
|
12
12
|
* // => '["mydoc","/users","get","default"]'
|
|
13
13
|
*/
|
|
14
|
-
var generateLocationId = ({ document, path, method, example }) => {
|
|
14
|
+
var generateLocationId = ({ document, path, method, example, isWebhook = false }) => {
|
|
15
15
|
return JSON.stringify([
|
|
16
16
|
document,
|
|
17
|
+
isWebhook ? "webhook" : void 0,
|
|
17
18
|
path,
|
|
18
19
|
method,
|
|
19
20
|
example
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-location-id.js","names":[],"sources":["../../../src/v2/helpers/generate-location-id.ts"],"sourcesContent":["import { isDefined } from '@scalar/helpers/array/is-defined'\nimport type { HttpMethod } from '@scalar/helpers/http/http-methods'\n\n/**\n * Generates a unique string ID for an API location, based on the document, path, method, and example.\n * Filters out undefined values and serializes the composite array into a stable string.\n *\n * @param params - An object containing document, path, method, and optional example name.\n * @returns A stringified array representing the unique location identifier.\n *\n * Example:\n * generateLocationId({ document: 'mydoc', path: '/users', method: 'get', example: 'default' })\n * // => '[\"mydoc\",\"/users\",\"get\",\"default\"]'\n */\nexport const generateLocationId = ({\n document,\n path,\n method,\n example,\n}: {\n document: string\n path?: string\n method?: HttpMethod\n example?: string\n}) => {\n return JSON.stringify([document, path, method, example].filter(isDefined))\n}\n"],"mappings":";;;;;;;;;;;;;AAcA,IAAa,sBAAsB,EACjC,UACA,MACA,QACA,
|
|
1
|
+
{"version":3,"file":"generate-location-id.js","names":[],"sources":["../../../src/v2/helpers/generate-location-id.ts"],"sourcesContent":["import { isDefined } from '@scalar/helpers/array/is-defined'\nimport type { HttpMethod } from '@scalar/helpers/http/http-methods'\n\n/**\n * Generates a unique string ID for an API location, based on the document, path, method, and example.\n * Filters out undefined values and serializes the composite array into a stable string.\n *\n * @param params - An object containing document, path, method, and optional example name.\n * @returns A stringified array representing the unique location identifier.\n *\n * Example:\n * generateLocationId({ document: 'mydoc', path: '/users', method: 'get', example: 'default' })\n * // => '[\"mydoc\",\"/users\",\"get\",\"default\"]'\n */\nexport const generateLocationId = ({\n document,\n path,\n method,\n example,\n isWebhook = false,\n}: {\n document: string\n path?: string\n method?: HttpMethod\n example?: string\n /** Namespace webhook entries without changing existing operation IDs. */\n isWebhook?: boolean\n}) => {\n return JSON.stringify([document, isWebhook ? 'webhook' : undefined, path, method, example].filter(isDefined))\n}\n"],"mappings":";;;;;;;;;;;;;AAcA,IAAa,sBAAsB,EACjC,UACA,MACA,QACA,SACA,YAAY,YAQR;CACJ,OAAO,KAAK,UAAU;EAAC;EAAU,YAAY,YAAY,KAAA;EAAW;EAAM;EAAQ;CAAO,CAAC,CAAC,OAAO,SAAS,CAAC;AAC9G"}
|
package/dist/vue-styles.css
CHANGED
|
@@ -314,13 +314,13 @@ to {
|
|
|
314
314
|
color: var(--scalar-color-1);
|
|
315
315
|
}
|
|
316
316
|
|
|
317
|
-
.code-input-lite[data-v-
|
|
317
|
+
.code-input-lite[data-v-4dfd05a3] {
|
|
318
318
|
/* Flex so the editor centres vertically in whatever height the cell gives us.
|
|
319
319
|
Font properties inherit so we adopt the surrounding typography. */
|
|
320
320
|
display: flex;
|
|
321
321
|
align-items: center;
|
|
322
322
|
}
|
|
323
|
-
.code-input-lite__editor[data-v-
|
|
323
|
+
.code-input-lite__editor[data-v-4dfd05a3] {
|
|
324
324
|
/* Everything font-related inherits from the surrounding context. */
|
|
325
325
|
font: inherit;
|
|
326
326
|
letter-spacing: inherit;
|
|
@@ -342,7 +342,7 @@ to {
|
|
|
342
342
|
/* Positioning context for the absolutely positioned placeholder. */
|
|
343
343
|
position: relative;
|
|
344
344
|
}
|
|
345
|
-
.code-input-lite__editor[data-v-
|
|
345
|
+
.code-input-lite__editor[data-v-4dfd05a3]::-webkit-scrollbar {
|
|
346
346
|
display: none;
|
|
347
347
|
}
|
|
348
348
|
|
|
@@ -350,7 +350,7 @@ to {
|
|
|
350
350
|
contenteditable; otherwise the caret would land after it on focus.
|
|
351
351
|
`pointer-events: none` lets clicks fall through to focus the editor.
|
|
352
352
|
Hidden on focus so it never renders on top of the text caret. */
|
|
353
|
-
.code-input-lite--empty .code-input-lite__editor[data-v-
|
|
353
|
+
.code-input-lite--empty .code-input-lite__editor[data-v-4dfd05a3]:not(:focus)::before {
|
|
354
354
|
content: attr(data-placeholder);
|
|
355
355
|
color: var(--scalar-color-3);
|
|
356
356
|
pointer-events: none;
|
|
@@ -361,7 +361,7 @@ to {
|
|
|
361
361
|
display: flex;
|
|
362
362
|
align-items: center;
|
|
363
363
|
}
|
|
364
|
-
.code-input-lite--error .code-input-lite__editor[data-v-
|
|
364
|
+
.code-input-lite--error .code-input-lite__editor[data-v-4dfd05a3] {
|
|
365
365
|
outline: 1px solid var(--scalar-color-red);
|
|
366
366
|
}
|
|
367
367
|
|
|
@@ -405,20 +405,20 @@ to {
|
|
|
405
405
|
background: color-mix(in srgb, var(--scalar-background-3), transparent 40%);
|
|
406
406
|
}
|
|
407
407
|
|
|
408
|
-
[data-v-
|
|
408
|
+
[data-v-13500378] .code-input-lite__editor {
|
|
409
409
|
background-color: transparent;
|
|
410
410
|
font-family: var(--scalar-font);
|
|
411
411
|
font-size: var(--scalar-small);
|
|
412
412
|
padding: 5px 8px;
|
|
413
413
|
}
|
|
414
|
-
[data-v-
|
|
414
|
+
[data-v-13500378] .scalar-pill:not(:last-of-type) {
|
|
415
415
|
margin-right: 0.15em;
|
|
416
416
|
}
|
|
417
|
-
[data-v-
|
|
417
|
+
[data-v-13500378] .scalar-pill:not(:first-of-type) {
|
|
418
418
|
margin-left: 0.5px;
|
|
419
419
|
}
|
|
420
420
|
|
|
421
|
-
[data-v-
|
|
421
|
+
[data-v-c8ab7ba2] .cm-content {
|
|
422
422
|
font-size: var(--scalar-small);
|
|
423
423
|
}
|
|
424
424
|
|
|
@@ -614,21 +614,21 @@ to {
|
|
|
614
614
|
background: var(--scalar-background-2);
|
|
615
615
|
}
|
|
616
616
|
|
|
617
|
-
[data-v-
|
|
617
|
+
[data-v-c414dc68] .cm-editor {
|
|
618
618
|
height: 100%;
|
|
619
619
|
outline: none;
|
|
620
620
|
width: 100%;
|
|
621
621
|
}
|
|
622
|
-
[data-v-
|
|
622
|
+
[data-v-c414dc68] .cm-line {
|
|
623
623
|
padding: 0;
|
|
624
624
|
}
|
|
625
|
-
[data-v-
|
|
625
|
+
[data-v-c414dc68] .cm-content {
|
|
626
626
|
padding: 0;
|
|
627
627
|
display: flex;
|
|
628
628
|
align-items: center;
|
|
629
629
|
font-size: var(--scalar-small);
|
|
630
630
|
}
|
|
631
|
-
.scroll-timeline-x[data-v-
|
|
631
|
+
.scroll-timeline-x[data-v-c414dc68] {
|
|
632
632
|
-ms-overflow-style: none;
|
|
633
633
|
/* Fade the URL at the viewport edges. Mask lives on the scrollport (this
|
|
634
634
|
element) rather than on `.cm-scroller`, whose width follows the URL's
|
|
@@ -641,31 +641,31 @@ to {
|
|
|
641
641
|
transparent 100%
|
|
642
642
|
);
|
|
643
643
|
}
|
|
644
|
-
.scroll-timeline-x-hidden[data-v-
|
|
644
|
+
.scroll-timeline-x-hidden[data-v-c414dc68] {
|
|
645
645
|
overflow-x: auto;
|
|
646
646
|
}
|
|
647
|
-
.scroll-timeline-x-hidden[data-v-
|
|
647
|
+
.scroll-timeline-x-hidden[data-v-c414dc68] .cm-scroller {
|
|
648
648
|
scrollbar-width: none;
|
|
649
649
|
-ms-overflow-style: none;
|
|
650
650
|
padding-right: 20px;
|
|
651
651
|
overflow: auto;
|
|
652
652
|
}
|
|
653
|
-
.scroll-timeline-x-hidden[data-v-
|
|
653
|
+
.scroll-timeline-x-hidden[data-v-c414dc68]::-webkit-scrollbar {
|
|
654
654
|
width: 0;
|
|
655
655
|
height: 0;
|
|
656
656
|
display: none;
|
|
657
657
|
}
|
|
658
|
-
.scroll-timeline-x-hidden[data-v-
|
|
658
|
+
.scroll-timeline-x-hidden[data-v-c414dc68] .cm-scroller::-webkit-scrollbar {
|
|
659
659
|
width: 0;
|
|
660
660
|
height: 0;
|
|
661
661
|
display: none;
|
|
662
662
|
}
|
|
663
|
-
.scroll-timeline-x-address[data-v-
|
|
663
|
+
.scroll-timeline-x-address[data-v-c414dc68] {
|
|
664
664
|
line-height: 27px;
|
|
665
665
|
scrollbar-width: none; /* Firefox */
|
|
666
666
|
}
|
|
667
667
|
/* make clickable are to left of send button */
|
|
668
|
-
.scroll-timeline-x-address[data-v-
|
|
668
|
+
.scroll-timeline-x-address[data-v-c414dc68]:after {
|
|
669
669
|
content: '';
|
|
670
670
|
position: absolute;
|
|
671
671
|
height: 100%;
|
|
@@ -673,12 +673,12 @@ to {
|
|
|
673
673
|
right: 0;
|
|
674
674
|
cursor: text;
|
|
675
675
|
}
|
|
676
|
-
.scroll-timeline-x-address[data-v-
|
|
676
|
+
.scroll-timeline-x-address[data-v-c414dc68]:empty:before {
|
|
677
677
|
content: 'Enter URL or cURL request';
|
|
678
678
|
color: var(--scalar-color-3);
|
|
679
679
|
pointer-events: none;
|
|
680
680
|
}
|
|
681
|
-
.address-bar-bg-states[data-v-
|
|
681
|
+
.address-bar-bg-states[data-v-c414dc68] {
|
|
682
682
|
--scalar-address-bar-bg: color-mix(
|
|
683
683
|
in srgb,
|
|
684
684
|
var(--scalar-background-1),
|
|
@@ -686,22 +686,22 @@ to {
|
|
|
686
686
|
);
|
|
687
687
|
background: var(--scalar-address-bar-bg);
|
|
688
688
|
}
|
|
689
|
-
.address-bar-bg-states[data-v-
|
|
689
|
+
.address-bar-bg-states[data-v-c414dc68]:has(.cm-focused) {
|
|
690
690
|
--scalar-address-bar-bg: var(--scalar-background-1);
|
|
691
691
|
border-color: var(--scalar-border-color);
|
|
692
692
|
outline-width: 1px;
|
|
693
693
|
outline-style: solid;
|
|
694
694
|
}
|
|
695
|
-
.address-bar-bg-states:has(.cm-focused) .fade-left[data-v-
|
|
696
|
-
.address-bar-bg-states:has(.cm-focused) .fade-right[data-v-
|
|
695
|
+
.address-bar-bg-states:has(.cm-focused) .fade-left[data-v-c414dc68],
|
|
696
|
+
.address-bar-bg-states:has(.cm-focused) .fade-right[data-v-c414dc68] {
|
|
697
697
|
--scalar-address-bar-bg: var(--scalar-background-1);
|
|
698
698
|
}
|
|
699
699
|
|
|
700
|
-
.app-exit-button[data-v-
|
|
700
|
+
.app-exit-button[data-v-3769522e] {
|
|
701
701
|
color: white;
|
|
702
702
|
background: rgba(0, 0, 0, 0.1);
|
|
703
703
|
}
|
|
704
|
-
.app-exit-button[data-v-
|
|
704
|
+
.app-exit-button[data-v-3769522e]:hover {
|
|
705
705
|
background: rgba(255, 255, 255, 0.1);
|
|
706
706
|
}
|
|
707
707
|
/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
|
package/package.json
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"rest",
|
|
19
19
|
"testing"
|
|
20
20
|
],
|
|
21
|
-
"version": "3.
|
|
21
|
+
"version": "3.17.0",
|
|
22
22
|
"engines": {
|
|
23
23
|
"node": ">=22"
|
|
24
24
|
},
|
|
@@ -300,7 +300,7 @@
|
|
|
300
300
|
"@vueuse/integrations": "13.9.0",
|
|
301
301
|
"focus-trap": "^7.8.0",
|
|
302
302
|
"fuse.js": "^7.5.0",
|
|
303
|
-
"js-base64": "^3.
|
|
303
|
+
"js-base64": "^3.9.2",
|
|
304
304
|
"jsonc-parser": "3.3.1",
|
|
305
305
|
"nanoid": "^5.1.6",
|
|
306
306
|
"pretty-ms": "^9.3.0",
|
|
@@ -308,28 +308,28 @@
|
|
|
308
308
|
"set-cookie-parser": "3.1.0",
|
|
309
309
|
"vue": "^3.5.40",
|
|
310
310
|
"yaml": "^2.9.0",
|
|
311
|
-
"zod": "^4.3
|
|
312
|
-
"@scalar/blocks": "0.1.
|
|
313
|
-
"@scalar/components": "0.
|
|
314
|
-
"@scalar/
|
|
315
|
-
"@scalar/
|
|
316
|
-
"@scalar/
|
|
317
|
-
"@scalar/
|
|
318
|
-
"@scalar/
|
|
319
|
-
"@scalar/
|
|
320
|
-
"@scalar/
|
|
321
|
-
"@scalar/
|
|
322
|
-
"@scalar/use-codemirror": "0.14.
|
|
323
|
-
"@scalar/use-hooks": "0.4.
|
|
324
|
-
"@scalar/use-toasts": "0.10.
|
|
325
|
-
"@scalar/workspace-store": "0.
|
|
311
|
+
"zod": "^4.4.3",
|
|
312
|
+
"@scalar/blocks": "0.1.15",
|
|
313
|
+
"@scalar/components": "0.29.0",
|
|
314
|
+
"@scalar/helpers": "0.11.2",
|
|
315
|
+
"@scalar/icons": "0.7.6",
|
|
316
|
+
"@scalar/oas-utils": "0.19.15",
|
|
317
|
+
"@scalar/openapi-types": "0.9.5",
|
|
318
|
+
"@scalar/sidebar": "0.11.0",
|
|
319
|
+
"@scalar/snippetz": "0.9.29",
|
|
320
|
+
"@scalar/themes": "0.17.4",
|
|
321
|
+
"@scalar/types": "0.18.3",
|
|
322
|
+
"@scalar/use-codemirror": "0.14.15",
|
|
323
|
+
"@scalar/use-hooks": "0.4.10",
|
|
324
|
+
"@scalar/use-toasts": "0.10.5",
|
|
325
|
+
"@scalar/workspace-store": "0.59.0"
|
|
326
326
|
},
|
|
327
327
|
"devDependencies": {
|
|
328
328
|
"@tailwindcss/cli": "^4.3.3",
|
|
329
329
|
"@tailwindcss/vite": "^4.3.3",
|
|
330
330
|
"@vitejs/plugin-vue": "^6.0.8",
|
|
331
331
|
"@vue/test-utils": "2.4.11",
|
|
332
|
-
"fake-indexeddb": "6.2.
|
|
332
|
+
"fake-indexeddb": "6.2.5",
|
|
333
333
|
"jsdom": "27.4.0",
|
|
334
334
|
"posthog-js": "1.407.5",
|
|
335
335
|
"tailwindcss": "^4.3.3",
|