@scalar/api-reference 1.25.6 → 1.25.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 (122) hide show
  1. package/CHANGELOG.md +64 -0
  2. package/dist/browser/standalone.js +10872 -11312
  3. package/dist/browser/webpack-stats.json +1 -1
  4. package/dist/components/ApiClientModal.vue.js +5 -5
  5. package/dist/components/ApiReferenceLayout.vue.d.ts.map +1 -1
  6. package/dist/components/ApiReferenceLayout.vue.js +2 -2
  7. package/dist/components/ApiReferenceLayout.vue2.js +56 -53
  8. package/dist/components/Content/Authentication/Authentication.vue.js +1 -1
  9. package/dist/components/Content/Introduction/Introduction.vue.d.ts +1 -1
  10. package/dist/components/Content/Introduction/Introduction.vue.d.ts.map +1 -1
  11. package/dist/components/Content/Introduction/Introduction.vue.js +2 -2
  12. package/dist/components/Content/Introduction/Introduction.vue2.js +9 -9
  13. package/dist/components/Content/Models/Models.vue.d.ts +1 -1
  14. package/dist/components/Content/Models/Models.vue.d.ts.map +1 -1
  15. package/dist/components/Content/Models/Models.vue.js +1 -1
  16. package/dist/components/Content/Models/Models.vue2.js +65 -42
  17. package/dist/components/Content/Models/ModelsAccordion.vue.d.ts +1 -1
  18. package/dist/components/Content/Models/ModelsAccordion.vue.d.ts.map +1 -1
  19. package/dist/components/Content/Models/ModelsAccordion.vue.js +1 -1
  20. package/dist/components/Content/Operation/Operation.vue.d.ts.map +1 -1
  21. package/dist/components/Content/Operation/Operation.vue.js +2 -2
  22. package/dist/components/Content/Operation/Operation.vue2.js +46 -59
  23. package/dist/components/Content/Schema/Schema.vue.d.ts +1 -1
  24. package/dist/components/Content/Schema/Schema.vue.d.ts.map +1 -1
  25. package/dist/components/Content/Schema/Schema.vue.js +2 -2
  26. package/dist/components/Content/Schema/Schema.vue2.js +18 -18
  27. package/dist/components/Content/Schema/SchemaHeading.vue.d.ts +1 -1
  28. package/dist/components/Content/Schema/SchemaHeading.vue.d.ts.map +1 -1
  29. package/dist/components/Content/Schema/SchemaHeading.vue.js +2 -2
  30. package/dist/components/Content/Schema/SchemaHeading.vue2.js +14 -14
  31. package/dist/components/Content/Webhooks/Webhook.vue.d.ts.map +1 -1
  32. package/dist/components/Content/Webhooks/Webhook.vue.js +5 -33
  33. package/dist/components/Content/Webhooks/Webhook.vue2.js +37 -2
  34. package/dist/components/Content/Webhooks/Webhooks.vue.d.ts.map +1 -1
  35. package/dist/components/Content/Webhooks/Webhooks.vue.js +2 -2
  36. package/dist/components/Content/Webhooks/Webhooks.vue2.js +93 -62
  37. package/dist/components/Section/CompactSection.vue.d.ts +28 -0
  38. package/dist/components/Section/CompactSection.vue.d.ts.map +1 -0
  39. package/dist/components/Section/CompactSection.vue.js +7 -0
  40. package/dist/components/Section/CompactSection.vue2.js +59 -0
  41. package/dist/components/Section/index.d.ts +1 -0
  42. package/dist/components/Section/index.d.ts.map +1 -1
  43. package/dist/{components/Content/Models/CollapsedModel.vue.d.ts → embeds/ExampleRequest/ExampleRequest.vue.d.ts} +9 -5
  44. package/dist/embeds/ExampleRequest/ExampleRequest.vue.d.ts.map +1 -0
  45. package/dist/embeds/ExampleRequest/index.d.ts +2 -0
  46. package/dist/embeds/ExampleRequest/index.d.ts.map +1 -0
  47. package/dist/embeds/OpenApiDocument/OpenApiDocument.vue.d.ts +508 -0
  48. package/dist/embeds/OpenApiDocument/OpenApiDocument.vue.d.ts.map +1 -0
  49. package/dist/embeds/OpenApiDocument/index.d.ts +3 -0
  50. package/dist/embeds/OpenApiDocument/index.d.ts.map +1 -0
  51. package/dist/embeds/OpenApiDocument/types.d.ts +3 -0
  52. package/dist/embeds/OpenApiDocument/types.d.ts.map +1 -0
  53. package/dist/embeds/index.d.ts +3 -0
  54. package/dist/embeds/index.d.ts.map +1 -0
  55. package/dist/features/BaseUrl/BaseUrl.vue.d.ts.map +1 -1
  56. package/dist/features/BaseUrl/BaseUrl.vue.js +24 -74
  57. package/dist/features/BaseUrl/types.d.ts +1 -1
  58. package/dist/features/BaseUrl/types.d.ts.map +1 -1
  59. package/dist/features/BaseUrl/utils/getServers.d.ts +3 -2
  60. package/dist/features/BaseUrl/utils/getServers.d.ts.map +1 -1
  61. package/dist/{components/Content/Introduction/DownloadSpec.vue.d.ts → features/DownloadLink/DownloadLink.vue.d.ts} +1 -1
  62. package/dist/features/DownloadLink/DownloadLink.vue.d.ts.map +1 -0
  63. package/dist/features/DownloadLink/DownloadLink.vue.js +7 -0
  64. package/dist/features/DownloadLink/DownloadLink.vue2.js +36 -0
  65. package/dist/features/DownloadLink/index.d.ts +2 -0
  66. package/dist/features/DownloadLink/index.d.ts.map +1 -0
  67. package/dist/features/ExampleRequest/ExampleRequest.vue.d.ts +1 -3
  68. package/dist/features/ExampleRequest/ExampleRequest.vue.d.ts.map +1 -1
  69. package/dist/features/ExampleRequest/ExampleRequest.vue.js +2 -2
  70. package/dist/features/ExampleRequest/ExampleRequest.vue2.js +127 -122
  71. package/dist/features/Search/SearchModal.vue.d.ts.map +1 -1
  72. package/dist/features/Search/SearchModal.vue.js +3 -3
  73. package/dist/features/Search/SearchModal.vue2.js +63 -58
  74. package/dist/helpers/createEmptySpecification.d.ts +1 -1
  75. package/dist/helpers/createEmptySpecification.d.ts.map +1 -1
  76. package/dist/helpers/getApiClientRequest.d.ts +1 -1
  77. package/dist/helpers/getApiClientRequest.d.ts.map +1 -1
  78. package/dist/helpers/getHarRequest.d.ts.map +1 -1
  79. package/dist/helpers/getHarRequest.js +8 -15
  80. package/dist/helpers/getModels.d.ts +1 -1
  81. package/dist/helpers/getModels.d.ts.map +1 -1
  82. package/dist/helpers/openClientFor.d.ts +1 -1
  83. package/dist/helpers/openClientFor.d.ts.map +1 -1
  84. package/dist/helpers/openClientFor.js +5 -5
  85. package/dist/helpers/parse.d.ts.map +1 -1
  86. package/dist/helpers/provideSymbols.d.ts +3 -2
  87. package/dist/helpers/provideSymbols.d.ts.map +1 -1
  88. package/dist/helpers/provideSymbols.js +3 -2
  89. package/dist/index.js +65 -64
  90. package/dist/legacy/components/SecurityScheme.vue.d.ts +1 -1
  91. package/dist/legacy/components/SecurityScheme.vue.d.ts.map +1 -1
  92. package/dist/legacy/components/SecurityScheme.vue.js +2 -2
  93. package/dist/legacy/components/SecurityScheme.vue2.js +57 -53
  94. package/dist/legacy/components/SecuritySchemeSelector.vue.d.ts +1 -1
  95. package/dist/legacy/components/SecuritySchemeSelector.vue.d.ts.map +1 -1
  96. package/dist/legacy/components/SecuritySchemeSelector.vue.js +4 -4
  97. package/dist/legacy/components/SecuritySchemeSelector.vue2.js +5 -5
  98. package/dist/legacy/helpers/getRequestFromAuthentication.d.ts +1 -1
  99. package/dist/legacy/helpers/getRequestFromAuthentication.d.ts.map +1 -1
  100. package/dist/legacy/helpers/getUrlFromServerState.d.ts +1 -1
  101. package/dist/legacy/helpers/getUrlFromServerState.d.ts.map +1 -1
  102. package/dist/legacy/helpers/index.d.ts +1 -1
  103. package/dist/legacy/helpers/normalizeHeaders.d.ts +2 -3
  104. package/dist/legacy/helpers/normalizeHeaders.d.ts.map +1 -1
  105. package/dist/legacy/helpers/normalizeHeaders.js +24 -0
  106. package/dist/legacy/stores/useOpenApiStore.d.ts +2 -2
  107. package/dist/legacy/stores/useOpenApiStore.d.ts.map +1 -1
  108. package/dist/legacy/stores/useServerStore.d.ts +32 -6
  109. package/dist/legacy/stores/useServerStore.d.ts.map +1 -1
  110. package/dist/legacy/stores/useServerStore.js +70 -11
  111. package/dist/legacy/types.d.ts +0 -23
  112. package/dist/legacy/types.d.ts.map +1 -1
  113. package/dist/style.css +1 -1
  114. package/package.json +13 -12
  115. package/dist/components/Content/Introduction/DownloadSpec.vue.d.ts.map +0 -1
  116. package/dist/components/Content/Introduction/DownloadSpec.vue.js +0 -7
  117. package/dist/components/Content/Introduction/DownloadSpec.vue2.js +0 -30
  118. package/dist/components/Content/Models/CollapsedModel.vue.d.ts.map +0 -1
  119. package/dist/components/Content/Models/CollapsedModel.vue.js +0 -7
  120. package/dist/components/Content/Models/CollapsedModel.vue2.js +0 -70
  121. package/dist/features/BaseUrl/utils/index.d.ts +0 -2
  122. package/dist/features/BaseUrl/utils/index.d.ts.map +0 -1
@@ -1,4 +1,4 @@
1
- import type { OpenAPIV3, OpenAPIV3_1 } from '@scalar/openapi-parser';
1
+ import type { OpenAPIV3, OpenAPIV3_1 } from '@scalar/openapi-types';
2
2
  export type ServerVariables = {
3
3
  [variable: string]: ServerVariable;
4
4
  };
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/features/BaseUrl/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AAEpE,MAAM,MAAM,eAAe,GAAG;IAC5B,CAAC,QAAQ,EAAE,MAAM,GAAG,cAAc,CAAA;CACnC,CAAA;AAED,MAAM,MAAM,oBAAoB,GAAG;IACjC,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAA;CAC3B,CAAA;AAED,MAAM,MAAM,cAAc,GACtB,SAAS,CAAC,oBAAoB,GAC9B,WAAW,CAAC,oBAAoB,CAAA"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/features/BaseUrl/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAEnE,MAAM,MAAM,eAAe,GAAG;IAC5B,CAAC,QAAQ,EAAE,MAAM,GAAG,cAAc,CAAA;CACnC,CAAA;AAED,MAAM,MAAM,oBAAoB,GAAG;IACjC,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAA;CAC3B,CAAA;AAED,MAAM,MAAM,cAAc,GACtB,SAAS,CAAC,oBAAoB,GAC9B,WAAW,CAAC,oBAAoB,CAAA"}
@@ -1,4 +1,5 @@
1
- import type { Server, Spec } from '@scalar/types/legacy';
1
+ import type { OpenAPIV3, OpenAPIV3_1 } from '@scalar/openapi-types';
2
+ import type { Spec } from '@scalar/types/legacy';
2
3
  export type DefaultServerUrlOption = {
3
4
  /**
4
5
  * Sometimes you can’t add an URL to your OpenAPI document, so you can provide a default one here.
@@ -10,5 +11,5 @@ export type DefaultServerUrlOption = {
10
11
  * If no servers are found, it will default to a specified URL or the current URL.
11
12
  * Relative paths will be prepended with the default server URL or the current URL.
12
13
  */
13
- export declare function getServers(specification: Spec | undefined, options?: DefaultServerUrlOption): Server[];
14
+ export declare function getServers(specification: Spec | undefined, options?: DefaultServerUrlOption): (OpenAPIV3.ServerObject | OpenAPIV3_1.ServerObject)[];
14
15
  //# sourceMappingURL=getServers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getServers.d.ts","sourceRoot":"","sources":["../../../../src/features/BaseUrl/utils/getServers.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAExD,MAAM,MAAM,sBAAsB,GAAG;IACnC;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAC1B,CAAA;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CACxB,aAAa,EAAE,IAAI,GAAG,SAAS,EAC/B,OAAO,CAAC,EAAE,sBAAsB,YA+DjC"}
1
+ {"version":3,"file":"getServers.d.ts","sourceRoot":"","sources":["../../../../src/features/BaseUrl/utils/getServers.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACnE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAEhD,MAAM,MAAM,sBAAsB,GAAG;IACnC;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAC1B,CAAA;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CACxB,aAAa,EAAE,IAAI,GAAG,SAAS,EAC/B,OAAO,CAAC,EAAE,sBAAsB,yDA8DjC"}
@@ -13,4 +13,4 @@ type __VLS_TypePropsToOption<T> = {
13
13
  required: true;
14
14
  };
15
15
  };
16
- //# sourceMappingURL=DownloadSpec.vue.d.ts.map
16
+ //# sourceMappingURL=DownloadLink.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DownloadLink.vue.d.ts","sourceRoot":"","sources":["../../../src/features/DownloadLink/DownloadLink.vue"],"names":[],"mappings":";gBA2Ec,MAAM;;gBAAN,MAAM;;AAqEpB,wBAMG;AAOH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
@@ -0,0 +1,7 @@
1
+ import o from "./DownloadLink.vue2.js";
2
+ /* empty css */
3
+ import t from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-af826d86"]]);
5
+ export {
6
+ m as default
7
+ };
@@ -0,0 +1,36 @@
1
+ import { defineComponent as m, inject as d, openBlock as o, createElementBlock as e, unref as t, Fragment as _, createCommentVNode as u } from "vue";
2
+ import { HIDE_DOWNLOAD_BUTTON_SYMBOL as D, OPENAPI_DOCUMENT_URL_SYMBOL as w } from "../../helpers/provideSymbols.js";
3
+ import { downloadSpecBus as O } from "../../helpers/specDownloads.js";
4
+ const f = { class: "download" }, k = ["href"], A = /* @__PURE__ */ m({
5
+ __name: "DownloadLink",
6
+ props: {
7
+ specTitle: {}
8
+ },
9
+ setup(s) {
10
+ const r = s, p = d(D), n = d(w), i = () => {
11
+ O.emit({ id: "", specTitle: r.specTitle });
12
+ };
13
+ return (b, B) => {
14
+ var c, l, a;
15
+ return o(), e("div", f, [
16
+ (c = t(p)) != null && c() ? u("", !0) : (o(), e(_, { key: 0 }, [
17
+ (l = t(n)) != null && l() ? (o(), e("a", {
18
+ key: 0,
19
+ class: "download-button",
20
+ download: "",
21
+ href: (a = t(n)) == null ? void 0 : a(),
22
+ target: "_blank"
23
+ }, " Download OpenAPI Document ", 8, k)) : (o(), e("button", {
24
+ key: 1,
25
+ class: "download-button",
26
+ type: "button",
27
+ onClick: i
28
+ }, " Download OpenAPI Document "))
29
+ ], 64))
30
+ ]);
31
+ };
32
+ }
33
+ });
34
+ export {
35
+ A as default
36
+ };
@@ -0,0 +1,2 @@
1
+ export { default as DownloadLink } from './DownloadLink.vue.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/features/DownloadLink/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,oBAAoB,CAAA"}
@@ -1,13 +1,11 @@
1
- import type { CustomRequestExample, TransformedOperation } from '@scalar/types/legacy';
1
+ import type { TransformedOperation } from '@scalar/types/legacy';
2
2
  declare function __VLS_template(): {
3
3
  header?(_: {}): any;
4
4
  footer?(_: {}): any;
5
5
  };
6
6
  declare const __VLS_component: import("vue").DefineComponent<__VLS_TypePropsToOption<{
7
- customExamples?: CustomRequestExample[] | null;
8
7
  operation: TransformedOperation;
9
8
  }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<{
10
- customExamples?: CustomRequestExample[] | null;
11
9
  operation: TransformedOperation;
12
10
  }>>>, {}, {}>;
13
11
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
@@ -1 +1 @@
1
- {"version":3,"file":"ExampleRequest.vue.d.ts","sourceRoot":"","sources":["../../../src/features/ExampleRequest/ExampleRequest.vue"],"names":[],"mappings":"AAuXA,OAAO,KAAK,EACV,oBAAoB,EAGpB,oBAAoB,EACrB,MAAM,sBAAsB,CAAA;AAwP7B,iBAAS,cAAc;oBA+MM,GAAG;oBACH,GAAG;EAiC/B;AACD,QAAA,MAAM,eAAe;qBA3cF,oBAAoB,EAAE,GAAG,IAAI;eACnC,oBAAoB;;qBADd,oBAAoB,EAAE,GAAG,IAAI;eACnC,oBAAoB;aAgd/B,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAAvG,wBAAwG;AAOxG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACpC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC;AAEN,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
1
+ {"version":3,"file":"ExampleRequest.vue.d.ts","sourceRoot":"","sources":["../../../src/features/ExampleRequest/ExampleRequest.vue"],"names":[],"mappings":"AA6YA,OAAO,KAAK,EAGV,oBAAoB,EACrB,MAAM,sBAAsB,CAAA;AA6Q7B,iBAAS,cAAc;oBAiNM,GAAG;oBACH,GAAG;EAmC/B;AACD,QAAA,MAAM,eAAe;eApeR,oBAAoB;;eAApB,oBAAoB;aA0e/B,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAAvG,wBAAwG;AAOxG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACpC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC;AAEN,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import o from "./ExampleRequest.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../_virtual/_plugin-vue_export-helper.js";
4
- const r = /* @__PURE__ */ t(o, [["__scopeId", "data-v-de3f5cc4"]]);
4
+ const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-f47524fb"]]);
5
5
  export {
6
- r as default
6
+ p as default
7
7
  };
@@ -1,8 +1,8 @@
1
- import { defineComponent as U, ref as _, watch as L, computed as y, inject as I, onServerPrefetch as M, useSSRContext as Y, openBlock as d, createBlock as b, unref as s, withCtx as c, createVNode as p, createElementBlock as h, Fragment as V, createTextVNode as H, toDisplayString as v, createElementVNode as O, renderSlot as j, createCommentVNode as N } from "vue";
1
+ import { defineComponent as P, ref as R, computed as f, watch as I, inject as L, onServerPrefetch as M, useSSRContext as Y, unref as a, openBlock as y, createBlock as V, withCtx as p, createVNode as u, createElementBlock as h, Fragment as H, createTextVNode as O, toDisplayString as K, createElementVNode as N, renderSlot as j, createCommentVNode as x } from "vue";
2
2
  import { ScalarCodeBlock as z } from "@scalar/components";
3
3
  import { createHash as D, ssrState as Q } from "@scalar/oas-utils/helpers";
4
4
  import { getRequestFromOperation as W } from "@scalar/oas-utils/spec-getters";
5
- import { snippetz as R } from "@scalar/snippetz";
5
+ import { snippetz as B } from "@scalar/snippetz";
6
6
  import { asyncComputed as X } from "@vueuse/core";
7
7
  import { HTTPSnippet as Z } from "httpsnippet-lite";
8
8
  import G from "./ExamplePicker.vue.js";
@@ -16,189 +16,194 @@ import ne from "../../components/Card/CardContent.vue.js";
16
16
  import { getSecretCredentialsFromAuthentication as se, getRequestFromAuthentication as le } from "../../legacy/helpers/getRequestFromAuthentication.js";
17
17
  import ie from "../../components/Card/CardFooter.vue.js";
18
18
  import { useHttpClientStore as ce } from "../../stores/useHttpClientStore.js";
19
- import { getApiClientRequest as pe } from "../../helpers/getApiClientRequest.js";
20
- import { useServerStore as me } from "../../legacy/stores/useServerStore.js";
21
- import { useAuthenticationStore as ue } from "../../legacy/stores/useAuthenticationStore.js";
19
+ import { useServerStore as pe } from "../../legacy/stores/useServerStore.js";
20
+ import { getApiClientRequest as ue } from "../../helpers/getApiClientRequest.js";
21
+ import { useAuthenticationStore as me } from "../../legacy/stores/useAuthenticationStore.js";
22
22
  import { getHarRequest as de } from "../../helpers/getHarRequest.js";
23
23
  import { getUrlFromServerState as fe } from "../../legacy/helpers/getUrlFromServerState.js";
24
- const ye = { class: "request-header" }, ge = { class: "code-snippet" }, he = {
24
+ const ye = { class: "request-header" }, ve = { class: "code-snippet" }, ge = {
25
25
  key: 0,
26
26
  class: "request-card-footer-addon"
27
- }, Ue = /* @__PURE__ */ U({
27
+ }, Pe = /* @__PURE__ */ P({
28
28
  __name: "ExampleRequest",
29
29
  props: {
30
- customExamples: {},
31
30
  operation: {}
32
31
  },
33
- setup(B) {
34
- var k;
35
- const a = B, K = `components-Content-Operation-Example-Request${D(
36
- a.operation.path + a.operation.httpVerb + a.operation.operationId
37
- )}`, x = _(), {
38
- httpClient: n,
39
- setHttpClient: T,
40
- availableTargets: $,
32
+ setup(T) {
33
+ const n = T, C = `components-Content-Operation-Example-Request${D(
34
+ n.operation.path + n.operation.httpVerb + n.operation.operationId
35
+ )}`, S = R(), {
36
+ httpClient: r,
37
+ setHttpClient: $,
38
+ availableTargets: E,
41
39
  httpTargetTitle: w,
42
40
  httpClientTitle: F
43
- } = ce(), { server: E } = me(), { authentication: g } = ue(), l = _(
41
+ } = ce(), { server: k } = pe(), { authentication: v } = me(), i = f(() => {
42
+ var e;
43
+ const t = ["x-custom-examples", "x-codeSamples", "x-code-samples"];
44
+ for (const o of t)
45
+ if ((e = n.operation.information) != null && e[o])
46
+ return n.operation.information[o] ?? [];
47
+ return [];
48
+ }), s = R(
44
49
  // Default to first custom example
45
- (k = a.customExamples) != null && k.length ? {
50
+ i.value.length ? {
46
51
  targetKey: "customExamples",
47
52
  clientKey: 0
48
53
  } : (
49
54
  // Otherwise use the globally selected HTTP client
50
55
  {
51
- targetKey: n.targetKey,
52
- clientKey: n.clientKey
56
+ targetKey: r.targetKey,
57
+ clientKey: r.clientKey
53
58
  }
54
59
  )
55
60
  );
56
- L(n, () => {
57
- l.value = {
58
- targetKey: n.targetKey,
59
- clientKey: n.clientKey
61
+ I(r, () => {
62
+ s.value = {
63
+ targetKey: r.targetKey,
64
+ clientKey: r.clientKey
60
65
  };
61
66
  });
62
- const C = y(
67
+ const q = f(
63
68
  () => {
64
- var e, o, t, r;
69
+ var t, e, o, l;
65
70
  return Object.keys(
66
- ((r = (t = (o = (e = a.operation.information) == null ? void 0 : e.requestBody) == null ? void 0 : o.content) == null ? void 0 : t["application/json"]) == null ? void 0 : r.examples) ?? {}
71
+ ((l = (o = (e = (t = n.operation.information) == null ? void 0 : t.requestBody) == null ? void 0 : e.content) == null ? void 0 : o["application/json"]) == null ? void 0 : l.examples) ?? {}
67
72
  ).length > 1;
68
73
  }
69
- ), i = I(te);
70
- async function S() {
71
- var r, m, u;
72
- if (l.value.targetKey === "customExamples")
73
- return ((m = (r = a.customExamples) == null ? void 0 : r[l.value.clientKey]) == null ? void 0 : m.source) ?? "";
74
- const e = de(
74
+ ), c = L(te);
75
+ async function _() {
76
+ var l, m;
77
+ if (s.value.targetKey === "customExamples")
78
+ return ((l = i.value[s.value.clientKey]) == null ? void 0 : l.source) ?? "";
79
+ const t = de(
75
80
  {
76
- url: fe(E)
81
+ url: fe(k)
77
82
  },
78
83
  W(
79
- a.operation,
84
+ n.operation,
80
85
  {
81
86
  replaceVariables: !0
82
87
  },
83
- x.value
88
+ S.value
84
89
  ),
85
90
  le(
86
- g,
87
- ((u = a.operation.information) == null ? void 0 : u.security) ?? (i == null ? void 0 : i())
91
+ v,
92
+ ((m = n.operation.information) == null ? void 0 : m.security) ?? (c == null ? void 0 : c())
88
93
  )
89
- ), o = n.clientKey === "undici" || n.clientKey === "fetch" || n.clientKey === "ofetch" ? n.clientKey : null, t = n.targetKey.replace("javascript", "js");
90
- if (o && R().hasPlugin(t, o) && (t === "node" || t === "js"))
91
- return R().print(t, o, e) ?? "";
94
+ ), e = r.clientKey === "undici" || r.clientKey === "fetch" || r.clientKey === "ofetch" ? r.clientKey : null, o = r.targetKey.replace("javascript", "js");
95
+ if (e && B().hasPlugin(o, e))
96
+ return B().print(o, e, t) ?? "";
92
97
  try {
93
- return await new Z(e).convert(
94
- n.targetKey,
95
- n.clientKey
98
+ const g = await new Z(t).convert(
99
+ r.targetKey,
100
+ r.clientKey
96
101
  );
97
- } catch (f) {
98
- return console.error("[ExampleRequest]", f), "";
102
+ return decodeURIComponent(g);
103
+ } catch (d) {
104
+ return console.error("[ExampleRequest]", d), "";
99
105
  }
100
106
  }
101
- const q = X(async () => {
107
+ const b = X(async () => {
102
108
  try {
103
- return await S();
104
- } catch (e) {
105
- return console.error("[generateSnippet]", e), "";
109
+ return await _();
110
+ } catch (t) {
111
+ return console.error("[generateSnippet]", t), "";
106
112
  }
107
- }, Q[K] ?? "");
113
+ }, Q[C] ?? "");
108
114
  M(async () => {
109
- const e = Y();
110
- e.payload.data[K] = await S();
111
- }), y(() => pe({
112
- serverState: E,
113
- authenticationState: g,
114
- operation: a.operation,
115
- globalSecurity: i == null ? void 0 : i()
115
+ const t = Y();
116
+ t.payload.data[C] = await _();
117
+ }), f(() => ue({
118
+ serverState: k,
119
+ authenticationState: v,
120
+ operation: n.operation,
121
+ globalSecurity: c == null ? void 0 : c()
116
122
  }));
117
- const A = y(() => {
118
- var o, t, r;
119
- const e = (
123
+ const A = f(() => {
124
+ var e, o;
125
+ const t = (
120
126
  // Specified language
121
- ((o = l.value) == null ? void 0 : o.targetKey) === "customExamples" ? ((r = (t = a.customExamples) == null ? void 0 : t[l.value.clientKey]) == null ? void 0 : r.lang) ?? "plaintext" : (
127
+ ((e = s.value) == null ? void 0 : e.targetKey) === "customExamples" ? ((o = i.value[s.value.clientKey]) == null ? void 0 : o.lang) ?? "plaintext" : (
122
128
  // Or language for the globally selected HTTP client
123
- n.targetKey
129
+ r.targetKey
124
130
  )
125
131
  );
126
- return e === "shell" && q.value.includes("curl") ? "curl" : e === "Objective-C" ? "objc" : e;
127
- }), J = y(() => {
128
- var o;
129
- const e = $.value.map((t) => ({
130
- value: t.key,
131
- label: t.title,
132
- options: t.clients.map((r) => ({
132
+ return t === "shell" && b.value.includes("curl") ? "curl" : t === "Objective-C" ? "objc" : t;
133
+ }), U = f(() => {
134
+ const t = E.value.map((e) => ({
135
+ value: e.key,
136
+ label: e.title,
137
+ options: e.clients.map((o) => ({
133
138
  value: JSON.stringify({
134
- targetKey: t.key,
135
- clientKey: r.key
139
+ targetKey: e.key,
140
+ clientKey: o.key
136
141
  }),
137
- label: r.title
142
+ label: o.title
138
143
  }))
139
144
  }));
140
- return (o = a.customExamples) != null && o.length && e.unshift({
145
+ return i.value.length && t.unshift({
141
146
  value: "customExamples",
142
147
  label: "Examples",
143
- options: a.customExamples.map((t, r) => ({
148
+ options: i.value.map((e, o) => ({
144
149
  value: JSON.stringify({
145
150
  targetKey: "customExamples",
146
- clientKey: r
151
+ clientKey: o
147
152
  }),
148
- label: t.label ?? t.lang ?? `Example #${r + 1}`
153
+ label: e.label ?? e.lang ?? `Example #${o + 1}`
149
154
  }))
150
- }), e;
155
+ }), t;
151
156
  });
152
- function P(e) {
153
- const o = JSON.parse(e);
154
- o.targetKey === "customExamples" ? l.value = o : T(o);
157
+ function J(t) {
158
+ const e = JSON.parse(t);
159
+ e.targetKey === "customExamples" ? s.value = e : $(e);
155
160
  }
156
- return (e, o) => (d(), b(s(oe), { class: "dark-mode" }, {
157
- default: c(() => [
158
- p(s(re), { muted: "" }, {
159
- actions: c(() => [
160
- p(ee, {
161
+ return (t, e) => a(E).length || i.value.length ? (y(), V(a(oe), {
162
+ key: 0,
163
+ class: "dark-mode"
164
+ }, {
165
+ default: p(() => [
166
+ u(a(re), { muted: "" }, {
167
+ actions: p(() => [
168
+ u(ee, {
161
169
  class: "request-client-picker",
162
- modelValue: JSON.stringify(l.value),
163
- options: J.value,
164
- "onUpdate:modelValue": P
170
+ modelValue: JSON.stringify(s.value),
171
+ options: U.value,
172
+ "onUpdate:modelValue": J
165
173
  }, {
166
- default: c(() => {
167
- var t;
168
- return [
169
- l.value.targetKey === "customExamples" ? (d(), h(V, { key: 0 }, [
170
- H(v(((t = a.customExamples) == null ? void 0 : t[l.value.clientKey].label) ?? "Example"), 1)
171
- ], 64)) : (d(), h(V, { key: 1 }, [
172
- H(v(s(w)) + " " + v(s(F)), 1)
173
- ], 64))
174
- ];
175
- }),
174
+ default: p(() => [
175
+ s.value.targetKey === "customExamples" ? (y(), h(H, { key: 0 }, [
176
+ O(K(i.value[s.value.clientKey].label ?? "Example"), 1)
177
+ ], 64)) : (y(), h(H, { key: 1 }, [
178
+ O(K(a(w)) + " " + K(a(F)), 1)
179
+ ], 64))
180
+ ]),
176
181
  _: 1
177
182
  }, 8, ["modelValue", "options"])
178
183
  ]),
179
- default: c(() => [
180
- O("div", ye, [
181
- p(s(ae), {
184
+ default: p(() => [
185
+ N("div", ye, [
186
+ u(a(ae), {
182
187
  as: "span",
183
188
  class: "request-method",
184
- method: e.operation.httpVerb
189
+ method: t.operation.httpVerb
185
190
  }, null, 8, ["method"]),
186
- j(e.$slots, "header", {}, void 0, !0)
191
+ j(t.$slots, "header", {}, void 0, !0)
187
192
  ])
188
193
  ]),
189
194
  _: 3
190
195
  }),
191
- p(s(ne), {
196
+ u(a(ne), {
192
197
  borderless: "",
193
198
  class: "request-editor-section custom-scroll",
194
199
  frameless: ""
195
200
  }, {
196
- default: c(() => [
197
- O("div", ge, [
198
- p(s(z), {
201
+ default: p(() => [
202
+ N("div", ve, [
203
+ u(a(z), {
199
204
  class: "bg-b-2",
200
- content: s(q),
201
- hideCredentials: s(se)(s(g)),
205
+ content: a(b),
206
+ hideCredentials: a(se)(a(v)),
202
207
  lang: A.value,
203
208
  lineNumbers: ""
204
209
  }, null, 8, ["content", "hideCredentials", "lang"])
@@ -206,31 +211,31 @@ const ye = { class: "request-header" }, ge = { class: "code-snippet" }, he = {
206
211
  ]),
207
212
  _: 1
208
213
  }),
209
- C.value || e.$slots.footer ? (d(), b(s(ie), {
214
+ q.value || t.$slots.footer ? (y(), V(a(ie), {
210
215
  key: 0,
211
216
  class: "request-card-footer",
212
217
  contrast: ""
213
218
  }, {
214
- default: c(() => {
215
- var t, r, m, u;
219
+ default: p(() => {
220
+ var o, l, m, d;
216
221
  return [
217
- C.value ? (d(), h("div", he, [
218
- p(G, {
222
+ q.value ? (y(), h("div", ge, [
223
+ u(G, {
219
224
  class: "request-example-selector",
220
- examples: ((u = (m = (r = (t = e.operation.information) == null ? void 0 : t.requestBody) == null ? void 0 : r.content) == null ? void 0 : m["application/json"]) == null ? void 0 : u.examples) ?? [],
221
- "onUpdate:modelValue": o[0] || (o[0] = (f) => x.value = f)
225
+ examples: ((d = (m = (l = (o = t.operation.information) == null ? void 0 : o.requestBody) == null ? void 0 : l.content) == null ? void 0 : m["application/json"]) == null ? void 0 : d.examples) ?? [],
226
+ "onUpdate:modelValue": e[0] || (e[0] = (g) => S.value = g)
222
227
  }, null, 8, ["examples"])
223
- ])) : N("", !0),
224
- j(e.$slots, "footer", {}, void 0, !0)
228
+ ])) : x("", !0),
229
+ j(t.$slots, "footer", {}, void 0, !0)
225
230
  ];
226
231
  }),
227
232
  _: 3
228
- })) : N("", !0)
233
+ })) : x("", !0)
229
234
  ]),
230
235
  _: 3
231
- }));
236
+ })) : x("", !0);
232
237
  }
233
238
  });
234
239
  export {
235
- Ue as default
240
+ Pe as default
236
241
  };
@@ -1 +1 @@
1
- {"version":3,"file":"SearchModal.vue.d.ts","sourceRoot":"","sources":["../../../src/features/Search/SearchModal.vue"],"names":[],"mappings":"AAoKA,OAAO,EAEL,KAAK,UAAU,EAKhB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;;gBAYlC,IAAI;gBACJ,UAAU;;gBADV,IAAI;gBACJ,UAAU;;AAgRxB,wBAMG;AAOH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
1
+ {"version":3,"file":"SearchModal.vue.d.ts","sourceRoot":"","sources":["../../../src/features/Search/SearchModal.vue"],"names":[],"mappings":"AA0KA,OAAO,EAEL,KAAK,UAAU,EAKhB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;;gBAYlC,IAAI;gBACJ,UAAU;;gBADV,IAAI;gBACJ,UAAU;;AAmRxB,wBAMG;AAOH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import o from "./SearchModal.vue2.js";
2
2
  /* empty css */
3
- import a from "../../_virtual/_plugin-vue_export-helper.js";
4
- const f = /* @__PURE__ */ a(o, [["__scopeId", "data-v-6ee7fa31"]]);
3
+ import r from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const e = /* @__PURE__ */ r(o, [["__scopeId", "data-v-fb0fd0be"]]);
5
5
  export {
6
- f as default
6
+ e as default
7
7
  };