@scalar/api-reference 1.25.10 → 1.25.11

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 (92) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/browser/standalone.js +14612 -14611
  3. package/dist/browser/webpack-stats.json +1 -1
  4. package/dist/components/Content/Operation/Operation.vue.js +2 -2
  5. package/dist/components/Content/Operation/Operation.vue2.js +14 -14
  6. package/dist/components/Content/Operation/OperationAccordion.vue.js +1 -1
  7. package/dist/components/Content/Operation/OperationAccordion.vue2.js +24 -24
  8. package/dist/components/Content/Operation/ParameterHeaders.vue.d.ts +21 -0
  9. package/dist/components/Content/Operation/ParameterHeaders.vue.d.ts.map +1 -0
  10. package/dist/components/Content/Operation/ParameterHeaders.vue.js +7 -0
  11. package/dist/components/Content/Operation/ParameterHeaders.vue2.js +62 -0
  12. package/dist/components/Content/Operation/ParameterItem.vue.d.ts.map +1 -1
  13. package/dist/components/Content/Operation/ParameterItem.vue.js +2 -2
  14. package/dist/components/Content/Operation/ParameterItem.vue2.js +34 -30
  15. package/dist/components/Content/Tag/Endpoints.vue.d.ts.map +1 -1
  16. package/dist/components/Content/Tag/Endpoints.vue.js +2 -2
  17. package/dist/components/Content/Tag/Endpoints.vue2.js +10 -8
  18. package/dist/components/Content/Tag/Tag.vue.js +3 -3
  19. package/dist/components/Content/Tag/Tag.vue2.js +1 -1
  20. package/dist/{components/Content/Operation/PathResponses/ExampleResponse.vue.d.ts → embeds/ExampleResponses/ExampleResponses.vue.d.ts} +4 -9
  21. package/dist/embeds/ExampleResponses/ExampleResponses.vue.d.ts.map +1 -0
  22. package/dist/embeds/ExampleResponses/index.d.ts +2 -0
  23. package/dist/embeds/ExampleResponses/index.d.ts.map +1 -0
  24. package/dist/embeds/OpenApiDocument/OpenApiDocument.vue.d.ts +8 -1
  25. package/dist/embeds/OpenApiDocument/OpenApiDocument.vue.d.ts.map +1 -1
  26. package/dist/embeds/index.d.ts +1 -0
  27. package/dist/embeds/index.d.ts.map +1 -1
  28. package/dist/features/BaseUrl/ServerForm.vue.d.ts.map +1 -1
  29. package/dist/features/BaseUrl/ServerForm.vue.js +2 -2
  30. package/dist/features/BaseUrl/ServerForm.vue2.js +5 -5
  31. package/dist/features/ExampleRequest/ExampleRequest.vue.d.ts.map +1 -1
  32. package/dist/features/ExampleRequest/ExampleRequest.vue.js +1 -1
  33. package/dist/features/ExampleRequest/ExampleRequest.vue2.js +118 -129
  34. package/dist/{components/Content/Operation/PathResponses/Headers.vue.d.ts → features/ExampleResponses/ExampleResponse.vue.d.ts} +4 -4
  35. package/dist/features/ExampleResponses/ExampleResponse.vue.d.ts.map +1 -0
  36. package/dist/features/ExampleResponses/ExampleResponse.vue.js +7 -0
  37. package/dist/features/ExampleResponses/ExampleResponse.vue2.js +37 -0
  38. package/dist/{components/Content/Operation/PathResponses/PathResponses.vue.d.ts → features/ExampleResponses/ExampleResponses.vue.d.ts} +1 -1
  39. package/dist/features/ExampleResponses/ExampleResponses.vue.d.ts.map +1 -0
  40. package/dist/features/ExampleResponses/ExampleResponses.vue.js +7 -0
  41. package/dist/{components/Content/Operation/PathResponses/PathResponses.vue2.js → features/ExampleResponses/ExampleResponses.vue2.js} +18 -18
  42. package/dist/features/ExampleResponses/index.d.ts +2 -0
  43. package/dist/features/ExampleResponses/index.d.ts.map +1 -0
  44. package/dist/helpers/createRequest.d.ts +6 -0
  45. package/dist/helpers/createRequest.d.ts.map +1 -0
  46. package/dist/helpers/createRequest.js +16 -0
  47. package/dist/helpers/getExampleCode.d.ts +9 -0
  48. package/dist/helpers/getExampleCode.d.ts.map +1 -0
  49. package/dist/helpers/getExampleCode.js +27 -0
  50. package/dist/helpers/index.d.ts +2 -0
  51. package/dist/helpers/index.d.ts.map +1 -1
  52. package/dist/helpers/mergeAllObjects.d.ts +3 -0
  53. package/dist/helpers/mergeAllObjects.d.ts.map +1 -1
  54. package/dist/hooks/useReactiveSpec.d.ts +7 -1
  55. package/dist/hooks/useReactiveSpec.d.ts.map +1 -1
  56. package/dist/hooks/useResponses.d.ts +4 -0
  57. package/dist/hooks/useResponses.d.ts.map +1 -1
  58. package/dist/hooks/useResponses.js +11 -10
  59. package/dist/index.js +72 -68
  60. package/dist/legacy/helpers/index.d.ts +1 -0
  61. package/dist/legacy/helpers/index.d.ts.map +1 -1
  62. package/dist/legacy/helpers/normalizeHeaderName.d.ts +5 -0
  63. package/dist/legacy/helpers/normalizeHeaderName.d.ts.map +1 -0
  64. package/dist/legacy/helpers/normalizeHeaderName.js +6 -0
  65. package/dist/legacy/helpers/normalizeHeaders.d.ts.map +1 -1
  66. package/dist/legacy/helpers/normalizeHeaders.js +15 -17
  67. package/dist/legacy/stores/useOpenApiStore.d.ts +7 -1
  68. package/dist/legacy/stores/useOpenApiStore.d.ts.map +1 -1
  69. package/dist/style.css +1 -1
  70. package/dist/types.d.ts +0 -8
  71. package/dist/types.d.ts.map +1 -1
  72. package/package.json +11 -11
  73. package/dist/components/Content/Operation/PathResponses/ExampleResponse.vue.d.ts.map +0 -1
  74. package/dist/components/Content/Operation/PathResponses/ExampleResponse.vue.js +0 -7
  75. package/dist/components/Content/Operation/PathResponses/ExampleResponse.vue2.js +0 -101
  76. package/dist/components/Content/Operation/PathResponses/Headers.vue.d.ts.map +0 -1
  77. package/dist/components/Content/Operation/PathResponses/PathResponses.vue.d.ts.map +0 -1
  78. package/dist/components/Content/Operation/PathResponses/PathResponses.vue.js +0 -7
  79. package/dist/components/Content/Operation/PathResponses/index.d.ts +0 -2
  80. package/dist/components/Content/Operation/PathResponses/index.d.ts.map +0 -1
  81. package/dist/components/SimpleTable/SimpleCell.vue.d.ts +0 -50
  82. package/dist/components/SimpleTable/SimpleCell.vue.d.ts.map +0 -1
  83. package/dist/components/SimpleTable/SimpleHeader.vue.d.ts +0 -12
  84. package/dist/components/SimpleTable/SimpleHeader.vue.d.ts.map +0 -1
  85. package/dist/components/SimpleTable/SimpleRow.vue.d.ts +0 -12
  86. package/dist/components/SimpleTable/SimpleRow.vue.d.ts.map +0 -1
  87. package/dist/components/SimpleTable/SimpleTable.stories.d.ts +0 -7
  88. package/dist/components/SimpleTable/SimpleTable.stories.d.ts.map +0 -1
  89. package/dist/components/SimpleTable/SimpleTable.vue.d.ts +0 -12
  90. package/dist/components/SimpleTable/SimpleTable.vue.d.ts.map +0 -1
  91. package/dist/components/SimpleTable/index.d.ts +0 -5
  92. package/dist/components/SimpleTable/index.d.ts.map +0 -1
@@ -3,7 +3,7 @@ import { ScalarMarkdown as V } from "@scalar/components";
3
3
  import B from "./ServerUrl.vue.js";
4
4
  import R from "./ServerUrlSelect.vue.js";
5
5
  import g from "./ServerVariablesForm.vue.js";
6
- const y = (r) => (N("data-v-da7210d5"), r = r(), U(), r), E = { key: 0 }, F = /* @__PURE__ */ y(() => /* @__PURE__ */ t("span", { class: "server-form-title" }, "Base URL", -1)), L = { class: "server-form" }, M = { class: "server-form-container" }, $ = { class: "server-item" }, j = {
6
+ const y = (r) => (N("data-v-465cec21"), r = r(), U(), r), E = { key: 0 }, F = /* @__PURE__ */ y(() => /* @__PURE__ */ t("span", { class: "server-form-title" }, "Base URL", -1)), L = { class: "server-form" }, M = { class: "server-form-container" }, $ = { class: "server-item" }, j = {
7
7
  key: 0,
8
8
  muted: ""
9
9
  }, q = { class: "description" }, H = /* @__PURE__ */ S({
@@ -23,8 +23,8 @@ const y = (r) => (N("data-v-da7210d5"), r = r(), U(), r), E = { key: 0 }, F = /*
23
23
  return (e = i.servers) == null ? void 0 : e[l.value];
24
24
  });
25
25
  return (e, s) => {
26
- var d, v, n;
27
- return (d = e.servers) != null && d.length ? (c(), u("div", E, [
26
+ var v, n, d;
27
+ return (v = e.servers) != null && v.length ? (c(), u("div", E, [
28
28
  F,
29
29
  t("div", L, [
30
30
  t("div", M, [
@@ -45,12 +45,12 @@ const y = (r) => (N("data-v-da7210d5"), r = r(), U(), r), E = { key: 0 }, F = /*
45
45
  ]),
46
46
  o(g, {
47
47
  values: e.variables,
48
- variables: (v = a.value) == null ? void 0 : v.variables,
48
+ variables: (n = a.value) == null ? void 0 : n.variables,
49
49
  "onUpdate:variable": s[0] || (s[0] = (b, h) => e.$emit("update:variable", b, h))
50
50
  }, null, 8, ["values", "variables"])
51
51
  ])
52
52
  ]),
53
- (n = a.value) != null && n.description ? (c(), u("div", j, [
53
+ (d = a.value) != null && d.description ? (c(), u("div", j, [
54
54
  t("div", q, [
55
55
  o(C(V), {
56
56
  value: a.value.description
@@ -1 +1 @@
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
+ {"version":3,"file":"ExampleRequest.vue.d.ts","sourceRoot":"","sources":["../../../src/features/ExampleRequest/ExampleRequest.vue"],"names":[],"mappings":"AA4XA,OAAO,KAAK,EAGV,oBAAoB,EACrB,MAAM,sBAAsB,CAAA;AA8P7B,iBAAS,cAAc;oBAiNM,GAAG;oBACH,GAAG;EAmC/B;AACD,QAAA,MAAM,eAAe;eArdR,oBAAoB;;eAApB,oBAAoB;aA2d/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 p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-f47524fb"]]);
4
+ const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-292a80da"]]);
5
5
  export {
6
6
  p as default
7
7
  };
@@ -1,51 +1,50 @@
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
- import { ScalarCodeBlock as z } from "@scalar/components";
3
- import { createHash as D, ssrState as Q } from "@scalar/oas-utils/helpers";
4
- import { getRequestFromOperation as W } from "@scalar/oas-utils/spec-getters";
5
- import { snippetz as B } from "@scalar/snippetz";
6
- import { asyncComputed as X } from "@vueuse/core";
7
- import { HTTPSnippet as Z } from "httpsnippet-lite";
8
- import G from "./ExamplePicker.vue.js";
9
- import ee from "./TextSelect.vue.js";
1
+ import { defineComponent as U, ref as b, computed as d, watch as L, inject as I, onServerPrefetch as M, useSSRContext as P, unref as r, openBlock as f, createBlock as V, withCtx as u, createVNode as m, createElementBlock as v, Fragment as O, createTextVNode as R, toDisplayString as g, createElementVNode as H, renderSlot as N, createCommentVNode as h } from "vue";
2
+ import { ScalarCodeBlock as Y } from "@scalar/components";
3
+ import { createHash as D, ssrState as z } from "@scalar/oas-utils/helpers";
4
+ import { getRequestFromOperation as Q } from "@scalar/oas-utils/spec-getters";
5
+ import { asyncComputed as W } from "@vueuse/core";
6
+ import X from "./ExamplePicker.vue.js";
7
+ import Z from "./TextSelect.vue.js";
10
8
  /* empty css */
11
- import { GLOBAL_SECURITY_SYMBOL as te } from "../../helpers/provideSymbols.js";
12
- import oe from "../../components/Card/Card.vue.js";
13
- import re from "../../components/Card/CardHeader.vue.js";
14
- import ae from "../../components/HttpMethod/HttpMethod.vue.js";
15
- import ne from "../../components/Card/CardContent.vue.js";
16
- import { getSecretCredentialsFromAuthentication as se, getRequestFromAuthentication as le } from "../../legacy/helpers/getRequestFromAuthentication.js";
17
- import ie from "../../components/Card/CardFooter.vue.js";
18
- import { useHttpClientStore as ce } from "../../stores/useHttpClientStore.js";
19
- import { useServerStore as pe } from "../../legacy/stores/useServerStore.js";
9
+ import { GLOBAL_SECURITY_SYMBOL as G } from "../../helpers/provideSymbols.js";
10
+ import ee from "../../components/Card/Card.vue.js";
11
+ import te from "../../components/Card/CardHeader.vue.js";
12
+ import oe from "../../components/HttpMethod/HttpMethod.vue.js";
13
+ import re from "../../components/Card/CardContent.vue.js";
14
+ import { getSecretCredentialsFromAuthentication as ae, getRequestFromAuthentication as ne } from "../../legacy/helpers/getRequestFromAuthentication.js";
15
+ import se from "../../components/Card/CardFooter.vue.js";
16
+ import { getExampleCode as le } from "../../helpers/getExampleCode.js";
17
+ import { useHttpClientStore as ie } from "../../stores/useHttpClientStore.js";
18
+ import { useServerStore as ce } from "../../legacy/stores/useServerStore.js";
20
19
  import { getApiClientRequest as ue } from "../../helpers/getApiClientRequest.js";
21
20
  import { useAuthenticationStore as me } from "../../legacy/stores/useAuthenticationStore.js";
22
- import { getHarRequest as de } from "../../helpers/getHarRequest.js";
23
- import { getUrlFromServerState as fe } from "../../legacy/helpers/getUrlFromServerState.js";
24
- const ye = { class: "request-header" }, ve = { class: "code-snippet" }, ge = {
21
+ import { getHarRequest as pe } from "../../helpers/getHarRequest.js";
22
+ import { getUrlFromServerState as de } from "../../legacy/helpers/getUrlFromServerState.js";
23
+ const fe = { class: "request-header" }, ye = { class: "code-snippet" }, ve = {
25
24
  key: 0,
26
25
  class: "request-card-footer-addon"
27
- }, Pe = /* @__PURE__ */ P({
26
+ }, Je = /* @__PURE__ */ U({
28
27
  __name: "ExampleRequest",
29
28
  props: {
30
29
  operation: {}
31
30
  },
32
- setup(T) {
33
- const n = T, C = `components-Content-Operation-Example-Request${D(
31
+ setup(B) {
32
+ const n = B, K = `components-Content-Operation-Example-Request${D(
34
33
  n.operation.path + n.operation.httpVerb + n.operation.operationId
35
- )}`, S = R(), {
36
- httpClient: r,
34
+ )}`, x = b(), {
35
+ httpClient: a,
37
36
  setHttpClient: $,
38
- availableTargets: E,
39
- httpTargetTitle: w,
37
+ availableTargets: C,
38
+ httpTargetTitle: j,
40
39
  httpClientTitle: F
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])
40
+ } = ie(), { server: S } = ce(), { authentication: y } = me(), i = d(() => {
41
+ var t;
42
+ const e = ["x-custom-examples", "x-codeSamples", "x-code-samples"];
43
+ for (const o of e)
44
+ if ((t = n.operation.information) != null && t[o])
46
45
  return n.operation.information[o] ?? [];
47
46
  return [];
48
- }), s = R(
47
+ }), s = b(
49
48
  // Default to first custom example
50
49
  i.value.length ? {
51
50
  targetKey: "customExamples",
@@ -53,189 +52,179 @@ const ye = { class: "request-header" }, ve = { class: "code-snippet" }, ge = {
53
52
  } : (
54
53
  // Otherwise use the globally selected HTTP client
55
54
  {
56
- targetKey: r.targetKey,
57
- clientKey: r.clientKey
55
+ targetKey: a.targetKey,
56
+ clientKey: a.clientKey
58
57
  }
59
58
  )
60
59
  );
61
- I(r, () => {
60
+ L(a, () => {
62
61
  s.value = {
63
- targetKey: r.targetKey,
64
- clientKey: r.clientKey
62
+ targetKey: a.targetKey,
63
+ clientKey: a.clientKey
65
64
  };
66
65
  });
67
- const q = f(
66
+ const E = d(
68
67
  () => {
69
- var t, e, o, l;
68
+ var e, t, o, l;
70
69
  return Object.keys(
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) ?? {}
70
+ ((l = (o = (t = (e = n.operation.information) == null ? void 0 : e.requestBody) == null ? void 0 : t.content) == null ? void 0 : o["application/json"]) == null ? void 0 : l.examples) ?? {}
72
71
  ).length > 1;
73
72
  }
74
- ), c = L(te);
75
- async function _() {
76
- var l, m;
73
+ ), c = I(G);
74
+ async function k() {
75
+ var l, p;
77
76
  if (s.value.targetKey === "customExamples")
78
77
  return ((l = i.value[s.value.clientKey]) == null ? void 0 : l.source) ?? "";
79
- const t = de(
78
+ const e = pe(
80
79
  {
81
- url: fe(k)
80
+ url: de(S)
82
81
  },
83
- W(
82
+ Q(
84
83
  n.operation,
85
84
  {
86
85
  replaceVariables: !0
87
86
  },
88
- S.value
87
+ x.value
89
88
  ),
90
- le(
91
- v,
92
- ((m = n.operation.information) == null ? void 0 : m.security) ?? (c == null ? void 0 : c())
89
+ ne(
90
+ y,
91
+ ((p = n.operation.information) == null ? void 0 : p.security) ?? (c == null ? void 0 : c())
93
92
  )
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) ?? "";
97
- try {
98
- const g = await new Z(t).convert(
99
- r.targetKey,
100
- r.clientKey
101
- );
102
- return decodeURIComponent(g);
103
- } catch (d) {
104
- return console.error("[ExampleRequest]", d), "";
105
- }
93
+ ), t = a.clientKey === "undici" || a.clientKey === "fetch" || a.clientKey === "ofetch" ? a.clientKey : null, o = a.targetKey;
94
+ return await le(e, o, t) ?? "";
106
95
  }
107
- const b = X(async () => {
96
+ const q = W(async () => {
108
97
  try {
109
- return await _();
110
- } catch (t) {
111
- return console.error("[generateSnippet]", t), "";
98
+ return await k();
99
+ } catch (e) {
100
+ return console.error("[generateSnippet]", e), "";
112
101
  }
113
- }, Q[C] ?? "");
102
+ }, z[K] ?? "");
114
103
  M(async () => {
115
- const t = Y();
116
- t.payload.data[C] = await _();
117
- }), f(() => ue({
118
- serverState: k,
119
- authenticationState: v,
104
+ const e = P();
105
+ e.payload.data[K] = await k();
106
+ }), d(() => ue({
107
+ serverState: S,
108
+ authenticationState: y,
120
109
  operation: n.operation,
121
110
  globalSecurity: c == null ? void 0 : c()
122
111
  }));
123
- const A = f(() => {
124
- var e, o;
125
- const t = (
112
+ const T = d(() => {
113
+ var t, o;
114
+ const e = (
126
115
  // Specified language
127
- ((e = s.value) == null ? void 0 : e.targetKey) === "customExamples" ? ((o = i.value[s.value.clientKey]) == null ? void 0 : o.lang) ?? "plaintext" : (
116
+ ((t = s.value) == null ? void 0 : t.targetKey) === "customExamples" ? ((o = i.value[s.value.clientKey]) == null ? void 0 : o.lang) ?? "plaintext" : (
128
117
  // Or language for the globally selected HTTP client
129
- r.targetKey
118
+ a.targetKey
130
119
  )
131
120
  );
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) => ({
121
+ return e === "shell" && q.value.includes("curl") ? "curl" : e === "Objective-C" ? "objc" : e;
122
+ }), w = d(() => {
123
+ const e = C.value.map((t) => ({
124
+ value: t.key,
125
+ label: t.title,
126
+ options: t.clients.map((o) => ({
138
127
  value: JSON.stringify({
139
- targetKey: e.key,
128
+ targetKey: t.key,
140
129
  clientKey: o.key
141
130
  }),
142
131
  label: o.title
143
132
  }))
144
133
  }));
145
- return i.value.length && t.unshift({
134
+ return i.value.length && e.unshift({
146
135
  value: "customExamples",
147
136
  label: "Examples",
148
- options: i.value.map((e, o) => ({
137
+ options: i.value.map((t, o) => ({
149
138
  value: JSON.stringify({
150
139
  targetKey: "customExamples",
151
140
  clientKey: o
152
141
  }),
153
- label: e.label ?? e.lang ?? `Example #${o + 1}`
142
+ label: t.label ?? t.lang ?? `Example #${o + 1}`
154
143
  }))
155
- }), t;
144
+ }), e;
156
145
  });
157
- function J(t) {
158
- const e = JSON.parse(t);
159
- e.targetKey === "customExamples" ? s.value = e : $(e);
146
+ function A(e) {
147
+ const t = JSON.parse(e);
148
+ t.targetKey === "customExamples" ? s.value = t : $(t);
160
149
  }
161
- return (t, e) => a(E).length || i.value.length ? (y(), V(a(oe), {
150
+ return (e, t) => r(C).length || i.value.length ? (f(), V(r(ee), {
162
151
  key: 0,
163
152
  class: "dark-mode"
164
153
  }, {
165
- default: p(() => [
166
- u(a(re), { muted: "" }, {
167
- actions: p(() => [
168
- u(ee, {
154
+ default: u(() => [
155
+ m(r(te), { muted: "" }, {
156
+ actions: u(() => [
157
+ m(Z, {
169
158
  class: "request-client-picker",
170
159
  modelValue: JSON.stringify(s.value),
171
- options: U.value,
172
- "onUpdate:modelValue": J
160
+ options: w.value,
161
+ "onUpdate:modelValue": A
173
162
  }, {
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)
163
+ default: u(() => [
164
+ s.value.targetKey === "customExamples" ? (f(), v(O, { key: 0 }, [
165
+ R(g(i.value[s.value.clientKey].label ?? "Example"), 1)
166
+ ], 64)) : (f(), v(O, { key: 1 }, [
167
+ R(g(r(j)) + " " + g(r(F)), 1)
179
168
  ], 64))
180
169
  ]),
181
170
  _: 1
182
171
  }, 8, ["modelValue", "options"])
183
172
  ]),
184
- default: p(() => [
185
- N("div", ye, [
186
- u(a(ae), {
173
+ default: u(() => [
174
+ H("div", fe, [
175
+ m(r(oe), {
187
176
  as: "span",
188
177
  class: "request-method",
189
- method: t.operation.httpVerb
178
+ method: e.operation.httpVerb
190
179
  }, null, 8, ["method"]),
191
- j(t.$slots, "header", {}, void 0, !0)
180
+ N(e.$slots, "header", {}, void 0, !0)
192
181
  ])
193
182
  ]),
194
183
  _: 3
195
184
  }),
196
- u(a(ne), {
185
+ m(r(re), {
197
186
  borderless: "",
198
187
  class: "request-editor-section custom-scroll",
199
188
  frameless: ""
200
189
  }, {
201
- default: p(() => [
202
- N("div", ve, [
203
- u(a(z), {
190
+ default: u(() => [
191
+ H("div", ye, [
192
+ m(r(Y), {
204
193
  class: "bg-b-2",
205
- content: a(b),
206
- hideCredentials: a(se)(a(v)),
207
- lang: A.value,
194
+ content: r(q),
195
+ hideCredentials: r(ae)(r(y)),
196
+ lang: T.value,
208
197
  lineNumbers: ""
209
198
  }, null, 8, ["content", "hideCredentials", "lang"])
210
199
  ])
211
200
  ]),
212
201
  _: 1
213
202
  }),
214
- q.value || t.$slots.footer ? (y(), V(a(ie), {
203
+ E.value || e.$slots.footer ? (f(), V(r(se), {
215
204
  key: 0,
216
205
  class: "request-card-footer",
217
206
  contrast: ""
218
207
  }, {
219
- default: p(() => {
220
- var o, l, m, d;
208
+ default: u(() => {
209
+ var o, l, p, _;
221
210
  return [
222
- q.value ? (y(), h("div", ge, [
223
- u(G, {
211
+ E.value ? (f(), v("div", ve, [
212
+ m(X, {
224
213
  class: "request-example-selector",
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)
214
+ examples: ((_ = (p = (l = (o = e.operation.information) == null ? void 0 : o.requestBody) == null ? void 0 : l.content) == null ? void 0 : p["application/json"]) == null ? void 0 : _.examples) ?? [],
215
+ "onUpdate:modelValue": t[0] || (t[0] = (J) => x.value = J)
227
216
  }, null, 8, ["examples"])
228
- ])) : x("", !0),
229
- j(t.$slots, "footer", {}, void 0, !0)
217
+ ])) : h("", !0),
218
+ N(e.$slots, "footer", {}, void 0, !0)
230
219
  ];
231
220
  }),
232
221
  _: 3
233
- })) : x("", !0)
222
+ })) : h("", !0)
234
223
  ]),
235
224
  _: 3
236
- })) : x("", !0);
225
+ })) : h("", !0);
237
226
  }
238
227
  });
239
228
  export {
240
- Pe as default
229
+ Je as default
241
230
  };
@@ -1,8 +1,8 @@
1
- import type { ExampleResponseHeaders } from '../../../../types';
1
+ import type { OpenAPI } from '@scalar/openapi-types';
2
2
  declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<{
3
- headers: ExampleResponseHeaders;
3
+ response: OpenAPI.ResponseObject;
4
4
  }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<{
5
- headers: ExampleResponseHeaders;
5
+ response: OpenAPI.ResponseObject;
6
6
  }>>>, {}, {}>;
7
7
  export default _default;
8
8
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
@@ -14,4 +14,4 @@ type __VLS_TypePropsToOption<T> = {
14
14
  required: true;
15
15
  };
16
16
  };
17
- //# sourceMappingURL=Headers.vue.d.ts.map
17
+ //# sourceMappingURL=ExampleResponse.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExampleResponse.vue.d.ts","sourceRoot":"","sources":["../../../src/features/ExampleResponses/ExampleResponse.vue"],"names":[],"mappings":"AAsGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;;cAKxC,OAAO,CAAC,cAAc;;cAAtB,OAAO,CAAC,cAAc;;AA2GlC,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 "./ExampleResponse.vue2.js";
2
+ /* empty css */
3
+ import p from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const r = /* @__PURE__ */ p(o, [["__scopeId", "data-v-908bf679"]]);
5
+ export {
6
+ r as default
7
+ };
@@ -0,0 +1,37 @@
1
+ import { defineComponent as c, openBlock as n, createBlock as a, unref as e, createElementBlock as i } from "vue";
2
+ import { ScalarCodeBlock as m } from "@scalar/components";
3
+ import { prettyPrintJson as l } from "@scalar/oas-utils/helpers";
4
+ import { getExampleFromSchema as d } from "@scalar/oas-utils/spec-getters";
5
+ const f = {
6
+ key: 2,
7
+ class: "empty-state"
8
+ }, B = /* @__PURE__ */ c({
9
+ __name: "ExampleResponse",
10
+ props: {
11
+ response: {}
12
+ },
13
+ setup(k) {
14
+ return (o, u) => {
15
+ var s, t, r, p;
16
+ return (s = o.response) != null && s.example ? (n(), a(e(m), {
17
+ key: 0,
18
+ class: "bg-b-2",
19
+ content: e(l)((t = o.response) == null ? void 0 : t.example),
20
+ lang: "json"
21
+ }, null, 8, ["content"])) : (r = o.response) != null && r.schema ? (n(), a(e(m), {
22
+ key: 1,
23
+ class: "bg-b-2",
24
+ content: e(l)(
25
+ e(d)((p = o.response) == null ? void 0 : p.schema, {
26
+ emptyString: "…",
27
+ mode: "read"
28
+ })
29
+ ),
30
+ lang: "json"
31
+ }, null, 8, ["content"])) : (n(), i("div", f, " No Body "));
32
+ };
33
+ }
34
+ });
35
+ export {
36
+ B as default
37
+ };
@@ -14,4 +14,4 @@ type __VLS_TypePropsToOption<T> = {
14
14
  required: true;
15
15
  };
16
16
  };
17
- //# sourceMappingURL=PathResponses.vue.d.ts.map
17
+ //# sourceMappingURL=ExampleResponses.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExampleResponses.vue.d.ts","sourceRoot":"","sources":["../../../src/features/ExampleResponses/ExampleResponses.vue"],"names":[],"mappings":"AAqTA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;;eAoB7B,oBAAoB;;eAApB,oBAAoB;;AAoXvD,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 "./ExampleResponses.vue2.js";
2
+ /* empty css */
3
+ import e from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const m = /* @__PURE__ */ e(o, [["__scopeId", "data-v-0696399e"]]);
5
+ export {
6
+ m as default
7
+ };
@@ -1,22 +1,22 @@
1
- import { defineComponent as B, ref as S, computed as v, openBlock as t, createBlock as r, unref as s, withCtx as c, createVNode as b, createElementBlock as x, createCommentVNode as f, createTextVNode as g, withDirectives as M, createElementVNode as w, vModelCheckbox as N, Fragment as R, renderList as F, toDisplayString as O, pushScopeId as P, popScopeId as A } from "vue";
2
- import { ScalarIcon as D, ScalarCodeBlock as U, ScalarMarkdown as H } from "@scalar/components";
1
+ import { defineComponent as B, ref as S, computed as v, openBlock as t, createBlock as r, unref as s, withCtx as c, createVNode as b, createElementBlock as x, createCommentVNode as f, createTextVNode as g, withDirectives as M, createElementVNode as E, vModelCheckbox as N, Fragment as R, renderList as F, toDisplayString as O, pushScopeId as A, popScopeId as D } from "vue";
2
+ import { ScalarIcon as P, ScalarCodeBlock as U, ScalarMarkdown as H } from "@scalar/components";
3
3
  import { normalizeMimeTypeObject as J } from "@scalar/oas-utils/helpers";
4
4
  import T from "./ExampleResponse.vue.js";
5
- import K from "../../../Card/Card.vue.js";
6
- import L from "../../../Card/CardTabHeader.vue.js";
7
- import W from "../../../Card/CardTab.vue.js";
8
- import q from "../../../Card/CardContent.vue.js";
9
- import G from "../../../Card/CardFooter.vue.js";
10
- import Q from "../../../../features/ExampleRequest/ExamplePicker.vue.js";
11
- import { useClipboard as X } from "../../../../hooks/useClipboard.js";
12
- const Y = (u) => (P("data-v-b976599a"), u = u(), A(), u), Z = {
5
+ import K from "../../components/Card/Card.vue.js";
6
+ import L from "../../components/Card/CardTabHeader.vue.js";
7
+ import W from "../../components/Card/CardTab.vue.js";
8
+ import q from "../../components/Card/CardContent.vue.js";
9
+ import G from "../../components/Card/CardFooter.vue.js";
10
+ import Q from "../ExampleRequest/ExamplePicker.vue.js";
11
+ import { useClipboard as X } from "../../hooks/useClipboard.js";
12
+ const Y = (u) => (A("data-v-0696399e"), u = u(), D(), u), Z = {
13
13
  key: 1,
14
14
  class: "scalar-card-checkbox"
15
- }, $ = /* @__PURE__ */ Y(() => /* @__PURE__ */ w("span", { class: "scalar-card-checkbox-checkmark" }, null, -1)), z = { class: "scalar-card-container custom-scroll" }, ee = {
15
+ }, $ = /* @__PURE__ */ Y(() => /* @__PURE__ */ E("span", { class: "scalar-card-checkbox-checkmark" }, null, -1)), z = { class: "scalar-card-container custom-scroll" }, ee = {
16
16
  key: 1,
17
17
  class: "response-description"
18
18
  }, ie = /* @__PURE__ */ B({
19
- __name: "PathResponses",
19
+ __name: "ExampleResponses",
20
20
  props: {
21
21
  operation: {}
22
22
  },
@@ -28,9 +28,9 @@ const Y = (u) => (P("data-v-b976599a"), u = u(), A(), u), Z = {
28
28
  }
29
29
  ), y = v(
30
30
  () => !!o.value.examples
31
- ), E = S(0), m = v(() => {
31
+ ), w = S(0), m = v(() => {
32
32
  var a, i;
33
- const e = C.value[E.value];
33
+ const e = C.value[w.value];
34
34
  return (i = (a = k.operation.information) == null ? void 0 : a.responses) == null ? void 0 : i[e];
35
35
  }), o = v(() => {
36
36
  var a;
@@ -55,7 +55,7 @@ const Y = (u) => (P("data-v-b976599a"), u = u(), A(), u), Z = {
55
55
  ...o.value,
56
56
  example: y.value && p.value ? o.value.examples[p.value].value ?? o.value.examples[p.value] : j()
57
57
  })), I = (e) => {
58
- E.value = e, p.value = void 0;
58
+ w.value = e, p.value = void 0;
59
59
  }, _ = S(!1);
60
60
  return (e, a) => C.value.length ? (t(), r(s(K), { key: 0 }, {
61
61
  default: c(() => {
@@ -78,7 +78,7 @@ const Y = (u) => (P("data-v-b976599a"), u = u(), A(), u), Z = {
78
78
  return s(V)((n = o.value) == null ? void 0 : n.example);
79
79
  })
80
80
  }, [
81
- b(s(D), {
81
+ b(s(P), {
82
82
  icon: "Clipboard",
83
83
  width: "12px",
84
84
  x: "asd"
@@ -86,7 +86,7 @@ const Y = (u) => (P("data-v-b976599a"), u = u(), A(), u), Z = {
86
86
  ])) : f("", !0),
87
87
  (d = o.value) != null && d.schema ? (t(), x("label", Z, [
88
88
  g(" Show Schema "),
89
- M(w("input", {
89
+ M(E("input", {
90
90
  "onUpdate:modelValue": a[1] || (a[1] = (n) => _.value = n),
91
91
  class: "scalar-card-checkbox-input",
92
92
  type: "checkbox"
@@ -107,7 +107,7 @@ const Y = (u) => (P("data-v-b976599a"), u = u(), A(), u), Z = {
107
107
  ]),
108
108
  _: 1
109
109
  }),
110
- w("div", z, [
110
+ E("div", z, [
111
111
  b(s(q), { muted: "" }, {
112
112
  default: c(() => {
113
113
  var l;
@@ -0,0 +1,2 @@
1
+ export { default as ExampleResponses } from './ExampleResponses.vue.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/features/ExampleResponses/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,wBAAwB,CAAA"}
@@ -0,0 +1,6 @@
1
+ import type { Request } from '@scalar/snippetz';
2
+ /**
3
+ * Creates a complete HAR request, even if just passed a partial request.
4
+ */
5
+ export declare function createRequest(partialRequest?: Partial<Request>): Request;
6
+ //# sourceMappingURL=createRequest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createRequest.d.ts","sourceRoot":"","sources":["../../src/helpers/createRequest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAE/C;;GAEG;AACH,wBAAgB,aAAa,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAYxE"}
@@ -0,0 +1,16 @@
1
+ function t(e) {
2
+ return {
3
+ httpVersion: "http/2.0",
4
+ method: "GET",
5
+ url: "",
6
+ cookies: [],
7
+ headers: [],
8
+ headersSize: 0,
9
+ bodySize: 0,
10
+ queryString: [],
11
+ ...e ?? {}
12
+ };
13
+ }
14
+ export {
15
+ t as createRequest
16
+ };
@@ -0,0 +1,9 @@
1
+ import { type Request, type ClientId as SnippetzClientId, type TargetId as SnippetzTargetId } from '@scalar/snippetz';
2
+ import { type ClientId as HttpSnippetLiteClientId, type TargetId as HttpSnippetLiteTargetId } from 'httpsnippet-lite';
3
+ export type TargetId = HttpSnippetLiteTargetId | SnippetzTargetId;
4
+ export type ClientId = HttpSnippetLiteClientId | SnippetzClientId;
5
+ /**
6
+ * Returns a code example for given HAR request
7
+ */
8
+ export declare function getExampleCode(request: Request, target: TargetId, client: ClientId): Promise<string>;
9
+ //# sourceMappingURL=getExampleCode.d.ts.map