@scalar/api-client 2.1.34 → 2.1.36

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 (114) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/dist/components/AddressBar/AddressBar.vue.d.ts.map +1 -1
  3. package/dist/components/AddressBar/AddressBar.vue.js +2 -2
  4. package/dist/components/CommandPalette/CommandPaletteImport.vue.d.ts.map +1 -1
  5. package/dist/components/CommandPalette/CommandPaletteImport.vue.js +105 -119
  6. package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts.map +1 -1
  7. package/dist/components/CommandPalette/TheCommandPalette.vue.js +1 -1
  8. package/dist/components/CommandPalette/TheCommandPalette.vue2.js +14 -14
  9. package/dist/components/CommandPalette/WatchModeToggle.vue.d.ts +15 -0
  10. package/dist/components/CommandPalette/WatchModeToggle.vue.d.ts.map +1 -0
  11. package/dist/components/CommandPalette/WatchModeToggle.vue.js +39 -0
  12. package/dist/components/CommandPalette/WatchModeToggle.vue2.js +4 -0
  13. package/dist/components/ContextBar.vue.d.ts.map +1 -1
  14. package/dist/components/ContextBar.vue.js +1 -1
  15. package/dist/components/ContextBar.vue2.js +6 -6
  16. package/dist/components/DataTable/DataTableInput.vue.d.ts.map +1 -1
  17. package/dist/components/DataTable/DataTableInput.vue.js +3 -3
  18. package/dist/components/DataTable/DataTableInput.vue2.js +53 -40
  19. package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.js +1 -1
  20. package/dist/components/ImportCollection/DropEventListener.vue.d.ts.map +1 -1
  21. package/dist/components/ImportCollection/DropEventListener.vue.js +39 -33
  22. package/dist/components/ImportCollection/ImportCollectionListener.vue.d.ts.map +1 -1
  23. package/dist/components/ImportCollection/ImportCollectionListener.vue.js +22 -20
  24. package/dist/components/ImportCollection/ImportCollectionModal.vue.d.ts +2 -0
  25. package/dist/components/ImportCollection/ImportCollectionModal.vue.d.ts.map +1 -1
  26. package/dist/components/ImportCollection/ImportCollectionModal.vue.js +159 -100
  27. package/dist/components/ImportCollection/ImportCollectionModal.vue3.js +5 -0
  28. package/dist/components/ImportCollection/ImportNowButton.vue.d.ts +2 -0
  29. package/dist/components/ImportCollection/ImportNowButton.vue.d.ts.map +1 -1
  30. package/dist/components/ImportCollection/ImportNowButton.vue.js +35 -31
  31. package/dist/components/ImportCollection/IntegrationLogo.vue.d.ts +7 -0
  32. package/dist/components/ImportCollection/IntegrationLogo.vue.d.ts.map +1 -0
  33. package/dist/components/ImportCollection/IntegrationLogo.vue.js +46 -0
  34. package/dist/components/ImportCollection/IntegrationLogo.vue2.js +4 -0
  35. package/dist/components/ImportCollection/PrefetchError.vue.d.ts +8 -0
  36. package/dist/components/ImportCollection/PrefetchError.vue.d.ts.map +1 -0
  37. package/dist/components/ImportCollection/UrlQueryParameterChecker.vue.d.ts +2 -2
  38. package/dist/components/ImportCollection/UrlQueryParameterChecker.vue.d.ts.map +1 -1
  39. package/dist/components/ImportCollection/UrlQueryParameterChecker.vue.js +7 -7
  40. package/dist/components/ImportCollection/WorkspaceSelector.vue.d.ts.map +1 -1
  41. package/dist/components/ImportCollection/WorkspaceSelector.vue.js +2 -2
  42. package/dist/components/ImportCollection/hooks/useUrlPrefetcher.d.ts +29 -12
  43. package/dist/components/ImportCollection/hooks/useUrlPrefetcher.d.ts.map +1 -1
  44. package/dist/components/ImportCollection/hooks/useUrlPrefetcher.js +34 -42
  45. package/dist/components/OpenApiClientButton.vue.d.ts +13 -0
  46. package/dist/components/OpenApiClientButton.vue.d.ts.map +1 -0
  47. package/dist/components/OpenApiClientButton.vue.js +7 -0
  48. package/dist/components/OpenApiClientButton.vue2.js +36 -0
  49. package/dist/components/SideNav/SideNav.vue.d.ts.map +1 -1
  50. package/dist/components/SideNav/SideNav.vue.js +2 -2
  51. package/dist/components/SideNav/SideNav.vue2.js +8 -8
  52. package/dist/components/TopNav/TopNav.vue.d.ts.map +1 -1
  53. package/dist/components/TopNav/TopNav.vue.js +2 -2
  54. package/dist/components/TopNav/TopNav.vue2.js +14 -14
  55. package/dist/components/ViewLayout/ViewLayoutSection.vue.js +1 -1
  56. package/dist/components/index.d.ts +1 -0
  57. package/dist/components/index.d.ts.map +1 -1
  58. package/dist/components/index.js +4 -2
  59. package/dist/layouts/App/MainLayout.vue.d.ts.map +1 -1
  60. package/dist/layouts/App/MainLayout.vue.js +4 -4
  61. package/dist/layouts/App/create-api-client-app.d.ts +58 -41
  62. package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
  63. package/dist/layouts/Modal/ApiClientModal.vue.d.ts.map +1 -1
  64. package/dist/layouts/Modal/ApiClientModal.vue.js +1 -1
  65. package/dist/layouts/Modal/create-api-client-modal.d.ts +116 -82
  66. package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
  67. package/dist/layouts/Web/ApiClientWeb.vue.d.ts.map +1 -1
  68. package/dist/layouts/Web/ApiClientWeb.vue.js +42 -38
  69. package/dist/layouts/Web/create-api-client-web.d.ts +58 -41
  70. package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
  71. package/dist/libs/create-client.d.ts +58 -41
  72. package/dist/libs/create-client.d.ts.map +1 -1
  73. package/dist/store/collections.d.ts +34 -24
  74. package/dist/store/collections.d.ts.map +1 -1
  75. package/dist/store/import-spec.d.ts +6 -4
  76. package/dist/store/import-spec.d.ts.map +1 -1
  77. package/dist/store/store.d.ts +116 -82
  78. package/dist/store/store.d.ts.map +1 -1
  79. package/dist/style.css +1 -1
  80. package/dist/views/Request/Request.vue2.js +30 -31
  81. package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.js +21 -21
  82. package/dist/views/Request/RequestSection/RequestAuth/OAuthScopesInput.vue.d.ts.map +1 -1
  83. package/dist/views/Request/RequestSection/RequestAuth/OAuthScopesInput.vue.js +79 -71
  84. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.d.ts.map +1 -1
  85. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.js +2 -2
  86. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue2.js +24 -24
  87. package/dist/views/Request/RequestSection/RequestAuth/RequestExampleAuth.vue.d.ts.map +1 -1
  88. package/dist/views/Request/RequestSection/RequestAuth/RequestExampleAuth.vue.js +8 -8
  89. package/dist/views/Request/RequestSection/RequestSection.vue.d.ts.map +1 -1
  90. package/dist/views/Request/RequestSection/RequestSection.vue.js +5 -124
  91. package/dist/views/Request/RequestSection/RequestSection.vue2.js +126 -0
  92. package/dist/views/Request/RequestSidebar.vue.js +3 -3
  93. package/dist/views/Request/RequestSidebar.vue2.js +29 -29
  94. package/dist/views/Request/RequestSidebarItem.vue.js +2 -2
  95. package/dist/views/Request/RequestSidebarItem.vue2.js +76 -76
  96. package/dist/views/Request/RequestSidebarItemMenu.vue.d.ts +2 -2
  97. package/dist/views/Request/RequestSidebarItemMenu.vue.js +3 -3
  98. package/dist/views/Request/RequestSidebarItemMenu.vue2.js +47 -47
  99. package/dist/views/Request/RequestSubpageHeader.vue.d.ts.map +1 -1
  100. package/dist/views/Request/RequestSubpageHeader.vue.js +1 -1
  101. package/dist/views/Request/RequestSubpageHeader.vue2.js +67 -42
  102. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  103. package/dist/views/Request/ResponseSection/ResponseMetaInformation.vue.d.ts.map +1 -1
  104. package/dist/views/Request/ResponseSection/ResponseMetaInformation.vue.js +1 -1
  105. package/dist/views/Request/ResponseSection/ResponseSection.vue.d.ts.map +1 -1
  106. package/dist/views/Request/ResponseSection/ResponseSection.vue.js +5 -99
  107. package/dist/views/Request/ResponseSection/ResponseSection.vue2.js +104 -2
  108. package/dist/views/Request/components/WorkspaceDropdown.vue.js +1 -1
  109. package/dist/views/Request/hooks/useOpenApiWatcher.js +24 -24
  110. package/dist/views/Request/types/sidebar-item.d.ts +1 -1
  111. package/dist/views/Request/types/sidebar-item.d.ts.map +1 -1
  112. package/package.json +8 -8
  113. package/dist/components/ImportCollection/ImportCollectionModal.vue2.js +0 -4
  114. package/dist/views/Request/RequestSection/RequestSection.vue3.js +0 -5
@@ -1,13 +1,13 @@
1
- import { defineComponent as V, ref as d, computed as w, openBlock as l, createBlock as i, normalizeClass as b, withCtx as k, createElementBlock as s, renderSlot as m, createCommentVNode as u, createElementVNode as C, Fragment as B, createVNode as g, mergeProps as $, unref as h } from "vue";
2
- import x from "../CodeInput/CodeInput.vue.js";
3
- import { ScalarIconButton as q } from "@scalar/components";
4
- import A from "./DataTableCell.vue.js";
5
- import E from "./DataTableInputSelect.vue.js";
6
- const F = {
7
- key: 0,
8
- class: "text-c-2 flex min-w-[120px] items-center border-r-1/2 pl-2 pr-0"
9
- }, I = { class: "row-1" }, O = {
1
+ import { defineComponent as V, ref as i, computed as k, openBlock as l, createBlock as u, normalizeClass as b, withCtx as g, createElementBlock as r, renderSlot as p, createCommentVNode as d, createElementVNode as C, Fragment as B, mergeProps as y, unref as $ } from "vue";
2
+ import h from "../CodeInput/CodeInput.vue.js";
3
+ import { ScalarIconButton as x } from "@scalar/components";
4
+ import O from "./DataTableCell.vue.js";
5
+ import q from "./DataTableInputSelect.vue.js";
6
+ const A = {
10
7
  key: 0,
8
+ class: "text-c-1 flex min-w-[94px] items-center pl-2 pr-0"
9
+ }, I = { class: "row-1 overflow-x-auto" }, E = ["id", "readOnly", "type", "value"], F = {
10
+ key: 2,
11
11
  class: "absolute centered-y right-0 pt-px pr-2 text-xxs text-c-3 bg-b-1 shadow-[-8px_0_4px_var(--scalar-background-1)] opacity-100 duration-150 transition-opacity peer-focus:opacity-0"
12
12
  }, S = {
13
13
  key: 1,
@@ -28,30 +28,43 @@ const F = {
28
28
  max: {}
29
29
  },
30
30
  emits: ["update:modelValue", "inputFocus", "inputBlur", "selectVariable"],
31
- setup(p, { emit: c }) {
32
- const o = p, r = c, a = d(!0);
33
- d("");
34
- const f = d(!1), y = () => {
35
- f.value || r("inputBlur");
36
- }, v = w(
37
- () => o.type === "password" ? a.value ? "password" : "text" : o.type ?? "text"
31
+ setup(c, { emit: f }) {
32
+ const o = c, s = f, n = i(!0);
33
+ i("");
34
+ const v = i(!1), w = () => {
35
+ v.value || s("inputBlur");
36
+ }, m = k(
37
+ () => o.type === "password" ? n.value ? "password" : "text" : o.type ?? "text"
38
38
  );
39
- return (e, t) => (l(), i(A, {
39
+ return (e, t) => (l(), u(O, {
40
40
  class: b(["relative row", e.containerClass])
41
41
  }, {
42
- default: k(() => [
43
- e.$slots.default ? (l(), s("div", F, [
44
- m(e.$slots, "default", {}, void 0, !0)
45
- ])) : u("", !0),
42
+ default: g(() => [
43
+ e.$slots.default ? (l(), r("div", A, [
44
+ p(e.$slots, "default", {}, void 0, !0)
45
+ ])) : d("", !0),
46
46
  C("div", I, [
47
- o.enum && o.enum.length ? (l(), i(E, {
47
+ o.enum && o.enum.length ? (l(), u(q, {
48
48
  key: 0,
49
49
  canAddCustomValue: e.canAddCustomEnumValue,
50
50
  modelValue: o.modelValue,
51
51
  value: o.enum,
52
- "onUpdate:modelValue": t[0] || (t[0] = (n) => r("update:modelValue", n))
53
- }, null, 8, ["canAddCustomValue", "modelValue", "value"])) : (l(), s(B, { key: 1 }, [
54
- g(x, $(e.$attrs, {
52
+ "onUpdate:modelValue": t[0] || (t[0] = (a) => s("update:modelValue", a))
53
+ }, null, 8, ["canAddCustomValue", "modelValue", "value"])) : (l(), r(B, { key: 1 }, [
54
+ n.value && e.type === "password" ? (l(), r("input", y({ key: 0 }, e.$attrs, {
55
+ id: e.id,
56
+ autocomplete: "off",
57
+ class: "border-none text-c-1 disabled:text-c-2 min-w-0 w-full peer px-2 py-1.25 outline-none",
58
+ "data-1p-ignore": "",
59
+ readOnly: e.readOnly,
60
+ spellcheck: "false",
61
+ type: m.value,
62
+ value: e.modelValue,
63
+ onInput: t[1] || (t[1] = (a) => s(
64
+ "update:modelValue",
65
+ a.target.value ?? ""
66
+ ))
67
+ }), null, 16, E)) : (l(), u(h, y({ key: 1 }, e.$attrs, {
55
68
  id: e.id,
56
69
  class: "border-none text-c-1 disabled:text-c-2 min-w-0 w-full peer outline-none",
57
70
  disableCloseBrackets: "",
@@ -62,25 +75,25 @@ const F = {
62
75
  readOnly: e.readOnly,
63
76
  required: e.required,
64
77
  spellcheck: "false",
65
- type: v.value,
66
- onBlur: y,
67
- onFocus: t[1] || (t[1] = (n) => r("inputFocus")),
68
- "onUpdate:modelValue": t[2] || (t[2] = (n) => r("update:modelValue", n))
69
- }), null, 16, ["id", "max", "min", "modelValue", "readOnly", "required", "type"]),
70
- e.required ? (l(), s("div", O, " Required ")) : u("", !0)
78
+ type: m.value,
79
+ onBlur: w,
80
+ onFocus: t[2] || (t[2] = (a) => s("inputFocus")),
81
+ "onUpdate:modelValue": t[3] || (t[3] = (a) => s("update:modelValue", a))
82
+ }), null, 16, ["id", "max", "min", "modelValue", "readOnly", "required", "type"])),
83
+ e.required ? (l(), r("div", F, " Required ")) : d("", !0)
71
84
  ], 64))
72
85
  ]),
73
- e.$slots.warning ? (l(), s("div", S, [
74
- m(e.$slots, "warning", {}, void 0, !0)
75
- ])) : u("", !0),
76
- m(e.$slots, "icon", {}, void 0, !0),
77
- e.type === "password" ? (l(), i(h(q), {
86
+ e.$slots.warning ? (l(), r("div", S, [
87
+ p(e.$slots, "warning", {}, void 0, !0)
88
+ ])) : d("", !0),
89
+ p(e.$slots, "icon", {}, void 0, !0),
90
+ e.type === "password" ? (l(), u($(x), {
78
91
  key: 2,
79
92
  class: "-ml-.5 mr-1 h-6 w-6 self-center p-1.5",
80
- icon: a.value ? "Show" : "Hide",
81
- label: a.value ? "Show Password" : "Hide Password",
82
- onClick: t[3] || (t[3] = (n) => a.value = !a.value)
83
- }, null, 8, ["icon", "label"])) : u("", !0)
93
+ icon: n.value ? "Show" : "Hide",
94
+ label: n.value ? "Show Password" : "Hide Password",
95
+ onClick: t[4] || (t[4] = (a) => n.value = !n.value)
96
+ }, null, 8, ["icon", "label"])) : d("", !0)
84
97
  ]),
85
98
  _: 3
86
99
  }, 8, ["class"]));
@@ -84,7 +84,7 @@ const W = { class: "font-medium m-0 text-xs flex gap-1.5 items-center whitespace
84
84
  ]),
85
85
  default: r(() => [
86
86
  n(e(I), {
87
- class: "font-normal h-auto justify-start py-1.5 px-1.5 pl-2 text-c-1 hover:bg-b-2 text-c-3 w-fit",
87
+ class: "font-normal h-auto justify-start py-1.5 px-1.5 pl-2 text-c-1 hover:bg-b-2 text-c-1 w-fit",
88
88
  fullWidth: "",
89
89
  variant: "ghost"
90
90
  }, {
@@ -1 +1 @@
1
- {"version":3,"file":"DropEventListener.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ImportCollection/DropEventListener.vue"],"names":[],"mappings":";;;;;AAgTA,wBAQG"}
1
+ {"version":3,"file":"DropEventListener.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ImportCollection/DropEventListener.vue"],"names":[],"mappings":";;;;;AAkVA,wBAQG"}
@@ -1,70 +1,76 @@
1
- import { defineComponent as v, ref as g, onMounted as y, onBeforeUnmount as h, openBlock as m, createBlock as x, Transition as D, withCtx as E, createElementBlock as _, createElementVNode as s, createVNode as L, unref as T, createCommentVNode as C } from "vue";
2
- import { ScalarIcon as b } from "@scalar/components";
3
- const k = {
1
+ import { defineComponent as g, ref as y, onMounted as x, onBeforeUnmount as h, openBlock as p, createBlock as D, Transition as E, withCtx as T, createElementBlock as _, createElementVNode as i, createVNode as L, unref as C, createCommentVNode as b } from "vue";
2
+ import { ScalarIcon as k } from "@scalar/components";
3
+ const A = {
4
4
  key: 0,
5
- class: "fixed bottom-10 right-10 w-64 h-64 bg-b-2 z-50 rounded-xl border transition-opacity duration-200"
6
- }, w = { class: "flex flex-col items-center justify-center h-full" }, V = /* @__PURE__ */ v({
5
+ class: "fixed translate-x-1/2 translate-y-1/2 md:translate-x-0 md:translate-y-0 right-1/2 bottom-1/2 md:bottom-10 md:right-10 w-64 h-64 bg-b-2 z-50 rounded-xl border transition-opacity duration-200"
6
+ }, w = { class: "flex flex-col items-center justify-center h-full" }, V = /* @__PURE__ */ g({
7
7
  __name: "DropEventListener",
8
8
  emits: ["input"],
9
- setup(A, { emit: p }) {
10
- const d = p, r = g(!1);
9
+ setup(B, { emit: v }) {
10
+ const d = v, r = y(!1);
11
11
  let o = 0;
12
- y(() => {
13
- document.addEventListener("dragenter", f), document.addEventListener("dragleave", u), document.addEventListener("dragover", c), document.addEventListener("drop", l);
12
+ x(() => {
13
+ document.addEventListener("dragenter", m), document.addEventListener("dragleave", f), document.addEventListener("dragover", u), document.addEventListener("drop", c);
14
14
  }), h(() => {
15
- document.removeEventListener("dragenter", f), document.removeEventListener("dragover", c), document.removeEventListener("dragleave", u), document.removeEventListener("drop", l);
15
+ document.removeEventListener("dragenter", m), document.removeEventListener("dragover", u), document.removeEventListener("dragleave", f), document.removeEventListener("drop", c);
16
16
  });
17
- async function l(e) {
18
- if (e.preventDefault(), r.value = !1, o = 0, e.dataTransfer) {
17
+ function l(e) {
18
+ var t;
19
+ return ((t = e.dataTransfer) == null ? void 0 : t.types.includes("text/html")) ?? !1;
20
+ }
21
+ async function c(e) {
22
+ if (e.preventDefault(), r.value = !1, o = 0, !l(e) && e.dataTransfer) {
19
23
  const t = e.dataTransfer.getData("text").replace(/^blob:/, "");
20
24
  if (t)
21
25
  d("input", t);
22
26
  else if (e.dataTransfer.files.length > 0) {
23
27
  const a = e.dataTransfer.files[0], n = new FileReader();
24
- n.onload = async (i) => {
25
- i.target && typeof i.target.result == "string" && d("input", i.target.result);
28
+ n.onload = async (s) => {
29
+ s.target && typeof s.target.result == "string" && d("input", s.target.result);
26
30
  }, n.readAsText(a);
27
31
  }
28
32
  }
29
33
  }
30
- function c(e) {
34
+ function u(e) {
31
35
  e.preventDefault();
32
36
  }
33
- function u(e) {
37
+ function f(e) {
34
38
  e.preventDefault(), o--, o === 0 && (r.value = !1);
35
39
  }
36
- function f(e) {
37
- if (e.preventDefault(), o++, e.dataTransfer) {
38
- const t = e.dataTransfer.items;
39
- for (let a = 0; a < t.length; a++) {
40
- const n = t[a];
41
- if (n.kind === "string" || n.type.includes("json") || n.type.includes("yml") || n.type.includes("yaml")) {
42
- r.value = !0;
43
- return;
40
+ function m(e) {
41
+ if (e.preventDefault(), o++, !l(e)) {
42
+ if (e.dataTransfer) {
43
+ const t = e.dataTransfer.items;
44
+ for (let a = 0; a < t.length; a++) {
45
+ const n = t[a];
46
+ if (n.kind === "string" || n.type.includes("json") || n.type.includes("yml") || n.type.includes("yaml")) {
47
+ r.value = !0;
48
+ return;
49
+ }
44
50
  }
45
51
  }
52
+ r.value = !1;
46
53
  }
47
- r.value = !1;
48
54
  }
49
- return (e, t) => (m(), x(D, {
55
+ return (e, t) => (p(), D(E, {
50
56
  enterActiveClass: "transition-opacity duration-200",
51
57
  enterFromClass: "opacity-0",
52
58
  leaveActiveClass: "transition-opacity duration-200",
53
59
  leaveToClass: "opacity-0"
54
60
  }, {
55
- default: E(() => [
56
- r.value ? (m(), _("div", k, [
57
- s("div", w, [
58
- s("div", null, [
59
- L(T(b), {
61
+ default: T(() => [
62
+ r.value ? (p(), _("div", A, [
63
+ i("div", w, [
64
+ i("div", null, [
65
+ L(C(k), {
60
66
  icon: "Download",
61
67
  size: "xl",
62
68
  thickness: "2"
63
69
  })
64
70
  ]),
65
- t[0] || (t[0] = s("div", { class: "text-center text-c-1 m-4" }, " Drop your OpenAPI document here ", -1))
71
+ t[0] || (t[0] = i("div", { class: "text-center text-c-1 m-4" }, " Drop your OpenAPI document here ", -1))
66
72
  ])
67
- ])) : C("", !0)
73
+ ])) : b("", !0)
68
74
  ]),
69
75
  _: 1
70
76
  }));
@@ -1 +1 @@
1
- {"version":3,"file":"ImportCollectionListener.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ImportCollection/ImportCollectionListener.vue"],"names":[],"mappings":"AAyEA,iBAAS,cAAc;qBA4GO,GAAG;EAoBhC;AACD,QAAA,MAAM,eAAe,+QAKnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAAvG,wBAAwG;AAOxG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACpC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"ImportCollectionListener.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ImportCollection/ImportCollectionListener.vue"],"names":[],"mappings":"AA0FA,iBAAS,cAAc;qBA4GO,GAAG;EAqBhC;AACD,QAAA,MAAM,eAAe,+QAKnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAAvG,wBAAwG;AAOxG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACpC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -1,30 +1,32 @@
1
- import { defineComponent as a, ref as c, openBlock as l, createElementBlock as m, Fragment as u, createVNode as n, renderSlot as i, nextTick as s } from "vue";
2
- import p from "./DropEventListener.vue.js";
3
- import f from "./ImportCollectionModal.vue.js";
4
- import _ from "./PasteEventListener.vue.js";
5
- import d from "./UrlQueryParameterChecker.vue.js";
6
- const y = /* @__PURE__ */ a({
1
+ import { defineComponent as u, ref as i, openBlock as c, createElementBlock as m, Fragment as s, createVNode as n, renderSlot as p, nextTick as f } from "vue";
2
+ import _ from "./DropEventListener.vue.js";
3
+ import d from "./ImportCollectionModal.vue.js";
4
+ /* empty css */
5
+ import v from "./PasteEventListener.vue.js";
6
+ import I from "./UrlQueryParameterChecker.vue.js";
7
+ const B = /* @__PURE__ */ u({
7
8
  __name: "ImportCollectionListener",
8
- setup(I) {
9
- const e = c(null);
10
- async function r() {
11
- e.value = null, await s();
9
+ setup($) {
10
+ const e = i(null), t = i(null);
11
+ async function a() {
12
+ e.value = null, t.value = null, await f();
12
13
  }
13
- async function o(t) {
14
- await r(), e.value = t;
14
+ async function o(r, l = null) {
15
+ await a(), e.value = r, t.value = l;
15
16
  }
16
- return (t, $) => (l(), m(u, null, [
17
- n(f, {
17
+ return (r, l) => (c(), m(s, null, [
18
+ n(d, {
19
+ integration: t.value,
18
20
  source: e.value,
19
- onImportFinished: r
20
- }, null, 8, ["source"]),
21
+ onImportFinished: a
22
+ }, null, 8, ["integration", "source"]),
23
+ n(v, { onInput: o }),
21
24
  n(_, { onInput: o }),
22
- n(p, { onInput: o }),
23
- n(d, { onInput: o }),
24
- i(t.$slots, "default")
25
+ n(I, { onInput: o }),
26
+ p(r.$slots, "default")
25
27
  ], 64));
26
28
  }
27
29
  });
28
30
  export {
29
- y as default
31
+ B as default
30
32
  };
@@ -1,9 +1,11 @@
1
1
  declare const _default: import("vue").DefineComponent<{
2
2
  source: string | null;
3
+ integration: string | null;
3
4
  }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
4
5
  importFinished: () => any;
5
6
  }, string, import("vue").PublicProps, Readonly<{
6
7
  source: string | null;
8
+ integration: string | null;
7
9
  }> & Readonly<{
8
10
  onImportFinished?: (() => any) | undefined;
9
11
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -1 +1 @@
1
- {"version":3,"file":"ImportCollectionModal.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ImportCollection/ImportCollectionModal.vue"],"names":[],"mappings":";YA2LU,MAAM,GAAG,IAAI;;;;YAAb,MAAM,GAAG,IAAI;;;;AAmTvB,wBASG"}
1
+ {"version":3,"file":"ImportCollectionModal.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ImportCollection/ImportCollectionModal.vue"],"names":[],"mappings":";YAiVU,MAAM,GAAG,IAAI;iBACR,MAAM,GAAG,IAAI;;;;YADlB,MAAM,GAAG,IAAI;iBACR,MAAM,GAAG,IAAI;;;;AA+b5B,wBASG"}
@@ -1,119 +1,178 @@
1
- import { defineComponent as S, computed as a, watch as C, openBlock as l, createBlock as z, unref as o, withCtx as D, createElementVNode as e, toDisplayString as h, createElementBlock as d, createVNode as i, Fragment as F, createCommentVNode as x, createTextVNode as I } from "vue";
2
- import { useUrlPrefetcher as V } from "./hooks/useUrlPrefetcher.js";
3
- import { getOpenApiDocumentVersion as _ } from "./utils/getOpenApiDocumentVersion.js";
4
- import { isDocument as j } from "./utils/isDocument.js";
5
- import { isUrl as A } from "./utils/isUrl.js";
6
- import { useModal as B, ScalarModal as E, ScalarIcon as m, ScalarCodeBlock as N } from "@scalar/components";
7
- import { normalize as O } from "@scalar/openapi-parser";
8
- import U from "./ImportNowButton.vue.js";
9
- import M from "./WorkspaceSelector.vue.js";
10
- import { useWorkspace as $ } from "../../store/store.js";
11
- const P = { class: "flex flex-col h-screen justify-center overflow-hidden relative" }, T = { class: "flex items-center flex-col m-auto" }, W = { class: "text-center text-[50px] tracking-[-3px] leading-tight font-medium text-pretty" }, K = {
1
+ import { defineComponent as K, ref as w, computed as c, watch as u, onMounted as R, onUnmounted as G, resolveComponent as H, openBlock as a, createBlock as p, unref as s, withCtx as k, createElementVNode as e, normalizeClass as J, createCommentVNode as f, toDisplayString as I, createElementBlock as x, Fragment as Q, createVNode as i, createTextVNode as C } from "vue";
2
+ import X from "../CommandPalette/WatchModeToggle.vue.js";
3
+ import { useUrlPrefetcher as Y } from "./hooks/useUrlPrefetcher.js";
4
+ import { getOpenApiDocumentVersion as M } from "./utils/getOpenApiDocumentVersion.js";
5
+ import { isDocument as A } from "./utils/isDocument.js";
6
+ import { isUrl as h } from "./utils/isUrl.js";
7
+ import { useModal as U, ScalarModal as L, ScalarIcon as P, ScalarCodeBlock as Z } from "@scalar/components";
8
+ import { isLocalUrl as ee } from "@scalar/oas-utils/helpers";
9
+ import { normalize as te } from "@scalar/openapi-parser";
10
+ import oe from "./ImportNowButton.vue.js";
11
+ import se from "./IntegrationLogo.vue.js";
12
+ import re from "./WorkspaceSelector.vue.js";
13
+ import { useWorkspace as ne } from "../../store/store.js";
14
+ const le = { class: "flex flex-col h-screen justify-center px-6 overflow-hidden relative md:px-0" }, ie = { class: "text-center text-md font-bold mb-2 line-clamp-1" }, ce = { class: "inline-flex flex-col gap-2 items-center z-10 w-full" }, ae = { class: "flex justify-center" }, de = { class: "inline-flex py-1 px-4 items-center text-xs font-medium text-c-3" }, me = {
12
15
  key: 0,
13
- class: "flex gap-2 items-center p-3 font-code text-sm border rounded break-words my-4"
14
- }, L = { class: "break-all" }, R = { class: "flex gap-2 items-center p-3 font-code text-sm border rounded" }, q = { class: "bg-b-2 h-48 border rounded custom-scroll" }, G = {
15
- key: 2,
16
- class: "inline-flex flex-col gap-2 items-center mt-2"
17
- }, H = { class: "flex justify-center" }, J = { class: "inline-block py-1 px-4" }, Q = { class: "flex flex-col justify-center items-center pb-4" }, X = { class: "text-center flex items-center flex-col" }, Y = { class: "mb-2 w-10 h-10 border rounded-[10px] flex items-center justify-center" }, ae = /* @__PURE__ */ S({
16
+ class: "text-sm overflow-hidden mt-5 pt-4 border-t-1/2"
17
+ }, ue = { class: "flex items-center justify-center" }, pe = {
18
+ key: 3,
19
+ class: "flex flex-col gap-2"
20
+ }, fe = { class: "flex gap-2 items-center p-3 font-code text-sm border rounded" }, xe = { class: "bg-b-2 h-48 border rounded custom-scroll" }, he = { class: "flex flex-col justify-center items-center pb-8" }, ve = { class: "text-center flex items-center flex-col" }, _e = { class: "mb-2 w-10 h-10 border rounded-[10px] flex items-center justify-center" }, ye = {
21
+ href: "https://scalar.com/download",
22
+ target: "_blank"
23
+ }, be = { class: "text-sm" }, De = /* @__PURE__ */ K({
18
24
  __name: "ImportCollectionModal",
19
25
  props: {
20
- source: {}
26
+ source: {},
27
+ integration: {}
21
28
  },
22
29
  emits: ["importFinished"],
23
- setup(v) {
24
- const c = v, { activeWorkspace: k, events: g } = $(), { prefetchResult: r, prefetchUrl: y } = V(), n = B();
25
- g.hotKeys.on(() => n.hide());
26
- const b = a(() => {
30
+ setup(S) {
31
+ const n = S, { activeWorkspace: V, events: z } = ne(), { prefetchResult: r, prefetchUrl: D } = Y(), l = U(), E = U(), j = w(""), d = w(!0);
32
+ z.hotKeys.on(() => l.hide());
33
+ const B = c(() => {
27
34
  try {
28
- return O(
29
- r.content || c.source || ""
35
+ return te(
36
+ r.content || n.source || ""
30
37
  );
31
38
  } catch {
32
39
  return;
33
40
  }
34
- }), w = a(() => {
35
- var t, s;
36
- return (s = (t = b.value) == null ? void 0 : t.info) == null ? void 0 : s.title;
37
- }), p = a(
38
- () => _(r.content || c.source || "")
41
+ }), N = c(() => {
42
+ var o, t;
43
+ return (t = (o = B.value) == null ? void 0 : o.info) == null ? void 0 : t.title;
44
+ }), v = c(
45
+ () => M(r.content || n.source || "")
39
46
  );
40
- return C(
41
- () => c.source,
42
- (t) => {
43
- y(t, k.value.proxyUrl), t && (A(t) || j(t) && _(t)) ? n.show() : n.hide();
47
+ u(
48
+ () => n.source,
49
+ (o) => {
50
+ h(o) && D(o, V.value.proxyUrl), o && (h(o) || A(o) && M(o)) ? l.show() : l.hide();
44
51
  }
45
- ), (t, s) => (l(), z(o(E), {
46
- size: "full",
47
- state: o(n)
48
- }, {
49
- default: D(() => {
50
- var f, u;
51
- return [
52
- e("div", P, [
53
- e("div", T, [
54
- e("div", W, h(w.value ?? "Import Collection"), 1),
55
- o(r).state !== "loading" && o(r).error ? (l(), d("div", K, [
56
- i(o(m), {
57
- class: "text-red flex-shrink-0",
58
- icon: "Error",
59
- size: "sm"
60
- }),
61
- e("div", L, h(o(r).error), 1)
62
- ])) : p.value ? x("", !0) : (l(), d(F, { key: 1 }, [
63
- e("div", R, [
64
- i(o(m), {
65
- class: "text-red",
66
- icon: "Error",
67
- size: "sm"
68
- }),
69
- s[1] || (s[1] = e("div", null, "This doesn’t look like a valid OpenAPI/Swagger document.", -1))
70
- ]),
71
- e("div", q, [
72
- i(o(N), {
73
- content: ((f = o(r).content) == null ? void 0 : f.trim()) || ((u = c.source) == null ? void 0 : u.trim()) || "",
74
- copy: !1
75
- }, null, 8, ["content"])
76
- ])
77
- ], 64)),
78
- p.value ? (l(), d("div", G, [
79
- i(U, {
80
- source: t.source,
81
- variant: "button",
82
- onImportFinished: s[0] || (s[0] = () => t.$emit("importFinished"))
83
- }, null, 8, ["source"])
84
- ])) : x("", !0),
85
- e("div", H, [
86
- e("div", J, [
87
- i(M)
52
+ );
53
+ const $ = c(() => !!n.source && h(n.source)), F = c(() => !!n.source && A(n.source)), O = c(() => r.url && ee(r.url)), m = (o) => {
54
+ ($.value || F.value) && l.open ? document.body.classList.add("has-import-url") : document.body.classList.remove("has-import-url");
55
+ }, T = () => {
56
+ document.body.classList.remove("has-import-url"), document.body.classList.add("has-no-import-url");
57
+ };
58
+ return u(
59
+ () => l.open,
60
+ (o) => {
61
+ o ? m() : T();
62
+ }
63
+ ), u(
64
+ () => n.source,
65
+ () => {
66
+ m();
67
+ }
68
+ ), R(() => {
69
+ m();
70
+ }), G(() => {
71
+ document.body.classList.remove("has-import-url"), document.body.classList.remove("has-no-import-url");
72
+ }), (o, t) => {
73
+ const q = H("PrefetchError");
74
+ return a(), p(s(L), {
75
+ size: "full",
76
+ state: s(l)
77
+ }, {
78
+ default: k(() => {
79
+ var _, y, b, g;
80
+ return [
81
+ e("div", le, [
82
+ e("div", {
83
+ class: J(["flex items-center flex-col m-auto px-8 py-8 rounded-xl border-1/2 max-w-[380px] w-full transition-opacity", { "opacity-0": s(r).state === "loading" }])
84
+ }, [
85
+ O.value ? (a(), p(se, {
86
+ key: 0,
87
+ integration: o.integration
88
+ }, null, 8, ["integration"])) : f("", !0),
89
+ e("div", ie, I(N.value ?? "Untitled Collection"), 1),
90
+ t[5] || (t[5] = e("div", { class: "text-c-1 text-sm font-medium mb-2 text-center text-balance" }, " Import the OpenAPI document to instantly send API requests. No signup required. ", -1)),
91
+ s(r).error ? (a(), p(q, {
92
+ key: 1,
93
+ result: s(r)
94
+ }, null, 8, ["result"])) : v.value ? (a(), x(Q, { key: 2 }, [
95
+ e("div", ce, [
96
+ i(oe, {
97
+ source: ((_ = s(r)) == null ? void 0 : _.url) ?? o.source,
98
+ variant: "button",
99
+ watchMode: d.value,
100
+ onImportFinished: t[0] || (t[0] = () => o.$emit("importFinished"))
101
+ }, null, 8, ["source", "watchMode"])
102
+ ]),
103
+ e("div", ae, [
104
+ e("div", de, [
105
+ t[2] || (t[2] = C(" Import to: ")),
106
+ i(re)
107
+ ])
108
+ ]),
109
+ (y = s(r)) != null && y.url ? (a(), x("div", me, [
110
+ e("div", ue, [
111
+ i(X, {
112
+ modelValue: d.value,
113
+ "onUpdate:modelValue": t[1] || (t[1] = (W) => d.value = W),
114
+ disableToolTip: !0
115
+ }, null, 8, ["modelValue"])
116
+ ]),
117
+ t[3] || (t[3] = e("div", { class: "pt-0 text-center text-balance font-medium text-xs text-c-3" }, " Automatically update your API client when the OpenAPI document content changes. ", -1))
118
+ ])) : f("", !0)
119
+ ], 64)) : v.value ? f("", !0) : (a(), x("div", pe, [
120
+ e("div", fe, [
121
+ i(s(P), {
122
+ class: "text-red",
123
+ icon: "Error",
124
+ size: "sm"
125
+ }),
126
+ t[4] || (t[4] = e("div", null, " This doesn’t look like a valid OpenAPI/Swagger document. ", -1))
127
+ ]),
128
+ e("div", xe, [
129
+ i(s(Z), {
130
+ content: ((b = s(r).content) == null ? void 0 : b.trim()) || ((g = n.source) == null ? void 0 : g.trim()) || "",
131
+ copy: !1
132
+ }, null, 8, ["content"])
133
+ ])
134
+ ]))
135
+ ], 2),
136
+ e("div", he, [
137
+ e("div", ve, [
138
+ e("div", _e, [
139
+ e("a", ye, [
140
+ i(s(P), {
141
+ icon: "Logo",
142
+ size: "xl"
143
+ })
144
+ ])
145
+ ]),
146
+ t[6] || (t[6] = e("span", { class: "text-c-2 leading-snug text-sm font-medium" }, [
147
+ e("a", {
148
+ class: "hover:text-c-1 underline-offset-2 mb-1 inline-block",
149
+ href: "https://scalar.com/download",
150
+ target: "_blank"
151
+ }, " Download Desktop App "),
152
+ e("br"),
153
+ C(" free · open-source · offline first ")
154
+ ], -1))
88
155
  ])
89
- ])
90
- ]),
91
- e("div", Q, [
92
- e("div", X, [
93
- e("div", Y, [
94
- i(o(m), {
95
- icon: "Logo",
96
- size: "xl"
97
- })
156
+ ]),
157
+ i(s(L), {
158
+ size: "md",
159
+ state: s(E),
160
+ title: "Error Details",
161
+ variant: "error"
162
+ }, {
163
+ default: k(() => [
164
+ e("div", be, I(j.value), 1)
98
165
  ]),
99
- s[2] || (s[2] = e("span", { class: "text-c-2" }, [
100
- e("a", {
101
- class: "hover:text-c-1",
102
- href: "https://scalar.com/download",
103
- target: "_blank"
104
- }, " Download Scalar App "),
105
- e("br"),
106
- I(" Offline First - Open Source ")
107
- ], -1))
108
- ])
166
+ _: 1
167
+ }, 8, ["state"])
109
168
  ])
110
- ])
111
- ];
112
- }),
113
- _: 1
114
- }, 8, ["state"]));
169
+ ];
170
+ }),
171
+ _: 1
172
+ }, 8, ["state"]);
173
+ };
115
174
  }
116
175
  });
117
176
  export {
118
- ae as default
177
+ De as default
119
178
  };
@@ -0,0 +1,5 @@
1
+ import o from "./ImportCollectionModal.vue.js";
2
+ /* empty css */
3
+ export {
4
+ o as default
5
+ };