@scalar/api-reference 1.25.115 → 1.25.116

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 (57) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/browser/standalone.js +10903 -10880
  3. package/dist/browser/webpack-stats.json +1 -1
  4. package/dist/components/Content/Lazy/Loading.vue.d.ts.map +1 -1
  5. package/dist/components/Content/Lazy/Loading.vue.js +58 -60
  6. package/dist/components/Content/Tag/TagList.vue.d.ts.map +1 -1
  7. package/dist/components/Content/Tag/TagList.vue.js +36 -38
  8. package/dist/components/Sidebar/SidebarElement.vue.d.ts.map +1 -1
  9. package/dist/components/Sidebar/SidebarElement.vue.js +1 -1
  10. package/dist/components/Sidebar/SidebarElement.vue2.js +59 -55
  11. package/dist/features/ApiClientModal/useApiClient.d.ts +18 -18
  12. package/dist/features/ApiClientModal/useApiClient.d.ts.map +1 -1
  13. package/dist/features/ExampleRequest/ExampleRequest.vue.d.ts +6 -4
  14. package/dist/features/ExampleRequest/ExampleRequest.vue.d.ts.map +1 -1
  15. package/dist/features/ExampleRequest/ExampleRequest.vue.js +2 -2
  16. package/dist/features/ExampleRequest/ExampleRequest.vue2.js +138 -119
  17. package/dist/features/ExampleRequest/helpers/filter-security-requirements.d.ts +6 -0
  18. package/dist/features/ExampleRequest/helpers/filter-security-requirements.d.ts.map +1 -0
  19. package/dist/features/ExampleRequest/helpers/filter-security-requirements.js +17 -0
  20. package/dist/features/Operation/Operation.vue.d.ts +4 -5
  21. package/dist/features/Operation/Operation.vue.d.ts.map +1 -1
  22. package/dist/features/Operation/Operation.vue.js +34 -41
  23. package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts +6 -6
  24. package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts.map +1 -1
  25. package/dist/features/Operation/layouts/ClassicLayout.vue.js +4 -4
  26. package/dist/features/Operation/layouts/ClassicLayout.vue2.js +52 -51
  27. package/dist/features/Operation/layouts/ModernLayout.vue.d.ts +6 -6
  28. package/dist/features/Operation/layouts/ModernLayout.vue.d.ts.map +1 -1
  29. package/dist/features/Operation/layouts/ModernLayout.vue.js +2 -2
  30. package/dist/features/Operation/layouts/ModernLayout.vue2.js +70 -70
  31. package/dist/helpers/convert-to-har-request.d.ts +28 -0
  32. package/dist/helpers/convert-to-har-request.d.ts.map +1 -0
  33. package/dist/helpers/convert-to-har-request.js +64 -0
  34. package/dist/helpers/get-example-code.d.ts +9 -0
  35. package/dist/helpers/get-example-code.d.ts.map +1 -0
  36. package/dist/helpers/get-example-code.js +51 -0
  37. package/dist/helpers/index.d.ts +0 -3
  38. package/dist/helpers/index.d.ts.map +1 -1
  39. package/dist/hooks/useNavState.d.ts.map +1 -1
  40. package/dist/hooks/useNavState.js +26 -24
  41. package/dist/hooks/useReactiveSpec.d.ts +1 -1
  42. package/dist/index.js +66 -72
  43. package/dist/style.css +1 -1
  44. package/package.json +10 -10
  45. package/dist/features/Operation/hooks/useRequestExample.d.ts +0 -17
  46. package/dist/features/Operation/hooks/useRequestExample.d.ts.map +0 -1
  47. package/dist/features/Operation/hooks/useRequestExample.js +0 -68
  48. package/dist/helpers/convertRequestToHarRequest.d.ts +0 -7
  49. package/dist/helpers/convertRequestToHarRequest.d.ts.map +0 -1
  50. package/dist/helpers/convertRequestToHarRequest.js +0 -64
  51. package/dist/helpers/get-request.js +0 -6
  52. package/dist/helpers/getExampleCode.d.ts +0 -8
  53. package/dist/helpers/getExampleCode.d.ts.map +0 -1
  54. package/dist/helpers/getExampleCode.js +0 -16
  55. package/dist/helpers/joinWithSlash.d.ts +0 -5
  56. package/dist/helpers/joinWithSlash.d.ts.map +0 -1
  57. package/dist/helpers/joinWithSlash.js +0 -4
@@ -1,49 +1,50 @@
1
- import { defineComponent as D, useId as M, computed as p, ref as z, watch as A, onServerPrefetch as G, useSSRContext as L, unref as o, openBlock as m, createBlock as v, withCtx as l, createVNode as r, createElementBlock as g, Fragment as V, createTextVNode as d, toDisplayString as h, createElementVNode as K, renderSlot as f, createCommentVNode as x } from "vue";
2
- import { ScalarCodeBlock as Q } from "@scalar/components";
3
- import { createHash as W, ssrState as X } from "@scalar/oas-utils/helpers";
4
- import { asyncComputed as Y } from "@vueuse/core";
5
- import H from "../../components/ScreenReader.vue.js";
6
- import Z from "./ExamplePicker.vue.js";
7
- import _ from "./TextSelect.vue.js";
1
+ import { defineComponent as A, useId as N, computed as d, ref as G, watch as L, onServerPrefetch as Q, useSSRContext as X, unref as a, openBlock as m, createBlock as g, withCtx as r, createVNode as l, createElementBlock as x, Fragment as w, createTextVNode as f, toDisplayString as K, createElementVNode as k, renderSlot as y, createCommentVNode as C } from "vue";
2
+ import { filterSecurityRequirements as Y } from "./helpers/filter-security-requirements.js";
3
+ import { getExampleCode as Z } from "../../helpers/get-example-code.js";
4
+ import { useWorkspace as _ } from "@scalar/api-client/store";
5
+ import { ScalarCodeBlock as ee } from "@scalar/components";
6
+ import { ssrState as te } from "@scalar/oas-utils/helpers";
7
+ import { asyncComputed as oe } from "@vueuse/core";
8
+ import V from "../../components/ScreenReader.vue.js";
9
+ import ae from "./ExamplePicker.vue.js";
10
+ import re from "./TextSelect.vue.js";
8
11
  /* empty css */
9
- import N from "../../components/Card/Card.vue.js";
10
- import ee from "../../components/Card/CardHeader.vue.js";
12
+ import j from "../../components/Card/Card.vue.js";
13
+ import le from "../../components/Card/CardHeader.vue.js";
11
14
  import B from "../../components/HttpMethod/HttpMethod.vue.js";
12
- import O from "../../components/Card/CardContent.vue.js";
13
- import te from "../../components/Card/CardFooter.vue.js";
14
- import { getExampleCode as ae } from "../../helpers/getExampleCode.js";
15
- import { useHttpClientStore as oe } from "../../stores/useHttpClientStore.js";
16
- import { useExampleStore as le } from "../../legacy/stores/useExampleStore.js";
17
- const re = ["id"], se = ["id"], ne = {
15
+ import T from "../../components/Card/CardContent.vue.js";
16
+ import ne from "../../components/Card/CardFooter.vue.js";
17
+ import { useHttpClientStore as se } from "../../stores/useHttpClientStore.js";
18
+ import { useExampleStore as ie } from "../../legacy/stores/useExampleStore.js";
19
+ const ue = ["id"], ce = ["id"], me = {
18
20
  key: 0,
19
21
  class: "request-card-footer-addon"
20
- }, ie = { class: "request-header" }, qe = /* @__PURE__ */ D({
22
+ }, pe = { class: "request-header" }, je = /* @__PURE__ */ A({
21
23
  __name: "ExampleRequest",
22
24
  props: {
23
25
  operation: {},
24
- request: {},
25
- secretCredentials: {},
26
- fallback: { type: Boolean }
26
+ server: {},
27
+ collection: {},
28
+ fallback: { type: Boolean },
29
+ transformedOperation: {}
27
30
  },
28
31
  setup(n) {
29
- const C = `components-Content-Operation-Example-Request${W(
30
- n.operation.path + n.operation.httpVerb + n.operation.operationId
31
- )}`, { selectedExampleKey: T, operationId: j } = le(), {
32
+ const S = `components-Content-Operation-Example-Request${N()}`, { selectedExampleKey: H, operationId: R } = ie(), { requestExamples: I, securitySchemes: h } = _(), {
32
33
  httpClient: i,
33
- setHttpClient: w,
34
- availableTargets: k,
35
- httpTargetTitle: R,
36
- httpClientTitle: I
37
- } = oe(), y = M(), u = p(() => {
34
+ setHttpClient: J,
35
+ availableTargets: E,
36
+ httpTargetTitle: D,
37
+ httpClientTitle: P
38
+ } = se(), v = N(), c = d(() => {
38
39
  var t;
39
40
  const e = ["x-custom-examples", "x-codeSamples", "x-code-samples"];
40
- for (const a of e)
41
- if ((t = n.operation.information) != null && t[a])
42
- return [...n.operation.information[a]];
41
+ for (const o of e)
42
+ if ((t = n.transformedOperation.information) != null && t[o])
43
+ return [...n.transformedOperation.information[o]];
43
44
  return [];
44
- }), s = z(
45
+ }), s = G(
45
46
  // Default to first custom example
46
- u.value.length ? {
47
+ c.value.length ? {
47
48
  targetKey: "customExamples",
48
49
  clientKey: 0
49
50
  } : (
@@ -54,193 +55,211 @@ const re = ["id"], se = ["id"], ne = {
54
55
  }
55
56
  )
56
57
  );
57
- A(i, () => {
58
+ L(i, () => {
58
59
  s.value = {
59
60
  targetKey: i.targetKey,
60
61
  clientKey: i.clientKey
61
62
  };
62
63
  });
63
- const E = p(
64
+ const b = d(
64
65
  () => {
65
- var e, t, a, c;
66
+ var e, t, o, u;
66
67
  return Object.keys(
67
- ((c = (a = (t = (e = n.operation.information) == null ? void 0 : e.requestBody) == null ? void 0 : t.content) == null ? void 0 : a["application/json"]) == null ? void 0 : c.examples) ?? {}
68
+ ((u = (o = (t = (e = n.transformedOperation.information) == null ? void 0 : e.requestBody) == null ? void 0 : t.content) == null ? void 0 : o["application/json"]) == null ? void 0 : u.examples) ?? {}
68
69
  ).length > 1;
69
70
  }
70
- ), S = async () => {
71
- var a;
71
+ ), q = async () => {
72
+ var p;
72
73
  if (s.value.targetKey === "customExamples")
73
- return ((a = u.value[s.value.clientKey]) == null ? void 0 : a.source) ?? "";
74
- if (!n.request) return "";
75
- const e = i.clientKey, t = i.targetKey;
76
- return await ae(n.request, t, e) ?? "";
77
- }, b = Y(async () => {
74
+ return ((p = c.value[s.value.clientKey]) == null ? void 0 : p.source) ?? "";
75
+ const e = i.clientKey, t = i.targetKey, o = I[n.operation.examples[0]];
76
+ if (!o) return "";
77
+ const u = Y(
78
+ n.operation.security || n.collection.security,
79
+ n.collection.selectedSecuritySchemeUids,
80
+ h
81
+ );
82
+ return await Z(
83
+ n.operation,
84
+ o,
85
+ t,
86
+ e,
87
+ n.server,
88
+ u
89
+ ) ?? "";
90
+ }, O = oe(async () => {
78
91
  try {
79
- return await S();
92
+ return await q();
80
93
  } catch (e) {
81
94
  return console.error("[generateSnippet]", e), "";
82
95
  }
83
- }, X[C] ?? "");
84
- G(async () => {
85
- const e = L();
86
- e.payload.data[C] = await S();
96
+ }, te[S] ?? "");
97
+ Q(async () => {
98
+ const e = X();
99
+ e.payload.data[S] = await q();
87
100
  });
88
- const J = p(() => {
89
- var t, a;
101
+ const U = d(() => {
102
+ var t, o;
90
103
  const e = (
91
104
  // Specified language
92
- ((t = s.value) == null ? void 0 : t.targetKey) === "customExamples" ? ((a = u.value[s.value.clientKey]) == null ? void 0 : a.lang) ?? "plaintext" : (
105
+ ((t = s.value) == null ? void 0 : t.targetKey) === "customExamples" ? ((o = c.value[s.value.clientKey]) == null ? void 0 : o.lang) ?? "plaintext" : (
93
106
  // Or language for the globally selected HTTP client
94
107
  i.targetKey
95
108
  )
96
109
  );
97
- return e === "shell" && b.value.includes("curl") ? "curl" : e === "Objective-C" ? "objc" : e;
98
- }), P = p(() => {
99
- const e = k.value.map((t) => ({
110
+ return e === "shell" && O.value.includes("curl") ? "curl" : e === "Objective-C" ? "objc" : e;
111
+ }), F = d(
112
+ () => Object.values(h).flatMap((e) => e.type === "apiKey" ? e.value : (e == null ? void 0 : e.type) === "http" ? [
113
+ e.token,
114
+ e.password,
115
+ btoa(`${e.username}:${e.password}`)
116
+ ] : e.type === "oauth2" ? Object.values(e.flows).map((t) => t.token) : [])
117
+ ), M = d(() => {
118
+ const e = E.value.map((t) => ({
100
119
  value: t.key,
101
120
  label: t.title,
102
- options: t.clients.map((a) => ({
121
+ options: t.clients.map((o) => ({
103
122
  value: JSON.stringify({
104
123
  targetKey: t.key,
105
- clientKey: a.client
124
+ clientKey: o.client
106
125
  }),
107
- label: a.title
126
+ label: o.title
108
127
  }))
109
128
  }));
110
- return u.value.length && e.unshift({
129
+ return c.value.length && e.unshift({
111
130
  value: "customExamples",
112
131
  label: "Examples",
113
- options: u.value.map((t, a) => ({
132
+ options: c.value.map((t, o) => ({
114
133
  value: JSON.stringify({
115
134
  targetKey: "customExamples",
116
- clientKey: a
135
+ clientKey: o
117
136
  }),
118
- label: t.label ?? t.lang ?? `Example #${a + 1}`
137
+ label: t.label ?? t.lang ?? `Example #${o + 1}`
119
138
  }))
120
139
  }), e;
121
140
  });
122
- function F(e) {
141
+ function W(e) {
123
142
  const t = JSON.parse(e);
124
- t.targetKey === "customExamples" ? s.value = t : w(t);
143
+ t.targetKey === "customExamples" ? s.value = t : J(t);
125
144
  }
126
- return (e, t) => o(k).length || u.value.length ? (m(), v(o(N), {
145
+ return (e, t) => a(E).length || c.value.length ? (m(), g(a(j), {
127
146
  key: 0,
128
147
  class: "dark-mode"
129
148
  }, {
130
- default: l(() => [
131
- r(o(ee), { muted: "" }, {
132
- actions: l(() => [
133
- r(_, {
149
+ default: r(() => [
150
+ l(a(le), { muted: "" }, {
151
+ actions: r(() => [
152
+ l(re, {
134
153
  class: "request-client-picker",
135
- controls: `${o(y)}-example`,
154
+ controls: `${a(v)}-example`,
136
155
  modelValue: JSON.stringify(s.value),
137
- options: P.value,
138
- "onUpdate:modelValue": F
156
+ options: M.value,
157
+ "onUpdate:modelValue": W
139
158
  }, {
140
- default: l(() => [
141
- s.value.targetKey === "customExamples" ? (m(), g(V, { key: 0 }, [
142
- r(H, null, {
143
- default: l(() => t[1] || (t[1] = [
144
- d("Selected Example:")
159
+ default: r(() => [
160
+ s.value.targetKey === "customExamples" ? (m(), x(w, { key: 0 }, [
161
+ l(V, null, {
162
+ default: r(() => t[1] || (t[1] = [
163
+ f("Selected Example:")
145
164
  ])),
146
165
  _: 1
147
166
  }),
148
- d(" " + h(u.value[s.value.clientKey].label ?? "Example"), 1)
149
- ], 64)) : (m(), g(V, { key: 1 }, [
150
- r(H, null, {
151
- default: l(() => t[2] || (t[2] = [
152
- d("Selected HTTP client:")
167
+ f(" " + K(c.value[s.value.clientKey].label ?? "Example"), 1)
168
+ ], 64)) : (m(), x(w, { key: 1 }, [
169
+ l(V, null, {
170
+ default: r(() => t[2] || (t[2] = [
171
+ f("Selected HTTP client:")
153
172
  ])),
154
173
  _: 1
155
174
  }),
156
- d(" " + h(o(R)) + " " + h(o(I)), 1)
175
+ f(" " + K(a(D)) + " " + K(a(P)), 1)
157
176
  ], 64))
158
177
  ]),
159
178
  _: 1
160
179
  }, 8, ["controls", "modelValue", "options"])
161
180
  ]),
162
- default: l(() => [
163
- K("div", {
164
- id: `${o(y)}-header`,
181
+ default: r(() => [
182
+ k("div", {
183
+ id: `${a(v)}-header`,
165
184
  class: "request-header"
166
185
  }, [
167
- r(o(B), {
186
+ l(a(B), {
168
187
  as: "span",
169
188
  class: "request-method",
170
- method: e.operation.httpVerb
189
+ method: e.operation.method
171
190
  }, null, 8, ["method"]),
172
- f(e.$slots, "header", {}, void 0, !0)
173
- ], 8, re)
191
+ y(e.$slots, "header", {}, void 0, !0)
192
+ ], 8, ue)
174
193
  ]),
175
194
  _: 3
176
195
  }),
177
- r(o(O), {
196
+ l(a(T), {
178
197
  borderless: "",
179
198
  class: "request-editor-section custom-scroll",
180
199
  frameless: ""
181
200
  }, {
182
- default: l(() => [
183
- K("div", {
184
- id: `${o(y)}-example`,
201
+ default: r(() => [
202
+ k("div", {
203
+ id: `${a(v)}-example`,
185
204
  class: "code-snippet"
186
205
  }, [
187
- r(o(Q), {
206
+ l(a(ee), {
188
207
  class: "bg-b-2",
189
- content: o(b),
190
- hideCredentials: e.secretCredentials,
191
- lang: J.value,
208
+ content: a(O),
209
+ hideCredentials: F.value,
210
+ lang: U.value,
192
211
  lineNumbers: ""
193
212
  }, null, 8, ["content", "hideCredentials", "lang"])
194
- ], 8, se)
213
+ ], 8, ce)
195
214
  ]),
196
215
  _: 1
197
216
  }),
198
- E.value || e.$slots.footer ? (m(), v(o(te), {
217
+ b.value || e.$slots.footer ? (m(), g(a(ne), {
199
218
  key: 0,
200
219
  class: "request-card-footer",
201
220
  contrast: ""
202
221
  }, {
203
- default: l(() => {
204
- var a, c, q, $;
222
+ default: r(() => {
223
+ var o, u, p, $;
205
224
  return [
206
- E.value ? (m(), g("div", ne, [
207
- r(Z, {
225
+ b.value ? (m(), x("div", me, [
226
+ l(ae, {
208
227
  class: "request-example-selector",
209
- examples: (($ = (q = (c = (a = e.operation.information) == null ? void 0 : a.requestBody) == null ? void 0 : c.content) == null ? void 0 : q["application/json"]) == null ? void 0 : $.examples) ?? [],
210
- "onUpdate:modelValue": t[0] || (t[0] = (U) => (T.value = U, j.value = e.operation.operationId))
228
+ examples: (($ = (p = (u = (o = e.transformedOperation.information) == null ? void 0 : o.requestBody) == null ? void 0 : u.content) == null ? void 0 : p["application/json"]) == null ? void 0 : $.examples) ?? [],
229
+ "onUpdate:modelValue": t[0] || (t[0] = (z) => (H.value = z, R.value = e.operation.operationId))
211
230
  }, null, 8, ["examples"])
212
- ])) : x("", !0),
213
- f(e.$slots, "footer", {}, void 0, !0)
231
+ ])) : C("", !0),
232
+ y(e.$slots, "footer", {}, void 0, !0)
214
233
  ];
215
234
  }),
216
235
  _: 3
217
- })) : x("", !0)
236
+ })) : C("", !0)
218
237
  ]),
219
238
  _: 3
220
- })) : e.fallback ? (m(), v(o(N), {
239
+ })) : e.fallback ? (m(), g(a(j), {
221
240
  key: 1,
222
241
  class: "dark-mode"
223
242
  }, {
224
- default: l(() => [
225
- r(o(O), { class: "request-card-simple" }, {
226
- default: l(() => [
227
- K("div", ie, [
228
- r(o(B), {
243
+ default: r(() => [
244
+ l(a(T), { class: "request-card-simple" }, {
245
+ default: r(() => [
246
+ k("div", pe, [
247
+ l(a(B), {
229
248
  as: "span",
230
249
  class: "request-method",
231
- method: e.operation.httpVerb
250
+ method: e.operation.method
232
251
  }, null, 8, ["method"]),
233
- f(e.$slots, "header", {}, void 0, !0)
252
+ y(e.$slots, "header", {}, void 0, !0)
234
253
  ]),
235
- f(e.$slots, "footer", {}, void 0, !0)
254
+ y(e.$slots, "footer", {}, void 0, !0)
236
255
  ]),
237
256
  _: 3
238
257
  })
239
258
  ]),
240
259
  _: 3
241
- })) : x("", !0);
260
+ })) : C("", !0);
242
261
  }
243
262
  });
244
263
  export {
245
- qe as default
264
+ je as default
246
265
  };
@@ -0,0 +1,6 @@
1
+ import type { Collection, SecurityScheme } from '@scalar/oas-utils/entities/spec';
2
+ /**
3
+ * Takes in selected security and filters it with the requirements
4
+ */
5
+ export declare const filterSecurityRequirements: (securityRequirements: Collection["security"], selectedSecuritySchemeUids?: Collection["selectedSecuritySchemeUids"], securitySchemes?: Record<string, SecurityScheme>) => SecurityScheme[];
6
+ //# sourceMappingURL=filter-security-requirements.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filter-security-requirements.d.ts","sourceRoot":"","sources":["../../../../src/features/ExampleRequest/helpers/filter-security-requirements.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,cAAc,EACf,MAAM,iCAAiC,CAAA;AAExC;;GAEG;AACH,eAAO,MAAM,0BAA0B,yBACf,UAAU,CAAC,UAAU,CAAC,+BAChB,UAAU,CAAC,4BAA4B,CAAC,oBACnD,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,KAC9C,cAAc,EAwBhB,CAAA"}
@@ -0,0 +1,17 @@
1
+ const y = (i, a = [], n = {}) => {
2
+ const m = new Set(
3
+ i.map(
4
+ (e) => Object.keys(e).sort().join(",")
5
+ )
6
+ );
7
+ return a.reduce((e, r) => {
8
+ const o = Array.isArray(r) ? r : [r], p = o.map((t) => {
9
+ var s;
10
+ return (s = n[t]) == null ? void 0 : s.nameKey;
11
+ }).sort().join(",");
12
+ return m.has(p) && e.push(...o.map((t) => n[t])), e;
13
+ }, []);
14
+ };
15
+ export {
16
+ y as filterSecurityRequirements
17
+ };
@@ -1,12 +1,11 @@
1
- import { type WorkspaceStore } from '@scalar/api-client/store';
1
+ import type { Collection, Server } from '@scalar/oas-utils/entities/spec';
2
2
  import type { TransformedOperation } from '@scalar/types/legacy';
3
3
  type __VLS_Props = {
4
4
  id?: string;
5
5
  layout?: 'modern' | 'classic';
6
- operation: TransformedOperation;
7
- requests: WorkspaceStore['requests'];
8
- requestExamples: WorkspaceStore['requestExamples'];
9
- securitySchemes: WorkspaceStore['securitySchemes'];
6
+ transformedOperation: TransformedOperation;
7
+ collection: Collection | undefined;
8
+ server: Server | undefined;
10
9
  };
11
10
  declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
12
11
  export default _default;
@@ -1 +1 @@
1
- {"version":3,"file":"Operation.vue.d.ts","sourceRoot":"","sources":["../../../src/features/Operation/Operation.vue"],"names":[],"mappings":"AAmFA,OAAO,EAEL,KAAK,cAAc,EAEpB,MAAM,0BAA0B,CAAA;AACjC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAShE,KAAK,WAAW,GAAG;IACjB,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,MAAM,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAA;IAC7B,SAAS,EAAE,oBAAoB,CAAA;IAC/B,QAAQ,EAAE,cAAc,CAAC,UAAU,CAAC,CAAA;IACpC,eAAe,EAAE,cAAc,CAAC,iBAAiB,CAAC,CAAA;IAClD,eAAe,EAAE,cAAc,CAAC,iBAAiB,CAAC,CAAA;CACnD,CAAC;;AA8GF,wBAMG"}
1
+ {"version":3,"file":"Operation.vue.d.ts","sourceRoot":"","sources":["../../../src/features/Operation/Operation.vue"],"names":[],"mappings":"AAqEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAA;AACzE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAOhE,KAAK,WAAW,GAAG;IACjB,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,MAAM,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAA;IAC7B,oBAAoB,EAAE,oBAAoB,CAAA;IAC1C,UAAU,EAAE,UAAU,GAAG,SAAS,CAAA;IAClC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;CAC3B,CAAC;;AAmGF,wBAMG"}
@@ -1,53 +1,46 @@
1
- import { defineComponent as m, inject as p, openBlock as n, createBlock as a, unref as t } from "vue";
2
- import { getPointer as d } from "../../blocks/helpers/getPointer.js";
3
- import { useBlockProps as q } from "../../blocks/hooks/useBlockProps.js";
4
- import { useActiveEntities as y, WORKSPACE_SYMBOL as f } from "@scalar/api-client/store";
5
- import { useRequestExample as E } from "./hooks/useRequestExample.js";
6
- import C from "./layouts/ClassicLayout.vue.js";
7
- import h from "./layouts/ModernLayout.vue.js";
8
- const M = /* @__PURE__ */ m({
1
+ import { defineComponent as s, unref as r, openBlock as t, createElementBlock as l, Fragment as p, createBlock as a, createCommentVNode as m } from "vue";
2
+ import { getPointer as c } from "../../blocks/helpers/getPointer.js";
3
+ import { useBlockProps as d } from "../../blocks/hooks/useBlockProps.js";
4
+ import { useWorkspace as f } from "@scalar/api-client/store";
5
+ import u from "./layouts/ClassicLayout.vue.js";
6
+ import O from "./layouts/ModernLayout.vue.js";
7
+ const g = /* @__PURE__ */ s({
9
8
  __name: "Operation",
10
9
  props: {
11
10
  id: {},
12
11
  layout: { default: "modern" },
13
- operation: {},
14
- requests: {},
15
- requestExamples: {},
16
- securitySchemes: {}
12
+ transformedOperation: {},
13
+ collection: {},
14
+ server: {}
17
15
  },
18
- setup(e) {
19
- const { activeCollection: u, activeServer: c } = y(), { request: o, secretCredentials: s } = E({
20
- operation: e.operation,
21
- collection: u,
22
- requests: e.requests,
23
- requestExamples: e.requestExamples,
24
- securitySchemes: e.securitySchemes,
25
- server: c
26
- }), l = p(f), { operation: i } = q({
27
- store: l,
28
- location: d([
16
+ setup(n) {
17
+ const i = f(), { operation: o } = d({
18
+ store: i,
19
+ location: c([
29
20
  "paths",
30
- e.operation.path,
31
- e.operation.httpVerb.toLowerCase()
21
+ n.transformedOperation.path,
22
+ n.transformedOperation.httpVerb.toLowerCase()
32
23
  ])
33
24
  });
34
- return (r, S) => r.layout === "classic" ? (n(), a(C, {
35
- key: 0,
36
- id: r.id,
37
- operation: r.operation,
38
- request: t(o),
39
- requestEntity: t(i),
40
- secretCredentials: t(s)
41
- }, null, 8, ["id", "operation", "request", "requestEntity", "secretCredentials"])) : (n(), a(h, {
42
- key: 1,
43
- id: r.id,
44
- operation: r.operation,
45
- request: t(o),
46
- requestEntity: t(i),
47
- secretCredentials: t(s)
48
- }, null, 8, ["id", "operation", "request", "requestEntity", "secretCredentials"]));
25
+ return (e, k) => e.collection && r(o) ? (t(), l(p, { key: 0 }, [
26
+ e.layout === "classic" ? (t(), a(u, {
27
+ key: 0,
28
+ id: e.id,
29
+ collection: e.collection,
30
+ operation: r(o),
31
+ server: e.server,
32
+ transformedOperation: e.transformedOperation
33
+ }, null, 8, ["id", "collection", "operation", "server", "transformedOperation"])) : (t(), a(O, {
34
+ key: 1,
35
+ id: e.id,
36
+ collection: e.collection,
37
+ operation: r(o),
38
+ server: e.server,
39
+ transformedOperation: e.transformedOperation
40
+ }, null, 8, ["id", "collection", "operation", "server", "transformedOperation"]))
41
+ ], 64)) : m("", !0);
49
42
  }
50
43
  });
51
44
  export {
52
- M as default
45
+ g as default
53
46
  };
@@ -1,12 +1,12 @@
1
- import type { Request as RequestEntity } from '@scalar/oas-utils/entities/spec';
1
+ import type { Collection, Operation, Server } from '@scalar/oas-utils/entities/spec';
2
2
  import type { TransformedOperation } from '@scalar/types/legacy';
3
3
  type __VLS_Props = {
4
4
  id?: string;
5
- requestEntity?: RequestEntity;
6
- /** @deprecated Use `requestEntity` instead */
7
- operation: TransformedOperation;
8
- request: Request | null;
9
- secretCredentials: string[];
5
+ collection: Collection;
6
+ server: Server | undefined;
7
+ operation: Operation;
8
+ /** @deprecated Use `operation` instead */
9
+ transformedOperation: TransformedOperation;
10
10
  };
11
11
  declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
12
12
  export default _default;
@@ -1 +1 @@
1
- {"version":3,"file":"ClassicLayout.vue.d.ts","sourceRoot":"","sources":["../../../../src/features/Operation/layouts/ClassicLayout.vue"],"names":[],"mappings":"AA0TA,OAAO,KAAK,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iCAAiC,CAAA;AAC/E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAQhE,KAAK,WAAW,GAAG;IACjB,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,aAAa,CAAC,EAAE,aAAa,CAAA;IAC7B,8CAA8C;IAC9C,SAAS,EAAE,oBAAoB,CAAA;IAC/B,OAAO,EAAE,OAAO,GAAG,IAAI,CAAA;IACvB,iBAAiB,EAAE,MAAM,EAAE,CAAA;CAC5B,CAAC;;AAsQF,wBAOG"}
1
+ {"version":3,"file":"ClassicLayout.vue.d.ts","sourceRoot":"","sources":["../../../../src/features/Operation/layouts/ClassicLayout.vue"],"names":[],"mappings":"AAiUA,OAAO,KAAK,EACV,UAAU,EACV,SAAS,EACT,MAAM,EACP,MAAM,iCAAiC,CAAA;AACxC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAQhE,KAAK,WAAW,GAAG;IACjB,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,UAAU,EAAE,UAAU,CAAA;IACtB,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,SAAS,EAAE,SAAS,CAAA;IACpB,0CAA0C;IAC1C,oBAAoB,EAAE,oBAAoB,CAAA;CAC3C,CAAC;;AAsQF,wBAOG"}
@@ -1,7 +1,7 @@
1
- import o from "./ClassicLayout.vue2.js";
1
+ import a from "./ClassicLayout.vue2.js";
2
2
  /* empty css */
3
- import t from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-d26002b4"]]);
3
+ import o from "../../../_virtual/_plugin-vue_export-helper.js";
4
+ const c = /* @__PURE__ */ o(a, [["__scopeId", "data-v-ac9aa830"]]);
5
5
  export {
6
- m as default
6
+ c as default
7
7
  };