@scalar/api-reference 1.31.8 → 1.31.9

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 (183) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/dist/browser/standalone.js +18613 -18470
  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 +10 -30
  6. package/dist/components/ApiReferenceLayout.vue.d.ts.map +1 -1
  7. package/dist/components/ApiReferenceLayout.vue.js +2 -2
  8. package/dist/components/ApiReferenceLayout.vue2.js +240 -222
  9. package/dist/components/Content/Content.vue.d.ts +2 -0
  10. package/dist/components/Content/Content.vue.d.ts.map +1 -1
  11. package/dist/components/Content/Content.vue.js +2 -2
  12. package/dist/components/Content/Content.vue2.js +84 -74
  13. package/dist/components/Content/Introduction/Introduction.vue.d.ts +1 -3
  14. package/dist/components/Content/Introduction/Introduction.vue.d.ts.map +1 -1
  15. package/dist/components/Content/Introduction/Introduction.vue.js +2 -2
  16. package/dist/components/Content/Introduction/Introduction.vue2.js +93 -83
  17. package/dist/components/Content/Lazy/Loading.vue.d.ts.map +1 -1
  18. package/dist/components/Content/Lazy/Loading.vue.js +84 -86
  19. package/dist/components/Content/Models/Models.vue.js +1 -1
  20. package/dist/components/Content/Models/Models.vue2.js +4 -4
  21. package/dist/components/Content/Schema/Schema.vue.d.ts.map +1 -1
  22. package/dist/components/Content/Schema/Schema.vue.js +2 -2
  23. package/dist/components/Content/Schema/Schema.vue2.js +53 -53
  24. package/dist/components/Content/Schema/SchemaDiscriminator.vue.d.ts.map +1 -1
  25. package/dist/components/Content/Schema/SchemaDiscriminator.vue.js +1 -1
  26. package/dist/components/Content/Schema/SchemaProperty.vue.d.ts.map +1 -1
  27. package/dist/components/Content/Schema/SchemaProperty.vue.js +1 -1
  28. package/dist/components/Content/Schema/SchemaProperty.vue2.js +117 -112
  29. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.d.ts.map +1 -1
  30. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.js +2 -2
  31. package/dist/components/Content/Schema/SchemaPropertyHeading.vue2.js +161 -191
  32. package/dist/components/Content/Schema/helpers/schema-name.d.ts +13 -0
  33. package/dist/components/Content/Schema/helpers/schema-name.d.ts.map +1 -1
  34. package/dist/components/Content/Schema/helpers/schema-name.js +59 -13
  35. package/dist/components/Content/Tag/OperationsList.vue.d.ts.map +1 -1
  36. package/dist/components/Content/Tag/OperationsList.vue.js +1 -1
  37. package/dist/components/Content/Tag/OperationsList.vue2.js +22 -25
  38. package/dist/components/Content/Tag/OperationsListItem.vue.d.ts +2 -3
  39. package/dist/components/Content/Tag/OperationsListItem.vue.d.ts.map +1 -1
  40. package/dist/components/Content/Tag/OperationsListItem.vue.js +2 -2
  41. package/dist/components/Content/Tag/OperationsListItem.vue2.js +46 -47
  42. package/dist/components/Content/Tag/Tag.vue.d.ts.map +1 -1
  43. package/dist/components/Content/Tag/Tag.vue.js +45 -47
  44. package/dist/components/Content/Tag/TagList.vue.d.ts +2 -0
  45. package/dist/components/Content/Tag/TagList.vue.d.ts.map +1 -1
  46. package/dist/components/Content/Tag/TagList.vue.js +40 -41
  47. package/dist/components/Content/Tag/TagSection.vue.d.ts.map +1 -1
  48. package/dist/components/Content/Tag/TagSection.vue.js +2 -2
  49. package/dist/components/Content/Tag/TagSection.vue2.js +21 -21
  50. package/dist/components/HttpMethod/HttpMethod.vue.d.ts +16 -1
  51. package/dist/components/HttpMethod/HttpMethod.vue.d.ts.map +1 -1
  52. package/dist/components/HttpMethod/HttpMethod.vue.js +12 -11
  53. package/dist/components/MobileHeader.vue.d.ts +1 -8
  54. package/dist/components/MobileHeader.vue.d.ts.map +1 -1
  55. package/dist/components/MobileHeader.vue.js +1 -1
  56. package/dist/components/MobileHeader.vue2.js +19 -19
  57. package/dist/components/Section/Section.vue.js +2 -2
  58. package/dist/components/Section/Section.vue2.js +1 -1
  59. package/dist/components/ShowMoreButton.vue.js +2 -2
  60. package/dist/components/ShowMoreButton.vue2.js +1 -1
  61. package/dist/components/Sidebar/Sidebar.vue.d.ts +2 -4
  62. package/dist/components/Sidebar/Sidebar.vue.d.ts.map +1 -1
  63. package/dist/components/Sidebar/Sidebar.vue.js +1 -1
  64. package/dist/components/Sidebar/Sidebar.vue2.js +113 -159
  65. package/dist/components/Sidebar/SidebarElement.vue.d.ts +2 -11
  66. package/dist/components/Sidebar/SidebarElement.vue.d.ts.map +1 -1
  67. package/dist/components/Sidebar/SidebarElement.vue.js +2 -2
  68. package/dist/components/Sidebar/SidebarElement.vue2.js +85 -81
  69. package/dist/components/Sidebar/SidebarHttpBadge.vue.d.ts +16 -1
  70. package/dist/components/Sidebar/SidebarHttpBadge.vue.d.ts.map +1 -1
  71. package/dist/components/Sidebar/SidebarHttpBadge.vue.js +2 -2
  72. package/dist/components/Sidebar/SidebarHttpBadge.vue2.js +11 -5
  73. package/dist/features/ApiClientModal/ApiClientModal.vue.d.ts.map +1 -1
  74. package/dist/features/ApiClientModal/ApiClientModal.vue.js +54 -42
  75. package/dist/features/ApiClientModal/useApiClient.d.ts +74 -72
  76. package/dist/features/ApiClientModal/useApiClient.d.ts.map +1 -1
  77. package/dist/features/DocumentSource/hooks/useDocumentSource.d.ts +0 -2
  78. package/dist/features/DocumentSource/hooks/useDocumentSource.d.ts.map +1 -1
  79. package/dist/features/DocumentSource/hooks/useDocumentSource.js +40 -67
  80. package/dist/features/DownloadLink/DownloadLink.vue.js +1 -1
  81. package/dist/features/ExampleRequest/ExampleRequest.vue.d.ts +5 -5
  82. package/dist/features/ExampleRequest/ExampleRequest.vue.d.ts.map +1 -1
  83. package/dist/features/ExampleRequest/ExampleRequest.vue.js +1 -1
  84. package/dist/features/ExampleRequest/ExampleRequest.vue2.js +200 -179
  85. package/dist/features/Operation/Operation.vue.d.ts +0 -1
  86. package/dist/features/Operation/Operation.vue.d.ts.map +1 -1
  87. package/dist/features/Operation/Operation.vue.js +31 -34
  88. package/dist/features/Operation/components/OperationParameters.vue.d.ts +3 -2
  89. package/dist/features/Operation/components/OperationParameters.vue.d.ts.map +1 -1
  90. package/dist/features/Operation/components/OperationParameters.vue.js +62 -64
  91. package/dist/features/Operation/components/OperationResponses.vue.d.ts +1 -2
  92. package/dist/features/Operation/components/OperationResponses.vue.d.ts.map +1 -1
  93. package/dist/features/Operation/components/OperationResponses.vue.js +2 -2
  94. package/dist/features/Operation/components/callbacks/Callback.vue.d.ts.map +1 -1
  95. package/dist/features/Operation/components/callbacks/Callback.vue.js +3 -3
  96. package/dist/features/Operation/components/callbacks/Callback.vue2.js +31 -38
  97. package/dist/features/Operation/hooks/useResponses.d.ts +3 -3
  98. package/dist/features/Operation/hooks/useResponses.d.ts.map +1 -1
  99. package/dist/features/Operation/hooks/useResponses.js +12 -13
  100. package/dist/features/Operation/index.d.ts +0 -1
  101. package/dist/features/Operation/index.d.ts.map +1 -1
  102. package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts +4 -6
  103. package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts.map +1 -1
  104. package/dist/features/Operation/layouts/ClassicLayout.vue.js +2 -2
  105. package/dist/features/Operation/layouts/ClassicLayout.vue2.js +85 -72
  106. package/dist/features/Operation/layouts/ModernLayout.vue.d.ts +2 -4
  107. package/dist/features/Operation/layouts/ModernLayout.vue.d.ts.map +1 -1
  108. package/dist/features/Operation/layouts/ModernLayout.vue.js +2 -2
  109. package/dist/features/Operation/layouts/ModernLayout.vue2.js +114 -98
  110. package/dist/features/Search/SearchModal.vue.js +2 -2
  111. package/dist/features/Search/SearchModal.vue2.js +1 -1
  112. package/dist/features/Search/useSearchIndex.d.ts.map +1 -1
  113. package/dist/features/Search/useSearchIndex.js +61 -64
  114. package/dist/features/sidebar/helpers/create-sidebar.d.ts +4 -2
  115. package/dist/features/sidebar/helpers/create-sidebar.d.ts.map +1 -1
  116. package/dist/features/sidebar/helpers/create-sidebar.js +33 -0
  117. package/dist/features/sidebar/hooks/useSidebar.d.ts +2 -3
  118. package/dist/features/sidebar/hooks/useSidebar.d.ts.map +1 -1
  119. package/dist/features/sidebar/hooks/useSidebar.js +18 -0
  120. package/dist/features/sidebar/index.d.ts +2 -1
  121. package/dist/features/sidebar/index.d.ts.map +1 -1
  122. package/dist/features/traverse-schema/helpers/get-tag.d.ts +4 -2
  123. package/dist/features/traverse-schema/helpers/get-tag.d.ts.map +1 -1
  124. package/dist/features/traverse-schema/helpers/get-tag.js +7 -0
  125. package/dist/features/traverse-schema/helpers/traverse-description.js +33 -0
  126. package/dist/features/traverse-schema/helpers/traverse-document.d.ts.map +1 -1
  127. package/dist/features/traverse-schema/helpers/traverse-document.js +34 -0
  128. package/dist/features/traverse-schema/helpers/traverse-paths.d.ts +5 -3
  129. package/dist/features/traverse-schema/helpers/traverse-paths.d.ts.map +1 -1
  130. package/dist/features/traverse-schema/helpers/traverse-paths.js +32 -0
  131. package/dist/features/traverse-schema/helpers/traverse-schemas.d.ts +2 -2
  132. package/dist/features/traverse-schema/helpers/traverse-schemas.d.ts.map +1 -1
  133. package/dist/features/traverse-schema/helpers/traverse-schemas.js +23 -0
  134. package/dist/features/traverse-schema/helpers/traverse-tags.d.ts +2 -2
  135. package/dist/features/traverse-schema/helpers/traverse-tags.d.ts.map +1 -1
  136. package/dist/features/traverse-schema/helpers/traverse-tags.js +43 -0
  137. package/dist/features/traverse-schema/helpers/traverse-webhooks.d.ts +2 -2
  138. package/dist/features/traverse-schema/helpers/traverse-webhooks.d.ts.map +1 -1
  139. package/dist/features/traverse-schema/helpers/traverse-webhooks.js +26 -0
  140. package/dist/features/traverse-schema/index.d.ts +3 -3
  141. package/dist/features/traverse-schema/index.d.ts.map +1 -1
  142. package/dist/features/traverse-schema/types.d.ts +8 -5
  143. package/dist/features/traverse-schema/types.d.ts.map +1 -1
  144. package/dist/helpers/parse.d.ts +2 -1
  145. package/dist/helpers/parse.d.ts.map +1 -1
  146. package/dist/helpers/parse.js +72 -88
  147. package/dist/hooks/useMultipleDocuments.d.ts +6 -6
  148. package/dist/hooks/useMultipleDocuments.d.ts.map +1 -1
  149. package/dist/hooks/useNavState.d.ts +1 -1
  150. package/dist/hooks/useNavState.d.ts.map +1 -1
  151. package/dist/hooks/useNavState.js +14 -9
  152. package/dist/hooks/useOperation.d.ts +7 -7
  153. package/dist/hooks/useOperation.d.ts.map +1 -1
  154. package/dist/hooks/useOperation.js +13 -12
  155. package/dist/index.d.ts +0 -1
  156. package/dist/index.d.ts.map +1 -1
  157. package/dist/index.js +23 -25
  158. package/dist/legacy/fixtures/index.d.ts +1 -1
  159. package/dist/libs/openapi.d.ts +3 -4
  160. package/dist/libs/openapi.d.ts.map +1 -1
  161. package/dist/libs/openapi.js +8 -9
  162. package/dist/style.css +1 -1
  163. package/dist/v2/ApiReferenceWorkspace.vue.d.ts +4 -18
  164. package/dist/v2/ApiReferenceWorkspace.vue.d.ts.map +1 -1
  165. package/dist/v2/ApiReferenceWorkspace.vue.js +68 -45
  166. package/package.json +16 -16
  167. package/dist/components/Content/Webhooks/index.d.ts +0 -2
  168. package/dist/components/Content/Webhooks/index.d.ts.map +0 -1
  169. package/dist/features/Operation/Webhooks.vue.d.ts +0 -7
  170. package/dist/features/Operation/Webhooks.vue.d.ts.map +0 -1
  171. package/dist/features/Operation/Webhooks.vue.js +0 -7
  172. package/dist/features/Operation/Webhooks.vue2.js +0 -121
  173. package/dist/features/Operation/components/Webhook.vue.d.ts +0 -7
  174. package/dist/features/Operation/components/Webhook.vue.d.ts.map +0 -1
  175. package/dist/features/Operation/components/Webhook.vue.js +0 -7
  176. package/dist/features/Operation/components/Webhook.vue2.js +0 -29
  177. package/dist/features/traverse-schema/helpers/operation-id-params.d.ts +0 -8
  178. package/dist/features/traverse-schema/helpers/operation-id-params.d.ts.map +0 -1
  179. package/dist/features/traverse-schema/helpers/operation-id-params.js +0 -8
  180. package/dist/hooks/useSidebar.d.ts +0 -53
  181. package/dist/hooks/useSidebar.d.ts.map +0 -1
  182. package/dist/hooks/useSidebar.js +0 -248
  183. package/dist/legacy/fixtures/httpRequestMethods.js +0 -14
@@ -2,6 +2,11 @@ import type { ApiReferenceConfiguration } from '@scalar/types/api-reference';
2
2
  import type { UseNavState } from '../../hooks/useNavState.js';
3
3
  import type { Ref } from 'vue';
4
4
  import type { OpenAPIV3_1 } from '@scalar/openapi-types';
5
+ /** Map of tagNames and their entries */
6
+ export type TagsMap = Map<string, {
7
+ tag: OpenAPIV3_1.TagObject;
8
+ entries: TraversedEntry[];
9
+ }>;
5
10
  /** Description entry returned form traversing the document */
6
11
  export type TraversedDescription = {
7
12
  id: string;
@@ -27,10 +32,10 @@ export type TraversedSchema = {
27
32
  export type TraversedTag = {
28
33
  id: string;
29
34
  title: string;
30
- name: string;
31
- children?: TraversedEntry[];
35
+ children: TraversedEntry[];
32
36
  tag: OpenAPIV3_1.TagObject;
33
37
  isGroup: boolean;
38
+ isWebhooks?: boolean;
34
39
  };
35
40
  /** Webhook entry returned form traversing the document, basically the same as an operaation but with name instead of path */
36
41
  export type TraversedWebhook = {
@@ -42,10 +47,8 @@ export type TraversedWebhook = {
42
47
  };
43
48
  /** Entries returned form traversing the document */
44
49
  export type TraversedEntry = TraversedDescription | TraversedOperation | TraversedSchema | TraversedTag | TraversedWebhook;
45
- /** Create sidebar options */
50
+ /** Options for traversing the spec */
46
51
  export type TraverseSpecOptions = {
47
52
  config: Ref<ApiReferenceConfiguration>;
48
- /** You can optionally pass in these refs in case you need them before the hook is instantiated */
49
- isSidebarOpen?: Ref<boolean>;
50
53
  } & Pick<UseNavState, 'getHeadingId' | 'getModelId' | 'getOperationId' | 'getSectionId' | 'getTagId' | 'getWebhookId'>;
51
54
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/features/traverse-schema/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAA;AAE5E,OAAO,KAAK,EAA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CAAC,eAAe,CAAA;CACvC,CAAA;AAED,wDAAwD;AACxD,MAAM,MAAM,eAAe,GAAG;IAC5B,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,WAAW,CAAC,YAAY,CAAA;CACjC,CAAA;AAED,0EAA0E;AAC1E,MAAM,MAAM,YAAY,GAAG;IACzB,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,cAAc,EAAE,CAAA;IAC1B,GAAG,EAAE,WAAW,CAAC,SAAS,CAAA;IAC1B,OAAO,EAAE,OAAO,CAAA;IAChB,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB,CAAA;AAED,6HAA6H;AAC7H,MAAM,MAAM,gBAAgB,GAAG;IAC7B,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,WAAW,CAAC,WAAW,CAAA;IAC/B,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,WAAW,CAAC,eAAe,CAAA;CACrC,CAAA;AAED,oDAAoD;AACpD,MAAM,MAAM,cAAc,GACtB,oBAAoB,GACpB,kBAAkB,GAClB,eAAe,GACf,YAAY,GACZ,gBAAgB,CAAA;AAEpB,sCAAsC;AACtC,MAAM,MAAM,mBAAmB,GAAG;IAChC,MAAM,EAAE,GAAG,CAAC,yBAAyB,CAAC,CAAA;CACvC,GAAG,IAAI,CAAC,WAAW,EAAE,cAAc,GAAG,YAAY,GAAG,gBAAgB,GAAG,cAAc,GAAG,UAAU,GAAG,cAAc,CAAC,CAAA"}
@@ -1,9 +1,10 @@
1
1
  import type { OpenAPIV3_1 } from '@scalar/openapi-types';
2
2
  import type { Spec } from '@scalar/types/legacy';
3
+ import type { TraversedEntry } from '../features/traverse-schema';
3
4
  /**
4
5
  * Parse the given dereferencedDocument and return a super custom transformed dereferencedDocument.
5
6
  *
6
7
  * @deprecated Try to use a store instead.
7
8
  */
8
- export declare const parse: (dereferencedDocument: OpenAPIV3_1.Document) => Promise<Spec>;
9
+ export declare const parse: (dereferencedDocument: OpenAPIV3_1.Document, items?: TraversedEntry[]) => Promise<Spec>;
9
10
  //# sourceMappingURL=parse.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../../src/helpers/parse.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACxD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAQhD;;;;GAIG;AACH,eAAO,MAAM,KAAK,yBAA0B,WAAW,CAAC,QAAQ,KAAG,OAAO,CAAC,IAAI,CAmB9E,CAAA"}
1
+ {"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../../src/helpers/parse.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACxD,OAAO,KAAK,EAAE,IAAI,EAAwB,MAAM,sBAAsB,CAAA;AAGtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAKhE;;;;GAIG;AACH,eAAO,MAAM,KAAK,yBAA0B,WAAW,CAAC,QAAQ,UAAU,cAAc,EAAE,KAAG,OAAO,CAAC,IAAI,CAiBrG,CAAA"}
@@ -1,97 +1,81 @@
1
- import { shouldIgnoreEntity as m } from "@scalar/oas-utils/helpers";
2
1
  import { createEmptySpecification as w } from "../libs/openapi.js";
3
- import { normalizeHttpMethod as P } from "@scalar/helpers/http/normalize-http-method";
4
- import { validRequestMethods as A } from "../legacy/fixtures/httpRequestMethods.js";
5
- const C = (c) => new Promise(async (t, p) => {
2
+ import { normalizeHttpMethod as m } from "@scalar/helpers/http/normalize-http-method";
3
+ const I = (s, i) => new Promise((e, b) => {
6
4
  try {
7
- return t(b(c || w()));
8
- } catch (l) {
9
- console.error("[@scalar/api-reference]", "Failed to parse the OpenAPI document. It might be invalid?"), console.error(l), p(l);
5
+ return e(s ? k(s, i) : k(w()));
6
+ } catch (p) {
7
+ console.error("[@scalar/api-reference]", "Failed to parse the OpenAPI document. It might be invalid?"), console.error(p), b(p);
10
8
  }
11
- return t(b(w()));
12
- }), b = (c) => {
13
- var E, O;
14
- let t = {};
15
- c && typeof c == "object" ? t = c : t = w(), t.tags || (t.tags = []), t.paths || (t.paths = {}), t.components || (t.components = {}), t.webhooks || (t.webhooks = {}), t.servers || (t.servers = []), t.security || (t.security = []);
16
- const p = {};
17
- return Object.keys(t.webhooks ?? {}).forEach((s) => {
18
- var d;
19
- Object.keys(((d = t.webhooks) == null ? void 0 : d[s]) ?? {}).forEach((r) => {
20
- var n, u, h, g;
21
- const e = (n = t.webhooks) == null ? void 0 : n[s][r];
22
- if (!(!e || m(e))) {
23
- if (Array.isArray(e.tags)) {
24
- const o = (u = e.tags) == null ? void 0 : u.map(
25
- (a) => {
26
- var y;
27
- return (y = t.tags) == null ? void 0 : y.find((i) => i.name === a);
28
- }
29
- );
30
- if (e.tags = o == null ? void 0 : o.filter((a) => !m(a)), o != null && o.some((a) => m(a)))
31
- return;
32
- }
33
- p[s] === void 0 && (p[s] = {}), p[s][r] = {
34
- // Transformed data
35
- httpVerb: P(r),
36
- path: s,
37
- operationId: (e == null ? void 0 : e.operationId) || s,
38
- name: (e == null ? void 0 : e.summary) || s || "",
39
- description: (e == null ? void 0 : e.description) || "",
40
- pathParameters: (g = (h = t.paths) == null ? void 0 : h[s]) == null ? void 0 : g.parameters,
41
- // Original webhook
42
- information: {
43
- ...e
44
- }
45
- };
46
- }
9
+ return e(k(w()));
10
+ }), k = (s, i) => {
11
+ let e = {};
12
+ s && typeof s == "object" ? e = s : e = w(), e.tags || (e.tags = []), e.paths || (e.paths = {}), e.components || (e.components = {}), e.webhooks || (e.webhooks = {}), e.servers || (e.servers = []), e.security || (e.security = []);
13
+ const b = [], p = (o) => {
14
+ var h;
15
+ !("children" in o) || !((h = o.children) != null && h.length) || o.children.forEach((a) => {
16
+ var f, u, t, n, g;
17
+ let r = (f = e.tags) == null ? void 0 : f.findIndex((d) => "tag" in o && d.name === o.tag.name);
18
+ r === -1 && "tag" in o && (e.tags.push({
19
+ name: o.tag.name,
20
+ operations: []
21
+ }), r = e.tags.length - 1), e.tags[r].operations ||= [], "tag" in a ? p(a) : "operation" in a ? e.tags[r].operations.push({
22
+ id: a.id,
23
+ httpVerb: m(a.method),
24
+ path: a.path,
25
+ name: a.operation.summary || a.path || "",
26
+ description: a.operation.description || "",
27
+ isWebhook: !1,
28
+ information: a.operation,
29
+ pathParameters: (t = (u = e.paths) == null ? void 0 : u[a.path ?? ""]) == null ? void 0 : t.parameters
30
+ }) : "webhook" in a && e.tags[r].operations.push({
31
+ id: a.id,
32
+ httpVerb: m(a.method),
33
+ path: a.name,
34
+ name: a.webhook.summary || a.name || "",
35
+ description: a.webhook.description || "",
36
+ isWebhook: !0,
37
+ information: a.webhook,
38
+ pathParameters: (g = (n = e.webhooks) == null ? void 0 : n[a.name ?? ""]) == null ? void 0 : g.parameters
39
+ });
47
40
  });
48
- }), Object.keys(((E = t.components) == null ? void 0 : E.schemas) ?? {}).forEach((s) => {
49
- var d, r, e, n;
50
- m((r = (d = t.components) == null ? void 0 : d.schemas) == null ? void 0 : r[s]) && ((n = (e = t.components) == null ? void 0 : e.schemas) == null || delete n[s]);
51
- }), Object.keys(t.paths).forEach((s) => {
52
- Object.keys(t.paths[s]).filter(
53
- (r) => A.includes(r.toUpperCase())
54
- ).forEach((r) => {
55
- var u, h, g, o, a, y;
56
- const e = t.paths[s][r];
57
- if (e === void 0 || m(e))
58
- return;
59
- const n = {
60
- httpVerb: P(r),
61
- path: s,
62
- operationId: e.operationId || s,
63
- name: e.summary || s || "",
64
- description: e.description || "",
65
- information: {
66
- ...e
67
- },
68
- pathParameters: (h = (u = t.paths) == null ? void 0 : u[s]) == null ? void 0 : h.parameters
69
- };
70
- if (!e.tags || e.tags.length === 0) {
71
- (g = t.tags) != null && g.find((f) => f.name === "default") || (o = t.tags) == null || o.push({
72
- name: "default",
73
- description: "",
74
- operations: []
75
- });
76
- const i = (a = t.tags) == null ? void 0 : a.findIndex((f) => f.name === "default");
77
- i >= 0 && ((y = t.tags[i]) == null || y.operations.push(n));
78
- } else
79
- e.tags.forEach((i) => {
80
- var k, x, j;
81
- const f = (k = t.tags) == null ? void 0 : k.findIndex((R) => R.name === i);
82
- f === -1 && ((x = t.tags) == null || x.push({
83
- name: i,
84
- description: ""
85
- }));
86
- const I = f !== -1 ? f : t.tags.length - 1;
87
- typeof ((j = t.tags[I]) == null ? void 0 : j.operations) > "u" && (t.tags[I].operations = []), t.tags[I].operations.push(n);
88
- });
41
+ };
42
+ return i == null || i.forEach((o) => {
43
+ var h, a, r, f, u;
44
+ if (o.id.startsWith("tag/default") && "operation" in o) {
45
+ let t = (h = e.tags) == null ? void 0 : h.findIndex((n) => n.name === "default");
46
+ t === -1 && (e.tags.push({
47
+ name: "default",
48
+ description: "",
49
+ operations: []
50
+ }), t = e.tags.length - 1), e.tags[t].operations.push({
51
+ id: o.id,
52
+ httpVerb: m(o.method),
53
+ path: o.path,
54
+ name: o.operation.summary || o.path || "",
55
+ description: o.operation.description || "",
56
+ isWebhook: !1,
57
+ information: o.operation,
58
+ pathParameters: (r = (a = e.paths) == null ? void 0 : a[o.path ?? ""]) == null ? void 0 : r.parameters
59
+ });
60
+ }
61
+ "tag" in o && o.isGroup && ((f = o.children) != null && f.length) && o.children.forEach(p), "tag" in o && p(o), "isWebhooks" in o && o.isWebhooks && ((u = o.children) != null && u.length) && o.children.forEach((t) => {
62
+ var n, g;
63
+ "webhook" in t && t.name && t.method && b.push({
64
+ id: t.id,
65
+ httpVerb: m(t.method),
66
+ path: t.name,
67
+ name: t.webhook.summary || t.name || "",
68
+ description: t.webhook.description || "",
69
+ isWebhook: !0,
70
+ information: t.webhook,
71
+ pathParameters: (g = (n = e.webhooks) == null ? void 0 : n[t.name ?? ""]) == null ? void 0 : g.parameters
72
+ });
89
73
  });
90
- }), t.tags = (O = t.tags) == null ? void 0 : O.filter((s) => !m(s)), {
91
- ...t,
92
- webhooks: p
74
+ }), {
75
+ ...e,
76
+ webhooks: b
93
77
  };
94
78
  };
95
79
  export {
96
- C as parse
80
+ I as parse
97
81
  };
@@ -1,5 +1,5 @@
1
1
  import type { NavState } from '../hooks/useNavState.js';
2
- import { type AnyApiReferenceConfiguration, type SpecConfiguration } from '@scalar/types/api-reference';
2
+ import { type AnyApiReferenceConfiguration, type ApiReferenceConfiguration, type SpecConfiguration } from '@scalar/types/api-reference';
3
3
  import { type Ref } from 'vue';
4
4
  type UseMultipleDocumentsProps = {
5
5
  /**
@@ -14,13 +14,13 @@ type UseMultipleDocumentsProps = {
14
14
  * Take any configuration and return a flat array of configurations.
15
15
  */
16
16
  export declare const normalizeConfigurations: (configuration: AnyApiReferenceConfiguration | undefined) => SpecConfiguration[];
17
- export declare const useMultipleDocuments: ({ configuration, initialIndex, isIntersectionEnabled, hash, hashPrefix, }: UseMultipleDocumentsProps) =>
18
17
  /**
19
- * This was needed for a the bug: The inferred type of 'useMultipleDocuments' cannot be named without a reference to
20
- * A limitation of typescript
18
+ * DEPRECATED: This is a temporary state solution while we migrate to the new workspace store
19
+ *
20
+ * @deprecated
21
21
  */
22
- {
23
- selectedConfiguration: Ref<SpecConfiguration>;
22
+ export declare const useMultipleDocuments: ({ configuration, initialIndex, isIntersectionEnabled, hash, hashPrefix, }: UseMultipleDocumentsProps) => {
23
+ selectedConfiguration: Ref<Partial<ApiReferenceConfiguration> & SpecConfiguration>;
24
24
  availableDocuments: Ref<SpecConfiguration[]>;
25
25
  selectedDocumentIndex: Ref<number>;
26
26
  isIntersectionEnabled: Ref<boolean>;
@@ -1 +1 @@
1
- {"version":3,"file":"useMultipleDocuments.d.ts","sourceRoot":"","sources":["../../src/hooks/useMultipleDocuments.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM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AA;IAC5D,2FAA2F;IAC3F,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB,GAAG,QAAQ,CAAA;AAIZ;;GAEG;AACH,eAAO,MAAM,uBAAuB,kBACnB,4BAA4B,GAAG,SAAS,KACtD,iBAAiB,EA6BnB,CAAA;AA0CD;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,8EAM9B,yBAAyB,KAAG;IAC7B,qBAAqB,EAAE,GAAG,CAAC,OAAO,CAAC,yBAAyB,CAAC,GAAG,iBAAiB,CAAC,CAAA;IAClF,kBAAkB,EAAE,GAAG,CAAC,iBAAiB,EAAE,CAAC,CAAA;IAC5C,qBAAqB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IAClC,qBAAqB,EAAE,GAAG,CAAC,OAAO,CAAC,CAAA;IACnC,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IACjB,UAAU,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;CAmIxB,CAAA"}
@@ -48,7 +48,7 @@ export declare const useNavState: (_config?: Ref<ApiReferenceConfiguration>) =>
48
48
  }, parentTag?: OpenAPIV3_1.TagObject) => string;
49
49
  getModelId: (model?: {
50
50
  name: string;
51
- }) => string;
51
+ }, parentTag?: OpenAPIV3_1.TagObject) => string;
52
52
  getHeadingId: (heading: Heading) => string;
53
53
  getOperationId: (operation: {
54
54
  path: string;
@@ -1 +1 @@
1
- {"version":3,"file":"useNavState.d.ts","sourceRoot":"","sources":["../../src/hooks/useNavState.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAA;AAC5E,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAEhE,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,GAAG,EAAe,MAAM,KAAK,CAAA;AAE9D,MAAM,MAAM,QAAQ,GAAG;IACrB,0EAA0E;IAC1E,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,C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IACjB,2CAA2C;IAC3C,UAAU,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IACvB,sFAAsF;IACtF,qBAAqB,EAAE,GAAG,CAAC,OAAO,CAAC,CAAA;CACpC,CAAA;AACD,eAAO,MAAM,gBAAgB,EAAe,YAAY,CAAC,QAAQ,CAAC,CAAA;AAOlE;;;;;;;;GAQG;AACH,eAAO,MAAM,WAAW,aAAc,GAAG,CAAC,yBAAyB,CAAC;;IAoJhE,mCAAmC;4BACX,MAAM;IAG9B;;;;OAIG;+BAlF4B,MAAM;IAoFrC;;;;;OAKG;oCAxGkC,MAAM;IA0G3C;;;OAGG;uCA/HqC,MAAM;;6BA2FhB;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,cAAc,WAAW,CAAC,SAAS;yBAxCxE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,cAAc,WAAW,CAAC,SAAS;4BAXhD,OAAO;gCAiCzB;QACT,IAAI,EAAE,MAAM,CAAA;QACZ,MAAM,EAAE,WAAW,CAAC,WAAW,CAAA;KAChC,GAAG,WAAW,CAAC,eAAe,aACpB,WAAW,CAAC,SAAS;iCA7GE,MAAM;;oBAiGnB,WAAW,CAAC,SAAS;;;CA2E7C,CAAA;AAED,mCAAmC;AACnC,MAAM,MAAM,WAAW,GAAG,UAAU,CAAC,OAAO,WAAW,CAAC,CAAA"}
@@ -7,7 +7,7 @@ const P = Symbol(), U = l(!1), x = l(""), k = l(""), T = (f) => {
7
7
  isIntersectionEnabled: U,
8
8
  hash: x,
9
9
  hashPrefix: k
10
- }), t = f ?? b(), g = (e) => {
10
+ }), t = f ?? b(), c = (e) => {
11
11
  var a;
12
12
  if (!t.value.pathRouting)
13
13
  return "";
@@ -17,16 +17,21 @@ const P = Symbol(), U = l(!1), x = l(""), k = l(""), T = (f) => {
17
17
  var h;
18
18
  const n = (h = e.match(/(tag\/[^/]+)/)) == null ? void 0 : h[0], a = e.startsWith("model") ? "models" : "", o = e.startsWith("webhook") ? "webhooks" : "";
19
19
  return n || a || o;
20
- }, c = () => t.value.pathRouting ? g(window.location.pathname) : (
20
+ }, g = () => t.value.pathRouting ? c(window.location.pathname) : (
21
21
  // Must remove the prefix from the hash as the internal hash value should be pure
22
22
  decodeURIComponent(window.location.hash.replace(/^#/, "")).slice(u.value.length)
23
- ), m = () => r.value = c(), I = (e, n = window.location.href) => {
23
+ ), m = () => r.value = g(), $ = (e, n = window.location.href) => {
24
24
  const a = new URL(n);
25
25
  t.value.pathRouting ? a.pathname = d(t.value.pathRouting.basePath, e) : a.hash = u.value + e, r.value = e, window.history.replaceState({}, "", a);
26
- }, $ = (e, n = window.location.href, a = window.location.search) => {
26
+ }, I = (e, n = window.location.href, a = window.location.search) => {
27
27
  const o = new URL(n);
28
28
  return t.value.pathRouting ? o.pathname = d(t.value.pathRouting.basePath, e) : o.hash = u.value + e, o.search = a, o.toString();
29
- }, w = (e = r.value) => `${u.value}${e}`, S = (e) => typeof t.value.generateHeadingSlug == "function" ? `${t.value.generateHeadingSlug(e)}` : e.slug ? `description/${e.slug}` : "", R = (e) => e != null && e.name ? typeof t.value.generateModelSlug == "function" ? `model/${t.value.generateModelSlug(e)}` : `model/${i(e.name)}` : "models", s = (e) => typeof t.value.generateTagSlug == "function" ? `tag/${t.value.generateTagSlug(e)}` : `tag/${i(e.name ?? "")}`;
29
+ }, w = (e = r.value) => `${u.value}${e}`, S = (e) => typeof t.value.generateHeadingSlug == "function" ? `${t.value.generateHeadingSlug(e)}` : e.slug ? `description/${e.slug}` : "", R = (e, n) => {
30
+ if (!(e != null && e.name))
31
+ return "models";
32
+ const a = n ? `${s(n)}/` : "";
33
+ return typeof t.value.generateModelSlug == "function" ? `${a}model/${t.value.generateModelSlug(e)}` : `${a}model/${i(e.name)}`;
34
+ }, s = (e) => typeof t.value.generateTagSlug == "function" ? `tag/${t.value.generateTagSlug(e)}` : `tag/${i(e.name ?? "")}`;
30
35
  return {
31
36
  hash: r,
32
37
  /** Sets the prefix for the hash */
@@ -45,13 +50,13 @@ const P = Symbol(), U = l(!1), x = l(""), k = l(""), T = (f) => {
45
50
  * @param url The url to get the hashed url from
46
51
  * @returns The hashed url
47
52
  */
48
- getHashedUrl: $,
53
+ getHashedUrl: I,
49
54
  /**
50
55
  * Replaces the URL state with the new url and hash
51
56
  * Replacement is used so that hash changes don't trigger the url hash watcher and cause a scroll
52
57
  */
53
- replaceUrlState: I,
54
- getReferenceId: c,
58
+ replaceUrlState: $,
59
+ getReferenceId: g,
55
60
  getWebhookId: (e, n) => {
56
61
  if (!(e != null && e.name))
57
62
  return "webhooks";
@@ -66,7 +71,7 @@ const P = Symbol(), U = l(!1), x = l(""), k = l(""), T = (f) => {
66
71
  method: e.method,
67
72
  summary: e.summary
68
73
  })}` : `${s(n)}/${e.method}${e.path}`,
69
- getPathRoutingId: g,
74
+ getPathRoutingId: c,
70
75
  getSectionId: v,
71
76
  getTagId: s,
72
77
  isIntersectionEnabled: p,
@@ -1,11 +1,11 @@
1
- import type { Parameter, TransformedOperation } from '@scalar/types/legacy';
1
+ import type { OpenAPIV3_1, TransformedOperation } from '@scalar/types/legacy';
2
2
  export type ParamMap = {
3
- path: Parameter[];
4
- query: Parameter[];
5
- header: Parameter[];
6
- cookie: Parameter[];
7
- body: Parameter[];
8
- formData: Parameter[];
3
+ path: OpenAPIV3_1.ParameterObject[];
4
+ query: OpenAPIV3_1.ParameterObject[];
5
+ header: OpenAPIV3_1.ParameterObject[];
6
+ cookie: OpenAPIV3_1.ParameterObject[];
7
+ body: OpenAPIV3_1.ParameterObject[];
8
+ formData: OpenAPIV3_1.ParameterObject[];
9
9
  };
10
10
  /**
11
11
  * This hook is used to generate the parameters for the request from the parameters in the swagger file
@@ -1 +1 @@
1
- {"version":3,"file":"useOperation.d.ts","sourceRoot":"","sources":["../../src/hooks/useOperation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAG3E,MAAM,MAAM,QAAQ,GAAG;IACrB,IAAI,EAAE,SAAS,EAAE,CAAA;IACjB,KAAK,EAAE,SAAS,EAAE,CAAA;IAClB,MAAM,EAAE,SAAS,EAAE,CAAA;IACnB,MAAM,EAAE,SAAS,EAAE,CAAA;IACnB,IAAI,EAAE,SAAS,EAAE,CAAA;IACjB,QAAQ,EAAE,SAAS,EAAE,CAAA;CACtB,CAAA;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,SAAS,EAAE,oBAAoB;;EAuD3D"}
1
+ {"version":3,"file":"useOperation.d.ts","sourceRoot":"","sources":["../../src/hooks/useOperation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAI7E,MAAM,MAAM,QAAQ,GAAG;IACrB,IAAI,EAAE,WAAW,CAAC,eAAe,EAAE,CAAA;IACnC,KAAK,EAAE,WAAW,CAAC,eAAe,EAAE,CAAA;IACpC,MAAM,EAAE,WAAW,CAAC,eAAe,EAAE,CAAA;IACrC,MAAM,EAAE,WAAW,CAAC,eAAe,EAAE,CAAA;IACrC,IAAI,EAAE,WAAW,CAAC,eAAe,EAAE,CAAA;IACnC,QAAQ,EAAE,WAAW,CAAC,eAAe,EAAE,CAAA;CACxC,CAAA;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,SAAS,EAAE,oBAAoB;;EA2D3D"}
@@ -1,9 +1,10 @@
1
- import { computed as u } from "vue";
2
- function e(o) {
1
+ import { isDereferenced as u } from "@scalar/openapi-types/helpers";
2
+ import { computed as n } from "vue";
3
+ function l(s) {
3
4
  return {
4
- parameterMap: u(() => {
5
- var f;
6
- const s = {
5
+ parameterMap: n(() => {
6
+ var h;
7
+ const o = {
7
8
  path: [],
8
9
  query: [],
9
10
  header: [],
@@ -11,16 +12,16 @@ function e(o) {
11
12
  body: [],
12
13
  formData: []
13
14
  };
14
- o.pathParameters && o.pathParameters.forEach((i) => {
15
- i.in === "path" ? s.path.push(i) : i.in === "query" ? s.query.push(i) : i.in === "header" ? s.header.push(i) : i.in === "cookie" ? s.cookie.push(i) : i.in === "body" ? s.body.push(i) : i.in === "formData" && s.formData.push(i);
15
+ s.pathParameters && s.pathParameters.forEach((i) => {
16
+ i.in === "path" ? o.path.push(i) : i.in === "query" ? o.query.push(i) : i.in === "header" ? o.header.push(i) : i.in === "cookie" ? o.cookie.push(i) : i.in === "body" ? o.body.push(i) : i.in === "formData" && o.formData.push(i);
16
17
  });
17
- const h = ((f = o.information) == null ? void 0 : f.parameters) ?? [];
18
- return h && h.forEach((i) => {
19
- i.in === "path" ? s.path.push(i) : i.in === "query" ? s.query.push(i) : i.in === "header" ? s.header.push(i) : i.in === "cookie" ? s.cookie.push(i) : i.in === "body" ? s.body.push(i) : i.in === "formData" && s.formData.push(i);
20
- }), s;
18
+ const f = ((h = s.information) == null ? void 0 : h.parameters) ?? [];
19
+ return f && f.forEach((i) => {
20
+ u(i) && (i.in === "path" ? o.path.push(i) : i.in === "query" ? o.query.push(i) : i.in === "header" ? o.header.push(i) : i.in === "cookie" ? o.cookie.push(i) : i.in === "body" ? o.body.push(i) : i.in === "formData" && o.formData.push(i));
21
+ }), o;
21
22
  })
22
23
  };
23
24
  }
24
25
  export {
25
- e as useOperation
26
+ l as useOperation
26
27
  };
package/dist/index.d.ts CHANGED
@@ -8,7 +8,6 @@ export { Card, CardHeader, CardContent, CardFooter, CardTabHeader, CardTab } fro
8
8
  export { parse } from './helpers/parse.js';
9
9
  export { createEmptySpecification } from './libs/openapi.js';
10
10
  export { useNavState } from './hooks/useNavState.js';
11
- export { useSidebar } from './hooks/useSidebar.js';
12
11
  export { useHttpClientStore } from './stores/useHttpClientStore.js';
13
12
  export type { ApiReferenceConfiguration, ReferenceProps, } from './types';
14
13
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,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