@scalar/api-client 2.1.33 → 2.1.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/dist/components/AddressBar/AddressBar.vue.d.ts.map +1 -1
  3. package/dist/components/AddressBar/AddressBar.vue.js +2 -2
  4. package/dist/components/CodeInput/CodeInput.vue.js +2 -2
  5. package/dist/components/ContextBar.vue.d.ts.map +1 -1
  6. package/dist/components/ContextBar.vue.js +1 -1
  7. package/dist/components/ContextBar.vue2.js +6 -6
  8. package/dist/components/DataTable/DataTableInput.vue.d.ts.map +1 -1
  9. package/dist/components/DataTable/DataTableInput.vue.js +3 -3
  10. package/dist/components/DataTable/DataTableInput.vue2.js +53 -40
  11. package/dist/components/ScalarHotkey.vue.d.ts +5 -6
  12. package/dist/components/ScalarHotkey.vue.d.ts.map +1 -1
  13. package/dist/components/ScalarHotkey.vue.js +9 -18
  14. package/dist/components/SideNav/SideNav.vue.d.ts.map +1 -1
  15. package/dist/components/SideNav/SideNav.vue.js +2 -2
  16. package/dist/components/SideNav/SideNav.vue2.js +8 -8
  17. package/dist/components/Sidebar/SidebarButton.vue.d.ts +4 -0
  18. package/dist/components/Sidebar/SidebarButton.vue.d.ts.map +1 -1
  19. package/dist/components/Sidebar/SidebarButton.vue.js +19 -17
  20. package/dist/components/TopNav/TopNav.vue.d.ts.map +1 -1
  21. package/dist/components/TopNav/TopNav.vue.js +2 -2
  22. package/dist/components/TopNav/TopNav.vue2.js +14 -14
  23. package/dist/components/ViewLayout/ViewLayoutSection.vue.d.ts.map +1 -1
  24. package/dist/components/ViewLayout/ViewLayoutSection.vue.js +6 -6
  25. package/dist/index.d.ts +1 -1
  26. package/dist/index.d.ts.map +1 -1
  27. package/dist/index.js +8 -8
  28. package/dist/layouts/App/ApiClientApp.vue.d.ts.map +1 -1
  29. package/dist/layouts/App/ApiClientApp.vue.js +35 -29
  30. package/dist/layouts/App/MainLayout.vue.d.ts.map +1 -1
  31. package/dist/layouts/App/MainLayout.vue.js +4 -4
  32. package/dist/layouts/App/create-api-client-app.d.ts +257 -45
  33. package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
  34. package/dist/layouts/App/create-api-client-app.js +10 -10
  35. package/dist/layouts/App/hotkeys.js +1 -1
  36. package/dist/layouts/Modal/create-api-client-modal.d.ts +514 -90
  37. package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
  38. package/dist/layouts/Modal/create-api-client-modal.js +24 -22
  39. package/dist/layouts/Web/ApiClientWeb.vue.d.ts.map +1 -1
  40. package/dist/layouts/Web/ApiClientWeb.vue.js +33 -27
  41. package/dist/layouts/Web/create-api-client-web.d.ts +258 -46
  42. package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
  43. package/dist/layouts/Web/create-api-client-web.js +9 -9
  44. package/dist/libs/create-client.d.ts +280 -50
  45. package/dist/libs/create-client.d.ts.map +1 -1
  46. package/dist/libs/create-client.js +25 -24
  47. package/dist/libs/hot-keys.d.ts +1 -1
  48. package/dist/libs/local-storage.d.ts +2 -2
  49. package/dist/libs/local-storage.d.ts.map +1 -1
  50. package/dist/libs/send-request.d.ts +2 -1
  51. package/dist/libs/send-request.d.ts.map +1 -1
  52. package/dist/libs/send-request.js +98 -97
  53. package/dist/router.d.ts +5 -5
  54. package/dist/router.d.ts.map +1 -1
  55. package/dist/router.js +32 -32
  56. package/dist/store/collections.d.ts +14 -4
  57. package/dist/store/collections.d.ts.map +1 -1
  58. package/dist/store/events.d.ts +1 -1
  59. package/dist/store/import-spec.d.ts +16 -31
  60. package/dist/store/import-spec.d.ts.map +1 -1
  61. package/dist/store/import-spec.js +43 -56
  62. package/dist/store/requests.d.ts +14 -14
  63. package/dist/store/store.d.ts +514 -90
  64. package/dist/store/store.d.ts.map +1 -1
  65. package/dist/store/store.js +43 -43
  66. package/dist/store/workspace.d.ts +10 -10
  67. package/dist/store/workspace.d.ts.map +1 -1
  68. package/dist/style.css +1 -1
  69. package/dist/views/Cookies/Cookies.vue.d.ts +5 -1
  70. package/dist/views/Cookies/Cookies.vue.d.ts.map +1 -1
  71. package/dist/views/Cookies/Cookies.vue2.js +64 -55
  72. package/dist/views/Environment/Environment.vue.d.ts +5 -1
  73. package/dist/views/Environment/Environment.vue.d.ts.map +1 -1
  74. package/dist/views/Environment/Environment.vue2.js +75 -66
  75. package/dist/views/Request/Request.vue.d.ts.map +1 -1
  76. package/dist/views/Request/Request.vue.js +1 -1
  77. package/dist/views/Request/Request.vue2.js +96 -90
  78. package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.js +21 -21
  79. package/dist/views/Request/RequestSection/RequestAuth/OAuthScopesInput.vue.d.ts.map +1 -1
  80. package/dist/views/Request/RequestSection/RequestAuth/OAuthScopesInput.vue.js +79 -71
  81. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.d.ts +2 -0
  82. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.d.ts.map +1 -1
  83. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.js +2 -2
  84. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue2.js +105 -112
  85. package/dist/views/Request/RequestSection/RequestAuth/RequestExampleAuth.vue.d.ts +5 -1
  86. package/dist/views/Request/RequestSection/RequestAuth/RequestExampleAuth.vue.d.ts.map +1 -1
  87. package/dist/views/Request/RequestSection/RequestAuth/RequestExampleAuth.vue.js +38 -35
  88. package/dist/views/Request/RequestSection/RequestSection.vue.d.ts +5 -1
  89. package/dist/views/Request/RequestSection/RequestSection.vue.d.ts.map +1 -1
  90. package/dist/views/Request/RequestSection/RequestSection.vue.js +5 -118
  91. package/dist/views/Request/RequestSection/RequestSection.vue2.js +126 -0
  92. package/dist/views/Request/RequestSidebar.vue.d.ts.map +1 -1
  93. package/dist/views/Request/RequestSidebar.vue.js +4 -4
  94. package/dist/views/Request/RequestSidebar.vue2.js +43 -42
  95. package/dist/views/Request/ResponseSection/ResponseEmpty.vue.d.ts.map +1 -1
  96. package/dist/views/Request/ResponseSection/ResponseEmpty.vue.js +1 -1
  97. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +27 -26
  98. package/dist/views/Request/ResponseSection/ResponseMetaInformation.vue.d.ts.map +1 -1
  99. package/dist/views/Request/ResponseSection/ResponseMetaInformation.vue.js +1 -1
  100. package/dist/views/Request/ResponseSection/ResponseSection.vue.d.ts.map +1 -1
  101. package/dist/views/Request/ResponseSection/ResponseSection.vue.js +5 -99
  102. package/dist/views/Request/ResponseSection/ResponseSection.vue2.js +104 -2
  103. package/dist/views/Settings/SettingsGeneral.vue.js +3 -3
  104. package/dist/views/Settings/SettingsGeneralMode.vue.js +3 -3
  105. package/package.json +8 -8
  106. package/dist/views/Request/RequestSection/RequestSection.vue3.js +0 -5
@@ -1,157 +1,150 @@
1
- import { defineComponent as N, ref as C, computed as _, openBlock as p, createBlock as F, withCtx as n, createElementVNode as c, toDisplayString as w, createVNode as a, unref as i, createElementBlock as x, Fragment as I, renderList as W, createTextVNode as q, withModifiers as z } from "vue";
2
- import E from "../../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
3
- import { useModal as K, ScalarComboboxMultiselect as H, ScalarButton as L, ScalarIcon as A } from "@scalar/components";
4
- import { nanoid as P } from "nanoid";
5
- import G from "./DeleteRequestAuthModal.vue.js";
6
- import J from "./RequestExampleAuth.vue.js";
7
- import { displaySchemeFormatter as $, createSchemeValueSet as Q } from "../../libs/auth.js";
8
- import { ADD_AUTH_OPTIONS as X } from "../../consts/new-auth-options.js";
9
- import Y from "../../../../components/DataTable/DataTable.vue.js";
10
- import Z from "../../../../components/DataTable/DataTableRow.vue.js";
11
- import ee from "../../../../components/DataTable/DataTableHeader.vue.js";
12
- import { useWorkspace as te } from "../../../../store/store.js";
13
- const le = { class: "flex gap-1" }, oe = {
1
+ import { defineComponent as I, ref as w, computed as v, openBlock as u, createBlock as O, withCtx as c, createElementVNode as r, toDisplayString as A, createVNode as i, unref as o, createElementBlock as m, Fragment as W, renderList as z, createTextVNode as E, withModifiers as j } from "vue";
2
+ import H from "../../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
3
+ import { useModal as L, ScalarComboboxMultiselect as P, ScalarButton as G, ScalarIcon as D } from "@scalar/components";
4
+ import { nanoid as J } from "nanoid";
5
+ import K from "./DeleteRequestAuthModal.vue.js";
6
+ import Q from "./RequestExampleAuth.vue.js";
7
+ import { displaySchemeFormatter as $, createSchemeValueSet as X } from "../../libs/auth.js";
8
+ import { ADD_AUTH_OPTIONS as Y } from "../../consts/new-auth-options.js";
9
+ import Z from "../../../../components/DataTable/DataTable.vue.js";
10
+ import ee from "../../../../components/DataTable/DataTableRow.vue.js";
11
+ import te from "../../../../components/DataTable/DataTableHeader.vue.js";
12
+ import { useWorkspace as le } from "../../../../store/store.js";
13
+ const se = { class: "flex gap-1" }, oe = {
14
14
  key: 0,
15
15
  class: "flex relative scroll-timeline-x w-full"
16
- }, se = { class: "flex flex-1 gap-0.25 mr-1.5 items-center" }, ae = {
16
+ }, ie = { class: "flex flex-1 gap-0.25 mr-1.5 items-center" }, ae = {
17
17
  key: 1,
18
18
  class: "pl-2"
19
- }, _e = /* @__PURE__ */ N({
19
+ }, ye = /* @__PURE__ */ I({
20
20
  __name: "RequestAuth",
21
21
  props: {
22
+ selectedSecuritySchemeUids: {},
22
23
  title: {}
23
24
  },
24
- setup(ie) {
25
+ setup(S) {
25
26
  const {
26
- activeCollection: u,
27
- activeRequest: r,
28
- collectionMutators: D,
29
- isReadOnly: S,
30
- requestMutators: b,
31
- securitySchemes: v,
32
- securitySchemeMutators: M
33
- } = te(), V = C(null), y = K(), g = C(void 0), k = `combobox-${P()}`, O = _(() => {
34
- var o, m, d;
35
- const t = (m = (o = r.value) == null ? void 0 : o.security) == null ? void 0 : m.filter(
36
- (s) => Object.keys(s).length
37
- );
38
- return ((S.value && (t != null && t.length) ? t.map((s) => {
39
- var f;
40
- const l = Object.keys(s)[0];
41
- return ((f = Object.values(v).find((B) => B.nameKey === l)) == null ? void 0 : f.uid) ?? "";
42
- }) : (d = u.value) == null ? void 0 : d.securitySchemes) ?? []).map((s) => v[s]).filter((s) => s);
43
- }), R = _(
27
+ activeCollection: a,
28
+ activeRequest: d,
29
+ collectionMutators: x,
30
+ isReadOnly: f,
31
+ requestMutators: M,
32
+ securitySchemes: p,
33
+ securitySchemeMutators: V
34
+ } = le(), R = w(null), h = L(), y = w(void 0), _ = `combobox-${J()}`, T = v(() => {
35
+ var e;
36
+ return (((e = a.value) == null ? void 0 : e.securitySchemes) ?? []).map((l) => p[l]).filter((l) => l);
37
+ }), B = v(
44
38
  () => {
45
- const t = O.value.map(
39
+ const t = T.value.map(
46
40
  (e) => $(e)
47
41
  );
48
- return S.value ? t : [
42
+ return f.value ? t : [
49
43
  { label: "Select auth", options: t },
50
44
  {
51
45
  label: "Add new auth",
52
- options: X
46
+ options: Y
53
47
  }
54
48
  ];
55
49
  }
56
- ), h = _(
57
- () => {
58
- var t;
59
- return ((t = r.value) == null ? void 0 : t.selectedSecuritySchemeUids.map(
60
- (e) => $(v[e])
61
- )) ?? [];
62
- }
50
+ ), b = (t) => {
51
+ !a.value || !d.value || (f.value ? x.edit(
52
+ a.value.uid,
53
+ "selectedSecuritySchemeUids",
54
+ t
55
+ ) : M.edit(
56
+ d.value.uid,
57
+ "selectedSecuritySchemeUids",
58
+ t
59
+ ));
60
+ }, n = v(
61
+ () => S.selectedSecuritySchemeUids.map(
62
+ (t) => $(p[t])
63
+ )
63
64
  );
64
- function U(t) {
65
- var d, s;
66
- if (!((d = u.value) != null && d.uid) || !((s = r.value) != null && s.uid)) return;
67
- const e = t.find((l) => l.payload), o = t.filter((l) => !l.payload).map(({ id: l }) => l);
65
+ function N(t) {
66
+ var C, U;
67
+ if (!((C = a.value) != null && C.uid) || !((U = d.value) != null && U.uid)) return;
68
+ const e = t.find((s) => s.payload), l = t.filter((s) => !s.payload).map(({ id: s }) => s);
68
69
  if (e != null && e.payload) {
69
- const l = M.add(
70
+ const s = V.add(
70
71
  e.payload,
71
- u.value.uid
72
+ a.value.uid
72
73
  );
73
- o.push(l.uid);
74
+ l.push(s.uid);
74
75
  }
75
- const m = o.filter((l) => !u.value.auth[l]);
76
- D.edit(
77
- u.value.uid,
76
+ const g = l.filter((s) => !a.value.auth[s]);
77
+ x.edit(
78
+ a.value.uid,
78
79
  "auth",
79
- m.reduce((l, f) => (l[f] = Q(v[f]), l), u.value.auth)
80
- ), b.edit(
81
- r.value.uid,
82
- "selectedSecuritySchemeUids",
83
- o
84
- );
80
+ g.reduce((s, k) => (s[k] = X(p[k]), s), a.value.auth)
81
+ ), b(l);
85
82
  }
86
- const T = (t) => r.value && b.edit(
87
- r.value.uid,
88
- "selectedSecuritySchemeUids",
89
- r.value.selectedSecuritySchemeUids.filter(
90
- (e) => e !== t
91
- )
83
+ const q = (t) => b(
84
+ S.selectedSecuritySchemeUids.filter((e) => e !== t)
92
85
  );
93
- function j(t) {
94
- g.value = t, y.show();
86
+ function F(t) {
87
+ y.value = t, h.show();
95
88
  }
96
- return (t, e) => (p(), F(E, {
89
+ return (t, e) => (u(), O(H, {
97
90
  class: "group/params",
98
- itemCount: h.value.length
91
+ itemCount: n.value.length
99
92
  }, {
100
- title: n(() => [
101
- c("div", le, w(t.title), 1)
93
+ title: c(() => [
94
+ r("div", se, A(t.title), 1)
102
95
  ]),
103
- default: n(() => [
104
- c("form", null, [
105
- a(i(Y), {
96
+ default: c(() => [
97
+ r("form", null, [
98
+ i(o(Z), {
106
99
  class: "flex-1",
107
100
  columns: [""]
108
101
  }, {
109
- default: n(() => [
110
- a(i(Z), null, {
111
- default: n(() => [
112
- a(i(ee), { class: "relative col-span-full cursor-pointer py-[0px] px-[0px] flex items-center" }, {
113
- default: n(() => [
114
- a(i(H), {
102
+ default: c(() => [
103
+ i(o(ee), null, {
104
+ default: c(() => [
105
+ i(o(te), { class: "relative col-span-full cursor-pointer py-[0px] px-[0px] flex items-center" }, {
106
+ default: c(() => [
107
+ i(o(P), {
115
108
  ref_key: "comboboxRef",
116
- ref: V,
109
+ ref: R,
117
110
  class: "text-xs w-full",
118
111
  fullWidth: "",
119
- isDeletable: "",
120
- modelValue: h.value,
112
+ isDeletable: !o(f),
113
+ modelValue: n.value,
121
114
  multiple: "",
122
- options: R.value,
115
+ options: B.value,
123
116
  style: { "margin-left": "120px" },
124
- teleport: `#${k}`,
125
- onDelete: j,
126
- "onUpdate:modelValue": U
117
+ teleport: `#${_}`,
118
+ onDelete: F,
119
+ "onUpdate:modelValue": N
127
120
  }, {
128
- default: n(() => [
129
- a(i(L), {
121
+ default: c(() => [
122
+ i(o(G), {
130
123
  class: "h-auto py-0 px-0 text-c-2 hover:text-c-1 font-normal justify-start",
131
124
  fullWidth: "",
132
125
  variant: "ghost"
133
126
  }, {
134
- default: n(() => [
135
- e[3] || (e[3] = c("div", { class: "text-c-2 h-8 flex min-w-[120px] items-center border-r-1/2 pr-0 pl-2" }, " Auth Type ", -1)),
136
- h.value.length ? (p(), x("div", oe, [
137
- e[1] || (e[1] = c("div", { class: "fade-left" }, null, -1)),
138
- c("div", se, [
139
- (p(!0), x(I, null, W(h.value, (o) => (p(), x("span", {
140
- key: o.id,
141
- class: "cm-pill flex items-center mx-0 h-fit pr-1"
127
+ default: c(() => [
128
+ e[3] || (e[3] = r("div", { class: "text-c-1 h-8 flex min-w-[94px] items-center pr-0 pl-2" }, " Auth Type ", -1)),
129
+ n.value.length ? (u(), m("div", oe, [
130
+ e[1] || (e[1] = r("div", { class: "fade-left" }, null, -1)),
131
+ r("div", ie, [
132
+ (u(!0), m(W, null, z(n.value, (l) => (u(), m("span", {
133
+ key: l.id,
134
+ class: "cm-pill flex items-center mx-0 h-fit pr-1 !bg-b-2 text-c-1"
142
135
  }, [
143
- q(w(o.label) + " ", 1),
144
- a(i(A), {
136
+ E(A(l.label) + " ", 1),
137
+ i(o(D), {
145
138
  class: "ml-1 cursor-pointer text-c-3 hover:text-c-1",
146
139
  icon: "Close",
147
140
  size: "xs",
148
- onClick: z((m) => T(o.id), ["stop"])
141
+ onClick: j((g) => q(l.id), ["stop"])
149
142
  }, null, 8, ["onClick"])
150
143
  ]))), 128))
151
144
  ]),
152
- e[2] || (e[2] = c("div", { class: "fade-right" }, null, -1))
153
- ])) : (p(), x("div", ae, " None ")),
154
- a(i(A), {
145
+ e[2] || (e[2] = r("div", { class: "fade-right" }, null, -1))
146
+ ])) : (u(), m("div", ae, " None ")),
147
+ i(o(D), {
155
148
  class: "min-w-3 ml-auto mr-2.5",
156
149
  icon: "ChevronDown",
157
150
  size: "xs"
@@ -161,23 +154,23 @@ const le = { class: "flex gap-1" }, oe = {
161
154
  })
162
155
  ]),
163
156
  _: 1
164
- }, 8, ["modelValue", "options", "teleport"])
157
+ }, 8, ["isDeletable", "modelValue", "options", "teleport"])
165
158
  ]),
166
159
  _: 1
167
160
  })
168
161
  ]),
169
162
  _: 1
170
163
  }),
171
- a(J)
164
+ i(Q, { selectedSecuritySchemeUids: t.selectedSecuritySchemeUids }, null, 8, ["selectedSecuritySchemeUids"])
172
165
  ]),
173
166
  _: 1
174
167
  }),
175
- a(G, {
176
- scheme: g.value,
177
- state: i(y),
178
- onClose: e[0] || (e[0] = (o) => i(y).hide())
168
+ i(K, {
169
+ scheme: y.value,
170
+ state: o(h),
171
+ onClose: e[0] || (e[0] = (l) => o(h).hide())
179
172
  }, null, 8, ["scheme", "state"]),
180
- c("div", { id: k })
173
+ r("div", { id: _ })
181
174
  ])
182
175
  ]),
183
176
  _: 1
@@ -185,5 +178,5 @@ const le = { class: "flex gap-1" }, oe = {
185
178
  }
186
179
  });
187
180
  export {
188
- _e as default
181
+ ye as default
189
182
  };
@@ -1,3 +1,7 @@
1
- declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
1
+ declare const _default: import("vue").DefineComponent<{
2
+ selectedSecuritySchemeUids: string[];
3
+ }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
4
+ selectedSecuritySchemeUids: string[];
5
+ }> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
2
6
  export default _default;
3
7
  //# sourceMappingURL=RequestExampleAuth.vue.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"RequestExampleAuth.vue.d.ts","sourceRoot":"","sources":["../../../../../src/views/Request/RequestSection/RequestAuth/RequestExampleAuth.vue"],"names":[],"mappings":";AA0eA,wBAKG"}
1
+ {"version":3,"file":"RequestExampleAuth.vue.d.ts","sourceRoot":"","sources":["../../../../../src/views/Request/RequestSection/RequestAuth/RequestExampleAuth.vue"],"names":[],"mappings":";gCA+J8B,MAAM,EAAE;;gCAAR,MAAM,EAAE;;AAmVtC,wBAMG"}
@@ -1,49 +1,52 @@
1
- import { defineComponent as w, computed as x, openBlock as r, createElementBlock as s, Fragment as f, renderList as g, createVNode as d, unref as i, withCtx as l, createBlock as k, createTextVNode as n, toDisplayString as T, createCommentVNode as _, capitalize as B } from "vue";
2
- import V from "../RequestAuthDataTableInput.vue.js";
3
- import S from "./OAuth2.vue.js";
1
+ import { defineComponent as b, computed as g, openBlock as r, createElementBlock as s, Fragment as f, renderList as x, createVNode as o, unref as i, withCtx as l, createBlock as k, createTextVNode as n, toDisplayString as T, createCommentVNode as c, capitalize as B } from "vue";
2
+ import y from "../RequestAuthDataTableInput.vue.js";
3
+ import E from "./OAuth2.vue.js";
4
4
  import p from "../../../../components/DataTable/DataTableRow.vue.js";
5
- import E from "../../../../components/DataTable/DataTableCell.vue.js";
6
- import { isOauth2Example as F } from "../../libs/oauth2.js";
7
- import { useWorkspace as R } from "../../../../store/store.js";
8
- const A = /* @__PURE__ */ w({
5
+ import F from "../../../../components/DataTable/DataTableCell.vue.js";
6
+ import { isOauth2Example as R } from "../../libs/oauth2.js";
7
+ import { useWorkspace as C } from "../../../../store/store.js";
8
+ const A = /* @__PURE__ */ b({
9
9
  __name: "RequestExampleAuth",
10
- setup(C) {
11
- const { activeCollection: y, activeRequest: U, collectionMutators: v, securitySchemes: $ } = R(), c = x(() => !y.value || !U.value ? [] : U.value.selectedSecuritySchemeUids.map((o) => ({
12
- example: y.value.auth[o],
13
- scheme: $[o]
10
+ props: {
11
+ selectedSecuritySchemeUids: {}
12
+ },
13
+ setup(_) {
14
+ const { activeCollection: V, activeRequest: $, collectionMutators: v, securitySchemes: w } = C(), U = g(() => !V.value || !$.value ? [] : _.selectedSecuritySchemeUids.map((d) => ({
15
+ example: V.value.auth[d],
16
+ scheme: w[d]
14
17
  })));
15
- function b(o) {
16
- return `${B(o.nameKey)}: ${o.type} ${o.type === "oauth2" ? o.flow.type : ""}`;
18
+ function S(d) {
19
+ return `${B(d.nameKey)}: ${d.type} ${d.type === "oauth2" ? d.flow.type : ""}`;
17
20
  }
18
- function m(o, u, e, t) {
21
+ function m(d, u, e, t) {
19
22
  var a;
20
- (a = y.value) != null && a.uid && v.edit(
21
- y.value.uid,
22
- `auth.${o}.${e}`,
23
+ (a = V.value) != null && a.uid && v.edit(
24
+ V.value.uid,
25
+ `auth.${d}.${e}`,
23
26
  t
24
27
  );
25
28
  }
26
- return (o, u) => (r(!0), s(f, null, g(c.value, ({ scheme: e, example: t }) => (r(), s(f, {
29
+ return (d, u) => (r(!0), s(f, null, x(U.value, ({ scheme: e, example: t }) => (r(), s(f, {
27
30
  key: e.uid
28
31
  }, [
29
- d(i(p), { class: "group/delete" }, {
32
+ o(i(p), { class: "group/delete" }, {
30
33
  default: l(() => [
31
- c.value.length > 1 ? (r(), k(i(E), {
34
+ U.value.length > 1 ? (r(), k(i(F), {
32
35
  key: 0,
33
- class: "text-c-2 pl-2 text-xs font-medium flex items-center bg-b-2"
36
+ class: "text-c-3 pl-2 font-medium flex items-center"
34
37
  }, {
35
38
  default: l(() => [
36
- n(T(b(e)), 1)
39
+ n(T(S(e)), 1)
37
40
  ]),
38
41
  _: 2
39
- }, 1024)) : _("", !0)
42
+ }, 1024)) : c("", !0)
40
43
  ]),
41
44
  _: 2
42
45
  }, 1024),
43
46
  e.type === "http" && t.type === "http" ? (r(), s(f, { key: 0 }, [
44
47
  e.scheme === "bearer" ? (r(), k(i(p), { key: 0 }, {
45
48
  default: l(() => [
46
- d(V, {
49
+ o(y, {
47
50
  id: `http-bearer-token-${e.uid}`,
48
51
  modelValue: t.token,
49
52
  placeholder: "Token",
@@ -58,9 +61,9 @@ const A = /* @__PURE__ */ w({
58
61
  ]),
59
62
  _: 2
60
63
  }, 1024)) : e.scheme === "basic" ? (r(), s(f, { key: 1 }, [
61
- d(i(p), null, {
64
+ o(i(p), null, {
62
65
  default: l(() => [
63
- d(V, {
66
+ o(y, {
64
67
  id: `http-basic-username-${e.uid}`,
65
68
  class: "text-c-2",
66
69
  modelValue: t.username,
@@ -76,9 +79,9 @@ const A = /* @__PURE__ */ w({
76
79
  ]),
77
80
  _: 2
78
81
  }, 1024),
79
- d(i(p), null, {
82
+ o(i(p), null, {
80
83
  default: l(() => [
81
- d(V, {
84
+ o(y, {
82
85
  id: `http-basic-password-${e.uid}`,
83
86
  modelValue: t.password,
84
87
  placeholder: "xxxxxx",
@@ -93,11 +96,11 @@ const A = /* @__PURE__ */ w({
93
96
  ]),
94
97
  _: 2
95
98
  }, 1024)
96
- ], 64)) : _("", !0)
99
+ ], 64)) : c("", !0)
97
100
  ], 64)) : e.type === "apiKey" && t.type === "apiKey" ? (r(), s(f, { key: 1 }, [
98
- d(i(p), null, {
101
+ o(i(p), null, {
99
102
  default: l(() => [
100
- d(V, {
103
+ o(y, {
101
104
  id: `api-key-name-${e.uid}`,
102
105
  modelValue: t.name,
103
106
  placeholder: "api-key",
@@ -111,9 +114,9 @@ const A = /* @__PURE__ */ w({
111
114
  ]),
112
115
  _: 2
113
116
  }, 1024),
114
- d(i(p), null, {
117
+ o(i(p), null, {
115
118
  default: l(() => [
116
- d(V, {
119
+ o(y, {
117
120
  id: `api-key-value-add-${e.uid}`,
118
121
  modelValue: t.value,
119
122
  placeholder: "QUxMIFlPVVIgQkFTRSBBUkUgQkVMT05HIFRPIFVT",
@@ -127,11 +130,11 @@ const A = /* @__PURE__ */ w({
127
130
  ]),
128
131
  _: 2
129
132
  }, 1024)
130
- ], 64)) : e.type === "oauth2" && i(F)(t) ? (r(), k(S, {
133
+ ], 64)) : e.type === "oauth2" && i(R)(t) ? (r(), k(E, {
131
134
  key: 2,
132
135
  example: t,
133
136
  scheme: e
134
- }, null, 8, ["example", "scheme"])) : _("", !0)
137
+ }, null, 8, ["example", "scheme"])) : c("", !0)
135
138
  ], 64))), 128));
136
139
  }
137
140
  });
@@ -1,3 +1,7 @@
1
- declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
1
+ declare const _default: import("vue").DefineComponent<{
2
+ selectedSecuritySchemeUids: string[];
3
+ }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
4
+ selectedSecuritySchemeUids: string[];
5
+ }> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
2
6
  export default _default;
3
7
  //# sourceMappingURL=RequestSection.vue.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"RequestSection.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestSection.vue"],"names":[],"mappings":";AAiZA,wBAKG"}
1
+ {"version":3,"file":"RequestSection.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestSection.vue"],"names":[],"mappings":";gCA4K8B,MAAM,EAAE;;gCAAR,MAAM,EAAE;;AA4QtC,wBAMG"}
@@ -1,120 +1,7 @@
1
- import { defineComponent as S, computed as _, ref as g, watch as b, openBlock as m, createBlock as C, withCtx as x, createElementVNode as A, unref as r, createElementBlock as p, createCommentVNode as V, toDisplayString as w, createVNode as s, withDirectives as u, vShow as n } from "vue";
2
- import H from "../../../components/ContextBar.vue.js";
3
- import R from "../../../components/ViewLayout/ViewLayoutSection.vue.js";
4
- import N from "./RequestBody.vue.js";
5
- import v from "./RequestParams.vue.js";
6
- import K from "./RequestPathParams.vue.js";
7
- import { canMethodHaveBody as f } from "@scalar/oas-utils/helpers";
8
- import E from "./RequestAuth/RequestAuth.vue.js";
9
- import { useWorkspace as Q } from "../../../store/store.js";
10
- const $ = { class: "flex-1 flex gap-1 items-center lg:pr-24 pointer-events-none" }, D = {
11
- key: 0,
12
- class: "absolute w-full h-full top-0 left-0 pointer-events-auto opacity-0 cursor-text",
13
- for: "requestname"
14
- }, M = ["value"], P = {
15
- key: 2,
16
- class: "text-c-1"
17
- }, I = { class: "request-section-content custom-scroll flex flex-1 flex-col px-2 xl:px-4 py-2.5" }, X = /* @__PURE__ */ S({
18
- __name: "RequestSection",
19
- setup(O) {
20
- const { activeRequest: a, activeExample: h, isReadOnly: d, requestMutators: k } = Q(), B = _(() => {
21
- var l, o;
22
- const t = /* @__PURE__ */ new Set([
23
- "All",
24
- "Query",
25
- "Auth",
26
- "Variables",
27
- "Cookies",
28
- "Headers",
29
- "Body"
30
- ]);
31
- return (l = h.value) != null && l.parameters.path.length || t.delete("Variables"), f(((o = a.value) == null ? void 0 : o.method) ?? "get") || t.delete("Body"), y.value && t.delete("Auth"), [...t];
32
- }), y = _(
33
- () => {
34
- var t, l;
35
- return d.value && ((l = (t = a.value) == null ? void 0 : t.security) == null ? void 0 : l.length) === 0;
36
- }
37
- ), e = g("All");
38
- b(a, (t) => {
39
- e.value === "Body" && t && !f(t.method) && (e.value = "All");
40
- });
41
- const q = (t) => {
42
- if (!a.value) return;
43
- const l = t.target;
44
- k.edit(a.value.uid, "summary", l.value);
45
- };
46
- return (t, l) => (m(), C(R, null, {
47
- title: x(() => {
48
- var o, i;
49
- return [
50
- A("div", $, [
51
- r(d) ? V("", !0) : (m(), p("label", D)),
52
- r(d) ? (m(), p("span", P, w((i = r(a)) == null ? void 0 : i.summary), 1)) : (m(), p("input", {
53
- key: 1,
54
- id: "requestname",
55
- class: "outline-none border-0 text-c-1 rounded pointer-events-auto relative w-full",
56
- placeholder: "Request Name",
57
- value: (o = r(a)) == null ? void 0 : o.summary,
58
- onInput: q
59
- }, null, 40, M))
60
- ]),
61
- s(H, {
62
- activeSection: e.value,
63
- sections: B.value,
64
- onSetActiveSection: l[0] || (l[0] = (c) => e.value = c)
65
- }, null, 8, ["activeSection", "sections"])
66
- ];
67
- }),
68
- default: x(() => {
69
- var o, i, c;
70
- return [
71
- A("div", I, [
72
- u(s(E, { title: "Authentication" }, null, 512), [
73
- [
74
- n,
75
- !y.value && (e.value === "All" || e.value === "Auth")
76
- ]
77
- ]),
78
- u(s(K, {
79
- paramKey: "path",
80
- title: "Path Variables"
81
- }, null, 512), [
82
- [
83
- n,
84
- (e.value === "All" || e.value === "Variables") && ((c = (i = (o = r(h)) == null ? void 0 : o.parameters) == null ? void 0 : i.path) == null ? void 0 : c.length)
85
- ]
86
- ]),
87
- u(s(v, {
88
- paramKey: "cookies",
89
- title: "Cookies"
90
- }, null, 512), [
91
- [n, e.value === "All" || e.value === "Cookies"]
92
- ]),
93
- u(s(v, {
94
- paramKey: "headers",
95
- title: "Headers"
96
- }, null, 512), [
97
- [n, e.value === "All" || e.value === "Headers"]
98
- ]),
99
- u(s(v, {
100
- paramKey: "query",
101
- title: "Query Parameters"
102
- }, null, 512), [
103
- [n, e.value === "All" || e.value === "Query"]
104
- ]),
105
- u(s(N, { title: "Body" }, null, 512), [
106
- [
107
- n,
108
- r(a) && (e.value === "All" || e.value === "Body") && r(f)(r(a).method)
109
- ]
110
- ])
111
- ])
112
- ];
113
- }),
114
- _: 1
115
- }));
116
- }
117
- });
1
+ import o from "./RequestSection.vue2.js";
2
+ /* empty css */
3
+ import t from "../../../_virtual/_plugin-vue_export-helper.js";
4
+ const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-1039132b"]]);
118
5
  export {
119
- X as default
6
+ p as default
120
7
  };