@scalar/api-client 2.3.14 → 2.3.16

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 (66) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/components/DataTable/DataTable.vue.d.ts +2 -0
  3. package/dist/components/DataTable/DataTable.vue.d.ts.map +1 -1
  4. package/dist/components/DataTable/DataTable.vue.js +17 -15
  5. package/dist/components/DataTable/DataTableCell.vue.d.ts.map +1 -1
  6. package/dist/components/DataTable/DataTableCell.vue.js +6 -9
  7. package/dist/components/ImportCollection/ImportCollectionListener.vue.d.ts.map +1 -1
  8. package/dist/components/ImportCollection/ImportCollectionListener.vue.js +68 -23
  9. package/dist/components/ImportCollection/ImportNowButton.vue.d.ts.map +1 -1
  10. package/dist/components/ImportCollection/ImportNowButton.vue.js +41 -54
  11. package/dist/components/ImportCollection/utils/import-collection.d.ts +12 -0
  12. package/dist/components/ImportCollection/utils/import-collection.d.ts.map +1 -0
  13. package/dist/components/ImportCollection/utils/import-collection.js +29 -0
  14. package/dist/components/ImportCollection/utils/workspace-store-is-empty.d.ts +6 -0
  15. package/dist/components/ImportCollection/utils/workspace-store-is-empty.d.ts.map +1 -0
  16. package/dist/components/ImportCollection/utils/workspace-store-is-empty.js +7 -0
  17. package/dist/components/ScalarAsciiArt.vue.d.ts.map +1 -1
  18. package/dist/components/ScalarAsciiArt.vue.js +1 -1
  19. package/dist/components/ScalarAsciiArt.vue2.js +11 -8
  20. package/dist/components/ScalarHotkey.test.d.ts +2 -0
  21. package/dist/components/ScalarHotkey.test.d.ts.map +1 -0
  22. package/dist/components/ScalarHotkey.vue.d.ts.map +1 -1
  23. package/dist/components/ScalarHotkey.vue.js +34 -11
  24. package/dist/layouts/App/ApiClientApp.vue.d.ts.map +1 -1
  25. package/dist/layouts/Modal/ApiClientModal.vue.d.ts.map +1 -1
  26. package/dist/layouts/Modal/ApiClientModal.vue.js +1 -1
  27. package/dist/layouts/Web/ApiClientWeb.vue.d.ts.map +1 -1
  28. package/dist/style.css +1 -1
  29. package/dist/views/Request/Request.vue.d.ts.map +1 -1
  30. package/dist/views/Request/Request.vue.js +2 -2
  31. package/dist/views/Request/Request.vue2.js +39 -36
  32. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.d.ts.map +1 -1
  33. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.js +3 -3
  34. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue2.js +2 -1
  35. package/dist/views/Request/RequestSection/RequestBody.vue.d.ts.map +1 -1
  36. package/dist/views/Request/RequestSection/RequestBody.vue.js +2 -2
  37. package/dist/views/Request/RequestSection/RequestBody.vue2.js +4 -1
  38. package/dist/views/Request/RequestSection/RequestCodeExample.vue.d.ts.map +1 -1
  39. package/dist/views/Request/RequestSection/RequestCodeExample.vue.js +2 -2
  40. package/dist/views/Request/RequestSection/RequestCodeExample.vue2.js +4 -1
  41. package/dist/views/Request/RequestSection/RequestParams.vue.d.ts +1 -0
  42. package/dist/views/Request/RequestSection/RequestParams.vue.d.ts.map +1 -1
  43. package/dist/views/Request/RequestSection/RequestParams.vue.js +19 -16
  44. package/dist/views/Request/RequestSection/RequestSection.vue.d.ts.map +1 -1
  45. package/dist/views/Request/RequestSection/RequestSection.vue.js +1 -1
  46. package/dist/views/Request/RequestSection/RequestSection.vue2.js +67 -64
  47. package/dist/views/Request/RequestSection/RequestTable.vue.d.ts +1 -0
  48. package/dist/views/Request/RequestSection/RequestTable.vue.d.ts.map +1 -1
  49. package/dist/views/Request/RequestSection/RequestTable.vue.js +1 -1
  50. package/dist/views/Request/RequestSection/RequestTable.vue2.js +123 -126
  51. package/dist/views/Request/RequestSidebar.vue.d.ts.map +1 -1
  52. package/dist/views/Request/RequestSidebar.vue.js +1 -1
  53. package/dist/views/Request/RequestSidebar.vue2.js +72 -69
  54. package/dist/views/Request/ResponseSection/RequestHeaders.vue.d.ts.map +1 -1
  55. package/dist/views/Request/ResponseSection/RequestHeaders.vue.js +53 -35
  56. package/dist/views/Request/ResponseSection/ResponseEmpty.vue.d.ts +5 -0
  57. package/dist/views/Request/ResponseSection/ResponseEmpty.vue.d.ts.map +1 -1
  58. package/dist/views/Request/ResponseSection/ResponseEmpty.vue.js +2 -2
  59. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +56 -59
  60. package/dist/views/Request/ResponseSection/ResponseHeaders.vue.d.ts.map +1 -1
  61. package/dist/views/Request/ResponseSection/ResponseHeaders.vue.js +53 -35
  62. package/dist/views/Request/ResponseSection/ResponseSection.vue.d.ts +5 -1
  63. package/dist/views/Request/ResponseSection/ResponseSection.vue.d.ts.map +1 -1
  64. package/dist/views/Request/ResponseSection/ResponseSection.vue.js +3 -3
  65. package/dist/views/Request/ResponseSection/ResponseSection.vue2.js +40 -34
  66. package/package.json +7 -7
@@ -1,24 +1,20 @@
1
- import { defineComponent as E, computed as p, useId as O, ref as H, watch as N, openBlock as m, createBlock as b, withCtx as v, createElementVNode as d, unref as t, createElementBlock as c, createCommentVNode as w, toDisplayString as I, createVNode as n, withDirectives as i, vShow as s } from "vue";
2
- import { ScalarErrorBoundary as K } from "@scalar/components";
3
- import { canMethodHaveBody as f, isDefined as U, REGEX as V } from "@scalar/oas-utils/helpers";
4
- import D from "../../../components/SectionFilter.vue.js";
5
- import Q from "../../../components/ViewLayout/ViewLayoutSection.vue.js";
6
- import { matchesDomain as $ } from "../../../libs/send-request/set-request-cookies.js";
7
- import L from "./RequestBody.vue.js";
1
+ import { defineComponent as H, computed as p, useId as w, ref as N, watch as I, openBlock as m, createBlock as V, withCtx as d, createElementVNode as v, unref as n, createElementBlock as c, createCommentVNode as A, toDisplayString as K, createVNode as t, withDirectives as i, vShow as s } from "vue";
2
+ import { ScalarErrorBoundary as U } from "@scalar/components";
3
+ import { canMethodHaveBody as f, isDefined as D, REGEX as q } from "@scalar/oas-utils/helpers";
4
+ import Q from "../../../components/SectionFilter.vue.js";
5
+ import $ from "../../../components/ViewLayout/ViewLayoutSection.vue.js";
6
+ import { matchesDomain as L } from "../../../libs/send-request/set-request-cookies.js";
7
+ import j from "./RequestBody.vue.js";
8
8
  import y from "./RequestParams.vue.js";
9
- import j from "./RequestPathParams.vue.js";
10
- import F from "./RequestAuth/RequestAuth.vue.js";
11
- import M from "./RequestCodeExample.vue.js";
12
- import { useWorkspace as T } from "../../../store/store.js";
13
- import { useLayout as W } from "../../../hooks/useLayout.js";
14
- const z = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:pr-24" }, G = {
15
- key: 0,
16
- class: "pointer-events-auto absolute left-0 top-0 h-full w-full cursor-text opacity-0",
17
- for: "requestname"
18
- }, X = ["placeholder", "value"], J = {
9
+ import F from "./RequestPathParams.vue.js";
10
+ import M from "./RequestAuth/RequestAuth.vue.js";
11
+ import T from "./RequestCodeExample.vue.js";
12
+ import { useWorkspace as W } from "../../../store/store.js";
13
+ import { useLayout as z } from "../../../hooks/useLayout.js";
14
+ const G = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:pr-24" }, X = ["for"], J = ["id", "placeholder", "value"], Y = {
19
15
  key: 2,
20
16
  class: "text-c-1 flex h-8 items-center"
21
- }, Y = ["id", "role"], ue = /* @__PURE__ */ E({
17
+ }, Z = ["id", "role"], pe = /* @__PURE__ */ H({
22
18
  __name: "RequestSection",
23
19
  props: {
24
20
  collection: {},
@@ -32,40 +28,40 @@ const z = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:
32
28
  workspace: {}
33
29
  },
34
30
  setup(l) {
35
- const A = [
31
+ const P = [
36
32
  "Auth",
37
33
  "Variables",
38
34
  "Cookies",
39
35
  "Headers",
40
36
  "Query",
41
37
  "Body"
42
- ], { requestMutators: q, cookies: P, securitySchemes: S } = T(), { layout: u } = W(), h = p(() => {
43
- const e = /* @__PURE__ */ new Set(["All", ...A]);
38
+ ], { requestMutators: S, cookies: g, securitySchemes: B } = W(), { layout: u } = z(), h = p(() => {
39
+ const e = /* @__PURE__ */ new Set(["All", ...P]);
44
40
  return l.example.parameters.path.length || e.delete("Variables"), f(l.operation.method ?? "get") || e.delete("Body"), k.value && e.delete("Auth"), [...e];
45
41
  }), r = p(
46
42
  () => Object.fromEntries(
47
- h.value.map((e) => [e, O()])
43
+ h.value.map((e) => [e, w()])
48
44
  )
49
45
  ), k = p(
50
46
  () => {
51
47
  var e;
52
48
  return u === "modal" && ((e = l.operation.security) == null ? void 0 : e.length) === 0;
53
49
  }
54
- ), a = H("All");
55
- N(
50
+ ), a = N("All");
51
+ I(
56
52
  () => l.operation,
57
53
  (e) => {
58
54
  a.value === "Body" && e && !f(e.method) && (a.value = "All");
59
55
  }
60
56
  );
61
- const g = (e) => {
57
+ const C = (e) => {
62
58
  const o = e.target;
63
- q.edit(l.operation.uid, "summary", o.value);
64
- }, B = p(
65
- () => (l.workspace.cookies ?? []).map((e) => P[e]).filter(U).filter((e) => e.name).filter(
59
+ S.edit(l.operation.uid, "summary", o.value);
60
+ }, R = p(
61
+ () => (l.workspace.cookies ?? []).map((e) => g[e]).filter(D).filter((e) => e.name).filter(
66
62
  (e) => {
67
63
  var o;
68
- return $(((o = l.server) == null ? void 0 : o.url) || l.operation.path, e.domain);
64
+ return L(((o = l.server) == null ? void 0 : o.url) || l.operation.path, e.domain);
69
65
  }
70
66
  ).map((e) => ({
71
67
  key: e.name,
@@ -78,39 +74,43 @@ const z = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:
78
74
  },
79
75
  enabled: !0
80
76
  }))
81
- ), C = () => l.operation.summary ? l.operation.summary : l.operation.path.replace(V.PROTOCOL, "") ? l.operation.path.replace(V.PROTOCOL, "") : "Request Name";
82
- return (e, o) => (m(), b(Q, {
77
+ ), E = () => l.operation.summary ? l.operation.summary : l.operation.path.replace(q.PROTOCOL, "") ? l.operation.path.replace(q.PROTOCOL, "") : "Request Name", b = w();
78
+ return (e, o) => (m(), V($, {
83
79
  "aria-label": `Request: ${e.operation.summary}`
84
80
  }, {
85
- title: v(() => [
86
- d("div", z, [
87
- t(u) !== "modal" ? (m(), c("label", G)) : w("", !0),
88
- t(u) !== "modal" ? (m(), c("input", {
81
+ title: d(() => [
82
+ v("div", G, [
83
+ n(u) !== "modal" ? (m(), c("label", {
84
+ key: 0,
85
+ class: "pointer-events-auto absolute left-0 top-0 h-full w-full cursor-text opacity-0",
86
+ for: n(b)
87
+ }, null, 8, X)) : A("", !0),
88
+ n(u) !== "modal" ? (m(), c("input", {
89
89
  key: 1,
90
- id: "requestname",
90
+ id: n(b),
91
91
  class: "text-c-1 group-hover-input pl-1.25 md:-ml-1.25 pointer-events-auto relative z-10 -ml-0.5 h-8 w-full rounded has-[:focus-visible]:outline",
92
- placeholder: C(),
92
+ placeholder: E(),
93
93
  value: e.operation.summary,
94
- onInput: g
95
- }, null, 40, X)) : (m(), c("span", J, I(e.operation.summary), 1))
94
+ onInput: C
95
+ }, null, 40, J)) : (m(), c("span", Y, K(e.operation.summary), 1))
96
96
  ]),
97
- n(D, {
97
+ t(Q, {
98
98
  modelValue: a.value,
99
- "onUpdate:modelValue": o[0] || (o[0] = (R) => a.value = R),
99
+ "onUpdate:modelValue": o[0] || (o[0] = (O) => a.value = O),
100
100
  filterIds: r.value,
101
101
  filters: h.value
102
102
  }, null, 8, ["modelValue", "filterIds", "filters"])
103
103
  ]),
104
- default: v(() => [
105
- d("div", {
104
+ default: d(() => [
105
+ v("div", {
106
106
  id: r.value.All,
107
107
  class: "request-section-content custom-scroll relative flex flex-1 flex-col divide-y",
108
108
  role: a.value === "All" ? "tabpanel" : "none"
109
109
  }, [
110
- e.collection && e.workspace && (t(u) !== "modal" || Object.keys(t(S) ?? {}).length) ? i((m(), b(F, {
110
+ e.collection && e.workspace && (n(u) !== "modal" || Object.keys(n(B) ?? {}).length) ? i((m(), V(M, {
111
111
  key: 0,
112
- class: "request-section-content-auth border-b-0",
113
112
  id: r.value.Auth,
113
+ class: "request-section-content-auth border-b-0",
114
114
  collection: e.collection,
115
115
  envVariables: e.envVariables,
116
116
  environment: e.environment,
@@ -126,10 +126,10 @@ const z = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:
126
126
  s,
127
127
  !k.value && (a.value === "All" || a.value === "Auth")
128
128
  ]
129
- ]) : w("", !0),
130
- i(n(j, {
131
- class: "request-section-content-path-params",
129
+ ]) : A("", !0),
130
+ i(t(F, {
132
131
  id: r.value.Variables,
132
+ class: "request-section-content-path-params",
133
133
  envVariables: e.envVariables,
134
134
  environment: e.environment,
135
135
  example: e.example,
@@ -145,16 +145,17 @@ const z = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:
145
145
  (a.value === "All" || a.value === "Variables") && e.example.parameters.path.length
146
146
  ]
147
147
  ]),
148
- i(n(y, {
149
- class: "request-section-content-cookies",
148
+ i(t(y, {
150
149
  id: r.value.Cookies,
150
+ class: "request-section-content-cookies",
151
151
  envVariables: e.envVariables,
152
152
  environment: e.environment,
153
153
  example: e.example,
154
154
  invalidParams: e.invalidParams,
155
+ label: "Cookie",
155
156
  operation: e.operation,
156
157
  paramKey: "cookies",
157
- readOnlyEntries: B.value,
158
+ readOnlyEntries: R.value,
158
159
  role: a.value === "All" ? "none" : "tabpanel",
159
160
  title: "Cookies",
160
161
  workspace: e.workspace,
@@ -162,13 +163,14 @@ const z = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:
162
163
  }, null, 8, ["id", "envVariables", "environment", "example", "invalidParams", "operation", "readOnlyEntries", "role", "workspace"]), [
163
164
  [s, a.value === "All" || a.value === "Cookies"]
164
165
  ]),
165
- i(n(y, {
166
- class: "request-section-content-headers",
166
+ i(t(y, {
167
167
  id: r.value.Headers,
168
+ class: "request-section-content-headers",
168
169
  envVariables: e.envVariables,
169
170
  environment: e.environment,
170
171
  example: e.example,
171
172
  invalidParams: e.invalidParams,
173
+ label: "Header",
172
174
  operation: e.operation,
173
175
  paramKey: "headers",
174
176
  role: a.value === "All" ? "none" : "tabpanel",
@@ -177,13 +179,14 @@ const z = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:
177
179
  }, null, 8, ["id", "envVariables", "environment", "example", "invalidParams", "operation", "role", "workspace"]), [
178
180
  [s, a.value === "All" || a.value === "Headers"]
179
181
  ]),
180
- i(n(y, {
181
- class: "request-section-content-query",
182
+ i(t(y, {
182
183
  id: r.value.Query,
184
+ class: "request-section-content-query",
183
185
  envVariables: e.envVariables,
184
186
  environment: e.environment,
185
187
  example: e.example,
186
188
  invalidParams: e.invalidParams,
189
+ label: "Parameter",
187
190
  operation: e.operation,
188
191
  paramKey: "query",
189
192
  role: a.value === "All" ? "none" : "tabpanel",
@@ -192,9 +195,9 @@ const z = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:
192
195
  }, null, 8, ["id", "envVariables", "environment", "example", "invalidParams", "operation", "role", "workspace"]), [
193
196
  [s, a.value === "All" || a.value === "Query"]
194
197
  ]),
195
- i(n(L, {
196
- class: "request-section-content-body",
198
+ i(t(j, {
197
199
  id: r.value.Body,
200
+ class: "request-section-content-body",
198
201
  envVariables: e.envVariables,
199
202
  environment: e.environment,
200
203
  example: e.example,
@@ -205,13 +208,13 @@ const z = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:
205
208
  }, null, 8, ["id", "envVariables", "environment", "example", "operation", "role", "workspace"]), [
206
209
  [
207
210
  s,
208
- e.operation.method && (a.value === "All" || a.value === "Body") && t(f)(e.operation.method)
211
+ e.operation.method && (a.value === "All" || a.value === "Body") && n(f)(e.operation.method)
209
212
  ]
210
213
  ]),
211
- o[1] || (o[1] = d("div", { class: "-my-0.25 flex flex-grow" }, null, -1)),
212
- n(t(K), null, {
213
- default: v(() => [
214
- n(M, {
214
+ o[1] || (o[1] = v("div", { class: "-my-0.25 flex flex-grow" }, null, -1)),
215
+ t(n(U), null, {
216
+ default: d(() => [
217
+ t(T, {
215
218
  class: "request-section-content-code-example",
216
219
  collection: e.collection,
217
220
  example: e.example,
@@ -222,12 +225,12 @@ const z = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:
222
225
  ]),
223
226
  _: 1
224
227
  })
225
- ], 8, Y)
228
+ ], 8, Z)
226
229
  ]),
227
230
  _: 1
228
231
  }, 8, ["aria-label"]));
229
232
  }
230
233
  });
231
234
  export {
232
- ue as default
235
+ pe as default
233
236
  };
@@ -16,6 +16,7 @@ type __VLS_Props = {
16
16
  envVariables: EnvVariable[];
17
17
  workspace: Workspace;
18
18
  invalidParams?: Set<string>;
19
+ label?: string;
19
20
  };
20
21
  declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
21
22
  updateRow: (idx: number, field: "value" | "key", value: string) => any;
@@ -1 +1 @@
1
- {"version":3,"file":"RequestTable.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestTable.vue"],"names":[],"mappings":"AAyPA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AACzE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAA;AAC9E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AACrE,OAAO,EAAc,KAAK,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAQ9D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAO1D,KAAK,WAAW,GAAG;IACf,KAAK,CAAC,EAAE,CAAC,uBAAuB,GAAG;QAAE,KAAK,CAAC,EAAE,gBAAgB,CAAA;KAAE,CAAC,EAAE,CAAA;IAClE,8BAA8B;IAC9B,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,WAAW,EAAE,WAAW,CAAA;IACxB,YAAY,EAAE,WAAW,EAAE,CAAA;IAC3B,SAAS,EAAE,SAAS,CAAA;IACpB,aAAa,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;CAC5B,CAAC;;;;;;;;;;;;;;;;;;;;yBARsB,OAAO;sBACV,OAAO;cACf,OAAO;gBACL,OAAO;;AAghBxB,wBASG"}
1
+ {"version":3,"file":"RequestTable.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestTable.vue"],"names":[],"mappings":"AAqPA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AACzE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAA;AAC9E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AACrE,OAAO,EAAc,KAAK,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAQ9D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAO1D,KAAK,WAAW,GAAG;IACf,KAAK,CAAC,EAAE,CAAC,uBAAuB,GAAG;QAAE,KAAK,CAAC,EAAE,gBAAgB,CAAA;KAAE,CAAC,EAAE,CAAA;IAClE,8BAA8B;IAC9B,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,WAAW,EAAE,WAAW,CAAA;IACxB,YAAY,EAAE,WAAW,EAAE,CAAA;IAC3B,SAAS,EAAE,SAAS,CAAA;IACpB,aAAa,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAC;;;;;;;;;;;;;;;;;;;;yBATsB,OAAO;sBACV,OAAO;cACf,OAAO;gBACL,OAAO;;AA6gBxB,wBASG"}
@@ -1,7 +1,7 @@
1
1
  import o from "./RequestTable.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-5c4132b8"]]);
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-5b22d4e0"]]);
5
5
  export {
6
6
  m as default
7
7
  };
@@ -1,18 +1,18 @@
1
- import { defineComponent as _, openBlock as d, createBlock as p, withCtx as n, createVNode as t, createElementVNode as s, createTextVNode as k, createElementBlock as m, Fragment as f, renderList as I, normalizeClass as w, unref as i, toDisplayString as V, createCommentVNode as x } from "vue";
2
- import { ScalarTooltip as z, ScalarIcon as g, ScalarButton as D } from "@scalar/components";
3
- import { RouterLink as E } from "vue-router";
4
- import B from "../../../components/CodeInput/CodeInput.vue.js";
5
- import q from "../../../components/DataTable/DataTable.vue.js";
6
- import c from "../../../components/DataTable/DataTableCell.vue.js";
1
+ import { defineComponent as I, openBlock as r, createBlock as p, withCtx as n, createVNode as t, createTextVNode as c, toDisplayString as m, createElementBlock as f, Fragment as w, renderList as _, normalizeClass as V, unref as u, createElementVNode as i, createCommentVNode as g } from "vue";
2
+ import { ScalarTooltip as z, ScalarIcon as B, ScalarButton as q } from "@scalar/components";
3
+ import { RouterLink as D } from "vue-router";
4
+ import x from "../../../components/CodeInput/CodeInput.vue.js";
5
+ import E from "../../../components/DataTable/DataTable.vue.js";
6
+ import v from "../../../components/DataTable/DataTableCell.vue.js";
7
7
  import G from "../../../components/DataTable/DataTableCheckbox.vue.js";
8
- import v from "../../../components/DataTable/DataTableHeader.vue.js";
9
- import R from "../../../components/DataTable/DataTableRow.vue.js";
10
- import { parameterIsInvalid as N, hasItemProperties as C } from "../libs/request.js";
8
+ import k from "../../../components/DataTable/DataTableHeader.vue.js";
9
+ import h from "../../../components/DataTable/DataTableRow.vue.js";
10
+ import { parameterIsInvalid as N, hasItemProperties as R } from "../libs/request.js";
11
11
  import P from "./RequestTableTooltip.vue.js";
12
- const j = { class: "contents" }, O = { class: "sr-only" }, A = { class: "text-c-2 filemask flex w-full max-w-[100%] items-end justify-end overflow-hidden p-1" }, K = ["onClick"], L = {
12
+ const j = { class: "text-c-2 filemask flex w-full max-w-[100%] items-end justify-end overflow-hidden p-1" }, O = ["onClick"], A = {
13
13
  key: 1,
14
14
  class: "p-0.5"
15
- }, oe = /* @__PURE__ */ _({
15
+ }, le = /* @__PURE__ */ I({
16
16
  __name: "RequestTable",
17
17
  props: {
18
18
  items: {},
@@ -23,177 +23,174 @@ const j = { class: "contents" }, O = { class: "sr-only" }, A = { class: "text-c-
23
23
  environment: {},
24
24
  envVariables: {},
25
25
  workspace: {},
26
- invalidParams: {}
26
+ invalidParams: {},
27
+ label: {}
27
28
  },
28
29
  emits: ["updateRow", "toggleRow", "addRow", "deleteRow", "inputFocus", "inputBlur", "uploadFile", "removeFile"],
29
- setup(h, { emit: F }) {
30
- const b = h, r = F, U = ["", "", "36px"], y = (a, l, e) => {
31
- r("updateRow", a, l, e);
32
- }, S = (a) => {
33
- r("uploadFile", a);
34
- }, $ = (a) => Array.isArray(a.default) && a.default.length === 1 ? a.default[0] : a.default;
35
- return (a, l) => (d(), p(q, {
30
+ setup(C, { emit: F }) {
31
+ const b = C, s = F, U = ["", "", "36px"], y = (e, a, l) => {
32
+ s("updateRow", e, a, l);
33
+ }, S = (e) => {
34
+ s("uploadFile", e);
35
+ }, $ = (e) => Array.isArray(e.default) && e.default.length === 1 ? e.default[0] : e.default;
36
+ return (e, a) => (r(), p(E, {
36
37
  class: "group/table flex-1",
37
38
  columns: U
38
39
  }, {
39
40
  default: n(() => [
40
- t(R, { class: "sr-only !block" }, {
41
+ t(h, { class: "sr-only !block" }, {
41
42
  default: n(() => [
42
- t(v, null, {
43
- default: n(() => l[4] || (l[4] = [
44
- s("span", { class: "sr-only" }, "Enabled", -1)
45
- ])),
43
+ t(k, null, {
44
+ default: n(() => [
45
+ c(m(e.label) + " Enabled", 1)
46
+ ]),
46
47
  _: 1
47
48
  }),
48
- t(v, null, {
49
- default: n(() => l[5] || (l[5] = [
50
- k("Key")
51
- ])),
49
+ t(k, null, {
50
+ default: n(() => [
51
+ c(m(e.label) + " Key", 1)
52
+ ]),
52
53
  _: 1
53
54
  }),
54
- t(v, null, {
55
- default: n(() => l[6] || (l[6] = [
56
- k("Value")
57
- ])),
55
+ t(k, null, {
56
+ default: n(() => [
57
+ c(m(e.label) + " Value", 1)
58
+ ]),
58
59
  _: 1
59
60
  })
60
61
  ]),
61
62
  _: 1
62
63
  }),
63
- (d(!0), m(f, null, I(a.items, (e, u) => (d(), p(R, {
64
- id: e.key,
65
- key: u,
66
- class: w({
67
- alert: i(N)(e).value,
68
- error: a.invalidParams && a.invalidParams.has(e.key)
64
+ (r(!0), f(w, null, _(e.items, (l, d) => (r(), p(h, {
65
+ id: l.key,
66
+ key: d,
67
+ class: V({
68
+ alert: u(N)(l).value,
69
+ error: e.invalidParams && e.invalidParams.has(l.key)
69
70
  })
70
71
  }, {
71
72
  default: n(() => [
72
- s("label", j, [
73
- a.isGlobal ? (d(), p(i(E), {
74
- key: 0,
75
- class: "!border-r-1/2 border-t-1/2 text-c-2 flex items-center justify-center",
76
- to: e.route ?? {}
77
- }, {
78
- default: n(() => [
79
- l[8] || (l[8] = s("span", { class: "sr-only" }, "Global", -1)),
80
- t(i(z), {
81
- as: "div",
82
- side: "top"
83
- }, {
84
- trigger: n(() => [
85
- t(i(g), {
86
- class: "text-c-1",
87
- icon: "Globe",
88
- size: "xs"
89
- })
90
- ]),
91
- content: n(() => l[7] || (l[7] = [
92
- s("div", { class: "w-content bg-b-1 text-xxs text-c-1 z-100 pointer-events-none z-10 grid max-w-[320px] gap-1.5 rounded p-2 leading-5 shadow-lg" }, [
93
- s("div", { class: "text-c-1 flex items-center" }, [
94
- s("span", { class: "text-pretty" }, " Global cookies are shared across the whole workspace. ")
95
- ])
96
- ], -1)
97
- ])),
98
- _: 1
99
- })
100
- ]),
101
- _: 2
102
- }, 1032, ["to"])) : (d(), m(f, { key: 1 }, [
103
- s("span", O, " Row " + V(e.enabled ? "Enabled" : "Disabled"), 1),
104
- t(G, {
105
- class: "!border-r-1/2",
106
- disabled: b.hasCheckboxDisabled,
107
- modelValue: e.enabled,
108
- "onUpdate:modelValue": (o) => r("toggleRow", u, o)
109
- }, null, 8, ["disabled", "modelValue", "onUpdate:modelValue"])
110
- ], 64))
111
- ]),
112
- t(c, null, {
73
+ e.isGlobal ? (r(), p(u(D), {
74
+ key: 0,
75
+ class: "!border-r-1/2 border-t-1/2 text-c-2 flex items-center justify-center",
76
+ to: l.route ?? {}
77
+ }, {
78
+ default: n(() => [
79
+ a[5] || (a[5] = i("span", { class: "sr-only" }, "Global", -1)),
80
+ t(u(z), {
81
+ as: "div",
82
+ side: "top"
83
+ }, {
84
+ trigger: n(() => [
85
+ t(u(B), {
86
+ class: "text-c-1",
87
+ icon: "Globe",
88
+ size: "xs"
89
+ })
90
+ ]),
91
+ content: n(() => a[4] || (a[4] = [
92
+ i("div", { class: "w-content bg-b-1 text-xxs text-c-1 z-100 pointer-events-none z-10 grid max-w-[320px] gap-1.5 rounded p-2 leading-5 shadow-lg" }, [
93
+ i("div", { class: "text-c-1 flex items-center" }, [
94
+ i("span", { class: "text-pretty" }, " Global cookies are shared across the whole workspace. ")
95
+ ])
96
+ ], -1)
97
+ ])),
98
+ _: 1
99
+ })
100
+ ]),
101
+ _: 2
102
+ }, 1032, ["to"])) : (r(), p(G, {
103
+ key: 1,
104
+ class: "!border-r-1/2",
105
+ disabled: b.hasCheckboxDisabled,
106
+ modelValue: l.enabled,
107
+ "onUpdate:modelValue": (o) => s("toggleRow", d, o)
108
+ }, null, 8, ["disabled", "modelValue", "onUpdate:modelValue"])),
109
+ t(v, null, {
113
110
  default: n(() => [
114
- t(B, {
111
+ t(x, {
115
112
  disableCloseBrackets: "",
116
113
  disabled: b.isReadOnly,
117
114
  disableEnter: "",
118
115
  disableTabIndent: "",
119
- envVariables: a.envVariables,
120
- environment: a.environment,
121
- modelValue: e.key,
116
+ envVariables: e.envVariables,
117
+ environment: e.environment,
118
+ modelValue: l.key,
122
119
  placeholder: "Key",
123
- required: !!e.required,
124
- workspace: a.workspace,
125
- onBlur: l[0] || (l[0] = (o) => r("inputBlur")),
126
- onFocus: l[1] || (l[1] = (o) => r("inputFocus")),
127
- onSelectVariable: (o) => y(u, "key", o),
128
- "onUpdate:modelValue": (o) => r("updateRow", u, "key", o)
120
+ required: !!l.required,
121
+ workspace: e.workspace,
122
+ onBlur: a[0] || (a[0] = (o) => s("inputBlur")),
123
+ onFocus: a[1] || (a[1] = (o) => s("inputFocus")),
124
+ onSelectVariable: (o) => y(d, "key", o),
125
+ "onUpdate:modelValue": (o) => s("updateRow", d, "key", o)
129
126
  }, null, 8, ["disabled", "envVariables", "environment", "modelValue", "required", "workspace", "onSelectVariable", "onUpdate:modelValue"])
130
127
  ]),
131
128
  _: 2
132
129
  }, 1024),
133
- t(c, null, {
130
+ t(v, null, {
134
131
  default: n(() => [
135
- t(B, {
136
- class: w({
137
- "pr-6": i(C)(e)
132
+ t(x, {
133
+ class: V({
134
+ "pr-6": u(R)(l)
138
135
  }),
139
- default: e.default,
136
+ default: l.default,
140
137
  disableCloseBrackets: "",
141
138
  disabled: b.isReadOnly,
142
139
  disableEnter: "",
143
140
  disableTabIndent: "",
144
- enum: e.enum ?? [],
145
- envVariables: a.envVariables,
146
- environment: a.environment,
147
- examples: e.examples ?? [],
148
- max: e.maximum,
149
- min: e.minimum,
150
- modelValue: e.value,
151
- nullable: !!e.nullable,
141
+ enum: l.enum ?? [],
142
+ envVariables: e.envVariables,
143
+ environment: e.environment,
144
+ examples: l.examples ?? [],
145
+ max: l.maximum,
146
+ min: l.minimum,
147
+ modelValue: l.value,
148
+ nullable: !!l.nullable,
152
149
  placeholder: "Value",
153
- type: e.type,
154
- workspace: a.workspace,
155
- onBlur: l[2] || (l[2] = (o) => r("inputBlur")),
156
- onFocus: l[3] || (l[3] = (o) => r("inputFocus")),
157
- onSelectVariable: (o) => y(u, "value", o),
158
- "onUpdate:modelValue": (o) => r("updateRow", u, "value", o)
150
+ type: l.type,
151
+ workspace: e.workspace,
152
+ onBlur: a[2] || (a[2] = (o) => s("inputBlur")),
153
+ onFocus: a[3] || (a[3] = (o) => s("inputFocus")),
154
+ onSelectVariable: (o) => y(d, "value", o),
155
+ "onUpdate:modelValue": (o) => s("updateRow", d, "value", o)
159
156
  }, {
160
157
  icon: n(() => [
161
- i(C)(e) ? (d(), p(P, {
158
+ u(R)(l) ? (r(), p(P, {
162
159
  key: 0,
163
- item: { ...e, default: $(e) }
164
- }, null, 8, ["item"])) : x("", !0)
160
+ item: { ...l, default: $(l) }
161
+ }, null, 8, ["item"])) : g("", !0)
165
162
  ]),
166
163
  _: 2
167
164
  }, 1032, ["class", "default", "disabled", "enum", "envVariables", "environment", "examples", "max", "min", "modelValue", "nullable", "type", "workspace", "onSelectVariable", "onUpdate:modelValue"])
168
165
  ]),
169
166
  _: 2
170
167
  }, 1024),
171
- a.showUploadButton ? (d(), p(c, {
172
- key: 0,
168
+ e.showUploadButton ? (r(), p(v, {
169
+ key: 2,
173
170
  class: "group/upload flex items-center justify-center whitespace-nowrap"
174
171
  }, {
175
172
  default: n(() => {
176
173
  var o;
177
174
  return [
178
- e.file ? (d(), m(f, { key: 0 }, [
179
- s("div", A, [
180
- s("span", null, V((o = e.file) == null ? void 0 : o.name), 1)
175
+ l.file ? (r(), f(w, { key: 0 }, [
176
+ i("div", j, [
177
+ i("span", null, m((o = l.file) == null ? void 0 : o.name), 1)
181
178
  ]),
182
- s("button", {
179
+ i("button", {
183
180
  class: "bg-b-2 centered-x centered-y absolute hidden w-[calc(100%_-_8px)] rounded p-0.5 text-center text-xs font-medium group-hover/upload:block",
184
181
  type: "button",
185
- onClick: (T) => r("removeFile", u)
186
- }, " Delete ", 8, K)
187
- ], 64)) : (d(), m("div", L, [
188
- t(i(D), {
182
+ onClick: (T) => s("removeFile", d)
183
+ }, " Delete ", 8, O)
184
+ ], 64)) : (r(), f("div", A, [
185
+ t(u(q), {
189
186
  class: "bg-b-2 hover:bg-b-3 text-c-2 h-fit border-0 py-px shadow-none",
190
187
  size: "sm",
191
188
  variant: "outlined",
192
- onClick: (T) => S(u)
189
+ onClick: (T) => S(d)
193
190
  }, {
194
191
  default: n(() => [
195
- l[9] || (l[9] = s("span", null, "Upload File", -1)),
196
- t(i(g), {
192
+ a[6] || (a[6] = i("span", null, "Upload File", -1)),
193
+ t(u(B), {
197
194
  class: "ml-1",
198
195
  icon: "UploadSimple",
199
196
  size: "xs",
@@ -206,7 +203,7 @@ const j = { class: "contents" }, O = { class: "sr-only" }, A = { class: "text-c-
206
203
  ];
207
204
  }),
208
205
  _: 2
209
- }, 1024)) : x("", !0)
206
+ }, 1024)) : g("", !0)
210
207
  ]),
211
208
  _: 2
212
209
  }, 1032, ["id", "class"]))), 128))
@@ -216,5 +213,5 @@ const j = { class: "contents" }, O = { class: "sr-only" }, A = { class: "text-c-
216
213
  }
217
214
  });
218
215
  export {
219
- oe as default
216
+ le as default
220
217
  };
@@ -1 +1 @@
1
- {"version":3,"file":"RequestSidebar.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Request/RequestSidebar.vue"],"names":[],"mappings":";;;cA0jBuC,MAAM;aAAO,MAAM;;;;;cAAnB,MAAM;aAAO,MAAM;;;AAkyB1D,wBAMG"}
1
+ {"version":3,"file":"RequestSidebar.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Request/RequestSidebar.vue"],"names":[],"mappings":";;;cA4jBuC,MAAM;aAAO,MAAM;;;;;cAAnB,MAAM;aAAO,MAAM;;;AAoyB1D,wBAMG"}