@scalar/api-client 2.0.33 → 2.0.35

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 (89) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/dist/components/CodeInput/CodeInput.vue.js +2 -2
  3. package/dist/components/CommandPalette/CommandPaletteCollection.vue.d.ts.map +1 -1
  4. package/dist/components/CommandPalette/CommandPaletteCollection.vue.js +39 -31
  5. package/dist/components/CommandPalette/CommandPaletteExample.vue.d.ts.map +1 -1
  6. package/dist/components/CommandPalette/CommandPaletteExample.vue.js +65 -55
  7. package/dist/components/CommandPalette/CommandPaletteFolder.vue.d.ts.map +1 -1
  8. package/dist/components/CommandPalette/CommandPaletteFolder.vue.js +53 -44
  9. package/dist/components/CommandPalette/CommandPaletteImport.vue.d.ts.map +1 -1
  10. package/dist/components/CommandPalette/CommandPaletteImport.vue.js +42 -34
  11. package/dist/components/CommandPalette/CommandPaletteRequest.vue.d.ts.map +1 -1
  12. package/dist/components/CommandPalette/CommandPaletteRequest.vue.js +126 -70
  13. package/dist/components/CommandPalette/CommandPaletteWorkspace.vue.d.ts.map +1 -1
  14. package/dist/components/CommandPalette/CommandPaletteWorkspace.vue.js +37 -29
  15. package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts.map +1 -1
  16. package/dist/components/CommandPalette/TheCommandPalette.vue.js +4 -4
  17. package/dist/components/CommandPalette/TheCommandPalette.vue2.js +97 -85
  18. package/dist/components/CommandPalette/handleKeyDown.d.ts +2 -0
  19. package/dist/components/CommandPalette/handleKeyDown.d.ts.map +1 -0
  20. package/dist/components/CommandPalette/handleKeyDown.js +7 -0
  21. package/dist/components/DataTable/DataTableInput.vue.d.ts +7 -0
  22. package/dist/components/DataTable/DataTableInput.vue.d.ts.map +1 -1
  23. package/dist/components/DataTable/DataTableInput.vue.js +3 -3
  24. package/dist/components/DataTable/DataTableInput.vue2.js +33 -31
  25. package/dist/components/DataTable/DataTableInputSelect.vue.d.ts +19 -3
  26. package/dist/components/DataTable/DataTableInputSelect.vue.d.ts.map +1 -1
  27. package/dist/components/DataTable/DataTableInputSelect.vue.js +37 -35
  28. package/dist/components/DataTable/index.d.ts +1 -0
  29. package/dist/components/DataTable/index.d.ts.map +1 -1
  30. package/dist/components/DataTable/index.js +6 -4
  31. package/dist/components/Form/Form.vue.js +1 -1
  32. package/dist/components/Search/SearchButton.vue.d.ts.map +1 -1
  33. package/dist/components/Search/SearchButton.vue.js +14 -16
  34. package/dist/components/SideNav/SideHelp.vue.d.ts +3 -0
  35. package/dist/components/SideNav/SideHelp.vue.d.ts.map +1 -0
  36. package/dist/components/SideNav/SideHelp.vue.js +125 -0
  37. package/dist/components/SideNav/SideHelp.vue2.js +4 -0
  38. package/dist/components/SideNav/SideNav.vue.d.ts.map +1 -1
  39. package/dist/components/SideNav/SideNav.vue.js +3 -3
  40. package/dist/components/SideNav/SideNav.vue2.js +28 -24
  41. package/dist/components/Sidebar/SidebarButton.vue.js +1 -1
  42. package/dist/components/Sidebar/SidebarList.vue.d.ts.map +1 -1
  43. package/dist/components/Sidebar/SidebarList.vue.js +1 -1
  44. package/dist/components/Sidebar/SidebarListElement.vue.d.ts.map +1 -1
  45. package/dist/components/Sidebar/SidebarListElement.vue.js +1 -1
  46. package/dist/components/Sidebar/SidebarListElement.vue2.js +9 -9
  47. package/dist/constants.d.ts +0 -4
  48. package/dist/constants.d.ts.map +1 -1
  49. package/dist/constants.js +2 -2
  50. package/dist/layouts/App/create-api-client-app.d.ts +512 -603
  51. package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
  52. package/dist/layouts/Modal/api-client-modal.d.ts +1036 -1218
  53. package/dist/layouts/Modal/api-client-modal.d.ts.map +1 -1
  54. package/dist/libs/create-client.d.ts +513 -603
  55. package/dist/libs/create-client.d.ts.map +1 -1
  56. package/dist/libs/create-client.js +58 -68
  57. package/dist/libs/local-storage.js +5 -5
  58. package/dist/libs/sendRequest.d.ts +3 -5
  59. package/dist/libs/sendRequest.d.ts.map +1 -1
  60. package/dist/libs/sendRequest.js +73 -67
  61. package/dist/store/workspace.d.ts +1037 -1219
  62. package/dist/store/workspace.d.ts.map +1 -1
  63. package/dist/store/workspace.js +350 -277
  64. package/dist/style.css +1 -1
  65. package/dist/views/Request/Request.vue.d.ts.map +1 -1
  66. package/dist/views/Request/Request.vue.js +1 -1
  67. package/dist/views/Request/Request.vue2.js +101 -102
  68. package/dist/views/Request/RequestSection/RequestAuth.vue.d.ts.map +1 -1
  69. package/dist/views/Request/RequestSection/RequestAuth.vue.js +270 -177
  70. package/dist/views/Request/RequestSection/RequestSection.vue.d.ts.map +1 -1
  71. package/dist/views/Request/RequestSection/RequestSection.vue.js +52 -42
  72. package/dist/views/Request/RequestSidebarItemMenu.vue.d.ts.map +1 -1
  73. package/dist/views/Request/RequestSidebarItemMenu.vue.js +141 -104
  74. package/dist/views/Request/components/OAuth2.vue.d.ts +3 -9
  75. package/dist/views/Request/components/OAuth2.vue.d.ts.map +1 -1
  76. package/dist/views/Request/components/OAuth2.vue.js +141 -112
  77. package/dist/views/Request/components/OAuthScopesInput.vue.d.ts +2 -6
  78. package/dist/views/Request/components/OAuthScopesInput.vue.d.ts.map +1 -1
  79. package/dist/views/Request/components/OAuthScopesInput.vue.js +35 -39
  80. package/dist/views/Request/consts/index.d.ts +2 -0
  81. package/dist/views/Request/consts/index.d.ts.map +1 -0
  82. package/dist/views/Request/consts/index.js +5 -0
  83. package/dist/views/Request/consts/new-auth-options.d.ts +92 -0
  84. package/dist/views/Request/consts/new-auth-options.d.ts.map +1 -0
  85. package/dist/views/Request/consts/new-auth-options.js +83 -0
  86. package/dist/views/Request/libs/oauth2.d.ts +3 -16
  87. package/dist/views/Request/libs/oauth2.d.ts.map +1 -1
  88. package/dist/views/Request/libs/oauth2.js +28 -31
  89. package/package.json +9 -5
@@ -1,212 +1,305 @@
1
- import { defineComponent as T, computed as k, openBlock as d, createBlock as v, withCtx as s, createElementVNode as f, toDisplayString as x, createVNode as r, unref as l, createTextVNode as y, createElementBlock as N, Fragment as U, createCommentVNode as B, capitalize as w } from "vue";
2
- import D from "../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
3
- import { useWorkspace as O } from "../../../store/workspace.js";
4
- import _ from "./RequestAuthDataTableInput.vue.js";
5
- import { ScalarListbox as W, ScalarButton as j, ScalarIcon as A } from "@scalar/components";
6
- import { camelToTitleWords as E } from "@scalar/oas-utils/helpers";
7
- import I from "../../../components/DataTable/DataTable.vue.js";
8
- import p from "../../../components/DataTable/DataTableRow.vue.js";
9
- import K from "../../../components/DataTable/DataTableHeader.vue.js";
10
- import R from "../components/OAuth2.vue.js";
11
- const q = { class: "flex gap-1" }, z = { class: "flex h-8 items-center" }, L = /* @__PURE__ */ f("div", { class: "text-c-2 flex min-w-[100px] items-center border-r-1/2 pr-0 pl-2 h-full" }, " Auth Type ", -1), F = { class: "pl-2" }, ae = /* @__PURE__ */ T({
1
+ import { defineComponent as q, ref as O, computed as $, openBlock as i, createBlock as x, withCtx as l, createElementVNode as b, toDisplayString as k, createVNode as u, unref as n, createElementBlock as _, Fragment as v, renderList as Q, createTextVNode as p, withModifiers as j, createCommentVNode as I, capitalize as M } from "vue";
2
+ import H from "../../../components/DataTable/DataTableCell.vue.js";
3
+ import z from "../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
4
+ import { useWorkspace as E } from "../../../store/workspace.js";
5
+ import y from "./RequestAuthDataTableInput.vue.js";
6
+ import { ScalarComboboxMultiselect as L, ScalarButton as B, ScalarIcon as K } from "@scalar/components";
7
+ import { camelToTitleWords as G } from "@scalar/oas-utils/helpers";
8
+ import { ADD_AUTH_OPTIONS as J, ADD_AUTH_DICT as X } from "../consts/new-auth-options.js";
9
+ import Y from "../../../components/DataTable/DataTable.vue.js";
10
+ import c from "../../../components/DataTable/DataTableRow.vue.js";
11
+ import Z from "../../../components/DataTable/DataTableHeader.vue.js";
12
+ import ee from "../components/OAuth2.vue.js";
13
+ const te = { class: "flex gap-1" }, le = /* @__PURE__ */ b("div", { class: "text-c-2 h-8 flex min-w-[120px] items-center border-r-1/2 pr-0 pl-2" }, " Auth Type ", -1), ae = { class: "pl-2" }, oe = { class: "text-c-2 flex whitespace-nowrap opacity-0 group-hover/delete:opacity-100 request-meta-buttons" }, Ve = /* @__PURE__ */ q({
12
14
  __name: "RequestAuth",
13
15
  props: {
14
16
  title: {}
15
17
  },
16
- setup(P) {
18
+ setup(ue) {
17
19
  const {
18
- activeCollection: V,
19
- collectionMutators: S,
20
- activeSecurityRequirements: g,
21
- activeSecurityScheme: a,
22
- securitySchemes: $,
23
- securitySchemeMutators: C
24
- } = O(), M = (t) => {
25
- const e = $[t];
26
- switch (e == null ? void 0 : e.type) {
20
+ activeCollection: h,
21
+ activeRequest: V,
22
+ activeSecurityRequirements: N,
23
+ activeSecuritySchemes: T,
24
+ isReadOnly: U,
25
+ requestMutators: F,
26
+ securitySchemeMutators: S,
27
+ securitySchemes: w
28
+ } = E(), C = O(null), D = (a) => {
29
+ switch (a == null ? void 0 : a.type) {
27
30
  case "apiKey":
28
- return `${w(e.in)} (${t})`;
31
+ return `${M(a.in)}`;
29
32
  case "http":
30
- return `${w(e.scheme)} Authentication (${t})`;
33
+ return `${M(a.scheme)} Authentication`;
34
+ case "oauth2":
35
+ return G(a.flow.type);
31
36
  case "openIdConnect":
32
- return `Open ID Connect (${t})`;
37
+ return "Open ID Connect";
33
38
  default:
34
39
  return "None";
35
40
  }
36
- }, h = k(
37
- () => g.value.flatMap((t) => {
38
- const e = Object.keys(t);
39
- return e.length === 0 ? { id: "none", label: "None" } : e.flatMap((o) => {
40
- const n = $[o];
41
- return (n == null ? void 0 : n.type) === "oauth2" ? Object.keys(n.flows).map((i) => ({
42
- // Since ID's must be unique, we also store the uid and flowKey separately
43
- id: `${o}${i}`,
44
- label: `${E(i)} (${o})`,
45
- flowKey: i,
46
- uid: o
47
- })) : { id: o, label: M(o) };
41
+ }, g = $(
42
+ () => {
43
+ var e;
44
+ const a = (e = h.value) == null ? void 0 : e.securitySchemeDict, o = N.value.flatMap((r) => {
45
+ const t = Object.keys(r);
46
+ return t.length === 0 && U.value ? { id: "none", label: "None", labelWithoutId: "None" } : t.flatMap((d) => {
47
+ if (!a) return [];
48
+ const s = a[d], W = w[s], R = D(W);
49
+ return {
50
+ id: s,
51
+ label: `${R} (${d})`,
52
+ labelWithoutId: R
53
+ };
54
+ });
48
55
  });
49
- })
50
- ), c = k({
56
+ if (U.value)
57
+ return o;
58
+ {
59
+ const r = V.value.securitySchemeUids.map((t) => {
60
+ const d = w[t], s = D(d);
61
+ return {
62
+ id: t,
63
+ label: "name" in d && d.name.length ? `${s} (${d.name})` : s,
64
+ labelWithoutId: s
65
+ };
66
+ });
67
+ return [
68
+ { label: "Select auth", options: [...o, ...r] },
69
+ {
70
+ label: "Add new auth",
71
+ options: J
72
+ }
73
+ ];
74
+ }
75
+ }
76
+ ), f = $({
51
77
  // Grab the selected OR first security scheme
52
- get: () => {
53
- var e, o;
54
- const t = (o = (e = V.value) == null ? void 0 : e.selectedSecuritySchemes) == null ? void 0 : o[0];
55
- return h.value.find(
56
- ({ id: n }) => n === `${t == null ? void 0 : t.uid}${(t == null ? void 0 : t.flowKey) ?? ""}`
57
- ) || h.value[0];
58
- },
59
- // Update the mutator on set
60
- set: (t) => {
61
- if (!(t != null && t.id)) return;
62
- const e = "uid" in t ? { flowKey: t.flowKey, uid: t.uid } : { uid: t.id };
63
- S.edit(
78
+ get: () => g.value.flatMap(
79
+ (o) => "options" in o ? o.options : o
80
+ ).filter(
81
+ ({ id: o }) => {
82
+ var e, r;
83
+ return (r = (e = V.value) == null ? void 0 : e.selectedSecuritySchemeUids) == null ? void 0 : r.find(
84
+ (t) => t === o
85
+ );
86
+ }
87
+ ),
88
+ // Update the selected auth per this request
89
+ set: (a) => {
90
+ var e, r, t, d;
91
+ const o = a.find(
92
+ (s) => X[s.id]
93
+ );
94
+ o != null && o.payload && h.value ? ((d = (t = (r = (e = C.value) == null ? void 0 : e.comboboxPopoverRef) == null ? void 0 : r.popoverButtonRef) == null ? void 0 : t.el) == null || d.click(), S.add(
95
+ o.payload,
96
+ h.value.uid,
97
+ V.value,
98
+ !0
99
+ )) : F.edit(
64
100
  V.value.uid,
65
- "selectedSecuritySchemes",
66
- [e]
101
+ "selectedSecuritySchemeUids",
102
+ a.map((s) => s.id)
67
103
  );
68
104
  }
69
- }), m = (t, e) => {
70
- var o;
71
- return C.edit(
72
- ((o = a.value) == null ? void 0 : o.scheme.uid) ?? "",
73
- t,
74
- e
75
- );
76
- };
77
- return (t, e) => (d(), v(D, {
105
+ }), m = (a, o, e) => S.edit(a.uid ?? "", o, e), A = $(() => f.value.length > 1 ? f.value.map(({ labelWithoutId: a }) => a).join(", ") : f.value.length ? f.value[0].label : "None"), P = (a) => S.delete(a, V.value);
106
+ return (a, o) => (i(), x(z, {
78
107
  class: "group/params",
79
- itemCount: h.value.length
108
+ itemCount: g.value.length
80
109
  }, {
81
- title: s(() => [
82
- f("div", q, x(t.title), 1)
110
+ title: l(() => [
111
+ b("div", te, k(a.title), 1)
83
112
  ]),
84
- default: s(() => [
85
- f("form", null, [
86
- r(l(I), {
113
+ default: l(() => [
114
+ b("form", null, [
115
+ u(n(Y), {
87
116
  class: "flex-1",
88
117
  columns: [""]
89
118
  }, {
90
- default: s(() => {
91
- var o, n, i, b;
92
- return [
93
- r(l(p), null, {
94
- default: s(() => [
95
- r(l(K), { class: "relative col-span-full cursor-pointer py-[0px] px-[0px] flex items-center" }, {
96
- default: s(() => [
97
- r(l(W), {
98
- modelValue: c.value,
99
- "onUpdate:modelValue": e[0] || (e[0] = (u) => c.value = u),
100
- class: "text-xs w-full left-2",
101
- fullWidth: "",
102
- options: h.value,
103
- teleport: ""
104
- }, {
105
- default: s(() => [
106
- r(l(j), {
107
- class: "flex gap-1.5 h-auto py-0 px-0 text-c-2 hover:text-c-1 font-normal",
108
- fullWidth: "",
109
- variant: "ghost"
110
- }, {
111
- default: s(() => {
112
- var u;
113
- return [
114
- f("div", z, [
115
- L,
116
- f("span", F, x((u = c.value) == null ? void 0 : u.label), 1),
117
- r(l(A), {
118
- icon: "ChevronDown",
119
- size: "xs"
120
- })
121
- ])
122
- ];
123
- }),
124
- _: 1
125
- })
126
- ]),
127
- _: 1
128
- }, 8, ["modelValue", "options"])
129
- ]),
130
- _: 1
131
- })
132
- ]),
133
- _: 1
134
- }),
135
- ((o = l(a)) == null ? void 0 : o.scheme.type) === "http" && l(a).scheme.scheme === "bearer" ? (d(), v(l(p), { key: 0 }, {
136
- default: s(() => [
137
- r(_, {
138
- id: "http-bearer-token",
139
- modelValue: l(a).scheme.value,
140
- placeholder: "Token",
141
- type: "password",
142
- "onUpdate:modelValue": e[1] || (e[1] = (u) => m("value", u))
143
- }, {
144
- default: s(() => [
145
- y(" Bearer Token ")
146
- ]),
147
- _: 1
148
- }, 8, ["modelValue"])
149
- ]),
150
- _: 1
151
- })) : ((n = l(a)) == null ? void 0 : n.scheme.type) === "http" && l(a).scheme.scheme === "basic" ? (d(), N(U, { key: 1 }, [
152
- r(l(p), null, {
153
- default: s(() => [
154
- r(_, {
155
- id: "http-basic-username",
156
- class: "text-c-2",
157
- modelValue: l(a).scheme.value,
158
- placeholder: "ScalarEnjoyer01",
159
- "onUpdate:modelValue": e[2] || (e[2] = (u) => m("value", u))
119
+ default: l(() => [
120
+ u(n(c), null, {
121
+ default: l(() => [
122
+ u(n(Z), { class: "relative col-span-full cursor-pointer py-[0px] px-[0px] flex items-center" }, {
123
+ default: l(() => [
124
+ u(n(L), {
125
+ ref_key: "comboboxRef",
126
+ ref: C,
127
+ modelValue: f.value,
128
+ "onUpdate:modelValue": o[0] || (o[0] = (e) => f.value = e),
129
+ class: "text-xs w-full left-2",
130
+ fullWidth: "",
131
+ multiple: "",
132
+ options: g.value,
133
+ teleport: ""
160
134
  }, {
161
- default: s(() => [
162
- y(" Username ")
135
+ default: l(() => [
136
+ u(n(B), {
137
+ class: "h-auto py-0 px-0 text-c-2 hover:text-c-1 font-normal justify-start",
138
+ fullWidth: "",
139
+ variant: "ghost"
140
+ }, {
141
+ default: l(() => [
142
+ le,
143
+ b("span", ae, k(A.value), 1),
144
+ u(n(K), {
145
+ icon: "ChevronDown",
146
+ size: "xs"
147
+ })
148
+ ]),
149
+ _: 1
150
+ })
163
151
  ]),
164
152
  _: 1
165
- }, 8, ["modelValue"])
153
+ }, 8, ["modelValue", "options"])
166
154
  ]),
167
155
  _: 1
168
- }),
169
- r(l(p), null, {
170
- default: s(() => [
171
- r(_, {
172
- id: "http-basic-password",
173
- modelValue: l(a).scheme.secondValue,
174
- placeholder: "xxxxxx",
156
+ })
157
+ ]),
158
+ _: 1
159
+ }),
160
+ (i(!0), _(v, null, Q(n(T), (e, r) => (i(), _(v, {
161
+ key: e.uid
162
+ }, [
163
+ n(T).length > 1 ? (i(), x(n(c), {
164
+ key: 0,
165
+ class: "group/delete"
166
+ }, {
167
+ default: l(() => [
168
+ u(H, { class: "text-c-1 pl-2 text-sm flex items-center justify-between" }, {
169
+ default: l(() => {
170
+ var t;
171
+ return [
172
+ p(k((t = f.value[r]) == null ? void 0 : t.label) + " ", 1),
173
+ b("div", oe, [
174
+ u(n(B), {
175
+ class: "px-1 transition-none",
176
+ size: "sm",
177
+ variant: "ghost",
178
+ onClick: j((d) => P(e), ["stop"])
179
+ }, {
180
+ default: l(() => [
181
+ p(" Delete ")
182
+ ]),
183
+ _: 2
184
+ }, 1032, ["onClick"])
185
+ ])
186
+ ];
187
+ }),
188
+ _: 2
189
+ }, 1024)
190
+ ]),
191
+ _: 2
192
+ }, 1024)) : I("", !0),
193
+ e.type === "http" ? (i(), _(v, { key: 1 }, [
194
+ e.scheme === "bearer" ? (i(), x(n(c), { key: 0 }, {
195
+ default: l(() => [
196
+ u(y, {
197
+ id: `http-bearer-token-${e.uid}`,
198
+ modelValue: e.value,
199
+ placeholder: "QUxMIFlPVVIgQkFTRSBBUkUgQkVMT05HIFRPIFVT",
175
200
  type: "password",
176
- "onUpdate:modelValue": e[3] || (e[3] = (u) => m("secondValue", u))
201
+ "onUpdate:modelValue": (t) => m(e, "value", t)
177
202
  }, {
178
- default: s(() => [
179
- y(" Password ")
203
+ default: l(() => [
204
+ p(" Bearer Token ")
180
205
  ]),
181
- _: 1
182
- }, 8, ["modelValue"])
206
+ _: 2
207
+ }, 1032, ["id", "modelValue", "onUpdate:modelValue"])
183
208
  ]),
184
- _: 1
185
- })
186
- ], 64)) : ((i = l(a)) == null ? void 0 : i.scheme.type) === "apiKey" ? (d(), v(l(p), { key: 2 }, {
187
- default: s(() => [
188
- r(_, {
189
- id: `api-key-${l(a).scheme.name}`,
190
- modelValue: l(a).scheme.value,
191
- placeholder: "Value",
192
- type: "password",
193
- "onUpdate:modelValue": e[4] || (e[4] = (u) => m("value", u))
194
- }, {
195
- default: s(() => [
196
- y(x(l(a).scheme.name), 1)
209
+ _: 2
210
+ }, 1024)) : e.scheme === "basic" ? (i(), _(v, { key: 1 }, [
211
+ u(n(c), null, {
212
+ default: l(() => [
213
+ u(y, {
214
+ id: `http-basic-username-${e.uid}`,
215
+ class: "text-c-2",
216
+ modelValue: e.value,
217
+ placeholder: "ScalarEnjoyer01",
218
+ required: "",
219
+ "onUpdate:modelValue": (t) => m(e, "value", t)
220
+ }, {
221
+ default: l(() => [
222
+ p(" Username ")
223
+ ]),
224
+ _: 2
225
+ }, 1032, ["id", "modelValue", "onUpdate:modelValue"])
197
226
  ]),
198
- _: 1
199
- }, 8, ["id", "modelValue"])
200
- ]),
201
- _: 1
202
- })) : ((b = l(a)) == null ? void 0 : b.scheme.type) === "oauth2" && c.value && "uid" in c.value && l(a).flow ? (d(), v(l(R), {
227
+ _: 2
228
+ }, 1024),
229
+ u(n(c), null, {
230
+ default: l(() => [
231
+ u(y, {
232
+ id: `http-basic-password-${e.uid}`,
233
+ modelValue: e.secondValue,
234
+ placeholder: "xxxxxx",
235
+ type: "password",
236
+ "onUpdate:modelValue": (t) => m(e, "secondValue", t)
237
+ }, {
238
+ default: l(() => [
239
+ p(" Password ")
240
+ ]),
241
+ _: 2
242
+ }, 1032, ["id", "modelValue", "onUpdate:modelValue"])
243
+ ]),
244
+ _: 2
245
+ }, 1024)
246
+ ], 64)) : I("", !0)
247
+ ], 64)) : e.type === "apiKey" ? (i(), _(v, { key: 2 }, [
248
+ n(U) ? (i(), x(n(c), { key: 1 }, {
249
+ default: l(() => [
250
+ u(y, {
251
+ id: `api-key-value-${e.uid}`,
252
+ modelValue: e.value,
253
+ placeholder: "Value",
254
+ "onUpdate:modelValue": (t) => m(e, "value", t)
255
+ }, {
256
+ default: l(() => [
257
+ p(k(e.name), 1)
258
+ ]),
259
+ _: 2
260
+ }, 1032, ["id", "modelValue", "onUpdate:modelValue"])
261
+ ]),
262
+ _: 2
263
+ }, 1024)) : (i(), _(v, { key: 0 }, [
264
+ u(n(c), null, {
265
+ default: l(() => [
266
+ u(y, {
267
+ id: `api-key-name-${e.uid}`,
268
+ modelValue: e.name,
269
+ placeholder: "api-key",
270
+ "onUpdate:modelValue": (t) => m(e, "name", t)
271
+ }, {
272
+ default: l(() => [
273
+ p(" Name ")
274
+ ]),
275
+ _: 2
276
+ }, 1032, ["id", "modelValue", "onUpdate:modelValue"])
277
+ ]),
278
+ _: 2
279
+ }, 1024),
280
+ u(n(c), null, {
281
+ default: l(() => [
282
+ u(y, {
283
+ id: `api-key-value-add-${e.uid}`,
284
+ modelValue: e.value,
285
+ placeholder: "QUxMIFlPVVIgQkFTRSBBUkUgQkVMT05HIFRPIFVT",
286
+ "onUpdate:modelValue": (t) => m(e, "value", t)
287
+ }, {
288
+ default: l(() => [
289
+ p(" Value ")
290
+ ]),
291
+ _: 2
292
+ }, 1032, ["id", "modelValue", "onUpdate:modelValue"])
293
+ ]),
294
+ _: 2
295
+ }, 1024)
296
+ ], 64))
297
+ ], 64)) : e.type === "oauth2" ? (i(), x(n(ee), {
203
298
  key: 3,
204
- activeScheme: l(a),
205
- schemeModel: c.value,
206
- updateScheme: m
207
- }, null, 8, ["activeScheme", "schemeModel"])) : B("", !0)
208
- ];
209
- }),
299
+ scheme: e
300
+ }, null, 8, ["scheme"])) : I("", !0)
301
+ ], 64))), 128))
302
+ ]),
210
303
  _: 1
211
304
  })
212
305
  ])
@@ -216,5 +309,5 @@ const q = { class: "flex gap-1" }, z = { class: "flex h-8 items-center" }, L = /
216
309
  }
217
310
  });
218
311
  export {
219
- ae as default
312
+ Ve as default
220
313
  };
@@ -1 +1 @@
1
- {"version":3,"file":"RequestSection.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestSection.vue"],"names":[],"mappings":";AAmXA,wBAKG"}
1
+ {"version":3,"file":"RequestSection.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestSection.vue"],"names":[],"mappings":";AAgYA,wBAKG"}
@@ -1,16 +1,22 @@
1
- import { defineComponent as x, computed as f, ref as A, watch as S, openBlock as k, createBlock as q, withCtx as _, createVNode as l, unref as n, createElementVNode as u, createTextVNode as R, toDisplayString as B, withDirectives as a, vShow as o } from "vue";
2
- import C from "../../../components/ContextBar.vue.js";
3
- import E from "../../../components/ViewLayout/ViewLayoutSection.vue.js";
4
- import { useWorkspace as O } from "../../../store/workspace.js";
5
- import $ from "./RequestAuth.vue.js";
6
- import g from "./RequestBody.vue.js";
1
+ import { defineComponent as S, computed as f, ref as A, watch as k, openBlock as q, createBlock as R, withCtx as h, createVNode as l, unref as o, createElementVNode as u, createTextVNode as B, toDisplayString as C, withDirectives as i, vShow as a } from "vue";
2
+ import E from "../../../components/ContextBar.vue.js";
3
+ import O from "../../../components/ViewLayout/ViewLayoutSection.vue.js";
4
+ import { useWorkspace as $ } from "../../../store/workspace.js";
5
+ import g from "./RequestAuth.vue.js";
6
+ import H from "./RequestBody.vue.js";
7
7
  import r from "./RequestParams.vue.js";
8
- import H from "./RequestPathParams.vue.js";
9
- import { ScalarIcon as P } from "@scalar/components";
10
- const T = { class: "flex-1" }, w = { class: "text-c-3 pl-1" }, K = { class: "request-section-content custom-scroll flex flex-1 flex-col px-2 xl:px-5 py-2.5" }, U = /* @__PURE__ */ x({
8
+ import P from "./RequestPathParams.vue.js";
9
+ import { ScalarIcon as T } from "@scalar/components";
10
+ const w = { class: "flex-1" }, K = { class: "text-c-3 pl-1" }, N = { class: "request-section-content custom-scroll flex flex-1 flex-col px-2 xl:px-5 py-2.5" }, W = /* @__PURE__ */ S({
11
11
  __name: "RequestSection",
12
- setup(N) {
13
- const { activeRequest: i, activeExample: m, activeSecurityRequirements: d, isReadOnly: h } = O(), c = ["POST", "PUT", "PATCH", "DELETE"], y = f(() => {
12
+ setup(V) {
13
+ const {
14
+ activeRequest: s,
15
+ activeSecuritySchemes: _,
16
+ activeExample: m,
17
+ activeSecurityRequirements: d,
18
+ isReadOnly: y
19
+ } = $(), n = ["POST", "PUT", "PATCH", "DELETE"], x = f(() => {
14
20
  const t = [
15
21
  "All",
16
22
  "Auth",
@@ -20,75 +26,79 @@ const T = { class: "flex-1" }, w = { class: "text-c-3 pl-1" }, K = { class: "req
20
26
  "Query",
21
27
  "Body"
22
28
  ];
23
- return m.value.parameters.path.length || t.splice(t.indexOf("Request"), 1), c.includes(i.value.method) || t.splice(t.indexOf("Body"), 1), p.value && t.splice(t.indexOf("Auth"), 1), t;
29
+ return m.value.parameters.path.length || t.splice(t.indexOf("Request"), 1), n.includes(s.value.method) || t.splice(t.indexOf("Body"), 1), p.value && t.splice(t.indexOf("Auth"), 1), t;
24
30
  }), p = f(
25
- () => h.value && (d.value.length === 0 || JSON.stringify(d.value) === "[{}]")
31
+ () => y.value && (d.value.length === 0 || JSON.stringify(d.value) === "[{}]")
26
32
  ), e = A("All");
27
- return S(i, (t) => {
28
- e.value === "Body" && !c.includes(t.method) && (e.value = "All");
29
- }), (t, v) => (k(), q(E, null, {
30
- title: _(() => {
31
- var s;
33
+ return k(s, (t) => {
34
+ e.value === "Body" && !n.includes(t.method) && (e.value = "All");
35
+ }), (t, v) => (q(), R(O, null, {
36
+ title: h(() => {
37
+ var c;
32
38
  return [
33
- l(n(P), {
39
+ l(o(T), {
34
40
  class: "text-c-3 mr-2",
35
41
  icon: "ExternalLink",
36
42
  size: "sm",
37
43
  thickness: "2.5"
38
44
  }),
39
- u("div", T, [
40
- R(" Request "),
41
- u("span", w, B((s = n(i)) == null ? void 0 : s.summary), 1)
45
+ u("div", w, [
46
+ B(" Request "),
47
+ u("span", K, C((c = o(s)) == null ? void 0 : c.summary), 1)
42
48
  ])
43
49
  ];
44
50
  }),
45
- default: _(() => [
46
- u("div", K, [
47
- l(C, {
51
+ default: h(() => [
52
+ u("div", N, [
53
+ l(E, {
48
54
  activeSection: e.value,
49
- sections: y.value,
50
- onSetActiveSection: v[0] || (v[0] = (s) => e.value = s)
55
+ sections: x.value,
56
+ onSetActiveSection: v[0] || (v[0] = (c) => e.value = c)
51
57
  }, null, 8, ["activeSection", "sections"]),
52
- a(l($, { title: "Authentication" }, null, 512), [
58
+ i(l(g, {
59
+ index: 0,
60
+ securityScheme: o(_)[0],
61
+ title: "Authentication"
62
+ }, null, 8, ["securityScheme"]), [
53
63
  [
54
- o,
64
+ a,
55
65
  !p.value && (e.value === "All" || e.value === "Auth")
56
66
  ]
57
67
  ]),
58
- a(l(H, {
68
+ i(l(P, {
59
69
  paramKey: "path",
60
70
  title: "Path Variables"
61
71
  }, null, 512), [
62
72
  [
63
- o,
64
- (e.value === "All" || e.value === "Request") && n(m).parameters.path.length > 0
73
+ a,
74
+ (e.value === "All" || e.value === "Request") && o(m).parameters.path.length > 0
65
75
  ]
66
76
  ]),
67
- a(l(r, {
77
+ i(l(r, {
68
78
  paramKey: "cookies",
69
79
  title: "Cookies"
70
80
  }, null, 512), [
71
- [o, e.value === "All" || e.value === "Cookies"]
81
+ [a, e.value === "All" || e.value === "Cookies"]
72
82
  ]),
73
- a(l(r, {
83
+ i(l(r, {
74
84
  paramKey: "headers",
75
85
  title: "Headers"
76
86
  }, null, 512), [
77
- [o, e.value === "All" || e.value === "Headers"]
87
+ [a, e.value === "All" || e.value === "Headers"]
78
88
  ]),
79
- a(l(r, {
89
+ i(l(r, {
80
90
  paramKey: "query",
81
91
  title: "Query Parameters"
82
92
  }, null, 512), [
83
- [o, e.value === "All" || e.value === "Query"]
93
+ [a, e.value === "All" || e.value === "Query"]
84
94
  ]),
85
- a(l(g, {
95
+ i(l(H, {
86
96
  body: "foo",
87
97
  title: "Body"
88
98
  }, null, 512), [
89
99
  [
90
- o,
91
- (e.value === "All" || e.value === "Body") && c.includes(n(i).method)
100
+ a,
101
+ (e.value === "All" || e.value === "Body") && n.includes(o(s).method)
92
102
  ]
93
103
  ])
94
104
  ])
@@ -98,5 +108,5 @@ const T = { class: "flex-1" }, w = { class: "text-c-3 pl-1" }, K = { class: "req
98
108
  }
99
109
  });
100
110
  export {
101
- U as default
111
+ W as default
102
112
  };