@scalar/api-reference 1.49.7 → 1.50.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 (88) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/browser/standalone.js +185 -183
  3. package/dist/browser/webpack-stats.json +1 -1
  4. package/dist/components/ApiReference.vue.d.ts.map +1 -1
  5. package/dist/components/ApiReference.vue.js +1 -1
  6. package/dist/components/ApiReference.vue.js.map +1 -1
  7. package/dist/components/ApiReference.vue.script.js +4 -4
  8. package/dist/components/ApiReference.vue.script.js.map +1 -1
  9. package/dist/components/Content/Auth/Auth.vue.d.ts +1 -1
  10. package/dist/components/Content/Auth/Auth.vue.d.ts.map +1 -1
  11. package/dist/components/Content/Auth/Auth.vue.js.map +1 -1
  12. package/dist/components/Content/Auth/Auth.vue.script.js +1 -1
  13. package/dist/components/Content/Auth/Auth.vue.script.js.map +1 -1
  14. package/dist/components/Content/Auth/helpers/get-default-security.d.ts +1 -1
  15. package/dist/components/Content/Auth/helpers/get-default-security.d.ts.map +1 -1
  16. package/dist/components/Content/Auth/helpers/get-default-security.js.map +1 -1
  17. package/dist/components/Content/Content.vue.d.ts.map +1 -1
  18. package/dist/components/Content/Content.vue.js.map +1 -1
  19. package/dist/components/Content/Content.vue.script.js +2 -4
  20. package/dist/components/Content/Content.vue.script.js.map +1 -1
  21. package/dist/components/Content/Operations/TraversedEntry.vue.d.ts +1 -1
  22. package/dist/components/Content/Operations/TraversedEntry.vue.d.ts.map +1 -1
  23. package/dist/components/Content/Operations/TraversedEntry.vue.js.map +1 -1
  24. package/dist/components/Content/Operations/TraversedEntry.vue.script.js +1 -1
  25. package/dist/components/Content/Operations/TraversedEntry.vue.script.js.map +1 -1
  26. package/dist/components/Content/Tags/components/ClassicLayout.vue.d.ts.map +1 -1
  27. package/dist/components/Content/Tags/components/ClassicLayout.vue.js +1 -1
  28. package/dist/components/Content/Tags/components/ClassicLayout.vue.js.map +1 -1
  29. package/dist/components/Content/Tags/components/ClassicLayout.vue.script.js +9 -5
  30. package/dist/components/Content/Tags/components/ClassicLayout.vue.script.js.map +1 -1
  31. package/dist/features/Operation/Operation.vue.d.ts +1 -1
  32. package/dist/features/Operation/Operation.vue.d.ts.map +1 -1
  33. package/dist/features/Operation/Operation.vue.js.map +1 -1
  34. package/dist/features/Operation/Operation.vue.script.js +1 -1
  35. package/dist/features/Operation/Operation.vue.script.js.map +1 -1
  36. package/dist/features/Operation/helpers/filter-selected-security.d.ts +2 -1
  37. package/dist/features/Operation/helpers/filter-selected-security.d.ts.map +1 -1
  38. package/dist/features/Operation/helpers/filter-selected-security.js +1 -2
  39. package/dist/features/Operation/helpers/filter-selected-security.js.map +1 -1
  40. package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts +1 -1
  41. package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts.map +1 -1
  42. package/dist/features/Operation/layouts/ClassicLayout.vue.js +1 -1
  43. package/dist/features/Operation/layouts/ClassicLayout.vue.js.map +1 -1
  44. package/dist/features/Operation/layouts/ClassicLayout.vue.script.js.map +1 -1
  45. package/dist/features/Operation/layouts/ModernLayout.vue.d.ts +1 -1
  46. package/dist/features/Operation/layouts/ModernLayout.vue.d.ts.map +1 -1
  47. package/dist/features/Operation/layouts/ModernLayout.vue.js +1 -1
  48. package/dist/features/Operation/layouts/ModernLayout.vue.js.map +1 -1
  49. package/dist/features/Operation/layouts/ModernLayout.vue.script.js.map +1 -1
  50. package/dist/features/Search/helpers/create-fuse-instance.d.ts.map +1 -1
  51. package/dist/features/Search/helpers/create-fuse-instance.js +4 -0
  52. package/dist/features/Search/helpers/create-fuse-instance.js.map +1 -1
  53. package/dist/features/Search/helpers/create-search-index.d.ts.map +1 -1
  54. package/dist/features/Search/helpers/create-search-index.js +41 -4
  55. package/dist/features/Search/helpers/create-search-index.js.map +1 -1
  56. package/dist/features/Search/types.d.ts +1 -0
  57. package/dist/features/Search/types.d.ts.map +1 -1
  58. package/dist/features/example-responses/ExampleResponse.vue.d.ts.map +1 -1
  59. package/dist/features/example-responses/ExampleResponse.vue.js +1 -1
  60. package/dist/features/example-responses/ExampleResponse.vue.js.map +1 -1
  61. package/dist/features/example-responses/ExampleResponse.vue.script.js +2 -1
  62. package/dist/features/example-responses/ExampleResponse.vue.script.js.map +1 -1
  63. package/dist/features/example-responses/ExampleResponses.vue.js +1 -1
  64. package/dist/features/example-responses/ExampleResponses.vue.js.map +1 -1
  65. package/dist/features/example-responses/ExampleResponses.vue.script.js +1 -1
  66. package/dist/features/example-responses/ExampleResponses.vue.script.js.map +1 -1
  67. package/dist/features/external-docs/ExternalDocs.vue.d.ts +2 -2
  68. package/dist/features/external-docs/ExternalDocs.vue.d.ts.map +1 -1
  69. package/dist/features/external-docs/ExternalDocs.vue.js.map +1 -1
  70. package/dist/features/external-docs/ExternalDocs.vue.script.js.map +1 -1
  71. package/dist/features/info-object/Contact.vue.d.ts +2 -2
  72. package/dist/features/info-object/Contact.vue.d.ts.map +1 -1
  73. package/dist/features/info-object/Contact.vue.js.map +1 -1
  74. package/dist/features/info-object/Contact.vue.script.js.map +1 -1
  75. package/dist/features/info-object/License.vue.d.ts +2 -2
  76. package/dist/features/info-object/License.vue.d.ts.map +1 -1
  77. package/dist/features/info-object/License.vue.js.map +1 -1
  78. package/dist/features/info-object/License.vue.script.js.map +1 -1
  79. package/dist/features/info-object/TermsOfService.vue.d.ts +2 -2
  80. package/dist/features/info-object/TermsOfService.vue.d.ts.map +1 -1
  81. package/dist/features/info-object/TermsOfService.vue.js.map +1 -1
  82. package/dist/features/info-object/TermsOfService.vue.script.js.map +1 -1
  83. package/dist/helpers/openapi.d.ts +2 -5
  84. package/dist/helpers/openapi.d.ts.map +1 -1
  85. package/dist/helpers/openapi.js +25 -19
  86. package/dist/helpers/openapi.js.map +1 -1
  87. package/dist/style.css +340 -389
  88. package/package.json +20 -25
@@ -1 +1 @@
1
- {"version":3,"file":"Auth.vue.script.js","names":[],"sources":["../../../../src/components/Content/Auth/Auth.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport {\n AuthSelector,\n type MergedSecuritySchemes,\n} from '@scalar/api-client/v2/blocks/scalar-auth-selector-block'\nimport {\n getSecurityRequirements,\n getSelectedSecurity,\n} from '@scalar/api-client/v2/features/operation'\nimport type { ApiReferenceConfigurationRaw } from '@scalar/types/api-reference'\nimport type { AuthStore } from '@scalar/workspace-store/entities/auth'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport type { ServerObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport type { WorkspaceDocument } from '@scalar/workspace-store/schemas/workspace'\nimport { computed, watch } from 'vue'\n\nimport { getDefaultSecurity } from '@/components/Content/Auth/helpers/get-default-security'\n\nconst { document, environment, eventBus, options, securitySchemes, authStore } =\n defineProps<{\n options: Pick<\n ApiReferenceConfigurationRaw,\n 'authentication' | 'persistAuth' | 'proxyUrl'\n >\n authStore: AuthStore\n document: WorkspaceDocument | undefined\n eventBus: WorkspaceEventBus\n securitySchemes: MergedSecuritySchemes\n selectedServer: ServerObject | null\n environment: XScalarEnvironment\n }>()\n\n/** Compute what the security requirements should be for the document */\nconst securityRequirements = computed(() =>\n getSecurityRequirements(document?.security),\n)\n\n/** Grab the selected security for the document from the auth store */\nconst documentSelectedSecurity = computed(() =>\n authStore.getAuthSelectedSchemas({\n type: 'document',\n documentName: document?.['x-scalar-navigation']?.name ?? '',\n }),\n)\n\n/** The selected security keys for the document */\nconst selectedSecurity = computed(() =>\n getSelectedSecurity(\n documentSelectedSecurity.value,\n undefined,\n securityRequirements.value,\n ),\n)\n\n// We set the initial security on the document to the default if it doesn't exist\nwatch(\n documentSelectedSecurity,\n (newDocumentSelectedSecurity) => {\n if (typeof newDocumentSelectedSecurity !== 'undefined') {\n return\n }\n\n const defaultSecurity = getDefaultSecurity(\n securityRequirements.value,\n options.authentication?.preferredSecurityScheme,\n securitySchemes,\n )\n if (!defaultSecurity) {\n return\n }\n\n eventBus.emit('auth:update:selected-security-schemes', {\n selectedRequirements: [defaultSecurity],\n newSchemes: [],\n meta: { type: 'document' },\n })\n },\n { immediate: true },\n)\n</script>\n<template>\n <AuthSelector\n v-if=\"Object.keys(securitySchemes).length\"\n :createAnySecurityScheme=\"\n options.authentication?.createAnySecurityScheme ?? false\n \"\n :environment\n :eventBus\n isStatic\n layout=\"reference\"\n :meta=\"{ type: 'document' }\"\n :persistAuth=\"options.persistAuth\"\n :proxyUrl=\"options.proxyUrl ?? ''\"\n :securityRequirements\n :securitySchemes\n :selectedSecurity\n :server=\"selectedServer\"\n title=\"Authentication\" />\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;EAkCA,MAAM,uBAAuB,eAC3B,wBAAwB,QAAA,UAAU,SAAS,CAC7C;;EAGA,MAAM,2BAA2B,eAC/B,QAAA,UAAU,uBAAuB;GAC/B,MAAM;GACN,cAAc,QAAA,WAAW,wBAAwB,QAAQ;GAC1D,CAAC,CACJ;;EAGA,MAAM,mBAAmB,eACvB,oBACE,yBAAyB,OACzB,KAAA,GACA,qBAAqB,MACtB,CACH;AAGA,QACE,2BACC,gCAAgC;AAC/B,OAAI,OAAO,gCAAgC,YACzC;GAGF,MAAM,kBAAkB,mBACtB,qBAAqB,OACrB,QAAA,QAAQ,gBAAgB,yBACxB,QAAA,gBACF;AACA,OAAI,CAAC,gBACH;AAGF,WAAA,SAAS,KAAK,yCAAyC;IACrD,sBAAsB,CAAC,gBAAgB;IACvC,YAAY,EAAE;IACd,MAAM,EAAE,MAAM,YAAY;IAC3B,CAAA;KAEH,EAAE,WAAW,MAAM,CACrB;;UAIU,OAAO,KAAK,QAAA,gBAAe,CAAE,UAAA,WAAA,EADrC,YAgB2B,MAAA,aAAA,EAAA;;IAdxB,yBAAgC,QAAA,QAAQ,gBAAgB,2BAAuB;IAG/E,aAAA,QAAA;IACA,UAAA,QAAA;IACD,UAAA;IACA,QAAO;IACN,MAAM,EAAA,MAAA,YAAoB;IAC1B,aAAa,QAAA,QAAQ;IACrB,UAAU,QAAA,QAAQ,YAAQ;IAC1B,sBAAA,qBAAA;IACA,iBAAA,QAAA;IACA,kBAAA,iBAAA;IACA,QAAQ,QAAA;IACT,OAAM"}
1
+ {"version":3,"file":"Auth.vue.script.js","names":[],"sources":["../../../../src/components/Content/Auth/Auth.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { AuthSelector } from '@scalar/api-client/v2/blocks/scalar-auth-selector-block'\nimport type { ApiReferenceConfigurationRaw } from '@scalar/types/api-reference'\nimport type { AuthStore } from '@scalar/workspace-store/entities/auth'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport {\n getSecurityRequirements,\n getSelectedSecurity,\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 { ServerObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport type { WorkspaceDocument } from '@scalar/workspace-store/schemas/workspace'\nimport { computed, watch } from 'vue'\n\nimport { getDefaultSecurity } from '@/components/Content/Auth/helpers/get-default-security'\n\nconst { document, environment, eventBus, options, securitySchemes, authStore } =\n defineProps<{\n options: Pick<\n ApiReferenceConfigurationRaw,\n 'authentication' | 'persistAuth' | 'proxyUrl'\n >\n authStore: AuthStore\n document: WorkspaceDocument | undefined\n eventBus: WorkspaceEventBus\n securitySchemes: MergedSecuritySchemes\n selectedServer: ServerObject | null\n environment: XScalarEnvironment\n }>()\n\n/** Compute what the security requirements should be for the document */\nconst securityRequirements = computed(() =>\n getSecurityRequirements(document?.security),\n)\n\n/** Grab the selected security for the document from the auth store */\nconst documentSelectedSecurity = computed(() =>\n authStore.getAuthSelectedSchemas({\n type: 'document',\n documentName: document?.['x-scalar-navigation']?.name ?? '',\n }),\n)\n\n/** The selected security keys for the document */\nconst selectedSecurity = computed(() =>\n getSelectedSecurity(\n documentSelectedSecurity.value,\n undefined,\n securityRequirements.value,\n ),\n)\n\n// We set the initial security on the document to the default if it doesn't exist\nwatch(\n documentSelectedSecurity,\n (newDocumentSelectedSecurity) => {\n if (typeof newDocumentSelectedSecurity !== 'undefined') {\n return\n }\n\n const defaultSecurity = getDefaultSecurity(\n securityRequirements.value,\n options.authentication?.preferredSecurityScheme,\n securitySchemes,\n )\n if (!defaultSecurity) {\n return\n }\n\n eventBus.emit('auth:update:selected-security-schemes', {\n selectedRequirements: [defaultSecurity],\n newSchemes: [],\n meta: { type: 'document' },\n })\n },\n { immediate: true },\n)\n</script>\n<template>\n <AuthSelector\n v-if=\"Object.keys(securitySchemes).length\"\n :createAnySecurityScheme=\"\n options.authentication?.createAnySecurityScheme ?? false\n \"\n :environment\n :eventBus\n isStatic\n layout=\"reference\"\n :meta=\"{ type: 'document' }\"\n :persistAuth=\"options.persistAuth\"\n :proxyUrl=\"options.proxyUrl ?? ''\"\n :securityRequirements\n :securitySchemes\n :selectedSecurity\n :server=\"selectedServer\"\n title=\"Authentication\" />\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;EAgCA,MAAM,uBAAuB,eAC3B,wBAAwB,QAAA,UAAU,SAAS,CAC7C;;EAGA,MAAM,2BAA2B,eAC/B,QAAA,UAAU,uBAAuB;GAC/B,MAAM;GACN,cAAc,QAAA,WAAW,wBAAwB,QAAQ;GAC1D,CAAC,CACJ;;EAGA,MAAM,mBAAmB,eACvB,oBACE,yBAAyB,OACzB,KAAA,GACA,qBAAqB,MACtB,CACH;AAGA,QACE,2BACC,gCAAgC;AAC/B,OAAI,OAAO,gCAAgC,YACzC;GAGF,MAAM,kBAAkB,mBACtB,qBAAqB,OACrB,QAAA,QAAQ,gBAAgB,yBACxB,QAAA,gBACF;AACA,OAAI,CAAC,gBACH;AAGF,WAAA,SAAS,KAAK,yCAAyC;IACrD,sBAAsB,CAAC,gBAAgB;IACvC,YAAY,EAAE;IACd,MAAM,EAAE,MAAM,YAAY;IAC3B,CAAA;KAEH,EAAE,WAAW,MAAM,CACrB;;UAIU,OAAO,KAAK,QAAA,gBAAe,CAAE,UAAA,WAAA,EADrC,YAgB2B,MAAA,aAAA,EAAA;;IAdxB,yBAAgC,QAAA,QAAQ,gBAAgB,2BAAuB;IAG/E,aAAA,QAAA;IACA,UAAA,QAAA;IACD,UAAA;IACA,QAAO;IACN,MAAM,EAAA,MAAA,YAAoB;IAC1B,aAAa,QAAA,QAAQ;IACrB,UAAU,QAAA,QAAQ,YAAQ;IAC1B,sBAAA,qBAAA;IACA,iBAAA,QAAA;IACA,kBAAA,iBAAA;IACA,QAAQ,QAAA;IACT,OAAM"}
@@ -1,5 +1,5 @@
1
- import type { MergedSecuritySchemes } from '@scalar/api-client/v2/blocks/scalar-auth-selector-block';
2
1
  import type { AuthenticationConfiguration } from '@scalar/types/api-reference';
2
+ import type { MergedSecuritySchemes } from '@scalar/workspace-store/request-example';
3
3
  import type { SecurityRequirementObject, SecuritySchemeObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
4
4
  /**
5
5
  * Extracts the default scopes for a security scheme.
@@ -1 +1 @@
1
- {"version":3,"file":"get-default-security.d.ts","sourceRoot":"","sources":["../../../../../src/components/Content/Auth/helpers/get-default-security.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yDAAyD,CAAA;AACpG,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAA;AAG9E,OAAO,KAAK,EACV,yBAAyB,EACzB,oBAAoB,EACrB,MAAM,8DAA8D,CAAA;AAErE;;;GAGG;AACH,eAAO,MAAM,gBAAgB,GAAI,QAAQ,oBAAoB,GAAG,SAAS,KAAG,MAAM,EAMjF,CAAA;AAkED;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,GAC7B,sBAAsB,yBAAyB,EAAE,EACjD,yBAAyB,2BAA2B,CAAC,yBAAyB,CAAC,EAC/E,iBAAiB,qBAAqB,KACrC,yBAAyB,GAAG,IAW9B,CAAA"}
1
+ {"version":3,"file":"get-default-security.d.ts","sourceRoot":"","sources":["../../../../../src/components/Content/Auth/helpers/get-default-security.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAA;AAG9E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yCAAyC,CAAA;AACpF,OAAO,KAAK,EACV,yBAAyB,EACzB,oBAAoB,EACrB,MAAM,8DAA8D,CAAA;AAErE;;;GAGG;AACH,eAAO,MAAM,gBAAgB,GAAI,QAAQ,oBAAoB,GAAG,SAAS,KAAG,MAAM,EAMjF,CAAA;AAkED;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,GAC7B,sBAAsB,yBAAyB,EAAE,EACjD,yBAAyB,2BAA2B,CAAC,yBAAyB,CAAC,EAC/E,iBAAiB,qBAAqB,KACrC,yBAAyB,GAAG,IAW9B,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"get-default-security.js","names":[],"sources":["../../../../../src/components/Content/Auth/helpers/get-default-security.ts"],"sourcesContent":["import type { MergedSecuritySchemes } from '@scalar/api-client/v2/blocks/scalar-auth-selector-block'\nimport type { AuthenticationConfiguration } from '@scalar/types/api-reference'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport { unpackProxyObject } from '@scalar/workspace-store/helpers/unpack-proxy'\nimport type {\n SecurityRequirementObject,\n SecuritySchemeObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\n\n/**\n * Extracts the default scopes for a security scheme.\n * Only OAuth2 schemes can have default scopes via the x-default-scopes extension.\n */\nexport const getDefaultScopes = (scheme: SecuritySchemeObject | undefined): string[] => {\n if (!scheme || scheme.type !== 'oauth2') {\n return []\n }\n\n return scheme['x-default-scopes'] ?? []\n}\n\n/**\n * Hydrates an existing security requirement with configured default scopes.\n * Explicit scopes from the OpenAPI requirement take precedence over x-default-scopes.\n */\nconst hydrateSecurityRequirement = (\n requirement: SecurityRequirementObject,\n securitySchemes: MergedSecuritySchemes,\n): SecurityRequirementObject => {\n const hydratedRequirement: SecurityRequirementObject = {}\n\n for (const [schemeName, scopes] of Object.entries(unpackProxyObject(requirement, { depth: 1 }) ?? requirement)) {\n if (Array.isArray(scopes) && scopes.length > 0) {\n hydratedRequirement[schemeName] = scopes\n continue\n }\n\n const scheme = getResolvedRef(securitySchemes[schemeName])\n hydratedRequirement[schemeName] = getDefaultScopes(scheme)\n }\n\n return hydratedRequirement\n}\n\n/**\n * Processes a single scheme name and adds it to the accumulator with its default scopes.\n */\nconst addSchemeToRequirement = (\n acc: SecurityRequirementObject,\n schemeName: string,\n securitySchemes: MergedSecuritySchemes,\n): void => {\n const scheme = getResolvedRef(securitySchemes[schemeName])\n acc[schemeName] = getDefaultScopes(scheme)\n}\n\n/**\n * Converts the preferred security scheme configuration into a SecurityRequirementObject.\n * Handles both flat arrays and nested arrays (for complex auth scenarios).\n */\nconst buildSecurityRequirementFromPreferred = (\n preferredSecurityScheme: string | (string | string[])[],\n securitySchemes: MergedSecuritySchemes,\n): SecurityRequirementObject => {\n if (!Array.isArray(preferredSecurityScheme)) {\n const scheme = getResolvedRef(securitySchemes[preferredSecurityScheme])\n return { [preferredSecurityScheme]: getDefaultScopes(scheme) }\n }\n\n const requirement: SecurityRequirementObject = {}\n\n for (const item of preferredSecurityScheme) {\n if (Array.isArray(item)) {\n // Handle nested arrays for complex auth (e.g., [['oauth2', 'apiKey'], 'basic'])\n for (const schemeName of item) {\n addSchemeToRequirement(requirement, schemeName, securitySchemes)\n }\n } else {\n addSchemeToRequirement(requirement, item, securitySchemes)\n }\n }\n\n return requirement\n}\n\n/**\n * Determines the default security scheme to use for an operation.\n *\n * Priority order:\n * 1. User-configured preferred security scheme (if provided)\n * 2. First security requirement from the OpenAPI spec\n * 3. null (no security required)\n */\nexport const getDefaultSecurity = (\n securityRequirements: SecurityRequirementObject[],\n preferredSecurityScheme: AuthenticationConfiguration['preferredSecurityScheme'],\n securitySchemes: MergedSecuritySchemes,\n): SecurityRequirementObject | null => {\n if (preferredSecurityScheme) {\n return buildSecurityRequirementFromPreferred(preferredSecurityScheme, securitySchemes)\n }\n\n const firstRequirement = securityRequirements[0]\n if (firstRequirement) {\n return hydrateSecurityRequirement(firstRequirement, securitySchemes)\n }\n\n return null\n}\n"],"mappings":";;;;;;;AAaA,IAAa,oBAAoB,WAAuD;AACtF,KAAI,CAAC,UAAU,OAAO,SAAS,SAC7B,QAAO,EAAE;AAGX,QAAO,OAAO,uBAAuB,EAAE;;;;;;AAOzC,IAAM,8BACJ,aACA,oBAC8B;CAC9B,MAAM,sBAAiD,EAAE;AAEzD,MAAK,MAAM,CAAC,YAAY,WAAW,OAAO,QAAQ,kBAAkB,aAAa,EAAE,OAAO,GAAG,CAAC,IAAI,YAAY,EAAE;AAC9G,MAAI,MAAM,QAAQ,OAAO,IAAI,OAAO,SAAS,GAAG;AAC9C,uBAAoB,cAAc;AAClC;;AAIF,sBAAoB,cAAc,iBADnB,eAAe,gBAAgB,YAAY,CACA;;AAG5D,QAAO;;;;;AAMT,IAAM,0BACJ,KACA,YACA,oBACS;AAET,KAAI,cAAc,iBADH,eAAe,gBAAgB,YAAY,CAChB;;;;;;AAO5C,IAAM,yCACJ,yBACA,oBAC8B;AAC9B,KAAI,CAAC,MAAM,QAAQ,wBAAwB,EAAE;EAC3C,MAAM,SAAS,eAAe,gBAAgB,yBAAyB;AACvE,SAAO,GAAG,0BAA0B,iBAAiB,OAAO,EAAE;;CAGhE,MAAM,cAAyC,EAAE;AAEjD,MAAK,MAAM,QAAQ,wBACjB,KAAI,MAAM,QAAQ,KAAK,CAErB,MAAK,MAAM,cAAc,KACvB,wBAAuB,aAAa,YAAY,gBAAgB;KAGlE,wBAAuB,aAAa,MAAM,gBAAgB;AAI9D,QAAO;;;;;;;;;;AAWT,IAAa,sBACX,sBACA,yBACA,oBACqC;AACrC,KAAI,wBACF,QAAO,sCAAsC,yBAAyB,gBAAgB;CAGxF,MAAM,mBAAmB,qBAAqB;AAC9C,KAAI,iBACF,QAAO,2BAA2B,kBAAkB,gBAAgB;AAGtE,QAAO"}
1
+ {"version":3,"file":"get-default-security.js","names":[],"sources":["../../../../../src/components/Content/Auth/helpers/get-default-security.ts"],"sourcesContent":["import type { AuthenticationConfiguration } from '@scalar/types/api-reference'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport { unpackProxyObject } from '@scalar/workspace-store/helpers/unpack-proxy'\nimport type { MergedSecuritySchemes } from '@scalar/workspace-store/request-example'\nimport type {\n SecurityRequirementObject,\n SecuritySchemeObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\n\n/**\n * Extracts the default scopes for a security scheme.\n * Only OAuth2 schemes can have default scopes via the x-default-scopes extension.\n */\nexport const getDefaultScopes = (scheme: SecuritySchemeObject | undefined): string[] => {\n if (!scheme || scheme.type !== 'oauth2') {\n return []\n }\n\n return scheme['x-default-scopes'] ?? []\n}\n\n/**\n * Hydrates an existing security requirement with configured default scopes.\n * Explicit scopes from the OpenAPI requirement take precedence over x-default-scopes.\n */\nconst hydrateSecurityRequirement = (\n requirement: SecurityRequirementObject,\n securitySchemes: MergedSecuritySchemes,\n): SecurityRequirementObject => {\n const hydratedRequirement: SecurityRequirementObject = {}\n\n for (const [schemeName, scopes] of Object.entries(unpackProxyObject(requirement, { depth: 1 }) ?? requirement)) {\n if (Array.isArray(scopes) && scopes.length > 0) {\n hydratedRequirement[schemeName] = scopes\n continue\n }\n\n const scheme = getResolvedRef(securitySchemes[schemeName])\n hydratedRequirement[schemeName] = getDefaultScopes(scheme)\n }\n\n return hydratedRequirement\n}\n\n/**\n * Processes a single scheme name and adds it to the accumulator with its default scopes.\n */\nconst addSchemeToRequirement = (\n acc: SecurityRequirementObject,\n schemeName: string,\n securitySchemes: MergedSecuritySchemes,\n): void => {\n const scheme = getResolvedRef(securitySchemes[schemeName])\n acc[schemeName] = getDefaultScopes(scheme)\n}\n\n/**\n * Converts the preferred security scheme configuration into a SecurityRequirementObject.\n * Handles both flat arrays and nested arrays (for complex auth scenarios).\n */\nconst buildSecurityRequirementFromPreferred = (\n preferredSecurityScheme: string | (string | string[])[],\n securitySchemes: MergedSecuritySchemes,\n): SecurityRequirementObject => {\n if (!Array.isArray(preferredSecurityScheme)) {\n const scheme = getResolvedRef(securitySchemes[preferredSecurityScheme])\n return { [preferredSecurityScheme]: getDefaultScopes(scheme) }\n }\n\n const requirement: SecurityRequirementObject = {}\n\n for (const item of preferredSecurityScheme) {\n if (Array.isArray(item)) {\n // Handle nested arrays for complex auth (e.g., [['oauth2', 'apiKey'], 'basic'])\n for (const schemeName of item) {\n addSchemeToRequirement(requirement, schemeName, securitySchemes)\n }\n } else {\n addSchemeToRequirement(requirement, item, securitySchemes)\n }\n }\n\n return requirement\n}\n\n/**\n * Determines the default security scheme to use for an operation.\n *\n * Priority order:\n * 1. User-configured preferred security scheme (if provided)\n * 2. First security requirement from the OpenAPI spec\n * 3. null (no security required)\n */\nexport const getDefaultSecurity = (\n securityRequirements: SecurityRequirementObject[],\n preferredSecurityScheme: AuthenticationConfiguration['preferredSecurityScheme'],\n securitySchemes: MergedSecuritySchemes,\n): SecurityRequirementObject | null => {\n if (preferredSecurityScheme) {\n return buildSecurityRequirementFromPreferred(preferredSecurityScheme, securitySchemes)\n }\n\n const firstRequirement = securityRequirements[0]\n if (firstRequirement) {\n return hydrateSecurityRequirement(firstRequirement, securitySchemes)\n }\n\n return null\n}\n"],"mappings":";;;;;;;AAaA,IAAa,oBAAoB,WAAuD;AACtF,KAAI,CAAC,UAAU,OAAO,SAAS,SAC7B,QAAO,EAAE;AAGX,QAAO,OAAO,uBAAuB,EAAE;;;;;;AAOzC,IAAM,8BACJ,aACA,oBAC8B;CAC9B,MAAM,sBAAiD,EAAE;AAEzD,MAAK,MAAM,CAAC,YAAY,WAAW,OAAO,QAAQ,kBAAkB,aAAa,EAAE,OAAO,GAAG,CAAC,IAAI,YAAY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E,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"Content.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Content/Content.vue"],"names":[],"mappings":"AAqNA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,6BAA6B,CAAA;AAC/E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AACnD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uCAAuC,CAAA;AACtE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAMvE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AACnH,OAAO,KAAK,EAAE,cAAc,IAAI,kBAAkB,EAAE,MAAM,4CAA4C,CAAA;AACtG,OAAO,KAAK,EACV,SAAS,EACT,iBAAiB,EAClB,MAAM,2CAA2C,CAAA;AAiBlD,KAAK,WAAW,GAAG;IACf,aAAa,EAAE,MAAM,CAAA;IACrB,gFAAgF;IAChF,OAAO,EAAE,IAAI,CACX,4BAA4B,EAC1B,gBAAgB,GAChB,eAAe,GACf,sBAAsB,GACtB,oBAAoB,GACpB,eAAe,GACf,uBAAuB,GACvB,QAAQ,GACR,8BAA8B,GAC9B,yBAAyB,GACzB,aAAa,GACb,UAAU,GACV,SAAS,GACT,iBAAiB,CACpB,CAAA;IACD,QAAQ,EAAE,iBAAiB,GAAG,SAAS,CAAA;IACvC,SAAS,EAAE,SAAS,CAAA;IACpB,oBAAoB,EAAE,SAAS,CAAC,yBAAyB,CAAC,CAAA;IAC1D,KAAK,EAAE,kBAAkB,EAAE,CAAA;IAC3B,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACtC,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,WAAW,EAAE,kBAAkB,CAAA;IAC/B,iDAAiD;IACjD,oBAAoB,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,MAAM,CAAA;CACnD,CAAC;AA6UJ,QAAA,IAAI,OAAO,IAAU,EAAE,QAAQ,IAAY,CAAE;AAC7C,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,GAC1C;IAAE,GAAG,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,CAAC;AAG5C,QAAA,MAAM,UAAU,kSAEd,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AACzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Content.vue.js","names":[],"sources":["../../../src/components/Content/Content.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { generateClientOptions } from '@scalar/api-client/v2/blocks/operation-code-sample'\nimport { mergeSecurity } from '@scalar/api-client/v2/blocks/scalar-auth-selector-block'\nimport { mapHiddenClientsConfig } from '@scalar/api-client/v2/features/modal'\nimport { getSelectedServer } from '@scalar/api-client/v2/features/operation'\nimport { getServers } from '@scalar/api-client/v2/helpers'\nimport { ScalarErrorBoundary } from '@scalar/components'\nimport type { ApiReferenceConfigurationRaw } from '@scalar/types/api-reference'\nimport type { Heading } from '@scalar/types/legacy'\nimport type { AuthStore } from '@scalar/workspace-store/entities/auth'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport type { TraversedEntry as TraversedEntryType } from '@scalar/workspace-store/schemas/navigation'\nimport type {\n Workspace,\n WorkspaceDocument,\n} from '@scalar/workspace-store/schemas/workspace'\nimport { computed, onMounted } from 'vue'\n\nimport { ClientSelector } from '@/blocks/scalar-client-selector-block'\nimport { InfoBlock } from '@/blocks/scalar-info-block'\nimport { IntroductionCardItem } from '@/blocks/scalar-info-block/'\nimport { ServerSelector } from '@/blocks/scalar-server-selector-block'\nimport { Auth } from '@/components/Content/Auth'\nimport TraversedEntry from '@/components/Content/Operations/TraversedEntry.vue'\nimport { RenderPlugins } from '@/components/RenderPlugins'\nimport { SectionFlare } from '@/components/SectionFlare'\nimport { getXKeysFromObject } from '@/features/specification-extension'\nimport {\n firstLazyLoadComplete,\n scheduleInitialLoadComplete,\n} from '@/helpers/lazy-bus'\n\nconst { document, items, environment, eventBus, options, authStore } =\n defineProps<{\n infoSectionId: string\n /** The subset of the configuration object required for the content component */\n options: Pick<\n ApiReferenceConfigurationRaw,\n | 'authentication'\n | 'baseServerURL'\n | 'documentDownloadType'\n | 'expandAllResponses'\n | 'hiddenClients'\n | 'hideTestRequestButton'\n | 'layout'\n | 'orderRequiredPropertiesFirst'\n | 'orderSchemaPropertiesBy'\n | 'persistAuth'\n | 'proxyUrl'\n | 'servers'\n | 'showOperationId'\n >\n document: WorkspaceDocument | undefined\n authStore: AuthStore\n xScalarDefaultClient: Workspace['x-scalar-default-client']\n items: TraversedEntryType[]\n expandedItems: Record<string, boolean>\n eventBus: WorkspaceEventBus\n environment: XScalarEnvironment\n /** Heading id generator for Markdown headings */\n headingSlugGenerator: (heading: Heading) => string\n }>()\n\n/** Generate all client options so that it can be shared between the top client picker and the operations */\nconst clientOptions = computed(() =>\n generateClientOptions(mapHiddenClientsConfig(options.hiddenClients)),\n)\n\n/** Computed property to get all OpenAPI extension fields from the root document object */\nconst documentExtensions = computed(() => getXKeysFromObject(document))\n\n/** Computed property to get all OpenAPI extension fields from the document's info object */\nconst infoExtensions = computed(() => getXKeysFromObject(document?.info))\n\n/** Compute the servers for the document */\nconst servers = computed(() =>\n getServers(options?.servers ?? document?.servers, {\n baseServerUrl: options?.baseServerURL,\n documentUrl: document?.['x-scalar-original-source-url'],\n }),\n)\n\n/** Compute the selected server for the document only (for now) */\nconst selectedServer = computed(() =>\n getSelectedServer(servers.value, document?.['x-scalar-selected-server']),\n)\n\n/** Merge authentication config with the document security schemes */\nconst securitySchemes = computed(() =>\n mergeSecurity(\n document?.components?.securitySchemes,\n options.authentication?.securitySchemes,\n authStore,\n document?.['x-scalar-navigation']?.name ?? '',\n ),\n)\n\n/** Ensures firstLazyLoadComplete is set for documents with no Lazy sections (e.g. no operations/tags/models). */\nonMounted(() => {\n scheduleInitialLoadComplete()\n})\n</script>\n<template>\n <SectionFlare />\n\n <div class=\"narrow-references-container\">\n <slot name=\"start\" />\n\n <!-- Introduction -->\n\n <InfoBlock\n :id=\"infoSectionId\"\n :documentDownloadType=\"options.documentDownloadType\"\n :documentExtensions\n :documentUrl=\"document?.['x-scalar-original-source-url']\"\n :eventBus\n :externalDocs=\"document?.externalDocs\"\n :headingSlugGenerator\n :info=\"document?.info\"\n :infoExtensions\n :layout=\"options.layout\"\n :oasVersion=\"document?.['x-original-oas-version']\">\n <template #selectors>\n <!-- Server Selector -->\n <ScalarErrorBoundary>\n <IntroductionCardItem\n v-if=\"servers?.length\"\n class=\"scalar-reference-intro-server scalar-client introduction-card-item text-base leading-normal [--scalar-address-bar-height:0px]\">\n <ServerSelector\n :eventBus\n :selectedServer\n :servers />\n </IntroductionCardItem>\n </ScalarErrorBoundary>\n\n <!-- Auth selector -->\n <ScalarErrorBoundary>\n <IntroductionCardItem\n v-if=\"document && !options.hideTestRequestButton\"\n class=\"scalar-reference-intro-auth scalar-client introduction-card-item leading-normal\">\n <Auth\n :authStore\n :document\n :environment\n :eventBus\n :options\n :securitySchemes\n :selectedServer />\n </IntroductionCardItem>\n </ScalarErrorBoundary>\n\n <!-- Client selector -->\n <ScalarErrorBoundary>\n <IntroductionCardItem\n v-if=\"clientOptions.length\"\n class=\"introduction-card-item scalar-reference-intro-clients\">\n <ClientSelector\n class=\"introduction-card-item scalar-reference-intro-clients\"\n :clientOptions\n :eventBus\n :selectedClient=\"xScalarDefaultClient\"\n :xScalarSdkInstallation=\"\n document?.info?.['x-scalar-sdk-installation']\n \" />\n </IntroductionCardItem>\n </ScalarErrorBoundary>\n </template>\n </InfoBlock>\n\n <!-- Render traversed operations and webhooks -->\n <!-- Use recursive component for cleaner rendering -->\n <TraversedEntry\n v-if=\"items.length && document\"\n :authStore\n :clientOptions\n :document\n :entries=\"items\"\n :eventBus\n :expandedItems\n :options\n :securitySchemes\n :selectedClient=\"xScalarDefaultClient\"\n :selectedServer>\n </TraversedEntry>\n\n <!-- Render plugins at content.end view -->\n <RenderPlugins\n :options\n viewName=\"content.end\" />\n\n <slot name=\"end\" />\n <!-- Placeholder content to allow the active item to be scrolled to the top while the rest of the content is lazy loaded -->\n <div\n v-if=\"!firstLazyLoadComplete\"\n class=\"h-dvh\"></div>\n </div>\n</template>\n\n<style>\n.narrow-references-container {\n container-name: narrow-references-container;\n container-type: inline-size;\n}\n</style>\n"],"mappings":""}
1
+ {"version":3,"file":"Content.vue.js","names":[],"sources":["../../../src/components/Content/Content.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { generateClientOptions } from '@scalar/api-client/v2/blocks/operation-code-sample'\nimport { mapHiddenClientsConfig } from '@scalar/api-client/v2/features/modal'\nimport { ScalarErrorBoundary } from '@scalar/components'\nimport type { ApiReferenceConfigurationRaw } from '@scalar/types/api-reference'\nimport type { Heading } from '@scalar/types/legacy'\nimport type { AuthStore } from '@scalar/workspace-store/entities/auth'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport {\n getSelectedServer,\n getServers,\n mergeSecurity,\n} from '@scalar/workspace-store/request-example'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport type { TraversedEntry as TraversedEntryType } from '@scalar/workspace-store/schemas/navigation'\nimport type {\n Workspace,\n WorkspaceDocument,\n} from '@scalar/workspace-store/schemas/workspace'\nimport { computed, onMounted } from 'vue'\n\nimport { ClientSelector } from '@/blocks/scalar-client-selector-block'\nimport { InfoBlock } from '@/blocks/scalar-info-block'\nimport { IntroductionCardItem } from '@/blocks/scalar-info-block/'\nimport { ServerSelector } from '@/blocks/scalar-server-selector-block'\nimport { Auth } from '@/components/Content/Auth'\nimport TraversedEntry from '@/components/Content/Operations/TraversedEntry.vue'\nimport { RenderPlugins } from '@/components/RenderPlugins'\nimport { SectionFlare } from '@/components/SectionFlare'\nimport { getXKeysFromObject } from '@/features/specification-extension'\nimport {\n firstLazyLoadComplete,\n scheduleInitialLoadComplete,\n} from '@/helpers/lazy-bus'\n\nconst { document, items, environment, eventBus, options, authStore } =\n defineProps<{\n infoSectionId: string\n /** The subset of the configuration object required for the content component */\n options: Pick<\n ApiReferenceConfigurationRaw,\n | 'authentication'\n | 'baseServerURL'\n | 'documentDownloadType'\n | 'expandAllResponses'\n | 'hiddenClients'\n | 'hideTestRequestButton'\n | 'layout'\n | 'orderRequiredPropertiesFirst'\n | 'orderSchemaPropertiesBy'\n | 'persistAuth'\n | 'proxyUrl'\n | 'servers'\n | 'showOperationId'\n >\n document: WorkspaceDocument | undefined\n authStore: AuthStore\n xScalarDefaultClient: Workspace['x-scalar-default-client']\n items: TraversedEntryType[]\n expandedItems: Record<string, boolean>\n eventBus: WorkspaceEventBus\n environment: XScalarEnvironment\n /** Heading id generator for Markdown headings */\n headingSlugGenerator: (heading: Heading) => string\n }>()\n\n/** Generate all client options so that it can be shared between the top client picker and the operations */\nconst clientOptions = computed(() =>\n generateClientOptions(mapHiddenClientsConfig(options.hiddenClients)),\n)\n\n/** Computed property to get all OpenAPI extension fields from the root document object */\nconst documentExtensions = computed(() => getXKeysFromObject(document))\n\n/** Computed property to get all OpenAPI extension fields from the document's info object */\nconst infoExtensions = computed(() => getXKeysFromObject(document?.info))\n\n/** Compute the servers for the document */\nconst servers = computed(() =>\n getServers(options?.servers ?? document?.servers, {\n baseServerUrl: options?.baseServerURL,\n documentUrl: document?.['x-scalar-original-source-url'],\n }),\n)\n\n/** Compute the selected server for the document only (for now) */\nconst selectedServer = computed(() =>\n getSelectedServer(document ?? null, null, null, servers.value),\n)\n\n/** Merge authentication config with the document security schemes */\nconst securitySchemes = computed(() =>\n mergeSecurity(\n document?.components?.securitySchemes,\n options.authentication?.securitySchemes,\n authStore,\n document?.['x-scalar-navigation']?.name ?? '',\n ),\n)\n\n/** Ensures firstLazyLoadComplete is set for documents with no Lazy sections (e.g. no operations/tags/models). */\nonMounted(() => {\n scheduleInitialLoadComplete()\n})\n</script>\n<template>\n <SectionFlare />\n\n <div class=\"narrow-references-container\">\n <slot name=\"start\" />\n\n <!-- Introduction -->\n\n <InfoBlock\n :id=\"infoSectionId\"\n :documentDownloadType=\"options.documentDownloadType\"\n :documentExtensions\n :documentUrl=\"document?.['x-scalar-original-source-url']\"\n :eventBus\n :externalDocs=\"document?.externalDocs\"\n :headingSlugGenerator\n :info=\"document?.info\"\n :infoExtensions\n :layout=\"options.layout\"\n :oasVersion=\"document?.['x-original-oas-version']\">\n <template #selectors>\n <!-- Server Selector -->\n <ScalarErrorBoundary>\n <IntroductionCardItem\n v-if=\"servers?.length\"\n class=\"scalar-reference-intro-server scalar-client introduction-card-item text-base leading-normal [--scalar-address-bar-height:0px]\">\n <ServerSelector\n :eventBus\n :selectedServer\n :servers />\n </IntroductionCardItem>\n </ScalarErrorBoundary>\n\n <!-- Auth selector -->\n <ScalarErrorBoundary>\n <IntroductionCardItem\n v-if=\"document && !options.hideTestRequestButton\"\n class=\"scalar-reference-intro-auth scalar-client introduction-card-item leading-normal\">\n <Auth\n :authStore\n :document\n :environment\n :eventBus\n :options\n :securitySchemes\n :selectedServer />\n </IntroductionCardItem>\n </ScalarErrorBoundary>\n\n <!-- Client selector -->\n <ScalarErrorBoundary>\n <IntroductionCardItem\n v-if=\"clientOptions.length\"\n class=\"introduction-card-item scalar-reference-intro-clients\">\n <ClientSelector\n class=\"introduction-card-item scalar-reference-intro-clients\"\n :clientOptions\n :eventBus\n :selectedClient=\"xScalarDefaultClient\"\n :xScalarSdkInstallation=\"\n document?.info?.['x-scalar-sdk-installation']\n \" />\n </IntroductionCardItem>\n </ScalarErrorBoundary>\n </template>\n </InfoBlock>\n\n <!-- Render traversed operations and webhooks -->\n <!-- Use recursive component for cleaner rendering -->\n <TraversedEntry\n v-if=\"items.length && document\"\n :authStore\n :clientOptions\n :document\n :entries=\"items\"\n :eventBus\n :expandedItems\n :options\n :securitySchemes\n :selectedClient=\"xScalarDefaultClient\"\n :selectedServer>\n </TraversedEntry>\n\n <!-- Render plugins at content.end view -->\n <RenderPlugins\n :options\n viewName=\"content.end\" />\n\n <slot name=\"end\" />\n <!-- Placeholder content to allow the active item to be scrolled to the top while the rest of the content is lazy loaded -->\n <div\n v-if=\"!firstLazyLoadComplete\"\n class=\"h-dvh\"></div>\n </div>\n</template>\n\n<style>\n.narrow-references-container {\n container-name: narrow-references-container;\n container-type: inline-size;\n}\n</style>\n"],"mappings":""}
@@ -10,11 +10,9 @@ import RenderPlugins_default from "../RenderPlugins/RenderPlugins.vue.js";
10
10
  import SectionFlare_default from "../SectionFlare/SectionFlare.vue.js";
11
11
  import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, onMounted, openBlock, renderSlot, unref, withCtx } from "vue";
12
12
  import { mapHiddenClientsConfig } from "@scalar/api-client/v2/features/modal";
13
- import { getServers } from "@scalar/api-client/v2/helpers";
14
13
  import { ScalarErrorBoundary } from "@scalar/components";
14
+ import { getSelectedServer, getServers, mergeSecurity } from "@scalar/workspace-store/request-example";
15
15
  import { generateClientOptions } from "@scalar/api-client/v2/blocks/operation-code-sample";
16
- import { mergeSecurity } from "@scalar/api-client/v2/blocks/scalar-auth-selector-block";
17
- import { getSelectedServer } from "@scalar/api-client/v2/features/operation";
18
16
  //#region src/components/Content/Content.vue?vue&type=script&setup=true&lang.ts
19
17
  var _hoisted_1 = { class: "narrow-references-container" };
20
18
  var _hoisted_2 = {
@@ -48,7 +46,7 @@ var Content_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ define
48
46
  documentUrl: __props.document?.["x-scalar-original-source-url"]
49
47
  }));
50
48
  /** Compute the selected server for the document only (for now) */
51
- const selectedServer = computed(() => getSelectedServer(servers.value, __props.document?.["x-scalar-selected-server"]));
49
+ const selectedServer = computed(() => getSelectedServer(__props.document ?? null, null, null, servers.value));
52
50
  /** Merge authentication config with the document security schemes */
53
51
  const securitySchemes = computed(() => mergeSecurity(__props.document?.components?.securitySchemes, __props.options.authentication?.securitySchemes, __props.authStore, __props.document?.["x-scalar-navigation"]?.name ?? ""));
54
52
  /** Ensures firstLazyLoadComplete is set for documents with no Lazy sections (e.g. no operations/tags/models). */
@@ -1 +1 @@
1
- {"version":3,"file":"Content.vue.script.js","names":[],"sources":["../../../src/components/Content/Content.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { generateClientOptions } from '@scalar/api-client/v2/blocks/operation-code-sample'\nimport { mergeSecurity } from '@scalar/api-client/v2/blocks/scalar-auth-selector-block'\nimport { mapHiddenClientsConfig } from '@scalar/api-client/v2/features/modal'\nimport { getSelectedServer } from '@scalar/api-client/v2/features/operation'\nimport { getServers } from '@scalar/api-client/v2/helpers'\nimport { ScalarErrorBoundary } from '@scalar/components'\nimport type { ApiReferenceConfigurationRaw } from '@scalar/types/api-reference'\nimport type { Heading } from '@scalar/types/legacy'\nimport type { AuthStore } from '@scalar/workspace-store/entities/auth'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport type { TraversedEntry as TraversedEntryType } from '@scalar/workspace-store/schemas/navigation'\nimport type {\n Workspace,\n WorkspaceDocument,\n} from '@scalar/workspace-store/schemas/workspace'\nimport { computed, onMounted } from 'vue'\n\nimport { ClientSelector } from '@/blocks/scalar-client-selector-block'\nimport { InfoBlock } from '@/blocks/scalar-info-block'\nimport { IntroductionCardItem } from '@/blocks/scalar-info-block/'\nimport { ServerSelector } from '@/blocks/scalar-server-selector-block'\nimport { Auth } from '@/components/Content/Auth'\nimport TraversedEntry from '@/components/Content/Operations/TraversedEntry.vue'\nimport { RenderPlugins } from '@/components/RenderPlugins'\nimport { SectionFlare } from '@/components/SectionFlare'\nimport { getXKeysFromObject } from '@/features/specification-extension'\nimport {\n firstLazyLoadComplete,\n scheduleInitialLoadComplete,\n} from '@/helpers/lazy-bus'\n\nconst { document, items, environment, eventBus, options, authStore } =\n defineProps<{\n infoSectionId: string\n /** The subset of the configuration object required for the content component */\n options: Pick<\n ApiReferenceConfigurationRaw,\n | 'authentication'\n | 'baseServerURL'\n | 'documentDownloadType'\n | 'expandAllResponses'\n | 'hiddenClients'\n | 'hideTestRequestButton'\n | 'layout'\n | 'orderRequiredPropertiesFirst'\n | 'orderSchemaPropertiesBy'\n | 'persistAuth'\n | 'proxyUrl'\n | 'servers'\n | 'showOperationId'\n >\n document: WorkspaceDocument | undefined\n authStore: AuthStore\n xScalarDefaultClient: Workspace['x-scalar-default-client']\n items: TraversedEntryType[]\n expandedItems: Record<string, boolean>\n eventBus: WorkspaceEventBus\n environment: XScalarEnvironment\n /** Heading id generator for Markdown headings */\n headingSlugGenerator: (heading: Heading) => string\n }>()\n\n/** Generate all client options so that it can be shared between the top client picker and the operations */\nconst clientOptions = computed(() =>\n generateClientOptions(mapHiddenClientsConfig(options.hiddenClients)),\n)\n\n/** Computed property to get all OpenAPI extension fields from the root document object */\nconst documentExtensions = computed(() => getXKeysFromObject(document))\n\n/** Computed property to get all OpenAPI extension fields from the document's info object */\nconst infoExtensions = computed(() => getXKeysFromObject(document?.info))\n\n/** Compute the servers for the document */\nconst servers = computed(() =>\n getServers(options?.servers ?? document?.servers, {\n baseServerUrl: options?.baseServerURL,\n documentUrl: document?.['x-scalar-original-source-url'],\n }),\n)\n\n/** Compute the selected server for the document only (for now) */\nconst selectedServer = computed(() =>\n getSelectedServer(servers.value, document?.['x-scalar-selected-server']),\n)\n\n/** Merge authentication config with the document security schemes */\nconst securitySchemes = computed(() =>\n mergeSecurity(\n document?.components?.securitySchemes,\n options.authentication?.securitySchemes,\n authStore,\n document?.['x-scalar-navigation']?.name ?? '',\n ),\n)\n\n/** Ensures firstLazyLoadComplete is set for documents with no Lazy sections (e.g. no operations/tags/models). */\nonMounted(() => {\n scheduleInitialLoadComplete()\n})\n</script>\n<template>\n <SectionFlare />\n\n <div class=\"narrow-references-container\">\n <slot name=\"start\" />\n\n <!-- Introduction -->\n\n <InfoBlock\n :id=\"infoSectionId\"\n :documentDownloadType=\"options.documentDownloadType\"\n :documentExtensions\n :documentUrl=\"document?.['x-scalar-original-source-url']\"\n :eventBus\n :externalDocs=\"document?.externalDocs\"\n :headingSlugGenerator\n :info=\"document?.info\"\n :infoExtensions\n :layout=\"options.layout\"\n :oasVersion=\"document?.['x-original-oas-version']\">\n <template #selectors>\n <!-- Server Selector -->\n <ScalarErrorBoundary>\n <IntroductionCardItem\n v-if=\"servers?.length\"\n class=\"scalar-reference-intro-server scalar-client introduction-card-item text-base leading-normal [--scalar-address-bar-height:0px]\">\n <ServerSelector\n :eventBus\n :selectedServer\n :servers />\n </IntroductionCardItem>\n </ScalarErrorBoundary>\n\n <!-- Auth selector -->\n <ScalarErrorBoundary>\n <IntroductionCardItem\n v-if=\"document && !options.hideTestRequestButton\"\n class=\"scalar-reference-intro-auth scalar-client introduction-card-item leading-normal\">\n <Auth\n :authStore\n :document\n :environment\n :eventBus\n :options\n :securitySchemes\n :selectedServer />\n </IntroductionCardItem>\n </ScalarErrorBoundary>\n\n <!-- Client selector -->\n <ScalarErrorBoundary>\n <IntroductionCardItem\n v-if=\"clientOptions.length\"\n class=\"introduction-card-item scalar-reference-intro-clients\">\n <ClientSelector\n class=\"introduction-card-item scalar-reference-intro-clients\"\n :clientOptions\n :eventBus\n :selectedClient=\"xScalarDefaultClient\"\n :xScalarSdkInstallation=\"\n document?.info?.['x-scalar-sdk-installation']\n \" />\n </IntroductionCardItem>\n </ScalarErrorBoundary>\n </template>\n </InfoBlock>\n\n <!-- Render traversed operations and webhooks -->\n <!-- Use recursive component for cleaner rendering -->\n <TraversedEntry\n v-if=\"items.length && document\"\n :authStore\n :clientOptions\n :document\n :entries=\"items\"\n :eventBus\n :expandedItems\n :options\n :securitySchemes\n :selectedClient=\"xScalarDefaultClient\"\n :selectedServer>\n </TraversedEntry>\n\n <!-- Render plugins at content.end view -->\n <RenderPlugins\n :options\n viewName=\"content.end\" />\n\n <slot name=\"end\" />\n <!-- Placeholder content to allow the active item to be scrolled to the top while the rest of the content is lazy loaded -->\n <div\n v-if=\"!firstLazyLoadComplete\"\n class=\"h-dvh\"></div>\n </div>\n</template>\n\n<style>\n.narrow-references-container {\n container-name: narrow-references-container;\n container-type: inline-size;\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiEA,MAAM,gBAAgB,eACpB,sBAAsB,uBAAuB,QAAA,QAAQ,cAAc,CAAC,CACtE;;EAGA,MAAM,qBAAqB,eAAe,mBAAmB,QAAA,SAAS,CAAA;;EAGtE,MAAM,iBAAiB,eAAe,mBAAmB,QAAA,UAAU,KAAK,CAAA;;EAGxE,MAAM,UAAU,eACd,WAAW,QAAA,SAAS,WAAW,QAAA,UAAU,SAAS;GAChD,eAAe,QAAA,SAAS;GACxB,aAAa,QAAA,WAAW;GACzB,CAAC,CACJ;;EAGA,MAAM,iBAAiB,eACrB,kBAAkB,QAAQ,OAAO,QAAA,WAAW,4BAA4B,CAC1E;;EAGA,MAAM,kBAAkB,eACtB,cACE,QAAA,UAAU,YAAY,iBACtB,QAAA,QAAQ,gBAAgB,iBACxB,QAAA,WACA,QAAA,WAAW,wBAAwB,QAAQ,GAC5C,CACH;;AAGA,kBAAgB;AACd,gCAA4B;IAC7B;;2DAGC,YAAgB,MAAA,qBAAA,CAAA,EAEhB,mBA0FM,OA1FN,YA0FM;IAzFJ,WAAqB,KAAA,QAAA,QAAA;IAIr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QAAA;KACA,SAAS,QAAA;KACT,UAAA,QAAA;KACA,eAAA,QAAA;KACA,SAAA,QAAA;KACA,iBAAA,gBAAA;KACA,gBAAgB,QAAA;KAChB,gBAAA,eAAA;;;;;;;;;;;;;IAIH,YAE2B,MAAA,sBAAA,EAAA;KADxB,SAAA,QAAA;KACD,UAAS;;IAEX,WAAmB,KAAA,QAAA,MAAA;KAGV,MAAA,sBAAqB,IAAA,WAAA,EAD9B,mBAEsB,OAFtB,WAEsB,IAAA,mBAAA,IAAA,KAAA"}
1
+ {"version":3,"file":"Content.vue.script.js","names":[],"sources":["../../../src/components/Content/Content.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { generateClientOptions } from '@scalar/api-client/v2/blocks/operation-code-sample'\nimport { mapHiddenClientsConfig } from '@scalar/api-client/v2/features/modal'\nimport { ScalarErrorBoundary } from '@scalar/components'\nimport type { ApiReferenceConfigurationRaw } from '@scalar/types/api-reference'\nimport type { Heading } from '@scalar/types/legacy'\nimport type { AuthStore } from '@scalar/workspace-store/entities/auth'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport {\n getSelectedServer,\n getServers,\n mergeSecurity,\n} from '@scalar/workspace-store/request-example'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport type { TraversedEntry as TraversedEntryType } from '@scalar/workspace-store/schemas/navigation'\nimport type {\n Workspace,\n WorkspaceDocument,\n} from '@scalar/workspace-store/schemas/workspace'\nimport { computed, onMounted } from 'vue'\n\nimport { ClientSelector } from '@/blocks/scalar-client-selector-block'\nimport { InfoBlock } from '@/blocks/scalar-info-block'\nimport { IntroductionCardItem } from '@/blocks/scalar-info-block/'\nimport { ServerSelector } from '@/blocks/scalar-server-selector-block'\nimport { Auth } from '@/components/Content/Auth'\nimport TraversedEntry from '@/components/Content/Operations/TraversedEntry.vue'\nimport { RenderPlugins } from '@/components/RenderPlugins'\nimport { SectionFlare } from '@/components/SectionFlare'\nimport { getXKeysFromObject } from '@/features/specification-extension'\nimport {\n firstLazyLoadComplete,\n scheduleInitialLoadComplete,\n} from '@/helpers/lazy-bus'\n\nconst { document, items, environment, eventBus, options, authStore } =\n defineProps<{\n infoSectionId: string\n /** The subset of the configuration object required for the content component */\n options: Pick<\n ApiReferenceConfigurationRaw,\n | 'authentication'\n | 'baseServerURL'\n | 'documentDownloadType'\n | 'expandAllResponses'\n | 'hiddenClients'\n | 'hideTestRequestButton'\n | 'layout'\n | 'orderRequiredPropertiesFirst'\n | 'orderSchemaPropertiesBy'\n | 'persistAuth'\n | 'proxyUrl'\n | 'servers'\n | 'showOperationId'\n >\n document: WorkspaceDocument | undefined\n authStore: AuthStore\n xScalarDefaultClient: Workspace['x-scalar-default-client']\n items: TraversedEntryType[]\n expandedItems: Record<string, boolean>\n eventBus: WorkspaceEventBus\n environment: XScalarEnvironment\n /** Heading id generator for Markdown headings */\n headingSlugGenerator: (heading: Heading) => string\n }>()\n\n/** Generate all client options so that it can be shared between the top client picker and the operations */\nconst clientOptions = computed(() =>\n generateClientOptions(mapHiddenClientsConfig(options.hiddenClients)),\n)\n\n/** Computed property to get all OpenAPI extension fields from the root document object */\nconst documentExtensions = computed(() => getXKeysFromObject(document))\n\n/** Computed property to get all OpenAPI extension fields from the document's info object */\nconst infoExtensions = computed(() => getXKeysFromObject(document?.info))\n\n/** Compute the servers for the document */\nconst servers = computed(() =>\n getServers(options?.servers ?? document?.servers, {\n baseServerUrl: options?.baseServerURL,\n documentUrl: document?.['x-scalar-original-source-url'],\n }),\n)\n\n/** Compute the selected server for the document only (for now) */\nconst selectedServer = computed(() =>\n getSelectedServer(document ?? null, null, null, servers.value),\n)\n\n/** Merge authentication config with the document security schemes */\nconst securitySchemes = computed(() =>\n mergeSecurity(\n document?.components?.securitySchemes,\n options.authentication?.securitySchemes,\n authStore,\n document?.['x-scalar-navigation']?.name ?? '',\n ),\n)\n\n/** Ensures firstLazyLoadComplete is set for documents with no Lazy sections (e.g. no operations/tags/models). */\nonMounted(() => {\n scheduleInitialLoadComplete()\n})\n</script>\n<template>\n <SectionFlare />\n\n <div class=\"narrow-references-container\">\n <slot name=\"start\" />\n\n <!-- Introduction -->\n\n <InfoBlock\n :id=\"infoSectionId\"\n :documentDownloadType=\"options.documentDownloadType\"\n :documentExtensions\n :documentUrl=\"document?.['x-scalar-original-source-url']\"\n :eventBus\n :externalDocs=\"document?.externalDocs\"\n :headingSlugGenerator\n :info=\"document?.info\"\n :infoExtensions\n :layout=\"options.layout\"\n :oasVersion=\"document?.['x-original-oas-version']\">\n <template #selectors>\n <!-- Server Selector -->\n <ScalarErrorBoundary>\n <IntroductionCardItem\n v-if=\"servers?.length\"\n class=\"scalar-reference-intro-server scalar-client introduction-card-item text-base leading-normal [--scalar-address-bar-height:0px]\">\n <ServerSelector\n :eventBus\n :selectedServer\n :servers />\n </IntroductionCardItem>\n </ScalarErrorBoundary>\n\n <!-- Auth selector -->\n <ScalarErrorBoundary>\n <IntroductionCardItem\n v-if=\"document && !options.hideTestRequestButton\"\n class=\"scalar-reference-intro-auth scalar-client introduction-card-item leading-normal\">\n <Auth\n :authStore\n :document\n :environment\n :eventBus\n :options\n :securitySchemes\n :selectedServer />\n </IntroductionCardItem>\n </ScalarErrorBoundary>\n\n <!-- Client selector -->\n <ScalarErrorBoundary>\n <IntroductionCardItem\n v-if=\"clientOptions.length\"\n class=\"introduction-card-item scalar-reference-intro-clients\">\n <ClientSelector\n class=\"introduction-card-item scalar-reference-intro-clients\"\n :clientOptions\n :eventBus\n :selectedClient=\"xScalarDefaultClient\"\n :xScalarSdkInstallation=\"\n document?.info?.['x-scalar-sdk-installation']\n \" />\n </IntroductionCardItem>\n </ScalarErrorBoundary>\n </template>\n </InfoBlock>\n\n <!-- Render traversed operations and webhooks -->\n <!-- Use recursive component for cleaner rendering -->\n <TraversedEntry\n v-if=\"items.length && document\"\n :authStore\n :clientOptions\n :document\n :entries=\"items\"\n :eventBus\n :expandedItems\n :options\n :securitySchemes\n :selectedClient=\"xScalarDefaultClient\"\n :selectedServer>\n </TraversedEntry>\n\n <!-- Render plugins at content.end view -->\n <RenderPlugins\n :options\n viewName=\"content.end\" />\n\n <slot name=\"end\" />\n <!-- Placeholder content to allow the active item to be scrolled to the top while the rest of the content is lazy loaded -->\n <div\n v-if=\"!firstLazyLoadComplete\"\n class=\"h-dvh\"></div>\n </div>\n</template>\n\n<style>\n.narrow-references-container {\n container-name: narrow-references-container;\n container-type: inline-size;\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmEA,MAAM,gBAAgB,eACpB,sBAAsB,uBAAuB,QAAA,QAAQ,cAAc,CAAC,CACtE;;EAGA,MAAM,qBAAqB,eAAe,mBAAmB,QAAA,SAAS,CAAA;;EAGtE,MAAM,iBAAiB,eAAe,mBAAmB,QAAA,UAAU,KAAK,CAAA;;EAGxE,MAAM,UAAU,eACd,WAAW,QAAA,SAAS,WAAW,QAAA,UAAU,SAAS;GAChD,eAAe,QAAA,SAAS;GACxB,aAAa,QAAA,WAAW;GACzB,CAAC,CACJ;;EAGA,MAAM,iBAAiB,eACrB,kBAAkB,QAAA,YAAY,MAAM,MAAM,MAAM,QAAQ,MAAM,CAChE;;EAGA,MAAM,kBAAkB,eACtB,cACE,QAAA,UAAU,YAAY,iBACtB,QAAA,QAAQ,gBAAgB,iBACxB,QAAA,WACA,QAAA,WAAW,wBAAwB,QAAQ,GAC5C,CACH;;AAGA,kBAAgB;AACd,gCAA4B;IAC7B;;2DAGC,YAAgB,MAAA,qBAAA,CAAA,EAEhB,mBA0FM,OA1FN,YA0FM;IAzFJ,WAAqB,KAAA,QAAA,QAAA;IAIrB,YAyDY,MAAA,kBAAA,EAAA;KAxDT,IAAI,QAAA;KACJ,sBAAsB,QAAA,QAAQ;KAC9B,oBAAA,mBAAA;KACA,aAAa,QAAA,WAAQ;KACrB,UAAA,QAAA;KACA,cAAc,QAAA,UAAU;KACxB,sBAAA,QAAA;KACA,MAAM,QAAA,UA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UAAS;;IAEX,WAAmB,KAAA,QAAA,MAAA;KAGV,MAAA,sBAAqB,IAAA,WAAA,EAD9B,mBAEsB,OAFtB,WAEsB,IAAA,mBAAA,IAAA,KAAA"}
@@ -1,9 +1,9 @@
1
1
  import type { ClientOptionGroup } from '@scalar/api-client/v2/blocks/operation-code-sample';
2
- import type { MergedSecuritySchemes } from '@scalar/api-client/v2/blocks/scalar-auth-selector-block';
3
2
  import type { ApiReferenceConfigurationRaw } from '@scalar/types/api-reference';
4
3
  import type { WorkspaceStore } from '@scalar/workspace-store/client';
5
4
  import type { AuthStore } from '@scalar/workspace-store/entities/auth';
6
5
  import type { WorkspaceEventBus } from '@scalar/workspace-store/events';
6
+ import type { MergedSecuritySchemes } from '@scalar/workspace-store/request-example';
7
7
  import type { WorkspaceDocument } from '@scalar/workspace-store/schemas';
8
8
  import type { TraversedEntry } from '@scalar/workspace-store/schemas/navigation';
9
9
  import type { ServerObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
@@ -1 +1 @@
1
- {"version":3,"file":"TraversedEntry.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Operations/TraversedEntry.vue"],"names":[],"mappings":"AA6MA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oDAAoD,CAAA;AAC3F,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yDAAyD,CAAA;AACpG,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,6BAA6B,CAAA;AAC/E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uCAAuC,CAAA;AACtE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAEvE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AACxE,OAAO,KAAK,EACV,cAAc,EAMf,MAAM,4CAA4C,CAAA;AACnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAShG,KAAK,WAAW,GAAG;IACjB,qBAAqB;IACrB,SAAS,EAAE,SAAS,CAAA;IACpB,yBAAyB;IACzB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,kCAAkC;IAClC,OAAO,EAAE,cAAc,EAAE,CAAA;IACzB,0BAA0B;IAC1B,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,+CAA+C;IAC/C,aAAa,EAAE,iBAAiB,EAAE,CAAA;IAClC,kFAAkF;IAClF,OAAO,EAAE,IAAI,CACX,4BAA4B,EAC1B,oBAAoB,GACpB,uBAAuB,GACvB,QAAQ,GACR,8BAA8B,GAC9B,yBAAyB,GACzB,iBAAiB,CACpB,CAAA;IACD,iDAAiD;IACjD,cAAc,EAAE,YAAY,GAAG,IAAI,CAAA;IACnC,wFAAwF;IACxF,eAAe,EAAE,qBAAqB,CAAA;IACtC,sDAAsD;IACtD,cAAc,EAAE,cAAc,CAAC,WAAW,CAAC,CAAC,yBAAyB,CAAC,CAAA;IACtE,iDAAiD;IACjD,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACtC,iDAAiD;IACjD,QAAQ,EAAE,iBAAiB,CAAA;CAC5B,CAAC;AA+SF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"TraversedEntry.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Operations/TraversedEntry.vue"],"names":[],"mappings":"AA+MA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oDAAoD,CAAA;AAC3F,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,6BAA6B,CAAA;AAC/E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uCAAuC,CAAA;AACtE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAEvE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yCAAyC,CAAA;AACpF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AACxE,OAAO,KAAK,EACV,cAAc,EAMf,MAAM,4CAA4C,CAAA;AACnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAShG,KAAK,WAAW,GAAG;IACjB,qBAAqB;IACrB,SAAS,EAAE,SAAS,CAAA;IACpB,yBAAyB;IACzB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,kCAAkC;IAClC,OAAO,EAAE,cAAc,EAAE,CAAA;IACzB,0BAA0B;IAC1B,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,+CAA+C;IAC/C,aAAa,EAAE,iBAAiB,EAAE,CAAA;IAClC,kFAAkF;IAClF,OAAO,EAAE,IAAI,CACX,4BAA4B,EAC1B,oBAAoB,GACpB,uBAAuB,GACvB,QAAQ,GACR,8BAA8B,GAC9B,yBAAyB,GACzB,iBAAiB,CACpB,CAAA;IACD,iDAAiD;IACjD,cAAc,EAAE,YAAY,GAAG,IAAI,CAAA;IACnC,wFAAwF;IACxF,eAAe,EAAE,qBAAqB,CAAA;IACtC,sDAAsD;IACtD,cAAc,EAAE,cAAc,CAAC,WAAW,CAAC,CAAC,yBAAyB,CAAC,CAAA;IACtE,iDAAiD;IACjD,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACtC,iDAAiD;IACjD,QAAQ,EAAE,iBAAiB,CAAA;CAC5B,CAAC;AAiTF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -1 +1 @@
1
- {"version":3,"file":"TraversedEntry.vue.js","names":[],"sources":["../../../../src/components/Content/Operations/TraversedEntry.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { ClientOptionGroup } from '@scalar/api-client/v2/blocks/operation-code-sample'\nimport type { MergedSecuritySchemes } from '@scalar/api-client/v2/blocks/scalar-auth-selector-block'\nimport type { ApiReferenceConfigurationRaw } from '@scalar/types/api-reference'\nimport type { WorkspaceStore } from '@scalar/workspace-store/client'\nimport type { AuthStore } from '@scalar/workspace-store/entities/auth'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport type { WorkspaceDocument } from '@scalar/workspace-store/schemas'\nimport type {\n TraversedEntry,\n TraversedModels,\n TraversedOperation,\n TraversedSchema,\n TraversedTag,\n TraversedWebhook,\n} from '@scalar/workspace-store/schemas/navigation'\nimport type { ServerObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\n\nimport Model from '@/components/Content/Models/Model.vue'\nimport ModelTag from '@/components/Content/Models/ModelTag.vue'\nimport { Tag } from '@/components/Content/Tags'\nimport Lazy from '@/components/Lazy/Lazy.vue'\nimport { SectionContainer } from '@/components/Section'\nimport { Operation } from '@/features/Operation'\n\nconst {\n level = 0,\n clientOptions,\n document,\n authStore,\n entries,\n} = defineProps<{\n /** The auth store */\n authStore: AuthStore\n /** The level of depth */\n level?: number\n /** Traversed entries to render */\n entries: TraversedEntry[]\n /** The document object */\n document: WorkspaceDocument\n /** The http client options for the dropdown */\n clientOptions: ClientOptionGroup[]\n /** The subset of the configuration object required for the operation component */\n options: Pick<\n ApiReferenceConfigurationRaw,\n | 'expandAllResponses'\n | 'hideTestRequestButton'\n | 'layout'\n | 'orderRequiredPropertiesFirst'\n | 'orderSchemaPropertiesBy'\n | 'showOperationId'\n >\n /** Currently selected server for the document */\n selectedServer: ServerObject | null\n /** The merged security schemes for the document and the authentication configuration */\n securitySchemes: MergedSecuritySchemes\n /** Currently selected http client for the document */\n selectedClient: WorkspaceStore['workspace']['x-scalar-default-client']\n /** Used to determine if an entry is collapsed */\n expandedItems: Record<string, boolean>\n /** The event bus for the handling all events. */\n eventBus: WorkspaceEventBus\n}>()\n\n/**\n * Type guards for different entry types\n */\nconst isTagGroup = (\n entry: TraversedEntry,\n): entry is TraversedTag & { isGroup: true } =>\n entry['type'] === 'tag' && entry.isGroup === true\n\nconst isTag = (\n entry: TraversedEntry,\n): entry is TraversedTag & { isGroup: false } =>\n entry['type'] === 'tag' && !isTagGroup(entry) && entry.id !== 'models'\n\nconst isOperation = (entry: TraversedEntry): entry is TraversedOperation =>\n entry['type'] === 'operation'\n\nconst isWebhook = (entry: TraversedEntry): entry is TraversedWebhook =>\n entry['type'] === 'webhook'\n\n/** Models are special form of tag entry */\nconst isModelsTag = (entry: TraversedEntry): entry is TraversedModels =>\n entry['type'] === 'models'\n\nconst isModel = (entry: TraversedEntry): entry is TraversedSchema =>\n entry['type'] === 'model'\n\nfunction getPathValue(entry: TraversedOperation | TraversedWebhook) {\n return isWebhook(entry)\n ? document.webhooks?.[entry.name]\n : document.paths?.[entry.path]\n}\n</script>\n\n<template>\n <!-- The key must be joined with the layout to force a re-render when the layout changes -->\n <!-- Without this we get a timing issue where the lazy bus is reset and the element is not rendered -->\n <Lazy\n v-for=\"entry in entries\"\n :id=\"entry.id\"\n :key=\"`${entry.id}-${options.layout}`\"\n :expanded=\"!!expandedItems[entry.id]\">\n <!-- Operation or Webhook -->\n <SectionContainer\n v-if=\"isOperation(entry) || isWebhook(entry)\"\n :omit=\"level !== 0\">\n <Operation\n :id=\"entry.id\"\n :authStore\n :clientOptions\n :document\n :eventBus\n :isCollapsed=\"!expandedItems[entry.id]\"\n :isWebhook=\"isWebhook(entry)\"\n :method=\"entry.method\"\n :options=\"options\"\n :path=\"isWebhook(entry) ? entry.name : entry.path\"\n :pathValue=\"getPathValue(entry)\"\n :securitySchemes=\"securitySchemes\"\n :selectedClient=\"selectedClient\"\n :server=\"selectedServer\" />\n </SectionContainer>\n\n <!-- Webhook Group or Tag -->\n <Tag\n v-else-if=\"isTag(entry)\"\n :eventBus\n :isCollapsed=\"!expandedItems[entry.id]\"\n :isLoading=\"false\"\n :layout=\"options.layout\"\n :moreThanOneTag=\"entries.filter(isTag).length > 1\"\n :tag=\"entry\">\n <template v-if=\"'children' in entry && entry.children?.length\">\n <TraversedEntry\n :authStore\n :clientOptions\n :document\n :entries=\"entry.children\"\n :eventBus\n :expandedItems\n :level=\"level + 1\"\n :options\n :securitySchemes\n :selectedClient\n :selectedServer>\n </TraversedEntry>\n </template>\n </Tag>\n\n <!-- Tag Group -->\n <TraversedEntry\n v-else-if=\"isTagGroup(entry)\"\n :authStore\n :clientOptions\n :document\n :entries=\"entry.children || []\"\n :eventBus\n :expandedItems\n :level=\"level + 1\"\n :options\n :securitySchemes\n :selectedClient\n :selectedServer>\n </TraversedEntry>\n\n <!-- Models -->\n <ModelTag\n v-else-if=\"isModelsTag(entry) && document.components?.schemas\"\n :id=\"entry.id\"\n :eventBus\n :isCollapsed=\"!expandedItems[entry.id]\"\n :layout=\"options.layout\">\n <TraversedEntry\n :authStore\n :clientOptions\n :document\n :entries=\"entry.children || []\"\n :eventBus\n :expandedItems=\"expandedItems\"\n :level=\"level + 1\"\n :options\n :securitySchemes\n :selectedClient\n :selectedServer>\n </TraversedEntry>\n </ModelTag>\n\n <Model\n v-else-if=\"isModel(entry) && document.components?.schemas?.[entry.name]\"\n :id=\"entry.id\"\n :eventBus\n :isCollapsed=\"!expandedItems[entry.id]\"\n :name=\"entry.name\"\n :options\n :schema=\"getResolvedRef(document.components.schemas[entry.name])\">\n </Model>\n </Lazy>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"TraversedEntry.vue.js","names":[],"sources":["../../../../src/components/Content/Operations/TraversedEntry.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { ClientOptionGroup } from '@scalar/api-client/v2/blocks/operation-code-sample'\nimport type { ApiReferenceConfigurationRaw } from '@scalar/types/api-reference'\nimport type { WorkspaceStore } from '@scalar/workspace-store/client'\nimport type { AuthStore } from '@scalar/workspace-store/entities/auth'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport type { MergedSecuritySchemes } from '@scalar/workspace-store/request-example'\nimport type { WorkspaceDocument } from '@scalar/workspace-store/schemas'\nimport type {\n TraversedEntry,\n TraversedModels,\n TraversedOperation,\n TraversedSchema,\n TraversedTag,\n TraversedWebhook,\n} from '@scalar/workspace-store/schemas/navigation'\nimport type { ServerObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\n\nimport Model from '@/components/Content/Models/Model.vue'\nimport ModelTag from '@/components/Content/Models/ModelTag.vue'\nimport { Tag } from '@/components/Content/Tags'\nimport Lazy from '@/components/Lazy/Lazy.vue'\nimport { SectionContainer } from '@/components/Section'\nimport { Operation } from '@/features/Operation'\n\nconst {\n level = 0,\n clientOptions,\n document,\n authStore,\n entries,\n} = defineProps<{\n /** The auth store */\n authStore: AuthStore\n /** The level of depth */\n level?: number\n /** Traversed entries to render */\n entries: TraversedEntry[]\n /** The document object */\n document: WorkspaceDocument\n /** The http client options for the dropdown */\n clientOptions: ClientOptionGroup[]\n /** The subset of the configuration object required for the operation component */\n options: Pick<\n ApiReferenceConfigurationRaw,\n | 'expandAllResponses'\n | 'hideTestRequestButton'\n | 'layout'\n | 'orderRequiredPropertiesFirst'\n | 'orderSchemaPropertiesBy'\n | 'showOperationId'\n >\n /** Currently selected server for the document */\n selectedServer: ServerObject | null\n /** The merged security schemes for the document and the authentication configuration */\n securitySchemes: MergedSecuritySchemes\n /** Currently selected http client for the document */\n selectedClient: WorkspaceStore['workspace']['x-scalar-default-client']\n /** Used to determine if an entry is collapsed */\n expandedItems: Record<string, boolean>\n /** The event bus for the handling all events. */\n eventBus: WorkspaceEventBus\n}>()\n\n/**\n * Type guards for different entry types\n */\nconst isTagGroup = (\n entry: TraversedEntry,\n): entry is TraversedTag & { isGroup: true } =>\n entry['type'] === 'tag' && entry.isGroup === true\n\nconst isTag = (\n entry: TraversedEntry,\n): entry is TraversedTag & { isGroup: false } =>\n entry['type'] === 'tag' && !isTagGroup(entry) && entry.id !== 'models'\n\nconst isOperation = (entry: TraversedEntry): entry is TraversedOperation =>\n entry['type'] === 'operation'\n\nconst isWebhook = (entry: TraversedEntry): entry is TraversedWebhook =>\n entry['type'] === 'webhook'\n\n/** Models are special form of tag entry */\nconst isModelsTag = (entry: TraversedEntry): entry is TraversedModels =>\n entry['type'] === 'models'\n\nconst isModel = (entry: TraversedEntry): entry is TraversedSchema =>\n entry['type'] === 'model'\n\nfunction getPathValue(entry: TraversedOperation | TraversedWebhook) {\n return isWebhook(entry)\n ? document.webhooks?.[entry.name]\n : document.paths?.[entry.path]\n}\n</script>\n\n<template>\n <!-- The key must be joined with the layout to force a re-render when the layout changes -->\n <!-- Without this we get a timing issue where the lazy bus is reset and the element is not rendered -->\n <Lazy\n v-for=\"entry in entries\"\n :id=\"entry.id\"\n :key=\"`${entry.id}-${options.layout}`\"\n :expanded=\"!!expandedItems[entry.id]\">\n <!-- Operation or Webhook -->\n <SectionContainer\n v-if=\"isOperation(entry) || isWebhook(entry)\"\n :omit=\"level !== 0\">\n <Operation\n :id=\"entry.id\"\n :authStore\n :clientOptions\n :document\n :eventBus\n :isCollapsed=\"!expandedItems[entry.id]\"\n :isWebhook=\"isWebhook(entry)\"\n :method=\"entry.method\"\n :options=\"options\"\n :path=\"isWebhook(entry) ? entry.name : entry.path\"\n :pathValue=\"getPathValue(entry)\"\n :securitySchemes=\"securitySchemes\"\n :selectedClient=\"selectedClient\"\n :server=\"selectedServer\" />\n </SectionContainer>\n\n <!-- Webhook Group, Tag or Tag Group (only in classic layout) -->\n <Tag\n v-else-if=\"\n isTag(entry) || (isTagGroup(entry) && options.layout === 'classic')\n \"\n :eventBus\n :isCollapsed=\"!expandedItems[entry.id]\"\n :isLoading=\"false\"\n :layout=\"options.layout\"\n :moreThanOneTag=\"entries.filter(isTag).length > 1\"\n :tag=\"entry\">\n <template v-if=\"'children' in entry && entry.children?.length\">\n <TraversedEntry\n :authStore\n :clientOptions\n :document\n :entries=\"entry.children\"\n :eventBus\n :expandedItems\n :level=\"level + 1\"\n :options\n :securitySchemes\n :selectedClient\n :selectedServer>\n </TraversedEntry>\n </template>\n </Tag>\n\n <!-- Display tag grop entries for modern layout (flattened) -->\n <TraversedEntry\n v-else-if=\"isTagGroup(entry)\"\n :authStore\n :clientOptions\n :document\n :entries=\"entry.children || []\"\n :eventBus\n :expandedItems\n :level=\"level + 1\"\n :options\n :securitySchemes\n :selectedClient\n :selectedServer>\n </TraversedEntry>\n\n <!-- Models -->\n <ModelTag\n v-else-if=\"isModelsTag(entry) && document.components?.schemas\"\n :id=\"entry.id\"\n :eventBus\n :isCollapsed=\"!expandedItems[entry.id]\"\n :layout=\"options.layout\">\n <TraversedEntry\n :authStore\n :clientOptions\n :document\n :entries=\"entry.children || []\"\n :eventBus\n :expandedItems=\"expandedItems\"\n :level=\"level + 1\"\n :options\n :securitySchemes\n :selectedClient\n :selectedServer>\n </TraversedEntry>\n </ModelTag>\n\n <Model\n v-else-if=\"isModel(entry) && document.components?.schemas?.[entry.name]\"\n :id=\"entry.id\"\n :eventBus\n :isCollapsed=\"!expandedItems[entry.id]\"\n :name=\"entry.name\"\n :options\n :schema=\"getResolvedRef(document.components.schemas[entry.name])\">\n </Model>\n </Lazy>\n</template>\n"],"mappings":""}
@@ -80,7 +80,7 @@ var TraversedEntry_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */
80
80
  "server"
81
81
  ])]),
82
82
  _: 2
83
- }, 1032, ["omit"])) : isTag(entry) ? (openBlock(), createBlock(unref(Tag_default), {
83
+ }, 1032, ["omit"])) : isTag(entry) || isTagGroup(entry) && __props.options.layout === "classic" ? (openBlock(), createBlock(unref(Tag_default), {
84
84
  key: 1,
85
85
  eventBus: __props.eventBus,
86
86
  isCollapsed: !__props.expandedItems[entry.id],
@@ -1 +1 @@
1
- {"version":3,"file":"TraversedEntry.vue.script.js","names":[],"sources":["../../../../src/components/Content/Operations/TraversedEntry.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { ClientOptionGroup } from '@scalar/api-client/v2/blocks/operation-code-sample'\nimport type { MergedSecuritySchemes } from '@scalar/api-client/v2/blocks/scalar-auth-selector-block'\nimport type { ApiReferenceConfigurationRaw } from '@scalar/types/api-reference'\nimport type { WorkspaceStore } from '@scalar/workspace-store/client'\nimport type { AuthStore } from '@scalar/workspace-store/entities/auth'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport type { WorkspaceDocument } from '@scalar/workspace-store/schemas'\nimport type {\n TraversedEntry,\n TraversedModels,\n TraversedOperation,\n TraversedSchema,\n TraversedTag,\n TraversedWebhook,\n} from '@scalar/workspace-store/schemas/navigation'\nimport type { ServerObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\n\nimport Model from '@/components/Content/Models/Model.vue'\nimport ModelTag from '@/components/Content/Models/ModelTag.vue'\nimport { Tag } from '@/components/Content/Tags'\nimport Lazy from '@/components/Lazy/Lazy.vue'\nimport { SectionContainer } from '@/components/Section'\nimport { Operation } from '@/features/Operation'\n\nconst {\n level = 0,\n clientOptions,\n document,\n authStore,\n entries,\n} = defineProps<{\n /** The auth store */\n authStore: AuthStore\n /** The level of depth */\n level?: number\n /** Traversed entries to render */\n entries: TraversedEntry[]\n /** The document object */\n document: WorkspaceDocument\n /** The http client options for the dropdown */\n clientOptions: ClientOptionGroup[]\n /** The subset of the configuration object required for the operation component */\n options: Pick<\n ApiReferenceConfigurationRaw,\n | 'expandAllResponses'\n | 'hideTestRequestButton'\n | 'layout'\n | 'orderRequiredPropertiesFirst'\n | 'orderSchemaPropertiesBy'\n | 'showOperationId'\n >\n /** Currently selected server for the document */\n selectedServer: ServerObject | null\n /** The merged security schemes for the document and the authentication configuration */\n securitySchemes: MergedSecuritySchemes\n /** Currently selected http client for the document */\n selectedClient: WorkspaceStore['workspace']['x-scalar-default-client']\n /** Used to determine if an entry is collapsed */\n expandedItems: Record<string, boolean>\n /** The event bus for the handling all events. */\n eventBus: WorkspaceEventBus\n}>()\n\n/**\n * Type guards for different entry types\n */\nconst isTagGroup = (\n entry: TraversedEntry,\n): entry is TraversedTag & { isGroup: true } =>\n entry['type'] === 'tag' && entry.isGroup === true\n\nconst isTag = (\n entry: TraversedEntry,\n): entry is TraversedTag & { isGroup: false } =>\n entry['type'] === 'tag' && !isTagGroup(entry) && entry.id !== 'models'\n\nconst isOperation = (entry: TraversedEntry): entry is TraversedOperation =>\n entry['type'] === 'operation'\n\nconst isWebhook = (entry: TraversedEntry): entry is TraversedWebhook =>\n entry['type'] === 'webhook'\n\n/** Models are special form of tag entry */\nconst isModelsTag = (entry: TraversedEntry): entry is TraversedModels =>\n entry['type'] === 'models'\n\nconst isModel = (entry: TraversedEntry): entry is TraversedSchema =>\n entry['type'] === 'model'\n\nfunction getPathValue(entry: TraversedOperation | TraversedWebhook) {\n return isWebhook(entry)\n ? document.webhooks?.[entry.name]\n : document.paths?.[entry.path]\n}\n</script>\n\n<template>\n <!-- The key must be joined with the layout to force a re-render when the layout changes -->\n <!-- Without this we get a timing issue where the lazy bus is reset and the element is not rendered -->\n <Lazy\n v-for=\"entry in entries\"\n :id=\"entry.id\"\n :key=\"`${entry.id}-${options.layout}`\"\n :expanded=\"!!expandedItems[entry.id]\">\n <!-- Operation or Webhook -->\n <SectionContainer\n v-if=\"isOperation(entry) || isWebhook(entry)\"\n :omit=\"level !== 0\">\n <Operation\n :id=\"entry.id\"\n :authStore\n :clientOptions\n :document\n :eventBus\n :isCollapsed=\"!expandedItems[entry.id]\"\n :isWebhook=\"isWebhook(entry)\"\n :method=\"entry.method\"\n :options=\"options\"\n :path=\"isWebhook(entry) ? entry.name : entry.path\"\n :pathValue=\"getPathValue(entry)\"\n :securitySchemes=\"securitySchemes\"\n :selectedClient=\"selectedClient\"\n :server=\"selectedServer\" />\n </SectionContainer>\n\n <!-- Webhook Group or Tag -->\n <Tag\n v-else-if=\"isTag(entry)\"\n :eventBus\n :isCollapsed=\"!expandedItems[entry.id]\"\n :isLoading=\"false\"\n :layout=\"options.layout\"\n :moreThanOneTag=\"entries.filter(isTag).length > 1\"\n :tag=\"entry\">\n <template v-if=\"'children' in entry && entry.children?.length\">\n <TraversedEntry\n :authStore\n :clientOptions\n :document\n :entries=\"entry.children\"\n :eventBus\n :expandedItems\n :level=\"level + 1\"\n :options\n :securitySchemes\n :selectedClient\n :selectedServer>\n </TraversedEntry>\n </template>\n </Tag>\n\n <!-- Tag Group -->\n <TraversedEntry\n v-else-if=\"isTagGroup(entry)\"\n :authStore\n :clientOptions\n :document\n :entries=\"entry.children || []\"\n :eventBus\n :expandedItems\n :level=\"level + 1\"\n :options\n :securitySchemes\n :selectedClient\n :selectedServer>\n </TraversedEntry>\n\n <!-- Models -->\n <ModelTag\n v-else-if=\"isModelsTag(entry) && document.components?.schemas\"\n :id=\"entry.id\"\n :eventBus\n :isCollapsed=\"!expandedItems[entry.id]\"\n :layout=\"options.layout\">\n <TraversedEntry\n :authStore\n :clientOptions\n :document\n :entries=\"entry.children || []\"\n :eventBus\n :expandedItems=\"expandedItems\"\n :level=\"level + 1\"\n :options\n :securitySchemes\n :selectedClient\n :selectedServer>\n </TraversedEntry>\n </ModelTag>\n\n <Model\n v-else-if=\"isModel(entry) && document.components?.schemas?.[entry.name]\"\n :id=\"entry.id\"\n :eventBus\n :isCollapsed=\"!expandedItems[entry.id]\"\n :name=\"entry.name\"\n :options\n :schema=\"getResolvedRef(document.components.schemas[entry.name])\">\n </Model>\n </Lazy>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoEA,MAAM,cACJ,UAEA,MAAM,YAAY,SAAS,MAAM,YAAY;EAE/C,MAAM,SACJ,UAEA,MAAM,YAAY,SAAS,CAAC,WAAW,MAAM,IAAI,MAAM,OAAO;EAEhE,MAAM,eAAe,UACnB,MAAM,YAAY;EAEpB,MAAM,aAAa,UACjB,MAAM,YAAY;;EAGpB,MAAM,eAAe,UACnB,MAAM,YAAY;EAEpB,M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OAAO,QAAA,QAAK;OACZ,SAAA,QAAA;OACA,iBAAA,QAAA;OACA,gBAAA,QAAA;OACA,gBAAA,QAAA;;;;;;;;;;;;;;;;;;;;;WAOM,WAAW,MAAK,IAAA,WAAA,EAD7B,YAaiB,2BAAA;;MAXd,WAAA,QAAA;MACA,eAAA,QAAA;MACA,UAAA,QAAA;MACA,SAAS,MAAM,YAAQ,EAAA;MACvB,UAAA,QAAA;MACA,eAAA,QAAA;MACA,OAAO,QAAA,QAAK;MACZ,SAAA,QAAA;MACA,iBAAA,QAAA;MACA,gBAAA,QAAA;MACA,gBAAA,QAAA;;;;;;;;;;;;;WAKU,YAAY,MAAK,IAAK,QAAA,SAAS,YAAY,WAAA,WAAA,EADxD,YAmBW,kBAAA;;MAjBR,IAAI,MAAM;MACV,UAAA,QAAA;MACA,aAAW,CAAG,QAAA,cAAc,MAAM;MAClC,QAAQ,QAAA,QAAQ;;6BAaA,CAZjB,YAYiB,2BAAA;OAXd,WAAA,QAAA;OACA,eAAA,QAAA;OACA,UAAA,QAAA;OACA,SAAS,MAAM,YAAQ,EAAA;OACvB,UAAA,QAAA;OACA,eAAe,QAAA;OACf,OAAO,QAAA,QAAK;OACZ,SAAA,QAAA;OACA,iBAAA,QAAA;OACA,gBAAA,QAAA;OACA,gBAAA,QAAA;;;;;;;;;;;;;;;;;;;;WAKQ,QAAQ,MAAK,IAAK,QAAA,SAAS,YAAY,UAAU,MAAM,SAAA,WAAA,EADpE,YAQQ,eAAA;;MANL,IAAI,MAAM;MACV,UAAA,QAAA;MACA,aAAW,CAAG,QAAA,cAAc,MAAM;MAClC,MAAM,MAAM;MACZ,SAAA,QAAA;MACA,QAAQ,MAAA,eAAc,CAAC,QAAA,SAAS,WAAW,QAAQ,MAAM,MAAI"}
1
+ {"version":3,"file":"TraversedEntry.vue.script.js","names":[],"sources":["../../../../src/components/Content/Operations/TraversedEntry.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { ClientOptionGroup } from '@scalar/api-client/v2/blocks/operation-code-sample'\nimport type { ApiReferenceConfigurationRaw } from '@scalar/types/api-reference'\nimport type { WorkspaceStore } from '@scalar/workspace-store/client'\nimport type { AuthStore } from '@scalar/workspace-store/entities/auth'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport type { MergedSecuritySchemes } from '@scalar/workspace-store/request-example'\nimport type { WorkspaceDocument } from '@scalar/workspace-store/schemas'\nimport type {\n TraversedEntry,\n TraversedModels,\n TraversedOperation,\n TraversedSchema,\n TraversedTag,\n TraversedWebhook,\n} from '@scalar/workspace-store/schemas/navigation'\nimport type { ServerObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\n\nimport Model from '@/components/Content/Models/Model.vue'\nimport ModelTag from '@/components/Content/Models/ModelTag.vue'\nimport { Tag } from '@/components/Content/Tags'\nimport Lazy from '@/components/Lazy/Lazy.vue'\nimport { SectionContainer } from '@/components/Section'\nimport { Operation } from '@/features/Operation'\n\nconst {\n level = 0,\n clientOptions,\n document,\n authStore,\n entries,\n} = defineProps<{\n /** The auth store */\n authStore: AuthStore\n /** The level of depth */\n level?: number\n /** Traversed entries to render */\n entries: TraversedEntry[]\n /** The document object */\n document: WorkspaceDocument\n /** The http client options for the dropdown */\n clientOptions: ClientOptionGroup[]\n /** The subset of the configuration object required for the operation component */\n options: Pick<\n ApiReferenceConfigurationRaw,\n | 'expandAllResponses'\n | 'hideTestRequestButton'\n | 'layout'\n | 'orderRequiredPropertiesFirst'\n | 'orderSchemaPropertiesBy'\n | 'showOperationId'\n >\n /** Currently selected server for the document */\n selectedServer: ServerObject | null\n /** The merged security schemes for the document and the authentication configuration */\n securitySchemes: MergedSecuritySchemes\n /** Currently selected http client for the document */\n selectedClient: WorkspaceStore['workspace']['x-scalar-default-client']\n /** Used to determine if an entry is collapsed */\n expandedItems: Record<string, boolean>\n /** The event bus for the handling all events. */\n eventBus: WorkspaceEventBus\n}>()\n\n/**\n * Type guards for different entry types\n */\nconst isTagGroup = (\n entry: TraversedEntry,\n): entry is TraversedTag & { isGroup: true } =>\n entry['type'] === 'tag' && entry.isGroup === true\n\nconst isTag = (\n entry: TraversedEntry,\n): entry is TraversedTag & { isGroup: false } =>\n entry['type'] === 'tag' && !isTagGroup(entry) && entry.id !== 'models'\n\nconst isOperation = (entry: TraversedEntry): entry is TraversedOperation =>\n entry['type'] === 'operation'\n\nconst isWebhook = (entry: TraversedEntry): entry is TraversedWebhook =>\n entry['type'] === 'webhook'\n\n/** Models are special form of tag entry */\nconst isModelsTag = (entry: TraversedEntry): entry is TraversedModels =>\n entry['type'] === 'models'\n\nconst isModel = (entry: TraversedEntry): entry is TraversedSchema =>\n entry['type'] === 'model'\n\nfunction getPathValue(entry: TraversedOperation | TraversedWebhook) {\n return isWebhook(entry)\n ? document.webhooks?.[entry.name]\n : document.paths?.[entry.path]\n}\n</script>\n\n<template>\n <!-- The key must be joined with the layout to force a re-render when the layout changes -->\n <!-- Without this we get a timing issue where the lazy bus is reset and the element is not rendered -->\n <Lazy\n v-for=\"entry in entries\"\n :id=\"entry.id\"\n :key=\"`${entry.id}-${options.layout}`\"\n :expanded=\"!!expandedItems[entry.id]\">\n <!-- Operation or Webhook -->\n <SectionContainer\n v-if=\"isOperation(entry) || isWebhook(entry)\"\n :omit=\"level !== 0\">\n <Operation\n :id=\"entry.id\"\n :authStore\n :clientOptions\n :document\n :eventBus\n :isCollapsed=\"!expandedItems[entry.id]\"\n :isWebhook=\"isWebhook(entry)\"\n :method=\"entry.method\"\n :options=\"options\"\n :path=\"isWebhook(entry) ? entry.name : entry.path\"\n :pathValue=\"getPathValue(entry)\"\n :securitySchemes=\"securitySchemes\"\n :selectedClient=\"selectedClient\"\n :server=\"selectedServer\" />\n </SectionContainer>\n\n <!-- Webhook Group, Tag or Tag Group (only in classic layout) -->\n <Tag\n v-else-if=\"\n isTag(entry) || (isTagGroup(entry) && options.layout === 'classic')\n \"\n :eventBus\n :isCollapsed=\"!expandedItems[entry.id]\"\n :isLoading=\"false\"\n :layout=\"options.layout\"\n :moreThanOneTag=\"entries.filter(isTag).length > 1\"\n :tag=\"entry\">\n <template v-if=\"'children' in entry && entry.children?.length\">\n <TraversedEntry\n :authStore\n :clientOptions\n :document\n :entries=\"entry.children\"\n :eventBus\n :expandedItems\n :level=\"level + 1\"\n :options\n :securitySchemes\n :selectedClient\n :selectedServer>\n </TraversedEntry>\n </template>\n </Tag>\n\n <!-- Display tag grop entries for modern layout (flattened) -->\n <TraversedEntry\n v-else-if=\"isTagGroup(entry)\"\n :authStore\n :clientOptions\n :document\n :entries=\"entry.children || []\"\n :eventBus\n :expandedItems\n :level=\"level + 1\"\n :options\n :securitySchemes\n :selectedClient\n :selectedServer>\n </TraversedEntry>\n\n <!-- Models -->\n <ModelTag\n v-else-if=\"isModelsTag(entry) && document.components?.schemas\"\n :id=\"entry.id\"\n :eventBus\n :isCollapsed=\"!expandedItems[entry.id]\"\n :layout=\"options.layout\">\n <TraversedEntry\n :authStore\n :clientOptions\n :document\n :entries=\"entry.children || []\"\n :eventBus\n :expandedItems=\"expandedItems\"\n :level=\"level + 1\"\n :options\n :securitySchemes\n :selectedClient\n :selectedServer>\n </TraversedEntry>\n </ModelTag>\n\n <Model\n v-else-if=\"isModel(entry) && document.components?.schemas?.[entry.name]\"\n :id=\"entry.id\"\n :eventBus\n :isCollapsed=\"!expandedItems[entry.id]\"\n :name=\"entry.name\"\n :options\n :schema=\"getResolvedRef(document.components.schemas[entry.name])\">\n </Model>\n </Lazy>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoEA,MAAM,cACJ,UAEA,MAAM,YAAY,SAAS,MAAM,YAAY;EAE/C,MAAM,SACJ,UAEA,MAAM,YAAY,SAAS,CAAC,WAAW,MAAM,IAAI,MAAM,OAAO;EAEhE,MAAM,eAAe,UACnB,MAAM,YAAY;EAEpB,MAAM,aAAa,UACjB,MAAM,YAAY;;EAGpB,MAAM,e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":["../../../../../src/components/Content/Tags/components/ClassicLayout.vue"],"names":[],"mappings":"AA+DA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AACvE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4CAA4C,CAAA;AAS9E,KAAK,WAAW,GAAG;IACjB,GAAG,EAAE,YAAY,CAAA;IACjB,WAAW,EAAE,OAAO,CAAA;IACpB,QAAQ,EAAE,iBAAiB,GAAG,IAAI,CAAA;CACnC,CAAC;AAoIF,QAAA,IAAI,QAAQ,IAAY,CAAE;AAC1B,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,CAAC;AAKhD,QAAA,MAAM,UAAU,kSAEd,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AACzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"ClassicLayout.vue.d.ts","sourceRoot":"","sources":["../../../../../src/components/Content/Tags/components/ClassicLayout.vue"],"names":[],"mappings":"AA2FA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AACvE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4CAA4C,CAAA;AAS9E,KAAK,WAAW,GAAG;IACjB,GAAG,EAAE,YAAY,CAAA;IACjB,WAAW,EAAE,OAAO,CAAA;IACpB,QAAQ,EAAE,iBAAiB,GAAG,IAAI,CAAA;CACnC,CAAC;AAmJF,QAAA,IAAI,QAAQ,IAAY,CAAE;AAC1B,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,CAAC;AAKhD,QAAA,MAAM,UAAU,kSAEd,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AACzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
@@ -2,7 +2,7 @@ import _plugin_vue_export_helper_default from "../../../../_virtual/_plugin-vue_
2
2
  import ClassicLayout_vue_vue_type_script_setup_true_lang_default from "./ClassicLayout.vue.script.js";
3
3
  /* empty css */
4
4
  //#region src/components/Content/Tags/components/ClassicLayout.vue
5
- var ClassicLayout_default = /* @__PURE__ */ _plugin_vue_export_helper_default(ClassicLayout_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-1124be5d"]]);
5
+ var ClassicLayout_default = /* @__PURE__ */ _plugin_vue_export_helper_default(ClassicLayout_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-d4f47ce7"]]);
6
6
  //#endregion
7
7
  export { ClassicLayout_default as default };
8
8
 
@@ -1 +1 @@
1
- {"version":3,"file":"ClassicLayout.vue.js","names":[],"sources":["../../../../../src/components/Content/Tags/components/ClassicLayout.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarMarkdown } from '@scalar/components'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport type { TraversedTag } from '@scalar/workspace-store/schemas/navigation'\n\nimport { Anchor } from '@/components/Anchor'\nimport {\n SectionContainerAccordion,\n SectionHeader,\n SectionHeaderTag,\n} from '@/components/Section'\n\nconst { tag, isCollapsed } = defineProps<{\n tag: TraversedTag\n isCollapsed: boolean\n eventBus: WorkspaceEventBus | null\n}>()\n</script>\n\n<template>\n <SectionContainerAccordion\n :aria-label=\"tag.title\"\n class=\"tag-section\"\n :modelValue=\"!isCollapsed\"\n @update:modelValue=\"\n (value) => eventBus?.emit('toggle:nav-item', { id: tag.id, open: value })\n \">\n <template #title>\n <SectionHeader class=\"tag-name\">\n <Anchor\n @copyAnchorUrl=\"\n () => eventBus?.emit('copy-url:nav-item', { id: tag.id })\n \">\n <SectionHeaderTag :level=\"2\">\n {{ tag.title }}\n </SectionHeaderTag>\n </Anchor>\n </SectionHeader>\n <ScalarMarkdown\n class=\"tag-description\"\n :value=\"tag?.description\"\n withImages />\n </template>\n <slot />\n </SectionContainerAccordion>\n</template>\n\n<style scoped>\n.tag-section {\n margin-bottom: 48px;\n}\n.tag-name {\n text-transform: capitalize;\n}\n.tag-description {\n padding-bottom: 4px;\n text-align: left;\n}\n</style>\n"],"mappings":""}
1
+ {"version":3,"file":"ClassicLayout.vue.js","names":[],"sources":["../../../../../src/components/Content/Tags/components/ClassicLayout.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarMarkdown } from '@scalar/components'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport type { TraversedTag } from '@scalar/workspace-store/schemas/navigation'\n\nimport { Anchor } from '@/components/Anchor'\nimport {\n SectionContainerAccordion,\n SectionHeader,\n SectionHeaderTag,\n} from '@/components/Section'\n\nconst { tag, isCollapsed } = defineProps<{\n tag: TraversedTag\n isCollapsed: boolean\n eventBus: WorkspaceEventBus | null\n}>()\n</script>\n\n<template>\n <SectionContainerAccordion\n :aria-label=\"tag.title\"\n class=\"tag-section\"\n :class=\"{ 'tag-section-group': tag.isGroup }\"\n :modelValue=\"!isCollapsed\"\n @update:modelValue=\"\n (value) => eventBus?.emit('toggle:nav-item', { id: tag.id, open: value })\n \">\n <template #title>\n <SectionHeader\n class=\"tag-name\"\n :class=\"{ 'tag-group-name': tag.isGroup }\">\n <Anchor\n @copyAnchorUrl=\"\n () => eventBus?.emit('copy-url:nav-item', { id: tag.id })\n \">\n <SectionHeaderTag :level=\"2\">\n {{ tag.title }}\n </SectionHeaderTag>\n </Anchor>\n </SectionHeader>\n <ScalarMarkdown\n class=\"tag-description\"\n :value=\"tag?.description\"\n withImages />\n </template>\n <slot />\n </SectionContainerAccordion>\n</template>\n\n<style scoped>\n.tag-section {\n margin-bottom: 48px;\n}\n.tag-name {\n text-transform: capitalize;\n}\n.tag-description {\n padding-bottom: 4px;\n text-align: left;\n}\n\n/* Tag Groups */\n.tag-section-group .tag-group-name {\n gap: 12px;\n align-self: stretch;\n grid-template-columns: auto 1fr;\n}\n.tag-group-name:after {\n content: '';\n display: block;\n height: 1px;\n align-self: center;\n background: var(--scalar-border-color);\n}\n.tag-group-name:has(* > *:hover),\n.tag-group-name:has(:focus-visible) {\n gap: 32px;\n}\n.tag-section-group .tag-section {\n padding-inline: 0;\n margin-bottom: 24px;\n}\n.tag-section-group .tag-section:last-of-type {\n margin-bottom: 0;\n}\n</style>\n"],"mappings":""}
@@ -2,7 +2,7 @@ import SectionContainerAccordion_default from "../../../Section/SectionContainer
2
2
  import SectionHeader_default from "../../../Section/SectionHeader.vue.js";
3
3
  import SectionHeaderTag_default from "../../../Section/SectionHeaderTag.vue.js";
4
4
  import Anchor_default from "../../../Anchor/Anchor.vue.js";
5
- import { createBlock, createTextVNode, createVNode, defineComponent, openBlock, renderSlot, toDisplayString, unref, withCtx } from "vue";
5
+ import { createBlock, createTextVNode, createVNode, defineComponent, normalizeClass, openBlock, renderSlot, toDisplayString, unref, withCtx } from "vue";
6
6
  import { ScalarMarkdown } from "@scalar/components";
7
7
  //#region src/components/Content/Tags/components/ClassicLayout.vue?vue&type=script&setup=true&lang.ts
8
8
  var ClassicLayout_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
@@ -16,14 +16,14 @@ var ClassicLayout_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */
16
16
  return (_ctx, _cache) => {
17
17
  return openBlock(), createBlock(unref(SectionContainerAccordion_default), {
18
18
  "aria-label": __props.tag.title,
19
- class: "tag-section",
19
+ class: normalizeClass(["tag-section", { "tag-section-group": __props.tag.isGroup }]),
20
20
  modelValue: !__props.isCollapsed,
21
21
  "onUpdate:modelValue": _cache[1] || (_cache[1] = (value) => __props.eventBus?.emit("toggle:nav-item", {
22
22
  id: __props.tag.id,
23
23
  open: value
24
24
  }))
25
25
  }, {
26
- title: withCtx(() => [createVNode(unref(SectionHeader_default), { class: "tag-name" }, {
26
+ title: withCtx(() => [createVNode(unref(SectionHeader_default), { class: normalizeClass(["tag-name", { "tag-group-name": __props.tag.isGroup }]) }, {
27
27
  default: withCtx(() => [createVNode(unref(Anchor_default), { onCopyAnchorUrl: _cache[0] || (_cache[0] = () => __props.eventBus?.emit("copy-url:nav-item", { id: __props.tag.id })) }, {
28
28
  default: withCtx(() => [createVNode(unref(SectionHeaderTag_default), { level: 2 }, {
29
29
  default: withCtx(() => [createTextVNode(toDisplayString(__props.tag.title), 1)]),
@@ -32,14 +32,18 @@ var ClassicLayout_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */
32
32
  _: 1
33
33
  })]),
34
34
  _: 1
35
- }), createVNode(unref(ScalarMarkdown), {
35
+ }, 8, ["class"]), createVNode(unref(ScalarMarkdown), {
36
36
  class: "tag-description",
37
37
  value: __props.tag?.description,
38
38
  withImages: ""
39
39
  }, null, 8, ["value"])]),
40
40
  default: withCtx(() => [renderSlot(_ctx.$slots, "default", {}, void 0, true)]),
41
41
  _: 3
42
- }, 8, ["aria-label", "modelValue"]);
42
+ }, 8, [
43
+ "aria-label",
44
+ "class",
45
+ "modelValue"
46
+ ]);
43
47
  };
44
48
  }
45
49
  });
@@ -1 +1 @@
1
- {"version":3,"file":"ClassicLayout.vue.script.js","names":[],"sources":["../../../../../src/components/Content/Tags/components/ClassicLayout.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarMarkdown } from '@scalar/components'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport type { TraversedTag } from '@scalar/workspace-store/schemas/navigation'\n\nimport { Anchor } from '@/components/Anchor'\nimport {\n SectionContainerAccordion,\n SectionHeader,\n SectionHeaderTag,\n} from '@/components/Section'\n\nconst { tag, isCollapsed } = defineProps<{\n tag: TraversedTag\n isCollapsed: boolean\n eventBus: WorkspaceEventBus | null\n}>()\n</script>\n\n<template>\n <SectionContainerAccordion\n :aria-label=\"tag.title\"\n class=\"tag-section\"\n :modelValue=\"!isCollapsed\"\n @update:modelValue=\"\n (value) => eventBus?.emit('toggle:nav-item', { id: tag.id, open: value })\n \">\n <template #title>\n <SectionHeader class=\"tag-name\">\n <Anchor\n @copyAnchorUrl=\"\n () => eventBus?.emit('copy-url:nav-item', { id: tag.id })\n \">\n <SectionHeaderTag :level=\"2\">\n {{ tag.title }}\n </SectionHeaderTag>\n </Anchor>\n </SectionHeader>\n <ScalarMarkdown\n class=\"tag-description\"\n :value=\"tag?.description\"\n withImages />\n </template>\n <slot />\n </SectionContainerAccordion>\n</template>\n\n<style scoped>\n.tag-section {\n margin-bottom: 48px;\n}\n.tag-name {\n text-transform: capitalize;\n}\n.tag-description {\n padding-bottom: 4px;\n text-align: left;\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;uBAoBE,YAwB4B,MAAA,kCAAA,EAAA;IAvBzB,cAAY,QAAA,IAAI;IACjB,OAAM;IACL,YAAU,CAAG,QAAA;IACb,uBAAiB,OAAA,OAAA,OAAA,MAAU,UAAU,QAAA,UAAU,KAAI,mBAAA;KAAA,IAA0B,QAAA,IAAI;KAAE,MAAQ;KAAK,CAAA;;IAGtF,OAAK,cAUE,CAThB,YASgB,MAAA,sBAAA,EAAA,EATD,OAAM,YAAU,EAAA;4BAQpB,CAPT,YAOS,MAAA,eAAA,EAAA,EANN,iBAAa,OAAA,OAAA,OAAA,WAAqB,QAAA,UAAU,KAAI,qBAAA,EAAA,IAA4B,QAAA,IAAI,IAAE,CAAA,GAAA,EAAA;6BAKhE,CAFnB,YAEmB,MAAA,yBAAA,EAAA,EAFA,OAAO,GAAC,EAAA;8BACV,CAAA,gBAAA,gBAAZ,QAAA,IAAI,MAAK,EAAA,EAAA,CAAA,CAAA;;;;;;QAIlB,YAGe,MAAA,eAAA,EAAA;KAFb,OAAM;KACL,OAAO,QAAA,KAAK;KACb,YAAA;;2BAEI,CAAR,WAAQ,KAAA,QAAA,WAAA,EAAA,EAAA,KAAA,GAAA,KAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"ClassicLayout.vue.script.js","names":[],"sources":["../../../../../src/components/Content/Tags/components/ClassicLayout.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarMarkdown } from '@scalar/components'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport type { TraversedTag } from '@scalar/workspace-store/schemas/navigation'\n\nimport { Anchor } from '@/components/Anchor'\nimport {\n SectionContainerAccordion,\n SectionHeader,\n SectionHeaderTag,\n} from '@/components/Section'\n\nconst { tag, isCollapsed } = defineProps<{\n tag: TraversedTag\n isCollapsed: boolean\n eventBus: WorkspaceEventBus | null\n}>()\n</script>\n\n<template>\n <SectionContainerAccordion\n :aria-label=\"tag.title\"\n class=\"tag-section\"\n :class=\"{ 'tag-section-group': tag.isGroup }\"\n :modelValue=\"!isCollapsed\"\n @update:modelValue=\"\n (value) => eventBus?.emit('toggle:nav-item', { id: tag.id, open: value })\n \">\n <template #title>\n <SectionHeader\n class=\"tag-name\"\n :class=\"{ 'tag-group-name': tag.isGroup }\">\n <Anchor\n @copyAnchorUrl=\"\n () => eventBus?.emit('copy-url:nav-item', { id: tag.id })\n \">\n <SectionHeaderTag :level=\"2\">\n {{ tag.title }}\n </SectionHeaderTag>\n </Anchor>\n </SectionHeader>\n <ScalarMarkdown\n class=\"tag-description\"\n :value=\"tag?.description\"\n withImages />\n </template>\n <slot />\n </SectionContainerAccordion>\n</template>\n\n<style scoped>\n.tag-section {\n margin-bottom: 48px;\n}\n.tag-name {\n text-transform: capitalize;\n}\n.tag-description {\n padding-bottom: 4px;\n text-align: left;\n}\n\n/* Tag Groups */\n.tag-section-group .tag-group-name {\n gap: 12px;\n align-self: stretch;\n grid-template-columns: auto 1fr;\n}\n.tag-group-name:after {\n content: '';\n display: block;\n height: 1px;\n align-self: center;\n background: var(--scalar-border-color);\n}\n.tag-group-name:has(* > *:hover),\n.tag-group-name:has(:focus-visible) {\n gap: 32px;\n}\n.tag-section-group .tag-section {\n padding-inline: 0;\n margin-bottom: 24px;\n}\n.tag-section-group .tag-section:last-of-type {\n margin-bottom: 0;\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;uBAoBE,YA2B4B,MAAA,kCAAA,EAAA;IA1BzB,cAAY,QAAA,IAAI;IACjB,OAAK,eAAA,CAAC,eAAa,EAAA,qBACY,QAAA,IAAI,SAAO,CAAA,CAAA;IACzC,YAAU,CAAG,QAAA;IACb,uBAAiB,OAAA,OAAA,OAAA,MAAU,UAAU,QAAA,UAAU,KAAI,mBAAA;KAAA,IAA0B,QAAA,IAAI;KAAE,MAAQ;KAAK,CAAA;;IAGtF,OAAK,cAYE,CAXhB,YAWgB,MAAA,sBAAA,EAAA,EAVd,OAAK,eAAA,CAAC,YAAU,EAAA,kBACY,QAAA,IAAI,SAAO,CAAA,CAAA,EAAA,EAAA;4BAQ9B,CAPT,YAOS,MAAA,eAAA,EAAA,EANN,iBAAa,OAAA,OAAA,OAAA,WAAqB,QAAA,UAAU,KAAI,qBAAA,EAAA,IAA4B,QAAA,IAAI,IAAE,CAAA,GAAA,EAAA;6BAKhE,CAFnB,YAEmB,MAAA,yBAAA,EAAA,EAFA,OAAO,GAAC,EAAA;8BACV,CAAA,gBAAA,gBAAZ,QAAA,IAAI,MAAK,EAAA,EAAA,CAAA,CAAA;;;;;;sBAIlB,YAGe,MAAA,eAAA,EAAA;KAFb,OAAM;KACL,OAAO,QAAA,KAAK;KACb,YAAA;;2BAEI,CAAR,WAAQ,KAAA,QAAA,WAAA,EAAA,EAAA,KAAA,GAAA,KAAA,CAAA,CAAA"}
@@ -1,10 +1,10 @@
1
1
  import type { ClientOptionGroup } from '@scalar/api-client/v2/blocks/operation-code-sample';
2
- import type { MergedSecuritySchemes } from '@scalar/api-client/v2/blocks/scalar-auth-selector-block';
3
2
  import type { HttpMethod } from '@scalar/helpers/http/http-methods';
4
3
  import type { ApiReferenceConfigurationRaw } from '@scalar/types/api-reference';
5
4
  import type { WorkspaceStore } from '@scalar/workspace-store/client';
6
5
  import type { AuthStore } from '@scalar/workspace-store/entities/auth';
7
6
  import type { WorkspaceEventBus } from '@scalar/workspace-store/events';
7
+ import { type MergedSecuritySchemes } from '@scalar/workspace-store/request-example';
8
8
  import type { OpenApiDocument, PathItemObject, ServerObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
9
9
  /**
10
10
  * References Operation "block"
@@ -1 +1 @@
1
- {"version":3,"file":"Operation.vue.d.ts","sourceRoot":"","sources":["../../../src/features/Operation/Operation.vue"],"names":[],"mappings":"AAuKA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oDAAoD,CAAA;AAC3F,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yDAAyD,CAAA;AAEpG,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AACnE,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,6BAA6B,CAAA;AAC/E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uCAAuC,CAAA;AACtE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAEvE,OAAO,KAAK,EACV,eAAe,EACf,cAAc,EACd,YAAY,EACb,MAAM,8DAA8D,CAAA;AAUrE;;GAEG;wBACkB,OAAO,YAAY;AAAxC,wBAAyC;AAIzC,MAAM,MAAM,cAAc,GAAG;IAC3B,EAAE,EAAE,MAAM,CAAA;IACV,MAAM,EAAE,UAAU,CAAA;IAClB,kFAAkF;IAClF,OAAO,EAAE,IAAI,CACX,4BAA4B,EAC1B,oBAAoB,GACpB,uBAAu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d,YAAY,EACb,MAAM,8DAA8D,CAAA;AAUrE;;GAEG;wBACkB,OAAO,YAAY;AAAxC,wBAAyC;AAIzC,MAAM,MAAM,cAAc,GAAG;IAC3B,EAAE,EAAE,MAAM,CAAA;IACV,MAAM,EAAE,UAAU,CAAA;IAClB,kFAAkF;IAClF,OAAO,EAAE,IAAI,CACX,4BAA4B,EAC1B,oBAAoB,GACpB,uBAAuB,GACvB,QAAQ,GACR,8BAA8B,GAC9B,yBAAyB,GACzB,iBAAiB,CACpB,CAAA;IACD,sBAAsB;IACtB,QAAQ,EAAE,eAAe,CAAA;IACzB,8DAA8D;IAC9D,IAAI,EAAE,MAAM,CAAA;IACZ,0DAA0D;IAC1D,SAAS,EAAE,cAAc,GAAG,SAAS,CAAA;IACrC,iDAAiD;IACjD,MAAM,EAAE,YAAY,GAAG,IAAI,CAAA;IAC3B,wFAAwF;IACxF,eAAe,EAAE,qBAAqB,CAAA;IACtC,+CAA+C;IAC/C,aAAa,EAAE,iBAAiB,EAAE,CAAA;IAClC,wDAAwD;IACxD,WAAW,EAAE,OAAO,CAAA;IACpB,yCAAyC;IACzC,SAAS,EAAE,OAAO,CAAA;IAClB,qDAAqD;IACrD,cAAc,EAAE,cAAc,CAAC,WAAW,CAAC,CAAC,yBAAyB,CAAC,CAAA;IACtE,oBAAoB;IACpB,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,qBAAqB;IACrB,SAAS,EAAE,SAAS,CAAA;CACrB,CAAA;AACD,QAAA,MAAM,YAAY,wSAmKd,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Operation.vue.js","names":[],"sources":["../../../src/features/Operation/Operation.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * References Operation \"block\"\n */\nexport default {}\n\nexport type OperationProps = {\n id: string\n method: HttpMethod\n /** The subset of the configuration object required for the operation component */\n options: Pick<\n ApiReferenceConfigurationRaw,\n | 'expandAllResponses'\n | 'hideTestRequestButton'\n | 'layout'\n | 'orderRequiredPropertiesFirst'\n | 'orderSchemaPropertiesBy'\n | 'showOperationId'\n >\n /** Document object */\n document: OpenApiDocument\n /** Key of the operations path in the document.paths object */\n path: string\n /** OpenAPI path object that will include the operation */\n pathValue: PathItemObject | undefined\n /** Currently selected server for the document */\n server: ServerObject | null\n /** The merged security schemes for the document and the authentication configuration */\n securitySchemes: MergedSecuritySchemes\n /** The http client options for the dropdown */\n clientOptions: ClientOptionGroup[]\n /** Whether the Classic layout operation is collapsed */\n isCollapsed: boolean\n /** Whether the operation is a webhook */\n isWebhook: boolean\n /** The currently selected client for the document */\n selectedClient: WorkspaceStore['workspace']['x-scalar-default-client']\n /** The event bus */\n eventBus: WorkspaceEventBus\n /** The auth store */\n authStore: AuthStore\n}\n</script>\n\n<script lang=\"ts\" setup>\nimport type { ClientOptionGroup } from '@scalar/api-client/v2/blocks/operation-code-sample'\nimport type { MergedSecuritySchemes } from '@scalar/api-client/v2/blocks/scalar-auth-selector-block'\nimport { combineParams } from '@scalar/api-client/v2/features/operation'\nimport type { HttpMethod } from '@scalar/helpers/http/http-methods'\nimport type { ApiReferenceConfigurationRaw } from '@scalar/types/api-reference'\nimport type { WorkspaceStore } from '@scalar/workspace-store/client'\nimport type { AuthStore } from '@scalar/workspace-store/entities/auth'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport type {\n OpenApiDocument,\n PathItemObject,\n ServerObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed } from 'vue'\n\nimport { filterSelectedSecurity } from '@/features/Operation/helpers/filter-selected-security'\n\nimport { getFirstServer } from './helpers/get-first-server'\nimport ClassicLayout from './layouts/ClassicLayout.vue'\nimport ModernLayout from './layouts/ModernLayout.vue'\n\nconst {\n authStore,\n clientOptions,\n document,\n eventBus,\n isCollapsed,\n isWebhook,\n method,\n options,\n path,\n pathValue,\n securitySchemes,\n server,\n} = defineProps<OperationProps>()\n\n/**\n * Operation from the new workspace store, ensure we are de-reference\n *\n * Also adds in params from the pathItemObject\n */\nconst operation = computed(() => {\n const entity = getResolvedRef(pathValue?.[method])\n\n if (!entity) {\n return null\n }\n\n // Combine params from the pathItem and the operation\n const parameters = combineParams(pathValue?.parameters, entity.parameters)\n return { ...entity, parameters }\n})\n\n/**\n * Determine the effective server for the code examples.\n */\nconst selectedServer = computed<ServerObject | null>(() =>\n getFirstServer(\n // 1) Operation\n operation.value?.servers ?? null,\n // 2) Path Item\n pathValue?.servers ?? null,\n // 3) Document\n server,\n ),\n)\n\n/** We must ensure the selected security schemes are required on this operation */\nconst selectedSecuritySchemes = computed(() =>\n filterSelectedSecurity(\n document,\n operation.value,\n authStore.getAuthSelectedSchemas({\n type: 'document',\n documentName: document?.['x-scalar-navigation']?.name ?? '',\n }),\n authStore.getAuthSelectedSchemas({\n type: 'operation',\n documentName: document?.['x-scalar-navigation']?.name ?? '',\n path,\n method,\n }),\n securitySchemes,\n ),\n)\n</script>\n\n<template>\n <template v-if=\"operation\">\n <ClassicLayout\n v-if=\"options.layout === 'classic'\"\n :id\n :clientOptions\n :eventBus\n :isCollapsed\n :isWebhook\n :method\n :operation\n :options\n :path\n :selectedClient\n :selectedSecuritySchemes\n :selectedServer />\n <ModernLayout\n v-else\n :id\n :clientOptions\n :eventBus\n :isWebhook\n :method\n :operation\n :options\n :path\n :selectedClient\n :selectedSecuritySchemes\n :selectedServer />\n </template>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"Operation.vue.js","names":[],"sources":["../../../src/features/Operation/Operation.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * References Operation \"block\"\n */\nexport default {}\n\nexport type OperationProps = {\n id: string\n method: HttpMethod\n /** The subset of the configuration object required for the operation component */\n options: Pick<\n ApiReferenceConfigurationRaw,\n | 'expandAllResponses'\n | 'hideTestRequestButton'\n | 'layout'\n | 'orderRequiredPropertiesFirst'\n | 'orderSchemaPropertiesBy'\n | 'showOperationId'\n >\n /** Document object */\n document: OpenApiDocument\n /** Key of the operations path in the document.paths object */\n path: string\n /** OpenAPI path object that will include the operation */\n pathValue: PathItemObject | undefined\n /** Currently selected server for the document */\n server: ServerObject | null\n /** The merged security schemes for the document and the authentication configuration */\n securitySchemes: MergedSecuritySchemes\n /** The http client options for the dropdown */\n clientOptions: ClientOptionGroup[]\n /** Whether the Classic layout operation is collapsed */\n isCollapsed: boolean\n /** Whether the operation is a webhook */\n isWebhook: boolean\n /** The currently selected client for the document */\n selectedClient: WorkspaceStore['workspace']['x-scalar-default-client']\n /** The event bus */\n eventBus: WorkspaceEventBus\n /** The auth store */\n authStore: AuthStore\n}\n</script>\n\n<script lang=\"ts\" setup>\nimport type { ClientOptionGroup } from '@scalar/api-client/v2/blocks/operation-code-sample'\nimport type { HttpMethod } from '@scalar/helpers/http/http-methods'\nimport type { ApiReferenceConfigurationRaw } from '@scalar/types/api-reference'\nimport type { WorkspaceStore } from '@scalar/workspace-store/client'\nimport type { AuthStore } from '@scalar/workspace-store/entities/auth'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport {\n combineParams,\n type MergedSecuritySchemes,\n} from '@scalar/workspace-store/request-example'\nimport type {\n OpenApiDocument,\n PathItemObject,\n ServerObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed } from 'vue'\n\nimport { filterSelectedSecurity } from '@/features/Operation/helpers/filter-selected-security'\n\nimport { getFirstServer } from './helpers/get-first-server'\nimport ClassicLayout from './layouts/ClassicLayout.vue'\nimport ModernLayout from './layouts/ModernLayout.vue'\n\nconst {\n authStore,\n clientOptions,\n document,\n eventBus,\n isCollapsed,\n isWebhook,\n method,\n options,\n path,\n pathValue,\n securitySchemes,\n server,\n} = defineProps<OperationProps>()\n\n/**\n * Operation from the new workspace store, ensure we are de-reference\n *\n * Also adds in params from the pathItemObject\n */\nconst operation = computed(() => {\n const entity = getResolvedRef(pathValue?.[method])\n\n if (!entity) {\n return null\n }\n\n // Combine params from the pathItem and the operation\n const parameters = combineParams(pathValue?.parameters, entity.parameters)\n return { ...entity, parameters }\n})\n\n/**\n * Determine the effective server for the code examples.\n */\nconst selectedServer = computed<ServerObject | null>(() =>\n getFirstServer(\n // 1) Operation\n operation.value?.servers ?? null,\n // 2) Path Item\n pathValue?.servers ?? null,\n // 3) Document\n server,\n ),\n)\n\n/** We must ensure the selected security schemes are required on this operation */\nconst selectedSecuritySchemes = computed(() =>\n filterSelectedSecurity(\n document,\n operation.value,\n authStore.getAuthSelectedSchemas({\n type: 'document',\n documentName: document?.['x-scalar-navigation']?.name ?? '',\n }),\n authStore.getAuthSelectedSchemas({\n type: 'operation',\n documentName: document?.['x-scalar-navigation']?.name ?? '',\n path,\n method,\n }),\n securitySchemes,\n ),\n)\n</script>\n\n<template>\n <template v-if=\"operation\">\n <ClassicLayout\n v-if=\"options.layout === 'classic'\"\n :id\n :clientOptions\n :eventBus\n :isCollapsed\n :isWebhook\n :method\n :operation\n :options\n :path\n :selectedClient\n :selectedSecuritySchemes\n :selectedServer />\n <ModernLayout\n v-else\n :id\n :clientOptions\n :eventBus\n :isWebhook\n :method\n :operation\n :options\n :path\n :selectedClient\n :selectedSecuritySchemes\n :selectedServer />\n </template>\n</template>\n"],"mappings":""}
@@ -3,7 +3,7 @@ import { getFirstServer } from "./helpers/get-first-server.js";
3
3
  import ClassicLayout_default from "./layouts/ClassicLayout.vue.js";
4
4
  import ModernLayout_default from "./layouts/ModernLayout.vue.js";
5
5
  import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, defineComponent, openBlock } from "vue";
6
- import { combineParams } from "@scalar/api-client/v2/features/operation";
6
+ import { combineParams } from "@scalar/workspace-store/request-example";
7
7
  import { getResolvedRef } from "@scalar/workspace-store/helpers/get-resolved-ref";
8
8
  var Operation_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
9
9
  __name: "Operation",
@@ -1 +1 @@
1
- {"version":3,"file":"Operation.vue.script.js","names":[],"sources":["../../../src/features/Operation/Operation.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * References Operation \"block\"\n */\nexport default {}\n\nexport type OperationProps = {\n id: string\n method: HttpMethod\n /** The subset of the configuration object required for the operation component */\n options: Pick<\n ApiReferenceConfigurationRaw,\n | 'expandAllResponses'\n | 'hideTestRequestButton'\n | 'layout'\n | 'orderRequiredPropertiesFirst'\n | 'orderSchemaPropertiesBy'\n | 'showOperationId'\n >\n /** Document object */\n document: OpenApiDocument\n /** Key of the operations path in the document.paths object */\n path: string\n /** OpenAPI path object that will include the operation */\n pathValue: PathItemObject | undefined\n /** Currently selected server for the document */\n server: ServerObject | null\n /** The merged security schemes for the document and the authentication configuration */\n securitySchemes: MergedSecuritySchemes\n /** The http client options for the dropdown */\n clientOptions: ClientOptionGroup[]\n /** Whether the Classic layout operation is collapsed */\n isCollapsed: boolean\n /** Whether the operation is a webhook */\n isWebhook: boolean\n /** The currently selected client for the document */\n selectedClient: WorkspaceStore['workspace']['x-scalar-default-client']\n /** The event bus */\n eventBus: WorkspaceEventBus\n /** The auth store */\n authStore: AuthStore\n}\n</script>\n\n<script lang=\"ts\" setup>\nimport type { ClientOptionGroup } from '@scalar/api-client/v2/blocks/operation-code-sample'\nimport type { MergedSecuritySchemes } from '@scalar/api-client/v2/blocks/scalar-auth-selector-block'\nimport { combineParams } from '@scalar/api-client/v2/features/operation'\nimport type { HttpMethod } from '@scalar/helpers/http/http-methods'\nimport type { ApiReferenceConfigurationRaw } from '@scalar/types/api-reference'\nimport type { WorkspaceStore } from '@scalar/workspace-store/client'\nimport type { AuthStore } from '@scalar/workspace-store/entities/auth'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport type {\n OpenApiDocument,\n PathItemObject,\n ServerObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed } from 'vue'\n\nimport { filterSelectedSecurity } from '@/features/Operation/helpers/filter-selected-security'\n\nimport { getFirstServer } from './helpers/get-first-server'\nimport ClassicLayout from './layouts/ClassicLayout.vue'\nimport ModernLayout from './layouts/ModernLayout.vue'\n\nconst {\n authStore,\n clientOptions,\n document,\n eventBus,\n isCollapsed,\n isWebhook,\n method,\n options,\n path,\n pathValue,\n securitySchemes,\n server,\n} = defineProps<OperationProps>()\n\n/**\n * Operation from the new workspace store, ensure we are de-reference\n *\n * Also adds in params from the pathItemObject\n */\nconst operation = computed(() => {\n const entity = getResolvedRef(pathValue?.[method])\n\n if (!entity) {\n return null\n }\n\n // Combine params from the pathItem and the operation\n const parameters = combineParams(pathValue?.parameters, entity.parameters)\n return { ...entity, parameters }\n})\n\n/**\n * Determine the effective server for the code examples.\n */\nconst selectedServer = computed<ServerObject | null>(() =>\n getFirstServer(\n // 1) Operation\n operation.value?.servers ?? null,\n // 2) Path Item\n pathValue?.servers ?? null,\n // 3) Document\n server,\n ),\n)\n\n/** We must ensure the selected security schemes are required on this operation */\nconst selectedSecuritySchemes = computed(() =>\n filterSelectedSecurity(\n document,\n operation.value,\n authStore.getAuthSelectedSchemas({\n type: 'document',\n documentName: document?.['x-scalar-navigation']?.name ?? '',\n }),\n authStore.getAuthSelectedSchemas({\n type: 'operation',\n documentName: document?.['x-scalar-navigation']?.name ?? '',\n path,\n method,\n }),\n securitySchemes,\n ),\n)\n</script>\n\n<template>\n <template v-if=\"operation\">\n <ClassicLayout\n v-if=\"options.layout === 'classic'\"\n :id\n :clientOptions\n :eventBus\n :isCollapsed\n :isWebhook\n :method\n :operation\n :options\n :path\n :selectedClient\n :selectedSecuritySchemes\n :selectedServer />\n <ModernLayout\n v-else\n :id\n :clientOptions\n :eventBus\n :isWebhook\n :method\n :operation\n :options\n :path\n :selectedClient\n :selectedSecuritySchemes\n :selectedServer />\n </template>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuFA,MAAM,YAAY,eAAe;GAC/B,MAAM,SAAS,eAAe,QAAA,YAAY,QAAA,QAAO;AAEjD,OAAI,CAAC,OACH,QAAO;GAIT,MAAM,aAAa,cAAc,QAAA,WAAW,YAAY,OAAO,WAAU;AACzE,UAAO;IAAE,GAAG;IAAQ;IAAW;IAChC;;;;EAKD,MAAM,iBAAiB,eACrB,eAEE,UAAU,OAAO,WAAW,MAE5B,QAAA,WAAW,WAAW,MAEtB,QAAA,OACD,CACH;;EAGA,MAAM,0BAA0B,eAC9B,uBACE,QAAA,UACA,UAAU,OACV,QAAA,UAAU,uBAAuB;GAC/B,MAAM;GACN,cAAc,QAAA,WAAW,wBAAwB,QAAQ;GAC1D,CAAC,EACF,QAAA,UAAU,uBAAuB;GAC/B,MAAM;GACN,cAAc,QAAA,WAAW,wBAAwB,QAAQ;GACzD,MAAG,QAAA;GACH,QAAK,QAAA;GACN,CAAC,EACF,QAAA,gBACD,CACH;;UAIkB,UAAA,SAAA,WAAA,EAAhB,mBA4BW,UAAA,EAAA,KAAA,GAAA,EAAA,CA1BD,QAAA,QAAQ,WAAM,aAAA,WAAA,EADtB,YAaoB,uBAAA;;IAXjB,IAAA,QAAA;IACA,eAAA,QAAA;IACA,UAAA,QAAA;IACA,aAAA,QAAA;IACA,WAAA,QAAA;IACA,QAAA,QAAA;IACA,WAAA,UAAA;IACA,SAAA,QAAA;IACA,MAAA,QAAA;IACA,gBAAA,QAAA;IACA,yBAAA,wBAAA;IACA,gBAAA,eAAA;;;;;;;;;;;;;;uBACH,YAYoB,sBAAA;;IAVjB,IAAA,QAAA;IACA,eAAA,QAAA;IACA,UAAA,QAAA;IACA,WAAA,QAAA;IACA,QAAA,QAAA;IACA,WAAA,UAAA;IACA,SAAA,QAAA;IACA,MAAA,QAAA;IACA,gBAAA,QAAA;IACA,yBAAA,wBAAA;IACA,gBAAA,eAAA"}
1
+ {"version":3,"file":"Operation.vue.script.js","names":[],"sources":["../../../src/features/Operation/Operation.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * References Operation \"block\"\n */\nexport default {}\n\nexport type OperationProps = {\n id: string\n method: HttpMethod\n /** The subset of the configuration object required for the operation component */\n options: Pick<\n ApiReferenceConfigurationRaw,\n | 'expandAllResponses'\n | 'hideTestRequestButton'\n | 'layout'\n | 'orderRequiredPropertiesFirst'\n | 'orderSchemaPropertiesBy'\n | 'showOperationId'\n >\n /** Document object */\n document: OpenApiDocument\n /** Key of the operations path in the document.paths object */\n path: string\n /** OpenAPI path object that will include the operation */\n pathValue: PathItemObject | undefined\n /** Currently selected server for the document */\n server: ServerObject | null\n /** The merged security schemes for the document and the authentication configuration */\n securitySchemes: MergedSecuritySchemes\n /** The http client options for the dropdown */\n clientOptions: ClientOptionGroup[]\n /** Whether the Classic layout operation is collapsed */\n isCollapsed: boolean\n /** Whether the operation is a webhook */\n isWebhook: boolean\n /** The currently selected client for the document */\n selectedClient: WorkspaceStore['workspace']['x-scalar-default-client']\n /** The event bus */\n eventBus: WorkspaceEventBus\n /** The auth store */\n authStore: AuthStore\n}\n</script>\n\n<script lang=\"ts\" setup>\nimport type { ClientOptionGroup } from '@scalar/api-client/v2/blocks/operation-code-sample'\nimport type { HttpMethod } from '@scalar/helpers/http/http-methods'\nimport type { ApiReferenceConfigurationRaw } from '@scalar/types/api-reference'\nimport type { WorkspaceStore } from '@scalar/workspace-store/client'\nimport type { AuthStore } from '@scalar/workspace-store/entities/auth'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport {\n combineParams,\n type MergedSecuritySchemes,\n} from '@scalar/workspace-store/request-example'\nimport type {\n OpenApiDocument,\n PathItemObject,\n ServerObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed } from 'vue'\n\nimport { filterSelectedSecurity } from '@/features/Operation/helpers/filter-selected-security'\n\nimport { getFirstServer } from './helpers/get-first-server'\nimport ClassicLayout from './layouts/ClassicLayout.vue'\nimport ModernLayout from './layouts/ModernLayout.vue'\n\nconst {\n authStore,\n clientOptions,\n document,\n eventBus,\n isCollapsed,\n isWebhook,\n method,\n options,\n path,\n pathValue,\n securitySchemes,\n server,\n} = defineProps<OperationProps>()\n\n/**\n * Operation from the new workspace store, ensure we are de-reference\n *\n * Also adds in params from the pathItemObject\n */\nconst operation = computed(() => {\n const entity = getResolvedRef(pathValue?.[method])\n\n if (!entity) {\n return null\n }\n\n // Combine params from the pathItem and the operation\n const parameters = combineParams(pathValue?.parameters, entity.parameters)\n return { ...entity, parameters }\n})\n\n/**\n * Determine the effective server for the code examples.\n */\nconst selectedServer = computed<ServerObject | null>(() =>\n getFirstServer(\n // 1) Operation\n operation.value?.servers ?? null,\n // 2) Path Item\n pathValue?.servers ?? null,\n // 3) Document\n server,\n ),\n)\n\n/** We must ensure the selected security schemes are required on this operation */\nconst selectedSecuritySchemes = computed(() =>\n filterSelectedSecurity(\n document,\n operation.value,\n authStore.getAuthSelectedSchemas({\n type: 'document',\n documentName: document?.['x-scalar-navigation']?.name ?? '',\n }),\n authStore.getAuthSelectedSchemas({\n type: 'operation',\n documentName: document?.['x-scalar-navigation']?.name ?? '',\n path,\n method,\n }),\n securitySchemes,\n ),\n)\n</script>\n\n<template>\n <template v-if=\"operation\">\n <ClassicLayout\n v-if=\"options.layout === 'classic'\"\n :id\n :clientOptions\n :eventBus\n :isCollapsed\n :isWebhook\n :method\n :operation\n :options\n :path\n :selectedClient\n :selectedSecuritySchemes\n :selectedServer />\n <ModernLayout\n v-else\n :id\n :clientOptions\n :eventBus\n :isWebhook\n :method\n :operation\n :options\n :path\n :selectedClient\n :selectedSecuritySchemes\n :selectedServer />\n </template>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyFA,MAAM,YAAY,eAAe;GAC/B,MAAM,SAAS,eAAe,QAAA,YAAY,QAAA,QAAO;AAEjD,OAAI,CAAC,OACH,QAAO;GAIT,MAAM,aAAa,cAAc,QAAA,WAAW,YAAY,OAAO,WAAU;AACzE,UAAO;IAAE,GAAG;IAAQ;IAAW;IAChC;;;;EAKD,MAAM,iBAAiB,eACrB,eAEE,UAAU,OAAO,WAAW,MAE5B,QAAA,WAAW,WAAW,MAEtB,QAAA,OACD,CACH;;EAGA,MAAM,0BAA0B,eAC9B,uBACE,QAAA,UACA,UAAU,OACV,QAAA,UAAU,uBAAuB;GAC/B,MAAM;GACN,cAAc,QAAA,WAAW,wBAAwB,QAAQ;GAC1D,CAAC,EACF,QAAA,UAAU,uBAAuB;GAC/B,MAAM;GACN,cAAc,QAAA,WAAW,wBAAwB,QAAQ;GACzD,MAAG,QAAA;GACH,QAAK,QAAA;GACN,CAAC,EACF,QAAA,gBACD,CACH;;UAIkB,UAAA,SAAA,WAAA,EAAhB,mBA4BW,UAAA,EAAA,KAAA,GAAA,EAAA,CA1BD,QAAA,QAAQ,WAAM,aAAA,WAAA,EADtB,YAaoB,uBAAA;;IAXjB,IAAA,QAAA;IACA,eAAA,QAAA;IACA,UAAA,QAAA;IACA,aAAA,QAAA;IACA,WAAA,QAAA;IACA,QAAA,QAAA;IACA,WAAA,UAAA;IACA,SAAA,QAAA;IACA,MAAA,QAAA;IACA,gBAAA,QAAA;IACA,yBAAA,wBAAA;IACA,gBAAA,eAAA;;;;;;;;;;;;;;uBACH,YAYoB,sBAAA;;IAVjB,IAAA,QAAA;IACA,eAAA,QAAA;IACA,UAAA,QAAA;IACA,WAAA,QAAA;IACA,QAAA,QAAA;IACA,WAAA,UAAA;IACA,SAAA,QAAA;IACA,MAAA,QAAA;IACA,gBAAA,QAAA;IACA,yBAAA,wBAAA;IACA,gBAAA,eAAA"}
@@ -1,5 +1,6 @@
1
- import type { MergedSecuritySchemes, SecuritySchemeObjectSecret } from '@scalar/api-client/v2/blocks/scalar-auth-selector-block';
2
1
  import type { SelectedSecurity } from '@scalar/workspace-store/entities/auth';
2
+ import type { SecuritySchemeObjectSecret } from '@scalar/workspace-store/request-example';
3
+ import { type MergedSecuritySchemes } from '@scalar/workspace-store/request-example';
3
4
  import type { OpenApiDocument, OperationObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
4
5
  /**
5
6
  * Find the intersection between which security is selected on the document and what this operation requires
@@ -1 +1 @@
1
- {"version":3,"file":"filter-selected-security.d.ts","sourceRoot":"","sources":["../../../../src/features/Operation/helpers/filter-selected-security.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,qBAAqB,EACrB,0BAA0B,EAC3B,MAAM,yDAAyD,CAAA;AAEhE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAA;AAC7E,OAAO,KAAK,EACV,eAAe,EACf,eAAe,EAEhB,MAAM,8DAA8D,CAAA;AAKrE;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,GACjC,UAAU,eAAe,EACzB,WAAW,eAAe,GAAG,IAAI,EACjC,2BAA2B,gBAAgB,EAC3C,4BAA4B,gBAAgB,EAC5C,kBAAiB,qBAA0B,KAC1C,0BAA0B,EAmC5B,CAAA"}
1
+ {"version":3,"file":"filter-selected-security.d.ts","sourceRoot":"","sources":["../../../../src/features/Operation/helpers/filter-selected-security.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAA;AAC7E,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,yCAAyC,CAAA;AACzF,OAAO,EACL,KAAK,qBAAqB,EAG3B,MAAM,yCAAyC,CAAA;AAChD,OAAO,KAAK,EACV,eAAe,EACf,eAAe,EAEhB,MAAM,8DAA8D,CAAA;AAKrE;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,GACjC,UAAU,eAAe,EACzB,WAAW,eAAe,GAAG,IAAI,EACjC,2BAA2B,gBAAgB,EAC3C,4BAA4B,gBAAgB,EAC5C,kBAAiB,qBAA0B,KAC1C,0BAA0B,EAmC5B,CAAA"}
@@ -1,5 +1,4 @@
1
- import { getSelectedSecurity } from "@scalar/api-client/v2/features/operation";
2
- import { getSecuritySchemes } from "@scalar/api-client/v2/blocks/operation-block";
1
+ import { getSecuritySchemes, getSelectedSecurity } from "@scalar/workspace-store/request-example";
3
2
  //#region src/features/Operation/helpers/filter-selected-security.ts
4
3
  /** Builds a quick cache key from the sorted object keys */
5
4
  var getKey = (requirement) => Object.keys(requirement).sort().join(",");
@@ -1 +1 @@
1
- {"version":3,"file":"filter-selected-security.js","names":[],"sources":["../../../../src/features/Operation/helpers/filter-selected-security.ts"],"sourcesContent":["import { getSecuritySchemes } from '@scalar/api-client/v2/blocks/operation-block'\nimport type {\n MergedSecuritySchemes,\n SecuritySchemeObjectSecret,\n} from '@scalar/api-client/v2/blocks/scalar-auth-selector-block'\nimport { getSelectedSecurity } from '@scalar/api-client/v2/features/operation'\nimport type { SelectedSecurity } from '@scalar/workspace-store/entities/auth'\nimport type {\n OpenApiDocument,\n OperationObject,\n SecurityRequirementObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\n\n/** Builds a quick cache key from the sorted object keys */\nconst getKey = (requirement: SecurityRequirementObject) => Object.keys(requirement).sort().join(',')\n\n/**\n * Find the intersection between which security is selected on the document and what this operation requires\n *\n * If there is no overlap, we return the first requirement\n */\nexport const filterSelectedSecurity = (\n document: OpenApiDocument,\n operation: OperationObject | null,\n selectedSecurityDocument?: SelectedSecurity,\n selectedSecurityOperation?: SelectedSecurity,\n securitySchemes: MergedSecuritySchemes = {},\n): SecuritySchemeObjectSecret[] => {\n const securityRequirements = operation?.security ?? document.security ?? []\n\n /** The selected security keys for the document */\n const selectedSecurity = getSelectedSecurity(\n selectedSecurityDocument,\n selectedSecurityOperation,\n securityRequirements,\n )\n\n /** Build a set for O(1) lookup */\n const requirementSet = new Set(securityRequirements.map((r) => getKey(r)))\n\n // Lets check the selectedIndex first\n const selectedRequirement = selectedSecurity.selectedSchemes[selectedSecurity.selectedIndex]\n if (selectedRequirement && requirementSet.has(getKey(selectedRequirement))) {\n return getSecuritySchemes(securitySchemes, [selectedRequirement])\n }\n\n // Otherwise lets loop over all selected\n for (const selected of selectedSecurity.selectedSchemes) {\n if (requirementSet.has(getKey(selected))) {\n return getSecuritySchemes(securitySchemes, [selected])\n }\n }\n\n /**\n * If we are selected security on the document,\n * we should show the first requirement of the operation to show auth is required\n */\n if (operation?.security?.length) {\n return getSecuritySchemes(securitySchemes, securityRequirements.slice(0, 1))\n }\n\n return []\n}\n"],"mappings":";;;;AAcA,IAAM,UAAU,gBAA2C,OAAO,KAAK,YAAY,CAAC,MAAM,CAAC,KAAK,IAAI;;;;;;AAOpG,IAAa,0BACX,UACA,WACA,0BACA,2BACA,kBAAyC,EAAE,KACV;CACjC,MAAM,uBAAuB,WAAW,YAAY,SAAS,YAAY,EAAE;;CAG3E,MAAM,mBAAmB,oBACvB,0BACA,2BACA,qBACD;;CAGD,MAAM,iBAAiB,IAAI,IAAI,qBAAqB,KAAK,MAAM,OAAO,EAAE,CAAC,CAAC;CAG1E,MAAM,sBAAsB,iBAAiB,gBAAgB,iBAAiB;AAC9E,KAAI,uBAAuB,eAAe,IAAI,OAAO,oBAAoB,CAAC,CACxE,QAAO,mBAAmB,iBAAiB,CAAC,oBAAoB,CAAC;AAInE,MAAK,MAAM,YAAY,iBAAiB,gBACtC,KAAI,eAAe,IAAI,OAAO,SAAS,CAAC,CACtC,QAAO,mBAAmB,iBAAiB,CAAC,SAAS,CAAC;;;;;AAQ1D,KAAI,WAAW,UAAU,OACvB,QAAO,mBAAmB,iBAAiB,qBAAqB,MAAM,GAAG,EAAE,CAAC;AAG9E,QAAO,EAAE"}
1
+ {"version":3,"file":"filter-selected-security.js","names":[],"sources":["../../../../src/features/Operation/helpers/filter-selected-security.ts"],"sourcesContent":["import type { SelectedSecurity } from '@scalar/workspace-store/entities/auth'\nimport type { SecuritySchemeObjectSecret } from '@scalar/workspace-store/request-example'\nimport {\n type MergedSecuritySchemes,\n getSecuritySchemes,\n getSelectedSecurity,\n} from '@scalar/workspace-store/request-example'\nimport type {\n OpenApiDocument,\n OperationObject,\n SecurityRequirementObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\n\n/** Builds a quick cache key from the sorted object keys */\nconst getKey = (requirement: SecurityRequirementObject) => Object.keys(requirement).sort().join(',')\n\n/**\n * Find the intersection between which security is selected on the document and what this operation requires\n *\n * If there is no overlap, we return the first requirement\n */\nexport const filterSelectedSecurity = (\n document: OpenApiDocument,\n operation: OperationObject | null,\n selectedSecurityDocument?: SelectedSecurity,\n selectedSecurityOperation?: SelectedSecurity,\n securitySchemes: MergedSecuritySchemes = {},\n): SecuritySchemeObjectSecret[] => {\n const securityRequirements = operation?.security ?? document.security ?? []\n\n /** The selected security keys for the document */\n const selectedSecurity = getSelectedSecurity(\n selectedSecurityDocument,\n selectedSecurityOperation,\n securityRequirements,\n )\n\n /** Build a set for O(1) lookup */\n const requirementSet = new Set(securityRequirements.map((r) => getKey(r)))\n\n // Lets check the selectedIndex first\n const selectedRequirement = selectedSecurity.selectedSchemes[selectedSecurity.selectedIndex]\n if (selectedRequirement && requirementSet.has(getKey(selectedRequirement))) {\n return getSecuritySchemes(securitySchemes, [selectedRequirement])\n }\n\n // Otherwise lets loop over all selected\n for (const selected of selectedSecurity.selectedSchemes) {\n if (requirementSet.has(getKey(selected))) {\n return getSecuritySchemes(securitySchemes, [selected])\n }\n }\n\n /**\n * If we are selected security on the document,\n * we should show the first requirement of the operation to show auth is required\n */\n if (operation?.security?.length) {\n return getSecuritySchemes(securitySchemes, securityRequirements.slice(0, 1))\n }\n\n return []\n}\n"],"mappings":";;;AAcA,IAAM,UAAU,gBAA2C,OAAO,KAAK,YAAY,CAAC,MAAM,CAAC,KAAK,IAAI;;;;;;AAOpG,IAAa,0BACX,UACA,WACA,0BACA,2BACA,kBAAyC,EAAE,KACV;CACjC,MAAM,uBAAuB,WAAW,YAAY,SAAS,YAAY,EAAE;;CAG3E,MAAM,mBAAmB,oBACvB,0BACA,2BACA,qBACD;;CAGD,MAAM,iBAAiB,IAAI,IAAI,qBAAqB,KAAK,MAAM,OAAO,EAAE,CAAC,CAAC;CAG1E,MAAM,sBAAsB,iBAAiB,gBAAgB,iBAAiB;AAC9E,KAAI,uBAAuB,eAAe,IAAI,OAAO,oBAAoB,CAAC,CACxE,QAAO,mBAAmB,iBAAiB,CAAC,oBAAoB,CAAC;AAInE,MAAK,MAAM,YAAY,iBAAiB,gBACtC,KAAI,eAAe,IAAI,OAAO,SAAS,CAAC,CACtC,QAAO,mBAAmB,iBAAiB,CAAC,SAAS,CAAC;;;;;AAQ1D,KAAI,WAAW,UAAU,OACvB,QAAO,mBAAmB,iBAAiB,qBAAqB,MAAM,GAAG,EAAE,CAAC;AAG9E,QAAO,EAAE"}