@scalar/api-client 2.2.53 → 2.2.55

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 (84) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/components/CommandPalette/CommandActionForm.vue.d.ts +1 -1
  3. package/dist/components/CommandPalette/CommandActionForm.vue.d.ts.map +1 -1
  4. package/dist/components/CommandPalette/CommandActionForm.vue.js +15 -14
  5. package/dist/components/CommandPalette/CommandPaletteImport.vue.d.ts.map +1 -1
  6. package/dist/components/CommandPalette/CommandPaletteImport.vue.js +121 -106
  7. package/dist/components/{ImportCurl/ImportCurlModal.vue.d.ts → CommandPalette/CommandPaletteImportCurl.vue.d.ts} +9 -17
  8. package/dist/components/CommandPalette/CommandPaletteImportCurl.vue.d.ts.map +1 -0
  9. package/dist/components/CommandPalette/CommandPaletteImportCurl.vue.js +7 -0
  10. package/dist/components/CommandPalette/CommandPaletteImportCurl.vue2.js +141 -0
  11. package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts +98 -1
  12. package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts.map +1 -1
  13. package/dist/components/CommandPalette/TheCommandPalette.vue.js +2 -2
  14. package/dist/components/CommandPalette/TheCommandPalette.vue2.js +128 -113
  15. package/dist/components/HttpMethod/HttpMethod.vue.d.ts +2 -2
  16. package/dist/components/OpenApiClientButton.vue.d.ts.map +1 -1
  17. package/dist/components/OpenApiClientButton.vue.js +2 -2
  18. package/dist/components/Server/ServerSelector.vue.d.ts +5 -1
  19. package/dist/components/Server/ServerSelector.vue.d.ts.map +1 -1
  20. package/dist/components/Server/ServerSelector.vue.js +48 -43
  21. package/dist/components/TopNav/TopNav.vue.d.ts.map +1 -1
  22. package/dist/components/TopNav/TopNav.vue.js +122 -94
  23. package/dist/components/TopNav/TopNavItem.vue.d.ts +1 -0
  24. package/dist/components/TopNav/TopNavItem.vue.d.ts.map +1 -1
  25. package/dist/components/TopNav/TopNavItem.vue.js +1 -1
  26. package/dist/components/TopNav/TopNavItem.vue2.js +49 -42
  27. package/dist/components/ViewLayout/ViewLayoutCollapse.vue.d.ts.map +1 -1
  28. package/dist/components/ViewLayout/ViewLayoutCollapse.vue.js +10 -9
  29. package/dist/layouts/App/create-api-client-app.d.ts +12 -12
  30. package/dist/layouts/Modal/ApiClientModal.vue.d.ts.map +1 -1
  31. package/dist/layouts/Modal/ApiClientModal.vue.js +2 -2
  32. package/dist/layouts/Modal/create-api-client-modal.d.ts +24 -24
  33. package/dist/layouts/Web/create-api-client-web.d.ts +12 -12
  34. package/dist/libs/create-client.d.ts +12 -12
  35. package/dist/libs/create-client.d.ts.map +1 -1
  36. package/dist/libs/create-client.js +91 -115
  37. package/dist/libs/get-request-uid-by-path-method.d.ts +7 -0
  38. package/dist/libs/get-request-uid-by-path-method.d.ts.map +1 -0
  39. package/dist/libs/get-request-uid-by-path-method.js +10 -0
  40. package/dist/libs/get-request-uid-by-path-method.test.d.ts +2 -0
  41. package/dist/libs/get-request-uid-by-path-method.test.d.ts.map +1 -0
  42. package/dist/libs/send-request/create-fetch-body.d.ts +1 -1
  43. package/dist/libs/validate-parameters.d.ts +6 -0
  44. package/dist/libs/validate-parameters.d.ts.map +1 -0
  45. package/dist/libs/validate-parameters.js +12 -0
  46. package/dist/libs/validate-parameters.test.d.ts +2 -0
  47. package/dist/libs/validate-parameters.test.d.ts.map +1 -0
  48. package/dist/store/cookies.d.ts +4 -4
  49. package/dist/store/request-example.d.ts +4 -4
  50. package/dist/store/requests.d.ts +4 -4
  51. package/dist/store/store.d.ts +12 -12
  52. package/dist/style.css +1 -1
  53. package/dist/views/Request/Request.vue.d.ts +6 -3
  54. package/dist/views/Request/Request.vue.d.ts.map +1 -1
  55. package/dist/views/Request/Request.vue.js +2 -2
  56. package/dist/views/Request/Request.vue2.js +96 -145
  57. package/dist/views/Request/RequestRoot.vue.d.ts.map +1 -1
  58. package/dist/views/Request/RequestRoot.vue.js +2 -2
  59. package/dist/views/Request/RequestRoot.vue2.js +68 -57
  60. package/dist/views/Request/RequestSection/RequestParams.vue.d.ts +1 -0
  61. package/dist/views/Request/RequestSection/RequestParams.vue.d.ts.map +1 -1
  62. package/dist/views/Request/RequestSection/RequestParams.vue.js +34 -31
  63. package/dist/views/Request/RequestSection/RequestPathParams.vue.d.ts +1 -0
  64. package/dist/views/Request/RequestSection/RequestPathParams.vue.d.ts.map +1 -1
  65. package/dist/views/Request/RequestSection/RequestPathParams.vue.js +35 -33
  66. package/dist/views/Request/RequestSection/RequestSection.vue.d.ts +1 -0
  67. package/dist/views/Request/RequestSection/RequestSection.vue.d.ts.map +1 -1
  68. package/dist/views/Request/RequestSection/RequestSection.vue.js +2 -2
  69. package/dist/views/Request/RequestSection/RequestSection.vue2.js +59 -54
  70. package/dist/views/Request/RequestSection/RequestTable.vue.d.ts +1 -0
  71. package/dist/views/Request/RequestSection/RequestTable.vue.d.ts.map +1 -1
  72. package/dist/views/Request/RequestSection/RequestTable.vue.js +2 -2
  73. package/dist/views/Request/RequestSection/RequestTable.vue2.js +29 -27
  74. package/dist/views/Request/RequestSidebar.vue.js +2 -2
  75. package/dist/views/Request/RequestSidebar.vue2.js +23 -23
  76. package/dist/views/Request/RequestSubpageHeader.vue.d.ts.map +1 -1
  77. package/dist/views/Request/RequestSubpageHeader.vue.js +2 -2
  78. package/dist/views/Request/RequestSubpageHeader.vue2.js +4 -4
  79. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  80. package/dist/views/Request/libs/request.js +1 -2
  81. package/package.json +11 -11
  82. package/dist/components/ImportCurl/ImportCurlModal.vue.d.ts.map +0 -1
  83. package/dist/components/ImportCurl/ImportCurlModal.vue.js +0 -7
  84. package/dist/components/ImportCurl/ImportCurlModal.vue2.js +0 -125
@@ -1,13 +1,16 @@
1
- declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
1
+ type __VLS_Props = {
2
+ invalidParams: Set<string>;
3
+ };
4
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
2
5
  newTab: (item: {
3
6
  name: string;
4
7
  uid: string;
5
8
  }) => any;
6
- }, string, import("vue").PublicProps, Readonly<{}> & Readonly<{
9
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
7
10
  onNewTab?: (item: {
8
11
  name: string;
9
12
  uid: string;
10
13
  }) => any;
11
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
14
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
12
15
  export default _default;
13
16
  //# sourceMappingURL=Request.vue.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Request.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Request/Request.vue"],"names":[],"mappings":";;cA0O8C,MAAM;aAAO,MAAM;;;;cAAnB,MAAM;aAAO,MAAM;;;AA8UjE,wBAMG"}
1
+ {"version":3,"file":"Request.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Request/Request.vue"],"names":[],"mappings":"AAoLA,KAAK,WAAW,GAAG;IACjB,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;CAC3B,CAAC;;;cAtB4C,MAAM;aAAO,MAAM;;;;cAAnB,MAAM;aAAO,MAAM;;;AA4OjE,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-9a0ce942"]]);
4
+ const f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-dacbf370"]]);
5
5
  export {
6
- m as default
6
+ f as default
7
7
  };
@@ -1,160 +1,111 @@
1
- import { defineComponent as Y, ref as I, computed as H, openBlock as l, createElementBlock as k, Fragment as Z, unref as e, normalizeClass as M, createElementVNode as ee, createVNode as v, isRef as te, withCtx as L, createBlock as p, createCommentVNode as N } from "vue";
2
- import { useRouter as oe } from "vue-router";
3
- import z from "../../components/EmptyState.vue.js";
4
- import re from "../../components/ImportCurl/ImportCurlModal.vue.js";
5
- import se from "../../components/ViewLayout/ViewLayout.vue.js";
6
- import ie from "../../components/ViewLayout/ViewLayoutContent.vue.js";
7
- import { useSidebar as le } from "../../hooks/useSidebar.js";
8
- import { importCurlCommand as ae } from "../../libs/importers/curl.js";
9
- import { PathId as S } from "../../routes.js";
10
- import { useActiveEntities as ne } from "../../store/active-entities.js";
11
- import ue from "./RequestSection/RequestSection.vue.js";
12
- import ce from "./RequestSubpageHeader.vue.js";
13
- import me from "./ResponseSection/ResponseSection.vue.js";
14
- import { useLayout as de } from "../../hooks/useLayout.js";
15
- import { useWorkspace as ve } from "../../store/store.js";
16
- const pe = { class: "flex h-full" }, fe = {
1
+ import { defineComponent as P, computed as k, unref as e, openBlock as a, createElementBlock as y, normalizeClass as S, createElementVNode as W, createVNode as n, isRef as H, withCtx as b, createBlock as u, createCommentVNode as L } from "vue";
2
+ import x from "../../components/EmptyState.vue.js";
3
+ import N from "../../components/ViewLayout/ViewLayout.vue.js";
4
+ import g from "../../components/ViewLayout/ViewLayoutContent.vue.js";
5
+ import { useSidebar as B } from "../../hooks/useSidebar.js";
6
+ import { importCurlCommand as I } from "../../libs/importers/curl.js";
7
+ import { useActiveEntities as z } from "../../store/active-entities.js";
8
+ import A from "./RequestSection/RequestSection.vue.js";
9
+ import D from "./RequestSubpageHeader.vue.js";
10
+ import M from "./ResponseSection/ResponseSection.vue.js";
11
+ import { useWorkspace as h } from "../../store/store.js";
12
+ import { useLayout as O } from "../../hooks/useLayout.js";
13
+ const T = { class: "flex h-full" }, $ = {
17
14
  key: 0,
18
15
  class: "flex h-full flex-1 flex-col"
19
- }, Be = /* @__PURE__ */ Y({
16
+ }, ae = /* @__PURE__ */ P({
20
17
  __name: "Request",
18
+ props: {
19
+ invalidParams: {}
20
+ },
21
21
  emits: ["newTab"],
22
- setup(ye) {
23
- const { isSidebarOpen: c } = le(), { layout: h } = de(), {
24
- activeCollection: a,
25
- activeExample: f,
26
- activeRequest: m,
27
- activeWorkspace: n,
28
- activeServer: q,
29
- activeEnvVariables: x,
30
- activeEnvironment: b,
31
- activeWorkspaceCollections: D,
32
- activeWorkspaceRequests: F
33
- } = ne(), O = ve(), { modalState: u, requestHistory: $, requestMutators: j, serverMutators: A, servers: P } = O, t = I(), y = I(""), T = oe(), G = H(
34
- () => $.findLast((s) => {
35
- var o;
36
- return s.request.uid === ((o = f.value) == null ? void 0 : o.uid);
22
+ setup(j) {
23
+ const { events: C } = h(), { isSidebarOpen: l } = B(), V = h(), { layout: d } = O(), {
24
+ activeCollection: r,
25
+ activeExample: m,
26
+ activeRequest: s,
27
+ activeWorkspace: c,
28
+ activeServer: p,
29
+ activeEnvVariables: v,
30
+ activeEnvironment: f,
31
+ activeWorkspaceRequests: _
32
+ } = z(), { modalState: R, requestHistory: q } = V, w = k(
33
+ () => q.findLast((o) => {
34
+ var t;
35
+ return o.request.uid === ((t = m.value) == null ? void 0 : t.uid);
37
36
  })
38
- ), J = H(
37
+ ), E = k(
39
38
  () => {
40
- var s, o;
41
- return (h === "modal" ? (s = a.value) == null ? void 0 : s.selectedSecuritySchemeUids : (o = m.value) == null ? void 0 : o.selectedSecuritySchemeUids) ?? [];
39
+ var o, t;
40
+ return (d === "modal" ? (o = r.value) == null ? void 0 : o.selectedSecuritySchemeUids : (t = s.value) == null ? void 0 : t.selectedSecuritySchemeUids) ?? [];
42
41
  }
43
42
  );
44
- function K({
45
- requestName: s,
46
- collectionUid: o
47
- }) {
48
- var V, w, U, _, C, E, W;
49
- if (!t.value) return;
50
- const r = D.value.find(
51
- (d) => d.uid === o
52
- );
53
- if (!r) return;
54
- const i = ((V = r == null ? void 0 : r.info) == null ? void 0 : V.title) === "Drafts";
55
- if (!i && t.value.servers) {
56
- const d = Object.values(P).find(
57
- (X) => {
58
- var g, B;
59
- return X.url === ((B = (g = t == null ? void 0 : t.value) == null ? void 0 : g.servers) == null ? void 0 : B[0]);
60
- }
61
- );
62
- d ? y.value = d.uid : y.value = A.add(
63
- { url: t.value.servers[0] ?? "/" },
64
- r.uid
65
- ).uid;
66
- }
67
- const R = j.add(
68
- {
69
- summary: s,
70
- path: i ? (w = t == null ? void 0 : t.value) == null ? void 0 : w.url : (U = t == null ? void 0 : t.value) == null ? void 0 : U.path,
71
- method: (_ = t == null ? void 0 : t.value) == null ? void 0 : _.method,
72
- parameters: (C = t == null ? void 0 : t.value) == null ? void 0 : C.parameters,
73
- selectedServerUid: i ? void 0 : y.value,
74
- requestBody: (E = t == null ? void 0 : t.value) == null ? void 0 : E.requestBody
75
- },
76
- r.uid
77
- );
78
- R && ((W = n.value) != null && W.uid) && T.push({
79
- name: "request",
80
- params: {
81
- [S.Workspace]: n.value.uid,
82
- [S.Collection]: r.uid,
83
- [S.Request]: R.uid
43
+ function U(o) {
44
+ var t;
45
+ C.commandPalette.emit({
46
+ commandName: "Import from cURL",
47
+ metaData: {
48
+ parsedCurl: I(o),
49
+ collectionUid: (t = r.value) == null ? void 0 : t.uid
84
50
  }
85
- }), u.hide();
86
- }
87
- function Q(s) {
88
- t.value = ae(s), u.show();
51
+ });
89
52
  }
90
- return (s, o) => {
91
- var r;
92
- return l(), k(Z, null, [
93
- e(a) && e(n) ? (l(), k("div", {
94
- key: 0,
95
- class: M(["bg-b-1 relative z-0 flex h-full flex-1 flex-col overflow-hidden pt-0", {
96
- "!mb-0 !mr-0 !border-0": e(h) === "modal"
97
- }])
98
- }, [
99
- ee("div", pe, [
100
- e(m) ? (l(), k("div", fe, [
101
- v(ce, {
102
- modelValue: e(c),
103
- "onUpdate:modelValue": o[0] || (o[0] = (i) => te(c) ? c.value = i : null),
104
- collection: e(a),
105
- envVariables: e(x),
106
- environment: e(b),
107
- operation: e(m),
108
- server: e(q),
109
- workspace: e(n),
110
- onHideModal: o[1] || (o[1] = () => e(u).hide()),
111
- onImportCurl: Q
112
- }, null, 8, ["modelValue", "collection", "envVariables", "environment", "operation", "server", "workspace"]),
113
- v(se, null, {
114
- default: L(() => [
115
- e(f) ? (l(), p(ie, {
116
- key: 0,
117
- class: M(["flex-1", [e(c) ? "sidebar-active-hide-layout" : ""]])
118
- }, {
119
- default: L(() => {
120
- var i;
121
- return [
122
- v(ue, {
123
- collection: e(a),
124
- envVariables: e(x),
125
- environment: e(b),
126
- example: e(f),
127
- operation: e(m),
128
- selectedSecuritySchemeUids: J.value,
129
- server: e(q),
130
- workspace: e(n)
131
- }, null, 8, ["collection", "envVariables", "environment", "example", "operation", "selectedSecuritySchemeUids", "server", "workspace"]),
132
- v(me, {
133
- numWorkspaceRequests: e(F).length,
134
- response: (i = G.value) == null ? void 0 : i.response
135
- }, null, 8, ["numWorkspaceRequests", "response"])
136
- ];
137
- }),
138
- _: 1
139
- }, 8, ["class"])) : N("", !0)
140
- ]),
53
+ return (o, t) => e(r) && e(c) ? (a(), y("div", {
54
+ key: 0,
55
+ class: S(["bg-b-1 relative z-0 flex h-full flex-1 flex-col overflow-hidden pt-0", {
56
+ "!mb-0 !mr-0 !border-0": e(d) === "modal"
57
+ }])
58
+ }, [
59
+ W("div", T, [
60
+ e(s) ? (a(), y("div", $, [
61
+ n(D, {
62
+ modelValue: e(l),
63
+ "onUpdate:modelValue": t[0] || (t[0] = (i) => H(l) ? l.value = i : null),
64
+ collection: e(r),
65
+ envVariables: e(v),
66
+ environment: e(f),
67
+ operation: e(s),
68
+ server: e(p),
69
+ workspace: e(c),
70
+ onHideModal: t[1] || (t[1] = () => e(R).hide()),
71
+ onImportCurl: U
72
+ }, null, 8, ["modelValue", "collection", "envVariables", "environment", "operation", "server", "workspace"]),
73
+ n(N, null, {
74
+ default: b(() => [
75
+ e(m) ? (a(), u(g, {
76
+ key: 0,
77
+ class: S(["flex-1", [e(l) ? "sidebar-active-hide-layout" : ""]])
78
+ }, {
79
+ default: b(() => {
80
+ var i;
81
+ return [
82
+ n(A, {
83
+ collection: e(r),
84
+ envVariables: e(v),
85
+ environment: e(f),
86
+ example: e(m),
87
+ invalidParams: o.invalidParams,
88
+ operation: e(s),
89
+ selectedSecuritySchemeUids: E.value,
90
+ server: e(p),
91
+ workspace: e(c)
92
+ }, null, 8, ["collection", "envVariables", "environment", "example", "invalidParams", "operation", "selectedSecuritySchemeUids", "server", "workspace"]),
93
+ n(M, {
94
+ numWorkspaceRequests: e(_).length,
95
+ response: (i = w.value) == null ? void 0 : i.response
96
+ }, null, 8, ["numWorkspaceRequests", "response"])
97
+ ];
98
+ }),
141
99
  _: 1
142
- })
143
- ])) : (l(), p(z, { key: 1 }))
144
- ])
145
- ], 2)) : (l(), p(z, { key: 1 })),
146
- t.value ? (l(), p(re, {
147
- key: 2,
148
- collectionUid: ((r = e(a)) == null ? void 0 : r.uid) ?? "",
149
- parsedCurl: t.value,
150
- state: e(u),
151
- onClose: o[2] || (o[2] = (i) => e(u).hide()),
152
- onImportCurl: K
153
- }, null, 8, ["collectionUid", "parsedCurl", "state"])) : N("", !0)
154
- ], 64);
155
- };
100
+ }, 8, ["class"])) : L("", !0)
101
+ ]),
102
+ _: 1
103
+ })
104
+ ])) : (a(), u(x, { key: 1 }))
105
+ ])
106
+ ], 2)) : (a(), u(x, { key: 1 }));
156
107
  }
157
108
  });
158
109
  export {
159
- Be as default
110
+ ae as default
160
111
  };
@@ -1 +1 @@
1
- {"version":3,"file":"RequestRoot.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Request/RequestRoot.vue"],"names":[],"mappings":";;cAoL8C,MAAM;aAAO,MAAM;;;;cAAnB,MAAM;aAAO,MAAM;;;AA4NjE,wBAMG"}
1
+ {"version":3,"file":"RequestRoot.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Request/RequestRoot.vue"],"names":[],"mappings":";;cAgM8C,MAAM;aAAO,MAAM;;;;cAAnB,MAAM;aAAO,MAAM;;;AAuOjE,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 p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-7c73b460"]]);
4
+ const f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-7fb0d9a3"]]);
5
5
  export {
6
- p as default
6
+ f as default
7
7
  };
@@ -1,78 +1,89 @@
1
- import { defineComponent as B, ref as D, computed as I, onMounted as J, onBeforeUnmount as W, openBlock as b, createElementBlock as j, normalizeClass as z, unref as c, createElementVNode as h, createBlock as L, createCommentVNode as M, createVNode as H } from "vue";
2
- import { isDefined as Q } from "@scalar/oas-utils/helpers";
3
- import { safeJSON as $ } from "@scalar/object-utils/parse";
4
- import { useToasts as F } from "@scalar/use-toasts";
5
- import { RouterView as G } from "vue-router";
6
- import { useActiveEntities as K } from "../../store/active-entities.js";
7
- import { useOpenApiWatcher as P } from "./hooks/useOpenApiWatcher.js";
8
- import X from "./RequestSidebar.vue.js";
9
- import { createRequestOperation as Y } from "../../libs/send-request/create-request-operation.js";
10
- import { ERRORS as Z } from "../../libs/errors.js";
11
- import { useWorkspace as ee } from "../../store/store.js";
12
- import { useLayout as te } from "../../hooks/useLayout.js";
13
- const oe = { class: "flex h-full" }, re = { class: "flex h-full flex-1 flex-col" }, Se = /* @__PURE__ */ B({
1
+ import { defineComponent as P, ref as h, computed as I, onMounted as J, onBeforeUnmount as W, watch as j, openBlock as E, createElementBlock as z, normalizeClass as L, unref as c, createElementVNode as N, createBlock as M, createCommentVNode as H, createVNode as Q } from "vue";
2
+ import { isDefined as $ } from "@scalar/oas-utils/helpers";
3
+ import { safeJSON as F } from "@scalar/object-utils/parse";
4
+ import { useToasts as G } from "@scalar/use-toasts";
5
+ import { RouterView as K } from "vue-router";
6
+ import { validateParameters as X } from "../../libs/validate-parameters.js";
7
+ import { useActiveEntities as Y } from "../../store/active-entities.js";
8
+ import { useOpenApiWatcher as Z } from "./hooks/useOpenApiWatcher.js";
9
+ import ee from "./RequestSidebar.vue.js";
10
+ import { createRequestOperation as te } from "../../libs/send-request/create-request-operation.js";
11
+ import { ERRORS as oe } from "../../libs/errors.js";
12
+ import { useWorkspace as re } from "../../store/store.js";
13
+ import { useLayout as se } from "../../hooks/useLayout.js";
14
+ const ae = { class: "flex h-full" }, le = { class: "flex h-full flex-1 flex-col" }, be = /* @__PURE__ */ P({
14
15
  __name: "RequestRoot",
15
16
  emits: ["newTab"],
16
- setup(se) {
17
- const E = ee(), { toast: n } = F(), { layout: l } = te(), {
18
- activeCollection: r,
19
- activeExample: i,
20
- activeEnvironment: u,
21
- activeRequest: s,
22
- activeWorkspace: m,
23
- activeServer: N
24
- } = K(), { cookies: k, requestHistory: _, showSidebar: O, securitySchemes: w, events: o } = E, f = D(), U = I(
17
+ setup(ne) {
18
+ const k = re(), { toast: i } = G(), { layout: u } = se(), {
19
+ activeCollection: s,
20
+ activeExample: o,
21
+ activeEnvironment: m,
22
+ activeRequest: a,
23
+ activeWorkspace: v,
24
+ activeServer: w
25
+ } = Y(), { cookies: _, requestHistory: O, showSidebar: U, securitySchemes: C, events: r } = k, f = h(), l = h(/* @__PURE__ */ new Set()), T = I(
25
26
  () => {
26
- var t, e;
27
- return (l === "modal" ? (t = r.value) == null ? void 0 : t.selectedSecuritySchemeUids : (e = s.value) == null ? void 0 : e.selectedSecuritySchemeUids) ?? [];
27
+ var e, t;
28
+ return (u === "modal" ? (e = s.value) == null ? void 0 : e.selectedSecuritySchemeUids : (t = a.value) == null ? void 0 : t.selectedSecuritySchemeUids) ?? [];
28
29
  }
29
30
  ), p = async () => {
30
- var S, q, x, y;
31
- if (!s.value || !i.value || !r.value)
31
+ var q, x, y, b;
32
+ if (!a.value || !o.value || !s.value)
32
33
  return;
33
- const t = typeof u.value == "object" ? u.value.value : "{}", e = $.parse(t);
34
- e.error && console.error("INVALID ENVIRONMENT!");
35
- const a = e.error || typeof e.data != "object" ? {} : e.data ?? {}, T = ((S = m.value) == null ? void 0 : S.cookies.map((A) => k[A]).filter(Q)) ?? [], V = ((x = (q = r.value) == null ? void 0 : q.info) == null ? void 0 : x.title) === "Drafts" ? void 0 : N.value, [v, d] = Y({
36
- request: s.value,
37
- example: i.value,
38
- selectedSecuritySchemeUids: U.value,
39
- proxyUrl: ((y = m.value) == null ? void 0 : y.proxyUrl) ?? "",
40
- environment: a,
41
- globalCookies: T,
42
- status: o.requestStatus,
43
- securitySchemes: w,
44
- server: V
34
+ l.value = X(o.value);
35
+ const e = typeof m.value == "object" ? m.value.value : "{}", t = F.parse(e);
36
+ t.error && console.error("INVALID ENVIRONMENT!");
37
+ const n = t.error || typeof t.data != "object" ? {} : t.data ?? {}, g = ((q = v.value) == null ? void 0 : q.cookies.map((D) => _[D]).filter($)) ?? [], A = ((y = (x = s.value) == null ? void 0 : x.info) == null ? void 0 : y.title) === "Drafts" ? void 0 : w.value, [d, R] = te({
38
+ request: a.value,
39
+ example: o.value,
40
+ selectedSecuritySchemeUids: T.value,
41
+ proxyUrl: ((b = v.value) == null ? void 0 : b.proxyUrl) ?? "",
42
+ environment: n,
43
+ globalCookies: g,
44
+ status: r.requestStatus,
45
+ securitySchemes: C,
46
+ server: A
45
47
  });
46
- if (v) {
47
- n(v.message, "error");
48
+ if (d) {
49
+ i(d.message, "error");
48
50
  return;
49
51
  }
50
- f.value = d.controller;
51
- const [R, g] = await d.sendRequest();
52
- R ? n(R.message, "error") : _.push(JSON.parse(JSON.stringify(g)));
53
- }, C = async () => {
54
- var t;
55
- return (t = f.value) == null ? void 0 : t.abort(Z.REQUEST_ABORTED);
52
+ f.value = R.controller;
53
+ const [S, B] = await R.sendRequest();
54
+ S ? i(S.message, "error") : O.push(JSON.parse(JSON.stringify(B)));
55
+ }, V = async () => {
56
+ var e;
57
+ return (e = f.value) == null ? void 0 : e.abort(oe.REQUEST_ABORTED);
56
58
  };
57
59
  return J(() => {
58
- o.executeRequest.on(p), o.cancelRequest.on(C);
59
- }), P(), W(() => o.executeRequest.off(p)), (t, e) => (b(), j("div", {
60
- class: z(["bg-b-1 relative z-0 flex h-full flex-1 flex-col overflow-hidden pt-0", {
61
- "!mb-0 !mr-0 !border-0": c(l) === "modal"
60
+ r.executeRequest.on(p), r.cancelRequest.on(V);
61
+ }), Z(), W(() => r.executeRequest.off(p)), j(
62
+ () => {
63
+ var e;
64
+ return (e = o.value) == null ? void 0 : e.parameters;
65
+ },
66
+ () => {
67
+ l.value.clear();
68
+ },
69
+ { deep: !0 }
70
+ ), (e, t) => (E(), z("div", {
71
+ class: L(["bg-b-1 relative z-0 flex h-full flex-1 flex-col overflow-hidden pt-0", {
72
+ "!mb-0 !mr-0 !border-0": c(u) === "modal"
62
73
  }])
63
74
  }, [
64
- h("div", oe, [
65
- c(O) ? (b(), L(X, {
75
+ N("div", ae, [
76
+ c(U) ? (E(), M(ee, {
66
77
  key: 0,
67
- onNewTab: e[0] || (e[0] = (a) => t.$emit("newTab", a))
68
- })) : M("", !0),
69
- h("div", re, [
70
- H(c(G))
78
+ onNewTab: t[0] || (t[0] = (n) => e.$emit("newTab", n))
79
+ })) : H("", !0),
80
+ N("div", le, [
81
+ Q(c(K), { invalidParams: l.value }, null, 8, ["invalidParams"])
71
82
  ])
72
83
  ])
73
84
  ], 2));
74
85
  }
75
86
  });
76
87
  export {
77
- Se as default
88
+ be as default
78
89
  };
@@ -16,6 +16,7 @@ type __VLS_Props = {
16
16
  enabled: boolean;
17
17
  route: RouteLocationRaw;
18
18
  }[];
19
+ invalidParams: Set<string>;
19
20
  };
20
21
  declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
21
22
  export default _default;
@@ -1 +1 @@
1
- {"version":3,"file":"RequestParams.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestParams.vue"],"names":[],"mappings":"AA8NA,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,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;CACJ,CAAC;;AA6UF,wBAOG"}
1
+ {"version":3,"file":"RequestParams.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestParams.vue"],"names":[],"mappings":"AAiOA,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,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;;AA6UF,wBAOG"}