@scalar/api-reference 1.43.5 → 1.43.7

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 (95) hide show
  1. package/CHANGELOG.md +59 -0
  2. package/dist/blocks/scalar-client-selector-block/components/ClientDropdown.vue2.js +7 -7
  3. package/dist/blocks/scalar-client-selector-block/components/ClientSelector.vue2.js +5 -5
  4. package/dist/blocks/scalar-info-block/components/DownloadLink.vue2.js +5 -5
  5. package/dist/blocks/scalar-info-block/components/InfoBlock.vue.js +11 -11
  6. package/dist/blocks/scalar-info-block/components/InfoDescription.vue2.js +2 -2
  7. package/dist/blocks/scalar-info-block/components/InfoLinks.vue.js +7 -7
  8. package/dist/blocks/scalar-info-block/components/InfoMarkdownSection.vue.js +2 -2
  9. package/dist/blocks/scalar-info-block/components/IntroductionCard.vue2.js +1 -1
  10. package/dist/blocks/scalar-info-block/components/IntroductionLayout.vue2.js +16 -16
  11. package/dist/blocks/scalar-info-block/components/OpenApiVersion.vue.js +2 -2
  12. package/dist/blocks/scalar-server-selector-block/components/Selector.vue.js +1 -1
  13. package/dist/blocks/scalar-server-selector-block/components/ServerSelector.vue.js +7 -7
  14. package/dist/browser/standalone.js +18437 -18030
  15. package/dist/browser/webpack-stats.json +1 -1
  16. package/dist/components/Anchor/WithBreadcrumb.vue.js +3 -3
  17. package/dist/components/ApiReference.vue.d.ts.map +1 -1
  18. package/dist/components/ApiReference.vue.js +1 -1
  19. package/dist/components/ApiReference.vue2.js +16 -11
  20. package/dist/components/Content/Auth/Auth.vue.js +7 -7
  21. package/dist/components/Content/Content.vue.js +28 -28
  22. package/dist/components/Content/Models/Model.vue.js +14 -14
  23. package/dist/components/Content/Models/ModelTag.vue.js +8 -8
  24. package/dist/components/Content/Models/components/ClassicLayout.vue2.js +15 -15
  25. package/dist/components/Content/Models/components/ModernLayout.vue.js +11 -11
  26. package/dist/components/Content/Operations/TraversedEntry.vue.js +51 -51
  27. package/dist/components/Content/Schema/Schema.vue2.js +40 -40
  28. package/dist/components/Content/Schema/SchemaComposition.vue.js +17 -17
  29. package/dist/components/Content/Schema/SchemaEnumPropertyItem.vue2.js +3 -3
  30. package/dist/components/Content/Schema/SchemaHeading.vue2.js +7 -7
  31. package/dist/components/Content/Schema/SchemaObjectProperties.vue.js +31 -31
  32. package/dist/components/Content/Schema/SchemaProperty.vue2.js +33 -33
  33. package/dist/components/Content/Schema/SchemaPropertyDetail.vue2.js +2 -2
  34. package/dist/components/Content/Schema/SchemaPropertyExamples.vue2.js +6 -6
  35. package/dist/components/Content/Tags/Tag.vue.js +11 -11
  36. package/dist/components/Content/Tags/components/ClassicLayout.vue2.js +6 -6
  37. package/dist/components/Content/Tags/components/ModernLayout.vue2.js +10 -10
  38. package/dist/components/Content/Tags/components/TagSection.vue.js +14 -14
  39. package/dist/components/GettingStarted.vue2.js +1 -1
  40. package/dist/components/HttpMethod/HttpMethod.vue.js +3 -3
  41. package/dist/components/IntersectionObserver.vue.js +2 -2
  42. package/dist/components/LoadingSkeleton.vue2.js +2 -2
  43. package/dist/components/MobileHeader.vue.js +6 -6
  44. package/dist/components/OperationPath.vue2.js +1 -1
  45. package/dist/components/OperationsList/OperationsList.vue2.js +5 -5
  46. package/dist/components/OperationsList/OperationsListItem.vue2.js +8 -8
  47. package/dist/components/RenderPlugins/RenderPlugins.vue.js +2 -2
  48. package/dist/components/Section/CompactSection.vue2.js +9 -9
  49. package/dist/components/Section/SectionAccordion.vue2.js +5 -5
  50. package/dist/components/Section/SectionContainer.vue2.js +1 -1
  51. package/dist/components/Section/SectionContainerAccordion.vue2.js +3 -3
  52. package/dist/components/Section/SectionContent.vue2.js +1 -1
  53. package/dist/components/Section/SectionHeader.vue2.js +2 -2
  54. package/dist/components/Section/SectionHeaderTag.vue2.js +1 -1
  55. package/dist/features/Operation/Operation.vue.js +18 -18
  56. package/dist/features/Operation/components/Header.vue.js +8 -8
  57. package/dist/features/Operation/components/Headers.vue2.js +5 -5
  58. package/dist/features/Operation/components/OperationParameters.vue.js +17 -17
  59. package/dist/features/Operation/components/OperationResponses.vue.js +6 -6
  60. package/dist/features/Operation/components/ParameterList.vue.js +6 -6
  61. package/dist/features/Operation/components/ParameterListItem.vue2.js +16 -16
  62. package/dist/features/Operation/components/RequestBody.vue2.js +17 -17
  63. package/dist/features/Operation/components/callbacks/Callback.vue2.js +10 -10
  64. package/dist/features/Operation/components/callbacks/Callbacks.vue.js +3 -3
  65. package/dist/features/Operation/layouts/ClassicLayout.vue2.js +49 -49
  66. package/dist/features/Operation/layouts/ModernLayout.vue2.js +50 -50
  67. package/dist/features/Search/components/SearchButton.vue.js +5 -5
  68. package/dist/features/Search/components/SearchModal.vue2.js +1 -1
  69. package/dist/features/Search/components/SearchResult.vue.js +14 -14
  70. package/dist/features/example-responses/ExampleResponse.vue2.js +3 -3
  71. package/dist/features/external-docs/ExternalDocs.vue.js +3 -3
  72. package/dist/features/info-object/Contact.vue.js +6 -6
  73. package/dist/features/info-object/License.vue.js +4 -4
  74. package/dist/features/info-object/TermsOfService.vue.js +2 -2
  75. package/dist/features/multiple-documents/DocumentSelector.vue.js +1 -1
  76. package/dist/features/specification-extension/SpecificationExtension.vue2.js +3 -3
  77. package/dist/features/test-request-button/TestRequestButton.vue2.js +2 -2
  78. package/dist/features/toolbar/ApiReferenceToolbar.vue.js +4 -4
  79. package/dist/features/toolbar/ApiReferenceToolbarConfig.vue.js +1 -1
  80. package/dist/features/toolbar/ApiReferenceToolbarSdks.vue.js +1 -1
  81. package/dist/features/toolbar/ApiReferenceToolbarShare.vue.js +2 -2
  82. package/dist/features/toolbar/ApiReferenceToolbarShareRegister.vue.js +1 -1
  83. package/dist/helpers/load-from-perssistance.d.ts +32 -0
  84. package/dist/helpers/load-from-perssistance.d.ts.map +1 -0
  85. package/dist/helpers/load-from-perssistance.js +74 -0
  86. package/dist/helpers/map-config-plugins.d.ts +17 -2
  87. package/dist/helpers/map-config-plugins.d.ts.map +1 -1
  88. package/dist/helpers/map-config-plugins.js +20 -22
  89. package/dist/helpers/map-config-to-workspace-store.d.ts.map +1 -1
  90. package/dist/helpers/map-config-to-workspace-store.js +1 -8
  91. package/dist/helpers/storage.d.ts +6 -6
  92. package/dist/helpers/storage.d.ts.map +1 -1
  93. package/dist/helpers/storage.js +15 -10
  94. package/dist/style.css +39 -39
  95. package/package.json +31 -31
@@ -0,0 +1,74 @@
1
+ import { isClient } from "@scalar/api-client/v2/blocks/operation-code-sample";
2
+ import { isObject } from "@scalar/helpers/object/is-object";
3
+ import { getResolvedRef } from "@scalar/workspace-store/helpers/get-resolved-ref";
4
+ import { clientStorage, authStorage } from "./storage.js";
5
+ const SECRET_KEY_PREFIX = "x-scalar-secret-";
6
+ const loadClientFromStorage = (store) => {
7
+ const storedClient = clientStorage().get();
8
+ if (isClient(storedClient) && !store.workspace["x-scalar-default-client"]) {
9
+ store.update("x-scalar-default-client", storedClient);
10
+ }
11
+ };
12
+ const isSecretKey = (key) => key.startsWith(SECRET_KEY_PREFIX);
13
+ const mergeSecrets = (current, stored) => {
14
+ if (!isObject(current) || !isObject(stored)) {
15
+ return;
16
+ }
17
+ for (const [key, storedValue] of Object.entries(stored)) {
18
+ if (isSecretKey(key) && storedValue && current[key] === "") {
19
+ current[key] = storedValue;
20
+ continue;
21
+ }
22
+ mergeSecrets(getResolvedRef(current[key]), storedValue);
23
+ }
24
+ };
25
+ const restoreAuthSecretsFromStorage = (store) => {
26
+ const slug = store.workspace["x-scalar-active-document"];
27
+ const activeDocument = store.workspace.activeDocument;
28
+ if (!activeDocument || !slug) {
29
+ console.warn("Active document not found in workspace, skipping auth secrets loading");
30
+ return;
31
+ }
32
+ const securitySchemes = activeDocument.components?.securitySchemes ?? {};
33
+ const storedAuthSchemes = authStorage().getSchemas(slug);
34
+ for (const [key, storedScheme] of Object.entries(storedAuthSchemes)) {
35
+ const currentScheme = getResolvedRef(securitySchemes[key]);
36
+ if (isObject(currentScheme)) {
37
+ mergeSecrets(currentScheme, storedScheme);
38
+ }
39
+ }
40
+ };
41
+ const isSchemeValid = (scheme, availableSchemes) => Object.keys(scheme).every((key) => availableSchemes.has(key));
42
+ const clampSelectedIndex = (selectedIndex, schemesLength) => selectedIndex >= schemesLength ? schemesLength - 1 : selectedIndex;
43
+ const loadAuthSchemesFromStorage = (store) => {
44
+ const slug = store.workspace["x-scalar-active-document"];
45
+ const activeDocument = store.workspace.activeDocument;
46
+ if (!activeDocument || !slug) {
47
+ console.warn("Active document not found in workspace, skipping auth schemes loading");
48
+ return;
49
+ }
50
+ if (activeDocument["x-scalar-selected-security"]) {
51
+ restoreAuthSecretsFromStorage(store);
52
+ return;
53
+ }
54
+ const authPersistence = authStorage();
55
+ const storedSelectedAuthSchemes = authPersistence.getSelectedSchemes(slug);
56
+ const availableSchemes = new Set(Object.keys(activeDocument.components?.securitySchemes ?? {}));
57
+ const selectedSchemes = storedSelectedAuthSchemes["x-scalar-selected-security"]?.selectedSchemes;
58
+ const validSchemes = selectedSchemes?.filter((scheme) => isSchemeValid(scheme, availableSchemes));
59
+ if (validSchemes && validSchemes.length > 0) {
60
+ const selectedIndex = storedSelectedAuthSchemes["x-scalar-selected-security"]?.selectedIndex ?? 0;
61
+ const clampedIndex = clampSelectedIndex(selectedIndex, validSchemes.length);
62
+ activeDocument["x-scalar-selected-security"] = {
63
+ selectedIndex: clampedIndex,
64
+ selectedSchemes: validSchemes
65
+ };
66
+ }
67
+ restoreAuthSecretsFromStorage(store);
68
+ };
69
+ export {
70
+ isSecretKey,
71
+ loadAuthSchemesFromStorage,
72
+ loadClientFromStorage,
73
+ mergeSecrets
74
+ };
@@ -1,5 +1,20 @@
1
1
  import type { ClientPlugin } from '@scalar/api-client/v2/helpers';
2
2
  import type { ApiReferenceConfigurationRaw } from '@scalar/types/api-reference';
3
- /** Map the config functions to plugins */
4
- export declare const mapConfigPlugins: (config: ApiReferenceConfigurationRaw) => ClientPlugin[];
3
+ import { type ComputedRef } from 'vue';
4
+ /**
5
+ * Maps API reference configuration callbacks to client plugins.
6
+ *
7
+ * This function transforms the legacy onBeforeRequest and onRequestSent callbacks
8
+ * into the new plugin hook system. The mapping is reactive, so changes to the
9
+ * configuration will automatically update the plugin hooks.
10
+ *
11
+ * Note: onRequestSent is mapped to responseReceived hook. This is not a perfect
12
+ * one-to-one mapping, but it maintains backward compatibility with the old API.
13
+ * The old callback receives only the URL string, while the new hook receives
14
+ * the full response object.
15
+ *
16
+ * @param config - Reactive configuration object containing optional hook callbacks
17
+ * @returns Array containing a single plugin with the mapped hooks
18
+ */
19
+ export declare const mapConfigPlugins: (config: ComputedRef<ApiReferenceConfigurationRaw>) => ClientPlugin[];
5
20
  //# sourceMappingURL=map-config-plugins.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"map-config-plugins.d.ts","sourceRoot":"","sources":["../../src/helpers/map-config-plugins.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AACjE,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,6BAA6B,CAAA;AAE/E,0CAA0C;AAC1C,eAAO,MAAM,gBAAgB,GAAI,QAAQ,4BAA4B,KAAG,YAAY,EAkCnF,CAAA"}
1
+ {"version":3,"file":"map-config-plugins.d.ts","sourceRoot":"","sources":["../../src/helpers/map-config-plugins.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AACjE,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,6BAA6B,CAAA;AAC/E,OAAO,EAAE,KAAK,WAAW,EAAS,MAAM,KAAK,CAAA;AAE7C;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,gBAAgB,GAAI,QAAQ,WAAW,CAAC,4BAA4B,CAAC,KAAG,YAAY,EAwChG,CAAA"}
@@ -1,28 +1,26 @@
1
+ import { watch } from "vue";
1
2
  const mapConfigPlugins = (config) => {
2
- const plugins = [];
3
- if (config.onBeforeRequest) {
4
- plugins.push({
5
- hooks: {
6
- beforeRequest: async (payload) => {
7
- const result = await config.onBeforeRequest?.(payload);
8
- if (result) {
9
- return result;
10
- }
11
- return payload;
12
- }
3
+ const plugin = { hooks: {} };
4
+ watch(
5
+ [() => config.value.onBeforeRequest, () => config.value.onRequestSent],
6
+ ([onBeforeRequest, onRequestSent]) => {
7
+ if (!plugin.hooks) {
8
+ plugin.hooks = {};
13
9
  }
14
- });
15
- }
16
- if (config.onRequestSent) {
17
- plugins.push({
18
- hooks: {
19
- responseReceived: (payload) => {
20
- config.onRequestSent?.(payload.request.url);
10
+ plugin.hooks.beforeRequest = onBeforeRequest ? async (payload) => {
11
+ const result = await onBeforeRequest(payload);
12
+ if (result === void 0) {
13
+ return payload;
21
14
  }
22
- }
23
- });
24
- }
25
- return plugins;
15
+ return result;
16
+ } : void 0;
17
+ plugin.hooks.responseReceived = onRequestSent ? (payload) => {
18
+ onRequestSent(payload.request.url);
19
+ } : void 0;
20
+ },
21
+ { immediate: true }
22
+ );
23
+ return [plugin];
26
24
  };
27
25
  export {
28
26
  mapConfigPlugins
@@ -1 +1 @@
1
- {"version":3,"file":"map-config-to-workspace-store.d.ts","sourceRoot":"","sources":["../../src/helpers/map-config-to-workspace-store.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,6BAA6B,CAAA;AAC/E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AAGpE,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,GAAG,EAA2C,MAAM,KAAK,CAAA;AAE9F,eAAO,MAAM,yBAAyB,GAAI,gCAIvC;IACD,MAAM,EAAE,gBAAgB,CAAC,4BAA4B,CAAC,CAAA;IACtD,KAAK,EAAE,cAAc,CAAA;IACrB,UAAU,EAAE,GAAG,CAAC,OAAO,CAAC,CAAA;CACzB,SAmDA,CAAA"}
1
+ {"version":3,"file":"map-config-to-workspace-store.d.ts","sourceRoot":"","sources":["../../src/helpers/map-config-to-workspace-store.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,6BAA6B,CAAA;AAC/E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AAGpE,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,GAAG,EAA4B,MAAM,KAAK,CAAA;AAE/E,eAAO,MAAM,yBAAyB,GAAI,gCAIvC;IACD,MAAM,EAAE,gBAAgB,CAAC,4BAA4B,CAAC,CAAA;IACtD,KAAK,EAAE,cAAc,CAAA;IACrB,UAAU,EAAE,GAAG,CAAC,OAAO,CAAC,CAAA;CACzB,SA2CA,CAAA"}
@@ -1,19 +1,12 @@
1
1
  import { isClient } from "@scalar/api-client/v2/blocks/operation-code-sample";
2
- import { safeLocalStorage, REFERENCE_LS_KEYS } from "@scalar/helpers/object/local-storage";
3
2
  import { useSeoMeta } from "@unhead/vue";
4
3
  import { useFavicon } from "@vueuse/core";
5
- import { onBeforeMount, watch, toValue, computed } from "vue";
4
+ import { watch, toValue, computed } from "vue";
6
5
  const mapConfigToWorkspaceStore = ({
7
6
  config,
8
7
  store,
9
8
  isDarkMode
10
9
  }) => {
11
- onBeforeMount(() => {
12
- const storedClient = safeLocalStorage().getItem(REFERENCE_LS_KEYS.SELECTED_CLIENT);
13
- if (isClient(storedClient) && !store.workspace["x-scalar-default-client"]) {
14
- store.update("x-scalar-default-client", storedClient);
15
- }
16
- });
17
10
  watch(
18
11
  () => toValue(config).defaultHttpClient,
19
12
  (newValue) => {
@@ -1,4 +1,4 @@
1
- import { type XScalarSelectedSecurity } from '@scalar/workspace-store/schemas/extensions/security/x-scalar-selected-security';
1
+ import type { XScalarSelectedSecurity } from '@scalar/workspace-store/schemas/extensions/security/x-scalar-selected-security';
2
2
  import { type SecuritySchemes } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
3
3
  /**
4
4
  * Provides an interface to store and retrieve the selected client value
@@ -24,7 +24,7 @@ export declare const authStorage: () => {
24
24
  /**
25
25
  * Retrieves and coerces the authentication schemes stored in local storage.
26
26
  */
27
- getSchemas: () => {
27
+ getSchemas: (slug: string) => {
28
28
  [x: string]: ({
29
29
  description?: string | undefined;
30
30
  } & {
@@ -324,20 +324,20 @@ export declare const authStorage: () => {
324
324
  * Stores the authentication schemes in local storage.
325
325
  * @param value The SecuritySchemes object to stringify and store.
326
326
  */
327
- setSchemas: (prefix: string, value: SecuritySchemes) => void;
327
+ setSchemas: (slug: string, value: SecuritySchemes) => void;
328
328
  /**
329
329
  * Retrieves and coerces the selected authentication schemes stored in local storage.
330
330
  */
331
- getSelectedSchemes: () => {
331
+ getSelectedSchemes: (slug: string) => {
332
332
  'x-scalar-selected-security'?: {
333
333
  selectedIndex: number;
334
- selectedSchemes: unknown[];
334
+ selectedSchemes: {}[];
335
335
  } | undefined;
336
336
  };
337
337
  /**
338
338
  * Stores the user's selected authentication schemes in local storage.
339
339
  * @param value The XScalarSelectedSecurity object to stringify and store.
340
340
  */
341
- setSelectedSchemes: (prefix: string, value: XScalarSelectedSecurity) => void;
341
+ setSelectedSchemes: (slug: string, value: XScalarSelectedSecurity) => void;
342
342
  };
343
343
  //# sourceMappingURL=storage.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../src/helpers/storage.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,uBAAuB,EAE7B,MAAM,gFAAgF,CAAA;AAEvF,OAAO,EACL,KAAK,eAAe,EAErB,MAAM,8DAA8D,CAAA;AAKrE;;;GAGG;AACH,eAAO,MAAM,aAAa;IAGtB;;OAEG;;IAIH;;;OAGG;iBACU,MAAM;CAItB,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,WAAW;IAIpB;;OAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAKH;;;OAGG;yBACkB,MAAM,SAAS,eAAe;IAGnD;;OAEG;;;;;;;IAKH;;;OAGG;iCAC0B,MAAM,SAAS,uBAAuB;CAItE,CAAA"}
1
+ {"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../src/helpers/storage.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,gFAAgF,CAAA;AAE7H,OAAO,EACL,KAAK,eAAe,EAGrB,MAAM,8DAA8D,CAAA;AAKrE;;;GAGG;AACH,eAAO,MAAM,aAAa;IAGtB;;OAEG;;IAIH;;;OAGG;iBACU,MAAM;CAItB,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,WAAW;IAYpB;;OAEG;uBACgB,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAIzB;;;OAGG;uBACgB,MAAM,SAAS,eAAe;IAGjD;;OAEG;+BACwB,MAAM;;;;;;IAIjC;;;OAGG;+BACwB,MAAM,SAAS,uBAAuB;CAIpE,CAAA"}
@@ -1,7 +1,6 @@
1
1
  import { REFERENCE_LS_KEYS, safeLocalStorage } from "@scalar/helpers/object/local-storage";
2
- import { XScalarSelectedSecuritySchema } from "@scalar/workspace-store/schemas/extensions/security/x-scalar-selected-security";
3
2
  import { coerceValue } from "@scalar/workspace-store/schemas/typebox-coerce";
4
- import { SecuritySchemesSchema } from "@scalar/workspace-store/schemas/v3.1/strict/openapi-document";
3
+ import { XScalarSelectedSecuritySchema, SecuritySchemesSchema } from "@scalar/workspace-store/schemas/v3.1/strict/openapi-document";
5
4
  const storage = safeLocalStorage();
6
5
  const clientStorage = () => {
7
6
  const key = REFERENCE_LS_KEYS.SELECTED_CLIENT;
@@ -24,34 +23,40 @@ const clientStorage = () => {
24
23
  const authStorage = () => {
25
24
  const schemasKey = REFERENCE_LS_KEYS.AUTH_SCHEMES;
26
25
  const selectedSchemesKey = REFERENCE_LS_KEYS.SELECTED_AUTH_SCHEMES;
26
+ const getAuthId = (type, prefix) => {
27
+ const getKey = (type2) => {
28
+ return type2 === "schemas" ? schemasKey : selectedSchemesKey;
29
+ };
30
+ return `${prefix}-${getKey(type)}`;
31
+ };
27
32
  return {
28
33
  /**
29
34
  * Retrieves and coerces the authentication schemes stored in local storage.
30
35
  */
31
- getSchemas: () => {
32
- const parsed = JSON.parse(storage.getItem(schemasKey) ?? "{}");
36
+ getSchemas: (slug) => {
37
+ const parsed = JSON.parse(storage.getItem(getAuthId("schemas", slug)) ?? "{}");
33
38
  return coerceValue(SecuritySchemesSchema, parsed);
34
39
  },
35
40
  /**
36
41
  * Stores the authentication schemes in local storage.
37
42
  * @param value The SecuritySchemes object to stringify and store.
38
43
  */
39
- setSchemas: (prefix, value) => {
40
- storage.setItem(`${prefix}-schemasKey`, JSON.stringify(value));
44
+ setSchemas: (slug, value) => {
45
+ storage.setItem(getAuthId("schemas", slug), JSON.stringify(value));
41
46
  },
42
47
  /**
43
48
  * Retrieves and coerces the selected authentication schemes stored in local storage.
44
49
  */
45
- getSelectedSchemes: () => {
46
- const parsed = JSON.parse(storage.getItem(selectedSchemesKey) ?? "{}");
50
+ getSelectedSchemes: (slug) => {
51
+ const parsed = JSON.parse(storage.getItem(getAuthId("selectedSchemes", slug)) ?? "{}");
47
52
  return coerceValue(XScalarSelectedSecuritySchema, parsed);
48
53
  },
49
54
  /**
50
55
  * Stores the user's selected authentication schemes in local storage.
51
56
  * @param value The XScalarSelectedSecurity object to stringify and store.
52
57
  */
53
- setSelectedSchemes: (prefix, value) => {
54
- storage.setItem(`${prefix}-selectedSchemesKey`, JSON.stringify(value));
58
+ setSelectedSchemes: (slug, value) => {
59
+ storage.setItem(getAuthId("selectedSchemes", slug), JSON.stringify(value));
55
60
  }
56
61
  };
57
62
  };
package/dist/style.css CHANGED
@@ -9184,7 +9184,7 @@ to {
9184
9184
  scrollbar-width: none;
9185
9185
  overflow: auto;
9186
9186
  }
9187
- .commandmenu[data-v-f2bbd082] {
9187
+ .commandmenu[data-v-dd90fe74] {
9188
9188
  box-shadow: var(--scalar-shadow-2);
9189
9189
  border-radius: var(--scalar-radius-lg);
9190
9190
  background-color: var(--scalar-background-1);
@@ -9193,20 +9193,20 @@ to {
9193
9193
  max-width: 580px;
9194
9194
  max-height: 60dvh;
9195
9195
  margin: 12px;
9196
- animation: .3s ease-in-out .1s forwards fadeincommandmenu-f2bbd082;
9196
+ animation: .3s ease-in-out .1s forwards fadeincommandmenu-dd90fe74;
9197
9197
  position: fixed;
9198
9198
  top: 150px;
9199
9199
  left: 50%;
9200
9200
  transform: translate3d(-50%, 10px, 0);
9201
9201
  }
9202
- .commandmenu-overlay[data-v-f2bbd082] {
9202
+ .commandmenu-overlay[data-v-dd90fe74] {
9203
9203
  cursor: pointer;
9204
9204
  background: #0003;
9205
- animation: .3s ease-in-out forwards fadeincommand-f2bbd082;
9205
+ animation: .3s ease-in-out forwards fadeincommand-dd90fe74;
9206
9206
  position: fixed;
9207
9207
  inset: 0;
9208
9208
  }
9209
- @keyframes fadeincommand-f2bbd082 {
9209
+ @keyframes fadeincommand-dd90fe74 {
9210
9210
  0% {
9211
9211
  opacity: 0;
9212
9212
  }
@@ -9214,7 +9214,7 @@ to {
9214
9214
  opacity: 1;
9215
9215
  }
9216
9216
  }
9217
- @keyframes fadeincommandmenu-f2bbd082 {
9217
+ @keyframes fadeincommandmenu-dd90fe74 {
9218
9218
  0% {
9219
9219
  opacity: 0;
9220
9220
  transform: translate3d(-50%, 10px, 0);
@@ -10101,10 +10101,10 @@ to {
10101
10101
  white-space: nowrap;
10102
10102
  display: flex;
10103
10103
  }
10104
- [data-v-1434cda7] .cm-editor {
10104
+ [data-v-e07e86c7] .cm-editor {
10105
10105
  padding: 0;
10106
10106
  }
10107
- [data-v-1434cda7] .cm-content {
10107
+ [data-v-e07e86c7] .cm-content {
10108
10108
  font-family: var(--scalar-font);
10109
10109
  font-size: var(--scalar-small);
10110
10110
  background-color: #0000;
@@ -10113,27 +10113,27 @@ to {
10113
10113
  padding: 5px 8px;
10114
10114
  display: flex;
10115
10115
  }
10116
- [data-v-1434cda7] .cm-content:has(.cm-pill) {
10116
+ [data-v-e07e86c7] .cm-content:has(.cm-pill) {
10117
10117
  padding: 5px 8px;
10118
10118
  }
10119
- [data-v-1434cda7] .cm-content .cm-pill:not(:last-of-type) {
10119
+ [data-v-e07e86c7] .cm-content .cm-pill:not(:last-of-type) {
10120
10120
  margin-right: .5px;
10121
10121
  }
10122
- [data-v-1434cda7] .cm-content .cm-pill:not(:first-of-type) {
10122
+ [data-v-e07e86c7] .cm-content .cm-pill:not(:first-of-type) {
10123
10123
  margin-left: .5px;
10124
10124
  }
10125
- [data-v-1434cda7] .cm-line {
10125
+ [data-v-e07e86c7] .cm-line {
10126
10126
  text-overflow: ellipsis;
10127
10127
  padding: 0;
10128
10128
  overflow: hidden;
10129
10129
  }
10130
- .filemask[data-v-1434cda7] {
10130
+ .filemask[data-v-e07e86c7] {
10131
10131
  -webkit-mask-image: linear-gradient(to right, transparent 0, var(--scalar-background-2) 20px);
10132
10132
  -webkit-mask-image: linear-gradient(to right, transparent 0, var(--scalar-background-2) 20px);
10133
10133
  -webkit-mask-image: linear-gradient(to right, transparent 0, var(--scalar-background-2) 20px);
10134
10134
  mask-image: linear-gradient(to right, transparent 0, var(--scalar-background-2) 20px);
10135
10135
  }
10136
- [data-v-cbed7b55] .cm-content {
10136
+ [data-v-0a6f7696] .cm-content {
10137
10137
  font-size: var(--scalar-small);
10138
10138
  }
10139
10139
  .form-group[data-v-43df1726] {
@@ -10182,31 +10182,31 @@ input[data-v-3157c3c7]::placeholder {
10182
10182
  -webkit-text-security: disc;
10183
10183
  -moz-text-security: disc;
10184
10184
  }
10185
- .request-section-content[data-v-13f5983a] {
10185
+ .request-section-content[data-v-35cedd3d] {
10186
10186
  --scalar-border-width: .5px;
10187
10187
  }
10188
- .request-section-content-filter[data-v-13f5983a] {
10188
+ .request-section-content-filter[data-v-35cedd3d] {
10189
10189
  box-shadow: 0 -10px 0 10px var(--scalar-background-1);
10190
10190
  }
10191
- .request-item:focus-within .request-meta-buttons[data-v-13f5983a] {
10191
+ .request-item:focus-within .request-meta-buttons[data-v-35cedd3d] {
10192
10192
  opacity: 1;
10193
10193
  }
10194
- .group-hover-input[data-v-13f5983a] {
10194
+ .group-hover-input[data-v-35cedd3d] {
10195
10195
  border-width: var(--scalar-border-width);
10196
10196
  border-color: #0000;
10197
10197
  }
10198
- .group:hover .group-hover-input[data-v-13f5983a] {
10198
+ .group:hover .group-hover-input[data-v-35cedd3d] {
10199
10199
  background: var(--scalar-background-1);
10200
10200
  }
10201
10201
  @supports (color: color-mix(in lab, red, red)) {
10202
- .group:hover .group-hover-input[data-v-13f5983a] {
10202
+ .group:hover .group-hover-input[data-v-35cedd3d] {
10203
10203
  background: color-mix(in srgb, var(--scalar-background-1), var(--scalar-background-2));
10204
10204
  }
10205
10205
  }
10206
- .group:hover .group-hover-input[data-v-13f5983a] {
10206
+ .group:hover .group-hover-input[data-v-35cedd3d] {
10207
10207
  border-color: var(--scalar-border-color);
10208
10208
  }
10209
- .group-hover-input[data-v-13f5983a]:focus {
10209
+ .group-hover-input[data-v-35cedd3d]:focus {
10210
10210
  border-color: var(--scalar-border-color) !important;
10211
10211
  background: none !important;
10212
10212
  }
@@ -11141,10 +11141,10 @@ to {
11141
11141
  transform: translate3d(calc(-100% - 4.5px), 0, 0);
11142
11142
  }
11143
11143
  .indent-border-line-offset[data-v-4f5a9d1f]:before {
11144
- left: var(--0bed2d4e);
11144
+ left: var(--v0bed2d4e);
11145
11145
  }
11146
11146
  .indent-padding-left[data-v-4f5a9d1f] {
11147
- padding-left: calc(var(--57ee1db0) + 6px);
11147
+ padding-left: calc(var(--v57ee1db0) + 6px);
11148
11148
  }
11149
11149
  .sidebar-folderitem[data-v-4f5a9d1f] .ellipsis-position {
11150
11150
  right: 6px;
@@ -11548,7 +11548,7 @@ to {
11548
11548
 
11549
11549
  /* Configurable Layout Variables */
11550
11550
  @layer scalar-config {
11551
- .scalar-api-reference[data-v-8456284e] {
11551
+ .scalar-api-reference[data-v-9b26f178] {
11552
11552
  --refs-sidebar-width: var(--scalar-sidebar-width, 0px);
11553
11553
  /* The header height */
11554
11554
  --refs-header-height: calc(
@@ -11564,7 +11564,7 @@ to {
11564
11564
  );
11565
11565
  --refs-content-max-width: var(--scalar-content-max-width, 1540px);
11566
11566
  }
11567
- .scalar-api-reference.references-classic[data-v-8456284e] {
11567
+ .scalar-api-reference.references-classic[data-v-9b26f178] {
11568
11568
  /* Classic layout is wider */
11569
11569
  --refs-content-max-width: var(--scalar-content-max-width, 1420px);
11570
11570
  min-height: 100dvh;
@@ -11572,14 +11572,14 @@ to {
11572
11572
  }
11573
11573
 
11574
11574
  /* When the toolbar is present, we need to offset the content */
11575
- .scalar-api-reference[data-v-8456284e]:has(.api-reference-toolbar) {
11575
+ .scalar-api-reference[data-v-9b26f178]:has(.api-reference-toolbar) {
11576
11576
  --refs-content-offset: 48px;
11577
11577
  }
11578
11578
  }
11579
11579
 
11580
11580
  /* ----------------------------------------------------- */
11581
11581
  /* References Layout */
11582
- .references-layout[data-v-8456284e] {
11582
+ .references-layout[data-v-9b26f178] {
11583
11583
  /* Try to fill the container */
11584
11584
  min-height: 100dvh;
11585
11585
  min-width: 100%;
@@ -11603,39 +11603,39 @@ to {
11603
11603
 
11604
11604
  background: var(--scalar-background-1);
11605
11605
  }
11606
- .references-editor[data-v-8456284e] {
11606
+ .references-editor[data-v-9b26f178] {
11607
11607
  grid-area: editor;
11608
11608
  display: flex;
11609
11609
  min-width: 0;
11610
11610
  background: var(--scalar-background-1);
11611
11611
  }
11612
- .references-rendered[data-v-8456284e] {
11612
+ .references-rendered[data-v-9b26f178] {
11613
11613
  position: relative;
11614
11614
  grid-area: rendered;
11615
11615
  min-width: 0;
11616
11616
  background: var(--scalar-background-1);
11617
11617
  }
11618
- .scalar-api-reference.references-classic[data-v-8456284e],
11619
- .references-classic .references-rendered[data-v-8456284e] {
11618
+ .scalar-api-reference.references-classic[data-v-9b26f178],
11619
+ .references-classic .references-rendered[data-v-9b26f178] {
11620
11620
  height: initial !important;
11621
11621
  max-height: initial !important;
11622
11622
  }
11623
11623
  @layer scalar-config {
11624
- .references-sidebar[data-v-8456284e] {
11624
+ .references-sidebar[data-v-9b26f178] {
11625
11625
  /* Set a default width if references are enabled */
11626
11626
  --refs-sidebar-width: var(--scalar-sidebar-width, 280px);
11627
11627
  }
11628
11628
  }
11629
11629
 
11630
11630
  /* Footer */
11631
- .references-footer[data-v-8456284e] {
11631
+ .references-footer[data-v-9b26f178] {
11632
11632
  grid-area: footer;
11633
11633
  }
11634
11634
  /* ----------------------------------------------------- */
11635
11635
  /* Responsive / Mobile Layout */
11636
11636
  @media (max-width: 1000px) {
11637
11637
  /* Stack view on mobile */
11638
- .references-layout[data-v-8456284e] {
11638
+ .references-layout[data-v-9b26f178] {
11639
11639
  grid-template-columns: 100%;
11640
11640
  grid-template-rows: var(--scalar-header-height, 0px) 0px auto auto;
11641
11641
 
@@ -11645,13 +11645,13 @@ to {
11645
11645
  'rendered'
11646
11646
  'footer';
11647
11647
  }
11648
- .references-editable[data-v-8456284e] {
11648
+ .references-editable[data-v-9b26f178] {
11649
11649
  grid-template-areas:
11650
11650
  'header'
11651
11651
  'navigation'
11652
11652
  'editor';
11653
11653
  }
11654
- .references-rendered[data-v-8456284e] {
11654
+ .references-rendered[data-v-9b26f178] {
11655
11655
  position: static;
11656
11656
  }
11657
11657
  }
@@ -11662,12 +11662,12 @@ to {
11662
11662
  * when the new elements are available
11663
11663
  */
11664
11664
  @media (max-width: 1000px) {
11665
- .scalar-api-references-standalone-mobile[data-v-8456284e] {
11665
+ .scalar-api-references-standalone-mobile[data-v-9b26f178] {
11666
11666
  --scalar-header-height: 50px;
11667
11667
  }
11668
11668
  }
11669
11669
 
11670
- .darklight-reference[data-v-8456284e] {
11670
+ .darklight-reference[data-v-9b26f178] {
11671
11671
  width: 100%;
11672
11672
  margin-top: auto;
11673
11673
  }
package/package.json CHANGED
@@ -20,7 +20,7 @@
20
20
  "vue",
21
21
  "vue3"
22
22
  ],
23
- "version": "1.43.5",
23
+ "version": "1.43.7",
24
24
  "engines": {
25
25
  "node": ">=20"
26
26
  },
@@ -85,51 +85,51 @@
85
85
  "github-slugger": "^2.0.0",
86
86
  "js-base64": "^3.7.8",
87
87
  "microdiff": "^1.5.0",
88
- "nanoid": "5.1.5",
89
- "type-fest": "5.0.0",
90
- "vue": "^3.5.21",
91
- "zod": "^4.1.11",
92
- "@scalar/api-client": "2.18.1",
88
+ "nanoid": "^5.1.6",
89
+ "type-fest": "^5.3.1",
90
+ "vue": "^3.5.26",
91
+ "zod": "^4.3.5",
92
+ "@scalar/api-client": "2.18.3",
93
93
  "@scalar/code-highlight": "0.2.2",
94
- "@scalar/components": "0.16.20",
95
- "@scalar/helpers": "0.2.7",
96
- "@scalar/json-magic": "0.9.0",
97
- "@scalar/openapi-parser": "0.23.13",
98
- "@scalar/oas-utils": "0.6.17",
99
- "@scalar/openapi-upgrader": "0.1.7",
94
+ "@scalar/components": "0.16.22",
95
+ "@scalar/icons": "0.5.2",
96
+ "@scalar/helpers": "0.2.8",
97
+ "@scalar/oas-utils": "0.6.19",
98
+ "@scalar/json-magic": "0.9.1",
99
+ "@scalar/openapi-parser": "0.24.1",
100
100
  "@scalar/openapi-types": "0.5.3",
101
- "@scalar/object-utils": "1.2.21",
102
- "@scalar/sidebar": "0.7.10",
103
- "@scalar/snippetz": "0.6.4",
101
+ "@scalar/object-utils": "1.2.22",
102
+ "@scalar/openapi-upgrader": "0.1.7",
103
+ "@scalar/sidebar": "0.7.12",
104
+ "@scalar/snippetz": "0.6.5",
104
105
  "@scalar/themes": "0.13.26",
105
- "@scalar/types": "0.5.7",
106
- "@scalar/icons": "0.5.2",
106
+ "@scalar/types": "0.5.8",
107
107
  "@scalar/use-toasts": "0.9.1",
108
- "@scalar/workspace-store": "0.24.7",
109
- "@scalar/use-hooks": "0.3.6"
108
+ "@scalar/use-hooks": "0.3.6",
109
+ "@scalar/workspace-store": "0.24.9"
110
110
  },
111
111
  "devDependencies": {
112
- "@hono/node-server": "1.19.5",
112
+ "@hono/node-server": "^1.19.7",
113
113
  "@playwright/test": "1.56.0",
114
114
  "@tailwindcss/vite": "^4.1.18",
115
115
  "@types/react": "^19.2.7",
116
116
  "@types/react-dom": "^19.2.3",
117
- "@vitejs/plugin-vue": "6.0.1",
118
- "@vue/server-renderer": "^3.5.17",
117
+ "@vitejs/plugin-vue": "^6.0.3",
118
+ "@vue/server-renderer": "^3.5.26",
119
119
  "@vue/test-utils": "2.4.6",
120
120
  "hono": "4.11.4",
121
- "react": "^19.1.0",
122
- "react-dom": "^19.1.0",
121
+ "react": "^19.2.3",
122
+ "react-dom": "^19.2.3",
123
123
  "rollup-plugin-webpack-stats": "^0.2.5",
124
124
  "tailwindcss": "^4.1.18",
125
- "vite": "7.3.0",
126
- "vite-plugin-banner": "^0.7.1",
127
- "vite-plugin-css-injected-by-js": "^3.4.0",
128
- "vitest": "3.2.4",
125
+ "vite": "^7.3.1",
126
+ "vite-plugin-banner": "^0.8.1",
127
+ "vite-plugin-css-injected-by-js": "^3.5.2",
128
+ "vitest": "4.0.16",
129
129
  "@scalar/build-tooling": "0.4.1",
130
- "@scalar/core": "0.3.31",
131
- "@scalar/galaxy": "0.5.12",
132
- "@scalar/react-renderer": "0.3.0"
130
+ "@scalar/core": "0.3.32",
131
+ "@scalar/react-renderer": "0.3.0",
132
+ "@scalar/galaxy": "0.5.12"
133
133
  },
134
134
  "scripts": {
135
135
  "build": "pnpm build:default && pnpm build:standalone && pnpm types:build",