@scalar/api-client 3.9.0 → 3.10.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.
Files changed (52) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/plugins/posthog/sanitize-event-payload.d.ts.map +1 -1
  3. package/dist/plugins/posthog/sanitize-event-payload.js +2 -0
  4. package/dist/plugins/posthog/sanitize-event-payload.js.map +1 -1
  5. package/dist/style.css +10 -17
  6. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.d.ts +7 -4
  7. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.d.ts.map +1 -1
  8. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.js +1 -1
  9. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.js.map +1 -1
  10. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.script.js +28 -15
  11. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.script.js.map +1 -1
  12. package/dist/v2/blocks/operation-code-sample/helpers/find-client.d.ts +31 -31
  13. package/dist/v2/blocks/operation-code-sample/helpers/find-client.d.ts.map +1 -1
  14. package/dist/v2/blocks/operation-code-sample/helpers/find-client.js +32 -39
  15. package/dist/v2/blocks/operation-code-sample/helpers/find-client.js.map +1 -1
  16. package/dist/v2/blocks/operation-code-sample/helpers/format-language.d.ts +8 -0
  17. package/dist/v2/blocks/operation-code-sample/helpers/format-language.d.ts.map +1 -0
  18. package/dist/v2/blocks/operation-code-sample/helpers/format-language.js +70 -0
  19. package/dist/v2/blocks/operation-code-sample/helpers/format-language.js.map +1 -0
  20. package/dist/v2/blocks/operation-code-sample/helpers/generate-client-options.d.ts +15 -5
  21. package/dist/v2/blocks/operation-code-sample/helpers/generate-client-options.d.ts.map +1 -1
  22. package/dist/v2/blocks/operation-code-sample/helpers/generate-client-options.js +23 -6
  23. package/dist/v2/blocks/operation-code-sample/helpers/generate-client-options.js.map +1 -1
  24. package/dist/v2/blocks/operation-code-sample/helpers/generate-code-snippet.d.ts.map +1 -1
  25. package/dist/v2/blocks/operation-code-sample/helpers/generate-code-snippet.js +2 -2
  26. package/dist/v2/blocks/operation-code-sample/helpers/generate-code-snippet.js.map +1 -1
  27. package/dist/v2/blocks/operation-code-sample/helpers/get-clients.d.ts +2 -1
  28. package/dist/v2/blocks/operation-code-sample/helpers/get-clients.d.ts.map +1 -1
  29. package/dist/v2/blocks/operation-code-sample/helpers/get-clients.js +23 -17
  30. package/dist/v2/blocks/operation-code-sample/helpers/get-clients.js.map +1 -1
  31. package/dist/v2/blocks/operation-code-sample/helpers/get-custom-code-samples.d.ts +38 -3
  32. package/dist/v2/blocks/operation-code-sample/helpers/get-custom-code-samples.d.ts.map +1 -1
  33. package/dist/v2/blocks/operation-code-sample/helpers/get-custom-code-samples.js +74 -8
  34. package/dist/v2/blocks/operation-code-sample/helpers/get-custom-code-samples.js.map +1 -1
  35. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-body.d.ts.map +1 -1
  36. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-body.js +12 -87
  37. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-body.js.map +1 -1
  38. package/dist/v2/blocks/operation-code-sample/index.d.ts +1 -1
  39. package/dist/v2/blocks/operation-code-sample/index.d.ts.map +1 -1
  40. package/dist/v2/blocks/operation-code-sample/index.js +2 -2
  41. package/dist/v2/blocks/request-block/RequestBlock.vue.script.js.map +1 -1
  42. package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.d.ts.map +1 -1
  43. package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.js.map +1 -1
  44. package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.script.js +11 -6
  45. package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.script.js.map +1 -1
  46. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.script.js.map +1 -1
  47. package/dist/v2/constants.js +1 -1
  48. package/dist/v2/workspace-events.d.ts.map +1 -1
  49. package/dist/v2/workspace-events.js +2 -0
  50. package/dist/v2/workspace-events.js.map +1 -1
  51. package/dist/vue-styles.css +7 -7
  52. package/package.json +11 -11
@@ -1 +1 @@
1
- {"version":3,"file":"RequestCodeSnippet.vue.script.js","names":[],"sources":["../../../../../src/v2/blocks/request-block/components/RequestCodeSnippet.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarButton } from '@scalar/components/button'\nimport { ScalarCodeBlock } from '@scalar/components/code-block'\nimport { ScalarCombobox } from '@scalar/components/combobox'\nimport { ScalarErrorBoundary } from '@scalar/components/error-boundary'\nimport { ScalarIconCaretDown } from '@scalar/icons'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { computed, ref, watch } from 'vue'\n\nimport {\n findClient,\n type ClientOption,\n type CustomClientOption,\n} from '@/v2/blocks/operation-code-sample'\nimport type { OperationCodeSampleProps } from '@/v2/blocks/operation-code-sample/components/OperationCodeSample.vue'\nimport { generateCodeSnippet } from '@/v2/blocks/operation-code-sample/helpers/generate-code-snippet'\nimport { getClients } from '@/v2/blocks/operation-code-sample/helpers/get-clients'\nimport { getCustomCodeSamples } from '@/v2/blocks/operation-code-sample/helpers/get-custom-code-samples'\nimport { getSecrets } from '@/v2/blocks/operation-code-sample/helpers/get-secrets'\nimport { DataTable, DataTableRow } from '@/v2/components/data-table'\nimport { CollapsibleSection } from '@/v2/components/layout'\n\nconst {\n clientOptions,\n eventBus,\n operation,\n method,\n path,\n selectedContentType,\n selectedServer = null,\n selectedExample,\n securitySchemes,\n selectedClient,\n globalCookies,\n integration,\n} = defineProps<OperationCodeSampleProps & { eventBus: WorkspaceEventBus }>()\n\n/** Grab any custom code samples from the operation */\nconst customCodeSamples = computed(() => getCustomCodeSamples(operation))\n\n/** Merge custom code samples with the client options */\nconst clients = computed(() =>\n getClients(customCodeSamples.value, clientOptions),\n)\n\n/**\n * The locally selected client which would include code samples from this operation only\n * Must be local state because it contains custom code samples from this operation only\n */\nconst localSelectedClient = ref<ClientOption | CustomClientOption | undefined>(\n findClient(clients.value, selectedClient),\n)\n\n/** If the globally selected client changes we can update the local one */\nwatch(\n () => selectedClient,\n (newClient) => {\n const client = findClient(clients.value, newClient)\n if (client) {\n localSelectedClient.value = client\n }\n },\n)\n\n/** Block secrets from being shown in the code block */\nconst secretCredentials = computed(() => getSecrets(securitySchemes ?? []))\n\n/** Handle client change */\nconst handleClientChange = (option: ClientOption | undefined) => {\n localSelectedClient.value = option\n\n // Emit the change if it's not a custom example\n if (option && !option.id.startsWith('custom')) {\n eventBus.emit('workspace:update:selected-client', option.id)\n }\n}\n\n/** Generate the code snippet for the selected example */\nconst generatedCode = computed<string>(() =>\n generateCodeSnippet({\n defaultDisabledParameters: true,\n clientId: localSelectedClient.value?.id,\n customCodeSamples: customCodeSamples.value,\n operation,\n method,\n path,\n contentType: selectedContentType,\n server: selectedServer,\n securitySchemes,\n example: selectedExample,\n globalCookies,\n includeDefaultHeaders: integration === 'client',\n }),\n)\n\n/** Check if there are any clients available (built-in or custom code samples) */\nconst hasClients = computed(() =>\n clients.value.some((group) => group.options.length > 0),\n)\n</script>\n\n<template>\n <CollapsibleSection\n v-show=\"hasClients\"\n class=\"group/preview w-full border-t\"\n :defaultOpen=\"false\">\n <template #title>Code Snippet</template>\n\n <!-- Client selector -->\n <template #actions>\n <div class=\"flex flex-1\">\n <ScalarCombobox\n :modelValue=\"localSelectedClient\"\n :options=\"clients\"\n placement=\"bottom-end\"\n @update:modelValue=\"\n (ev) => handleClientChange(ev as ClientOption | undefined)\n \">\n <template #default=\"{ open }\">\n <ScalarButton\n class=\"text-c-2 hover:text-c-1 flex h-full w-fit gap-1.5 px-0.5 py-0 text-base font-normal\"\n data-testid=\"client-picker\"\n variant=\"ghost\">\n {{ localSelectedClient?.title }}\n <ScalarIconCaretDown\n class=\"mt-0.25 size-3 transition-transform duration-100\"\n :class=\"open && 'rotate-180'\"\n weight=\"bold\" />\n </ScalarButton>\n </template>\n </ScalarCombobox>\n </div>\n </template>\n\n <!-- Code snippet -->\n <ScalarErrorBoundary>\n <DataTable\n :columns=\"['']\"\n presentational>\n <DataTableRow>\n <div class=\"overflow-hidden\">\n <ScalarCodeBlock\n class=\"text-base\"\n :content=\"generatedCode\"\n :hideCredentials=\"secretCredentials\"\n :lang=\"localSelectedClient?.lang ?? 'plaintext'\"\n lineNumbers />\n </div>\n </DataTableRow>\n </DataTable>\n </ScalarErrorBoundary>\n </CollapsibleSection>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsCA,MAAM,oBAAoB,eAAe,qBAAqB,QAAA,UAAU,CAAA;;EAGxE,MAAM,UAAU,eACd,WAAW,kBAAkB,OAAO,QAAA,cAAc,CACpD;;;;;EAMA,MAAM,sBAAsB,IAC1B,WAAW,QAAQ,OAAO,QAAA,eAAe,CAC3C;;AAGA,cACQ,QAAA,iBACL,cAAc;GACb,MAAM,SAAS,WAAW,QAAQ,OAAO,UAAS;AAClD,OAAI,OACF,qBAAoB,QAAQ;IAGlC;;EAGA,MAAM,oBAAoB,eAAe,WAAW,QAAA,mBAAmB,EAAE,CAAC,CAAA;;EAG1E,MAAM,sBAAsB,WAAqC;AAC/D,uBAAoB,QAAQ;AAG5B,OAAI,UAAU,CAAC,OAAO,GAAG,WAAW,SAAS,CAC3C,SAAA,SAAS,KAAK,oCAAoC,OAAO,GAAE;;;EAK/D,MAAM,gBAAgB,eACpB,oBAAoB;GAClB,2BAA2B;GAC3B,UAAU,oBAAoB,OAAO;GACrC,mBAAmB,kBAAkB;GACrC,WAAQ,QAAA;GACR,QAAK,QAAA;GACL,MAAG,QAAA;GACH,aAAa,QAAA;GACb,QAAQ,QAAA;GACR,iBAAc,QAAA;GACd,SAAS,QAAA;GACT,eAAY,QAAA;GACZ,uBAAuB,QAAA,gBAAgB;GACxC,CAAC,CACJ;;EAGA,MAAM,aAAa,eACjB,QAAQ,MAAM,MAAM,UAAU,MAAM,QAAQ,SAAS,EAAE,CACzD;;uCAIE,YAiDqB,MAAA,2BAAA,EAAA;IA/CnB,OAAM;IACL,aAAa;;IACH,OAAK,cAAa,CAAA,GAAA,OAAA,OAAA,OAAA,KAAA,CAAA,gBAAZ,gBAAY,GAAA,CAAA,EAAA,CAAA;IAGlB,SAAO,cAsBV,CArBN,mBAqBM,OArBN,YAqBM,CApBJ,YAmBiB,MAAA,eAAA,EAAA;KAlBd,YAAY,oBAAA;KACZ,SAAS,QAAA;KACV,WAAU;KACT,uBAAiB,OAAA,OAAA,OAAA,MAAgB,OAAO,mBAAmB,GAAE;;KAGnD,SAAO,SAUD,EAVK,WAAI,CACxB,YASe,MAAA,aAAA,EAAA;MARb,OAAM;MACN,eAAY;MACZ,SAAQ;;6BACwB,CAAA,gBAAA,gBAA7B,oBAAA,OAAqB,MAAK,GAAG,KAChC,EAAA,EAAA,YAGkB,MAAA,oBAAA,EAAA;OAFhB,OAAK,eAAA,CAAC,oDACE,QAAI,aAAA,CAAA;OACZ,QAAO;;;;;;2BAuBG,CAftB,YAesB,MAAA,oBAAA,EAAA,MAAA;4BADR,CAbZ,YAaY,MAAA,kBAAA,EAAA;MAZT,SAAS,CAAA,GAAI;MACd,gBAAA;;6BAUe,CATf,YASe,MAAA,qBAAA,EAAA,MAAA;8BADP,CAPN,mBAOM,OAPN,YAOM,CANJ,YAKgB,MAAA,gBAAA,EAAA;QAJd,OAAM;QACL,SAAS,cAAA;QACT,iBAAiB,kBAAA;QACjB,MAAM,oBAAA,OAAqB,QAAI;QAChC,aAAA;;;;;;;;;;;;;sBA3CF,WAAA,MAAU,CAAA,CAAA"}
1
+ {"version":3,"file":"RequestCodeSnippet.vue.script.js","names":[],"sources":["../../../../../src/v2/blocks/request-block/components/RequestCodeSnippet.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarButton } from '@scalar/components/button'\nimport { ScalarCodeBlock } from '@scalar/components/code-block'\nimport { ScalarCombobox } from '@scalar/components/combobox'\nimport { ScalarErrorBoundary } from '@scalar/components/error-boundary'\nimport { ScalarIconCaretDown } from '@scalar/icons'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { computed, ref, watch } from 'vue'\n\nimport {\n findClient,\n type ClientOption,\n type CustomClientOption,\n} from '@/v2/blocks/operation-code-sample'\nimport type { OperationCodeSampleProps } from '@/v2/blocks/operation-code-sample/components/OperationCodeSample.vue'\nimport { generateCodeSnippet } from '@/v2/blocks/operation-code-sample/helpers/generate-code-snippet'\nimport { getClients } from '@/v2/blocks/operation-code-sample/helpers/get-clients'\nimport { getCustomCodeSamples } from '@/v2/blocks/operation-code-sample/helpers/get-custom-code-samples'\nimport { getSecrets } from '@/v2/blocks/operation-code-sample/helpers/get-secrets'\nimport { DataTable, DataTableRow } from '@/v2/components/data-table'\nimport { CollapsibleSection } from '@/v2/components/layout'\n\nconst {\n clientOptions,\n eventBus,\n operation,\n method,\n path,\n selectedContentType,\n selectedServer = null,\n selectedExample,\n securitySchemes,\n selectedClient,\n globalCookies,\n integration,\n} = defineProps<OperationCodeSampleProps & { eventBus: WorkspaceEventBus }>()\n\n/** Grab any custom code samples from the operation */\nconst customCodeSamples = computed(() => getCustomCodeSamples(operation))\n\n/** Merge custom code samples with the client options */\nconst clients = computed(() =>\n getClients(\n customCodeSamples.value.samples,\n clientOptions,\n customCodeSamples.value.label,\n ),\n)\n\n/**\n * The locally selected client which would include code samples from this operation only\n * Must be local state because it contains custom code samples from this operation only\n */\nconst localSelectedClient = ref<ClientOption | CustomClientOption | undefined>(\n findClient(clients.value, selectedClient),\n)\n\n/**\n * Re-resolve the local client whenever the global selection or the available\n * clients change. Watching `clients` matters when navigating between operations:\n * the stored id stays the same, but the matching option (e.g. a custom sample)\n * differs per operation, so without this the snippet could go stale.\n */\nwatch([() => selectedClient, clients], ([newClient]) => {\n const client = findClient(clients.value, newClient)\n if (client) {\n localSelectedClient.value = client\n }\n})\n\n/** Block secrets from being shown in the code block */\nconst secretCredentials = computed(() => getSecrets(securitySchemes ?? []))\n\n/** Handle client change */\nconst handleClientChange = (option: ClientOption | undefined) => {\n localSelectedClient.value = option\n\n // Sync the selection globally (built-in client or custom sample keyed by language)\n if (option) {\n eventBus.emit('workspace:update:selected-client', option.id)\n }\n}\n\n/** Generate the code snippet for the selected example */\nconst generatedCode = computed<string>(() =>\n generateCodeSnippet({\n defaultDisabledParameters: true,\n clientId: localSelectedClient.value?.id,\n customCodeSamples: customCodeSamples.value.samples,\n operation,\n method,\n path,\n contentType: selectedContentType,\n server: selectedServer,\n securitySchemes,\n example: selectedExample,\n globalCookies,\n includeDefaultHeaders: integration === 'client',\n }),\n)\n\n/** Check if there are any clients available (built-in or custom code samples) */\nconst hasClients = computed(() =>\n clients.value.some((group) => group.options.length > 0),\n)\n</script>\n\n<template>\n <CollapsibleSection\n v-show=\"hasClients\"\n class=\"group/preview w-full border-t\"\n :defaultOpen=\"false\">\n <template #title>Code Snippet</template>\n\n <!-- Client selector -->\n <template #actions>\n <div class=\"flex flex-1\">\n <ScalarCombobox\n :modelValue=\"localSelectedClient\"\n :options=\"clients\"\n placement=\"bottom-end\"\n @update:modelValue=\"\n (ev) => handleClientChange(ev as ClientOption | undefined)\n \">\n <template #default=\"{ open }\">\n <ScalarButton\n class=\"text-c-2 hover:text-c-1 flex h-full w-fit gap-1.5 px-0.5 py-0 text-base font-normal\"\n data-testid=\"client-picker\"\n variant=\"ghost\">\n {{ localSelectedClient?.title }}\n <ScalarIconCaretDown\n class=\"mt-0.25 size-3 transition-transform duration-100\"\n :class=\"open && 'rotate-180'\"\n weight=\"bold\" />\n </ScalarButton>\n </template>\n </ScalarCombobox>\n </div>\n </template>\n\n <!-- Code snippet -->\n <ScalarErrorBoundary>\n <DataTable\n :columns=\"['']\"\n presentational>\n <DataTableRow>\n <div class=\"overflow-hidden\">\n <ScalarCodeBlock\n class=\"text-base\"\n :content=\"generatedCode\"\n :hideCredentials=\"secretCredentials\"\n :lang=\"localSelectedClient?.lang ?? 'pl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AsBV,CArBN,mBAqBM,OArBN,YAqBM,CApBJ,YAmBiB,MAAA,eAAA,EAAA;KAlBd,YAAY,oBAAA;KACZ,SAAS,QAAA;KACV,WAAU;KACT,uBAAiB,OAAA,OAAA,OAAA,MAAgB,OAAO,mBAAmB,GAAE;;KAGnD,SAAO,SAUD,EAVK,WAAI,CACxB,YASe,MAAA,aAAA,EAAA;MARb,OAAM;MACN,eAAY;MACZ,SAAQ;;6BACwB,CAAA,gBAAA,gBAA7B,oBAAA,OAAqB,MAAK,GAAG,KAChC,EAAA,EAAA,YAGkB,MAAA,oBAAA,EAAA;OAFhB,OAAK,eAAA,CAAC,oDACE,QAAI,aAAA,CAAA;OACZ,QAAO;;;;;;2BAuBG,CAftB,YAesB,MAAA,oBAAA,EAAA,MAAA;4BADR,CAbZ,YAaY,MAAA,kBAAA,EAAA;MAZT,SAAS,CAAA,GAAI;MACd,gBAAA;;6BAUe,CATf,YASe,MAAA,qBAAA,EAAA,MAAA;8BADP,CAPN,mBAOM,OAPN,YAOM,CANJ,YAKgB,MAAA,gBAAA,EAAA;QAJd,OAAM;QACL,SAAS,cAAA;QACT,iBAAiB,kBAAA;QACjB,MAAM,oBAAA,OAAqB,QAAI;QAChC,aAAA;;;;;;;;;;;;;sBA3CF,WAAA,MAAU,CAAA,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"AuthSelector.vue.script.js","names":[],"sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport {\n ScalarButton,\n type ScalarButton as ScalarButtonType,\n} from '@scalar/components/button'\nimport { ScalarComboboxMultiselect } from '@scalar/components/combobox'\nimport type { Icon } from '@scalar/components/icon'\nimport { ScalarIconButton } from '@scalar/components/icon-button'\nimport { ScalarListboxCheckbox } from '@scalar/components/listbox'\nimport { useModal } from '@scalar/components/modal'\nimport { ScalarIconCaretDown, ScalarIconTrash } from '@scalar/icons'\nimport type { SelectedSecurity } from '@scalar/workspace-store/entities/auth'\nimport type {\n AuthMeta,\n WorkspaceEventBus,\n} from '@scalar/workspace-store/events'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport { unpackProxyObject } from '@scalar/workspace-store/helpers/unpack-proxy'\nimport {\n isAuthOptional,\n type MergedSecuritySchemes,\n} from '@scalar/workspace-store/request-example'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport type {\n OpenApiDocument,\n SecurityRequirementObject,\n ServerObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed, ref, useId } from 'vue'\n\nimport DeleteRequestAuthModal from '@/v2/blocks/scalar-auth-selector-block/components/DeleteRequestAuthModal.vue'\nimport type { OAuth2Options } from '@/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue'\nimport {\n formatComplexScheme,\n formatScheme,\n getSecuritySchemeOptions,\n type SecuritySchemeOption,\n} from '@/v2/blocks/scalar-auth-selector-block/helpers/security-scheme'\nimport { CollapsibleSection } from '@/v2/components/layout'\n\nimport RequestAuthDataTable from './RequestAuthDataTable.vue'\n\nconst {\n environment,\n eventBus,\n createAnySecurityScheme = false,\n defaultOpen = true,\n isStatic = false,\n meta,\n proxyUrl,\n securityRequirements,\n securitySchemes,\n selectedSecurity,\n server,\n title,\n options,\n} = defineProps<{\n environment: XScalarEnvironment\n eventBus: WorkspaceEventBus\n /** Allows adding authentication which is not in the document */\n createAnySecurityScheme?: boolean\n /** Whether the authentication disclosure should start expanded */\n defaultOpen?: boolean\n /** Creates a static disclosure that cannot be collapsed */\n isStatic?: boolean\n meta: AuthMeta\n proxyUrl: string\n securityRequirements: OpenApiDocument['security']\n securitySchemes: MergedSecuritySchemes\n selectedSecurity: SelectedSecurity | undefined\n server: ServerObject | null\n title: string\n /** Any config options required for the OAuth2 flow */\n options?: OAuth2Options\n}>()\n\nconst titleId = useId()\nconst comboboxButtonRef = ref<typeof ScalarButtonType | null>(null)\nconst isDisclosureOpen = ref(false)\n\nconst deleteModal = useModal()\nconst schemeToDelete = ref<{\n label: string\n payload: SecurityRequirementObject\n} | null>(null)\n\n/**\n * Determines if authentication is required or optional\n *\n * Auth is optional when there is an empty security requirement and no complex requirements.\n * Complex requirements have multiple auth schemes combined (e.g., API key + OAuth).\n */\nconst authIndicator = computed<{ icon: Icon; text: string } | null>(() => {\n if (!securityRequirements?.length) {\n return null\n }\n\n const isOptional = isAuthOptional(securityRequirements)\n\n return {\n icon: isOptional ? 'Unlock' : 'Lock',\n text: isOptional ? 'Optional' : 'Required',\n }\n})\n\n/** All available auth scheme options for the dropdown */\nconst availableSchemeOptions = computed(() =>\n getSecuritySchemeOptions(\n securityRequirements ?? [],\n securitySchemes ?? {},\n selectedSecurity?.selectedSchemes ?? [],\n createAnySecurityScheme,\n ),\n)\n\n/** Currently active auth schemes selected for this operation or collection */\nconst activeSchemeOptions = computed<SecuritySchemeOption[]>(() => {\n const schemes = selectedSecurity?.selectedSchemes\n if (!schemes?.length) {\n return []\n }\n\n return schemes.flatMap((requirement) => {\n const schemeNames = Object.keys(requirement)\n\n if (schemeNames.length === 0) {\n return []\n }\n\n // Complex auth requirement with multiple schemes\n if (schemeNames.length > 1) {\n return formatComplexScheme(requirement)\n }\n\n // Simple auth requirement with single scheme\n const schemeName = schemeNames[0]\n if (!schemeName) {\n return []\n }\n\n const scheme = getResolvedRef(securitySchemes?.[schemeName])\n if (!scheme) {\n return []\n }\n\n return formatScheme({\n name: schemeName,\n value: requirement,\n })\n })\n})\n\n/**\n * Opens the combobox dropdown when clicking the auth indicator badge.\n * Prevents the disclosure from toggling if it is already open.\n */\nconst handleAuthIndicatorClick = (event: Event): void => {\n if (isDisclosureOpen.value) {\n event.stopPropagation()\n }\n comboboxButtonRef.value?.$el.click()\n}\n\n/**\n * Updates the selected auth schemes.\n * Separates existing schemes from newly created ones for the event payload.\n */\nconst handleSchemeSelection = (selected: SecuritySchemeOption[]): void => {\n const existingSchemes = selected\n .filter((option) => option.payload === undefined)\n .map((option) => unpackProxyObject(option.value, { depth: 2 }))\n\n const newSchemes = selected\n .filter((option) => option.payload !== undefined)\n .map((option) => ({\n name: option.label,\n scheme: option.payload!,\n }))\n\n eventBus.emit('auth:update:selected-security-schemes', {\n selectedRequirements: existingSchemes,\n newSchemes,\n meta,\n })\n}\n\n/** Shows the delete confirmation modal for the selected scheme */\nconst handleDeleteRequest = (option: {\n label: string\n value: SecurityRequirementObject\n}): void => {\n schemeToDelete.value = { label: option.label, payload: option.value }\n deleteModal.show()\n}\n\n/** Deletes the selected auth scheme after confirmation */\nconst handleDeleteConfirm = (): void => {\n if (!schemeToDelete.value) {\n return\n }\n\n eventBus.emit('auth:delete:security-scheme', {\n names: Object.keys(schemeToDelete.value.payload),\n })\n\n schemeToDelete.value = null\n deleteModal.hide()\n}\n\ndefineExpose({\n authIndicator,\n selectedSchemeOptions: activeSchemeOptions,\n schemeOptions: availableSchemeOptions,\n})\n</script>\n<template>\n <CollapsibleSection\n class=\"group/params relative\"\n :defaultOpen\n :isStatic=\"isStatic\"\n :itemCount=\"activeSchemeOptions.length\"\n @update:modelValue=\"(open) => (isDisclosureOpen = open)\">\n <template #title>\n <div\n :id=\"titleId\"\n class=\"inline-flex items-center gap-0.5 leading-[20px]\">\n <span>{{ title }}</span>\n\n <span\n v-if=\"authIndicator\"\n class=\"text-c-3 hover:bg-b-3 hover:text-c-1 -my-0.5 -mr-1 cursor-pointer rounded px-1 py-0.5 leading-[normal] font-normal\"\n :class=\"{ 'text-c-1': authIndicator.text === 'Required' }\"\n data-testid=\"auth-indicator\"\n @click=\"handleAuthIndicatorClick\">\n {{ authIndicator.text }}\n </span>\n </div>\n </template>\n\n <!-- Auth Dropdown (hidden when only one scheme is available) -->\n <template #actions>\n <ScalarComboboxMultiselect\n class=\"w-72 text-xs\"\n :modelValue=\"activeSchemeOptions\"\n multiple\n :options=\"availableSchemeOptions\"\n placement=\"bottom-end\"\n teleport\n @delete=\"handleDeleteRequest\"\n @update:modelValue=\"handleSchemeSelection\">\n <ScalarButton\n ref=\"comboboxButtonRef\"\n :aria-describedby=\"titleId\"\n class=\"group/combobox-button hover:text-c-1 text-c-2 flex h-fit w-full items-center gap-1 px-0.75 py-0.25 text-base font-normal\"\n variant=\"ghost\">\n <!-- Single auth scheme selected -->\n <template v-if=\"activeSchemeOptions.length === 1\">\n <span class=\"sr-only\">Selected Auth Type:</span>\n {{ activeSchemeOptions[0]?.label }}\n </template>\n\n <!-- Multiple auth schemes selected -->\n <template v-else-if=\"activeSchemeOptions.length > 1\">\n Multiple\n <span class=\"sr-only\">Auth Types Selected</span>\n </template>\n\n <!-- No auth schemes selected -->\n <template v-else>\n <span class=\"sr-only\">Select</span>\n Auth Type\n </template>\n\n <ScalarIconCaretDown\n class=\"size-3 shrink-0 transition-transform duration-100 group-aria-expanded/combobox-button:rotate-180\"\n weight=\"bold\" />\n </ScalarButton>\n\n <template #option=\"{ option, selected }\">\n <ScalarListboxCheckbox\n multiselect\n :selected=\"selected\" />\n <div class=\"min-w-0 flex-1 truncate\">\n {{ option.label }}\n </div>\n <ScalarIconButton\n v-if=\"option.isDeletable\"\n class=\"-m-0.5 shrink-0 p-0.5 opacity-0 group-hover/item:opacity-100\"\n :icon=\"ScalarIconTrash\"\n :label=\"`Delete ${option.label}`\"\n size=\"xs\"\n @click.stop=\"handleDeleteRequest(option)\" />\n </template>\n </ScalarComboboxMultiselect>\n </template>\n\n <!-- Auth Table -->\n <RequestAuthDataTable\n :activeAuthIndex=\"selectedSecurity?.selectedIndex ?? 0\"\n :environment\n :eventBus\n :isStatic\n :meta\n :options\n :proxyUrl\n :securitySchemes\n :selectedSchemeOptions=\"activeSchemeOptions\"\n :server />\n\n <!-- Delete Auth Modal -->\n <DeleteRequestAuthModal\n v-if=\"schemeToDelete\"\n :label=\"schemeToDelete.label\"\n :scheme=\"schemeToDelete\"\n :state=\"deleteModal\"\n @close=\"deleteModal.hide()\"\n @delete=\"handleDeleteConfirm\" />\n </CollapsibleSection>\n</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A,GAEA,YAEkB,MAAA,oBAAA,EAAA;OADhB,OAAM;OACN,QAAO;;;;;;2BAgCH,CAVZ,YAUY,8BAAA;KATT,iBAAiB,QAAA,kBAAkB,iBAAa;KAChD,aAAA,QAAA;KACA,UAAA,QAAA;KACA,UAAA,QAAA;KACA,MAAA,QAAA;KACA,SAAA,QAAA;KACA,UAAA,QAAA;KACA,iBAAA,QAAA;KACA,uBAAuB,oBAAA;KACvB,QAAA,QAAA;;;;;;;;;;;;QAIK,eAAA,SAAA,WAAA,EADR,YAMkC,gCAAA;;KAJ/B,OAAO,eAAA,MAAe;KACtB,QAAQ,eAAA;KACR,OAAO,MAAA,YAAW;KAClB,SAAK,OAAA,OAAA,OAAA,MAAA,WAAE,MAAA,YAAW,CAAC,MAAI;KACvB,UAAQ"}
1
+ {"version":3,"file":"AuthSelector.vue.script.js","names":[],"sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport {\n ScalarButton,\n type ScalarButton as ScalarButtonType,\n} from '@scalar/components/button'\nimport { ScalarComboboxMultiselect } from '@scalar/components/combobox'\nimport type { Icon } from '@scalar/components/icon'\nimport { ScalarIconButton } from '@scalar/components/icon-button'\nimport { ScalarListboxCheckbox } from '@scalar/components/listbox'\nimport { useModal } from '@scalar/components/modal'\nimport { ScalarIconCaretDown, ScalarIconTrash } from '@scalar/icons'\nimport type { SelectedSecurity } from '@scalar/workspace-store/entities/auth'\nimport type {\n AuthMeta,\n WorkspaceEventBus,\n} from '@scalar/workspace-store/events'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport { unpackProxyObject } from '@scalar/workspace-store/helpers/unpack-proxy'\nimport {\n isAuthOptional,\n type MergedSecuritySchemes,\n} from '@scalar/workspace-store/request-example'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport type {\n OpenApiDocument,\n SecurityRequirementObject,\n ServerObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed, ref, useId } from 'vue'\n\nimport DeleteRequestAuthModal from '@/v2/blocks/scalar-auth-selector-block/components/DeleteRequestAuthModal.vue'\nimport type { OAuth2Options } from '@/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue'\nimport {\n formatComplexScheme,\n formatScheme,\n getSecuritySchemeOptions,\n type SecuritySchemeOption,\n} from '@/v2/blocks/scalar-auth-selector-block/helpers/security-scheme'\nimport { CollapsibleSection } from '@/v2/components/layout'\n\nimport RequestAuthDataTable from './RequestAuthDataTable.vue'\n\nconst {\n environment,\n eventBus,\n createAnySecurityScheme = false,\n defaultOpen = true,\n isStatic = false,\n meta,\n proxyUrl,\n securityRequirements,\n securitySchemes,\n selectedSecurity,\n server,\n title,\n options,\n} = defineProps<{\n environment: XScalarEnvironment\n eventBus: WorkspaceEventBus\n /** Allows adding authentication which is not in the document */\n createAnySecurityScheme?: boolean\n /** Whether the authentication disclosure should start expanded */\n defaultOpen?: boolean\n /** Creates a static disclosure that cannot be collapsed */\n isStatic?: boolean\n meta: AuthMeta\n proxyUrl: string\n securityRequirements: OpenApiDocument['security']\n securitySchemes: MergedSecuritySchemes\n selectedSecurity: SelectedSecurity | undefined\n server: ServerObject | null\n title: string\n /** Any config options required for the OAuth2 flow */\n options?: OAuth2Options\n}>()\n\nconst titleId = useId()\nconst comboboxButtonRef = ref<typeof ScalarButtonType | null>(null)\nconst isDisclosureOpen = ref(false)\n\nconst deleteModal = useModal()\nconst schemeToDelete = ref<{\n label: string\n payload: SecurityRequirementObject\n} | null>(null)\n\n/**\n * Determines if authentication is required or optional\n *\n * Auth is optional when there is an empty security requirement and no complex requirements.\n * Complex requirements have multiple auth schemes combined (e.g., API key + OAuth).\n */\nconst authIndicator = computed<{ icon: Icon; text: string } | null>(() => {\n if (!securityRequirements?.length) {\n return null\n }\n\n const isOptional = isAuthOptional(securityRequirements)\n\n return {\n icon: isOptional ? 'Unlock' : 'Lock',\n text: isOptional ? 'Optional' : 'Required',\n }\n})\n\n/** All available auth scheme options for the dropdown */\nconst availableSchemeOptions = computed(() =>\n getSecuritySchemeOptions(\n securityRequirements ?? [],\n securitySchemes ?? {},\n selectedSecurity?.selectedSchemes ?? [],\n createAnySecurityScheme,\n ),\n)\n\n/** Currently active auth schemes selected for this operation or collection */\nconst activeSchemeOptions = computed<SecuritySchemeOption[]>(() => {\n const schemes = selectedSecurity?.selectedSchemes\n if (!schemes?.length) {\n return []\n }\n\n return schemes.flatMap((requirement) => {\n const schemeNames = Object.keys(requirement)\n\n if (schemeNames.length === 0) {\n return []\n }\n\n // Complex auth requirement with multiple schemes\n if (schemeNames.length > 1) {\n return formatComplexScheme(requirement)\n }\n\n // Simple auth requirement with single scheme\n const schemeName = schemeNames[0]\n if (!schemeName) {\n return []\n }\n\n const scheme = getResolvedRef(securitySchemes?.[schemeName])\n if (!scheme) {\n return []\n }\n\n return formatScheme({\n name: schemeName,\n value: requirement,\n })\n })\n})\n\n/**\n * Opens the combobox dropdown when clicking the auth indicator badge.\n * Prevents the disclosure from toggling if it is already open.\n */\nconst handleAuthIndicatorClick = (event: Event): void => {\n if (isDisclosureOpen.value) {\n event.stopPropagation()\n }\n comboboxButtonRef.value?.$el.click()\n}\n\n/**\n * Updates the selected auth schemes.\n * Separates existing schemes from newly created ones for the event payload.\n */\nconst handleSchemeSelection = (selected: SecuritySchemeOption[]): void => {\n const existingSchemes = selected\n .filter((option) => option.payload === undefined)\n .map((option) => unpackProxyObject(option.value, { depth: 2 }))\n\n const newSchemes = selected\n .filter((option) => option.payload !== undefined)\n .map((option) => ({\n name: option.label,\n scheme: option.payload!,\n }))\n\n eventBus.emit('auth:update:selected-security-schemes', {\n selectedRequirements: existingSchemes,\n newSchemes,\n meta,\n })\n}\n\n/** Shows the delete confirmation modal for the selected scheme */\nconst handleDeleteRequest = (option: {\n label: string\n value: SecurityRequirementObject\n}): void => {\n schemeToDelete.value = { label: option.label, payload: option.value }\n deleteModal.show()\n}\n\n/** Deletes the selected auth scheme after confirmation */\nconst handleDeleteConfirm = (): void => {\n if (!schemeToDelete.value) {\n return\n }\n\n eventBus.emit('auth:delete:security-scheme', {\n names: Object.keys(schemeToDelete.value.payload),\n })\n\n schemeToDelete.value = null\n deleteModal.hide()\n}\n\ndefineExpose({\n authIndicator,\n selectedSchemeOptions: activeSchemeOptions,\n schemeOptions: availableSchemeOptions,\n})\n</script>\n<template>\n <CollapsibleSection\n class=\"group/params relative\"\n :defaultOpen\n :isStatic=\"isStatic\"\n :itemCount=\"activeSchemeOptions.length\"\n @update:modelValue=\"(open) => (isDisclosureOpen = open)\">\n <template #title>\n <div\n :id=\"titleId\"\n class=\"inline-flex items-center gap-0.5 leading-[20px]\">\n <span>{{ title }}</span>\n\n <span\n v-if=\"authIndicator\"\n class=\"text-c-3 hover:bg-b-3 hover:text-c-1 -my-0.5 -mr-1 cursor-pointer rounded px-1 py-0.5 leading-[normal] font-normal\"\n :class=\"{ 'text-c-1': authIndicator.text === 'Required' }\"\n data-testid=\"auth-indicator\"\n @click=\"handleAuthIndicatorClick\">\n {{ authIndicator.text }}\n </span>\n </div>\n </template>\n\n <!-- Auth Dropdown (hidden when only one scheme is available) -->\n <template #actions>\n <ScalarComboboxMultiselect\n class=\"w-72 text-xs\"\n :modelValue=\"activeSchemeOptions\"\n multiple\n :options=\"availableSchemeOptions\"\n placement=\"bottom-end\"\n teleport\n @delete=\"handleDeleteRequest\"\n @update:modelValue=\"handleSchemeSelection\">\n <ScalarButton\n ref=\"comboboxButtonRef\"\n :aria-describedby=\"titleId\"\n class=\"group/combobox-button hover:text-c-1 text-c-2 flex h-fit w-full items-center gap-1 px-0.75 py-0.25 text-base font-normal\"\n variant=\"ghost\">\n <!-- Single auth scheme selected -->\n <template v-if=\"activeSchemeOptions.length === 1\">\n <span class=\"sr-only\">Selected Auth Type:</span>\n {{ activeSchemeOptions[0]?.label }}\n </template>\n\n <!-- Multiple auth schemes selected -->\n <template v-else-if=\"activeSchemeOptions.length > 1\">\n Multiple\n <span class=\"sr-only\">Auth Types Selected</span>\n </template>\n\n <!-- No auth schemes selected -->\n <template v-else>\n <span class=\"sr-only\">Select</span>\n Auth Type\n </template>\n\n <ScalarIconCaretDown\n class=\"size-3 shrink-0 transition-transform duration-100 group-aria-expanded/combobox-button:rotate-180\"\n weight=\"bold\" />\n </ScalarButton>\n\n <template #option=\"{ option, selected }\">\n <ScalarListboxCheckbox\n multiselect\n :selected=\"selected\" />\n <div class=\"min-w-0 flex-1 truncate\">\n {{ option.label }}\n </div>\n <ScalarIconButton\n v-if=\"option.isDeletable\"\n class=\"-m-0.5 shrink-0 p-0.5 opacity-0 group-hover/item:opacity-100\"\n :icon=\"ScalarIconTrash\"\n :label=\"`Delete ${option.label}`\"\n size=\"xs\"\n @click.stop=\"handleDeleteRequest(option)\" />\n </template>\n </ScalarComboboxMultiselect>\n </template>\n\n <!-- Auth Table -->\n <RequestAuthDataTable\n :activeAuthIndex=\"selectedSecurity?.selectedIndex ?? 0\"\n :environment\n :eventBus\n :isStatic\n :meta\n :options\n :proxyUrl\n :securitySchemes\n :selectedSchemeOptions=\"activeSchemeOptions\"\n :server />\n\n <!-- Delete Auth Modal -->\n <DeleteRequestAuthModal\n v-if=\"schemeToDelete\"\n :label=\"schemeToDelete.label\"\n :scheme=\"schemeToDelete\"\n :state=\"deleteModal\"\n @close=\"deleteModal.hide()\"\n @delete=\"handleDeleteConfirm\" />\n </CollapsibleSection>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4EA,MAAM,UAAU,OAAM;EACtB,MAAM,oBAAoB,IAAoC,KAAI;EAClE,MAAM,mBAAmB,IAAI,MAAK;EAElC,MAAM,cAAc,UAAS;EAC7B,MAAM,iBAAiB,IAGb,KAAI;;;;;;;EAQd,MAAM,gBAAgB,eAAoD;AACxE,OAAI,CAAC,QAAA,sBAAsB,OACzB,QAAO;GAGT,MAAM,aAAa,eAAe,QAAA,qBAA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,YAMkC,gCAAA;;KAJ/B,OAAO,eAAA,MAAe;KACtB,QAAQ,eAAA;KACR,OAAO,MAAA,YAAW;KAClB,SAAK,OAAA,OAAA,OAAA,MAAA,WAAE,MAAA,YAAW,CAAC,MAAI;KACvB,UAAQ"}
@@ -1,6 +1,6 @@
1
1
  //#region src/v2/constants.ts
2
2
  /** The version number taken from the package.json. Consumers can override at build time via define (e.g. OVERRIDE_PACKAGE_VERSION: JSON.stringify('1.2.3')). */
3
- var APP_VERSION = typeof OVERRIDE_PACKAGE_VERSION !== "undefined" ? OVERRIDE_PACKAGE_VERSION : "3.9.0";
3
+ var APP_VERSION = typeof OVERRIDE_PACKAGE_VERSION !== "undefined" ? OVERRIDE_PACKAGE_VERSION : "3.10.0";
4
4
  //#endregion
5
5
  export { APP_VERSION };
6
6
 
@@ -1 +1 @@
1
- {"version":3,"file":"workspace-events.d.ts","sourceRoot":"","sources":["../../src/v2/workspace-events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,KAAK,EAAE,kBAAkB,EAAkB,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAE3G,OAAO,EAAE,KAAK,GAAG,EAAY,MAAM,KAAK,CAAA;AAExC,KAAK,IAAI,CAAC,CAAC,SAAS,MAAM,kBAAkB,IAAI,OAAO,CAAC;IACtD,eAAe,EAAE,CACf,OAAO,EAAE,kBAAkB,CAAC,CAAC,CAAC,KAC3B,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,kBAAkB,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAA;IAClF,cAAc,EAAE,CAAC,OAAO,EAAE,kBAAkB,CAAC,CAAC,CAAC,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CACzE,CAAC,CAAA;AAEF,KAAK,KAAK,GAAG;KACV,GAAG,IAAI,MAAM,kBAAkB,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,CAAC,CAAA;IACjC,KAAK,EAAE,KAAK,CAAA;CACb,QA+TA"}
@@ -77,6 +77,8 @@ function initializeWorkspaceEventHandlers({ eventBus, store, hooks }) {
77
77
  eventBus.on("server:clear:servers", (payload) => withHook("server:clear:servers", mutators.value.active().server.clearServers, hooks)(payload));
78
78
  eventBus.on("server:update:variables", (payload) => withHook("server:update:variables", mutators.value.active().server.updateServerVariables, hooks)(payload));
79
79
  eventBus.on("server:update:selected", (payload) => withHook("server:update:selected", mutators.value.active().server.updateSelectedServer, hooks)(payload));
80
+ eventBus.on("asyncapi-server:update:selected", (payload) => withHook("asyncapi-server:update:selected", mutators.value.active().server.updateSelectedAsyncApiServer, hooks)(payload));
81
+ eventBus.on("asyncapi-server:update:variables", (payload) => withHook("asyncapi-server:update:variables", mutators.value.active().server.updateAsyncApiServerVariables, hooks)(payload));
80
82
  eventBus.on("operation:create:operation", (payload) => withHook("operation:create:operation", mutators.value.active().operation.createOperation, hooks)(payload));
81
83
  eventBus.on("operation:update:pathMethod", (payload) => withHook("operation:update:pathMethod", mutators.value.active().operation.updateOperationPathMethod, hooks)(payload));
82
84
  eventBus.on("operation:update:meta", (payload) => withHook("operation:update:meta", mutators.value.active().operation.updateOperationMeta, hooks)(payload));
@@ -1 +1 @@
1
- {"version":3,"file":"workspace-events.js","names":[],"sources":["../../src/v2/workspace-events.ts"],"sourcesContent":["import type { WorkspaceStore } from '@scalar/workspace-store/client'\nimport type { ApiReferenceEvents, CollectionType, WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { generateClientMutators } from '@scalar/workspace-store/mutators'\nimport { type Ref, computed } from 'vue'\n\ntype Hook<T extends keyof ApiReferenceEvents> = Partial<{\n onBeforeExecute: (\n payload: ApiReferenceEvents[T],\n ) => void | Promise<void> | ApiReferenceEvents[T] | Promise<ApiReferenceEvents[T]>\n onAfterExecute: (payload: ApiReferenceEvents[T]) => void | Promise<void>\n}>\n\ntype Hooks = {\n [key in keyof ApiReferenceEvents]?: Hook<key>\n}\n\n/**\n * Wraps a given function with optional before/after execution hooks for a specific event.\n * - Calls onBeforeExecute hook before executing the main function.\n * - Calls onAfterExecute hook after executing the main function.\n *\n * @template T The event key from ApiReferenceEvents\n * @param event The event name\n * @param fn The main function to execute\n * @param hooks The hooks object containing before/after hooks for events\n * @returns An async function that runs hooks around the main function\n */\nconst withHook = <T extends keyof ApiReferenceEvents>(\n event: T,\n fn: (args: ApiReferenceEvents[T]) => unknown | Promise<unknown>,\n hooks: Hooks,\n) => {\n return async (args: ApiReferenceEvents[T]) => {\n // Call the before execution hook for this event, if any\n const result = (await hooks[event]?.onBeforeExecute?.(args)) ?? args\n // Execute the main function\n await fn(result)\n // Call the after execution hook for this event, if any\n await hooks[event]?.onAfterExecute?.(result)\n return result\n }\n}\n\n/**\n * Initializes all Workspace Event Handlers by subscribing eventBus listeners\n * to each relevant mutator operation. Hooks are used for before/after execution.\n *\n * @param eventBus The WorkspaceEventBus to subscribe to\n * @param store The WorkspaceStore instance\n * @param hooks Object containing optional before/after hooks for each event\n */\nexport function initializeWorkspaceEventHandlers({\n eventBus,\n store,\n hooks,\n}: {\n eventBus: WorkspaceEventBus\n store: Ref<WorkspaceStore | null>\n hooks: Hooks\n}) {\n // Generate all client mutators for the current workspace store\n const mutators = computed(() => generateClientMutators(store.value))\n\n /**\n * Returns the appropriate mutators depending on the collectionType.\n * If collectionType is 'document', gets the active document mutator,\n * otherwise, gets the workspace mutator.\n */\n const getMutators = ({ collectionType }: CollectionType) => {\n if (collectionType === 'document') {\n return mutators.value.active()\n }\n return mutators.value.workspace()\n }\n\n //------------------------------------------------------------------------------------\n // Workspace Event Handlers\n //------------------------------------------------------------------------------------\n eventBus.on('workspace:update:active-proxy', (payload) =>\n withHook('workspace:update:active-proxy', mutators.value.workspace().workspace.updateActiveProxy, hooks)(payload),\n )\n eventBus.on('workspace:update:color-mode', (payload) =>\n withHook('workspace:update:color-mode', mutators.value.workspace().workspace.updateColorMode, hooks)(payload),\n )\n eventBus.on('workspace:update:theme', (payload) =>\n withHook('workspace:update:theme', mutators.value.workspace().workspace.updateTheme, hooks)(payload),\n )\n eventBus.on('workspace:update:selected-client', (payload) =>\n withHook(\n 'workspace:update:selected-client',\n mutators.value.workspace().workspace.updateSelectedClient,\n hooks,\n )(payload),\n )\n eventBus.on('workspace:update:active-environment', (payload) =>\n withHook(\n 'workspace:update:active-environment',\n mutators.value.workspace().workspace.updateActiveEnvironment,\n hooks,\n )(payload),\n )\n\n //------------------------------------------------------------------------------------\n // Document Event Handlers\n //------------------------------------------------------------------------------------\n eventBus.on('document:update:extension', (payload) =>\n withHook('document:update:extension', mutators.value.active().document.updateDocumentExtension, hooks)(payload),\n )\n eventBus.on('document:update:icon', (payload) =>\n withHook('document:update:icon', mutators.value.active().document.updateDocumentIcon, hooks)(payload),\n )\n eventBus.on('document:update:info', (payload) =>\n withHook('document:update:info', mutators.value.active().document.updateDocumentInfo, hooks)(payload),\n )\n eventBus.on('document:update:watch-mode', (payload) =>\n withHook('document:update:watch-mode', mutators.value.active().document.updateWatchMode, hooks)(payload),\n )\n eventBus.on('document:create:empty-document', (payload) =>\n withHook('document:create:empty-document', mutators.value.active().document.createEmptyDocument, hooks)(payload),\n )\n eventBus.on('document:delete:document', (payload) =>\n withHook('document:delete:document', mutators.value.active().document.deleteDocument, hooks)(payload),\n )\n\n //------------------------------------------------------------------------------------\n // Environment Event Handlers\n //------------------------------------------------------------------------------------\n eventBus.on('environment:upsert:environment', (payload) =>\n withHook('environment:upsert:environment', getMutators(payload).environment.upsertEnvironment, hooks)(payload),\n )\n eventBus.on('environment:delete:environment', (payload) =>\n withHook('environment:delete:environment', getMutators(payload).environment.deleteEnvironment, hooks)(payload),\n )\n eventBus.on('environment:upsert:environment-variable', (payload) =>\n withHook(\n 'environment:upsert:environment-variable',\n getMutators(payload).environment.upsertEnvironmentVariable,\n hooks,\n )(payload),\n )\n eventBus.on('environment:delete:environment-variable', (payload) =>\n withHook(\n 'environment:delete:environment-variable',\n getMutators(payload).environment.deleteEnvironmentVariable,\n hooks,\n )(payload),\n )\n\n //------------------------------------------------------------------------------------\n // Cookie Related Event Handlers\n //------------------------------------------------------------------------------------\n eventBus.on('cookie:upsert:cookie', async (payload) => {\n await withHook('cookie:upsert:cookie', getMutators(payload).cookie.upsertCookie, hooks)(payload)\n })\n eventBus.on('cookie:delete:cookie', async (payload) => {\n await withHook('cookie:delete:cookie', getMutators(payload).cookie.deleteCookie, hooks)(payload)\n })\n\n //------------------------------------------------------------------------------------\n // Auth Related Event Handlers\n //------------------------------------------------------------------------------------\n eventBus.on('auth:delete:security-scheme', (payload) =>\n withHook('auth:delete:security-scheme', mutators.value.active().auth.deleteSecurityScheme, hooks)(payload),\n )\n eventBus.on('auth:update:active-index', (payload) =>\n withHook('auth:update:active-index', mutators.value.active().auth.updateSelectedAuthTab, hooks)(payload),\n )\n eventBus.on('auth:update:security-scheme', (payload) =>\n withHook('auth:update:security-scheme', mutators.value.active().auth.updateSecurityScheme, hooks)(payload),\n )\n eventBus.on('auth:update:selected-scopes', (payload) =>\n withHook('auth:update:selected-scopes', mutators.value.active().auth.updateSelectedScopes, hooks)(payload),\n )\n eventBus.on('auth:upsert:scopes', (payload) =>\n withHook('auth:upsert:scopes', mutators.value.active().auth.upsertScope, hooks)(payload),\n )\n eventBus.on('auth:delete:scopes', (payload) =>\n withHook('auth:delete:scopes', mutators.value.active().auth.deleteScope, hooks)(payload),\n )\n eventBus.on('auth:update:selected-security-schemes', (payload) =>\n withHook(\n 'auth:update:selected-security-schemes',\n mutators.value.active().auth.updateSelectedSecuritySchemes,\n hooks,\n )(payload),\n )\n eventBus.on('auth:clear:selected-security-schemes', (payload) =>\n withHook(\n 'auth:clear:selected-security-schemes',\n mutators.value.active().auth.clearSelectedSecuritySchemes,\n hooks,\n )(payload),\n )\n eventBus.on('auth:update:security-scheme-secrets', (payload) =>\n withHook(\n 'auth:update:security-scheme-secrets',\n mutators.value.active().auth.updateSecuritySchemeSecrets,\n hooks,\n )(payload),\n )\n eventBus.on('auth:clear:security-scheme-secrets', (payload) =>\n withHook(\n 'auth:clear:security-scheme-secrets',\n mutators.value.active().auth.clearSecuritySchemeSecrets,\n hooks,\n )(payload),\n )\n\n //------------------------------------------------------------------------------------\n // Server Related Event Handlers\n //------------------------------------------------------------------------------------\n eventBus.on('server:initialize:servers', (payload) =>\n withHook('server:initialize:servers', mutators.value.active().server.initializeServers, hooks)(payload),\n )\n eventBus.on('server:add:server', (payload) =>\n withHook('server:add:server', mutators.value.active().server.addServer, hooks)(payload),\n )\n eventBus.on('server:update:server', (payload) =>\n withHook('server:update:server', mutators.value.active().server.updateServer, hooks)(payload),\n )\n eventBus.on('server:delete:server', (payload) =>\n withHook('server:delete:server', mutators.value.active().server.deleteServer, hooks)(payload),\n )\n eventBus.on('server:clear:servers', (payload) =>\n withHook('server:clear:servers', mutators.value.active().server.clearServers, hooks)(payload),\n )\n eventBus.on('server:update:variables', (payload) =>\n withHook('server:update:variables', mutators.value.active().server.updateServerVariables, hooks)(payload),\n )\n eventBus.on('server:update:selected', (payload) =>\n withHook('server:update:selected', mutators.value.active().server.updateSelectedServer, hooks)(payload),\n )\n\n //------------------------------------------------------------------------------------\n // Operation Related Event Handlers\n //------------------------------------------------------------------------------------\n eventBus.on('operation:create:operation', (payload) =>\n withHook('operation:create:operation', mutators.value.active().operation.createOperation, hooks)(payload),\n )\n eventBus.on('operation:update:pathMethod', (payload) =>\n withHook(\n 'operation:update:pathMethod',\n mutators.value.active().operation.updateOperationPathMethod,\n hooks,\n )(payload),\n )\n eventBus.on('operation:update:meta', (payload) =>\n withHook('operation:update:meta', mutators.value.active().operation.updateOperationMeta, hooks)(payload),\n )\n eventBus.on('operation:delete:operation', (payload) =>\n withHook('operation:delete:operation', mutators.value.active().operation.deleteOperation, hooks)(payload),\n )\n eventBus.on('operation:create:draft-example', (payload) =>\n withHook(\n 'operation:create:draft-example',\n mutators.value.active().operation.createOperationDraftExample,\n hooks,\n )(payload),\n )\n eventBus.on('operation:delete:example', (payload) =>\n withHook('operation:delete:example', mutators.value.active().operation.deleteOperationExample, hooks)(payload),\n )\n eventBus.on('operation:rename:example', (payload) =>\n withHook('operation:rename:example', mutators.value.active().operation.renameOperationExample, hooks)(payload),\n )\n eventBus.on('operation:upsert:parameter', (payload) =>\n withHook('operation:upsert:parameter', mutators.value.active().operation.upsertOperationParameter, hooks)(payload),\n )\n eventBus.on('operation:update:extra-parameters', (payload) =>\n withHook(\n 'operation:update:extra-parameters',\n mutators.value.active().operation.updateOperationExtraParameters,\n hooks,\n )(payload),\n )\n eventBus.on('operation:delete:parameter', (payload) =>\n withHook('operation:delete:parameter', mutators.value.active().operation.deleteOperationParameter, hooks)(payload),\n )\n eventBus.on('operation:delete-all:parameters', (payload) =>\n withHook(\n 'operation:delete-all:parameters',\n mutators.value.active().operation.deleteAllOperationParameters,\n hooks,\n )(payload),\n )\n eventBus.on('operation:update:extension', (payload) =>\n withHook('operation:update:extension', mutators.value.active().operation.updateOperationExtension, hooks)(payload),\n )\n\n //------------------------------------------------------------------------------------\n // Operation Request Body Related Event Handlers\n //------------------------------------------------------------------------------------\n eventBus.on('operation:update:requestBody:contentType', (payload) =>\n withHook(\n 'operation:update:requestBody:contentType',\n mutators.value.active().operation.updateOperationRequestBodyContentType,\n hooks,\n )(payload),\n )\n eventBus.on('operation:update:requestBody:value', (payload) =>\n withHook(\n 'operation:update:requestBody:value',\n mutators.value.active().operation.updateOperationRequestBodyExample,\n hooks,\n )(payload),\n )\n eventBus.on('operation:update:requestBody:formValue', (payload) =>\n withHook(\n 'operation:update:requestBody:formValue',\n mutators.value.active().operation.updateOperationRequestBodyFormValue,\n hooks,\n )(payload),\n )\n eventBus.on('operation:reload:history', (payload) =>\n withHook('operation:reload:history', mutators.value.active().operation.reloadOperationHistory, hooks)(payload),\n )\n\n //------------------------------------------------------------------------------------\n // Tag Related Event Handlers\n //------------------------------------------------------------------------------------\n eventBus.on('tag:create:tag', (payload) =>\n withHook('tag:create:tag', mutators.value.active().tag.createTag, hooks)(payload),\n )\n eventBus.on('tag:edit:tag', (payload) =>\n withHook('tag:edit:tag', mutators.value.active().tag.editTag, hooks)(payload),\n )\n eventBus.on('tag:delete:tag', (payload) =>\n withHook('tag:delete:tag', mutators.value.active().tag.deleteTag, hooks)(payload),\n )\n\n //------------------------------------------------------------------------------------\n // Tabs Related Event Handlers\n //------------------------------------------------------------------------------------\n eventBus.on('tabs:add:tab', (payload) =>\n withHook('tabs:add:tab', mutators.value.workspace().tabs.addTab, hooks)(payload),\n )\n eventBus.on('tabs:close:tab', (payload) =>\n withHook('tabs:close:tab', mutators.value.workspace().tabs.closeTab, hooks)(payload),\n )\n eventBus.on('tabs:close:other-tabs', (payload) =>\n withHook('tabs:close:other-tabs', mutators.value.workspace().tabs.closeOtherTabs, hooks)(payload),\n )\n eventBus.on('tabs:focus:tab', (payload) =>\n withHook('tabs:focus:tab', mutators.value.workspace().tabs.focusTab, hooks)(payload),\n )\n eventBus.on('tabs:focus:tab-last', (payload) =>\n withHook('tabs:focus:tab-last', mutators.value.workspace().tabs.focusLastTab, hooks)(payload),\n )\n eventBus.on('tabs:navigate:previous', (payload) =>\n withHook('tabs:navigate:previous', mutators.value.workspace().tabs.navigatePreviousTab, hooks)(payload),\n )\n eventBus.on('tabs:navigate:next', (payload) =>\n withHook('tabs:navigate:next', mutators.value.workspace().tabs.navigateNextTab, hooks)(payload),\n )\n eventBus.on('tabs:update:tabs', (payload) =>\n withHook('tabs:update:tabs', mutators.value.workspace().tabs.updateTabs, hooks)(payload),\n )\n\n //------------------------------------------------------------------------------------\n // Hooks Related Event Handlers\n //------------------------------------------------------------------------------------\n eventBus.on('hooks:on:request:complete', (payload) =>\n withHook('hooks:on:request:complete', mutators.value.active().operation.addResponseToHistory, hooks)(payload),\n )\n}\n"],"mappings":";;;;;;;;;;;;;;AA2BA,IAAM,YACJ,OACA,IACA,UACG;AACH,QAAO,OAAO,SAAgC;EAE5C,MAAM,SAAU,MAAM,MAAM,QAAQ,kBAAkB,K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AAW,CAAC,KAAK,QAAQ,MAAM,CAAC,QAAQ,CACjF;AACD,UAAS,GAAG,mBAAmB,YAC7B,SAAS,kBAAkB,SAAS,MAAM,WAAW,CAAC,KAAK,UAAU,MAAM,CAAC,QAAQ,CACrF;AACD,UAAS,GAAG,0BAA0B,YACpC,SAAS,yBAAyB,SAAS,MAAM,WAAW,CAAC,KAAK,gBAAgB,MAAM,CAAC,QAAQ,CAClG;AACD,UAAS,GAAG,mBAAmB,YAC7B,SAAS,kBAAkB,SAAS,MAAM,WAAW,CAAC,KAAK,UAAU,MAAM,CAAC,QAAQ,CACrF;AACD,UAAS,GAAG,wBAAwB,YAClC,SAAS,uBAAuB,SAAS,MAAM,WAAW,CAAC,KAAK,cAAc,MAAM,CAAC,QAAQ,CAC9F;AACD,UAAS,GAAG,2BAA2B,YACrC,SAAS,0BAA0B,SAAS,MAAM,WAAW,CAAC,KAAK,qBAAqB,MAAM,CAAC,QAAQ,CACxG;AACD,UAAS,GAAG,uBAAuB,YACjC,SAAS,sBAAsB,SAAS,MAAM,WAAW,CAAC,KAAK,iBAAiB,MAAM,CAAC,QAAQ,CAChG;AACD,UAAS,GAAG,qBAAqB,YAC/B,SAAS,oBAAoB,SAAS,MAAM,WAAW,CAAC,KAAK,YAAY,MAAM,CAAC,QAAQ,CACzF;AAKD,UAAS,GAAG,8BAA8B,YACxC,SAAS,6BAA6B,SAAS,MAAM,QAAQ,CAAC,UAAU,sBAAsB,MAAM,CAAC,QAAQ,CAC9G"}
1
+ {"version":3,"file":"workspace-events.js","names":[],"sources":["../../src/v2/workspace-events.ts"],"sourcesContent":["import type { WorkspaceStore } from '@scalar/workspace-store/client'\nimport type { ApiReferenceEvents, CollectionType, WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { generateClientMutators } from '@scalar/workspace-store/mutators'\nimport { type Ref, computed } from 'vue'\n\ntype Hook<T extends keyof ApiReferenceEvents> = Partial<{\n onBeforeExecute: (\n payload: ApiReferenceEvents[T],\n ) => void | Promise<void> | ApiReferenceEvents[T] | Promise<ApiReferenceEvents[T]>\n onAfterExecute: (payload: ApiReferenceEvents[T]) => void | Promise<void>\n}>\n\ntype Hooks = {\n [key in keyof ApiReferenceEvents]?: Hook<key>\n}\n\n/**\n * Wraps a given function with optional before/after execution hooks for a specific event.\n * - Calls onBeforeExecute hook before executing the main function.\n * - Calls onAfterExecute hook after executing the main function.\n *\n * @template T The event key from ApiReferenceEvents\n * @param event The event name\n * @param fn The main function to execute\n * @param hooks The hooks object containing before/after hooks for events\n * @returns An async function that runs hooks around the main function\n */\nconst withHook = <T extends keyof ApiReferenceEvents>(\n event: T,\n fn: (args: ApiReferenceEvents[T]) => unknown | Promise<unknown>,\n hooks: Hooks,\n) => {\n return async (args: ApiReferenceEvents[T]) => {\n // Call the before execution hook for this event, if any\n const result = (await hooks[event]?.onBeforeExecute?.(args)) ?? args\n // Execute the main function\n await fn(result)\n // Call the after execution hook for this event, if any\n await hooks[event]?.onAfterExecute?.(result)\n return result\n }\n}\n\n/**\n * Initializes all Workspace Event Handlers by subscribing eventBus listeners\n * to each relevant mutator operation. Hooks are used for before/after execution.\n *\n * @param eventBus The WorkspaceEventBus to subscribe to\n * @param store The WorkspaceStore instance\n * @param hooks Object containing optional before/after hooks for each event\n */\nexport function initializeWorkspaceEventHandlers({\n eventBus,\n store,\n hooks,\n}: {\n eventBus: WorkspaceEventBus\n store: Ref<WorkspaceStore | null>\n hooks: Hooks\n}) {\n // Generate all client mutators for the current workspace store\n const mutators = computed(() => generateClientMutators(store.value))\n\n /**\n * Returns the appropriate mutators depending on the collectionType.\n * If collectionType is 'document', gets the active document mutator,\n * otherwise, gets the workspace mutator.\n */\n const getMutators = ({ collectionType }: CollectionType) => {\n if (collectionType === 'document') {\n return mutators.value.active()\n }\n return mutators.value.workspace()\n }\n\n //------------------------------------------------------------------------------------\n // Workspace Event Handlers\n //------------------------------------------------------------------------------------\n eventBus.on('workspace:update:active-proxy', (payload) =>\n withHook('workspace:update:active-proxy', mutators.value.workspace().workspace.updateActiveProxy, hooks)(payload),\n )\n eventBus.on('workspace:update:color-mode', (payload) =>\n withHook('workspace:update:color-mode', mutators.value.workspace().workspace.updateColorMode, hooks)(payload),\n )\n eventBus.on('workspace:update:theme', (payload) =>\n withHook('workspace:update:theme', mutators.value.workspace().workspace.updateTheme, hooks)(payload),\n )\n eventBus.on('workspace:update:selected-client', (payload) =>\n withHook(\n 'workspace:update:selected-client',\n mutators.value.workspace().workspace.updateSelectedClient,\n hooks,\n )(payload),\n )\n eventBus.on('workspace:update:active-environment', (payload) =>\n withHook(\n 'workspace:update:active-environment',\n mutators.value.workspace().workspace.updateActiveEnvironment,\n hooks,\n )(payload),\n )\n\n //------------------------------------------------------------------------------------\n // Document Event Handlers\n //------------------------------------------------------------------------------------\n eventBus.on('document:update:extension', (payload) =>\n withHook('document:update:extension', mutators.value.active().document.updateDocumentExtension, hooks)(payload),\n )\n eventBus.on('document:update:icon', (payload) =>\n withHook('document:update:icon', mutators.value.active().document.updateDocumentIcon, hooks)(payload),\n )\n eventBus.on('document:update:info', (payload) =>\n withHook('document:update:info', mutators.value.active().document.updateDocumentInfo, hooks)(payload),\n )\n eventBus.on('document:update:watch-mode', (payload) =>\n withHook('document:update:watch-mode', mutators.value.active().document.updateWatchMode, hooks)(payload),\n )\n eventBus.on('document:create:empty-document', (payload) =>\n withHook('document:create:empty-document', mutators.value.active().document.createEmptyDocument, hooks)(payload),\n )\n eventBus.on('document:delete:document', (payload) =>\n withHook('document:delete:document', mutators.value.active().document.deleteDocument, hooks)(payload),\n )\n\n //------------------------------------------------------------------------------------\n // Environment Event Handlers\n //------------------------------------------------------------------------------------\n eventBus.on('environment:upsert:environment', (payload) =>\n withHook('environment:upsert:environment', getMutators(payload).environment.upsertEnvironment, hooks)(payload),\n )\n eventBus.on('environment:delete:environment', (payload) =>\n withHook('environment:delete:environment', getMutators(payload).environment.deleteEnvironment, hooks)(payload),\n )\n eventBus.on('environment:upsert:environment-variable', (payload) =>\n withHook(\n 'environment:upsert:environment-variable',\n getMutators(payload).environment.upsertEnvironmentVariable,\n hooks,\n )(payload),\n )\n eventBus.on('environment:delete:environment-variable', (payload) =>\n withHook(\n 'environment:delete:environment-variable',\n getMutators(payload).environment.deleteEnvironmentVariable,\n hooks,\n )(payload),\n )\n\n //------------------------------------------------------------------------------------\n // Cookie Related Event Handlers\n //------------------------------------------------------------------------------------\n eventBus.on('cookie:upsert:cookie', async (payload) => {\n await withHook('cookie:upsert:cookie', getMutators(payload).cookie.upsertCookie, hooks)(payload)\n })\n eventBus.on('cookie:delete:cookie', async (payload) => {\n await withHook('cookie:delete:cookie', getMutators(payload).cookie.deleteCookie, hooks)(payload)\n })\n\n //------------------------------------------------------------------------------------\n // Auth Related Event Handlers\n //------------------------------------------------------------------------------------\n eventBus.on('auth:delete:security-scheme', (payload) =>\n withHook('auth:delete:security-scheme', mutators.value.active().auth.deleteSecurityScheme, hooks)(payload),\n )\n eventBus.on('auth:update:active-index', (payload) =>\n withHook('auth:update:active-index', mutators.value.active().auth.updateSelectedAuthTab, hooks)(payload),\n )\n eventBus.on('auth:update:security-scheme', (payload) =>\n withHook('auth:update:security-scheme', mutators.value.active().auth.updateSecurityScheme, hooks)(payload),\n )\n eventBus.on('auth:update:selected-scopes', (payload) =>\n withHook('auth:update:selected-scopes', mutators.value.active().auth.updateSelectedScopes, hooks)(payload),\n )\n eventBus.on('auth:upsert:scopes', (payload) =>\n withHook('auth:upsert:scopes', mutators.value.active().auth.upsertScope, hooks)(payload),\n )\n eventBus.on('auth:delete:scopes', (payload) =>\n withHook('auth:delete:scopes', mutators.value.active().auth.deleteScope, hooks)(payload),\n )\n eventBus.on('auth:update:selected-security-schemes', (payload) =>\n withHook(\n 'auth:update:selected-security-schemes',\n mutators.value.active().auth.updateSelectedSecuritySchemes,\n hooks,\n )(payload),\n )\n eventBus.on('auth:clear:selected-security-schemes', (payload) =>\n withHook(\n 'auth:clear:selected-security-schemes',\n mutators.value.active().auth.clearSelectedSecuritySchemes,\n hooks,\n )(payload),\n )\n eventBus.on('auth:update:security-scheme-secrets', (payload) =>\n withHook(\n 'auth:update:security-scheme-secrets',\n mutators.value.active().auth.updateSecuritySchemeSecrets,\n hooks,\n )(payload),\n )\n eventBus.on('auth:clear:security-scheme-secrets', (payload) =>\n withHook(\n 'auth:clear:security-scheme-secrets',\n mutators.value.active().auth.clearSecuritySchemeSecrets,\n hooks,\n )(payload),\n )\n\n //------------------------------------------------------------------------------------\n // Server Related Event Handlers\n //------------------------------------------------------------------------------------\n eventBus.on('server:initialize:servers', (payload) =>\n withHook('server:initialize:servers', mutators.value.active().server.initializeServers, hooks)(payload),\n )\n eventBus.on('server:add:server', (payload) =>\n withHook('server:add:server', mutators.value.active().server.addServer, hooks)(payload),\n )\n eventBus.on('server:update:server', (payload) =>\n withHook('server:update:server', mutators.value.active().server.updateServer, hooks)(payload),\n )\n eventBus.on('server:delete:server', (payload) =>\n withHook('server:delete:server', mutators.value.active().server.deleteServer, hooks)(payload),\n )\n eventBus.on('server:clear:servers', (payload) =>\n withHook('server:clear:servers', mutators.value.active().server.clearServers, hooks)(payload),\n )\n eventBus.on('server:update:variables', (payload) =>\n withHook('server:update:variables', mutators.value.active().server.updateServerVariables, hooks)(payload),\n )\n eventBus.on('server:update:selected', (payload) =>\n withHook('server:update:selected', mutators.value.active().server.updateSelectedServer, hooks)(payload),\n )\n eventBus.on('asyncapi-server:update:selected', (payload) =>\n withHook(\n 'asyncapi-server:update:selected',\n mutators.value.active().server.updateSelectedAsyncApiServer,\n hooks,\n )(payload),\n )\n eventBus.on('asyncapi-server:update:variables', (payload) =>\n withHook(\n 'asyncapi-server:update:variables',\n mutators.value.active().server.updateAsyncApiServerVariables,\n hooks,\n )(payload),\n )\n\n //------------------------------------------------------------------------------------\n // Operation Related Event Handlers\n //------------------------------------------------------------------------------------\n eventBus.on('operation:create:operation', (payload) =>\n withHook('operation:create:operation', mutators.value.active().operation.createOperation, hooks)(payload),\n )\n eventBus.on('operation:update:pathMethod', (payload) =>\n withHook(\n 'operation:update:pathMethod',\n mutators.value.active().operation.updateOperationPathMethod,\n hooks,\n )(payload),\n )\n eventBus.on('operation:update:meta', (payload) =>\n withHook('operation:update:meta', mutators.value.active().operation.updateOperationMeta, hooks)(payload),\n )\n eventBus.on('operation:delete:operation', (payload) =>\n withHook('operation:delete:operation', mutators.value.active().operation.deleteOperation, hooks)(payload),\n )\n eventBus.on('operation:create:draft-example', (payload) =>\n withHook(\n 'operation:create:draft-example',\n mutators.value.active().operation.createOperationDraftExample,\n hooks,\n )(payload),\n )\n eventBus.on('operation:delete:example', (payload) =>\n withHook('operation:delete:example', mutators.value.active().operation.deleteOperationExample, hooks)(payload),\n )\n eventBus.on('operation:rename:example', (payload) =>\n withHook('operation:rename:example', mutators.value.active().operation.renameOperationExample, hooks)(payload),\n )\n eventBus.on('operation:upsert:parameter', (payload) =>\n withHook('operation:upsert:parameter', mutators.value.active().operation.upsertOperationParameter, hooks)(payload),\n )\n eventBus.on('operation:update:extra-parameters', (payload) =>\n withHook(\n 'operation:update:extra-parameters',\n mutators.value.active().operation.updateOperationExtraParameters,\n hooks,\n )(payload),\n )\n eventBus.on('operation:delete:parameter', (payload) =>\n withHook('operation:delete:parameter', mutators.value.active().operation.deleteOperationParameter, hooks)(payload),\n )\n eventBus.on('operation:delete-all:parameters', (payload) =>\n withHook(\n 'operation:delete-all:parameters',\n mutators.value.active().operation.deleteAllOperationParameters,\n hooks,\n )(payload),\n )\n eventBus.on('operation:update:extension', (payload) =>\n withHook('operation:update:extension', mutators.value.active().operation.updateOperationExtension, hooks)(payload),\n )\n\n //------------------------------------------------------------------------------------\n // Operation Request Body Related Event Handlers\n //------------------------------------------------------------------------------------\n eventBus.on('operation:update:requestBody:contentType', (payload) =>\n withHook(\n 'operation:update:requestBody:contentType',\n mutators.value.active().operation.updateOperationRequestBodyContentType,\n hooks,\n )(payload),\n )\n eventBus.on('operation:update:requestBody:value', (payload) =>\n withHook(\n 'operation:update:requestBody:value',\n mutators.value.active().operation.updateOperationRequestBodyExample,\n hooks,\n )(payload),\n )\n eventBus.on('operation:update:requestBody:formValue', (payload) =>\n withHook(\n 'operation:update:requestBody:formValue',\n mutators.value.active().operation.updateOperationRequestBodyFormValue,\n hooks,\n )(payload),\n )\n eventBus.on('operation:reload:history', (payload) =>\n withHook('operation:reload:history', mutators.value.active().operation.reloadOperationHistory, hooks)(payload),\n )\n\n //------------------------------------------------------------------------------------\n // Tag Related Event Handlers\n //------------------------------------------------------------------------------------\n eventBus.on('tag:create:tag', (payload) =>\n withHook('tag:create:tag', mutators.value.active().tag.createTag, hooks)(payload),\n )\n eventBus.on('tag:edit:tag', (payload) =>\n withHook('tag:edit:tag', mutators.value.active().tag.editTag, hooks)(payload),\n )\n eventBus.on('tag:delete:tag', (payload) =>\n withHook('tag:delete:tag', mutators.value.active().tag.deleteTag, hooks)(payload),\n )\n\n //------------------------------------------------------------------------------------\n // Tabs Related Event Handlers\n //------------------------------------------------------------------------------------\n eventBus.on('tabs:add:tab', (payload) =>\n withHook('tabs:add:tab', mutators.value.workspace().tabs.addTab, hooks)(payload),\n )\n eventBus.on('tabs:close:tab', (payload) =>\n withHook('tabs:close:tab', mutators.value.workspace().tabs.closeTab, hooks)(payload),\n )\n eventBus.on('tabs:close:other-tabs', (payload) =>\n withHook('tabs:close:other-tabs', mutators.value.workspace().tabs.closeOtherTabs, hooks)(payload),\n )\n eventBus.on('tabs:focus:tab', (payload) =>\n withHook('tabs:focus:tab', mutators.value.workspace().tabs.focusTab, hooks)(payload),\n )\n eventBus.on('tabs:focus:tab-last', (payload) =>\n withHook('tabs:focus:tab-last', mutators.value.workspace().tabs.focusLastTab, hooks)(payload),\n )\n eventBus.on('tabs:navigate:previous', (payload) =>\n withHook('tabs:navigate:previous', mutators.value.workspace().tabs.navigatePreviousTab, hooks)(payload),\n )\n eventBus.on('tabs:navigate:next', (payload) =>\n withHook('tabs:navigate:next', mutators.value.workspace().tabs.navigateNextTab, hooks)(payload),\n )\n eventBus.on('tabs:update:tabs', (payload) =>\n withHook('tabs:update:tabs', mutators.value.workspace().tabs.updateTabs, hooks)(payload),\n )\n\n //------------------------------------------------------------------------------------\n // Hooks Related Event Handlers\n //------------------------------------------------------------------------------------\n eventBus.on('hooks:on:request:complete', (payload) =>\n withHook('hooks:on:request:complete', mutators.value.active().operation.addResponseToHistory, hooks)(payload),\n )\n}\n"],"mappings":";;;;;;;;;;;;;;AA2BA,IAAM,YACJ,OACA,IACA,UACG;AACH,QAAO,OAAO,SAAgC;EAE5C,MAAM,SAAU,MAAM,MAAM,QAAQ,kBAAkB,KAAK,IAAK;AAEhE,QAAM,GAAG,OAAO;AAEhB,QAAM,MAAM,QAAQ,iBAAiB,OAAO;AAC5C,SAAO;;;;;;;;;;;AAYX,SAAgB,iCAAiC,EAC/C,UACA,OACA,SAKC;CAED,MAAM,WAAW,eAAe,uBAAuB,MAAM,MAAM,CAAC;;;;;;CAOpE,MAAM,eAAe,EAAE,qBAAqC;AAC1D,MAAI,mBAAmB,WACrB,QAAO,SAAS,MAAM,QAAQ;AAEhC,SAAO,SAAS,MAAM,WAAW;;AAMnC,UAAS,GAAG,kCAAkC,YAC5C,SAAS,iCAAiC,SAAS,MAAM,WAAW,CAAC,UAAU,mBAAmB,MAAM,CAAC,QAAQ,CAClH;AACD,UAAS,GAAG,gCAAgC,YAC1C,SAAS,+BAA+B,SAAS,MAAM,WAAW,CAAC,UAAU,iBAAiB,MAAM,CAAC,QAAQ,CAC9G;AACD,UAAS,GAAG,2BAA2B,YACrC,SAAS,0BAA0B,SAAS,MAAM,WAAW,CAAC,UAAU,aAAa,MAAM,CAAC,QAAQ,CACrG;AACD,UAAS,GAAG,qCAAqC,YAC/C,SACE,oCACA,SAAS,MAAM,WAAW,CAAC,UAAU,sBACrC,MACD,CAAC,QAAQ,CACX;AACD,UAAS,GAAG,wCAAwC,YAClD,SACE,uCACA,SAAS,MAAM,WAAW,CAAC,UAAU,yBACrC,MACD,CAAC,QAAQ,CACX;AAKD,UA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,CAAC,KAAK,iBAAiB,MAAM,CAAC,QAAQ,CAChG;AACD,UAAS,GAAG,qBAAqB,YAC/B,SAAS,oBAAoB,SAAS,MAAM,WAAW,CAAC,KAAK,YAAY,MAAM,CAAC,QAAQ,CACzF;AAKD,UAAS,GAAG,8BAA8B,YACxC,SAAS,6BAA6B,SAAS,MAAM,QAAQ,CAAC,UAAU,sBAAsB,MAAM,CAAC,QAAQ,CAC9G"}
@@ -647,34 +647,34 @@ to {
647
647
  }
648
648
  }
649
649
 
650
- .request-card[data-v-49c97039] {
650
+ .request-card[data-v-70ede25b] {
651
651
  color: var(--scalar-color-1);
652
652
  font-size: var(--scalar-font-size-3);
653
653
  }
654
- .request-method[data-v-49c97039] {
654
+ .request-method[data-v-70ede25b] {
655
655
  font-family: var(--scalar-font-code);
656
656
  text-transform: uppercase;
657
657
  margin-right: 6px;
658
658
  }
659
- .request-card-footer[data-v-49c97039] {
659
+ .request-card-footer[data-v-70ede25b] {
660
660
  display: flex;
661
661
  justify-content: flex-end;
662
662
  padding: 6px;
663
663
  flex-shrink: 0;
664
664
  position: relative;
665
665
  }
666
- .request-card-footer-addon[data-v-49c97039] {
666
+ .request-card-footer-addon[data-v-70ede25b] {
667
667
  display: flex;
668
668
  align-items: center;
669
669
 
670
670
  flex: 1;
671
671
  min-width: 0;
672
672
  }
673
- .request-editor-section[data-v-49c97039] {
673
+ .request-editor-section[data-v-70ede25b] {
674
674
  display: flex;
675
675
  flex: 1;
676
676
  }
677
- .request-card-simple[data-v-49c97039] {
677
+ .request-card-simple[data-v-70ede25b] {
678
678
  display: flex;
679
679
  align-items: center;
680
680
  justify-content: space-between;
@@ -683,7 +683,7 @@ to {
683
683
 
684
684
  font-size: var(--scalar-small);
685
685
  }
686
- .code-snippet[data-v-49c97039] {
686
+ .code-snippet[data-v-70ede25b] {
687
687
  display: flex;
688
688
  flex-direction: column;
689
689
  width: 100%;
package/package.json CHANGED
@@ -18,7 +18,7 @@
18
18
  "rest",
19
19
  "testing"
20
20
  ],
21
- "version": "3.9.0",
21
+ "version": "3.10.0",
22
22
  "engines": {
23
23
  "node": ">=22"
24
24
  },
@@ -321,20 +321,20 @@
321
321
  "vue": "^3.5.30",
322
322
  "yaml": "^2.8.3",
323
323
  "zod": "^4.3.5",
324
- "@scalar/components": "0.26.1",
325
- "@scalar/helpers": "0.8.1",
324
+ "@scalar/components": "0.27.0",
326
325
  "@scalar/icons": "0.7.3",
327
326
  "@scalar/json-magic": "0.12.15",
327
+ "@scalar/oas-utils": "0.18.1",
328
328
  "@scalar/openapi-types": "0.9.1",
329
- "@scalar/sidebar": "0.9.18",
330
- "@scalar/snippetz": "0.9.12",
331
- "@scalar/themes": "0.15.6",
332
- "@scalar/oas-utils": "0.18.0",
333
- "@scalar/use-hooks": "0.4.6",
334
- "@scalar/types": "0.12.3",
329
+ "@scalar/sidebar": "0.9.19",
330
+ "@scalar/themes": "0.16.0",
331
+ "@scalar/helpers": "0.8.1",
332
+ "@scalar/snippetz": "0.9.13",
333
+ "@scalar/types": "0.13.0",
335
334
  "@scalar/use-codemirror": "0.14.11",
336
- "@scalar/workspace-store": "0.53.0",
337
- "@scalar/use-toasts": "0.10.2"
335
+ "@scalar/use-hooks": "0.4.6",
336
+ "@scalar/use-toasts": "0.10.2",
337
+ "@scalar/workspace-store": "0.54.0"
338
338
  },
339
339
  "devDependencies": {
340
340
  "@tailwindcss/cli": "^4.2.4",