@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
@@ -1,13 +1,13 @@
1
- import { defineComponent as b, computed as i, openBlock as w, createElementBlock as x, createVNode as n, withCtx as c, createTextVNode as S, createElementVNode as m, unref as r, toDisplayString as C } from "vue";
2
- import { ScalarCombobox as k, ScalarButton as $, ScalarIcon as g } from "@scalar/components";
3
- import { snippetz as K } from "@scalar/snippetz";
4
- import V from "../../../components/DataTable/DataTable.vue.js";
5
- import H from "../../../components/DataTable/DataTableRow.vue.js";
6
- import U from "../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
7
- import { filterSecurityRequirements as _ } from "./helpers/filter-security-requirements.js";
8
- import j from "../../Components/CodeSnippet/CodeSnippet.vue.js";
9
- import { useWorkspace as B } from "../../../store/store.js";
10
- const D = { class: "w-full" }, E = { class: "-mx-1 flex flex-1" }, N = { class: "bg-b-1 flex items-center justify-center overflow-hidden border-t" }, P = /* @__PURE__ */ b({
1
+ import { defineComponent as H, computed as a, ref as U, openBlock as v, createElementBlock as j, createVNode as i, withCtx as c, createTextVNode as D, createElementVNode as x, unref as r, toDisplayString as N, createBlock as C } from "vue";
2
+ import { ScalarCombobox as R, ScalarButton as T, ScalarIcon as W, ScalarCodeBlock as q } from "@scalar/components";
3
+ import { snippetz as z } from "@scalar/snippetz";
4
+ import I from "../../../components/DataTable/DataTable.vue.js";
5
+ import O from "../../../components/DataTable/DataTableRow.vue.js";
6
+ import M from "../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
7
+ import { filterSecurityRequirements as P } from "./helpers/filter-security-requirements.js";
8
+ import A from "../../Components/CodeSnippet/CodeSnippet.vue.js";
9
+ import { useWorkspace as F } from "../../../store/store.js";
10
+ const G = { class: "w-full" }, J = { class: "-mx-1 flex flex-1" }, L = { class: "bg-b-1 flex items-center justify-center overflow-hidden border-t" }, ne = /* @__PURE__ */ H({
11
11
  __name: "RequestCodeExample",
12
12
  props: {
13
13
  collection: {},
@@ -16,82 +16,120 @@ const D = { class: "w-full" }, E = { class: "-mx-1 flex flex-1" }, N = { class:
16
16
  server: {},
17
17
  workspace: {}
18
18
  },
19
- setup(o) {
20
- const { securitySchemes: u, workspaceMutators: p } = B(), f = i(
21
- () => _(
22
- o.operation.security || o.collection.security || [],
23
- o.operation.selectedSecuritySchemeUids || o.collection.selectedSecuritySchemeUids,
24
- u
19
+ setup(n) {
20
+ var b, K, S, h;
21
+ const { securitySchemes: k, workspaceMutators: w } = F(), f = a(() => {
22
+ var t, e, l;
23
+ return d.value.targetKey === "custom" && ((t = u.value) == null ? void 0 : t.some(
24
+ (o) => o.lang === d.value.clientKey
25
+ )) ? d.value : {
26
+ targetKey: ((e = n.workspace.selectedHttpClient) == null ? void 0 : e.targetKey) ?? "js",
27
+ clientKey: ((l = n.workspace.selectedHttpClient) == null ? void 0 : l.clientKey) ?? "fetch"
28
+ };
29
+ }), u = a(
30
+ () => n.operation["x-codeSamples"] || n.operation["x-code-samples"] || n.operation["x-custom-examples"]
31
+ ), d = U(
32
+ (b = u.value) != null && b.length ? {
33
+ targetKey: "custom",
34
+ clientKey: (K = u.value[0]) == null ? void 0 : K.lang
35
+ } : {
36
+ targetKey: ((S = n.workspace.selectedHttpClient) == null ? void 0 : S.targetKey) ?? "js",
37
+ clientKey: ((h = n.workspace.selectedHttpClient) == null ? void 0 : h.clientKey) ?? "fetch"
38
+ }
39
+ ), $ = a(
40
+ () => P(
41
+ n.operation.security || n.collection.security || [],
42
+ n.operation.selectedSecuritySchemeUids || n.collection.selectedSecuritySchemeUids,
43
+ k
25
44
  )
26
- ), a = i(() => {
27
- const e = {};
28
- return {
29
- options: K().clients().map((t) => ({
30
- label: t.title,
31
- options: t.clients.map((s) => (e[`${t.key},${s.client}`] = s.title, {
32
- id: `${t.key},${s.client}`,
33
- label: s.title
45
+ ), y = a(() => {
46
+ const t = {}, e = z().clients().map((o) => ({
47
+ label: o.title,
48
+ options: o.clients.map((p) => (t[`${o.key},${p.client}`] = p.title, {
49
+ id: `${o.key},${p.client}`,
50
+ label: p.title
51
+ }))
52
+ })), l = (n.operation["x-codeSamples"] || n.operation["x-code-samples"] || n.operation["x-custom-examples"] || []).map((o) => ({
53
+ id: `custom,${o.lang}`,
54
+ label: o.label || o.lang
55
+ })), m = l.length > 0 ? [
56
+ {
57
+ id: "customExamples",
58
+ label: "Code Examples",
59
+ options: l.map((o) => ({
60
+ id: o.id,
61
+ label: o.label ?? o.id
34
62
  }))
35
- })),
36
- dict: e
63
+ },
64
+ ...e
65
+ ] : e;
66
+ return l.forEach((o) => {
67
+ t[o.id] = o.label ?? o.id;
68
+ }), {
69
+ options: m,
70
+ dict: t
37
71
  };
38
- }), d = i(() => {
39
- var t;
40
- const e = o.workspace.selectedHttpClient;
41
- if (!e)
42
- return ((t = a.value.options[0]) == null ? void 0 : t.options[0]) ?? {
43
- id: "js,fetch",
44
- label: "Fetch"
72
+ }), s = a(() => {
73
+ const t = f.value;
74
+ if (t.targetKey === "custom") {
75
+ const l = `custom,${t.clientKey}`;
76
+ return {
77
+ id: l,
78
+ label: y.value.dict[l] ?? "Unknown"
45
79
  };
46
- const l = `${e.targetKey},${e.clientKey}`;
80
+ }
81
+ const e = `${t.targetKey},${t.clientKey}`;
47
82
  return {
48
- id: l,
49
- label: a.value.dict[l] ?? "Unknown"
83
+ id: e,
84
+ label: y.value.dict[e] ?? "Unknown"
50
85
  };
51
- }), y = i(
52
- () => {
53
- var e;
54
- return ((e = o.workspace.selectedHttpClient) == null ? void 0 : e.targetKey) ?? "js";
55
- }
56
- ), v = i(
57
- () => {
58
- var e;
59
- return ((e = o.workspace.selectedHttpClient) == null ? void 0 : e.clientKey) ?? "fetch";
60
- }
61
- ), h = ({ id: e }) => {
62
- const [l, t] = e.split(",");
63
- !l || !t || p.edit(o.workspace.uid, "selectedHttpClient", {
64
- targetKey: l,
65
- clientKey: t
66
- });
67
- };
68
- return (e, l) => (w(), x("div", D, [
69
- n(U, {
86
+ }), E = a(
87
+ () => f.value.targetKey
88
+ ), V = a(
89
+ () => f.value.clientKey
90
+ ), B = ({ id: t }) => {
91
+ const [e, l] = t.split(",");
92
+ !e || !l || (d.value = {
93
+ targetKey: e,
94
+ clientKey: l
95
+ }, e !== "custom" && w.edit(n.workspace.uid, "selectedHttpClient", {
96
+ targetKey: e,
97
+ clientKey: l
98
+ }));
99
+ }, g = a(() => {
100
+ var l;
101
+ if (!s.value.id.startsWith("custom,"))
102
+ return;
103
+ const t = s.value.id.split(",")[1], e = (l = u.value) == null ? void 0 : l.find((m) => m.lang === t);
104
+ return e == null ? void 0 : e.source;
105
+ });
106
+ return (t, e) => (v(), j("div", G, [
107
+ i(M, {
70
108
  class: "group/preview w-full border-b-0",
71
- defaultOpen: !1
109
+ defaultOpen: !0
72
110
  }, {
73
- title: c(() => l[0] || (l[0] = [
74
- S("Code Snippet")
111
+ title: c(() => e[0] || (e[0] = [
112
+ D("Code Snippet")
75
113
  ])),
76
114
  actions: c(() => [
77
- m("div", E, [
78
- n(r(k), {
79
- modelValue: d.value,
80
- options: a.value.options,
115
+ x("div", J, [
116
+ i(r(R), {
117
+ modelValue: s.value,
118
+ options: y.value.options,
81
119
  placement: "bottom-end",
82
- "onUpdate:modelValue": h
120
+ "onUpdate:modelValue": B
83
121
  }, {
84
122
  default: c(() => [
85
- n(r($), {
123
+ i(r(T), {
86
124
  class: "text-c-1 hover:bg-b-3 py-0.75 flex h-full w-fit gap-1.5 px-1.5 font-normal",
87
125
  fullWidth: "",
88
126
  variant: "ghost"
89
127
  }, {
90
128
  default: c(() => {
91
- var t;
129
+ var l;
92
130
  return [
93
- m("span", null, C((t = d.value) == null ? void 0 : t.label), 1),
94
- n(r(g), {
131
+ x("span", null, N((l = s.value) == null ? void 0 : l.label), 1),
132
+ i(r(W), {
95
133
  icon: "ChevronDown",
96
134
  size: "md"
97
135
  })
@@ -105,20 +143,26 @@ const D = { class: "w-full" }, E = { class: "-mx-1 flex flex-1" }, N = { class:
105
143
  ])
106
144
  ]),
107
145
  default: c(() => [
108
- n(V, { columns: [""] }, {
146
+ i(I, { columns: [""] }, {
109
147
  default: c(() => [
110
- n(H, null, {
148
+ i(O, null, {
111
149
  default: c(() => [
112
- m("div", N, [
113
- n(r(j), {
150
+ x("div", L, [
151
+ g.value ? (v(), C(r(q), {
152
+ key: 0,
153
+ class: "px-3 py-1.5",
154
+ content: g.value,
155
+ lang: s.value.id.split(",")[1] ?? "plaintext"
156
+ }, null, 8, ["content", "lang"])) : (v(), C(r(A), {
157
+ key: 1,
114
158
  class: "px-3 py-1.5",
115
- client: v.value,
116
- example: e.example,
117
- operation: e.operation,
118
- securitySchemes: f.value,
119
- server: e.server,
120
- target: y.value
121
- }, null, 8, ["client", "example", "operation", "securitySchemes", "server", "target"])
159
+ client: V.value,
160
+ example: t.example,
161
+ operation: t.operation,
162
+ securitySchemes: $.value,
163
+ server: t.server,
164
+ target: E.value
165
+ }, null, 8, ["client", "example", "operation", "securitySchemes", "server", "target"]))
122
166
  ])
123
167
  ]),
124
168
  _: 1
@@ -133,5 +177,5 @@ const D = { class: "w-full" }, E = { class: "-mx-1 flex flex-1" }, N = { class:
133
177
  }
134
178
  });
135
179
  export {
136
- P as default
180
+ ne as default
137
181
  };
@@ -1 +1 @@
1
- {"version":3,"file":"RequestSection.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestSection.vue"],"names":[],"mappings":"AA4TA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AACzE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAA;AACnF,OAAO,KAAK,EACV,UAAU,EACV,SAAS,EACT,cAAc,EACd,MAAM,EACP,MAAM,iCAAiC,CAAA;AACxC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AASrE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAU1D,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,UAAU,CAAA;IACtB,WAAW,EAAE,WAAW,CAAA;IACxB,YAAY,EAAE,WAAW,EAAE,CAAA;IAC3B,OAAO,EAAE,cAAc,CAAA;IACvB,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IAC1B,SAAS,EAAE,SAAS,CAAA;IACpB,0BAA0B,EAAE,0BAA0B,CAAA;IACtD,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,SAAS,EAAE,SAAS,CAAA;CACrB,CAAC;;AA+UF,wBAOG"}
1
+ {"version":3,"file":"RequestSection.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestSection.vue"],"names":[],"mappings":"AA4TA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AACzE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAA;AACnF,OAAO,KAAK,EACV,UAAU,EACV,SAAS,EACT,cAAc,EACd,MAAM,EACP,MAAM,iCAAiC,CAAA;AACxC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AASrE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAU1D,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,UAAU,CAAA;IACtB,WAAW,EAAE,WAAW,CAAA;IACxB,YAAY,EAAE,WAAW,EAAE,CAAA;IAC3B,OAAO,EAAE,cAAc,CAAA;IACvB,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IAC1B,SAAS,EAAE,SAAS,CAAA;IACpB,0BAA0B,EAAE,0BAA0B,CAAA;IACtD,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,SAAS,EAAE,SAAS,CAAA;CACrB,CAAC;;AAgVF,wBAOG"}
@@ -1,7 +1,7 @@
1
1
  import o from "./RequestSection.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const c = /* @__PURE__ */ t(o, [["__scopeId", "data-v-6ea5cf36"]]);
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-fde565f2"]]);
5
5
  export {
6
- c as default
6
+ m as default
7
7
  };
@@ -109,7 +109,7 @@ const z = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:
109
109
  }, [
110
110
  e.collection && e.workspace && (t(u) !== "modal" || Object.keys(t(S) ?? {}).length) ? i((m(), b(F, {
111
111
  key: 0,
112
- class: "request-section-content-auth",
112
+ class: "request-section-content-auth border-b-0",
113
113
  id: r.value.Auth,
114
114
  collection: e.collection,
115
115
  envVariables: e.envVariables,
@@ -1 +1 @@
1
- {"version":3,"file":"ResponseBody.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/ResponseSection/ResponseBody.vue"],"names":[],"mappings":"AAiGA,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,OAAO,CAAA;IACb,OAAO,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,OAAO,CAAA;KAAE,EAAE,CAAA;CAC9D,CAAC;;AAwKF,wBAOG"}
1
+ {"version":3,"file":"ResponseBody.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/ResponseSection/ResponseBody.vue"],"names":[],"mappings":"AAkGA,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,OAAO,CAAA;IACb,OAAO,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,OAAO,CAAA;KAAE,EAAE,CAAA;CAC9D,CAAC;;AAyKF,wBAOG"}
@@ -1,7 +1,7 @@
1
1
  import o from "./ResponseBody.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const e = /* @__PURE__ */ t(o, [["__scopeId", "data-v-9bbb0b3d"]]);
4
+ const a = /* @__PURE__ */ t(o, [["__scopeId", "data-v-51934a33"]]);
5
5
  export {
6
- e as default
6
+ a as default
7
7
  };
@@ -1,4 +1,4 @@
1
- import { defineComponent as b, ref as C, computed as d, openBlock as o, createBlock as n, createSlots as N, withCtx as u, createTextVNode as h, toDisplayString as g, createElementBlock as T, createElementVNode as _, unref as a, createCommentVNode as s, createVNode as $ } from "vue";
1
+ import { defineComponent as b, ref as C, computed as d, openBlock as o, createBlock as n, createSlots as N, withCtx as u, createTextVNode as w, toDisplayString as g, createElementBlock as T, createElementVNode as _, unref as a, createCommentVNode as s, createVNode as $ } from "vue";
2
2
  import E from "../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
3
3
  import { useResponseBody as P } from "../../../hooks/useResponseBody.js";
4
4
  import S from "./ResponseBodyDownload.vue.js";
@@ -10,7 +10,7 @@ import { mediaTypes as I } from "../consts/mediaTypes.js";
10
10
  const q = {
11
11
  key: 0,
12
12
  class: "bg-b-1 flex max-h-[calc(100%-32px)] flex-col overflow-hidden"
13
- }, z = { class: "flex items-center justify-between border-b px-3 py-1.5" }, A = { class: "text-xxs font-code leading-3" }, X = /* @__PURE__ */ b({
13
+ }, z = { class: "flex min-h-8 items-center justify-between border-y px-3 py-1.5" }, A = { class: "text-xxs font-code leading-3" }, X = /* @__PURE__ */ b({
14
14
  __name: "ResponseBody",
15
15
  props: {
16
16
  title: {},
@@ -29,10 +29,10 @@ const q = {
29
29
  }), e = d(() => I[i.value.essence]);
30
30
  return (t, m) => (o(), n(E, { class: "max-h-content overflow-y-hidden" }, N({
31
31
  title: u(() => [
32
- h(g(t.title), 1)
32
+ w(g(t.title), 1)
33
33
  ]),
34
34
  default: u(() => {
35
- var f, v, y, w;
35
+ var f, v, y, h;
36
36
  return [
37
37
  t.data ? (o(), T("div", q, [
38
38
  _("div", z, [
@@ -55,9 +55,9 @@ const q = {
55
55
  src: a(l),
56
56
  type: a(i).essence
57
57
  }, null, 8, ["alpha", "mode", "src", "type"])) : s("", !0),
58
- !((y = e.value) != null && y.raw) && !((w = e.value) != null && w.preview) ? (o(), n(U, { key: 2 }, {
58
+ !((y = e.value) != null && y.raw) && !((h = e.value) != null && h.preview) ? (o(), n(U, { key: 2 }, {
59
59
  default: u(() => m[1] || (m[1] = [
60
- h(" Binary file ")
60
+ w(" Binary file ")
61
61
  ])),
62
62
  _: 1
63
63
  })) : s("", !0)
@@ -37,7 +37,7 @@ const P = { class: "col-1 flex-center relative gap-6 p-2 capitalize" }, T = {
37
37
  }));
38
38
  }, y = (s) => {
39
39
  s != null && s.createNew && w.name === "request" && k();
40
- }, N = "2.3.11";
40
+ }, N = "2.3.13";
41
41
  return B(() => r.hotKeys.on(y)), E(() => r.hotKeys.off(y)), (s, e) => (u(), i("div", P, [
42
42
  o("div", {
43
43
  class: q(["flex h-[calc(100%_-_50px)] flex-col items-center justify-center", {
@@ -1,31 +1,31 @@
1
- import { useActiveEntities as R } from "../../../store/active-entities.js";
1
+ import { useActiveEntities as D } from "../../../store/active-entities.js";
2
2
  import { specDictionary as f } from "../../../store/import-spec.js";
3
- import { combineRenameDiffs as S, mutateCollectionDiff as d, mutateSecuritySchemeDiff as g, mutateServerDiff as D, mutateTagDiff as T, mutateRequestDiff as M } from "../libs/watch-mode.js";
4
- import { fetchSpecFromUrl as I, createHash as U } from "@scalar/oas-utils/helpers";
3
+ import { combineRenameDiffs as R, mutateCollectionDiff as d, mutateSecuritySchemeDiff as g, mutateServerDiff as S, mutateTagDiff as T, mutateRequestDiff as M } from "../libs/watch-mode.js";
4
+ import { fetchDocument as I, createHash as C } from "@scalar/oas-utils/helpers";
5
5
  import { parseSchema as O } from "@scalar/oas-utils/transforms";
6
- import { useToasts as C } from "@scalar/use-toasts";
7
- import { useTimeoutPoll as L } from "@vueuse/core";
8
- import N from "microdiff";
6
+ import { useToasts as L } from "@scalar/use-toasts";
7
+ import { useTimeoutPoll as N } from "@vueuse/core";
8
+ import U from "microdiff";
9
9
  import { watch as b } from "vue";
10
10
  import { useWorkspace as P } from "../../../store/store.js";
11
11
  const k = 5 * 1e3, q = 60 * 1e3, J = () => {
12
- const { toast: h } = C(), c = R(), o = P(), { activeCollection: t, activeWorkspace: W } = c, { collectionMutators: n } = o, r = (e) => h(`[useOpenApiWatcher] Changes to the ${e} were not applied`, "error"), w = (e) => {
13
- e.path[0] === "info" || e.path[0] === "security" ? d(e, c, o) || r("collection") : e.path[0] === "components" && e.path[1] === "securitySchemes" ? g(e, c, o) || r("securitySchemes") : e.path[0] === "servers" ? D(e, c, o) || r("servers") : e.path[0] === "tags" ? T(e, c, o) || r("tags") : e.path[0] === "paths" && (M(e, c, o) || r("requests"));
14
- }, { pause: p, resume: m } = L(async () => {
12
+ const { toast: h } = L(), c = D(), o = P(), { activeCollection: s, activeWorkspace: W } = c, { collectionMutators: n } = o, a = (e) => h(`[useOpenApiWatcher] Changes to the ${e} were not applied`, "error"), w = (e) => {
13
+ e.path[0] === "info" || e.path[0] === "security" ? d(e, c, o) || a("collection") : e.path[0] === "components" && e.path[1] === "securitySchemes" ? g(e, c, o) || a("securitySchemes") : e.path[0] === "servers" ? S(e, c, o) || a("servers") : e.path[0] === "tags" ? T(e, c, o) || a("tags") : e.path[0] === "paths" && (M(e, c, o) || a("requests"));
14
+ }, { pause: p, resume: m } = N(async () => {
15
15
  var l, v;
16
- const e = (l = t.value) == null ? void 0 : l.documentUrl;
16
+ const e = (l = s.value) == null ? void 0 : l.documentUrl;
17
17
  if (!e)
18
18
  return;
19
- const s = f[e];
19
+ const t = f[e];
20
20
  try {
21
- const a = await I(e, (v = W.value) == null ? void 0 : v.proxyUrl, !1), u = U(a);
22
- if (n.edit(t.value.uid, "watchModeStatus", "WATCHING"), s != null && s.hash)
23
- if (s.hash && s.hash !== u) {
24
- const { schema: i } = await O(a), A = N(s.schema, i), y = S(A);
21
+ const i = await I(e, (v = W.value) == null ? void 0 : v.proxyUrl, !1), u = C(i);
22
+ if (n.edit(s.value.uid, "watchModeStatus", "WATCHING"), t != null && t.hash)
23
+ if (t.hash && t.hash !== u) {
24
+ const { schema: r } = await O(i), A = U(t.schema, r), y = R(A);
25
25
  try {
26
26
  y.forEach(w), f[e] = {
27
27
  hash: u,
28
- schema: i
28
+ schema: r
29
29
  };
30
30
  } catch (E) {
31
31
  console.error("[useOpenApiWatcher] Error:", E);
@@ -33,14 +33,14 @@ const k = 5 * 1e3, q = 60 * 1e3, J = () => {
33
33
  } else
34
34
  console.log("[useOpenApiWatcher] No changes detected yet…");
35
35
  else {
36
- const { schema: i } = await O(a);
37
- i && (f[e] = {
36
+ const { schema: r } = await O(i);
37
+ r && (f[e] = {
38
38
  hash: u,
39
- schema: i
39
+ schema: r
40
40
  });
41
41
  }
42
- } catch (a) {
43
- console.error("[useOpenApiWatcher] Error:", a), console.info("[useOpenApiWatcher] Pausing watcher for 60 seconds"), p(), n.edit(t.value.uid, "watchModeStatus", "ERROR"), h("[useOpenApiWatcher] Unable to fetch the spec file, paused the watcher for 60 seconds", "error"), setTimeout(() => {
42
+ } catch (i) {
43
+ console.error("[useOpenApiWatcher] Error:", i), console.info("[useOpenApiWatcher] Pausing watcher for 60 seconds"), p(), n.edit(s.value.uid, "watchModeStatus", "ERROR"), h("[useOpenApiWatcher] Unable to fetch the spec file, paused the watcher for 60 seconds", "error"), setTimeout(() => {
44
44
  console.info("[useOpenApiWatcher] Resuming watcher"), m();
45
45
  }, q);
46
46
  }
@@ -48,13 +48,13 @@ const k = 5 * 1e3, q = 60 * 1e3, J = () => {
48
48
  b(
49
49
  [() => {
50
50
  var e;
51
- return (e = t.value) == null ? void 0 : e.documentUrl;
51
+ return (e = s.value) == null ? void 0 : e.documentUrl;
52
52
  }, () => {
53
53
  var e;
54
- return (e = t.value) == null ? void 0 : e.watchMode;
54
+ return (e = s.value) == null ? void 0 : e.watchMode;
55
55
  }],
56
- ([e, s]) => {
57
- e && s ? (console.info(`[useOpenApiWatcher] Watching ${e} …`), m()) : t.value && (p(), n.edit(t.value.uid, "watchModeStatus", "IDLE"));
56
+ ([e, t]) => {
57
+ e && t ? (console.info(`[useOpenApiWatcher] Watching ${e} …`), m()) : s.value && (p(), n.edit(s.value.uid, "watchModeStatus", "IDLE"));
58
58
  },
59
59
  { immediate: !0 }
60
60
  );
package/package.json CHANGED
@@ -18,7 +18,7 @@
18
18
  "rest",
19
19
  "testing"
20
20
  ],
21
- "version": "2.3.11",
21
+ "version": "2.3.13",
22
22
  "engines": {
23
23
  "node": ">=18"
24
24
  },
@@ -189,22 +189,22 @@
189
189
  "whatwg-mimetype": "^4.0.0",
190
190
  "yaml": "^2.4.5",
191
191
  "zod": "^3.23.8",
192
- "@scalar/components": "0.13.42",
193
- "@scalar/icons": "0.1.3",
192
+ "@scalar/components": "0.13.44",
194
193
  "@scalar/draggable": "0.1.11",
195
- "@scalar/import": "0.3.8",
194
+ "@scalar/icons": "0.1.3",
195
+ "@scalar/import": "0.3.10",
196
+ "@scalar/oas-utils": "0.2.127",
196
197
  "@scalar/object-utils": "1.1.13",
197
- "@scalar/openapi-parser": "0.10.13",
198
- "@scalar/oas-utils": "0.2.125",
198
+ "@scalar/openapi-parser": "0.10.14",
199
199
  "@scalar/openapi-types": "0.2.0",
200
200
  "@scalar/snippetz": "0.2.19",
201
- "@scalar/postman-to-openapi": "0.1.48",
202
- "@scalar/themes": "0.9.83",
203
- "@scalar/types": "0.1.5",
204
- "@scalar/use-codemirror": "0.11.87",
201
+ "@scalar/postman-to-openapi": "0.2.0",
202
+ "@scalar/themes": "0.9.84",
203
+ "@scalar/types": "0.1.6",
205
204
  "@scalar/use-toasts": "0.7.9",
206
- "@scalar/use-hooks": "0.1.37",
207
- "@scalar/use-tooltip": "1.0.6"
205
+ "@scalar/use-tooltip": "1.0.6",
206
+ "@scalar/use-codemirror": "0.11.89",
207
+ "@scalar/use-hooks": "0.1.38"
208
208
  },
209
209
  "devDependencies": {
210
210
  "@types/shell-quote": "^1.7.5",
@@ -219,8 +219,8 @@
219
219
  "vite": "^5.4.10",
220
220
  "vite-svg-loader": "^5.1.0",
221
221
  "vitest": "^1.6.0",
222
- "@scalar/build-tooling": "0.1.17",
223
- "@scalar/galaxy": "0.3.1"
222
+ "@scalar/galaxy": "0.3.1",
223
+ "@scalar/build-tooling": "0.1.17"
224
224
  },
225
225
  "scripts": {
226
226
  "build": "scalar-build-vite",