@scalar/api-client 2.5.13 → 2.5.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (127) hide show
  1. package/CHANGELOG.md +77 -0
  2. package/README.md +1 -1
  3. package/dist/components/AddressBar/AddressBar.vue.js +1 -1
  4. package/dist/components/AddressBar/AddressBarHistory.vue.js +1 -1
  5. package/dist/components/AddressBar/AddressBarHistory.vue2.js +1 -1
  6. package/dist/components/CodeInput/CodeInput.vue.js +2 -2
  7. package/dist/components/CodeInput/CodeInput.vue2.js +3 -3
  8. package/dist/components/CommandPalette/CommandActionInput.vue.d.ts.map +1 -1
  9. package/dist/components/CommandPalette/CommandActionInput.vue.js +11 -10
  10. package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts +10 -10
  11. package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts.map +1 -1
  12. package/dist/components/CommandPalette/TheCommandPalette.vue.js +2 -2
  13. package/dist/components/CommandPalette/TheCommandPalette.vue2.js +129 -116
  14. package/dist/components/DataTable/DataTableCell.vue.js +8 -8
  15. package/dist/components/DataTable/DataTableInput.vue.d.ts.map +1 -1
  16. package/dist/components/DataTable/DataTableInput.vue.js +2 -2
  17. package/dist/components/Form/Form.vue.js +1 -1
  18. package/dist/components/HttpMethod/HttpMethod.vue.d.ts +2 -2
  19. package/dist/components/ImportCollection/ImportCollectionModal.vue.js +7 -7
  20. package/dist/components/ImportCollection/PrefetchError.vue.js +1 -1
  21. package/dist/components/ImportCollection/WorkspaceSelector.vue.js +1 -1
  22. package/dist/components/ImportCollection/utils/get-openapi-version.d.ts +5 -0
  23. package/dist/components/ImportCollection/utils/get-openapi-version.d.ts.map +1 -0
  24. package/dist/components/ImportCollection/utils/get-openapi-version.js +20 -0
  25. package/dist/components/ImportCollection/utils/get-openapi-version.test.d.ts +2 -0
  26. package/dist/components/ImportCollection/utils/get-openapi-version.test.d.ts.map +1 -0
  27. package/dist/components/ImportCollection/utils/import-collection.js +1 -1
  28. package/dist/components/ImportCollection/utils/{isDocument.d.ts → is-document.d.ts} +2 -2
  29. package/dist/components/ImportCollection/utils/is-document.d.ts.map +1 -0
  30. package/dist/components/ImportCollection/utils/is-document.js +9 -0
  31. package/dist/components/ImportCollection/utils/is-document.test.d.ts +2 -0
  32. package/dist/components/ImportCollection/utils/is-document.test.d.ts.map +1 -0
  33. package/dist/components/ImportCollection/utils/is-url.d.ts +5 -0
  34. package/dist/components/ImportCollection/utils/is-url.d.ts.map +1 -0
  35. package/dist/components/ImportCollection/utils/is-url.js +9 -0
  36. package/dist/components/ImportCollection/utils/is-url.test.d.ts +2 -0
  37. package/dist/components/ImportCollection/utils/is-url.test.d.ts.map +1 -0
  38. package/dist/components/OpenApiClientButton.vue.js +2 -2
  39. package/dist/components/Server/ServerDropdown.vue.d.ts.map +1 -1
  40. package/dist/components/Server/ServerDropdown.vue.js +8 -8
  41. package/dist/components/Server/ServerSelector.vue.d.ts.map +1 -1
  42. package/dist/components/Server/ServerSelector.vue.js +13 -13
  43. package/dist/components/Server/ServerVariablesSelect.vue.d.ts.map +1 -1
  44. package/dist/components/Server/ServerVariablesSelect.vue.js +3 -3
  45. package/dist/components/TopNav/TopNav.vue.js +10 -10
  46. package/dist/components/TopNav/TopNavItem.vue.js +1 -1
  47. package/dist/components/TopNav/TopNavItem.vue2.js +1 -1
  48. package/dist/components/ViewLayout/ViewLayoutCollapse.vue.d.ts +5 -1
  49. package/dist/components/ViewLayout/ViewLayoutCollapse.vue.d.ts.map +1 -1
  50. package/dist/components/ViewLayout/ViewLayoutCollapse.vue.js +42 -36
  51. package/dist/components/ViewLayout/ViewLayoutSection.vue.js +4 -4
  52. package/dist/hooks/useClientConfig.d.ts +42 -36
  53. package/dist/hooks/useClientConfig.d.ts.map +1 -1
  54. package/dist/layouts/App/create-api-client-app.d.ts +202 -162
  55. package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
  56. package/dist/layouts/Modal/create-api-client-modal.d.ts +404 -324
  57. package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
  58. package/dist/layouts/Web/create-api-client-web.d.ts +202 -162
  59. package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
  60. package/dist/libs/create-client.d.ts +202 -162
  61. package/dist/libs/create-client.d.ts.map +1 -1
  62. package/dist/libs/find-request.d.ts +5 -5
  63. package/dist/libs/find-request.d.ts.map +1 -1
  64. package/dist/libs/get-request-uid-by-path-method.d.ts.map +1 -1
  65. package/dist/libs/get-request-uid-by-path-method.js +15 -7
  66. package/dist/libs/send-request/create-request-operation.js +10 -10
  67. package/dist/libs/send-request/create-request-operation.test.d.ts +33 -33
  68. package/dist/libs/send-request/create-request-operation.test.d.ts.map +1 -1
  69. package/dist/libs/send-request/set-request-cookies.d.ts +1 -1
  70. package/dist/libs/send-request/set-request-cookies.d.ts.map +1 -1
  71. package/dist/plugins/plugin-manager.d.ts +5 -3
  72. package/dist/plugins/plugin-manager.d.ts.map +1 -1
  73. package/dist/plugins/plugin-manager.js +17 -9
  74. package/dist/plugins/plugin-manager.test.d.ts +2 -0
  75. package/dist/plugins/plugin-manager.test.d.ts.map +1 -0
  76. package/dist/store/active-entities.d.ts +33 -33
  77. package/dist/store/active-entities.d.ts.map +1 -1
  78. package/dist/store/request-example.d.ts +130 -130
  79. package/dist/store/request-example.d.ts.map +1 -1
  80. package/dist/store/requests.d.ts +55 -55
  81. package/dist/store/requests.d.ts.map +1 -1
  82. package/dist/store/security-schemes.d.ts +42 -2
  83. package/dist/store/security-schemes.d.ts.map +1 -1
  84. package/dist/store/store.d.ts +204 -164
  85. package/dist/store/store.d.ts.map +1 -1
  86. package/dist/style.css +1 -1
  87. package/dist/views/Collection/CollectionInfoForm.vue.js +2 -2
  88. package/dist/views/Collection/components/EnvironmentForm.vue.js +2 -2
  89. package/dist/views/Collection/components/MarkdownInput.vue.d.ts.map +1 -1
  90. package/dist/views/Collection/components/MarkdownInput.vue.js +1 -1
  91. package/dist/views/Collection/components/MarkdownInput.vue2.js +32 -26
  92. package/dist/views/Cookies/CookieForm.vue.js +1 -1
  93. package/dist/views/Cookies/Cookies.vue.d.ts.map +1 -1
  94. package/dist/views/Cookies/Cookies.vue2.js +67 -61
  95. package/dist/views/Environment/Environment.vue.d.ts.map +1 -1
  96. package/dist/views/Environment/Environment.vue2.js +98 -92
  97. package/dist/views/Request/RequestSection/RequestAuth/DeleteRequestAuthModal.vue.js +1 -1
  98. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.d.ts.map +1 -1
  99. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.js +2 -2
  100. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue2.js +126 -122
  101. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthTab.vue.js +1 -1
  102. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthTab.vue2.js +22 -22
  103. package/dist/views/Request/RequestSection/RequestBody.vue.js +1 -1
  104. package/dist/views/Request/RequestSection/RequestCodeExample.vue.js +2 -2
  105. package/dist/views/Request/RequestSection/RequestTable.vue.js +1 -1
  106. package/dist/views/Request/RequestSidebarItem.vue.d.ts.map +1 -1
  107. package/dist/views/Request/RequestSidebarItem.vue.js +2 -2
  108. package/dist/views/Request/RequestSidebarItem.vue2.js +9 -9
  109. package/dist/views/Request/ResponseSection/RequestHeaders.vue.js +9 -9
  110. package/dist/views/Request/ResponseSection/ResponseBody.vue.js +2 -2
  111. package/dist/views/Request/ResponseSection/ResponseBodyRaw.vue.js +3 -3
  112. package/dist/views/Request/ResponseSection/ResponseBodyVirtual.vue.js +1 -1
  113. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  114. package/dist/views/Request/ResponseSection/ResponseHeaders.vue.js +9 -9
  115. package/dist/views/Request/components/WorkspaceDropdown.vue.js +2 -2
  116. package/dist/views/Request/libs/oauth2.d.ts.map +1 -1
  117. package/dist/views/Request/libs/oauth2.js +39 -39
  118. package/dist/views/Settings/SettingsGeneral.vue.js +2 -2
  119. package/package.json +19 -19
  120. package/dist/components/ImportCollection/utils/getOpenApiDocumentVersion.d.ts +0 -5
  121. package/dist/components/ImportCollection/utils/getOpenApiDocumentVersion.d.ts.map +0 -1
  122. package/dist/components/ImportCollection/utils/getOpenApiDocumentVersion.js +0 -20
  123. package/dist/components/ImportCollection/utils/isDocument.d.ts.map +0 -1
  124. package/dist/components/ImportCollection/utils/isDocument.js +0 -7
  125. package/dist/components/ImportCollection/utils/isUrl.d.ts +0 -3
  126. package/dist/components/ImportCollection/utils/isUrl.d.ts.map +0 -1
  127. package/dist/components/ImportCollection/utils/isUrl.js +0 -6
@@ -1,9 +1,9 @@
1
- import { defineComponent as y, createBlock as f, openBlock as r, withCtx as e, createElementBlock as l, createVNode as a, unref as d, createTextVNode as n, Fragment as i, renderList as g, toDisplayString as c } from "vue";
2
- import k from "../../../components/DataTable/DataTable.vue.js";
1
+ import { defineComponent as y, createBlock as f, openBlock as r, withCtx as e, createElementBlock as l, createVNode as a, unref as d, createTextVNode as n, Fragment as i, renderList as b, toDisplayString as c } from "vue";
2
+ import g from "../../../components/DataTable/DataTable.vue.js";
3
3
  import p from "../../../components/DataTable/DataTableRow.vue.js";
4
4
  import _ from "../../../components/DataTable/DataTableText.vue.js";
5
- import w from "../../../components/HelpfulLink.vue.js";
6
- import b from "../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
5
+ import k from "../../../components/HelpfulLink.vue.js";
6
+ import w from "../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
7
7
  import { httpHeaders as h } from "../../../data/httpHeaders.js";
8
8
  import x from "../../../components/DataTable/DataTableHeader.vue.js";
9
9
  const H = {
@@ -11,7 +11,7 @@ const H = {
11
11
  class: "max-h-[calc(100%-32px)] overflow-y-auto"
12
12
  }, C = {
13
13
  key: 1,
14
- class: "text-c-3 bg-b-1 flex min-h-12 items-center justify-center rounded border px-4 text-sm"
14
+ class: "text-c-3 bg-b-1 flex min-h-12 items-center justify-center rounded border px-4 text-base"
15
15
  }, D = /* @__PURE__ */ y({
16
16
  __name: "RequestHeaders",
17
17
  props: {
@@ -21,7 +21,7 @@ const H = {
21
21
  const m = (s) => h.find(
22
22
  (t) => t.name.toLowerCase() === s.toLowerCase()
23
23
  );
24
- return (s, t) => (r(), f(b, {
24
+ return (s, t) => (r(), f(w, {
25
25
  class: "overflow-auto",
26
26
  defaultOpen: !1,
27
27
  itemCount: s.headers.length
@@ -31,7 +31,7 @@ const H = {
31
31
  ])),
32
32
  default: e(() => [
33
33
  s.headers.length ? (r(), l("div", H, [
34
- a(k, {
34
+ a(g, {
35
35
  columns: ["minmax(auto, min-content)", "minmax(50%, 1fr)"],
36
36
  scroll: ""
37
37
  }, {
@@ -53,7 +53,7 @@ const H = {
53
53
  ]),
54
54
  _: 1
55
55
  }),
56
- (r(!0), l(i, null, g(s.headers, (o) => (r(), f(p, {
56
+ (r(!0), l(i, null, b(s.headers, (o) => (r(), f(p, {
57
57
  key: o.name,
58
58
  class: "group/row text-c-1"
59
59
  }, {
@@ -62,7 +62,7 @@ const H = {
62
62
  default: e(() => {
63
63
  var u;
64
64
  return [
65
- typeof ((u = m(o.name)) == null ? void 0 : u.url) == "string" ? (r(), f(w, {
65
+ typeof ((u = m(o.name)) == null ? void 0 : u.url) == "string" ? (r(), f(k, {
66
66
  key: 0,
67
67
  class: "decoration-c-3",
68
68
  href: m(o.name).url
@@ -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 s = /* @__PURE__ */ t(o, [["__scopeId", "data-v-2dcbd6aa"]]);
4
+ const e = /* @__PURE__ */ t(o, [["__scopeId", "data-v-17966bf4"]]);
5
5
  export {
6
- s as default
6
+ e as default
7
7
  };
@@ -1,7 +1,7 @@
1
1
  import o from "./ResponseBodyRaw.vue2.js";
2
2
  /* empty css */
3
- import t from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const s = /* @__PURE__ */ t(o, [["__scopeId", "data-v-96fbecd5"]]);
3
+ import a from "../../../_virtual/_plugin-vue_export-helper.js";
4
+ const r = /* @__PURE__ */ a(o, [["__scopeId", "data-v-fbacaa3e"]]);
5
5
  export {
6
- s as default
6
+ r as default
7
7
  };
@@ -21,7 +21,7 @@ const R = /* @__PURE__ */ c({
21
21
  t[0] || (t[0] = y("Body"))
22
22
  ]),
23
23
  default: r(() => [
24
- t[1] || (t[1] = h("div", { class: "font-code text-xxs rounded-t border border-b-0 px-2.5 py-1.5" }, " This response body is massive! Syntax highlighting wont work here. ", -1)),
24
+ t[1] || (t[1] = h("div", { class: "font-code text-xxs rounded-t border border-b-0 px-2.5 py-1.5" }, " This response body is massive! Syntax highlighting won't work here. ", -1)),
25
25
  s(e(b), {
26
26
  containerClass: "custom-scroll scalar-code-block border rounded-b flex flex-1 max-h-screen",
27
27
  contentClass: "language-plaintext whitespace-pre font-code text-base",
@@ -34,7 +34,7 @@ const W = { class: "flex-center relative flex flex-1 flex-col gap-6 p-2 capitali
34
34
  }));
35
35
  }, k = (o) => {
36
36
  o != null && o.createNew && g.name === "request" && f();
37
- }, w = "2.5.13";
37
+ }, w = "2.5.16";
38
38
  return R(() => a.hotKeys.on(k)), v(() => a.hotKeys.off(k)), (o, e) => (u(), i("div", W, [
39
39
  s("div", {
40
40
  class: y(["flex h-[calc(100%_-_50px)] flex-col items-center justify-center", {
@@ -1,9 +1,9 @@
1
- import { defineComponent as y, createBlock as f, openBlock as t, withCtx as e, createElementBlock as l, createVNode as a, unref as u, createTextVNode as n, Fragment as i, renderList as g, toDisplayString as p } from "vue";
2
- import k from "../../../components/DataTable/DataTable.vue.js";
1
+ import { defineComponent as y, createBlock as f, openBlock as t, withCtx as e, createElementBlock as l, createVNode as a, unref as u, createTextVNode as n, Fragment as i, renderList as b, toDisplayString as p } from "vue";
2
+ import g from "../../../components/DataTable/DataTable.vue.js";
3
3
  import c from "../../../components/DataTable/DataTableRow.vue.js";
4
4
  import _ from "../../../components/DataTable/DataTableText.vue.js";
5
- import w from "../../../components/HelpfulLink.vue.js";
6
- import b from "../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
5
+ import k from "../../../components/HelpfulLink.vue.js";
6
+ import w from "../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
7
7
  import { httpHeaders as h } from "../../../data/httpHeaders.js";
8
8
  import x from "../../../components/DataTable/DataTableHeader.vue.js";
9
9
  const H = {
@@ -11,7 +11,7 @@ const H = {
11
11
  class: "max-h-[calc(100%-32px)] overflow-y-auto"
12
12
  }, C = {
13
13
  key: 1,
14
- class: "text-c-3 bg-b-1 flex min-h-12 items-center justify-center rounded border px-4 text-sm"
14
+ class: "text-c-3 bg-b-1 flex min-h-12 items-center justify-center rounded border px-4 text-base"
15
15
  }, T = /* @__PURE__ */ y({
16
16
  __name: "ResponseHeaders",
17
17
  props: {
@@ -21,7 +21,7 @@ const H = {
21
21
  const m = (s) => h.find(
22
22
  (r) => r.name.toLowerCase() === s.toLowerCase()
23
23
  );
24
- return (s, r) => (t(), f(b, {
24
+ return (s, r) => (t(), f(w, {
25
25
  class: "overflow-auto",
26
26
  defaultOpen: !1,
27
27
  itemCount: s.headers.length
@@ -31,7 +31,7 @@ const H = {
31
31
  ])),
32
32
  default: e(() => [
33
33
  s.headers.length ? (t(), l("div", H, [
34
- a(k, {
34
+ a(g, {
35
35
  columns: ["minmax(auto, min-content)", "minmax(50%, 1fr)"],
36
36
  scroll: ""
37
37
  }, {
@@ -53,7 +53,7 @@ const H = {
53
53
  ]),
54
54
  _: 1
55
55
  }),
56
- (t(!0), l(i, null, g(s.headers, (o) => (t(), f(c, {
56
+ (t(!0), l(i, null, b(s.headers, (o) => (t(), f(c, {
57
57
  key: o.name,
58
58
  class: "group/row text-c-1"
59
59
  }, {
@@ -62,7 +62,7 @@ const H = {
62
62
  default: e(() => {
63
63
  var d;
64
64
  return [
65
- typeof ((d = m(o.name)) == null ? void 0 : d.url) == "string" ? (t(), f(w, {
65
+ typeof ((d = m(o.name)) == null ? void 0 : d.url) == "string" ? (t(), f(k, {
66
66
  key: 0,
67
67
  class: "decoration-c-3",
68
68
  href: m(o.name).url
@@ -5,7 +5,7 @@ import Y from "../../../components/Sidebar/Actions/DeleteSidebarListElement.vue.
5
5
  import G from "../../../components/Sidebar/Actions/EditSidebarListElement.vue.js";
6
6
  import { useActiveEntities as H } from "../../../store/active-entities.js";
7
7
  import { useWorkspace as J } from "../../../store/store.js";
8
- const K = { class: "flex w-[inherit] items-center text-sm" }, Q = { class: "m-0 flex items-center gap-1.5 font-bold" }, X = { class: "line-clamp-1 text-left" }, Z = { class: "overflow-hidden text-ellipsis" }, ee = { class: "flex h-4 w-4 items-center justify-center" }, ce = /* @__PURE__ */ L({
8
+ const K = { class: "flex w-[inherit] items-center text-base" }, Q = { class: "m-0 flex items-center gap-1.5 font-bold" }, X = { class: "line-clamp-1 text-left" }, Z = { class: "overflow-hidden text-ellipsis" }, ee = { class: "flex h-4 w-4 items-center justify-center" }, ce = /* @__PURE__ */ L({
9
9
  __name: "WorkspaceDropdown",
10
10
  setup(te) {
11
11
  const { activeWorkspace: c } = H(), { workspaces: r, workspaceMutators: _, events: T } = J(), { push: g } = P(), j = (o) => {
@@ -162,7 +162,7 @@ const K = { class: "flex w-[inherit] items-center text-sm" }, Q = { class: "m-0
162
162
  default: a(() => [
163
163
  s(Y, {
164
164
  variableName: d.value,
165
- warningMessage: "This cannot be undone. Youre about to delete the workspace and everything inside it.",
165
+ warningMessage: "This cannot be undone. You're about to delete the workspace and everything inside it.",
166
166
  onClose: t[0] || (t[0] = (n) => e(p).hide()),
167
167
  onDelete: A
168
168
  }, null, 8, ["variableName"])
@@ -1 +1 @@
1
- {"version":3,"file":"oauth2.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/libs/oauth2.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAA;AAGzE,qDAAqD;AACrD,KAAK,eAAe,GAAG,OAAO,CAAC,UAAU,EAAE;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,CAAC,CAAA;AAEhE,KAAK,SAAS,GAAG;IACf,YAAY,EAAE,MAAM,CAAA;IACpB,aAAa,EAAE,MAAM,CAAA;IACrB,mBAAmB,EAAE,MAAM,CAAA;CAC5B,CAAA;AAmBD;;GAEG;AACH,eAAO,MAAM,qBAAqB,aAAoB,MAAM,YAAY,SAAS,GAAG,OAAO,KAAG,OAAO,CAAC,MAAM,CAe3G,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,eAAe,SACpB,UAAU,gBAEF,MAAM,aAET,MAAM,KAChB,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,CA6J/B,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,gBAAgB,SACrB,eAAe,UACb,MAAM,8BAKX;IACD,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,SAAS,GAAG,IAAI,CAAA;IACvB,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAC9B,KACA,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,CAmE/B,CAAA"}
1
+ {"version":3,"file":"oauth2.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/libs/oauth2.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAA;AAGzE,qDAAqD;AACrD,KAAK,eAAe,GAAG,OAAO,CAAC,UAAU,EAAE;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,CAAC,CAAA;AAEhE,KAAK,SAAS,GAAG;IACf,YAAY,EAAE,MAAM,CAAA;IACpB,aAAa,EAAE,MAAM,CAAA;IACrB,mBAAmB,EAAE,MAAM,CAAA;CAC5B,CAAA;AAmBD;;GAEG;AACH,eAAO,MAAM,qBAAqB,aAAoB,MAAM,YAAY,SAAS,GAAG,OAAO,KAAG,OAAO,CAAC,MAAM,CAe3G,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,eAAe,SACpB,UAAU,gBAEF,MAAM,aAET,MAAM,KAChB,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,CA8J/B,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,gBAAgB,SACrB,eAAe,UACb,MAAM,8BAKX;IACD,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,SAAS,GAAG,IAAI,CAAA;IACvB,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAC9B,KACA,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,CAwE/B,CAAA"}
@@ -1,19 +1,19 @@
1
- import { shouldUseProxy as w } from "@scalar/oas-utils/helpers";
2
- const S = () => {
1
+ import { shouldUseProxy as k } from "@scalar/oas-utils/helpers";
2
+ const w = () => {
3
3
  const e = new Uint8Array(32);
4
4
  return crypto.getRandomValues(e), btoa(String.fromCharCode(...e)).replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
5
5
  }, x = async (e, l) => {
6
6
  if (l === "plain")
7
7
  return e;
8
- const a = new TextEncoder().encode(e), c = await crypto.subtle.digest("SHA-256", a);
8
+ const n = new TextEncoder().encode(e), c = await crypto.subtle.digest("SHA-256", n);
9
9
  return btoa(String.fromCharCode(...new Uint8Array(c))).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
10
- }, k = async (e, l, d) => {
10
+ }, U = async (e, l, d) => {
11
11
  try {
12
12
  if (!e)
13
13
  return [new Error("Flow not found"), null];
14
- const a = e.selectedScopes.join(" ");
14
+ const n = e.selectedScopes.join(" ");
15
15
  if (e.type === "clientCredentials" || e.type === "password")
16
- return P(e, a, {
16
+ return S(e, n, {
17
17
  proxyUrl: d
18
18
  });
19
19
  const c = (Math.random() + 1).toString(36).substring(2, 10), t = new URL(e.authorizationUrl);
@@ -21,77 +21,77 @@ const S = () => {
21
21
  if (e.type === "implicit")
22
22
  t.searchParams.set("response_type", "token");
23
23
  else if (e.type === "authorizationCode" && (t.searchParams.set("response_type", "code"), e["x-usePkce"] !== "no")) {
24
- const r = S(), n = await x(r, e["x-usePkce"]);
24
+ const r = w(), a = await x(r, e["x-usePkce"]);
25
25
  u = {
26
26
  codeVerifier: r,
27
- codeChallenge: n,
27
+ codeChallenge: a,
28
28
  codeChallengeMethod: e["x-usePkce"] === "SHA-256" ? "S256" : "plain"
29
- }, t.searchParams.set("code_challenge", n), t.searchParams.set("code_challenge_method", u.codeChallengeMethod);
29
+ }, t.searchParams.set("code_challenge", a), t.searchParams.set("code_challenge_method", u.codeChallengeMethod);
30
30
  }
31
31
  if (e["x-scalar-redirect-uri"].startsWith("/")) {
32
- const r = l.url || window.location.origin + window.location.pathname, n = new URL(e["x-scalar-redirect-uri"], r).toString();
33
- t.searchParams.set("redirect_uri", n);
32
+ const r = l.url || window.location.origin + window.location.pathname, a = new URL(e["x-scalar-redirect-uri"], r).toString();
33
+ t.searchParams.set("redirect_uri", a);
34
34
  } else
35
35
  t.searchParams.set("redirect_uri", e["x-scalar-redirect-uri"]);
36
36
  e["x-scalar-security-query"] && Object.keys(e["x-scalar-security-query"]).forEach((r) => {
37
- var i;
38
- const n = (i = e["x-scalar-security-query"]) == null ? void 0 : i[r];
39
- n && t.searchParams.set(r, n);
40
- }), t.searchParams.set("client_id", e["x-scalar-client-id"]), t.searchParams.set("state", c), a && t.searchParams.set("scope", a);
41
- const s = window.open(t, "openAuth2Window", "left=100,top=100,width=800,height=600");
42
- return s ? new Promise((r) => {
43
- const n = setInterval(() => {
37
+ var s;
38
+ const a = (s = e["x-scalar-security-query"]) == null ? void 0 : s[r];
39
+ a && t.searchParams.set(r, a);
40
+ }), t.searchParams.set("client_id", e["x-scalar-client-id"]), t.searchParams.set("state", c), n && t.searchParams.set("scope", n);
41
+ const i = window.open(t, "openAuth2Window", "left=100,top=100,width=800,height=600");
42
+ return i ? new Promise((r) => {
43
+ const a = setInterval(() => {
44
44
  var _;
45
- let i = null, h = null, p = null, g = null;
45
+ let s = null, h = null, p = null, m = null;
46
46
  try {
47
- const o = new URL(s.location.href).searchParams;
48
- i = o.get("access_token"), h = o.get("code"), p = o.get("error"), g = o.get("error_description");
49
- const m = new URLSearchParams(s.location.href.split("#")[1]);
50
- i || (i = m.get("access_token")), h || (h = m.get("code")), p || (p = m.get("error")), g || (g = m.get("error_description"));
47
+ const o = new URL(i.location.href).searchParams, P = e["x-tokenName"] || "access_token";
48
+ s = o.get(P), h = o.get("code"), p = o.get("error"), m = o.get("error_description");
49
+ const g = new URLSearchParams(i.location.href.split("#")[1]);
50
+ s || (s = g.get(P)), h || (h = g.get("code")), p || (p = g.get("error")), m || (m = g.get("error_description"));
51
51
  } catch {
52
52
  }
53
- if (s.closed || i || h || p)
54
- if (clearInterval(n), s.close(), p)
55
- r([new Error(`OAuth error: ${p}${g ? ` (${g})` : ""}`), null]);
56
- else if (i) {
57
- const o = (_ = s.location.href.match(/state=([^&]*)/)) == null ? void 0 : _[1];
58
- r(o === c ? [null, i] : [new Error("State mismatch"), null]);
59
- } else h ? new URL(s.location.href).searchParams.get("state") === c ? P(e, a, {
53
+ if (i.closed || s || h || p)
54
+ if (clearInterval(a), i.close(), p)
55
+ r([new Error(`OAuth error: ${p}${m ? ` (${m})` : ""}`), null]);
56
+ else if (s) {
57
+ const o = (_ = i.location.href.match(/state=([^&]*)/)) == null ? void 0 : _[1];
58
+ r(o === c ? [null, s] : [new Error("State mismatch"), null]);
59
+ } else h ? new URL(i.location.href).searchParams.get("state") === c ? S(e, n, {
60
60
  code: h,
61
61
  pkce: u,
62
62
  proxyUrl: d
63
- }).then(r) : r([new Error("State mismatch"), null]) : (clearInterval(n), r([new Error("Window was closed without granting authorization"), null]));
63
+ }).then(r) : r([new Error("State mismatch"), null]) : (clearInterval(a), r([new Error("Window was closed without granting authorization"), null]));
64
64
  }, 200);
65
65
  }) : [new Error("Failed to open auth window"), null];
66
66
  } catch {
67
67
  return [new Error("Failed to authorize oauth2 flow"), null];
68
68
  }
69
- }, P = async (e, l, {
69
+ }, S = async (e, l, {
70
70
  code: d,
71
- pkce: a,
71
+ pkce: n,
72
72
  proxyUrl: c
73
73
  } = {}) => {
74
74
  if (!e)
75
75
  return [new Error("OAuth2 flow was not defined"), null];
76
76
  const t = new URLSearchParams();
77
- t.set("client_id", e["x-scalar-client-id"]), l && (e.type === "clientCredentials" || e.type === "password") && t.set("scope", l), e.clientSecret && t.set("client_secret", e.clientSecret), "x-scalar-redirect-uri" in e && e["x-scalar-redirect-uri"] && t.set("redirect_uri", e["x-scalar-redirect-uri"]), d ? (t.set("code", d), t.set("grant_type", "authorization_code"), a && t.set("code_verifier", a.codeVerifier)) : e.type === "password" ? (t.set("grant_type", "password"), t.set("username", e.username), t.set("password", e.password)) : t.set("grant_type", "client_credentials");
77
+ t.set("client_id", e["x-scalar-client-id"]), l && (e.type === "clientCredentials" || e.type === "password") && t.set("scope", l), e.clientSecret && t.set("client_secret", e.clientSecret), "x-scalar-redirect-uri" in e && e["x-scalar-redirect-uri"] && t.set("redirect_uri", e["x-scalar-redirect-uri"]), d ? (t.set("code", d), t.set("grant_type", "authorization_code"), n && t.set("code_verifier", n.codeVerifier)) : e.type === "password" ? (t.set("grant_type", "password"), t.set("username", e.username), t.set("password", e.password)) : t.set("grant_type", "client_credentials");
78
78
  try {
79
79
  const u = {
80
80
  "Content-Type": "application/x-www-form-urlencoded"
81
81
  };
82
82
  e.clientSecret && (u.Authorization = `Basic ${btoa(`${e["x-scalar-client-id"]}:${e.clientSecret}`)}`);
83
- const y = w(c, e.tokenUrl) ? `${c}?${new URLSearchParams([["scalar_url", e.tokenUrl]]).toString()}` : e.tokenUrl, s = await fetch(y, {
83
+ const y = k(c, e.tokenUrl) ? `${c}?${new URLSearchParams([["scalar_url", e.tokenUrl]]).toString()}` : e.tokenUrl, r = await (await fetch(y, {
84
84
  method: "POST",
85
85
  headers: u,
86
86
  body: t
87
- }), { access_token: r } = await s.json();
88
- return [null, r];
87
+ })).json(), a = e["x-tokenName"] || "access_token";
88
+ return [null, r[a]];
89
89
  } catch {
90
90
  return [new Error("Failed to get an access token. Please check your credentials."), null];
91
91
  }
92
92
  };
93
93
  export {
94
- k as authorizeOauth2,
95
- P as authorizeServers,
94
+ U as authorizeOauth2,
95
+ S as authorizeServers,
96
96
  x as generateCodeChallenge
97
97
  };
@@ -174,7 +174,7 @@ const D = { class: "bg-b-1 h-full w-full overflow-auto" }, G = { class: "mr-auto
174
174
  a(" Themes ")
175
175
  ])),
176
176
  description: n(() => t[8] || (t[8] = [
177
- a(" Weve got a whole rainbow of themes for you to play with: ")
177
+ a(" We've got a whole rainbow of themes for you to play with: ")
178
178
  ])),
179
179
  default: n(() => [
180
180
  r("div", M, [
@@ -245,7 +245,7 @@ const D = { class: "bg-b-1 h-full w-full overflow-auto" }, G = { class: "mr-auto
245
245
  a(" Framework Themes ")
246
246
  ])),
247
247
  description: n(() => t[10] || (t[10] = [
248
- a(" Are you a real fan? Show your support by using your favorite frameworks theme! ")
248
+ a(" Are you a real fan? Show your support by using your favorite framework's theme! ")
249
249
  ])),
250
250
  default: n(() => [
251
251
  r("div", K, [
package/package.json CHANGED
@@ -18,7 +18,7 @@
18
18
  "rest",
19
19
  "testing"
20
20
  ],
21
- "version": "2.5.13",
21
+ "version": "2.5.16",
22
22
  "engines": {
23
23
  "node": ">=20"
24
24
  },
@@ -205,23 +205,23 @@
205
205
  "whatwg-mimetype": "^4.0.0",
206
206
  "yaml": "2.8.0",
207
207
  "zod": "3.24.1",
208
- "@scalar/components": "0.14.14",
208
+ "@scalar/components": "0.14.17",
209
209
  "@scalar/draggable": "0.2.0",
210
- "@scalar/icons": "0.4.5",
211
- "@scalar/helpers": "0.0.5",
212
- "@scalar/oas-utils": "0.4.9",
213
- "@scalar/import": "0.4.12",
214
- "@scalar/object-utils": "1.2.1",
215
- "@scalar/openapi-parser": "0.18.0",
216
- "@scalar/postman-to-openapi": "0.3.12",
217
- "@scalar/snippetz": "0.3.1",
218
- "@scalar/types": "0.2.5",
219
- "@scalar/themes": "0.13.6",
220
- "@scalar/openapi-types": "0.3.4",
221
- "@scalar/use-codemirror": "0.12.15",
210
+ "@scalar/icons": "0.4.6",
211
+ "@scalar/helpers": "0.0.6",
212
+ "@scalar/oas-utils": "0.4.12",
213
+ "@scalar/import": "0.4.13",
214
+ "@scalar/object-utils": "1.2.2",
215
+ "@scalar/openapi-types": "0.3.5",
216
+ "@scalar/openapi-parser": "0.18.1",
217
+ "@scalar/postman-to-openapi": "0.3.15",
218
+ "@scalar/snippetz": "0.4.1",
219
+ "@scalar/types": "0.2.8",
220
+ "@scalar/use-codemirror": "0.12.18",
221
+ "@scalar/themes": "0.13.9",
222
+ "@scalar/use-tooltip": "1.1.0",
222
223
  "@scalar/use-toasts": "0.8.0",
223
- "@scalar/use-hooks": "0.2.3",
224
- "@scalar/use-tooltip": "1.1.0"
224
+ "@scalar/use-hooks": "0.2.4"
225
225
  },
226
226
  "devDependencies": {
227
227
  "@tailwindcss/vite": "^4.1.7",
@@ -233,9 +233,9 @@
233
233
  "tailwindcss": "^4.1.7",
234
234
  "vite": "5.4.19",
235
235
  "vite-svg-loader": "^5.1.0",
236
- "vitest": "^1.6.0",
237
- "@scalar/galaxy": "0.5.1",
238
- "@scalar/build-tooling": "0.2.3"
236
+ "vitest": "^1.6.1",
237
+ "@scalar/build-tooling": "0.2.4",
238
+ "@scalar/galaxy": "0.5.3"
239
239
  },
240
240
  "scripts": {
241
241
  "build": "scalar-build-vite",
@@ -1,5 +0,0 @@
1
- /**
2
- * Get the Swagger/OpenAPI version and format from the given string
3
- */
4
- export declare function getOpenApiDocumentVersion(input: string | null): string | false;
5
- //# sourceMappingURL=getOpenApiDocumentVersion.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getOpenApiDocumentVersion.d.ts","sourceRoot":"","sources":["../../../../src/components/ImportCollection/utils/getOpenApiDocumentVersion.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,kBAsC7D"}
@@ -1,20 +0,0 @@
1
- import { isDocument as n } from "./isDocument.js";
2
- import { parse as t } from "yaml";
3
- function a(r) {
4
- if (!n(r))
5
- return !1;
6
- try {
7
- const e = JSON.parse(r ?? "");
8
- return typeof (e == null ? void 0 : e.openapi) == "string" ? `OpenAPI ${e.openapi} JSON` : typeof (e == null ? void 0 : e.swagger) == "string" ? `Swagger ${e.swagger} JSON` : !1;
9
- } catch {
10
- }
11
- try {
12
- const e = t(r ?? "");
13
- return typeof (e == null ? void 0 : e.openapi) == "string" ? `OpenAPI ${e.openapi} YAML` : typeof (e == null ? void 0 : e.swagger) == "string" ? `Swagger ${e.swagger} YAML` : !1;
14
- } catch {
15
- }
16
- return !1;
17
- }
18
- export {
19
- a as getOpenApiDocumentVersion
20
- };
@@ -1 +0,0 @@
1
- {"version":3,"file":"isDocument.d.ts","sourceRoot":"","sources":["../../../../src/components/ImportCollection/utils/isDocument.ts"],"names":[],"mappings":"AAEA,mEAAmE;AACnE,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,uBAE9C"}
@@ -1,7 +0,0 @@
1
- import { isUrl as o } from "./isUrl.js";
2
- function e(r) {
3
- return r && !o(r);
4
- }
5
- export {
6
- e as isDocument
7
- };
@@ -1,3 +0,0 @@
1
- /** Checks whether the given string is an URL */
2
- export declare function isUrl(input: string | null): boolean | "" | null;
3
- //# sourceMappingURL=isUrl.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"isUrl.d.ts","sourceRoot":"","sources":["../../../../src/components/ImportCollection/utils/isUrl.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAChD,wBAAgB,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,uBAEzC"}
@@ -1,6 +0,0 @@
1
- function r(t) {
2
- return t && (t.startsWith("http://") || t.startsWith("https://"));
3
- }
4
- export {
5
- r as isUrl
6
- };