@scalar/api-client 2.17.6 → 2.17.8

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 (40) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/dist/components/CommandPalette/CommandActionInput.vue.js +1 -1
  3. package/dist/components/Sidebar/Actions/DeleteSidebarListElement.vue.js +5 -5
  4. package/dist/components/Sidebar/Actions/EditSidebarListCollection.vue.js +18 -18
  5. package/dist/components/Sidebar/Actions/EditSidebarListElement.vue.js +7 -7
  6. package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.d.ts.map +1 -1
  7. package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.js +44 -5
  8. package/dist/components/Sidebar/Actions/SidebarListElementForm.vue2.js +2 -44
  9. package/dist/style.css +1 -1
  10. package/dist/v2/blocks/operation-block/helpers/build-request.d.ts.map +1 -1
  11. package/dist/v2/blocks/operation-block/helpers/build-request.js +22 -17
  12. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts +18 -10
  13. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts.map +1 -1
  14. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.js +149 -126
  15. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesAddModal.vue.d.ts +20 -0
  16. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesAddModal.vue.d.ts.map +1 -0
  17. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesAddModal.vue.js +7 -0
  18. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesAddModal.vue2.js +76 -0
  19. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.d.ts +22 -5
  20. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.d.ts.map +1 -1
  21. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.js +79 -64
  22. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts +16 -8
  23. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts.map +1 -1
  24. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts +2 -2
  25. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts.map +1 -1
  26. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.js +84 -82
  27. package/dist/v2/components/forms/ConfirmationForm.vue.d.ts.map +1 -1
  28. package/dist/v2/components/forms/ConfirmationForm.vue.js +43 -5
  29. package/dist/v2/components/forms/ConfirmationForm.vue2.js +2 -43
  30. package/dist/v2/components/modals/DeleteModal.vue.js +11 -11
  31. package/dist/v2/features/operation/Operation.vue.js +1 -1
  32. package/dist/v2/features/settings/DocumentSettings.vue.d.ts.map +1 -1
  33. package/dist/v2/features/settings/DocumentSettings.vue.js +104 -5
  34. package/dist/v2/features/settings/DocumentSettings.vue2.js +2 -104
  35. package/dist/views/Collection/CollectionSettings.vue.d.ts.map +1 -1
  36. package/dist/views/Collection/CollectionSettings.vue.js +1 -4
  37. package/dist/views/Collection/CollectionSettings.vue2.js +5 -5
  38. package/dist/views/Environment/EnvironmentColorModal.vue.js +6 -6
  39. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  40. package/package.json +12 -12
@@ -1,128 +1,130 @@
1
- import { makeUrlAbsolute as A } from "@scalar/helpers/url/make-url-absolute";
2
- import { shouldUseProxy as b } from "@scalar/oas-utils/helpers";
3
- import { encode as C, fromUint8Array as S } from "js-base64";
4
- const E = () => {
5
- const r = new Uint8Array(32);
6
- return crypto.getRandomValues(r), S(r, !0);
7
- }, z = async (r, t) => {
8
- if (t === "plain")
9
- return r;
1
+ import { makeUrlAbsolute as b } from "@scalar/helpers/url/make-url-absolute";
2
+ import { shouldUseProxy as E } from "@scalar/oas-utils/helpers";
3
+ import { encode as A, fromUint8Array as C } from "js-base64";
4
+ const S = () => {
5
+ const s = new Uint8Array(32);
6
+ return crypto.getRandomValues(s), C(s, !0);
7
+ }, z = async (s, e) => {
8
+ if (e === "plain")
9
+ return s;
10
10
  if (typeof crypto?.subtle?.digest != "function")
11
- return console.warn("SHA-256 is only supported when using https, using a plain text code challenge instead."), r;
12
- const l = new TextEncoder().encode(r), w = await crypto.subtle.digest("SHA-256", l);
13
- return S(new Uint8Array(w), !0);
14
- }, $ = async (r, t, p, l, w) => {
15
- const d = r[t];
11
+ return console.warn("SHA-256 is only supported when using https, using a plain text code challenge instead."), s;
12
+ const l = new TextEncoder().encode(s), f = await crypto.subtle.digest("SHA-256", l);
13
+ return C(new Uint8Array(f), !0);
14
+ }, L = async (s, e, g, l, f) => {
15
+ const d = s[e];
16
16
  try {
17
17
  if (!d)
18
18
  return [new Error("Flow not found"), null];
19
- const f = p.join(" ");
20
- if (t === "clientCredentials" || t === "password")
19
+ const m = g.join(" ");
20
+ if (e === "clientCredentials" || e === "password")
21
21
  return U(
22
- r,
23
- t,
24
- f,
22
+ s,
23
+ e,
24
+ m,
25
25
  {
26
- proxyUrl: w
26
+ proxyUrl: f
27
27
  },
28
28
  l
29
29
  );
30
- const e = (Math.random() + 1).toString(36).substring(2, 10), a = A(r[t].authorizationUrl, {
30
+ const t = (Math.random() + 1).toString(36).substring(2, 10), a = b(s[e].authorizationUrl, {
31
31
  baseUrl: l?.url
32
32
  }), n = new URL(a);
33
- let o = null;
34
- if (t === "implicit")
33
+ let c = null;
34
+ if (e === "implicit")
35
35
  n.searchParams.set("response_type", "token");
36
- else if (t === "authorizationCode") {
37
- const s = r[t];
38
- if (n.searchParams.set("response_type", "code"), s["x-usePkce"] !== "no") {
39
- const c = E(), i = await z(c, s["x-usePkce"]);
40
- o = {
41
- codeVerifier: c,
42
- codeChallenge: i,
43
- codeChallengeMethod: s["x-usePkce"] === "SHA-256" ? "S256" : "plain"
44
- }, n.searchParams.set("code_challenge", i), n.searchParams.set("code_challenge_method", o.codeChallengeMethod);
36
+ else if (e === "authorizationCode") {
37
+ const r = s[e];
38
+ if (n.searchParams.set("response_type", "code"), r["x-usePkce"] !== "no") {
39
+ const o = S(), u = await z(o, r["x-usePkce"]);
40
+ c = {
41
+ codeVerifier: o,
42
+ codeChallenge: u,
43
+ codeChallengeMethod: r["x-usePkce"] === "SHA-256" ? "S256" : "plain"
44
+ }, n.searchParams.set("code_challenge", u), n.searchParams.set("code_challenge_method", c.codeChallengeMethod);
45
45
  }
46
46
  }
47
- const m = r[t];
48
- if (m["x-scalar-secret-redirect-uri"].startsWith("/")) {
49
- const s = l?.url || window.location.origin + window.location.pathname, c = new URL(m["x-scalar-secret-redirect-uri"], s).toString();
50
- n.searchParams.set("redirect_uri", c);
47
+ const i = s[e];
48
+ if (i["x-scalar-secret-redirect-uri"].startsWith("/")) {
49
+ const r = l?.url || window.location.origin + window.location.pathname, o = new URL(i["x-scalar-secret-redirect-uri"], r).toString();
50
+ n.searchParams.set("redirect_uri", o);
51
51
  } else
52
- n.searchParams.set("redirect_uri", m["x-scalar-secret-redirect-uri"]);
53
- d["x-scalar-security-query"] && Object.keys(d["x-scalar-security-query"]).forEach((s) => {
54
- const c = d["x-scalar-security-query"]?.[s];
55
- c && n.searchParams.set(s, c);
56
- }), n.searchParams.set("client_id", d["x-scalar-secret-client-id"]), n.searchParams.set("state", e), f && n.searchParams.set("scope", f);
57
- const u = window.open(n, "openAuth2Window", "left=100,top=100,width=800,height=600");
58
- return u ? new Promise((s) => {
59
- const c = setInterval(() => {
60
- let i = null, g = null, x = null, P = null;
52
+ n.searchParams.set("redirect_uri", i["x-scalar-secret-redirect-uri"]);
53
+ d["x-scalar-security-query"] && Object.keys(d["x-scalar-security-query"]).forEach((r) => {
54
+ const o = d["x-scalar-security-query"]?.[r];
55
+ o && n.searchParams.set(r, o);
56
+ }), n.searchParams.set("client_id", d["x-scalar-secret-client-id"]), n.searchParams.set("state", t), m && n.searchParams.set("scope", m);
57
+ const h = window.open(n, "openAuth2Window", "left=100,top=100,width=800,height=600");
58
+ return h ? new Promise((r) => {
59
+ const o = setInterval(() => {
60
+ let u = null, p = null, x = null, _ = null;
61
61
  try {
62
- const h = new URL(u.location.href).searchParams, k = d["x-tokenName"] || "access_token";
63
- i = h.get(k), g = h.get("code"), x = h.get("error"), P = h.get("error_description");
64
- const y = new URLSearchParams(u.location.href.split("#")[1]);
65
- i ||= y.get(k), g ||= y.get("code"), x ||= y.get("error"), P ||= y.get("error_description");
62
+ const w = new URL(h.location.href).searchParams, k = d["x-tokenName"] || "access_token";
63
+ u = w.get(k), p = w.get("code"), x = w.get("error"), _ = w.get("error_description");
64
+ const P = new URLSearchParams(h.location.href.split("#")[1]);
65
+ u ||= P.get(k), p ||= P.get("code"), x ||= P.get("error"), _ ||= P.get("error_description");
66
66
  } catch {
67
67
  }
68
- if (u.closed || i || g || x)
69
- if (clearInterval(c), u.close(), x)
70
- s([new Error(`OAuth error: ${x}${P ? ` (${P})` : ""}`), null]);
71
- else if (i) {
72
- const h = u.location.href.match(/state=([^&]*)/)?.[1];
73
- s(h === e ? [null, i] : [new Error("State mismatch"), null]);
74
- } else g && t === "authorizationCode" ? new URL(u.location.href).searchParams.get("state") === e ? U(
75
- r,
76
- t,
77
- f,
68
+ if (h.closed || u || p || x)
69
+ if (clearInterval(o), h.close(), x)
70
+ r([new Error(`OAuth error: ${x}${_ ? ` (${_})` : ""}`), null]);
71
+ else if (u) {
72
+ const w = h.location.href.match(/state=([^&]*)/)?.[1];
73
+ r(w === t ? [null, u] : [new Error("State mismatch"), null]);
74
+ } else p && e === "authorizationCode" ? new URL(h.location.href).searchParams.get("state") === t ? U(
75
+ s,
76
+ e,
77
+ m,
78
78
  {
79
- code: g,
80
- pkce: o,
81
- proxyUrl: w
79
+ code: p,
80
+ pkce: c,
81
+ proxyUrl: f
82
82
  },
83
83
  l
84
- ).then(s) : s([new Error("State mismatch"), null]) : (clearInterval(c), s([new Error("Window was closed without granting authorization"), null]));
84
+ ).then(r) : r([new Error("State mismatch"), null]) : (clearInterval(o), r([new Error("Window was closed without granting authorization"), null]));
85
85
  }, 200);
86
86
  }) : [new Error("Failed to open auth window"), null];
87
87
  } catch {
88
88
  return [new Error("Failed to authorize oauth2 flow"), null];
89
89
  }
90
- }, U = async (r, t, p, {
90
+ }, U = async (s, e, g, {
91
91
  code: l,
92
- pkce: w,
92
+ pkce: f,
93
93
  proxyUrl: d
94
- } = {}, f) => {
95
- const e = r[t];
96
- if (!e)
94
+ } = {}, m) => {
95
+ const t = s[e];
96
+ if (!t)
97
97
  return [new Error("OAuth2 flow was not defined"), null];
98
98
  const a = new URLSearchParams();
99
- if (a.set("client_id", e["x-scalar-secret-client-id"]), p && (t === "clientCredentials" || t === "password") && a.set("scope", p), e["x-scalar-secret-client-secret"] && (!e["x-scalar-credentials-location"] || e["x-scalar-credentials-location"] === "body") && a.set("client_secret", e["x-scalar-secret-client-secret"]), "x-scalar-secret-redirect-uri" in e && e["x-scalar-secret-redirect-uri"] && a.set("redirect_uri", e["x-scalar-secret-redirect-uri"]), l)
100
- a.set("code", l), a.set("grant_type", "authorization_code"), w && a.set("code_verifier", w.codeVerifier);
101
- else if (t === "password") {
102
- const o = r[t];
103
- a.set("grant_type", "password"), a.set("username", o["x-scalar-secret-username"]), a.set("password", o["x-scalar-secret-password"]);
99
+ g && (e === "clientCredentials" || e === "password") && a.set("scope", g);
100
+ const n = t["x-scalar-credentials-location"] === "body";
101
+ if (n && (a.set("client_id", t["x-scalar-secret-client-id"]), a.set("client_secret", t["x-scalar-secret-client-secret"])), "x-scalar-secret-redirect-uri" in t && t["x-scalar-secret-redirect-uri"] && a.set("redirect_uri", t["x-scalar-secret-redirect-uri"]), l)
102
+ a.set("code", l), a.set("grant_type", "authorization_code"), f && a.set("code_verifier", f.codeVerifier);
103
+ else if (e === "password") {
104
+ const c = s[e];
105
+ a.set("grant_type", "password"), a.set("username", c["x-scalar-secret-username"]), a.set("password", c["x-scalar-secret-password"]);
104
106
  } else
105
107
  a.set("grant_type", "client_credentials");
106
- e["x-scalar-security-body"] && Object.entries(e["x-scalar-security-body"]).forEach(([o, m]) => {
107
- m && a.set(o, m);
108
+ t["x-scalar-security-body"] && Object.entries(t["x-scalar-security-body"]).forEach(([c, i]) => {
109
+ i && a.set(c, i);
108
110
  });
109
111
  try {
110
- const o = {
112
+ const c = {
111
113
  "Content-Type": "application/x-www-form-urlencoded"
112
114
  };
113
- e["x-scalar-secret-client-secret"] && (!e["x-scalar-credentials-location"] || e["x-scalar-credentials-location"] === "header") && (o.Authorization = `Basic ${C(`${e["x-scalar-secret-client-id"]}:${e["x-scalar-secret-client-secret"]}`)}`);
114
- const _ = A(e.tokenUrl, { baseUrl: f?.url }), u = b(d, _) ? `${d}?${new URLSearchParams([["scalar_url", _]]).toString()}` : _, c = await (await fetch(u, {
115
+ n || (c.Authorization = `Basic ${A(`${t["x-scalar-secret-client-id"]}:${t["x-scalar-secret-client-secret"]}`)}`);
116
+ const i = b(t.tokenUrl, { baseUrl: m?.url }), y = E(d, i) ? `${d}?${new URLSearchParams([["scalar_url", i]]).toString()}` : i, r = await (await fetch(y, {
115
117
  method: "POST",
116
- headers: o,
118
+ headers: c,
117
119
  body: a
118
- })).json(), i = e["x-tokenName"] || "access_token";
119
- return [null, c[i]];
120
+ })).json(), o = t["x-tokenName"] || "access_token";
121
+ return [null, r[o]];
120
122
  } catch {
121
123
  return [new Error("Failed to get an access token. Please check your credentials."), null];
122
124
  }
123
125
  };
124
126
  export {
125
- $ as authorizeOauth2,
127
+ L as authorizeOauth2,
126
128
  U as authorizeServers,
127
129
  z as generateCodeChallenge
128
130
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ConfirmationForm.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/forms/ConfirmationForm.vue"],"names":[],"mappings":"AAwDA,KAAK,WAAW,GAAG;IACjB,qCAAqC;IACrC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,0CAA0C;IAC1C,OAAO,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAA;CAC7B,CAAC;AAqGF,QAAA,IAAI,OAAO,IAAW,CAAE;AACxB,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,CAAC;AAsB/C,QAAA,MAAM,eAAe;;;;;;kFAOnB,CAAC;wBACkB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;AAAzE,wBAA0E;AAQ1E,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"ConfirmationForm.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/forms/ConfirmationForm.vue"],"names":[],"mappings":"AA6CA,KAAK,WAAW,GAAG;IACjB,qCAAqC;IACrC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,0CAA0C;IAC1C,OAAO,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAA;CAC7B,CAAC;AA4EF,QAAA,IAAI,OAAO,IAAW,CAAE;AACxB,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,CAAC;AAsB/C,QAAA,MAAM,eAAe;;;;;;kFAOnB,CAAC;wBACkB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;AAAzE,wBAA0E;AAQ1E,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -1,7 +1,45 @@
1
- import o from "./ConfirmationForm.vue2.js";
2
- /* empty css */
3
- import r from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const f = /* @__PURE__ */ r(o, [["__scopeId", "data-v-b4497d3d"]]);
1
+ import { defineComponent as f, createElementBlock as u, openBlock as d, withModifiers as p, renderSlot as v, createElementVNode as b, createVNode as o, unref as a, withCtx as i, createTextVNode as l, toDisplayString as c } from "vue";
2
+ import { ScalarButton as r } from "@scalar/components";
3
+ const x = { class: "flex justify-between gap-10" }, g = /* @__PURE__ */ f({
4
+ __name: "ConfirmationForm",
5
+ props: {
6
+ label: { default: "Save" },
7
+ variant: { default: "solid" }
8
+ },
9
+ emits: ["cancel", "submit"],
10
+ setup(C, { emit: s }) {
11
+ const n = s;
12
+ return (t, e) => (d(), u("form", {
13
+ class: "flex flex-col gap-4 text-base",
14
+ onSubmit: e[1] || (e[1] = p((m) => n("submit"), ["prevent"]))
15
+ }, [
16
+ v(t.$slots, "default"),
17
+ b("div", x, [
18
+ o(a(r), {
19
+ size: "sm",
20
+ type: "button",
21
+ variant: "outlined",
22
+ onClick: e[0] || (e[0] = (m) => n("cancel"))
23
+ }, {
24
+ default: i(() => [...e[2] || (e[2] = [
25
+ l(" Cancel ", -1)
26
+ ])]),
27
+ _: 1
28
+ }),
29
+ o(a(r), {
30
+ size: "sm",
31
+ type: "submit",
32
+ variant: t.variant
33
+ }, {
34
+ default: i(() => [
35
+ l(c(t.label), 1)
36
+ ]),
37
+ _: 1
38
+ }, 8, ["variant"])
39
+ ])
40
+ ], 32));
41
+ }
42
+ });
5
43
  export {
6
- f as default
44
+ g as default
7
45
  };
@@ -1,45 +1,4 @@
1
- import { defineComponent as m, createElementBlock as p, openBlock as f, withModifiers as d, renderSlot as c, createElementVNode as v, createVNode as n, unref as a, withCtx as i, createTextVNode as l, toDisplayString as b } from "vue";
2
- import { ScalarButton as r } from "@scalar/components";
3
- const x = { class: "flex justify-between gap-10" }, S = /* @__PURE__ */ m({
4
- __name: "ConfirmationForm",
5
- props: {
6
- label: { default: "Save" },
7
- variant: { default: "solid" }
8
- },
9
- emits: ["cancel", "submit"],
10
- setup(w, { emit: s }) {
11
- const o = s;
12
- return (t, e) => (f(), p("form", {
13
- class: "flex flex-col gap-4 text-base",
14
- onSubmit: e[1] || (e[1] = d((u) => o("submit"), ["prevent"]))
15
- }, [
16
- c(t.$slots, "default", {}, void 0, !0),
17
- v("div", x, [
18
- n(a(r), {
19
- class: "flex h-8 cursor-pointer items-center gap-1.5 px-2.5 shadow-none focus:outline-none",
20
- type: "button",
21
- variant: "outlined",
22
- onClick: e[0] || (e[0] = (u) => o("cancel"))
23
- }, {
24
- default: i(() => [...e[2] || (e[2] = [
25
- l(" Cancel ", -1)
26
- ])]),
27
- _: 1
28
- }),
29
- n(a(r), {
30
- class: "custom-scroll h-8 gap-1.5 px-2.5 font-medium whitespace-nowrap shadow-none focus:outline-none",
31
- type: "submit",
32
- variant: t.variant
33
- }, {
34
- default: i(() => [
35
- l(b(t.label), 1)
36
- ]),
37
- _: 1
38
- }, 8, ["variant"])
39
- ])
40
- ], 32));
41
- }
42
- });
1
+ import f from "./ConfirmationForm.vue.js";
43
2
  export {
44
- S as default
3
+ f as default
45
4
  };
@@ -1,31 +1,31 @@
1
- import { defineComponent as s, computed as i, createBlock as p, openBlock as o, unref as c, withCtx as d, createElementBlock as u, createCommentVNode as f, toDisplayString as g } from "vue";
2
- import { truncate as C } from "@scalar/helpers/string/truncate";
1
+ import { defineComponent as s, computed as i, createBlock as c, openBlock as a, unref as p, withCtx as d, createElementBlock as u, createCommentVNode as f, toDisplayString as g } from "vue";
2
+ import { truncate as _ } from "@scalar/helpers/string/truncate";
3
3
  import k from "../forms/ConfirmationForm.vue.js";
4
4
  const v = {
5
5
  key: 0,
6
6
  class: "text-c-2 text-sm leading-normal text-pretty"
7
- }, b = /* @__PURE__ */ s({
7
+ }, M = /* @__PURE__ */ s({
8
8
  __name: "DeleteModal",
9
9
  props: {
10
10
  name: {},
11
11
  warningMessage: {}
12
12
  },
13
13
  emits: ["close", "delete"],
14
- setup(a, { emit: r }) {
15
- const t = r, m = i(() => C(a.name));
16
- return (n, e) => (o(), p(c(k), {
17
- label: `Delete ${m.value}`,
14
+ setup(o, { emit: r }) {
15
+ const t = r, l = i(() => _(o.name));
16
+ return (n, e) => (a(), c(p(k), {
17
+ label: `Delete ${l.value}`,
18
18
  variant: "danger",
19
- onCancel: e[0] || (e[0] = (l) => t("close")),
20
- onSubmit: e[1] || (e[1] = (l) => t("delete"))
19
+ onCancel: e[0] || (e[0] = (m) => t("close")),
20
+ onSubmit: e[1] || (e[1] = (m) => t("delete"))
21
21
  }, {
22
22
  default: d(() => [
23
- n.warningMessage ? (o(), u("p", v, g(n.warningMessage), 1)) : f("", !0)
23
+ n.warningMessage ? (a(), u("p", v, g(n.warningMessage), 1)) : f("", !0)
24
24
  ]),
25
25
  _: 1
26
26
  }, 8, ["label"]));
27
27
  }
28
28
  });
29
29
  export {
30
- b as default
30
+ M as default
31
31
  };
@@ -57,7 +57,7 @@ const w = {
57
57
  method: t.method ?? "get"
58
58
  } : {
59
59
  type: "document"
60
- }), c = "2.17.6";
60
+ }), c = "2.17.8";
61
61
  return (e, a) => e.path && e.method && e.exampleName && r.value ? (n(), h(l(g), {
62
62
  key: 0,
63
63
  appVersion: l(c),
@@ -1 +1 @@
1
- {"version":3,"file":"DocumentSettings.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/settings/DocumentSettings.vue"],"names":[],"mappings":"AAmKA,KAAK,WAAW,GAAG;IACjB,uCAAuC;IACvC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,yDAAyD;IACzD,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,qBAAqB;IACrB,KAAK,EAAE,MAAM,CAAA;IACb,+CAA+C;IAC/C,eAAe,CAAC,EAAE,OAAO,CAAA;CAC1B,CAAC;;;;;;;;AAgUF,wBAOG"}
1
+ {"version":3,"file":"DocumentSettings.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/settings/DocumentSettings.vue"],"names":[],"mappings":"AAyJA,KAAK,WAAW,GAAG;IACjB,uCAAuC;IACvC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,yDAAyD;IACzD,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,qBAAqB;IACrB,KAAK,EAAE,MAAM,CAAA;IACb,+CAA+C;IAC/C,eAAe,CAAC,EAAE,OAAO,CAAA;CAC1B,CAAC;;;;;;;;AAkTF,wBAOG"}
@@ -1,7 +1,106 @@
1
- import t from "./DocumentSettings.vue2.js";
2
- /* empty css */
3
- import o from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const c = /* @__PURE__ */ o(t, [["__scopeId", "data-v-cda64f02"]]);
1
+ import { defineComponent as v, createElementBlock as d, openBlock as a, Fragment as i, createElementVNode as e, createVNode as n, unref as o, createTextVNode as u, toDisplayString as w, withCtx as m } from "vue";
2
+ import { useModal as x, ScalarToggle as D, ScalarIcon as f, ScalarButton as y, ScalarModal as k } from "@scalar/components";
3
+ import M from "../../../components/Sidebar/Actions/DeleteSidebarListElement.vue.js";
4
+ const U = { class: "flex flex-col gap-12" }, C = { class: "flex flex-col gap-2" }, N = { class: "bg-b-2 rounded-lg border text-sm" }, S = { class: "bg-b-1 flex items-center justify-between gap-4 rounded-t-lg p-3" }, B = { class: "text-c-1 flex items-center overflow-x-auto border-t py-1.5 whitespace-nowrap" }, V = { class: "flex items-center" }, T = ["href"], z = { class: "flex flex-col gap-4" }, A = { class: "flex items-center justify-between rounded-lg border p-3 text-sm" }, O = /* @__PURE__ */ v({
5
+ __name: "DocumentSettings",
6
+ props: {
7
+ documentUrl: {},
8
+ watchMode: { type: Boolean },
9
+ title: {},
10
+ isDraftDocument: { type: Boolean, default: !1 }
11
+ },
12
+ emits: ["delete:document", "update:watchMode"],
13
+ setup(p, { emit: g }) {
14
+ const r = g, s = x(), b = () => {
15
+ p.isDraftDocument || s.show();
16
+ }, h = () => {
17
+ r("delete:document"), s.hide();
18
+ };
19
+ return (l, t) => (a(), d(i, null, [
20
+ e("div", U, [
21
+ e("div", C, [
22
+ t[5] || (t[5] = e("div", { class: "flex h-8 items-center" }, [
23
+ e("h3", { class: "font-bold" }, "Features")
24
+ ], -1)),
25
+ e("div", N, [
26
+ e("div", S, [
27
+ t[2] || (t[2] = e("div", null, [
28
+ e("h4", null, "Watch Mode"),
29
+ e("p", { class: "text-c-2 mt-1" }, " When enabled, the OpenAPI document will be polled for changes. The collection will be updated automatically. ")
30
+ ], -1)),
31
+ n(o(D), {
32
+ class: "w-4",
33
+ disabled: !l.documentUrl,
34
+ modelValue: l.watchMode ?? !1,
35
+ "onUpdate:modelValue": t[0] || (t[0] = (c) => r("update:watchMode", c))
36
+ }, null, 8, ["disabled", "modelValue"])
37
+ ]),
38
+ e("div", B, [
39
+ e("div", V, [
40
+ l.documentUrl ? (a(), d(i, { key: 0 }, [
41
+ t[3] || (t[3] = e("span", { class: "bg-b-2 sticky left-0 pr-2 pl-3" }, "Source", -1)),
42
+ e("a", {
43
+ class: "text-c-2 group rounded pr-3 no-underline hover:underline",
44
+ href: l.documentUrl,
45
+ target: "_blank"
46
+ }, [
47
+ u(w(l.documentUrl) + " ", 1),
48
+ n(o(f), {
49
+ class: "ml-1 hidden w-2.5 group-hover:inline",
50
+ icon: "ExternalLink"
51
+ })
52
+ ], 8, T)
53
+ ], 64)) : (a(), d(i, { key: 1 }, [
54
+ n(o(f), {
55
+ class: "text-c-2 mr-2 ml-3 w-4",
56
+ icon: "NotAllowed",
57
+ size: "sm"
58
+ }),
59
+ t[4] || (t[4] = e("span", { class: "text-c-2 pr-3" }, " No URL configured. Try importing an OpenAPI document from an URL. ", -1))
60
+ ], 64))
61
+ ])
62
+ ])
63
+ ])
64
+ ]),
65
+ e("div", z, [
66
+ t[8] || (t[8] = e("h3", { class: "font-bold" }, "Danger Zone", -1)),
67
+ e("div", A, [
68
+ t[7] || (t[7] = e("div", null, [
69
+ e("h4", null, "Delete Collection"),
70
+ e("p", { class: "text-c-2 mt-1" }, " Be careful, my friend. Once deleted, there is no way to recover the collection. ")
71
+ ], -1)),
72
+ n(o(y), {
73
+ disabled: l.isDraftDocument,
74
+ size: "sm",
75
+ variant: "danger",
76
+ onClick: b
77
+ }, {
78
+ default: m(() => [...t[6] || (t[6] = [
79
+ u(" Delete Collection ", -1)
80
+ ])]),
81
+ _: 1
82
+ }, 8, ["disabled"])
83
+ ])
84
+ ])
85
+ ]),
86
+ n(o(k), {
87
+ size: "xxs",
88
+ state: o(s),
89
+ title: `Delete ${l.title}`
90
+ }, {
91
+ default: m(() => [
92
+ n(M, {
93
+ variableName: l.title ?? "",
94
+ warningMessage: "This action cannot be undone.",
95
+ onClose: t[1] || (t[1] = (c) => o(s).hide()),
96
+ onDelete: h
97
+ }, null, 8, ["variableName"])
98
+ ]),
99
+ _: 1
100
+ }, 8, ["state", "title"])
101
+ ], 64));
102
+ }
103
+ });
5
104
  export {
6
- c as default
105
+ O as default
7
106
  };
@@ -1,106 +1,4 @@
1
- import { defineComponent as w, createElementBlock as a, openBlock as d, Fragment as i, createElementVNode as e, createVNode as n, unref as o, createTextVNode as u, toDisplayString as x, withCtx as m } from "vue";
2
- import { useModal as v, ScalarToggle as D, ScalarIcon as f, ScalarButton as y, ScalarModal as k } from "@scalar/components";
3
- import M from "../../../components/Sidebar/Actions/DeleteSidebarListElement.vue.js";
4
- const U = { class: "flex flex-col gap-12" }, C = { class: "flex flex-col gap-2" }, N = { class: "bg-b-2 rounded-lg border text-sm" }, S = { class: "bg-b-1 flex items-center justify-between gap-4 rounded-t-lg p-3" }, B = { class: "text-c-1 flex items-center overflow-x-auto border-t py-1.5 whitespace-nowrap" }, V = { class: "flex items-center" }, T = ["href"], A = { class: "flex flex-col gap-4" }, E = { class: "flex items-center justify-between rounded-lg border p-3 text-sm" }, _ = /* @__PURE__ */ w({
5
- __name: "DocumentSettings",
6
- props: {
7
- documentUrl: {},
8
- watchMode: { type: Boolean },
9
- title: {},
10
- isDraftDocument: { type: Boolean, default: !1 }
11
- },
12
- emits: ["delete:document", "update:watchMode"],
13
- setup(p, { emit: g }) {
14
- const r = g, s = v(), b = () => {
15
- p.isDraftDocument || s.show();
16
- }, h = () => {
17
- r("delete:document"), s.hide();
18
- };
19
- return (l, t) => (d(), a(i, null, [
20
- e("div", U, [
21
- e("div", C, [
22
- t[5] || (t[5] = e("div", { class: "flex h-8 items-center" }, [
23
- e("h3", { class: "font-bold" }, "Features")
24
- ], -1)),
25
- e("div", N, [
26
- e("div", S, [
27
- t[2] || (t[2] = e("div", null, [
28
- e("h4", null, "Watch Mode"),
29
- e("p", { class: "text-c-2 mt-1" }, " When enabled, the OpenAPI document will be polled for changes. The collection will be updated automatically. ")
30
- ], -1)),
31
- n(o(D), {
32
- class: "w-4",
33
- disabled: !l.documentUrl,
34
- modelValue: l.watchMode ?? !1,
35
- "onUpdate:modelValue": t[0] || (t[0] = (c) => r("update:watchMode", c))
36
- }, null, 8, ["disabled", "modelValue"])
37
- ]),
38
- e("div", B, [
39
- e("div", V, [
40
- l.documentUrl ? (d(), a(i, { key: 0 }, [
41
- t[3] || (t[3] = e("span", { class: "bg-b-2 sticky left-0 pr-2 pl-3" }, "Source", -1)),
42
- e("a", {
43
- class: "text-c-2 group rounded pr-3 no-underline hover:underline",
44
- href: l.documentUrl,
45
- target: "_blank"
46
- }, [
47
- u(x(l.documentUrl) + " ", 1),
48
- n(o(f), {
49
- class: "ml-1 hidden w-2.5 group-hover:inline",
50
- icon: "ExternalLink"
51
- })
52
- ], 8, T)
53
- ], 64)) : (d(), a(i, { key: 1 }, [
54
- n(o(f), {
55
- class: "text-c-2 mr-2 ml-3 w-4",
56
- icon: "NotAllowed",
57
- size: "sm"
58
- }),
59
- t[4] || (t[4] = e("span", { class: "text-c-2 pr-3" }, " No URL configured. Try importing an OpenAPI document from an URL. ", -1))
60
- ], 64))
61
- ])
62
- ])
63
- ])
64
- ]),
65
- e("div", A, [
66
- t[8] || (t[8] = e("h3", { class: "font-bold" }, "Danger Zone", -1)),
67
- e("div", E, [
68
- t[7] || (t[7] = e("div", null, [
69
- e("h4", null, "Delete Collection"),
70
- e("p", { class: "text-c-2 mt-1" }, " Be careful, my friend. Once deleted, there is no way to recover the collection. ")
71
- ], -1)),
72
- n(o(y), {
73
- class: "custom-scroll h-8 gap-1.5 px-2.5 font-medium whitespace-nowrap shadow-none focus:outline-none",
74
- disabled: l.isDraftDocument,
75
- variant: "danger",
76
- onClick: b
77
- }, {
78
- default: m(() => [...t[6] || (t[6] = [
79
- u(" Delete Collection ", -1)
80
- ])]),
81
- _: 1
82
- }, 8, ["disabled"])
83
- ])
84
- ])
85
- ]),
86
- n(o(k), {
87
- size: "xxs",
88
- state: o(s),
89
- title: `Delete ${l.title}`
90
- }, {
91
- default: m(() => [
92
- n(M, {
93
- variableName: l.title ?? "",
94
- warningMessage: "This action cannot be undone.",
95
- onClose: t[1] || (t[1] = (c) => o(s).hide()),
96
- onDelete: h
97
- }, null, 8, ["variableName"])
98
- ]),
99
- _: 1
100
- }, 8, ["state", "title"])
101
- ], 64));
102
- }
103
- });
1
+ import f from "./DocumentSettings.vue.js";
104
2
  export {
105
- _ as default
3
+ f as default
106
4
  };
@@ -1 +1 @@
1
- {"version":3,"file":"CollectionSettings.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Collection/CollectionSettings.vue"],"names":[],"mappings":";AA8fA,wBAKG"}
1
+ {"version":3,"file":"CollectionSettings.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Collection/CollectionSettings.vue"],"names":[],"mappings":";AAseA,wBAKG"}
@@ -1,7 +1,4 @@
1
- import o from "./CollectionSettings.vue2.js";
2
- /* empty css */
3
- import t from "../../_virtual/_plugin-vue_export-helper.js";
4
- const f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-f353959a"]]);
1
+ import f from "./CollectionSettings.vue2.js";
5
2
  export {
6
3
  f as default
7
4
  };