@scalar/api-client 2.2.22 → 2.2.24

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 (127) hide show
  1. package/CHANGELOG.md +22 -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/AddressBar/AddressBar.vue2.js +69 -70
  5. package/dist/components/AddressBar/AddressBarServer.vue.d.ts.map +1 -1
  6. package/dist/components/AddressBar/AddressBarServer.vue.js +69 -61
  7. package/dist/components/AddressBar/AddressBarServerItem.vue.d.ts.map +1 -1
  8. package/dist/components/AddressBar/AddressBarServerItem.vue.js +17 -16
  9. package/dist/components/CodeInput/CodeInput.vue.d.ts.map +1 -1
  10. package/dist/components/CodeInput/CodeInput.vue.js +2 -2
  11. package/dist/components/CodeInput/CodeInput.vue2.js +46 -46
  12. package/dist/components/CodeInput/codeVariableWidget.d.ts +4 -4
  13. package/dist/components/CodeInput/codeVariableWidget.d.ts.map +1 -1
  14. package/dist/components/CodeInput/codeVariableWidget.js +42 -38
  15. package/dist/components/CommandPalette/CommandPaletteCollection.vue.js +25 -24
  16. package/dist/components/CommandPalette/CommandPaletteExample.vue.d.ts +1 -1
  17. package/dist/components/CommandPalette/CommandPaletteExample.vue.d.ts.map +1 -1
  18. package/dist/components/CommandPalette/CommandPaletteExample.vue.js +64 -55
  19. package/dist/components/CommandPalette/CommandPaletteImport.vue.d.ts.map +1 -1
  20. package/dist/components/CommandPalette/CommandPaletteImport.vue.js +110 -106
  21. package/dist/components/CommandPalette/CommandPaletteRequest.vue.js +2 -2
  22. package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts +1 -1
  23. package/dist/components/CommandPalette/TheCommandPalette.vue.js +1 -1
  24. package/dist/components/CommandPalette/TheCommandPalette.vue2.js +38 -37
  25. package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.d.ts.map +1 -1
  26. package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.js +52 -49
  27. package/dist/components/ImportCollection/DropEventListener.vue.d.ts.map +1 -1
  28. package/dist/components/ImportCollection/DropEventListener.vue.js +46 -43
  29. package/dist/components/ImportCollection/ImportCollectionModal.vue.js +40 -39
  30. package/dist/components/ImportCollection/ImportNowButton.vue.js +44 -42
  31. package/dist/components/ImportCollection/WorkspaceSelector.vue.js +76 -69
  32. package/dist/components/ScalarAsciiArt.vue.js +1 -1
  33. package/dist/components/ScalarAsciiArt.vue2.js +22 -19
  34. package/dist/components/Search/useSearch.d.ts.map +1 -1
  35. package/dist/components/Search/useSearch.js +57 -49
  36. package/dist/components/SideNav/SideNavRouterLink.vue.d.ts.map +1 -1
  37. package/dist/components/SideNav/SideNavRouterLink.vue.js +22 -19
  38. package/dist/components/Sidebar/SidebarListElement.vue.d.ts.map +1 -1
  39. package/dist/components/Sidebar/SidebarListElement.vue.js +2 -2
  40. package/dist/components/Sidebar/SidebarListElement.vue2.js +38 -36
  41. package/dist/components/TopNav/TopNav.vue.d.ts.map +1 -1
  42. package/dist/components/TopNav/TopNav.vue.js +71 -64
  43. package/dist/layouts/App/ApiClientApp.vue.js +4 -1
  44. package/dist/layouts/Modal/ApiClientModal.vue.js +2 -2
  45. package/dist/layouts/Modal/ApiClientModal.vue2.js +22 -19
  46. package/dist/layouts/Web/ApiClientWeb.vue.js +4 -1
  47. package/dist/libs/create-client.d.ts +10 -10
  48. package/dist/libs/create-client.d.ts.map +1 -1
  49. package/dist/libs/create-client.js +42 -36
  50. package/dist/libs/extractAttachmentFilename.d.ts +3 -0
  51. package/dist/libs/extractAttachmentFilename.d.ts.map +1 -1
  52. package/dist/libs/extractAttachmentFilename.js +7 -7
  53. package/dist/libs/importers/curl.d.ts.map +1 -1
  54. package/dist/libs/importers/curl.js +18 -18
  55. package/dist/libs/normalize-headers.d.ts.map +1 -1
  56. package/dist/libs/normalize-headers.js +2 -2
  57. package/dist/libs/parse-curl.js +39 -36
  58. package/dist/store/active-entities.d.ts +4 -4
  59. package/dist/store/active-entities.d.ts.map +1 -1
  60. package/dist/store/active-entities.js +88 -86
  61. package/dist/store/collections.d.ts.map +1 -1
  62. package/dist/store/collections.js +29 -29
  63. package/dist/store/request-example.d.ts.map +1 -1
  64. package/dist/store/request-example.js +27 -23
  65. package/dist/store/requests.d.ts.map +1 -1
  66. package/dist/store/requests.js +94 -77
  67. package/dist/store/security-schemes.d.ts.map +1 -1
  68. package/dist/store/security-schemes.js +27 -27
  69. package/dist/store/servers.d.ts.map +1 -1
  70. package/dist/store/servers.js +18 -18
  71. package/dist/store/tags.d.ts.map +1 -1
  72. package/dist/store/tags.js +35 -33
  73. package/dist/style.css +1 -1
  74. package/dist/views/Cookies/CookieForm.vue.d.ts.map +1 -1
  75. package/dist/views/Cookies/CookieForm.vue.js +14 -9
  76. package/dist/views/Cookies/Cookies.vue.d.ts.map +1 -1
  77. package/dist/views/Cookies/Cookies.vue2.js +39 -37
  78. package/dist/views/Environment/Environment.vue.d.ts.map +1 -1
  79. package/dist/views/Environment/Environment.vue2.js +94 -89
  80. package/dist/views/Request/Request.vue.d.ts.map +1 -1
  81. package/dist/views/Request/Request.vue.js +1 -1
  82. package/dist/views/Request/Request.vue2.js +118 -116
  83. package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.d.ts.map +1 -1
  84. package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.js +28 -25
  85. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.d.ts.map +1 -1
  86. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.js +1 -1
  87. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue2.js +38 -37
  88. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.d.ts.map +1 -1
  89. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.js +2 -2
  90. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue2.js +76 -73
  91. package/dist/views/Request/RequestSection/RequestAuth/RequestExampleAuth.vue.js +2 -2
  92. package/dist/views/Request/RequestSection/RequestAuth/RequestExampleAuth.vue2.js +80 -80
  93. package/dist/views/Request/RequestSection/RequestBody.vue.d.ts.map +1 -1
  94. package/dist/views/Request/RequestSection/RequestBody.vue.js +1 -1
  95. package/dist/views/Request/RequestSection/RequestBody.vue2.js +192 -178
  96. package/dist/views/Request/RequestSection/RequestParams.vue.d.ts.map +1 -1
  97. package/dist/views/Request/RequestSection/RequestParams.vue.js +80 -73
  98. package/dist/views/Request/RequestSection/RequestPathParams.vue.d.ts.map +1 -1
  99. package/dist/views/Request/RequestSection/RequestPathParams.vue.js +50 -48
  100. package/dist/views/Request/RequestSidebar.vue.d.ts.map +1 -1
  101. package/dist/views/Request/RequestSidebar.vue.js +1 -1
  102. package/dist/views/Request/RequestSidebar.vue2.js +149 -144
  103. package/dist/views/Request/RequestSidebarItem.vue.d.ts.map +1 -1
  104. package/dist/views/Request/RequestSidebarItem.vue.js +2 -2
  105. package/dist/views/Request/RequestSidebarItem.vue2.js +168 -150
  106. package/dist/views/Request/RequestSidebarItemMenu.vue.d.ts.map +1 -1
  107. package/dist/views/Request/RequestSidebarItemMenu.vue.js +4 -4
  108. package/dist/views/Request/RequestSidebarItemMenu.vue2.js +80 -80
  109. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  110. package/dist/views/Request/ResponseSection/ResponseSection.vue.js +1 -1
  111. package/dist/views/Request/ResponseSection/ResponseSection.vue2.js +1 -1
  112. package/dist/views/Request/components/WorkspaceDropdown.vue.d.ts.map +1 -1
  113. package/dist/views/Request/components/WorkspaceDropdown.vue.js +166 -156
  114. package/dist/views/Request/handle-drag.d.ts.map +1 -1
  115. package/dist/views/Request/handle-drag.js +37 -31
  116. package/dist/views/Request/hooks/useOpenApiWatcher.js +27 -27
  117. package/dist/views/Request/libs/live-sync.d.ts.map +1 -1
  118. package/dist/views/Request/libs/live-sync.js +147 -130
  119. package/dist/views/Request/types/sidebar-item.d.ts +4 -1
  120. package/dist/views/Request/types/sidebar-item.d.ts.map +1 -1
  121. package/dist/views/Servers/ServerForm.vue.js +38 -35
  122. package/dist/views/Servers/Servers.vue2.js +38 -35
  123. package/dist/views/Settings/Settings.vue.d.ts.map +1 -1
  124. package/dist/views/Settings/Settings.vue2.js +15 -15
  125. package/dist/views/Settings/SettingsGeneral.vue.d.ts.map +1 -1
  126. package/dist/views/Settings/SettingsGeneral.vue.js +206 -174
  127. package/package.json +8 -8
@@ -1,55 +1,56 @@
1
- import { defineComponent as j, ref as x, computed as h, openBlock as a, createElementBlock as c, createVNode as r, unref as s, normalizeClass as k, withCtx as m, Fragment as U, createElementVNode as d, renderList as W, createTextVNode as H, toDisplayString as L, withModifiers as D, withKeys as P, createBlock as G, createCommentVNode as $ } from "vue";
2
- import { useActiveEntities as J } from "../../../../store/active-entities.js";
3
- import { useModal as Q, ScalarComboboxMultiselect as X, ScalarButton as Y, ScalarIconButton as Z, ScalarIcon as ee } from "@scalar/components";
4
- import { nanoid as te } from "nanoid";
5
- import le from "./DeleteRequestAuthModal.vue.js";
6
- import oe from "./RequestExampleAuth.vue.js";
1
+ import { defineComponent as W, ref as x, computed as y, openBlock as r, createElementBlock as c, createVNode as a, unref as s, normalizeClass as k, withCtx as m, Fragment as D, createElementVNode as d, renderList as H, createTextVNode as L, toDisplayString as P, withModifiers as U, withKeys as G, createBlock as J, createCommentVNode as $ } from "vue";
2
+ import { useActiveEntities as Q } from "../../../../store/active-entities.js";
3
+ import { useModal as X, ScalarComboboxMultiselect as Y, ScalarButton as Z, ScalarIconButton as ee, ScalarIcon as te } from "@scalar/components";
4
+ import { isDefined as B } from "@scalar/oas-utils/helpers";
5
+ import { nanoid as le } from "nanoid";
6
+ import oe from "./DeleteRequestAuthModal.vue.js";
7
+ import se from "./RequestExampleAuth.vue.js";
7
8
  import { displaySchemeFormatter as R } from "../../libs/auth.js";
8
- import { ADD_AUTH_OPTIONS as se } from "../../consts/new-auth-options.js";
9
- import ie from "../../../../components/DataTable/DataTable.vue.js";
10
- import B from "../../../../components/DataTable/DataTableRow.vue.js";
11
- import ne from "../../../../components/DataTable/DataTableHeader.vue.js";
9
+ import { ADD_AUTH_OPTIONS as ie } from "../../consts/new-auth-options.js";
10
+ import ne from "../../../../components/DataTable/DataTable.vue.js";
11
+ import M from "../../../../components/DataTable/DataTableRow.vue.js";
12
+ import re from "../../../../components/DataTable/DataTableHeader.vue.js";
12
13
  import { useWorkspace as ae } from "../../../../store/store.js";
13
- const re = {
14
+ const ce = {
14
15
  key: 0,
15
16
  class: "flex relative scroll-timeline-x w-full"
16
- }, ce = { class: "flex flex-1 gap-0.25 mr-1.5 items-center" }, ue = {
17
+ }, ue = { class: "flex flex-1 gap-0.25 mr-1.5 items-center" }, me = {
17
18
  key: 1,
18
19
  class: "pl-2"
19
- }, me = {
20
+ }, de = {
20
21
  key: 1,
21
22
  class: "text-c-3 uppercase font-medium"
22
- }, de = {
23
+ }, fe = {
23
24
  key: 0,
24
25
  class: "border-1/2 flex items-center min-h-8 min-w-8 px-2 rounded text-sm"
25
- }, qe = /* @__PURE__ */ j({
26
+ }, ge = /* @__PURE__ */ W({
26
27
  __name: "RequestAuthDataTable",
27
28
  props: {
28
29
  selectedSecuritySchemeUids: {},
29
30
  layout: { default: "client" }
30
31
  },
31
- setup(y) {
32
- const { activeCollection: u, activeRequest: f } = J(), {
33
- collectionMutators: M,
34
- isReadOnly: v,
35
- requestMutators: V,
32
+ setup(v) {
33
+ const { activeCollection: u, activeRequest: f } = Q(), {
34
+ collectionMutators: V,
35
+ isReadOnly: b,
36
+ requestMutators: N,
36
37
  securitySchemes: _,
37
- securitySchemeMutators: N
38
- } = ae(), T = x(null), w = x(null), b = Q(), q = x(void 0), A = `combobox-${te()}`, E = h(() => {
38
+ securitySchemeMutators: T
39
+ } = ae(), E = x(null), w = x(null), S = X(), q = x(void 0), A = `combobox-${le()}`, I = y(() => {
39
40
  var l, i, n;
40
- const e = (y.layout === "client" ? ((l = f.value) == null ? void 0 : l.security) ?? ((i = u.value) == null ? void 0 : i.security) : (n = u.value) == null ? void 0 : n.security) ?? [];
41
+ const e = (v.layout === "client" ? ((l = f.value) == null ? void 0 : l.security) ?? ((i = u.value) == null ? void 0 : i.security) : (n = u.value) == null ? void 0 : n.security) ?? [];
41
42
  return { filteredRequirements: e.filter((o) => Object.keys(o).length), requirements: e };
42
- }), I = h(() => {
43
+ }), O = y(() => {
43
44
  var t;
44
- return (((t = u.value) == null ? void 0 : t.securitySchemes) ?? []).map((l) => _[l]).filter((l) => l);
45
- }), O = h(
45
+ return (((t = u.value) == null ? void 0 : t.securitySchemes) ?? []).map((l) => _[l]).filter(B);
46
+ }), z = y(
46
47
  () => {
47
- const e = [...I.value], t = [];
48
- E.value.filteredRequirements.forEach((o) => {
49
- const S = e.findIndex(
50
- (K) => K.nameKey === Object.keys(o)[0]
48
+ const e = [...O.value], t = [];
49
+ I.value.filteredRequirements.forEach((o) => {
50
+ const h = e.findIndex(
51
+ (j) => j.nameKey === Object.keys(o)[0]
51
52
  );
52
- S > -1 && (t.push(e[S]), e.splice(S, 1));
53
+ h > -1 && e[h] && (t.push(e[h]), e.splice(h, 1));
53
54
  });
54
55
  const l = e.map(
55
56
  (o) => R(o)
@@ -59,32 +60,34 @@ const re = {
59
60
  { label: "Required authentication", options: i },
60
61
  { label: "Available authentication", options: l }
61
62
  ];
62
- return v ? i.length ? n : l : (n.push({
63
+ return b ? i.length ? n : l : (n.push({
63
64
  label: "Add new authentication",
64
- options: se
65
+ options: ie
65
66
  }), n);
66
67
  }
67
68
  ), g = (e) => {
68
- !u.value || !f.value || (v ? M.edit(
69
+ !u.value || !f.value || (b ? V.edit(
69
70
  u.value.uid,
70
71
  "selectedSecuritySchemeUids",
71
72
  e
72
- ) : V.edit(
73
+ ) : N.edit(
73
74
  f.value.uid,
74
75
  "selectedSecuritySchemeUids",
75
76
  e
76
77
  ));
77
- }, p = h(
78
- () => y.selectedSecuritySchemeUids.map(
79
- (e) => R(_[e])
80
- )
78
+ }, p = y(
79
+ () => v.selectedSecuritySchemeUids.map((e) => {
80
+ const t = _[e ?? ""];
81
+ if (t)
82
+ return R(t);
83
+ }).filter(B)
81
84
  );
82
- function z(e) {
85
+ function F(e) {
83
86
  var i, n;
84
87
  if (!((i = u.value) != null && i.uid) || !((n = f.value) != null && n.uid)) return;
85
88
  const t = e.find((o) => o.payload), l = e.filter((o) => !o.payload).map(({ id: o }) => o);
86
89
  if (t != null && t.payload) {
87
- const o = N.add(
90
+ const o = T.add(
88
91
  t.payload,
89
92
  u.value.uid
90
93
  );
@@ -95,41 +98,41 @@ const re = {
95
98
  const C = (e) => {
96
99
  var t;
97
100
  g(
98
- y.selectedSecuritySchemeUids.filter((l) => l !== e)
101
+ v.selectedSecuritySchemeUids.filter((l) => l !== e)
99
102
  ), (t = w.value) == null || t.$el.focus();
100
103
  };
101
- function F(e) {
102
- q.value = e, b.show();
104
+ function K(e) {
105
+ q.value = e, S.show();
103
106
  }
104
- return (e, t) => (a(), c("form", null, [
105
- r(s(ie), {
107
+ return (e, t) => (r(), c("form", null, [
108
+ a(s(ne), {
106
109
  class: k(["flex-1", e.layout === "reference" && "border-0"]),
107
110
  columns: [""]
108
111
  }, {
109
112
  default: m(() => [
110
- r(s(B), null, {
113
+ a(s(M), null, {
111
114
  default: m(() => [
112
- r(s(ne), {
115
+ a(s(re), {
113
116
  class: k(["relative col-span-full cursor-pointer py-0 px-0 flex items-center", e.layout === "reference" && "border-0 min-h-0 mb-1.5"])
114
117
  }, {
115
118
  default: m(() => [
116
- r(s(X), {
119
+ a(s(Y), {
117
120
  ref_key: "comboboxRef",
118
- ref: T,
121
+ ref: E,
119
122
  class: "text-xs w-full",
120
123
  fullWidth: "",
121
- isDeletable: !s(v),
124
+ isDeletable: !s(b),
122
125
  modelValue: p.value,
123
126
  multiple: "",
124
- options: O.value,
127
+ options: z.value,
125
128
  resize: "",
126
129
  style: { "margin-left": "120px" },
127
130
  teleport: `#${A}`,
128
- onDelete: F,
129
- "onUpdate:modelValue": z
131
+ onDelete: K,
132
+ "onUpdate:modelValue": F
130
133
  }, {
131
134
  default: m(() => [
132
- r(s(Y), {
135
+ a(s(Z), {
133
136
  ref_key: "comboboxButtonRef",
134
137
  ref: w,
135
138
  class: "h-auto py-0 px-0 text-c-2 hover:text-c-1 font-normal justify-start -outline-offset-2",
@@ -137,30 +140,30 @@ const re = {
137
140
  variant: "ghost"
138
141
  }, {
139
142
  default: m(() => [
140
- e.layout === "client" ? (a(), c(U, { key: 0 }, [
143
+ e.layout === "client" ? (r(), c(D, { key: 0 }, [
141
144
  t[3] || (t[3] = d("div", { class: "text-c-1 h-8 flex min-w-[94px] items-center pr-0 pl-2" }, " Auth Type ", -1)),
142
- p.value.length ? (a(), c("div", re, [
145
+ p.value.length ? (r(), c("div", ce, [
143
146
  t[1] || (t[1] = d("div", { class: "fade-left" }, null, -1)),
144
- d("div", ce, [
145
- (a(!0), c(U, null, W(p.value, (l) => (a(), c("span", {
147
+ d("div", ue, [
148
+ (r(!0), c(D, null, H(p.value, (l) => (r(), c("span", {
146
149
  key: l.id,
147
150
  class: "cm-pill flex items-center mx-0 h-fit pr-0.5 !bg-b-2 text-c-1"
148
151
  }, [
149
- H(L(l.label) + " ", 1),
150
- r(s(Z), {
152
+ L(P(l.label) + " ", 1),
153
+ a(s(ee), {
151
154
  class: "cursor-pointer -ml-0.5 text-c-3 hover:text-c-1 rounded-full",
152
155
  icon: "Close",
153
156
  label: `Remove ${l.label}`,
154
157
  size: "xs",
155
- onClick: D((i) => C(l.id), ["stop"]),
156
- onKeydown: P(D((i) => C(l.id), ["stop"]), ["enter"])
158
+ onClick: U((i) => C(l.id), ["stop"]),
159
+ onKeydown: G(U((i) => C(l.id), ["stop"]), ["enter"])
157
160
  }, null, 8, ["label", "onClick", "onKeydown"])
158
161
  ]))), 128))
159
162
  ]),
160
163
  t[2] || (t[2] = d("div", { class: "fade-right" }, null, -1))
161
- ])) : (a(), c("div", ue, " None "))
162
- ], 64)) : (a(), c("div", me, " Authentication ")),
163
- r(s(ee), {
164
+ ])) : (r(), c("div", me, " None "))
165
+ ], 64)) : (r(), c("div", de, " Authentication ")),
166
+ a(s(te), {
164
167
  class: k(["min-w-3 mr-2.5", {
165
168
  "ml-auto": e.layout === "client",
166
169
  "ml-1": e.layout === "reference"
@@ -177,31 +180,31 @@ const re = {
177
180
  ]),
178
181
  _: 1
179
182
  }, 8, ["class"]),
180
- e.layout === "reference" ? (a(), G(s(B), { key: 0 }, {
183
+ e.layout === "reference" ? (r(), J(s(M), { key: 0 }, {
181
184
  default: m(() => [
182
- p.value.length ? $("", !0) : (a(), c("div", de, " None "))
185
+ p.value.length ? $("", !0) : (r(), c("div", fe, " None "))
183
186
  ]),
184
187
  _: 1
185
188
  })) : $("", !0)
186
189
  ]),
187
190
  _: 1
188
191
  }),
189
- r(oe, {
192
+ a(se, {
190
193
  layout: e.layout,
191
194
  selectedSecuritySchemeUids: e.selectedSecuritySchemeUids
192
195
  }, null, 8, ["layout", "selectedSecuritySchemeUids"])
193
196
  ]),
194
197
  _: 1
195
198
  }, 8, ["class"]),
196
- r(le, {
199
+ a(oe, {
197
200
  scheme: q.value,
198
- state: s(b),
199
- onClose: t[0] || (t[0] = (l) => s(b).hide())
201
+ state: s(S),
202
+ onClose: t[0] || (t[0] = (l) => s(S).hide())
200
203
  }, null, 8, ["scheme", "state"]),
201
204
  d("div", { id: A })
202
205
  ]));
203
206
  }
204
207
  });
205
208
  export {
206
- qe as default
209
+ ge as default
207
210
  };
@@ -1,7 +1,7 @@
1
1
  import t from "./RequestExampleAuth.vue2.js";
2
2
  /* empty css */
3
3
  import o from "../../../../_virtual/_plugin-vue_export-helper.js";
4
- const p = /* @__PURE__ */ o(t, [["__scopeId", "data-v-59761a00"]]);
4
+ const r = /* @__PURE__ */ o(t, [["__scopeId", "data-v-b2583e23"]]);
5
5
  export {
6
- p as default
6
+ r as default
7
7
  };
@@ -1,7 +1,7 @@
1
- import { defineComponent as K, computed as N, ref as R, openBlock as r, createElementBlock as u, Fragment as s, renderList as k, createBlock as x, unref as p, normalizeClass as v, withCtx as a, createVNode as n, createTextVNode as f, toDisplayString as $, createCommentVNode as c, createElementVNode as _, capitalize as w } from "vue";
1
+ import { defineComponent as K, computed as N, ref as R, openBlock as r, createElementBlock as u, Fragment as i, renderList as x, createBlock as C, unref as b, normalizeClass as k, withCtx as a, createVNode as n, createTextVNode as y, toDisplayString as _, createCommentVNode as m, createElementVNode as c, capitalize as w } from "vue";
2
2
  import j from "./OAuth2.vue.js";
3
- import V from "./RequestAuthDataTableInput.vue.js";
4
- import b from "../../../../components/DataTable/DataTableRow.vue.js";
3
+ import g from "./RequestAuthDataTableInput.vue.js";
4
+ import s from "../../../../components/DataTable/DataTableRow.vue.js";
5
5
  import q from "../../../../components/DataTable/DataTableCell.vue.js";
6
6
  import { useWorkspace as I } from "../../../../store/store.js";
7
7
  const E = { class: "flex flex-wrap px-2 items-center gap-1 py-1" }, M = ["onClick"], H = /* @__PURE__ */ K({
@@ -10,167 +10,167 @@ const E = { class: "flex flex-wrap px-2 items-center gap-1 py-1" }, M = ["onClic
10
10
  selectedSecuritySchemeUids: {},
11
11
  layout: { default: "client" }
12
12
  },
13
- setup(C) {
14
- const { securitySchemes: S, securitySchemeMutators: F } = I(), U = N(
15
- () => C.selectedSecuritySchemeUids.map((e) => ({
16
- scheme: S[e]
13
+ setup(U) {
14
+ const { securitySchemes: S, securitySchemeMutators: T } = I(), $ = N(
15
+ () => U.selectedSecuritySchemeUids.map((t) => ({
16
+ scheme: S[t]
17
17
  }))
18
- ), d = R(""), T = (e) => {
19
- if (e.type === "apiKey")
20
- return `${w(e.nameKey)}: ${e.in}`;
21
- if (e.type === "oauth2") {
22
- const l = Object.values(e.flows ?? {})[0];
23
- return `${w(e.nameKey)}: ${d.value ? d.value : l.type}`;
18
+ ), d = R(""), B = (t) => {
19
+ if (t.type === "apiKey")
20
+ return `${w(t.nameKey)}: ${t.in}`;
21
+ if (t.type === "oauth2") {
22
+ const l = Object.values(t.flows ?? {})[0];
23
+ return `${w(t.nameKey)}: ${d.value ? d.value : (l == null ? void 0 : l.type) ?? ""}`;
24
24
  }
25
- return e.type === "http" ? `${w(e.nameKey)}: ${e.scheme}` : `${w(e.nameKey)}: ${e.type}`;
26
- }, y = (e, l, t) => F.edit(e, l, t), m = (e = "") => C.layout === "reference" ? `bg-b-2 border-l-1/2 last:border-r-1/2 group-last:border-b-border ${e}` : "";
27
- return (e, l) => (r(!0), u(s, null, k(U.value, ({ scheme: t }, B) => (r(), u(s, {
28
- key: t.uid
25
+ return t.type === "http" ? `${w(t.nameKey)}: ${t.scheme}` : `${w(t.nameKey)}: ${t.type}`;
26
+ }, V = (t, l, e) => T.edit(t, l, e), f = (t = "") => U.layout === "reference" ? `bg-b-2 border-l-1/2 last:border-r-1/2 group-last:border-b-border ${t}` : "";
27
+ return (t, l) => (r(!0), u(i, null, x($.value, ({ scheme: e }, F) => (r(), u(i, {
28
+ key: e == null ? void 0 : e.uid
29
29
  }, [
30
- U.value.length > 1 ? (r(), x(p(b), {
30
+ $.value.length > 1 ? (r(), C(b(s), {
31
31
  key: 0,
32
- class: v({ "request-example-references-header": e.layout === "reference" })
32
+ class: k({ "request-example-references-header": t.layout === "reference" })
33
33
  }, {
34
34
  default: a(() => [
35
- n(p(q), {
36
- class: v([
35
+ n(b(q), {
36
+ class: k([
37
37
  "text-c-3 pl-2 font-medium flex items-center",
38
- m(
39
- `bg-b-1 rounded-t border-t-1/2 ${B !== 0 ? "mt-2" : ""}`
38
+ f(
39
+ `bg-b-1 rounded-t border-t-1/2 ${F !== 0 ? "mt-2" : ""}`
40
40
  )
41
41
  ])
42
42
  }, {
43
43
  default: a(() => [
44
- f($(T(t)), 1)
44
+ y(_(B(e)), 1)
45
45
  ]),
46
46
  _: 2
47
47
  }, 1032, ["class"])
48
48
  ]),
49
49
  _: 2
50
- }, 1032, ["class"])) : c("", !0),
51
- t.type === "http" ? (r(), u(s, { key: 1 }, [
52
- t.scheme === "bearer" ? (r(), x(p(b), { key: 0 }, {
50
+ }, 1032, ["class"])) : m("", !0),
51
+ (e == null ? void 0 : e.type) === "http" ? (r(), u(i, { key: 1 }, [
52
+ e.scheme === "bearer" ? (r(), C(b(s), { key: 0 }, {
53
53
  default: a(() => [
54
- n(V, {
55
- containerClass: m("bg-b-2 rounded border-1/2"),
56
- modelValue: t.token,
54
+ n(g, {
55
+ containerClass: f("bg-b-2 rounded border-1/2"),
56
+ modelValue: e.token,
57
57
  placeholder: "Token",
58
58
  type: "password",
59
- "onUpdate:modelValue": (o) => y(t.uid, "token", o)
59
+ "onUpdate:modelValue": (o) => V(e.uid, "token", o)
60
60
  }, {
61
61
  default: a(() => l[0] || (l[0] = [
62
- f(" Bearer Token ")
62
+ y(" Bearer Token ")
63
63
  ])),
64
64
  _: 2
65
65
  }, 1032, ["containerClass", "modelValue", "onUpdate:modelValue"])
66
66
  ]),
67
67
  _: 2
68
- }, 1024)) : t.scheme === "basic" ? (r(), u(s, { key: 1 }, [
69
- n(p(b), null, {
68
+ }, 1024)) : (e == null ? void 0 : e.scheme) === "basic" ? (r(), u(i, { key: 1 }, [
69
+ n(b(s), null, {
70
70
  default: a(() => [
71
- n(V, {
71
+ n(g, {
72
72
  class: "text-c-2",
73
- containerClass: m(
73
+ containerClass: f(
74
74
  "auth-blend-required bg-b-2 rounded-t border-t-1/2"
75
75
  ),
76
- modelValue: t.username,
76
+ modelValue: e.username,
77
77
  placeholder: "janedoe",
78
78
  required: "",
79
- "onUpdate:modelValue": (o) => y(t.uid, "username", o)
79
+ "onUpdate:modelValue": (o) => V(e.uid, "username", o)
80
80
  }, {
81
81
  default: a(() => l[1] || (l[1] = [
82
- f(" Username ")
82
+ y(" Username ")
83
83
  ])),
84
84
  _: 2
85
85
  }, 1032, ["containerClass", "modelValue", "onUpdate:modelValue"])
86
86
  ]),
87
87
  _: 2
88
88
  }, 1024),
89
- n(p(b), null, {
89
+ n(b(s), null, {
90
90
  default: a(() => [
91
- n(V, {
92
- containerClass: m("bg-b-2 rounded-b border-b-1/2"),
93
- modelValue: t.password,
91
+ n(g, {
92
+ containerClass: f("bg-b-2 rounded-b border-b-1/2"),
93
+ modelValue: e.password,
94
94
  placeholder: "********",
95
95
  type: "password",
96
- "onUpdate:modelValue": (o) => y(t.uid, "password", o)
96
+ "onUpdate:modelValue": (o) => V(e.uid, "password", o)
97
97
  }, {
98
98
  default: a(() => l[2] || (l[2] = [
99
- f(" Password ")
99
+ y(" Password ")
100
100
  ])),
101
101
  _: 2
102
102
  }, 1032, ["containerClass", "modelValue", "onUpdate:modelValue"])
103
103
  ]),
104
104
  _: 2
105
105
  }, 1024)
106
- ], 64)) : c("", !0)
107
- ], 64)) : t.type === "apiKey" ? (r(), u(s, { key: 2 }, [
108
- n(p(b), null, {
106
+ ], 64)) : m("", !0)
107
+ ], 64)) : (e == null ? void 0 : e.type) === "apiKey" ? (r(), u(i, { key: 2 }, [
108
+ n(b(s), null, {
109
109
  default: a(() => [
110
- n(V, {
111
- containerClass: m("bg-b-2 rounded-t border-t-1/2"),
112
- modelValue: t.name,
110
+ n(g, {
111
+ containerClass: f("bg-b-2 rounded-t border-t-1/2"),
112
+ modelValue: e.name,
113
113
  placeholder: "api-key",
114
- "onUpdate:modelValue": (o) => y(t.uid, "name", o)
114
+ "onUpdate:modelValue": (o) => V(e.uid, "name", o)
115
115
  }, {
116
116
  default: a(() => l[3] || (l[3] = [
117
- f(" Name ")
117
+ y(" Name ")
118
118
  ])),
119
119
  _: 2
120
120
  }, 1032, ["containerClass", "modelValue", "onUpdate:modelValue"])
121
121
  ]),
122
122
  _: 2
123
123
  }, 1024),
124
- n(p(b), null, {
124
+ n(b(s), null, {
125
125
  default: a(() => [
126
- n(V, {
127
- containerClass: m("bg-b-2 rounded-b border-b-1/2"),
128
- modelValue: t.value,
126
+ n(g, {
127
+ containerClass: f("bg-b-2 rounded-b border-b-1/2"),
128
+ modelValue: e.value,
129
129
  placeholder: "QUxMIFlPVVIgQkFTRSBBUkUgQkVMT05HIFRPIFVT",
130
- "onUpdate:modelValue": (o) => y(t.uid, "value", o)
130
+ "onUpdate:modelValue": (o) => V(e.uid, "value", o)
131
131
  }, {
132
132
  default: a(() => l[4] || (l[4] = [
133
- f(" Value ")
133
+ y(" Value ")
134
134
  ])),
135
135
  _: 2
136
136
  }, 1032, ["containerClass", "modelValue", "onUpdate:modelValue"])
137
137
  ]),
138
138
  _: 2
139
139
  }, 1024)
140
- ], 64)) : t.type === "oauth2" ? (r(), u(s, { key: 3 }, [
141
- n(p(b), null, {
140
+ ], 64)) : (e == null ? void 0 : e.type) === "oauth2" ? (r(), u(i, { key: 3 }, [
141
+ n(b(s), null, {
142
142
  default: a(() => [
143
- Object.keys(t.flows).length > 1 ? (r(), u("div", {
143
+ Object.keys(e.flows).length > 1 ? (r(), u("div", {
144
144
  key: 0,
145
- class: v(["min-h-8 min-w-8 flex text-sm border-t-1/2 last:border-r-0 p-0 m-0 relative row", {
146
- "border-1/2 border-b-0 rounded-t bg-b-2": e.layout === "reference"
145
+ class: k(["min-h-8 min-w-8 flex text-sm border-t-1/2 last:border-r-0 p-0 m-0 relative row", {
146
+ "border-1/2 border-b-0 rounded-t bg-b-2": t.layout === "reference"
147
147
  }])
148
148
  }, [
149
- l[5] || (l[5] = _("div", { class: "text-c-1 flex min-w-[94px] items-center pl-2 pr-0" }, " Flow ", -1)),
150
- _("div", E, [
151
- (r(!0), u(s, null, k(t.flows, (o, i, g) => (r(), u("button", {
152
- key: i,
153
- class: v(["h-6 scalar-button scalar-row cursor-pointer items-center justify-center rounded font-medium text-xs scalar-button-outlined border border-solid border-border text-c-1 hover:bg-b-2 p-0 px-2", {
154
- "bg-b-3": e.layout === "client" && (d.value === i || g === 0 && !d.value),
155
- "bg-b-1": e.layout === "reference" && (d.value === i || g === 0 && !d.value)
149
+ l[5] || (l[5] = c("div", { class: "text-c-1 flex min-w-[94px] items-center pl-2 pr-0" }, " Flow ", -1)),
150
+ c("div", E, [
151
+ (r(!0), u(i, null, x(e == null ? void 0 : e.flows, (o, p, v) => (r(), u("button", {
152
+ key: p,
153
+ class: k(["h-6 scalar-button scalar-row cursor-pointer items-center justify-center rounded font-medium text-xs scalar-button-outlined border border-solid border-border text-c-1 hover:bg-b-2 p-0 px-2", {
154
+ "bg-b-3": t.layout === "client" && (d.value === p || v === 0 && !d.value),
155
+ "bg-b-1": t.layout === "reference" && (d.value === p || v === 0 && !d.value)
156
156
  }]),
157
157
  type: "button",
158
- onClick: (P) => d.value = i
159
- }, $(i), 11, M))), 128))
158
+ onClick: (P) => d.value = p
159
+ }, _(p), 11, M))), 128))
160
160
  ])
161
- ], 2)) : c("", !0)
161
+ ], 2)) : m("", !0)
162
162
  ]),
163
163
  _: 2
164
164
  }, 1024),
165
- (r(!0), u(s, null, k(t.flows, (o, i, g) => (r(), u(s, { key: i }, [
166
- d.value === i || g === 0 && !d.value ? (r(), x(j, {
165
+ (r(!0), u(i, null, x(e == null ? void 0 : e.flows, (o, p, v) => (r(), u(i, { key: p }, [
166
+ d.value === p || v === 0 && !d.value ? (r(), C(j, {
167
167
  key: 0,
168
168
  flow: o,
169
- layout: e.layout,
170
- scheme: t
171
- }, null, 8, ["flow", "layout", "scheme"])) : c("", !0)
169
+ layout: t.layout,
170
+ scheme: e
171
+ }, null, 8, ["flow", "layout", "scheme"])) : m("", !0)
172
172
  ], 64))), 128))
173
- ], 64)) : c("", !0)
173
+ ], 64)) : m("", !0)
174
174
  ], 64))), 128));
175
175
  }
176
176
  });
@@ -1 +1 @@
1
- {"version":3,"file":"RequestBody.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestBody.vue"],"names":[],"mappings":"AAolBA,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAA;CACd,CAAC;;AAu4BF,wBAOG"}
1
+ {"version":3,"file":"RequestBody.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestBody.vue"],"names":[],"mappings":"AAumBA,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAA;CACd,CAAC;;AA05BF,wBAOG"}
@@ -1,7 +1,7 @@
1
1
  import o from "./RequestBody.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-a3031462"]]);
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-556dd256"]]);
5
5
  export {
6
6
  m as default
7
7
  };