@scalar/api-client 2.3.11 → 2.3.13

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 (57) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/dist/components/AddressBar/AddressBarHistory.vue.d.ts.map +1 -1
  3. package/dist/components/AddressBar/AddressBarHistory.vue.js +2 -2
  4. package/dist/components/AddressBar/AddressBarHistory.vue2.js +45 -51
  5. package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts +6 -0
  6. package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts.map +1 -1
  7. package/dist/components/ImportCollection/hooks/useUrlPrefetcher.d.ts +1 -1
  8. package/dist/components/ImportCollection/hooks/useUrlPrefetcher.d.ts.map +1 -1
  9. package/dist/components/ImportCollection/hooks/useUrlPrefetcher.js +3 -3
  10. package/dist/components/Server/ServerDropdownItem.vue.d.ts.map +1 -1
  11. package/dist/components/Server/ServerDropdownItem.vue.js +1 -1
  12. package/dist/components/Server/ServerDropdownItem.vue2.js +25 -22
  13. package/dist/components/ViewLayout/ViewLayoutCollapse.vue.d.ts.map +1 -1
  14. package/dist/components/ViewLayout/ViewLayoutCollapse.vue.js +25 -26
  15. package/dist/layouts/App/create-api-client-app.d.ts +154 -4
  16. package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
  17. package/dist/layouts/Modal/create-api-client-modal.d.ts +308 -8
  18. package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
  19. package/dist/layouts/Web/create-api-client-web.d.ts +154 -4
  20. package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
  21. package/dist/libs/create-client.d.ts +154 -4
  22. package/dist/libs/create-client.d.ts.map +1 -1
  23. package/dist/libs/create-client.js +40 -37
  24. package/dist/libs/find-request.d.ts +15 -0
  25. package/dist/libs/find-request.d.ts.map +1 -1
  26. package/dist/libs/send-request/create-request-operation.d.ts.map +1 -1
  27. package/dist/libs/send-request/create-request-operation.js +41 -41
  28. package/dist/libs/send-request/create-request-operation.test.d.ts +15 -0
  29. package/dist/libs/send-request/create-request-operation.test.d.ts.map +1 -1
  30. package/dist/store/active-entities.d.ts +15 -0
  31. package/dist/store/active-entities.d.ts.map +1 -1
  32. package/dist/store/import-spec.d.ts.map +1 -1
  33. package/dist/store/import-spec.js +12 -12
  34. package/dist/store/requests.d.ts +169 -4
  35. package/dist/store/requests.d.ts.map +1 -1
  36. package/dist/store/store.d.ts +154 -4
  37. package/dist/store/store.d.ts.map +1 -1
  38. package/dist/style.css +1 -1
  39. package/dist/views/Collection/CollectionAuthentication.vue.js +2 -2
  40. package/dist/views/Request/RequestRoot.vue.d.ts.map +1 -1
  41. package/dist/views/Request/RequestRoot.vue.js +1 -1
  42. package/dist/views/Request/RequestRoot.vue2.js +71 -61
  43. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthTab.vue.d.ts.map +1 -1
  44. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthTab.vue.js +2 -2
  45. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthTab.vue2.js +32 -32
  46. package/dist/views/Request/RequestSection/RequestCodeExample.vue.d.ts.map +1 -1
  47. package/dist/views/Request/RequestSection/RequestCodeExample.vue.js +3 -3
  48. package/dist/views/Request/RequestSection/RequestCodeExample.vue2.js +123 -79
  49. package/dist/views/Request/RequestSection/RequestSection.vue.d.ts.map +1 -1
  50. package/dist/views/Request/RequestSection/RequestSection.vue.js +2 -2
  51. package/dist/views/Request/RequestSection/RequestSection.vue2.js +1 -1
  52. package/dist/views/Request/ResponseSection/ResponseBody.vue.d.ts.map +1 -1
  53. package/dist/views/Request/ResponseSection/ResponseBody.vue.js +2 -2
  54. package/dist/views/Request/ResponseSection/ResponseBody.vue2.js +6 -6
  55. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  56. package/dist/views/Request/hooks/useOpenApiWatcher.js +25 -25
  57. package/package.json +14 -14
package/CHANGELOG.md CHANGED
@@ -1,5 +1,44 @@
1
1
  # @scalar/api-client
2
2
 
3
+ ## 2.3.13
4
+
5
+ ### Patch Changes
6
+
7
+ - bf961b1: feat: show custom code examples in the API client
8
+ - a176b7e: fix: updates server dropdown item selected server logic
9
+ - Updated dependencies [018e8b2]
10
+ - Updated dependencies [bf961b1]
11
+ - Updated dependencies [018e8b2]
12
+ - Updated dependencies [018e8b2]
13
+ - Updated dependencies [a176b7e]
14
+ - @scalar/postman-to-openapi@0.2.0
15
+ - @scalar/oas-utils@0.2.127
16
+ - @scalar/import@0.3.10
17
+ - @scalar/components@0.13.44
18
+ - @scalar/use-codemirror@0.11.89
19
+
20
+ ## 2.3.12
21
+
22
+ ### Patch Changes
23
+
24
+ - 73be3c0: fix(api-client): fix missing borders + default to code snippet open
25
+ - 75667fe: fix: updating the client store with isReadOnly
26
+ - a571d36: refactor: use central helper fetchDocument to fetch OpenAPI documents
27
+ - a097ea1: fix: download doesn’t appear anymore
28
+ - Updated dependencies [a571d36]
29
+ - Updated dependencies [cf5bf65]
30
+ - Updated dependencies [3783345]
31
+ - @scalar/oas-utils@0.2.126
32
+ - @scalar/openapi-parser@0.10.14
33
+ - @scalar/types@0.1.6
34
+ - @scalar/import@0.3.9
35
+ - @scalar/postman-to-openapi@0.1.49
36
+ - @scalar/snippetz@0.2.19
37
+ - @scalar/themes@0.9.84
38
+ - @scalar/components@0.13.43
39
+ - @scalar/use-codemirror@0.11.88
40
+ - @scalar/use-hooks@0.1.38
41
+
3
42
  ## 2.3.11
4
43
 
5
44
  ### Patch Changes
@@ -1 +1 @@
1
- {"version":3,"file":"AddressBarHistory.vue.d.ts","sourceRoot":"","sources":["../../../src/components/AddressBar/AddressBarHistory.vue"],"names":[],"mappings":"AAmJA,OAAO,KAAK,EAAE,SAAS,EAAgB,MAAM,iCAAiC,CAAA;AAc9E,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,SAAS,CAAA;IACpB,qEAAqE;IACrE,MAAM,EAAE,MAAM,CAAA;CACf,CAAC;;AAiQF,wBAOG"}
1
+ {"version":3,"file":"AddressBarHistory.vue.d.ts","sourceRoot":"","sources":["../../../src/components/AddressBar/AddressBarHistory.vue"],"names":[],"mappings":"AAoHA,OAAO,KAAK,EAAE,SAAS,EAAgB,MAAM,iCAAiC,CAAA;AAY9E,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,SAAS,CAAA;IACpB,qEAAqE;IACrE,MAAM,EAAE,MAAM,CAAA;CACf,CAAC;;AAoOF,wBAOG"}
@@ -1,7 +1,7 @@
1
1
  import o from "./AddressBarHistory.vue2.js";
2
2
  /* empty css */
3
3
  import r from "../../_virtual/_plugin-vue_export-helper.js";
4
- const a = /* @__PURE__ */ r(o, [["__scopeId", "data-v-50597ffd"]]);
4
+ const e = /* @__PURE__ */ r(o, [["__scopeId", "data-v-4e70a4a7"]]);
5
5
  export {
6
- a as default
6
+ e as default
7
7
  };
@@ -1,93 +1,87 @@
1
- import { defineComponent as _, computed as y, openBlock as a, createBlock as i, unref as e, withCtx as o, createVNode as l, createSlots as S, createElementVNode as r, createCommentVNode as h, normalizeStyle as b, createElementBlock as M, Fragment as B, renderList as H, toDisplayString as c, normalizeClass as w } from "vue";
2
- import { Menu as z, MenuButton as I, MenuItems as E, MenuItem as F } from "@headlessui/vue";
3
- import { ScalarFloating as N, ScalarIcon as U, ScalarFloatingBackdrop as V } from "@scalar/components";
1
+ import { defineComponent as x, computed as _, openBlock as a, createBlock as i, unref as e, withCtx as o, createVNode as l, createSlots as y, createElementVNode as s, createCommentVNode as p, normalizeStyle as C, createElementBlock as S, Fragment as b, renderList as H, toDisplayString as u, normalizeClass as q } from "vue";
2
+ import { Menu as B, MenuButton as M, MenuItems as w, MenuItem as z } from "@headlessui/vue";
3
+ import { ScalarFloating as I, ScalarIcon as F, ScalarFloatingBackdrop as N } from "@scalar/components";
4
4
  import { httpStatusCodes as R } from "@scalar/oas-utils/helpers";
5
- import { useRouter as W } from "vue-router";
6
- import { formatMs as A } from "../../libs/formatters.js";
7
- import { PathId as g } from "../../routes.js";
8
- import D from "../HttpMethod/HttpMethod.vue.js";
9
- import { getStatusCodeColor as L } from "./httpStatusCodeColors.js";
10
- import { useWorkspace as P } from "../../store/store.js";
11
- const $ = { class: "min-w-0" }, j = { class: "text-c-1 min-w-0 truncate" }, te = /* @__PURE__ */ _({
5
+ import { formatMs as V } from "../../libs/formatters.js";
6
+ import E from "../HttpMethod/HttpMethod.vue.js";
7
+ import { getStatusCodeColor as A } from "./httpStatusCodeColors.js";
8
+ import { useWorkspace as D } from "../../store/store.js";
9
+ const L = { class: "min-w-0" }, U = { class: "text-c-1 min-w-0 truncate" }, Q = /* @__PURE__ */ x({
12
10
  __name: "AddressBarHistory",
13
11
  props: {
14
12
  operation: {},
15
13
  target: {}
16
14
  },
17
- setup(m) {
18
- const { requestHistory: k, requestExampleMutators: v } = P(), p = W(), f = y(
19
- () => k.filter((s) => s.request.requestUid === m.operation.uid).slice().reverse()
15
+ setup(f) {
16
+ const { requestHistory: h } = D(), d = _(
17
+ () => h.filter((r) => r.request.requestUid === f.operation.uid).slice().reverse()
20
18
  );
21
- function x(s) {
22
- const n = p.currentRoute.value.params.workspace;
23
- m.operation.uid !== s.request.requestUid && p.push({
24
- name: "request",
25
- params: {
26
- [g.Workspace]: n,
27
- [g.Request]: s.request.requestUid
28
- }
29
- }), v.set({ ...s.request });
19
+ function g(r) {
20
+ console.warn(
21
+ "Restoring from the request history doesn’t work yet. Request History Item:",
22
+ r
23
+ );
30
24
  }
31
- return (s, n) => (a(), i(e(z), { as: "div" }, {
32
- default: o(({ open: q }) => [
33
- l(e(N), {
25
+ return (r, m) => (a(), i(e(B), { as: "div" }, {
26
+ default: o(({ open: v }) => [
27
+ l(e(I), {
34
28
  offset: 0,
35
29
  resize: "",
36
- target: s.target
37
- }, S({
30
+ target: r.target
31
+ }, y({
38
32
  default: o(() => {
39
- var u;
33
+ var n;
40
34
  return [
41
- (u = f.value) != null && u.length ? (a(), i(e(I), {
35
+ (n = d.value) != null && n.length ? (a(), i(e(M), {
42
36
  key: 0,
43
37
  class: "address-bar-history-button z-context-plus text-c-3 focus:text-c-1 relative mr-1 rounded-lg p-1.5"
44
38
  }, {
45
39
  default: o(() => [
46
- l(e(U), {
40
+ l(e(F), {
47
41
  icon: "History",
48
42
  size: "sm",
49
43
  thickness: "2.25"
50
44
  }),
51
- n[0] || (n[0] = r("span", { class: "sr-only" }, "Request History", -1))
45
+ m[0] || (m[0] = s("span", { class: "sr-only" }, "Request History", -1))
52
46
  ]),
53
47
  _: 1
54
- })) : h("", !0)
48
+ })) : p("", !0)
55
49
  ];
56
50
  }),
57
51
  _: 2
58
52
  }, [
59
- q ? {
53
+ v ? {
60
54
  name: "floating",
61
- fn: o(({ width: u }) => [
62
- l(e(E), {
55
+ fn: o(({ width: n }) => [
56
+ l(e(w), {
63
57
  class: "custom-scroll p-0.75 grid max-h-[inherit] grid-cols-[44px,1fr,repeat(3,auto)] items-center border-t",
64
58
  static: "",
65
- style: b({ width: u })
59
+ style: C({ width: n })
66
60
  }, {
67
61
  default: o(() => [
68
- (a(!0), M(B, null, H(f.value, (t, C) => (a(), i(e(F), {
62
+ (a(!0), S(b, null, H(d.value, (t, k) => (a(), i(e(z), {
69
63
  key: t.timestamp,
70
64
  as: "button",
71
65
  class: "font-code *:ui-active:bg-b-2 text-c-2 contents text-sm font-medium *:flex *:h-8 *:cursor-pointer *:items-center *:rounded-none *:px-1.5 first:*:rounded-l last:*:rounded-r",
72
- value: C,
73
- onClick: (d) => x(t)
66
+ value: k,
67
+ onClick: (c) => g(t)
74
68
  }, {
75
69
  default: o(() => {
76
- var d;
70
+ var c;
77
71
  return [
78
- t.response.method ? (a(), i(D, {
72
+ t.response.method ? (a(), i(E, {
79
73
  key: 0,
80
74
  class: "text-[11px]",
81
75
  method: t.response.method
82
- }, null, 8, ["method"])) : h("", !0),
83
- r("div", $, [
84
- r("div", j, c(t.response.path), 1)
76
+ }, null, 8, ["method"])) : p("", !0),
77
+ s("div", L, [
78
+ s("div", U, u(t.response.path), 1)
85
79
  ]),
86
- r("div", null, c(e(A)(t.response.duration)), 1),
87
- r("div", {
88
- class: w([e(L)(t.response.status).color])
89
- }, c(t.response.status), 3),
90
- r("div", null, c((d = e(R)[t.response.status]) == null ? void 0 : d.name), 1)
80
+ s("div", null, u(e(V)(t.response.duration)), 1),
81
+ s("div", {
82
+ class: q([e(A)(t.response.status).color])
83
+ }, u(t.response.status), 3),
84
+ s("div", null, u((c = e(R)[t.response.status]) == null ? void 0 : c.name), 1)
91
85
  ];
92
86
  }),
93
87
  _: 2
@@ -95,7 +89,7 @@ const $ = { class: "min-w-0" }, j = { class: "text-c-1 min-w-0 truncate" }, te =
95
89
  ]),
96
90
  _: 2
97
91
  }, 1032, ["style"]),
98
- l(e(V), { class: "-top-[--scalar-address-bar-height] rounded-lg" })
92
+ l(e(N), { class: "-top-[--scalar-address-bar-height] rounded-lg" })
99
93
  ]),
100
94
  key: "0"
101
95
  } : void 0
@@ -106,5 +100,5 @@ const $ = { class: "min-w-0" }, j = { class: "text-c-1 min-w-0 truncate" }, te =
106
100
  }
107
101
  });
108
102
  export {
109
- te as default
103
+ Q as default
110
104
  };
@@ -106,6 +106,9 @@ export declare const PaletteComponents: {
106
106
  }[] | undefined;
107
107
  requestBody?: any;
108
108
  responses?: Record<string, any> | undefined;
109
+ 'x-codeSamples'?: unknown;
110
+ 'x-code-samples'?: unknown;
111
+ 'x-custom-examples'?: unknown;
109
112
  'x-scalar-stability'?: unknown;
110
113
  method?: "options" | "connect" | "delete" | "get" | "head" | "patch" | "post" | "put" | "trace" | undefined;
111
114
  } & {
@@ -155,6 +158,9 @@ export declare const PaletteComponents: {
155
158
  }[] | undefined;
156
159
  requestBody?: any;
157
160
  responses?: Record<string, any> | undefined;
161
+ 'x-codeSamples'?: unknown;
162
+ 'x-code-samples'?: unknown;
163
+ 'x-custom-examples'?: unknown;
158
164
  'x-scalar-stability'?: unknown;
159
165
  method?: "options" | "connect" | "delete" | "get" | "head" | "patch" | "post" | "put" | "trace" | undefined;
160
166
  } & {
@@ -1 +1 @@
1
- {"version":3,"file":"TheCommandPalette.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CommandPalette/TheCommandPalette.vue"],"names":[],"mappings":"AAqcA;;;;GAIG;;AACH,wBA8gBI;AAEJ,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;mBA9iB9B,CAlRqC;qBAkRrC,CAjRY;;;;;;;mBAiRZ,CAlRqC;qBAkRrC,CAjRY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+BAmoB0D,CAAC;;;;;;;;;;;;;;;+BAOoD,CAAA;4BAAsC,CAAC;2BAI5J,CAAC;8BAA6B,CAAC;0BACxB,CAAC;2BAA0B,CAAC;yBAAwB,CAAC;4BAIjC,CAAC;6BAAgD,CAAC;+BAA8B,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;+BAhB5C,CAAC;;;;;;;;;;;;;;;+BAOoD,CAAA;4BAAsC,CAAC;2BAI5J,CAAC;8BAA6B,CAAC;0BACxB,CAAC;2BAA0B,CAAC;yBAAwB,CAAC;4BAIjC,CAAC;6BAAgD,CAAC;+BAA8B,CAAC;;;;;;;;;;;;;;;;CAqLxG,CAAA;AAEV,yCAAyC;AACzC,MAAM,MAAM,YAAY,GAAG,MAAM,OAAO,iBAAiB,CAAA;AAEzD,MAAM,MAAM,mBAAmB,GAAG;IAChC,8DAA8D;IAC9D,WAAW,CAAC,EAAE,YAAY,CAAA;IAC1B,iEAAiE;IACjE,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CAC/B,CACA"}
1
+ {"version":3,"file":"TheCommandPalette.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CommandPalette/TheCommandPalette.vue"],"names":[],"mappings":"AAqcA;;;;GAIG;;AACH,wBA8gBI;AAEJ,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;mBA9iB9B,CAlRqC;qBAkRrC,CAjRY;;;;;;;mBAiRZ,CAlRqC;qBAkRrC,CAjRY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+BA6pB0B,CAAC;;;;;;;;;;;;;;;+BAMf,CAAA;4BACnB,CAAC;2BACoB,CAAC;8BAC3B,CAAA;0BAEG,CAAC;2BAA0B,CAAC;yBAG7B,CAAC;4BAKQ,CAAC;6BACI,CAAC;+BAA8B,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;+BApBV,CAAC;;;;;;;;;;;;;;;+BAMf,CAAA;4BACnB,CAAC;2BACoB,CAAC;8BAC3B,CAAA;0BAEG,CAAC;2BAA0B,CAAC;yBAG7B,CAAC;4BAKQ,CAAC;6BACI,CAAC;+BAA8B,CAAC;;;;;;;;;;;;;;;;;;;CAuJtC,CAAA;AAEV,yCAAyC;AACzC,MAAM,MAAM,YAAY,GAAG,MAAM,OAAO,iBAAiB,CAAA;AAEzD,MAAM,MAAM,mBAAmB,GAAG;IAChC,8DAA8D;IAC9D,WAAW,CAAC,EAAE,YAAY,CAAA;IAC1B,iEAAiE;IACjE,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CAC/B,CACA"}
@@ -16,7 +16,7 @@ export declare function useUrlPrefetcher(): {
16
16
  url: string | null;
17
17
  error: string | null;
18
18
  };
19
- prefetchUrl: (input: string | null, proxy?: string) => Promise<{
19
+ prefetchUrl: (input: string | null, proxyUrl?: string) => Promise<{
20
20
  state: string;
21
21
  content: null;
22
22
  url: null;
@@ -1 +1 @@
1
- {"version":3,"file":"useUrlPrefetcher.d.ts","sourceRoot":"","sources":["../../../../src/components/ImportCollection/hooks/useUrlPrefetcher.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,EAAE,MAAM,GAAG,SAAS,CAAA;IACzB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;IAClB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;CACrB,CAAA;AAED;;GAEG;AACH,wBAAgB,gBAAgB;;eAVvB,MAAM,GAAG,SAAS;iBAChB,MAAM,GAAG,IAAI;eACf,MAAM,GAAG,IAAI;aACf,MAAM,GAAG,IAAI;eACX,MAAM,GAAG,IAAI;;yBAsH4B,MAAM,GAAG,IAAI,UAAU,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;EAmB9E"}
1
+ {"version":3,"file":"useUrlPrefetcher.d.ts","sourceRoot":"","sources":["../../../../src/components/ImportCollection/hooks/useUrlPrefetcher.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,EAAE,MAAM,GAAG,SAAS,CAAA;IACzB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;IAClB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;CACrB,CAAA;AAED;;GAEG;AACH,wBAAgB,gBAAgB;;eAVvB,MAAM,GAAG,SAAS;iBAChB,MAAM,GAAG,IAAI;eACf,MAAM,GAAG,IAAI;aACf,MAAM,GAAG,IAAI;eACX,MAAM,GAAG,IAAI;;yBAsH4B,MAAM,GAAG,IAAI,aAAa,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;EAmBjF"}
@@ -2,7 +2,7 @@ import { resolve as i } from "@scalar/import";
2
2
  import { redirectToProxy as f, fetchWithProxyFallback as d } from "@scalar/oas-utils/helpers";
3
3
  import { reactive as h } from "vue";
4
4
  import { isUrl as m } from "../../../libs/isUrl.js";
5
- function y() {
5
+ function b() {
6
6
  const n = h({
7
7
  state: "idle",
8
8
  content: null,
@@ -58,7 +58,7 @@ function y() {
58
58
  error: "Oops, we got invalid content for the given URL."
59
59
  };
60
60
  const o = t, l = await d(o, {
61
- proxy: r,
61
+ proxyUrl: r,
62
62
  cache: "no-cache"
63
63
  });
64
64
  return l.ok ? {
@@ -101,5 +101,5 @@ function y() {
101
101
  };
102
102
  }
103
103
  export {
104
- y as useUrlPrefetcher
104
+ b as useUrlPrefetcher
105
105
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ServerDropdownItem.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Server/ServerDropdownItem.vue"],"names":[],"mappings":"AAwJA,OAAO,KAAK,EACV,UAAU,EACV,OAAO,IAAI,SAAS,EACpB,MAAM,EACP,MAAM,iCAAiC,CAAA;AASxC,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,UAAU,CAAA;IACtB,SAAS,EAAE,SAAS,GAAG,SAAS,CAAA;IAChC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,YAAY,EAAE;QACZ,EAAE,EAAE,MAAM,CAAC,KAAK,CAAC,CAAA;QACjB,KAAK,EAAE,MAAM,CAAA;KACd,CAAA;IACD,IAAI,EAAE,YAAY,GAAG,SAAS,CAAA;CAC/B,CAAC;;;;;;AA4NF,wBAQG"}
1
+ {"version":3,"file":"ServerDropdownItem.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Server/ServerDropdownItem.vue"],"names":[],"mappings":"AA4JA,OAAO,KAAK,EACV,UAAU,EACV,OAAO,IAAI,SAAS,EACpB,MAAM,EACP,MAAM,iCAAiC,CAAA;AASxC,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,UAAU,CAAA;IACtB,SAAS,EAAE,SAAS,GAAG,SAAS,CAAA;IAChC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,YAAY,EAAE;QACZ,EAAE,EAAE,MAAM,CAAC,KAAK,CAAC,CAAA;QACjB,KAAK,EAAE,MAAM,CAAA;KACd,CAAA;IACD,IAAI,EAAE,YAAY,GAAG,SAAS,CAAA;CAC/B,CAAC;;;;;;AAgOF,wBAQG"}
@@ -1,7 +1,7 @@
1
1
  import o from "./ServerDropdownItem.vue2.js";
2
2
  /* empty css */
3
3
  import r from "../../_virtual/_plugin-vue_export-helper.js";
4
- const p = /* @__PURE__ */ r(o, [["__scopeId", "data-v-bf29cdce"]]);
4
+ const p = /* @__PURE__ */ r(o, [["__scopeId", "data-v-e86ebacd"]]);
5
5
  export {
6
6
  p as default
7
7
  };
@@ -1,8 +1,8 @@
1
- import { defineComponent as O, useId as U, computed as y, openBlock as c, createElementBlock as p, normalizeClass as V, createElementVNode as u, mergeProps as q, unref as a, createVNode as v, toDisplayString as M, withModifiers as E, createCommentVNode as h } from "vue";
1
+ import { defineComponent as C, useId as O, computed as y, openBlock as c, createElementBlock as p, normalizeClass as V, createElementVNode as u, mergeProps as q, unref as a, createVNode as v, toDisplayString as M, withModifiers as E, createCommentVNode as h } from "vue";
2
2
  import { ScalarListboxCheckbox as I, ScalarMarkdown as N } from "@scalar/components";
3
3
  import B from "./ServerVariablesForm.vue.js";
4
4
  import { useWorkspace as D } from "../../store/store.js";
5
- const P = ["aria-expanded"], j = { class: "overflow-hidden text-ellipsis whitespace-nowrap" }, z = ["id"], L = { key: 0 }, W = { class: "description text-c-3 px-3 py-1.5" }, H = /* @__PURE__ */ O({
5
+ const P = ["aria-expanded"], j = { class: "overflow-hidden text-ellipsis whitespace-nowrap" }, z = ["id"], L = { key: 0 }, W = { class: "description text-c-3 px-3 py-1.5" }, H = /* @__PURE__ */ C({
6
6
  __name: "ServerDropdownItem",
7
7
  props: {
8
8
  collection: {},
@@ -13,9 +13,9 @@ const P = ["aria-expanded"], j = { class: "overflow-hidden text-ellipsis whitesp
13
13
  },
14
14
  emits: ["update:variable"],
15
15
  setup(g, { emit: k }) {
16
- const e = g, x = k, f = U(), { collectionMutators: m, requestMutators: l, servers: _ } = D(), w = (t, r) => {
16
+ const e = g, x = k, f = O(), { collectionMutators: m, requestMutators: l, servers: _ } = D(), U = (r, t) => {
17
17
  var i, s, n, S;
18
- if (b(t) && (r == null || r.stopPropagation()), o.value) {
18
+ if (b(r) && (t == null || t.stopPropagation()), o.value) {
19
19
  (s = (i = e.operation) == null ? void 0 : i.servers) != null && s.length && l.edit(e.operation.uid, "selectedServerUid", null), e.type === "collection" ? m.edit(
20
20
  e.collection.uid,
21
21
  "selectedServerUid",
@@ -26,22 +26,25 @@ const P = ["aria-expanded"], j = { class: "overflow-hidden text-ellipsis whitesp
26
26
  e.type === "collection" && e.collection ? ((S = (n = e.operation) == null ? void 0 : n.servers) != null && S.length && l.edit(e.operation.uid, "selectedServerUid", null), m.edit(
27
27
  e.collection.uid,
28
28
  "selectedServerUid",
29
- t
30
- )) : e.type === "request" && e.operation && l.edit(e.operation.uid, "selectedServerUid", t);
31
- }, o = y(() => e.type === "collection" ? e.collection.selectedServerUid === e.serverOption.id : e.type === "request" && e.operation ? e.operation.selectedServerUid === e.serverOption.id : !1), b = (t) => {
32
- if (!t)
29
+ r
30
+ )) : e.type === "request" && e.operation && l.edit(e.operation.uid, "selectedServerUid", r);
31
+ }, o = y(() => {
32
+ var r;
33
+ return e.type === "collection" ? e.collection.selectedServerUid === e.serverOption.id && !((r = e.operation) != null && r.selectedServerUid) : e.type === "request" && e.operation ? e.operation.selectedServerUid === e.serverOption.id : !1;
34
+ }), b = (r) => {
35
+ if (!r)
33
36
  return !1;
34
- const r = _[t];
35
- return Object.keys((r == null ? void 0 : r.variables) ?? {}).length > 0;
37
+ const t = _[r];
38
+ return Object.keys((t == null ? void 0 : t.variables) ?? {}).length > 0;
36
39
  }, d = y(
37
40
  () => {
38
- var t;
39
- return o.value && b(((t = e.server) == null ? void 0 : t.uid) ?? "");
41
+ var r;
42
+ return o.value && b(((r = e.server) == null ? void 0 : r.uid) ?? "");
40
43
  }
41
- ), C = (t, r) => {
42
- x("update:variable", t, r);
44
+ ), w = (r, t) => {
45
+ x("update:variable", r, t);
43
46
  };
44
- return (t, r) => {
47
+ return (r, t) => {
45
48
  var i, s;
46
49
  return c(), p("div", {
47
50
  class: V(["group/item flex min-h-fit flex-col rounded border", { "border-transparent": !o.value }])
@@ -50,26 +53,26 @@ const P = ["aria-expanded"], j = { class: "overflow-hidden text-ellipsis whitesp
50
53
  "aria-expanded": d.value,
51
54
  class: ["flex min-h-8 cursor-pointer items-center gap-1.5 rounded px-1.5", o.value ? "text-c-1 bg-b-2" : "hover:bg-b-2"],
52
55
  type: "button",
53
- onClick: r[0] || (r[0] = (n) => w(t.serverOption.id, n))
56
+ onClick: t[0] || (t[0] = (n) => U(r.serverOption.id, n))
54
57
  }), [
55
58
  v(a(I), { selected: o.value }, null, 8, ["selected"]),
56
- u("span", j, M(t.serverOption.label), 1)
59
+ u("span", j, M(r.serverOption.label), 1)
57
60
  ], 16, P),
58
61
  d.value ? (c(), p("div", {
59
62
  key: 0,
60
63
  id: a(f),
61
64
  class: "bg-b-2 divide divide-y rounded-b border-t *:pl-4",
62
- onClick: r[1] || (r[1] = E(() => {
65
+ onClick: t[1] || (t[1] = E(() => {
63
66
  }, ["stop"]))
64
67
  }, [
65
68
  v(B, {
66
- variables: (i = t.server) == null ? void 0 : i.variables,
67
- "onUpdate:variable": C
69
+ variables: (i = r.server) == null ? void 0 : i.variables,
70
+ "onUpdate:variable": w
68
71
  }, null, 8, ["variables"]),
69
- (s = t.server) != null && s.description ? (c(), p("div", L, [
72
+ (s = r.server) != null && s.description ? (c(), p("div", L, [
70
73
  u("div", W, [
71
74
  v(a(N), {
72
- value: t.server.description
75
+ value: r.server.description
73
76
  }, null, 8, ["value"])
74
77
  ])
75
78
  ])) : h("", !0)
@@ -1 +1 @@
1
- {"version":3,"file":"ViewLayoutCollapse.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ViewLayout/ViewLayoutCollapse.vue"],"names":[],"mappings":"AAwFA,KAAK,WAAW,GAAG;IACjB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,MAAM,CAAC,EAAE,QAAQ,GAAG,WAAW,CAAA;CAChC,CAAC;AAeF,iBAAS,cAAc;WAsKT,OAAO,IAA6B;;;;YAVtB,GAAG;;;YACD,GAAG;;;YACH,GAAG;;;;EAahC;AAaD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe,kSAOnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAUpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"ViewLayoutCollapse.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ViewLayout/ViewLayoutCollapse.vue"],"names":[],"mappings":"AAwFA,KAAK,WAAW,GAAG;IACjB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,MAAM,CAAC,EAAE,QAAQ,GAAG,WAAW,CAAA;CAChC,CAAC;AAeF,iBAAS,cAAc;WAoKT,OAAO,IAA6B;;;;YAVtB,GAAG;;;YACD,GAAG;;;YACH,GAAG;;;;EAahC;AAaD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe,kSAOnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAUpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -1,5 +1,5 @@
1
- import { defineComponent as m, useId as h, openBlock as s, createBlock as u, unref as t, withCtx as a, createElementVNode as l, createVNode as d, normalizeClass as p, createCommentVNode as n, renderSlot as r, createElementBlock as i, createTextVNode as y, toDisplayString as f, mergeProps as b } from "vue";
2
- import { Disclosure as x, DisclosureButton as g, DisclosurePanel as _ } from "@headlessui/vue";
1
+ import { defineComponent as m, useId as h, openBlock as s, createBlock as d, unref as t, normalizeClass as a, withCtx as r, createElementVNode as l, createVNode as f, createCommentVNode as n, renderSlot as i, createElementBlock as c, createTextVNode as y, toDisplayString as p, mergeProps as b } from "vue";
2
+ import { Disclosure as x, DisclosureButton as _, DisclosurePanel as g } from "@headlessui/vue";
3
3
  import { ScalarIcon as C } from "@scalar/components";
4
4
  const v = ["aria-labelledby"], k = { class: "bg-b-2 flex items-center" }, w = { class: "text-c-1 flex flex-1 items-center gap-1.5" }, B = ["id"], V = {
5
5
  key: 0,
@@ -18,31 +18,30 @@ const v = ["aria-labelledby"], k = { class: "bg-b-2 flex items-center" }, w = {
18
18
  layout: { default: "client" }
19
19
  },
20
20
  setup(O) {
21
- const c = h();
22
- return (e, I) => (s(), u(t(x), {
21
+ const u = h();
22
+ return (e, I) => (s(), d(t(x), {
23
23
  as: "div",
24
- class: "group/collapse focus-within:text-c-1 text-c-2 request-item",
24
+ class: a(["group/collapse focus-within:text-c-1 text-c-2 border-b", { "first-of-type:last-of-type:border-b-0": e.layout === "reference" }]),
25
25
  defaultOpen: e.defaultOpen,
26
26
  static: e.layout === "reference" ? !0 : void 0
27
27
  }, {
28
- default: a(({ open: o }) => [
28
+ default: r(({ open: o }) => [
29
29
  l("section", {
30
- "aria-labelledby": t(c),
30
+ "aria-labelledby": t(u),
31
31
  class: "contents"
32
32
  }, [
33
33
  l("div", k, [
34
- d(t(g), {
35
- class: p([
34
+ f(t(_), {
35
+ class: a([
36
36
  "hover:text-c-1 group box-content flex max-h-8 flex-1 items-center gap-2.5 overflow-hidden px-1 py-1.5 text-sm font-medium outline-none md:px-1.5 xl:pl-2 xl:pr-0.5",
37
- { "!pl-3": e.layout === "reference" },
38
- { "group-last/collapse:border-b": e.layout === "client" }
37
+ { "!pl-3": e.layout === "reference" }
39
38
  ]),
40
39
  disabled: e.layout === "reference"
41
40
  }, {
42
- default: a(() => [
43
- e.layout !== "reference" ? (s(), u(t(C), {
41
+ default: r(() => [
42
+ e.layout !== "reference" ? (s(), d(t(C), {
44
43
  key: 0,
45
- class: p([
44
+ class: a([
46
45
  "text-c-3 group-hover:text-c-1 ui-open:rotate-90 ui-not-open:rotate-0 rounded-px outline-offset-2 group-focus-visible:outline"
47
46
  ]),
48
47
  icon: "ChevronRight",
@@ -50,34 +49,34 @@ const v = ["aria-labelledby"], k = { class: "bg-b-2 flex items-center" }, w = {
50
49
  })) : n("", !0),
51
50
  l("h2", w, [
52
51
  l("span", {
53
- id: t(c),
52
+ id: t(u),
54
53
  class: "contents"
55
54
  }, [
56
- r(e.$slots, "title", { open: o }),
57
- o ? n("", !0) : (s(), i("span", V, " (Collapsed) "))
55
+ i(e.$slots, "title", { open: o }),
56
+ o ? n("", !0) : (s(), c("span", V, " (Collapsed) "))
58
57
  ], 8, B),
59
- !o && e.itemCount ? (s(), i("span", $, [
60
- y(f(e.itemCount) + " ", 1),
61
- l("span", D, "Item" + f(e.itemCount === 1 ? "" : "s"), 1)
58
+ !o && e.itemCount ? (s(), c("span", $, [
59
+ y(p(e.itemCount) + " ", 1),
60
+ l("span", D, "Item" + p(e.itemCount === 1 ? "" : "s"), 1)
62
61
  ])) : n("", !0)
63
62
  ])
64
63
  ]),
65
64
  _: 2
66
65
  }, 1032, ["class", "disabled"]),
67
- e.$slots.actions ? (s(), i("div", N, [
68
- r(e.$slots, "actions", { open: o })
66
+ e.$slots.actions ? (s(), c("div", N, [
67
+ i(e.$slots, "actions", { open: o })
69
68
  ])) : n("", !0)
70
69
  ]),
71
- d(t(_), b(e.$attrs, { class: "diclosure-panel h-full max-h-fit rounded-b" }), {
72
- default: a(() => [
73
- r(e.$slots, "default", { open: o })
70
+ f(t(g), b(e.$attrs, { class: "diclosure-panel h-full max-h-fit rounded-b" }), {
71
+ default: r(() => [
72
+ i(e.$slots, "default", { open: o })
74
73
  ]),
75
74
  _: 2
76
75
  }, 1040)
77
76
  ], 8, v)
78
77
  ]),
79
78
  _: 3
80
- }, 8, ["defaultOpen", "static"]));
79
+ }, 8, ["class", "defaultOpen", "static"]));
81
80
  }
82
81
  });
83
82
  export {