@scalar/api-client 2.3.34 → 2.4.1

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 (94) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/dist/components/CodeInput/CodeInput.vue.js +2 -2
  3. package/dist/components/CodeInput/CodeInput.vue2.js +1 -1
  4. package/dist/components/CommandPalette/CommandPaletteImport.vue.d.ts.map +1 -1
  5. package/dist/components/CommandPalette/CommandPaletteImport.vue.js +74 -89
  6. package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts +4 -0
  7. package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts.map +1 -1
  8. package/dist/components/Server/ServerVariablesForm.vue.d.ts +2 -0
  9. package/dist/components/Server/ServerVariablesForm.vue.d.ts.map +1 -1
  10. package/dist/components/Server/ServerVariablesForm.vue.js +19 -18
  11. package/dist/components/TopNav/TopNavItem.vue.d.ts.map +1 -1
  12. package/dist/components/TopNav/TopNavItem.vue.js +3 -3
  13. package/dist/components/TopNav/TopNavItem.vue2.js +46 -54
  14. package/dist/components/ViewLayout/ViewLayoutCollapse.vue.js +1 -1
  15. package/dist/hooks/useClientConfig.d.ts +72 -6
  16. package/dist/hooks/useClientConfig.d.ts.map +1 -1
  17. package/dist/layouts/App/ApiClientApp.vue.d.ts +1 -1
  18. package/dist/layouts/App/ApiClientApp.vue.d.ts.map +1 -1
  19. package/dist/layouts/App/ApiClientApp.vue.js +45 -40
  20. package/dist/layouts/App/create-api-client-app.d.ts +72 -52
  21. package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
  22. package/dist/layouts/Modal/create-api-client-modal.d.ts +144 -104
  23. package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
  24. package/dist/layouts/Web/ApiClientWeb.vue.d.ts.map +1 -1
  25. package/dist/layouts/Web/ApiClientWeb.vue.js +49 -44
  26. package/dist/layouts/Web/create-api-client-web.d.ts +72 -52
  27. package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
  28. package/dist/libs/create-client.d.ts +72 -52
  29. package/dist/libs/create-client.d.ts.map +1 -1
  30. package/dist/libs/create-client.js +53 -49
  31. package/dist/libs/electron.d.ts +5 -0
  32. package/dist/libs/electron.d.ts.map +1 -0
  33. package/dist/libs/electron.js +4 -0
  34. package/dist/libs/find-request.d.ts +2 -0
  35. package/dist/libs/find-request.d.ts.map +1 -1
  36. package/dist/libs/send-request/create-fetch-query-params.d.ts +10 -3
  37. package/dist/libs/send-request/create-fetch-query-params.d.ts.map +1 -1
  38. package/dist/libs/send-request/create-fetch-query-params.js +28 -6
  39. package/dist/libs/send-request/create-request-operation.d.ts +3 -1
  40. package/dist/libs/send-request/create-request-operation.d.ts.map +1 -1
  41. package/dist/libs/send-request/create-request-operation.js +91 -87
  42. package/dist/libs/send-request/create-request-operation.test.d.ts +2 -0
  43. package/dist/libs/send-request/create-request-operation.test.d.ts.map +1 -1
  44. package/dist/plugins/hooks/usePluginManager.d.ts +8 -0
  45. package/dist/plugins/hooks/usePluginManager.d.ts.map +1 -0
  46. package/dist/plugins/hooks/usePluginManager.js +10 -0
  47. package/dist/plugins/index.d.ts +3 -0
  48. package/dist/plugins/index.d.ts.map +1 -0
  49. package/dist/plugins/index.js +7 -0
  50. package/dist/plugins/plugin-manager.d.ts +28 -0
  51. package/dist/plugins/plugin-manager.d.ts.map +1 -0
  52. package/dist/plugins/plugin-manager.js +24 -0
  53. package/dist/store/active-entities.d.ts +2 -0
  54. package/dist/store/active-entities.d.ts.map +1 -1
  55. package/dist/store/collections.d.ts +4 -4
  56. package/dist/store/cookies.d.ts +4 -4
  57. package/dist/store/environment.d.ts +4 -4
  58. package/dist/store/request-example.d.ts +4 -4
  59. package/dist/store/requests.d.ts +26 -4
  60. package/dist/store/requests.d.ts.map +1 -1
  61. package/dist/store/security-schemes.d.ts +24 -24
  62. package/dist/store/store.d.ts +72 -52
  63. package/dist/store/store.d.ts.map +1 -1
  64. package/dist/store/tags.d.ts +4 -4
  65. package/dist/store/workspace.d.ts +4 -4
  66. package/dist/style.css +1 -1
  67. package/dist/views/Request/Request.vue.d.ts.map +1 -1
  68. package/dist/views/Request/Request.vue.js +2 -2
  69. package/dist/views/Request/RequestRoot.vue.d.ts.map +1 -1
  70. package/dist/views/Request/RequestRoot.vue.js +1 -1
  71. package/dist/views/Request/RequestRoot.vue2.js +47 -45
  72. package/dist/views/Request/RequestSection/RequestParams.vue.d.ts.map +1 -1
  73. package/dist/views/Request/RequestSection/RequestParams.vue.js +61 -70
  74. package/dist/views/Request/RequestSection/RequestSection.vue.d.ts.map +1 -1
  75. package/dist/views/Request/RequestSection/RequestSection.vue.js +2 -2
  76. package/dist/views/Request/RequestSection/RequestSection.vue2.js +92 -77
  77. package/dist/views/Request/RequestSection/RequestTable.vue.d.ts.map +1 -1
  78. package/dist/views/Request/RequestSection/RequestTable.vue.js +4 -4
  79. package/dist/views/Request/RequestSection/RequestTable.vue2.js +59 -65
  80. package/dist/views/Request/RequestSection/RequestTableTooltip.vue.d.ts.map +1 -1
  81. package/dist/views/Request/RequestSection/RequestTableTooltip.vue.js +1 -1
  82. package/dist/views/Request/RequestSection/RequestTableTooltip.vue2.js +34 -35
  83. package/dist/views/Request/RequestSection/types/post-response.d.ts +7 -0
  84. package/dist/views/Request/RequestSection/types/post-response.d.ts.map +1 -0
  85. package/dist/views/Request/RequestSidebarItem.vue.d.ts.map +1 -1
  86. package/dist/views/Request/RequestSidebarItem.vue.js +3 -3
  87. package/dist/views/Request/RequestSidebarItem.vue2.js +132 -134
  88. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  89. package/dist/views/Request/ResponseSection/ResponseSection.vue.d.ts.map +1 -1
  90. package/dist/views/Request/ResponseSection/ResponseSection.vue.js +1 -1
  91. package/dist/views/Request/ResponseSection/ResponseSection.vue2.js +82 -70
  92. package/dist/views/Request/components/WorkspaceDropdown.vue.d.ts.map +1 -1
  93. package/dist/views/Request/components/WorkspaceDropdown.vue.js +80 -114
  94. package/package.json +25 -20
@@ -1 +1 @@
1
- {"version":3,"file":"Request.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Request/Request.vue"],"names":[],"mappings":"AAsIA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAA;AASnF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8CAA8C,CAAA;AASrF,KAAK,WAAW,GAAG;IACjB,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IAC1B,0BAA0B,EAAE,0BAA0B,CAAA;IACtD,aAAa,CAAC,EAAE,iBAAiB,GAAG,IAAI,CAAA;CACzC,CAAC;;;cAG4C,MAAM;aAAO,MAAM;;;;cAAnB,MAAM;aAAO,MAAM;;;AAsNjE,wBAOG"}
1
+ {"version":3,"file":"Request.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Request/Request.vue"],"names":[],"mappings":"AAuIA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAA;AASnF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8CAA8C,CAAA;AASrF,KAAK,WAAW,GAAG;IACf,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IAC1B,0BAA0B,EAAE,0BAA0B,CAAA;IACtD,aAAa,CAAC,EAAE,iBAAiB,GAAG,IAAI,CAAA;CACzC,CAAC;;;cAI0C,MAAM;aAAO,MAAM;;;;cAAnB,MAAM;aAAO,MAAM;;;AAsNjE,wBAOG"}
@@ -1,7 +1,7 @@
1
1
  import o from "./Request.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-d620d52d"]]);
4
+ const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-351e187b"]]);
5
5
  export {
6
- m as default
6
+ p as default
7
7
  };
@@ -1 +1 @@
1
- {"version":3,"file":"RequestRoot.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Request/RequestRoot.vue"],"names":[],"mappings":";;cAkQ8C,MAAM;aAAO,MAAM;;;;cAAnB,MAAM;aAAO,MAAM;;;AAmTjE,wBAMG"}
1
+ {"version":3,"file":"RequestRoot.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Request/RequestRoot.vue"],"names":[],"mappings":";;cAuQ8C,MAAM;aAAO,MAAM;;;;cAAnB,MAAM;aAAO,MAAM;;;AAsTjE,wBAMG"}
@@ -1,7 +1,7 @@
1
1
  import o from "./RequestRoot.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-985ee6ae"]]);
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-fdd31891"]]);
5
5
  export {
6
6
  m as default
7
7
  };
@@ -1,67 +1,69 @@
1
- import { defineComponent as Q, ref as m, computed as F, onMounted as G, onBeforeUnmount as K, watch as X, createElementBlock as Y, openBlock as d, normalizeClass as g, unref as r, createBlock as B, createCommentVNode as T, createElementVNode as A, isRef as Z, createVNode as ee } from "vue";
2
- import { isDefined as te } from "@scalar/oas-utils/helpers";
3
- import { safeJSON as oe } from "@scalar/object-utils/parse";
4
- import { useToasts as re } from "@scalar/use-toasts";
5
- import { RouterView as se } from "vue-router";
6
- import ae from "../../components/Sidebar/SidebarToggle.vue.js";
7
- import { useClientConfig as le } from "../../hooks/useClientConfig.js";
8
- import { useSidebar as ne } from "../../hooks/useSidebar.js";
9
- import { validateParameters as ue } from "../../libs/validate-parameters.js";
10
- import { useActiveEntities as ie } from "../../store/active-entities.js";
11
- import { useOpenApiWatcher as ce } from "./hooks/useOpenApiWatcher.js";
12
- import me from "./RequestSidebar.vue.js";
13
- import { createRequestOperation as fe } from "../../libs/send-request/create-request-operation.js";
14
- import { ERRORS as de } from "../../libs/errors.js";
15
- import { useWorkspace as pe } from "../../store/store.js";
16
- import { useLayout as ve } from "../../hooks/useLayout.js";
17
- const Se = { class: "flex h-full" }, Re = { class: "flex h-full flex-1 flex-col" }, Ae = /* @__PURE__ */ Q({
1
+ import { defineComponent as F, ref as m, computed as G, onMounted as K, onBeforeUnmount as X, watch as Y, createElementBlock as Z, openBlock as d, normalizeClass as V, unref as r, createBlock as B, createCommentVNode as T, createElementVNode as A, isRef as ee, createVNode as te } from "vue";
2
+ import { isDefined as oe } from "@scalar/oas-utils/helpers";
3
+ import { safeJSON as re } from "@scalar/object-utils/parse";
4
+ import { useToasts as se } from "@scalar/use-toasts";
5
+ import { RouterView as ae } from "vue-router";
6
+ import le from "../../components/Sidebar/SidebarToggle.vue.js";
7
+ import { useClientConfig as ne } from "../../hooks/useClientConfig.js";
8
+ import { useSidebar as ue } from "../../hooks/useSidebar.js";
9
+ import { validateParameters as ie } from "../../libs/validate-parameters.js";
10
+ import { useActiveEntities as ce } from "../../store/active-entities.js";
11
+ import { useOpenApiWatcher as me } from "./hooks/useOpenApiWatcher.js";
12
+ import fe from "./RequestSidebar.vue.js";
13
+ import { usePluginManager as de } from "../../plugins/hooks/usePluginManager.js";
14
+ import { createRequestOperation as pe } from "../../libs/send-request/create-request-operation.js";
15
+ import { ERRORS as ve } from "../../libs/errors.js";
16
+ import { useWorkspace as Se } from "../../store/store.js";
17
+ import { useLayout as Re } from "../../hooks/useLayout.js";
18
+ const ye = { class: "flex h-full" }, qe = { class: "flex h-full flex-1 flex-col" }, Me = /* @__PURE__ */ F({
18
19
  __name: "RequestRoot",
19
20
  emits: ["newTab"],
20
- setup(ye) {
21
- const D = pe(), { toast: p } = re(), { layout: v } = ve(), P = le(), { isSidebarOpen: s } = ne(), {
21
+ setup(xe) {
22
+ const P = Se(), { toast: p } = se(), { layout: v } = Re(), D = ne(), { isSidebarOpen: s } = ue(), {
22
23
  activeCollection: l,
23
24
  activeExample: n,
24
25
  activeEnvironment: S,
25
26
  activeRequest: u,
26
27
  activeWorkspace: R,
27
- activeServer: z
28
- } = ie(), { cookies: I, requestHistory: J, showSidebar: y, securitySchemes: W, events: i } = D, j = m(), q = m(), f = m(/* @__PURE__ */ new Set()), x = m(null), b = F(
28
+ activeServer: M
29
+ } = ce(), { cookies: z, requestHistory: I, showSidebar: y, securitySchemes: J, events: i } = P, W = de(), j = m(), q = m(), f = m(/* @__PURE__ */ new Set()), x = m(null), b = G(
29
30
  () => {
30
31
  var e, t, o;
31
32
  return ((e = l.value) != null && e.useCollectionSecurity ? (t = l.value) == null ? void 0 : t.selectedSecuritySchemeUids : (o = u.value) == null ? void 0 : o.selectedSecuritySchemeUids) ?? [];
32
33
  }
33
34
  ), h = async () => {
34
- var U, _, w, O, c, V;
35
+ var N, U, _, w, c, O;
35
36
  if (!u.value || !n.value || !l.value)
36
37
  return;
37
- f.value = ue(n.value);
38
- const e = typeof S.value == "object" ? S.value.value : "{}", t = oe.parse(e);
38
+ f.value = ie(n.value);
39
+ const e = typeof S.value == "object" ? S.value.value : "{}", t = re.parse(e);
39
40
  t.error && console.error("INVALID ENVIRONMENT!");
40
- const o = t.error || typeof t.data != "object" ? {} : t.data ?? {}, a = ((U = R.value) == null ? void 0 : U.cookies.map((H) => I[H]).filter(te)) ?? [], $ = ((w = (_ = l.value) == null ? void 0 : _.info) == null ? void 0 : w.title) === "Drafts" ? void 0 : z.value, [k, E] = fe({
41
+ const o = t.error || typeof t.data != "object" ? {} : t.data ?? {}, a = ((N = R.value) == null ? void 0 : N.cookies.map((Q) => z[Q]).filter(oe)) ?? [], H = ((_ = (U = l.value) == null ? void 0 : U.info) == null ? void 0 : _.title) === "Drafts" ? void 0 : M.value, [k, E] = pe({
41
42
  request: u.value,
42
43
  example: n.value,
43
44
  selectedSecuritySchemeUids: b.value,
44
- proxyUrl: ((O = R.value) == null ? void 0 : O.proxyUrl) ?? "",
45
+ proxyUrl: ((w = R.value) == null ? void 0 : w.proxyUrl) ?? "",
45
46
  environment: o,
46
47
  globalCookies: a,
47
48
  status: i.requestStatus,
48
- securitySchemes: W,
49
- server: $
49
+ securitySchemes: J,
50
+ server: H,
51
+ pluginManager: W
50
52
  });
51
- if ((V = (c = P.value) == null ? void 0 : c.onRequestSent) == null || V.call(c, u.value.path ?? ""), k) {
53
+ if ((O = (c = D.value) == null ? void 0 : c.onRequestSent) == null || O.call(c, u.value.path ?? ""), k) {
52
54
  p(k.message, "error");
53
55
  return;
54
56
  }
55
57
  q.value = E.controller;
56
- const [C, N] = await E.sendRequest();
57
- x.value = N, C ? p(C.message, "error") : J.push(M(N));
58
+ const [g, C] = await E.sendRequest();
59
+ x.value = C, g ? p(g.message, "error") : I.push($(C));
58
60
  }, L = async () => {
59
61
  var e;
60
- return (e = q.value) == null ? void 0 : e.abort(de.REQUEST_ABORTED);
62
+ return (e = q.value) == null ? void 0 : e.abort(ve.REQUEST_ABORTED);
61
63
  };
62
- G(() => {
64
+ K(() => {
63
65
  i.executeRequest.on(h), i.cancelRequest.on(L);
64
- }), ce(), K(() => i.executeRequest.off(h)), X(
66
+ }), me(), X(() => i.executeRequest.off(h)), Y(
65
67
  () => {
66
68
  var e;
67
69
  return (e = n.value) == null ? void 0 : e.parameters;
@@ -71,7 +73,7 @@ const Se = { class: "flex h-full" }, Re = { class: "flex h-full flex-1 flex-col"
71
73
  },
72
74
  { deep: !0 }
73
75
  );
74
- const M = (e) => {
76
+ const $ = (e) => {
75
77
  var t;
76
78
  try {
77
79
  return structuredClone(e);
@@ -80,30 +82,30 @@ const Se = { class: "flex h-full" }, Re = { class: "flex h-full flex-1 flex-col"
80
82
  return (t = e.response) != null && t.data && (e.response.data instanceof Blob || e.response.data instanceof ArrayBuffer ? a.response.data = e.response.data : a.response.data = JSON.parse(JSON.stringify(e.response.data))), a;
81
83
  }
82
84
  };
83
- return (e, t) => (d(), Y("div", {
85
+ return (e, t) => (d(), Z("div", {
84
86
  ref_key: "element",
85
87
  ref: j,
86
- class: g(["bg-b-1 relative z-0 flex h-full flex-1 flex-col overflow-hidden pt-0", {
88
+ class: V(["bg-b-1 relative z-0 flex h-full flex-1 flex-col overflow-hidden pt-0", {
87
89
  "!mb-0 !mr-0 !border-0": r(v) === "modal"
88
90
  }])
89
91
  }, [
90
- r(y) ? (d(), B(ae, {
92
+ r(y) ? (d(), B(le, {
91
93
  key: 0,
92
94
  modelValue: r(s),
93
- "onUpdate:modelValue": t[0] || (t[0] = (o) => Z(s) ? s.value = o : null),
94
- class: g(["absolute left-3 top-2 z-50", [
95
+ "onUpdate:modelValue": t[0] || (t[0] = (o) => ee(s) ? s.value = o : null),
96
+ class: V(["absolute left-3 top-2 z-50", [
95
97
  { hidden: r(s) },
96
98
  { "xl:!flex": !r(s) },
97
99
  { "!flex": r(v) === "modal" }
98
100
  ]])
99
101
  }, null, 8, ["modelValue", "class"])) : T("", !0),
100
- A("div", Se, [
101
- r(y) ? (d(), B(me, {
102
+ A("div", ye, [
103
+ r(y) ? (d(), B(fe, {
102
104
  key: 0,
103
105
  onNewTab: t[1] || (t[1] = (o) => e.$emit("newTab", o))
104
106
  })) : T("", !0),
105
- A("div", Re, [
106
- ee(r(se), {
107
+ A("div", qe, [
108
+ te(r(ae), {
107
109
  invalidParams: f.value,
108
110
  selectedSecuritySchemeUids: b.value,
109
111
  requestResult: x.value
@@ -114,5 +116,5 @@ const Se = { class: "flex h-full" }, Re = { class: "flex h-full flex-1 flex-col"
114
116
  }
115
117
  });
116
118
  export {
117
- Ae as default
119
+ Me as default
118
120
  };
@@ -1 +1 @@
1
- {"version":3,"file":"RequestParams.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestParams.vue"],"names":[],"mappings":"AAkQA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AACzE,OAAO,EAEL,KAAK,cAAc,EACpB,MAAM,iCAAiC,CAAA;AACxC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AAErE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAIlD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAK1D,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,cAAc,CAAA;IACvB,WAAW,EAAE,WAAW,CAAA;IACxB,YAAY,EAAE,WAAW,EAAE,CAAA;IAC3B,SAAS,EAAE,SAAS,CAAA;IACpB,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,MAAM,cAAc,CAAC,YAAY,CAAC,CAAA;IAC5C,eAAe,CAAC,EAAE;QAChB,GAAG,EAAE,MAAM,CAAA;QACX,KAAK,EAAE,MAAM,CAAA;QACb,OAAO,EAAE,OAAO,CAAA;QAChB,KAAK,EAAE,gBAAgB,CAAA;KACxB,EAAE,CAAA;IACH,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;CAC3B,CAAC;;AAuXF,wBAOG"}
1
+ {"version":3,"file":"RequestParams.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestParams.vue"],"names":[],"mappings":"AAmPA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AACzE,OAAO,EAEL,KAAK,cAAc,EACpB,MAAM,iCAAiC,CAAA;AACxC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AAErE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAIlD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAK1D,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,cAAc,CAAA;IACvB,WAAW,EAAE,WAAW,CAAA;IACxB,YAAY,EAAE,WAAW,EAAE,CAAA;IAC3B,SAAS,EAAE,SAAS,CAAA;IACpB,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,MAAM,cAAc,CAAC,YAAY,CAAC,CAAA;IAC5C,eAAe,CAAC,EAAE;QAChB,GAAG,EAAE,MAAM,CAAA;QACX,KAAK,EAAE,MAAM,CAAA;QACb,OAAO,EAAE,OAAO,CAAA;QAChB,KAAK,EAAE,gBAAgB,CAAA;KACxB,EAAE,CAAA;IACH,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;CAC3B,CAAC;;AAwVF,wBAOG"}
@@ -1,10 +1,10 @@
1
- import { defineComponent as N, ref as h, computed as u, onMounted as z, nextTick as d, watch as A, createBlock as v, openBlock as f, withCtx as i, createElementVNode as r, createCommentVNode as P, createVNode as w, normalizeClass as B, unref as R, withModifiers as M, createTextVNode as V, toDisplayString as C } from "vue";
2
- import { ScalarTooltip as W, ScalarButton as D } from "@scalar/components";
3
- import { requestExampleParametersSchema as x } from "@scalar/oas-utils/entities/spec";
4
- import G from "../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
5
- import K from "./RequestTable.vue.js";
6
- import { useWorkspace as U } from "../../../store/store.js";
7
- const j = { class: "text-c-2 request-meta-buttons flex whitespace-nowrap opacity-0 group-hover/params:opacity-100 has-[:focus-visible]:opacity-100" }, F = { class: "sr-only" }, _ = /* @__PURE__ */ N({
1
+ import { defineComponent as S, computed as m, onMounted as N, nextTick as p, ref as x, watch as A, createBlock as d, openBlock as v, withCtx as i, createElementVNode as f, createCommentVNode as h, createVNode as k, normalizeClass as B, unref as P, withModifiers as M, createTextVNode as R, toDisplayString as w } from "vue";
2
+ import { ScalarTooltip as W, ScalarButton as z } from "@scalar/components";
3
+ import { requestExampleParametersSchema as V } from "@scalar/oas-utils/entities/spec";
4
+ import D from "../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
5
+ import C from "./RequestTable.vue.js";
6
+ import { useWorkspace as G } from "../../../store/store.js";
7
+ const U = { class: "text-c-2 request-meta-buttons flex whitespace-nowrap opacity-0 group-hover/params:opacity-100 has-[:focus-visible]:opacity-100" }, j = { class: "sr-only" }, I = /* @__PURE__ */ S({
8
8
  __name: "RequestParams",
9
9
  props: {
10
10
  example: {},
@@ -18,127 +18,118 @@ const j = { class: "text-c-2 request-meta-buttons flex whitespace-nowrap opacity
18
18
  invalidParams: {}
19
19
  },
20
20
  setup(t) {
21
- const { requestExampleMutators: s } = U(), y = h(!1), n = u(() => t.example.parameters[t.paramKey] ?? []);
22
- z(() => {
23
- d(() => {
24
- y.value = !0, b();
21
+ const { requestExampleMutators: s } = G(), n = m(() => t.example.parameters[t.paramKey] ?? []);
22
+ N(() => {
23
+ p(() => {
24
+ y();
25
25
  });
26
26
  });
27
- const m = () => {
28
- const e = x.parse({ enabled: !1 }), a = [...n.value, e];
27
+ const o = () => {
28
+ const e = V.parse({ enabled: !1 }), a = [...n.value, e];
29
29
  s.edit(t.example.uid, `parameters.${t.paramKey}`, a);
30
- }, c = h(null), $ = (e, a, o) => {
31
- const p = n.value;
32
- if (p.length > e) {
33
- const l = [...p];
30
+ }, u = x(null), K = (e, a, r) => {
31
+ const c = n.value;
32
+ if (c.length > e) {
33
+ const l = [...c];
34
34
  if (!l[e])
35
35
  return;
36
- l[e] = { ...l[e], [a]: o }, (l[e].key !== "" || l[e].value !== "") && (l[e].enabled = !0), l[e].key === "" && l[e].value === "" && l.splice(e, 1), s.edit(
36
+ l[e] = { ...l[e], [a]: r }, (l[e].key !== "" || l[e].value !== "") && (l[e].enabled = !0), l[e].key === "" && l[e].value === "" && l.splice(e, 1), s.edit(
37
37
  t.example.uid,
38
38
  `parameters.${t.paramKey}`,
39
39
  l
40
40
  );
41
41
  } else {
42
- const l = [x.parse({ [a]: o })];
43
- s.edit(t.example.uid, `parameters.${t.paramKey}`, l), d(() => {
44
- var k;
45
- if (!c.value)
42
+ const l = [V.parse({ [a]: r })];
43
+ s.edit(t.example.uid, `parameters.${t.paramKey}`, l), p(() => {
44
+ var g;
45
+ if (!u.value)
46
46
  return;
47
- (k = c.value.querySelectorAll("input")[a === "key" ? 0 : 1]) == null || k.focus();
47
+ (g = u.value.querySelectorAll("input")[a === "key" ? 0 : 1]) == null || g.focus();
48
48
  });
49
49
  }
50
- e === p.length - 1 && m();
51
- }, q = (e, a) => s.edit(
50
+ e === c.length - 1 && o();
51
+ }, $ = (e, a) => s.edit(
52
52
  t.example.uid,
53
53
  `parameters.${t.paramKey}.${e}.enabled`,
54
54
  a
55
- ), E = () => {
55
+ ), q = () => {
56
56
  const e = n.value.filter((a) => a.required);
57
57
  s.edit(
58
58
  t.example.uid,
59
59
  `parameters.${t.paramKey}`,
60
60
  e
61
- ), d(() => m());
62
- }, T = (e) => {
61
+ ), p(() => o());
62
+ }, E = (e) => {
63
63
  const a = n.value;
64
64
  if (a.length > e) {
65
- const o = [...a];
66
- o.splice(e, 1), s.edit(
65
+ const r = [...a];
66
+ r.splice(e, 1), s.edit(
67
67
  t.example.uid,
68
68
  `parameters.${t.paramKey}`,
69
- o
69
+ r
70
70
  );
71
71
  }
72
72
  };
73
- function b() {
73
+ function y() {
74
74
  if (n.value.length === 0)
75
- m();
75
+ o();
76
76
  else if (n.value.length >= 1) {
77
77
  const e = n.value[n.value.length - 1];
78
- e && e.key !== "" && e.value !== "" && m();
78
+ e && e.key !== "" && e.value !== "" && o();
79
79
  }
80
80
  }
81
- const O = u(
81
+ const T = m(
82
82
  () => n.value.filter((e) => e.key || e.value).length
83
- ), S = u(
84
- () => y.value && n.value.length > 1
85
- );
83
+ ), O = m(() => n.value.length > 1);
86
84
  A(
87
85
  () => t.example,
88
86
  (e, a) => {
89
- e !== a && b();
87
+ e !== a && y();
90
88
  },
91
89
  { immediate: !0 }
92
90
  );
93
- const g = u(() => (t.readOnlyEntries ?? []).length > 0);
94
- return (e, a) => (f(), v(G, {
91
+ const b = m(() => (t.readOnlyEntries ?? []).length > 0);
92
+ return (e, a) => (v(), d(D, {
95
93
  class: "group/params",
96
- itemCount: O.value
94
+ itemCount: T.value
97
95
  }, {
98
96
  title: i(() => [
99
- V(C(e.title), 1)
97
+ R(w(e.title), 1)
100
98
  ]),
101
99
  actions: i(() => [
102
- r("div", j, [
103
- S.value ? (f(), v(R(W), {
100
+ f("div", U, [
101
+ O.value ? (v(), d(P(W), {
104
102
  key: 0,
105
- side: "left",
106
- sideOffset: 6
103
+ content: "Clear optional parameters",
104
+ placement: "left"
107
105
  }, {
108
- trigger: i(() => [
109
- w(R(D), {
106
+ default: i(() => [
107
+ k(P(z), {
110
108
  class: "pr-0.75 pl-1 transition-none",
111
109
  size: "sm",
112
110
  variant: "ghost",
113
- onClick: M(E, ["stop"])
111
+ onClick: M(q, ["stop"])
114
112
  }, {
115
113
  default: i(() => [
116
- a[0] || (a[0] = V(" Clear ")),
117
- r("span", F, "All " + C(e.title), 1)
114
+ a[0] || (a[0] = R(" Clear ")),
115
+ f("span", j, "All " + w(e.title), 1)
118
116
  ]),
119
117
  _: 1
120
118
  })
121
119
  ]),
122
- content: i(() => a[1] || (a[1] = [
123
- r("div", { class: "w-content bg-b-1 text-xxs text-c-1 pointer-events-none z-10 grid min-w-48 gap-1.5 rounded p-2 leading-5 shadow-lg" }, [
124
- r("div", { class: "text-c-2 flex items-center" }, [
125
- r("span", null, "Clear optional parameters")
126
- ])
127
- ], -1)
128
- ])),
129
120
  _: 1
130
- })) : P("", !0)
121
+ })) : h("", !0)
131
122
  ])
132
123
  ]),
133
124
  default: i(() => [
134
- r("div", {
125
+ f("div", {
135
126
  ref_key: "tableWrapperRef",
136
- ref: c
127
+ ref: u
137
128
  }, [
138
- g.value ? (f(), v(K, {
129
+ b.value ? (v(), d(C, {
139
130
  key: 0,
140
131
  class: B(["flex-1", {
141
- "bg-mix-transparent bg-mix-amount-95 bg-c-3": g.value
132
+ "bg-mix-transparent bg-mix-amount-95 bg-c-3": b.value
142
133
  }]),
143
134
  columns: ["32px", "", ""],
144
135
  envVariables: e.envVariables,
@@ -149,8 +140,8 @@ const j = { class: "text-c-2 request-meta-buttons flex whitespace-nowrap opacity
149
140
  items: e.readOnlyEntries,
150
141
  label: e.label,
151
142
  workspace: e.workspace
152
- }, null, 8, ["class", "envVariables", "environment", "invalidParams", "items", "label", "workspace"])) : P("", !0),
153
- w(K, {
143
+ }, null, 8, ["class", "envVariables", "environment", "invalidParams", "items", "label", "workspace"])) : h("", !0),
144
+ k(C, {
154
145
  class: "flex-1",
155
146
  columns: ["32px", "", ""],
156
147
  envVariables: e.envVariables,
@@ -159,9 +150,9 @@ const j = { class: "text-c-2 request-meta-buttons flex whitespace-nowrap opacity
159
150
  items: n.value,
160
151
  label: e.label,
161
152
  workspace: e.workspace,
162
- onToggleRow: q,
163
- onUpdateRow: $,
164
- onDeleteRow: T
153
+ onToggleRow: $,
154
+ onUpdateRow: K,
155
+ onDeleteRow: E
165
156
  }, null, 8, ["envVariables", "environment", "invalidParams", "items", "label", "workspace"])
166
157
  ], 512)
167
158
  ]),
@@ -170,5 +161,5 @@ const j = { class: "text-c-2 request-meta-buttons flex whitespace-nowrap opacity
170
161
  }
171
162
  });
172
163
  export {
173
- _ as default
164
+ I as default
174
165
  };
@@ -1 +1 @@
1
- {"version":3,"file":"RequestSection.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestSection.vue"],"names":[],"mappings":"AAiUA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AACzE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAA;AACnF,OAAO,KAAK,EACV,UAAU,EACV,SAAS,EACT,cAAc,EACd,MAAM,EACP,MAAM,iCAAiC,CAAA;AACxC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AASrE,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,OAAO,EAAE,cAAc,CAAA;IACvB,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IAC1B,SAAS,EAAE,SAAS,CAAA;IACpB,0BAA0B,EAAE,0BAA0B,CAAA;IACtD,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,SAAS,EAAE,SAAS,CAAA;CACrB,CAAC;;AAmVF,wBAOG"}
1
+ {"version":3,"file":"RequestSection.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestSection.vue"],"names":[],"mappings":"AAuVA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AACzE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAA;AACnF,OAAO,KAAK,EACV,UAAU,EACV,SAAS,EACT,cAAc,EACd,MAAM,EACP,MAAM,iCAAiC,CAAA;AACxC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AAUrE,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,OAAO,EAAE,cAAc,CAAA;IACvB,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IAC1B,SAAS,EAAE,SAAS,CAAA;IACpB,0BAA0B,EAAE,0BAA0B,CAAA;IACtD,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,SAAS,EAAE,SAAS,CAAA;CACrB,CAAC;;AA2XF,wBAOG"}
@@ -1,7 +1,7 @@
1
1
  import o from "./RequestSection.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-b2979639"]]);
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-53db5ccb"]]);
5
5
  export {
6
- p as default
6
+ m as default
7
7
  };