@scalar/api-client 2.3.32 → 2.3.33

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 (99) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/dist/components/CodeInput/CodeInput.vue.d.ts.map +1 -1
  3. package/dist/components/CodeInput/CodeInput.vue.js +1 -1
  4. package/dist/components/CodeInput/CodeInput.vue2.js +63 -61
  5. package/dist/components/DataTable/DataTable.vue.js +1 -1
  6. package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.d.ts.map +1 -1
  7. package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.js +58 -48
  8. package/dist/components/Sidebar/SidebarListElement.vue.d.ts +2 -2
  9. package/dist/components/ViewLayout/ViewLayoutCollapse.vue.d.ts.map +1 -1
  10. package/dist/components/ViewLayout/ViewLayoutCollapse.vue.js +34 -32
  11. package/dist/components/ViewLayout/ViewLayoutSection.vue.d.ts.map +1 -1
  12. package/dist/components/ViewLayout/ViewLayoutSection.vue.js +6 -6
  13. package/dist/hooks/useClientConfig.d.ts +3 -0
  14. package/dist/hooks/useClientConfig.d.ts.map +1 -1
  15. package/dist/layouts/App/create-api-client-app.d.ts +64 -24
  16. package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
  17. package/dist/layouts/Modal/create-api-client-modal.d.ts +128 -48
  18. package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
  19. package/dist/layouts/Web/create-api-client-web.d.ts +64 -24
  20. package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
  21. package/dist/libs/create-client.d.ts +64 -24
  22. package/dist/libs/create-client.d.ts.map +1 -1
  23. package/dist/libs/index.js +26 -25
  24. package/dist/libs/local-storage.d.ts +8 -0
  25. package/dist/libs/local-storage.d.ts.map +1 -1
  26. package/dist/libs/local-storage.js +28 -24
  27. package/dist/libs/send-request/create-request-operation.d.ts.map +1 -1
  28. package/dist/libs/send-request/create-request-operation.js +8 -8
  29. package/dist/libs/send-request/create-request-operation.test.d.ts +2 -2
  30. package/dist/libs/send-request/create-request-operation.test.d.ts.map +1 -1
  31. package/dist/libs/send-request/decode-buffer.js +4 -4
  32. package/dist/store/active-entities.d.ts +2 -2
  33. package/dist/store/active-entities.d.ts.map +1 -1
  34. package/dist/store/request-example.d.ts +22 -22
  35. package/dist/store/request-example.d.ts.map +1 -1
  36. package/dist/store/security-schemes.d.ts +42 -2
  37. package/dist/store/security-schemes.d.ts.map +1 -1
  38. package/dist/store/store.d.ts +64 -24
  39. package/dist/store/store.d.ts.map +1 -1
  40. package/dist/style.css +1 -1
  41. package/dist/views/Collection/CollectionAuthentication.vue.d.ts.map +1 -1
  42. package/dist/views/Collection/CollectionAuthentication.vue.js +1 -1
  43. package/dist/views/Collection/CollectionAuthentication.vue2.js +32 -32
  44. package/dist/views/Collection/CollectionEnvironment.vue.d.ts.map +1 -1
  45. package/dist/views/Collection/CollectionEnvironment.vue.js +3 -2
  46. package/dist/views/Collection/CollectionEnvironment.vue2.js +233 -9
  47. package/dist/views/Collection/CollectionNavigation.vue.js +36 -36
  48. package/dist/views/Collection/CollectionServers.vue.d.ts.map +1 -1
  49. package/dist/views/Collection/CollectionServers.vue2.js +6 -6
  50. package/dist/views/Collection/components/EnvironmentForm.vue.d.ts +13 -0
  51. package/dist/views/Collection/components/EnvironmentForm.vue.d.ts.map +1 -0
  52. package/dist/views/Collection/components/EnvironmentForm.vue.js +7 -0
  53. package/dist/views/Collection/components/EnvironmentForm.vue2.js +274 -0
  54. package/dist/views/Components/CodeSnippet/helpers/convert-to-har-request.d.ts.map +1 -1
  55. package/dist/views/Components/CodeSnippet/helpers/convert-to-har-request.js +35 -34
  56. package/dist/views/Environment/EnvironmentModal.vue.d.ts.map +1 -1
  57. package/dist/views/Environment/EnvironmentModal.vue.js +32 -28
  58. package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.d.ts +1 -0
  59. package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.d.ts.map +1 -1
  60. package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.js +67 -65
  61. package/dist/views/Request/RequestSection/RequestAuth/OAuthScopesInput.vue.d.ts.map +1 -1
  62. package/dist/views/Request/RequestSection/RequestAuth/OAuthScopesInput.vue.js +94 -97
  63. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.d.ts +1 -0
  64. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.d.ts.map +1 -1
  65. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.js +2 -2
  66. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue2.js +116 -99
  67. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.d.ts +1 -0
  68. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.d.ts.map +1 -1
  69. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.js +1 -1
  70. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue2.js +27 -25
  71. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthTab.vue.d.ts +1 -0
  72. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthTab.vue.d.ts.map +1 -1
  73. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthTab.vue.js +2 -2
  74. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthTab.vue2.js +114 -73
  75. package/dist/views/Request/RequestSection/RequestSection.vue.d.ts.map +1 -1
  76. package/dist/views/Request/RequestSection/RequestSection.vue.js +1 -1
  77. package/dist/views/Request/RequestSection/RequestSection.vue2.js +15 -15
  78. package/dist/views/Request/RequestSection/helpers/update-scheme.d.ts +8 -0
  79. package/dist/views/Request/RequestSection/helpers/update-scheme.d.ts.map +1 -0
  80. package/dist/views/Request/RequestSection/helpers/update-scheme.js +17 -0
  81. package/dist/views/Request/RequestSection/helpers/update-scheme.test.d.ts +2 -0
  82. package/dist/views/Request/RequestSection/helpers/update-scheme.test.d.ts.map +1 -0
  83. package/dist/views/Request/RequestSidebar.vue.d.ts.map +1 -1
  84. package/dist/views/Request/RequestSidebar.vue.js +1 -1
  85. package/dist/views/Request/RequestSidebar.vue2.js +87 -84
  86. package/dist/views/Request/ResponseSection/ResponseBody.vue.js +2 -2
  87. package/dist/views/Request/ResponseSection/ResponseBody.vue2.js +21 -21
  88. package/dist/views/Request/ResponseSection/ResponseBodyDownload.vue.d.ts.map +1 -1
  89. package/dist/views/Request/ResponseSection/ResponseBodyDownload.vue.js +11 -11
  90. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  91. package/dist/views/Request/consts/index.js +7 -5
  92. package/dist/views/Request/consts/mediaTypes.d.ts +4 -0
  93. package/dist/views/Request/consts/mediaTypes.d.ts.map +1 -1
  94. package/dist/views/Request/consts/mediaTypes.js +21 -4
  95. package/dist/views/Request/consts/mediaTypes.test.d.ts +2 -0
  96. package/dist/views/Request/consts/mediaTypes.test.d.ts.map +1 -0
  97. package/dist/views/Request/libs/oauth2.d.ts.map +1 -1
  98. package/dist/views/Request/libs/oauth2.js +53 -47
  99. package/package.json +11 -11
@@ -0,0 +1,274 @@
1
+ import { defineComponent as $, ref as f, computed as b, watch as E, onMounted as D, createBlock as V, openBlock as d, withCtx as u, createVNode as v, createElementBlock as O, createTextVNode as K, Fragment as j, renderList as F, normalizeClass as A, createSlots as J, unref as g, createCommentVNode as L, withModifiers as q, nextTick as p } from "vue";
2
+ import { ScalarButton as G } from "@scalar/components";
3
+ import { ScalarIconWarning as H, ScalarIconTrash as P } from "@scalar/icons";
4
+ import T from "../../../components/CodeInput/CodeInput.vue.js";
5
+ import Q from "../../../components/DataTable/DataTable.vue.js";
6
+ import U from "../../../components/DataTable/DataTableCell.vue.js";
7
+ import z from "../../../components/DataTable/DataTableHeader.vue.js";
8
+ import M from "../../../components/DataTable/DataTableRow.vue.js";
9
+ import { useWorkspace as X } from "../../../store/store.js";
10
+ const re = /* @__PURE__ */ $({
11
+ __name: "EnvironmentForm",
12
+ props: {
13
+ collection: {},
14
+ environment: {},
15
+ workspace: {},
16
+ envVariables: {}
17
+ },
18
+ setup(o) {
19
+ const { collectionMutators: y } = X(), r = f([]), k = f(/* @__PURE__ */ new Set()), w = f(/* @__PURE__ */ new Map()), c = f(!1), x = b(() => {
20
+ var e;
21
+ if (!((e = o.environment) != null && e.value))
22
+ return [{ key: "", value: "" }];
23
+ try {
24
+ const n = JSON.parse(o.environment.value), l = Object.entries(n).map(([t, a]) => ({
25
+ key: t,
26
+ value: String(a)
27
+ }));
28
+ return l.length === 0 ? [{ key: "", value: "" }] : l;
29
+ } catch {
30
+ return [{ key: "", value: "" }];
31
+ }
32
+ }), N = b(() => {
33
+ const e = r.value[r.value.length - 1];
34
+ return e ? e.key || e.value ? [...r.value, { key: "", value: "" }] : r.value : [{ key: "", value: "" }];
35
+ }), C = b(() => {
36
+ const e = /* @__PURE__ */ new Map();
37
+ return r.value.forEach((n, l) => {
38
+ if (n.key) {
39
+ const t = e.get(n.key) || [];
40
+ t.push(l), e.set(n.key, t);
41
+ }
42
+ }), w.value.forEach((n, l) => {
43
+ if (n) {
44
+ const t = e.get(n) || [];
45
+ t.push(l), e.set(n, t);
46
+ }
47
+ }), Array.from(e.values()).filter((n) => n.length > 1).flat();
48
+ });
49
+ E(
50
+ x,
51
+ (e) => {
52
+ r.value = [...e], k.value = new Set(e.map((n) => n.key).filter(Boolean));
53
+ },
54
+ { immediate: !0 }
55
+ );
56
+ const S = async (e, n, l) => {
57
+ var t;
58
+ if (!c.value) {
59
+ if (n === "key") {
60
+ w.value.set(e, l);
61
+ const a = new Set(k.value), s = r.value[e];
62
+ if (s && a.delete(s.key), a.has(l))
63
+ return;
64
+ }
65
+ c.value = !0;
66
+ try {
67
+ const a = [...r.value], s = a[e];
68
+ if (!s)
69
+ return;
70
+ a[e] = {
71
+ key: n === "key" ? l : s.key,
72
+ value: n === "value" ? l : s.value
73
+ }, !a[e].key && !a[e].value && e !== a.length - 1 && a.splice(e, 1);
74
+ const m = a.reduce(
75
+ (i, { key: I, value: R }) => ((I || R) && (i[I] = R), i),
76
+ {}
77
+ );
78
+ if (o.collection) {
79
+ const i = {
80
+ ...o.collection["x-scalar-environments"],
81
+ [o.environment.name]: {
82
+ ...(t = o.collection["x-scalar-environments"]) == null ? void 0 : t[o.environment.name],
83
+ variables: m
84
+ }
85
+ };
86
+ await y.edit(
87
+ o.collection.uid,
88
+ "x-scalar-environments",
89
+ i
90
+ );
91
+ }
92
+ if (e === r.value.length - 1) {
93
+ const i = a[a.length - 1];
94
+ i && (i.key || i.value) && await h();
95
+ }
96
+ await p(), r.value = a, n === "key" && (k.value = new Set(
97
+ a.map((i) => i.key).filter(Boolean)
98
+ ), w.value.delete(e));
99
+ } finally {
100
+ c.value = !1;
101
+ }
102
+ }
103
+ }, h = async () => {
104
+ var e;
105
+ if (!c.value) {
106
+ c.value = !0;
107
+ try {
108
+ const n = [...r.value, { key: "", value: "" }], l = n.reduce(
109
+ (t, { key: a, value: s }) => ((a || s) && (t[a] = s), t),
110
+ {}
111
+ );
112
+ if (o.collection) {
113
+ const t = {
114
+ ...o.collection["x-scalar-environments"],
115
+ [o.environment.name]: {
116
+ ...(e = o.collection["x-scalar-environments"]) == null ? void 0 : e[o.environment.name],
117
+ variables: l
118
+ }
119
+ };
120
+ await y.edit(
121
+ o.collection.uid,
122
+ "x-scalar-environments",
123
+ t
124
+ );
125
+ }
126
+ await p(), r.value = n;
127
+ } finally {
128
+ c.value = !1;
129
+ }
130
+ }
131
+ }, W = async (e) => {
132
+ var n;
133
+ if (!c.value) {
134
+ c.value = !0;
135
+ try {
136
+ const l = [...r.value];
137
+ l.splice(e, 1);
138
+ const t = l.reduce(
139
+ (a, { key: s, value: m }) => ((s || m) && (a[s] = m), a),
140
+ {}
141
+ );
142
+ if (o.collection) {
143
+ const a = {
144
+ ...o.collection["x-scalar-environments"],
145
+ [o.environment.name]: {
146
+ ...(n = o.collection["x-scalar-environments"]) == null ? void 0 : n[o.environment.name],
147
+ variables: t
148
+ }
149
+ };
150
+ await y.edit(
151
+ o.collection.uid,
152
+ "x-scalar-environments",
153
+ a
154
+ );
155
+ }
156
+ await p(), r.value = l;
157
+ } finally {
158
+ c.value = !1;
159
+ }
160
+ }
161
+ }, B = async () => {
162
+ if (r.value.length === 0)
163
+ await h();
164
+ else if (r.value.length >= 1) {
165
+ const e = r.value[r.value.length - 1];
166
+ e && (e.key || e.value) && await h();
167
+ }
168
+ };
169
+ return D(() => {
170
+ B();
171
+ }), E(
172
+ () => r.value,
173
+ () => {
174
+ B();
175
+ }
176
+ ), (e, n) => (d(), V(Q, {
177
+ class: "group/table flex-1",
178
+ columns: ["", ""]
179
+ }, {
180
+ default: u(() => [
181
+ v(M, { class: "sr-only !block" }, {
182
+ default: u(() => [
183
+ v(z, null, {
184
+ default: u(() => n[0] || (n[0] = [
185
+ K("Key")
186
+ ])),
187
+ _: 1
188
+ }),
189
+ v(z, null, {
190
+ default: u(() => n[1] || (n[1] = [
191
+ K("Value")
192
+ ])),
193
+ _: 1
194
+ })
195
+ ]),
196
+ _: 1
197
+ }),
198
+ (d(!0), O(j, null, F(N.value, (l, t) => (d(), V(M, {
199
+ key: t,
200
+ class: A({
201
+ error: C.value.includes(t)
202
+ })
203
+ }, {
204
+ default: u(() => [
205
+ v(U, null, {
206
+ default: u(() => [
207
+ v(T, {
208
+ disableCloseBrackets: "",
209
+ disableEnter: "",
210
+ disableTabIndent: "",
211
+ lineWrapping: "",
212
+ environment: e.environment,
213
+ envVariables: e.envVariables,
214
+ modelValue: l.key,
215
+ placeholder: "Key",
216
+ workspace: e.workspace,
217
+ "onUpdate:modelValue": (a) => S(t, "key", a)
218
+ }, J({ _: 2 }, [
219
+ C.value.includes(t) ? {
220
+ name: "icon",
221
+ fn: u(() => [
222
+ v(g(H), { class: "text-red mr-0.75 size-3.5 brightness-[.9]" })
223
+ ]),
224
+ key: "0"
225
+ } : void 0
226
+ ]), 1032, ["environment", "envVariables", "modelValue", "workspace", "onUpdate:modelValue"])
227
+ ]),
228
+ _: 2
229
+ }, 1024),
230
+ v(U, null, {
231
+ default: u(() => [
232
+ v(T, {
233
+ class: "pr-6 group-hover:pr-10 group-has-[.cm-focused]:pr-10",
234
+ disableCloseBrackets: "",
235
+ disableEnter: "",
236
+ disableTabIndent: "",
237
+ lineWrapping: "",
238
+ environment: e.environment,
239
+ envVariables: e.envVariables,
240
+ modelValue: l.value,
241
+ placeholder: "Value",
242
+ workspace: e.workspace,
243
+ "onUpdate:modelValue": (a) => S(t, "value", a)
244
+ }, {
245
+ icon: u(() => [
246
+ l.key || l.value ? (d(), V(g(G), {
247
+ key: 0,
248
+ class: "text-c-2 hover:text-c-1 hover:bg-b-2 z-context hidden h-fit rounded p-1 group-hover:flex group-has-[.cm-focused]:flex",
249
+ size: "sm",
250
+ variant: "ghost",
251
+ onClick: q((a) => W(t), ["stop"])
252
+ }, {
253
+ default: u(() => [
254
+ v(g(P), { class: "size-3.5" })
255
+ ]),
256
+ _: 2
257
+ }, 1032, ["onClick"])) : L("", !0)
258
+ ]),
259
+ _: 2
260
+ }, 1032, ["environment", "envVariables", "modelValue", "workspace", "onUpdate:modelValue"])
261
+ ]),
262
+ _: 2
263
+ }, 1024)
264
+ ]),
265
+ _: 2
266
+ }, 1032, ["class"]))), 128))
267
+ ]),
268
+ _: 1
269
+ }));
270
+ }
271
+ });
272
+ export {
273
+ re as default
274
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"convert-to-har-request.d.ts","sourceRoot":"","sources":["../../../../../src/views/Components/CodeSnippet/helpers/convert-to-har-request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAEhF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAElD,KAAK,KAAK,GAAG;IACX,OAAO,EAAE,MAAM,GAAG,SAAS,CAAA;IAC3B,IAAI,CAAC,EAAE,cAAc,CAAC,MAAM,CAAC,GAAG,SAAS,CAAA;IACzC,OAAO,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAE,EAAE,CAAA;IAC3D,OAAO,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAE,EAAE,CAAA;IAC3D,KAAK,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAE,EAAE,CAAA;CAC1D,GAAG,IAAI,CAAC,SAAS,EAAE,QAAQ,GAAG,MAAM,CAAC,CAAA;AAEtC;;;GAGG;AACH,eAAO,MAAM,mBAAmB,8DAQ7B,KAAK,KAAG,UAgHV,CAAA"}
1
+ {"version":3,"file":"convert-to-har-request.d.ts","sourceRoot":"","sources":["../../../../../src/views/Components/CodeSnippet/helpers/convert-to-har-request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAEhF,OAAO,KAAK,EAAE,UAAU,EAAiB,MAAM,kBAAkB,CAAA;AAEjE,KAAK,KAAK,GAAG;IACX,OAAO,EAAE,MAAM,GAAG,SAAS,CAAA;IAC3B,IAAI,CAAC,EAAE,cAAc,CAAC,MAAM,CAAC,GAAG,SAAS,CAAA;IACzC,OAAO,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAE,EAAE,CAAA;IAC3D,OAAO,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAE,EAAE,CAAA;IAC3D,KAAK,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAE,EAAE,CAAA;CAC1D,GAAG,IAAI,CAAC,SAAS,EAAE,QAAQ,GAAG,MAAM,CAAC,CAAA;AAEtC;;;GAGG;AACH,eAAO,MAAM,mBAAmB,8DAQ7B,KAAK,KAAG,UAoGV,CAAA"}
@@ -1,17 +1,17 @@
1
- import { mergeUrls as T } from "@scalar/oas-utils/helpers";
1
+ import { mergeUrls as D } from "@scalar/oas-utils/helpers";
2
2
  const w = ({
3
- baseUrl: u = "",
4
- method: g,
5
- body: r,
6
- path: h,
7
- cookies: s,
3
+ baseUrl: f = "",
4
+ method: u,
5
+ body: a,
6
+ path: g,
7
+ cookies: p,
8
8
  headers: o,
9
9
  query: m
10
10
  }) => {
11
- var p, c, l;
12
- const D = T(u, h, void 0, !0), i = {
13
- method: g.toUpperCase(),
14
- url: D.toString(),
11
+ var s, l, c;
12
+ const h = D(f, g, void 0, !0), r = {
13
+ method: u.toUpperCase(),
14
+ url: h.toString(),
15
15
  httpVersion: "HTTP/1.1",
16
16
  headers: [],
17
17
  queryString: [],
@@ -19,43 +19,44 @@ const w = ({
19
19
  headersSize: -1,
20
20
  bodySize: -1
21
21
  };
22
- if (s.length && (i.cookies = s.filter((e) => e.enabled).map(({ key: e, value: t }) => ({
22
+ if (p.length && (r.cookies = p.filter((e) => e.enabled).map(({ key: e, value: t }) => ({
23
23
  name: e,
24
24
  value: t
25
- }))), o.length && (i.headers = o.filter((e) => e.enabled && !(e.key.toLowerCase() === "accept" && e.value === "*/*")).map(({ key: e, value: t }) => ({
26
- name: e.replace(/\b\w/g, (a) => a.toUpperCase()),
25
+ }))), o.length && (r.headers = o.filter((e) => e.enabled && !(e.key.toLowerCase() === "accept" && e.value === "*/*")).map(({ key: e, value: t }) => ({
26
+ name: e.replace(/\b\w/g, (n) => n.toUpperCase()),
27
27
  value: t
28
- }))), m.length && (i.queryString = m.filter((e) => e.enabled).map(({ key: e, value: t }) => ({
28
+ }))), m.length && (r.queryString = m.filter((e) => e.enabled).map(({ key: e, value: t }) => ({
29
29
  name: e,
30
30
  value: t
31
- }))), r)
31
+ }))), a)
32
32
  try {
33
- const e = ((p = o.find((t) => t.key.toLowerCase() === "content-type")) == null ? void 0 : p.value) || "application/json";
34
- if (r.activeBody === "formData" && r.formData) {
35
- const t = {};
36
- r.formData.value.forEach(({ key: a, value: f, file: n, enabled: S }) => {
37
- S && (n ? t[a] = {
38
- type: "file",
39
- text: "BINARY",
40
- name: a || "blob",
41
- size: n.size,
42
- fileName: n.name,
43
- mimeType: n.type || "application/octet-stream"
44
- } : t[a] ? (Array.isArray(t[a]) || (t[a] = [t[a]]), t[a].push(f)) : t[a] = f);
45
- }), ((c = r.formData) == null ? void 0 : c.encoding) === "urlencoded" ? i.postData = {
33
+ const e = ((s = o.find((t) => t.key.toLowerCase() === "content-type")) == null ? void 0 : s.value) || "application/json";
34
+ if (a.activeBody === "formData" && a.formData) {
35
+ const t = [];
36
+ a.formData.value.forEach(({ key: n, value: v, file: i, enabled: T }) => {
37
+ T && (i ? t.push({
38
+ name: n || "blob",
39
+ value: "BINARY",
40
+ fileName: i.name,
41
+ contentType: i.type || "application/octet-stream"
42
+ }) : t.push({
43
+ name: n,
44
+ value: v
45
+ }));
46
+ }), ((l = a.formData) == null ? void 0 : l.encoding) === "urlencoded" ? r.postData = {
46
47
  mimeType: e,
47
- text: new URLSearchParams(t).toString()
48
- } : i.postData = {
48
+ params: t
49
+ } : r.postData = {
49
50
  mimeType: e,
50
- text: JSON.stringify(t)
51
+ params: t
51
52
  };
52
- } else r.activeBody === "raw" && r.raw && (i.postData = {
53
+ } else a.activeBody === "raw" && a.raw && (r.postData = {
53
54
  mimeType: e,
54
- text: ((l = r.raw) == null ? void 0 : l.value) ?? ""
55
+ text: ((c = a.raw) == null ? void 0 : c.value) ?? ""
55
56
  });
56
57
  } catch {
57
58
  }
58
- return i;
59
+ return r;
59
60
  };
60
61
  export {
61
62
  w as convertToHarRequest
@@ -1 +1 @@
1
- {"version":3,"file":"EnvironmentModal.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Environment/EnvironmentModal.vue"],"names":[],"mappings":"AA2JA,OAAO,EAKL,KAAK,UAAU,EAChB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAA;AAYjE,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,UAAU,CAAA;IACjB,0BAA0B,EAAE,UAAU,EAAE,CAAA;IACxC,YAAY,EAAE,MAAM,GAAG,SAAS,CAAA;CACjC,CAAC;;;cAQU,MAAM;eACL,MAAM;cACP,MAAM;sBACE,UAAU,CAAC,KAAK,CAAC,GAAG,SAAS;;;;;cAHrC,MAAM;eACL,MAAM;cACP,MAAM;sBACE,UAAU,CAAC,KAAK,CAAC,GAAG,SAAS;;;;AAkSjD,wBAQG"}
1
+ {"version":3,"file":"EnvironmentModal.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Environment/EnvironmentModal.vue"],"names":[],"mappings":"AA+JA,OAAO,EAKL,KAAK,UAAU,EAChB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAA;AAYjE,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,UAAU,CAAA;IACjB,0BAA0B,EAAE,UAAU,EAAE,CAAA;IACxC,YAAY,EAAE,MAAM,GAAG,SAAS,CAAA;CACjC,CAAC;;;cAQU,MAAM;eACL,MAAM;cACP,MAAM;sBACE,UAAU,CAAC,KAAK,CAAC,GAAG,SAAS;;;;;cAHrC,MAAM;eACL,MAAM;cACP,MAAM;sBACE,UAAU,CAAC,KAAK,CAAC,GAAG,SAAS;;;;AAsSjD,wBAQG"}
@@ -1,11 +1,11 @@
1
- import { defineComponent as _, ref as u, computed as h, watch as w, createBlock as m, openBlock as v, unref as i, withCtx as a, createVNode as s, createElementVNode as p, createTextVNode as I, normalizeClass as E, toDisplayString as N } from "vue";
2
- import { ScalarModal as T, ScalarListbox as $, ScalarButton as C, ScalarIcon as z } from "@scalar/components";
1
+ import { defineComponent as _, ref as m, computed as h, watch as w, createBlock as u, openBlock as v, unref as s, withCtx as a, createVNode as r, createElementVNode as p, createTextVNode as I, normalizeClass as E, toDisplayString as N } from "vue";
2
+ import { ScalarModal as T, ScalarListbox as $, ScalarButton as x, ScalarIcon as z } from "@scalar/components";
3
3
  import { useToasts as B } from "@scalar/use-toasts";
4
4
  import D from "../../components/CommandPalette/CommandActionForm.vue.js";
5
- import U from "../../components/CommandPalette/CommandActionInput.vue.js";
6
- import W from "./EnvironmentColors.vue.js";
7
- import { useWorkspace as j } from "../../store/store.js";
8
- const M = { class: "flex items-start gap-2" }, K = /* @__PURE__ */ _({
5
+ import P from "../../components/CommandPalette/CommandActionInput.vue.js";
6
+ import U from "./EnvironmentColors.vue.js";
7
+ import { useWorkspace as W } from "../../store/store.js";
8
+ const j = { class: "flex items-start gap-2" }, K = /* @__PURE__ */ _({
9
9
  __name: "EnvironmentModal",
10
10
  props: {
11
11
  state: {},
@@ -13,8 +13,8 @@ const M = { class: "flex items-start gap-2" }, K = /* @__PURE__ */ _({
13
13
  collectionId: {}
14
14
  },
15
15
  emits: ["cancel", "submit"],
16
- setup(x, { emit: g }) {
17
- const n = x, f = g, { events: F } = j(), r = u(""), c = u("#FFFFFF"), d = h(() => [
16
+ setup(g, { emit: F }) {
17
+ const n = g, f = F, { events: S } = W(), i = m(""), c = m("#FFFFFF"), d = h(() => [
18
18
  ...n.activeWorkspaceCollections.filter((t) => {
19
19
  var e;
20
20
  return ((e = t.info) == null ? void 0 : e.title) !== "Drafts";
@@ -25,54 +25,58 @@ const M = { class: "flex items-start gap-2" }, K = /* @__PURE__ */ _({
25
25
  label: ((e = t.info) == null ? void 0 : e.title) ?? "Untitled Collection"
26
26
  };
27
27
  })
28
- ]), l = u(
28
+ ]), l = m(
29
29
  d.value.find((t) => t.id === n.collectionId)
30
- ), { toast: S } = B(), V = (t) => {
30
+ ), { toast: b } = B(), V = (t) => {
31
31
  c.value = t;
32
32
  };
33
33
  w(
34
34
  () => n.state.open,
35
35
  (t) => {
36
- t && (r.value = "", c.value = "#FFFFFF", n.collectionId ? l.value = d.value.find(
36
+ t && (i.value = "", c.value = "#FFFFFF", n.collectionId ? l.value = d.value.find(
37
37
  (e) => e.id === n.collectionId
38
38
  ) : l.value = void 0);
39
39
  }
40
40
  );
41
41
  const k = () => {
42
- var t, e, o, b;
42
+ var t, e, o, C;
43
+ if (!i.value.trim()) {
44
+ b("Please enter a name before adding an environment.", "error");
45
+ return;
46
+ }
43
47
  if (!((t = l.value) != null && t.id)) {
44
- S("Please select a collection before adding an environment.", "error");
48
+ b("Please select a collection before adding an environment.", "error");
45
49
  return;
46
50
  }
47
51
  f("submit", {
48
- name: r.value,
52
+ name: i.value,
49
53
  color: c.value,
50
54
  type: ((e = l.value) == null ? void 0 : e.id) === "global" ? "global" : "collection",
51
- collectionId: ((o = l.value) == null ? void 0 : o.id) !== "global" ? (b = l.value) == null ? void 0 : b.id : void 0
55
+ collectionId: ((o = l.value) == null ? void 0 : o.id) !== "global" ? (C = l.value) == null ? void 0 : C.id : void 0
52
56
  });
53
57
  }, y = () => {
54
- n.state.hide(), F.commandPalette.emit({ commandName: "Create Collection" });
58
+ n.state.hide(), S.commandPalette.emit({ commandName: "Create Collection" });
55
59
  };
56
- return (t, e) => (v(), m(i(T), {
60
+ return (t, e) => (v(), u(s(T), {
57
61
  bodyClass: "border-t-0 rounded-t-lg",
58
62
  size: "xs",
59
63
  state: t.state
60
64
  }, {
61
65
  default: a(() => [
62
- s(D, {
63
- disabled: !l.value,
66
+ r(D, {
67
+ disabled: !l.value || !i.value.trim(),
64
68
  onCancel: e[2] || (e[2] = (o) => f("cancel")),
65
69
  onSubmit: k
66
70
  }, {
67
71
  options: a(() => [
68
- s(i($), {
72
+ r(s($), {
69
73
  modelValue: l.value,
70
74
  "onUpdate:modelValue": e[1] || (e[1] = (o) => l.value = o),
71
75
  options: d.value,
72
76
  placeholder: "Select Type"
73
77
  }, {
74
78
  default: a(() => [
75
- d.value.length > 0 ? (v(), m(i(C), {
79
+ d.value.length > 0 ? (v(), u(s(x), {
76
80
  key: 0,
77
81
  class: "hover:bg-b-2 max-h-8 w-fit justify-between gap-1 p-2 text-xs",
78
82
  variant: "outlined"
@@ -81,14 +85,14 @@ const M = { class: "flex items-start gap-2" }, K = /* @__PURE__ */ _({
81
85
  p("span", {
82
86
  class: E(l.value ? "text-c-1" : "text-c-3")
83
87
  }, N(l.value ? l.value.label : "Select Collection"), 3),
84
- s(i(z), {
88
+ r(s(z), {
85
89
  class: "text-c-3",
86
90
  icon: "ChevronDown",
87
91
  size: "xs"
88
92
  })
89
93
  ]),
90
94
  _: 1
91
- })) : (v(), m(i(C), {
95
+ })) : (v(), u(s(x), {
92
96
  key: 1,
93
97
  class: "hover:bg-b-2 max-h-8 justify-between gap-1 p-2 text-xs",
94
98
  variant: "outlined",
@@ -107,16 +111,16 @@ const M = { class: "flex items-start gap-2" }, K = /* @__PURE__ */ _({
107
111
  I(" Add Environment ")
108
112
  ])),
109
113
  default: a(() => [
110
- p("div", M, [
111
- s(W, {
114
+ p("div", j, [
115
+ r(U, {
112
116
  activeColor: c.value,
113
117
  class: "peer",
114
118
  selector: "",
115
119
  onSelect: V
116
120
  }, null, 8, ["activeColor"]),
117
- s(U, {
118
- modelValue: r.value,
119
- "onUpdate:modelValue": e[0] || (e[0] = (o) => r.value = o),
121
+ r(P, {
122
+ modelValue: i.value,
123
+ "onUpdate:modelValue": e[0] || (e[0] = (o) => i.value = o),
120
124
  class: "-mt-[.5px] !p-0 peer-has-[.color-selector]:hidden",
121
125
  placeholder: "Environment name"
122
126
  }, null, 8, ["modelValue"])
@@ -7,6 +7,7 @@ type __VLS_Props = {
7
7
  environment: Environment;
8
8
  envVariables: EnvVariable[];
9
9
  flow: Oauth2Flow;
10
+ persistAuth: boolean;
10
11
  scheme: SecuritySchemeOauth2;
11
12
  server: Server | undefined;
12
13
  workspace: Workspace;
@@ -1 +1 @@
1
- {"version":3,"file":"OAuth2.vue.d.ts","sourceRoot":"","sources":["../../../../../src/views/Request/RequestSection/RequestAuth/OAuth2.vue"],"names":[],"mappings":"AAqQA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AACzE,OAAO,EAEL,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,oBAAoB,EACzB,KAAK,MAAM,EACZ,MAAM,iCAAiC,CAAA;AACxC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AAIrE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAS1D,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,UAAU,CAAA;IACtB,WAAW,EAAE,WAAW,CAAA;IACxB,YAAY,EAAE,WAAW,EAAE,CAAA;IAC3B,IAAI,EAAE,UAAU,CAAA;IAChB,MAAM,EAAE,oBAAoB,CAAA;IAC5B,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,SAAS,EAAE,SAAS,CAAA;CACrB,CAAC;;AAgfF,wBAMG"}
1
+ {"version":3,"file":"OAuth2.vue.d.ts","sourceRoot":"","sources":["../../../../../src/views/Request/RequestSection/RequestAuth/OAuth2.vue"],"names":[],"mappings":"AAwQA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AACzE,OAAO,EAEL,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,oBAAoB,EACzB,KAAK,MAAM,EACZ,MAAM,iCAAiC,CAAA;AACxC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AAIrE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAU1D,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,UAAU,CAAA;IACtB,WAAW,EAAE,WAAW,CAAA;IACxB,YAAY,EAAE,WAAW,EAAE,CAAA;IAC3B,IAAI,EAAE,UAAU,CAAA;IAChB,WAAW,EAAE,OAAO,CAAA;IACpB,MAAM,EAAE,oBAAoB,CAAA;IAC5B,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,SAAS,EAAE,SAAS,CAAA;CACrB,CAAC;;AAifF,wBAMG"}