@scalar/api-client 2.3.31 → 2.3.33

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 (112) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/dist/components/CodeInput/CodeInput.vue.d.ts.map +1 -1
  3. package/dist/components/CodeInput/CodeInput.vue.js +1 -1
  4. package/dist/components/CodeInput/CodeInput.vue2.js +63 -61
  5. package/dist/components/DataTable/DataTable.vue.js +1 -1
  6. package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.d.ts.map +1 -1
  7. package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.js +58 -48
  8. package/dist/components/Sidebar/SidebarListElement.vue.d.ts +2 -2
  9. package/dist/components/ViewLayout/ViewLayoutCollapse.vue.d.ts.map +1 -1
  10. package/dist/components/ViewLayout/ViewLayoutCollapse.vue.js +34 -32
  11. package/dist/components/ViewLayout/ViewLayoutSection.vue.d.ts.map +1 -1
  12. package/dist/components/ViewLayout/ViewLayoutSection.vue.js +6 -6
  13. package/dist/hooks/useClientConfig.d.ts +3 -0
  14. package/dist/hooks/useClientConfig.d.ts.map +1 -1
  15. package/dist/layouts/App/create-api-client-app.d.ts +64 -24
  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 +128 -48
  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 +64 -24
  20. package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
  21. package/dist/libs/create-client.d.ts +64 -24
  22. package/dist/libs/create-client.d.ts.map +1 -1
  23. package/dist/libs/index.js +26 -25
  24. package/dist/libs/local-storage.d.ts +8 -0
  25. package/dist/libs/local-storage.d.ts.map +1 -1
  26. package/dist/libs/local-storage.js +28 -24
  27. package/dist/libs/send-request/create-request-operation.d.ts.map +1 -1
  28. package/dist/libs/send-request/create-request-operation.js +8 -8
  29. package/dist/libs/send-request/create-request-operation.test.d.ts +2 -2
  30. package/dist/libs/send-request/create-request-operation.test.d.ts.map +1 -1
  31. package/dist/libs/send-request/decode-buffer.js +4 -4
  32. package/dist/store/active-entities.d.ts +2 -2
  33. package/dist/store/active-entities.d.ts.map +1 -1
  34. package/dist/store/request-example.d.ts +22 -22
  35. package/dist/store/request-example.d.ts.map +1 -1
  36. package/dist/store/security-schemes.d.ts +42 -2
  37. package/dist/store/security-schemes.d.ts.map +1 -1
  38. package/dist/store/store.d.ts +64 -24
  39. package/dist/store/store.d.ts.map +1 -1
  40. package/dist/style.css +1 -1
  41. package/dist/views/Collection/CollectionAuthentication.vue.d.ts.map +1 -1
  42. package/dist/views/Collection/CollectionAuthentication.vue.js +1 -1
  43. package/dist/views/Collection/CollectionAuthentication.vue2.js +32 -32
  44. package/dist/views/Collection/CollectionEnvironment.vue.d.ts.map +1 -1
  45. package/dist/views/Collection/CollectionEnvironment.vue.js +3 -2
  46. package/dist/views/Collection/CollectionEnvironment.vue2.js +233 -9
  47. package/dist/views/Collection/CollectionNavigation.vue.js +36 -36
  48. package/dist/views/Collection/CollectionServers.vue.d.ts.map +1 -1
  49. package/dist/views/Collection/CollectionServers.vue2.js +6 -6
  50. package/dist/views/Collection/components/EnvironmentForm.vue.d.ts +13 -0
  51. package/dist/views/Collection/components/EnvironmentForm.vue.d.ts.map +1 -0
  52. package/dist/views/Collection/components/EnvironmentForm.vue.js +7 -0
  53. package/dist/views/Collection/components/EnvironmentForm.vue2.js +274 -0
  54. package/dist/views/Components/CodeSnippet/CodeSnippet.vue.d.ts +2 -0
  55. package/dist/views/Components/CodeSnippet/CodeSnippet.vue.d.ts.map +1 -1
  56. package/dist/views/Components/CodeSnippet/CodeSnippet.vue.js +15 -13
  57. package/dist/views/Components/CodeSnippet/helpers/convert-to-har-request.d.ts.map +1 -1
  58. package/dist/views/Components/CodeSnippet/helpers/convert-to-har-request.js +35 -34
  59. package/dist/views/Components/CodeSnippet/helpers/get-har-request.d.ts +3 -1
  60. package/dist/views/Components/CodeSnippet/helpers/get-har-request.d.ts.map +1 -1
  61. package/dist/views/Components/CodeSnippet/helpers/get-har-request.js +74 -31
  62. package/dist/views/Components/CodeSnippet/helpers/get-snippet.d.ts +3 -1
  63. package/dist/views/Components/CodeSnippet/helpers/get-snippet.d.ts.map +1 -1
  64. package/dist/views/Components/CodeSnippet/helpers/get-snippet.js +8 -6
  65. package/dist/views/Environment/EnvironmentModal.vue.d.ts.map +1 -1
  66. package/dist/views/Environment/EnvironmentModal.vue.js +32 -28
  67. package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.d.ts +1 -0
  68. package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.d.ts.map +1 -1
  69. package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.js +67 -65
  70. package/dist/views/Request/RequestSection/RequestAuth/OAuthScopesInput.vue.d.ts.map +1 -1
  71. package/dist/views/Request/RequestSection/RequestAuth/OAuthScopesInput.vue.js +94 -97
  72. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.d.ts +1 -0
  73. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.d.ts.map +1 -1
  74. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.js +2 -2
  75. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue2.js +116 -99
  76. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.d.ts +1 -0
  77. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.d.ts.map +1 -1
  78. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.js +1 -1
  79. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue2.js +27 -25
  80. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthTab.vue.d.ts +1 -0
  81. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthTab.vue.d.ts.map +1 -1
  82. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthTab.vue.js +2 -2
  83. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthTab.vue2.js +114 -73
  84. package/dist/views/Request/RequestSection/RequestCodeExample.vue.d.ts +2 -0
  85. package/dist/views/Request/RequestSection/RequestCodeExample.vue.d.ts.map +1 -1
  86. package/dist/views/Request/RequestSection/RequestCodeExample.vue.js +2 -2
  87. package/dist/views/Request/RequestSection/RequestCodeExample.vue2.js +54 -59
  88. package/dist/views/Request/RequestSection/RequestSection.vue.d.ts.map +1 -1
  89. package/dist/views/Request/RequestSection/RequestSection.vue.js +3 -3
  90. package/dist/views/Request/RequestSection/RequestSection.vue2.js +27 -26
  91. package/dist/views/Request/RequestSection/helpers/update-scheme.d.ts +8 -0
  92. package/dist/views/Request/RequestSection/helpers/update-scheme.d.ts.map +1 -0
  93. package/dist/views/Request/RequestSection/helpers/update-scheme.js +17 -0
  94. package/dist/views/Request/RequestSection/helpers/update-scheme.test.d.ts +2 -0
  95. package/dist/views/Request/RequestSection/helpers/update-scheme.test.d.ts.map +1 -0
  96. package/dist/views/Request/RequestSidebar.vue.d.ts.map +1 -1
  97. package/dist/views/Request/RequestSidebar.vue.js +1 -1
  98. package/dist/views/Request/RequestSidebar.vue2.js +87 -84
  99. package/dist/views/Request/ResponseSection/ResponseBody.vue.js +2 -2
  100. package/dist/views/Request/ResponseSection/ResponseBody.vue2.js +21 -21
  101. package/dist/views/Request/ResponseSection/ResponseBodyDownload.vue.d.ts.map +1 -1
  102. package/dist/views/Request/ResponseSection/ResponseBodyDownload.vue.js +11 -11
  103. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  104. package/dist/views/Request/consts/index.js +7 -5
  105. package/dist/views/Request/consts/mediaTypes.d.ts +4 -0
  106. package/dist/views/Request/consts/mediaTypes.d.ts.map +1 -1
  107. package/dist/views/Request/consts/mediaTypes.js +22 -4
  108. package/dist/views/Request/consts/mediaTypes.test.d.ts +2 -0
  109. package/dist/views/Request/consts/mediaTypes.test.d.ts.map +1 -0
  110. package/dist/views/Request/libs/oauth2.d.ts.map +1 -1
  111. package/dist/views/Request/libs/oauth2.js +53 -47
  112. package/package.json +16 -16
@@ -1,12 +1,12 @@
1
- import { defineComponent as b, ref as m, computed as y, watch as k, createElementBlock as s, openBlock as o, withModifiers as w, createCommentVNode as d, createBlock as x, createVNode as v, Fragment as S, renderList as g, normalizeClass as p, createElementVNode as h, toDisplayString as C, unref as a, withCtx as V } from "vue";
2
- import { useModal as _ } from "@scalar/components";
1
+ import { defineComponent as b, ref as d, computed as y, watch as k, createElementBlock as o, openBlock as s, withModifiers as w, createCommentVNode as m, createBlock as x, createVNode as p, Fragment as S, renderList as g, normalizeClass as h, createElementVNode as v, toDisplayString as A, unref as a, withCtx as C } from "vue";
2
+ import { useModal as V } from "@scalar/components";
3
3
  import O from "./DeleteRequestAuthModal.vue.js";
4
- import z from "./RequestAuthTab.vue.js";
5
- import M from "../../../../components/DataTable/DataTable.vue.js";
6
- const N = {
4
+ import _ from "./RequestAuthTab.vue.js";
5
+ import z from "../../../../components/DataTable/DataTable.vue.js";
6
+ const B = {
7
7
  key: 0,
8
- class: "box-content flex h-8 flex-wrap gap-x-2.5 overflow-hidden border-t px-3"
9
- }, $ = ["onClick"], A = { class: "relative z-10 whitespace-nowrap font-medium" }, B = {
8
+ class: "box-content flex h-8 flex-wrap gap-x-2.5 overflow-hidden border border-b-0 px-3"
9
+ }, M = ["onClick"], N = { class: "relative z-10 whitespace-nowrap font-medium" }, $ = {
10
10
  key: 0,
11
11
  class: "z-1 absolute inset-x-1 bottom-[var(--scalar-border-width)] left-1/2 h-px w-full -translate-x-1/2 bg-current"
12
12
  }, q = {
@@ -19,14 +19,15 @@ const N = {
19
19
  environment: {},
20
20
  envVariables: {},
21
21
  layout: { default: "client" },
22
+ persistAuth: { type: Boolean, default: !1 },
22
23
  selectedSchemeOptions: { default: () => [] },
23
24
  server: {},
24
25
  workspace: {}
25
26
  },
26
27
  setup(i) {
27
- const c = _(), f = m(
28
+ const c = V(), f = d(
28
29
  null
29
- ), t = m(0), u = y(() => {
30
+ ), t = d(0), u = y(() => {
30
31
  const e = i.selectedSchemeOptions[t.value];
31
32
  if (!e)
32
33
  return [];
@@ -38,45 +39,46 @@ const N = {
38
39
  (e) => {
39
40
  e[t.value] || (t.value = Math.max(0, t.value - 1));
40
41
  }
41
- ), (e, r) => (o(), s("form", {
42
+ ), (e, r) => (s(), o("form", {
42
43
  onSubmit: r[1] || (r[1] = w(() => {
43
44
  }, ["prevent"]))
44
45
  }, [
45
- e.selectedSchemeOptions.length > 1 ? (o(), s("div", N, [
46
- (o(!0), s(S, null, g(e.selectedSchemeOptions, (l, n) => (o(), s("div", {
46
+ e.selectedSchemeOptions.length > 1 ? (s(), o("div", B, [
47
+ (s(!0), o(S, null, g(e.selectedSchemeOptions, (l, n) => (s(), o("div", {
47
48
  key: l.id,
48
- class: p(["z-1 relative -mb-[var(--scalar-border-width)] flex h-8 cursor-pointer", [t.value === n ? "text-c-1" : "text-c-3"]])
49
+ class: h(["z-1 relative -mb-[var(--scalar-border-width)] flex h-8 cursor-pointer", [t.value === n ? "text-c-1" : "text-c-3"]])
49
50
  }, [
50
- h("button", {
51
+ v("button", {
51
52
  class: "floating-bg relative cursor-pointer border-b-[1px] border-transparent py-1 text-sm font-medium",
52
53
  type: "button",
53
54
  onClick: (D) => t.value = n
54
55
  }, [
55
- h("span", A, C(l.label), 1)
56
- ], 8, $),
57
- t.value === n ? (o(), s("div", B)) : d("", !0)
56
+ v("span", N, A(l.label), 1)
57
+ ], 8, M),
58
+ t.value === n ? (s(), o("div", $)) : m("", !0)
58
59
  ], 2))), 128))
59
- ])) : d("", !0),
60
- u.value.length ? (o(), x(a(M), {
60
+ ])) : m("", !0),
61
+ u.value.length ? (s(), x(a(z), {
61
62
  key: 1,
62
- class: p(["flex-1", e.layout === "reference" && "border-0"]),
63
+ class: h(["flex-1", e.layout === "reference" && "rounded-b-lg border border-t-0"]),
63
64
  columns: [""],
64
65
  presentational: ""
65
66
  }, {
66
- default: V(() => [
67
- v(z, {
67
+ default: C(() => [
68
+ p(_, {
68
69
  collection: e.collection,
69
70
  envVariables: e.envVariables,
70
71
  environment: e.environment,
71
72
  layout: e.layout,
73
+ persistAuth: e.persistAuth,
72
74
  securitySchemeUids: u.value,
73
75
  server: e.server,
74
76
  workspace: e.workspace
75
- }, null, 8, ["collection", "envVariables", "environment", "layout", "securitySchemeUids", "server", "workspace"])
77
+ }, null, 8, ["collection", "envVariables", "environment", "layout", "persistAuth", "securitySchemeUids", "server", "workspace"])
76
78
  ]),
77
79
  _: 1
78
- }, 8, ["class"])) : (o(), s("div", q, " No authentication selected ")),
79
- v(O, {
80
+ }, 8, ["class"])) : (s(), o("div", q, " No authentication selected ")),
81
+ p(O, {
80
82
  scheme: f.value,
81
83
  state: a(c),
82
84
  onClose: r[0] || (r[0] = (l) => a(c).hide())
@@ -7,6 +7,7 @@ type __VLS_Props = {
7
7
  environment: Environment;
8
8
  envVariables: EnvVariable[];
9
9
  layout: 'client' | 'reference';
10
+ persistAuth: boolean;
10
11
  securitySchemeUids: string[];
11
12
  server: Server | undefined;
12
13
  workspace: Workspace;
@@ -1 +1 @@
1
- {"version":3,"file":"RequestAuthTab.vue.d.ts","sourceRoot":"","sources":["../../../../../src/views/Request/RequestSection/RequestAuth/RequestAuthTab.vue"],"names":[],"mappings":"AA0PA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AACzE,OAAO,KAAK,EACV,UAAU,EAEV,MAAM,EACP,MAAM,iCAAiC,CAAA;AACxC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AAKrE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAQ1D,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,UAAU,CAAA;IACtB,WAAW,EAAE,WAAW,CAAA;IACxB,YAAY,EAAE,WAAW,EAAE,CAAA;IAC3B,MAAM,EAAE,QAAQ,GAAG,WAAW,CAAA;IAC9B,kBAAkB,EAAE,MAAM,EAAE,CAAA;IAC5B,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,SAAS,EAAE,SAAS,CAAA;CACrB,CAAC;;AAuaF,wBAMG"}
1
+ {"version":3,"file":"RequestAuthTab.vue.d.ts","sourceRoot":"","sources":["../../../../../src/views/Request/RequestSection/RequestAuth/RequestAuthTab.vue"],"names":[],"mappings":"AA6UA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AACzE,OAAO,KAAK,EACV,UAAU,EAEV,MAAM,EACP,MAAM,iCAAiC,CAAA;AACxC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AAQrE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAY1D,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,UAAU,CAAA;IACtB,WAAW,EAAE,WAAW,CAAA;IACxB,YAAY,EAAE,WAAW,EAAE,CAAA;IAC3B,MAAM,EAAE,QAAQ,GAAG,WAAW,CAAA;IAC9B,WAAW,EAAE,OAAO,CAAA;IACpB,kBAAkB,EAAE,MAAM,EAAE,CAAA;IAC5B,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,SAAS,EAAE,SAAS,CAAA;CACrB,CAAC;;AA+fF,wBAMG"}
@@ -1,7 +1,7 @@
1
1
  import t from "./RequestAuthTab.vue2.js";
2
2
  /* empty css */
3
3
  import a from "../../../../_virtual/_plugin-vue_export-helper.js";
4
- const e = /* @__PURE__ */ a(t, [["__scopeId", "data-v-10acaca1"]]);
4
+ const m = /* @__PURE__ */ a(t, [["__scopeId", "data-v-abdabad2"]]);
5
5
  export {
6
- e as default
6
+ m as default
7
7
  };
@@ -1,80 +1,117 @@
1
- import { defineComponent as F, computed as N, ref as P, createElementBlock as n, openBlock as a, Fragment as p, renderList as g, createBlock as $, createCommentVNode as v, unref as d, normalizeClass as C, withCtx as l, createVNode as u, createTextVNode as y, toDisplayString as m, mergeProps as V, createElementVNode as T, capitalize as _ } from "vue";
2
- import { useWorkspace as j } from "../../../../store/store.js";
3
- import q from "./OAuth2.vue.js";
1
+ import { defineComponent as L, computed as F, ref as P, onMounted as R, createElementBlock as i, openBlock as l, Fragment as s, renderList as C, createBlock as S, createCommentVNode as v, unref as d, normalizeClass as g, withCtx as n, createVNode as u, createTextVNode as m, toDisplayString as _, mergeProps as V, createElementVNode as A, capitalize as U } from "vue";
2
+ import { ScalarMarkdown as q } from "@scalar/components";
3
+ import { isDefined as I } from "@scalar/oas-utils/helpers";
4
+ import { CLIENT_LS_KEYS as N } from "../../../../libs/local-storage.js";
5
+ import { useWorkspace as z } from "../../../../store/store.js";
6
+ import { updateScheme as D } from "../helpers/update-scheme.js";
7
+ import H from "./OAuth2.vue.js";
4
8
  import w from "./RequestAuthDataTableInput.vue.js";
5
- import s from "../../../../components/DataTable/DataTableRow.vue.js";
6
- import S from "../../../../components/DataTable/DataTableCell.vue.js";
7
- const R = {
9
+ import f from "../../../../components/DataTable/DataTableRow.vue.js";
10
+ import j from "../../../../components/DataTable/DataTableCell.vue.js";
11
+ const Q = {
8
12
  key: 0,
9
13
  class: "flex min-h-8 border-t text-sm"
10
- }, z = { class: "flex h-8 max-w-full gap-2.5 overflow-x-auto px-3" }, L = ["onClick"], M = { class: "relative z-10" }, Q = {
11
- key: 5,
12
- class: "text-c-3 bg-b-1 flex min-h-[calc(4rem+1px)] items-center justify-center border-t px-4 text-sm"
13
- }, J = /* @__PURE__ */ F({
14
+ }, J = { class: "flex h-8 max-w-full gap-2.5 overflow-x-auto px-3" }, Y = ["onClick"], W = { class: "relative z-10" }, ne = /* @__PURE__ */ L({
14
15
  __name: "RequestAuthTab",
15
16
  props: {
16
17
  collection: {},
17
18
  environment: {},
18
19
  envVariables: {},
19
20
  layout: {},
21
+ persistAuth: { type: Boolean, default: !1 },
20
22
  securitySchemeUids: {},
21
23
  server: {},
22
24
  workspace: {}
23
25
  },
24
26
  setup(c) {
25
- const { securitySchemes: B, securitySchemeMutators: I } = j(), U = N(
27
+ const T = z(), { collectionMutators: B, securitySchemes: x, securitySchemeMutators: M } = T, $ = F(
26
28
  () => c.securitySchemeUids.map((t) => ({
27
- scheme: B[t]
29
+ scheme: x[t]
28
30
  }))
29
- ), i = P(""), K = (t) => {
30
- const r = t.description ? `: ${t.description}` : "", e = `${_(t.nameKey)}${r || `: ${t.type}`}`;
31
+ ), p = P(""), O = (t) => {
32
+ const r = t.description ? `: ${t.description}` : "", e = `${U(t.nameKey)}${r || `: ${t.type}`}`;
31
33
  if (t.type === "apiKey")
32
- return `${_(t.nameKey)}${r || `: ${t.in}`}`;
34
+ return `${U(t.nameKey)}${r || `: ${t.in}`}`;
33
35
  if (t.type === "oauth2") {
34
36
  const o = Object.values(t.flows ?? {})[0];
35
- return `${_(t.nameKey)}: ${i.value ? i.value : (o == null ? void 0 : o.type) ?? ""}${r}`;
37
+ return `${U(t.nameKey)}: ${p.value ? p.value : (o == null ? void 0 : o.type) ?? ""}${r}`;
36
38
  }
37
- return t.type === "http" ? `${_(t.nameKey)}: ${t.scheme}${r}` : `${e}${r}`;
38
- }, k = (t, r, e) => I.edit(t, r, e), b = {
39
+ return t.type === "http" ? `${U(t.nameKey)}: ${t.scheme}${r}` : `${e}${r}`;
40
+ }, k = (t, r, e) => {
41
+ D(t, r, e, T, c.persistAuth);
42
+ };
43
+ R(() => {
44
+ if (!c.persistAuth)
45
+ return;
46
+ const t = JSON.parse(
47
+ localStorage.getItem(N.AUTH) ?? "{}"
48
+ ), r = Object.keys(x).reduce(
49
+ (e, o) => {
50
+ const a = x[o];
51
+ return a && (e[a.nameKey] = a.uid), e;
52
+ },
53
+ {}
54
+ );
55
+ Object.entries(t).forEach(([e, o]) => {
56
+ const a = r[e];
57
+ a && Object.entries(o).forEach(([E, K]) => {
58
+ M.edit(a, E, K);
59
+ });
60
+ });
61
+ try {
62
+ const o = JSON.parse(
63
+ localStorage.getItem(N.SELECTED_SECURITY_SCHEMES) ?? ""
64
+ ).map((a) => Array.isArray(a) ? a.map((y) => r[y]).filter(I) : r[a]).filter(I);
65
+ B.edit(c.collection.uid, "selectedSecuritySchemeUids", o);
66
+ } catch {
67
+ }
68
+ });
69
+ const b = {
39
70
  environment: c.environment,
40
71
  envVariables: c.envVariables,
41
72
  workspace: c.workspace
42
73
  };
43
- return (t, r) => (a(!0), n(p, null, g(U.value, ({ scheme: e }) => (a(), n(p, {
74
+ return (t, r) => (l(!0), i(s, null, C($.value, ({ scheme: e }) => (l(), i(s, {
44
75
  key: e == null ? void 0 : e.uid
45
76
  }, [
46
- U.value.length > 1 ? (a(), $(d(s), {
77
+ $.value.length > 1 ? (l(), S(d(f), {
47
78
  key: 0,
48
- class: C({
79
+ class: g({
49
80
  "request-example-references-header": t.layout === "reference"
50
81
  })
51
82
  }, {
52
- default: l(() => [
53
- u(d(S), {
54
- class: C(["text-c-2 flex items-center pl-3", t.layout === "reference" && "border-b"])
83
+ default: n(() => [
84
+ u(d(j), {
85
+ class: g(["text-c-2 flex items-center pl-3", t.layout === "reference" && "border-b"])
55
86
  }, {
56
- default: l(() => [
57
- y(m(K(e)), 1)
87
+ default: n(() => [
88
+ m(_(O(e)), 1)
58
89
  ]),
59
90
  _: 2
60
91
  }, 1032, ["class"])
61
92
  ]),
62
93
  _: 2
63
94
  }, 1032, ["class"])) : v("", !0),
64
- e != null && e.description && U.value.length <= 1 ? (a(), $(d(s), { key: 1 }, {
65
- default: l(() => [
66
- u(d(S), { class: "text-c-2 flex items-center overflow-auto whitespace-nowrap pl-3" }, {
67
- default: l(() => [
68
- y(m(e.description), 1)
95
+ e != null && e.description && $.value.length <= 1 ? (l(), S(d(f), { key: 1 }, {
96
+ default: n(() => [
97
+ u(d(j), {
98
+ "aria-label": e.description,
99
+ class: "text-c-2 auth-description-container group/auth -mb-0.25 flex items-center whitespace-nowrap outline-none hover:whitespace-normal"
100
+ }, {
101
+ default: n(() => [
102
+ u(d(q), {
103
+ class: "auth-description z-1 bg-b-1 text-c-2 outline-b-3 top-0 line-clamp-1 h-full w-full px-3 py-1.5 group-hover/auth:line-clamp-none",
104
+ value: e.description
105
+ }, null, 8, ["value"])
69
106
  ]),
70
107
  _: 2
71
- }, 1024)
108
+ }, 1032, ["aria-label"])
72
109
  ]),
73
110
  _: 2
74
111
  }, 1024)) : v("", !0),
75
- (e == null ? void 0 : e.type) === "http" ? (a(), n(p, { key: 2 }, [
76
- e.scheme === "bearer" ? (a(), $(d(s), { key: 0 }, {
77
- default: l(() => [
112
+ (e == null ? void 0 : e.type) === "http" ? (l(), i(s, { key: 2 }, [
113
+ e.scheme === "bearer" ? (l(), S(d(f), { key: 0 }, {
114
+ default: n(() => [
78
115
  u(w, V({ ref_for: !0 }, b, {
79
116
  containerClass: t.layout === "reference" && "border-t",
80
117
  modelValue: e.token,
@@ -82,16 +119,16 @@ const R = {
82
119
  type: "password",
83
120
  "onUpdate:modelValue": (o) => k(e.uid, "token", o)
84
121
  }), {
85
- default: l(() => r[0] || (r[0] = [
86
- y(" Bearer Token ")
122
+ default: n(() => r[0] || (r[0] = [
123
+ m(" Bearer Token ")
87
124
  ])),
88
125
  _: 2
89
126
  }, 1040, ["containerClass", "modelValue", "onUpdate:modelValue"])
90
127
  ]),
91
128
  _: 2
92
- }, 1024)) : (e == null ? void 0 : e.scheme) === "basic" ? (a(), n(p, { key: 1 }, [
93
- u(d(s), null, {
94
- default: l(() => [
129
+ }, 1024)) : (e == null ? void 0 : e.scheme) === "basic" ? (l(), i(s, { key: 1 }, [
130
+ u(d(f), null, {
131
+ default: n(() => [
95
132
  u(w, V({ ref_for: !0 }, b, {
96
133
  class: "text-c-2",
97
134
  containerClass: t.layout === "reference" && "auth-blend-required border-t",
@@ -100,24 +137,24 @@ const R = {
100
137
  required: "",
101
138
  "onUpdate:modelValue": (o) => k(e.uid, "username", o)
102
139
  }), {
103
- default: l(() => r[1] || (r[1] = [
104
- y(" Username ")
140
+ default: n(() => r[1] || (r[1] = [
141
+ m(" Username ")
105
142
  ])),
106
143
  _: 2
107
144
  }, 1040, ["containerClass", "modelValue", "onUpdate:modelValue"])
108
145
  ]),
109
146
  _: 2
110
147
  }, 1024),
111
- u(d(s), null, {
112
- default: l(() => [
148
+ u(d(f), null, {
149
+ default: n(() => [
113
150
  u(w, V({ ref_for: !0 }, b, {
114
151
  modelValue: e.password,
115
152
  placeholder: "********",
116
153
  type: "password",
117
154
  "onUpdate:modelValue": (o) => k(e.uid, "password", o)
118
155
  }), {
119
- default: l(() => r[2] || (r[2] = [
120
- y(" Password ")
156
+ default: n(() => r[2] || (r[2] = [
157
+ m(" Password ")
121
158
  ])),
122
159
  _: 2
123
160
  }, 1040, ["modelValue", "onUpdate:modelValue"])
@@ -125,76 +162,80 @@ const R = {
125
162
  _: 2
126
163
  }, 1024)
127
164
  ], 64)) : v("", !0)
128
- ], 64)) : (e == null ? void 0 : e.type) === "apiKey" ? (a(), n(p, { key: 3 }, [
129
- u(d(s), null, {
130
- default: l(() => [
165
+ ], 64)) : (e == null ? void 0 : e.type) === "apiKey" ? (l(), i(s, { key: 3 }, [
166
+ u(d(f), null, {
167
+ default: n(() => [
131
168
  u(w, V({ ref_for: !0 }, b, {
132
169
  containerClass: t.layout === "reference" && "border-t",
133
170
  modelValue: e.name,
134
171
  placeholder: "api-key",
135
172
  "onUpdate:modelValue": (o) => k(e.uid, "name", o)
136
173
  }), {
137
- default: l(() => r[3] || (r[3] = [
138
- y(" Name ")
174
+ default: n(() => r[3] || (r[3] = [
175
+ m(" Name ")
139
176
  ])),
140
177
  _: 2
141
178
  }, 1040, ["containerClass", "modelValue", "onUpdate:modelValue"])
142
179
  ]),
143
180
  _: 2
144
181
  }, 1024),
145
- u(d(s), null, {
146
- default: l(() => [
182
+ u(d(f), null, {
183
+ default: n(() => [
147
184
  u(w, V({ ref_for: !0 }, b, {
148
185
  modelValue: e.value,
149
186
  placeholder: "QUxMIFlPVVIgQkFTRSBBUkUgQkVMT05HIFRPIFVT",
150
187
  type: "password",
151
188
  "onUpdate:modelValue": (o) => k(e.uid, "value", o)
152
189
  }), {
153
- default: l(() => r[4] || (r[4] = [
154
- y(" Value ")
190
+ default: n(() => r[4] || (r[4] = [
191
+ m(" Value ")
155
192
  ])),
156
193
  _: 2
157
194
  }, 1040, ["modelValue", "onUpdate:modelValue"])
158
195
  ]),
159
196
  _: 2
160
197
  }, 1024)
161
- ], 64)) : (e == null ? void 0 : e.type) === "oauth2" ? (a(), n(p, { key: 4 }, [
162
- u(d(s), null, {
163
- default: l(() => [
164
- Object.keys(e.flows).length > 1 ? (a(), n("div", R, [
165
- T("div", z, [
166
- (a(!0), n(p, null, g(e == null ? void 0 : e.flows, (o, f, x) => (a(), n("button", {
167
- key: f,
168
- class: C(["floating-bg text-c-3 relative cursor-pointer border-b-[1px] border-transparent py-1 text-sm font-medium", {
169
- "!text-c-1 !rounded-none border-b-[1px] !border-current": t.layout !== "reference" && (i.value === f || x === 0 && !i.value),
170
- "!text-c-1 !rounded-none border-b-[1px] !border-current opacity-100": t.layout === "reference" && (i.value === f || x === 0 && !i.value)
198
+ ], 64)) : (e == null ? void 0 : e.type) === "oauth2" ? (l(), i(s, { key: 4 }, [
199
+ u(d(f), null, {
200
+ default: n(() => [
201
+ Object.keys(e.flows).length > 1 ? (l(), i("div", Q, [
202
+ A("div", J, [
203
+ (l(!0), i(s, null, C(e == null ? void 0 : e.flows, (o, a, y) => (l(), i("button", {
204
+ key: a,
205
+ class: g(["floating-bg text-c-3 relative cursor-pointer border-b-[1px] border-transparent py-1 text-sm font-medium", {
206
+ "!text-c-1 !rounded-none border-b-[1px] !border-current": t.layout !== "reference" && (p.value === a || y === 0 && !p.value),
207
+ "!text-c-1 !rounded-none border-b-[1px] !border-current opacity-100": t.layout === "reference" && (p.value === a || y === 0 && !p.value)
171
208
  }]),
172
209
  type: "button",
173
- onClick: (D) => i.value = f
210
+ onClick: (E) => p.value = a
174
211
  }, [
175
- T("span", M, m(f), 1)
176
- ], 10, L))), 128))
212
+ A("span", W, _(a), 1)
213
+ ], 10, Y))), 128))
177
214
  ])
178
215
  ])) : v("", !0)
179
216
  ]),
180
217
  _: 2
181
218
  }, 1024),
182
- (a(!0), n(p, null, g(e == null ? void 0 : e.flows, (o, f, x) => (a(), n(p, { key: f }, [
183
- i.value === f || x === 0 && !i.value ? (a(), $(q, V({
219
+ (l(!0), i(s, null, C(e == null ? void 0 : e.flows, (o, a, y) => (l(), i(s, { key: a }, [
220
+ p.value === a || y === 0 && !p.value ? (l(), S(H, V({
184
221
  key: 0,
185
222
  ref_for: !0
186
223
  }, b, {
187
224
  collection: t.collection,
188
225
  flow: o,
226
+ persistAuth: t.persistAuth,
189
227
  scheme: e,
190
228
  server: t.server,
191
229
  workspace: t.workspace
192
- }), null, 16, ["collection", "flow", "scheme", "server", "workspace"])) : v("", !0)
230
+ }), null, 16, ["collection", "flow", "persistAuth", "scheme", "server", "workspace"])) : v("", !0)
193
231
  ], 64))), 128))
194
- ], 64)) : (e == null ? void 0 : e.type) === "openIdConnect" ? (a(), n("div", Q, " Coming soon ")) : v("", !0)
232
+ ], 64)) : (e == null ? void 0 : e.type) === "openIdConnect" ? (l(), i("div", {
233
+ key: 5,
234
+ class: g(["text-c-3 bg-b-1 flex min-h-[calc(4rem+1px)] items-center justify-center border-b-0 border-t px-4 text-sm", { "rounded-b-lg": t.layout === "reference" }])
235
+ }, " Coming soon ", 2)) : v("", !0)
195
236
  ], 64))), 128));
196
237
  }
197
238
  });
198
239
  export {
199
- J as default
240
+ ne as default
200
241
  };
@@ -1,11 +1,13 @@
1
1
  import type { Collection, Operation, RequestExample, Server } from '@scalar/oas-utils/entities/spec';
2
2
  import type { Workspace } from '@scalar/oas-utils/entities/workspace';
3
+ import type { EnvVariables } from '../../../libs/env-helpers';
3
4
  type __VLS_Props = {
4
5
  collection: Collection;
5
6
  example: RequestExample;
6
7
  operation: Operation;
7
8
  server: Server | undefined;
8
9
  workspace: Workspace;
10
+ environment: EnvVariables;
9
11
  };
10
12
  declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, HTMLDivElement>;
11
13
  export default _default;
@@ -1 +1 @@
1
- {"version":3,"file":"RequestCodeExample.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestCodeExample.vue"],"names":[],"mappings":"AA0RA,OAAO,KAAK,EACV,UAAU,EACV,SAAS,EACT,cAAc,EACd,MAAM,EACP,MAAM,iCAAiC,CAAA;AACxC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AAcrE,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,UAAU,CAAA;IACtB,OAAO,EAAE,cAAc,CAAA;IACvB,SAAS,EAAE,SAAS,CAAA;IACpB,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,SAAS,EAAE,SAAS,CAAA;CACrB,CAAC;;AA2WF,wBAOG"}
1
+ {"version":3,"file":"RequestCodeExample.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestCodeExample.vue"],"names":[],"mappings":"AA8RA,OAAO,KAAK,EACV,UAAU,EACV,SAAS,EACT,cAAc,EAEd,MAAM,EACP,MAAM,iCAAiC,CAAA;AACxC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AAOrE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAMtD,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,UAAU,CAAA;IACtB,OAAO,EAAE,cAAc,CAAA;IACvB,SAAS,EAAE,SAAS,CAAA;IACpB,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,SAAS,EAAE,SAAS,CAAA;IACpB,WAAW,EAAE,YAAY,CAAA;CAC1B,CAAC;;AA6WF,wBAOG"}
@@ -1,7 +1,7 @@
1
1
  import o from "./RequestCodeExample.vue2.js";
2
2
  /* empty css */
3
- import e from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const r = /* @__PURE__ */ e(o, [["__scopeId", "data-v-ec5dd19c"]]);
3
+ import t from "../../../_virtual/_plugin-vue_export-helper.js";
4
+ const r = /* @__PURE__ */ t(o, [["__scopeId", "data-v-01b51127"]]);
5
5
  export {
6
6
  r as default
7
7
  };