@scalar/api-client 2.1.10 → 2.1.12

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 (113) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/dist/components/AddressBar/AddressBarServer.vue.d.ts.map +1 -1
  3. package/dist/components/AddressBar/AddressBarServer.vue.js +18 -18
  4. package/dist/components/CommandPalette/CommandActionForm.vue.d.ts +2 -0
  5. package/dist/components/CommandPalette/CommandActionForm.vue.d.ts.map +1 -1
  6. package/dist/components/CommandPalette/CommandActionForm.vue.js +1 -1
  7. package/dist/components/CommandPalette/CommandActionInput.vue.d.ts +2 -0
  8. package/dist/components/CommandPalette/CommandActionInput.vue.d.ts.map +1 -1
  9. package/dist/components/CommandPalette/CommandActionInput.vue.js +27 -23
  10. package/dist/components/CommandPalette/CommandPaletteCollection.vue.d.ts +2 -0
  11. package/dist/components/CommandPalette/CommandPaletteCollection.vue.d.ts.map +1 -1
  12. package/dist/components/CommandPalette/CommandPaletteCollection.vue.js +32 -31
  13. package/dist/components/CommandPalette/CommandPaletteExample.vue.d.ts +2 -0
  14. package/dist/components/CommandPalette/CommandPaletteExample.vue.d.ts.map +1 -1
  15. package/dist/components/CommandPalette/CommandPaletteExample.vue.js +43 -42
  16. package/dist/components/CommandPalette/CommandPaletteImport.vue.d.ts +2 -0
  17. package/dist/components/CommandPalette/CommandPaletteImport.vue.d.ts.map +1 -1
  18. package/dist/components/CommandPalette/CommandPaletteImport.vue.js +26 -25
  19. package/dist/components/CommandPalette/CommandPaletteRequest.vue.d.ts +2 -0
  20. package/dist/components/CommandPalette/CommandPaletteRequest.vue.d.ts.map +1 -1
  21. package/dist/components/CommandPalette/CommandPaletteRequest.vue.js +31 -30
  22. package/dist/components/CommandPalette/CommandPaletteServer.vue.d.ts +2 -0
  23. package/dist/components/CommandPalette/CommandPaletteServer.vue.d.ts.map +1 -1
  24. package/dist/components/CommandPalette/CommandPaletteServer.vue.js +35 -34
  25. package/dist/components/CommandPalette/CommandPaletteTag.vue.d.ts +2 -0
  26. package/dist/components/CommandPalette/CommandPaletteTag.vue.d.ts.map +1 -1
  27. package/dist/components/CommandPalette/CommandPaletteTag.vue.js +28 -27
  28. package/dist/components/CommandPalette/CommandPaletteWorkspace.vue.d.ts +2 -0
  29. package/dist/components/CommandPalette/CommandPaletteWorkspace.vue.d.ts.map +1 -1
  30. package/dist/components/CommandPalette/CommandPaletteWorkspace.vue.js +18 -17
  31. package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts +14 -0
  32. package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts.map +1 -1
  33. package/dist/components/CommandPalette/TheCommandPalette.vue.js +4 -4
  34. package/dist/components/CommandPalette/TheCommandPalette.vue2.js +112 -103
  35. package/dist/components/DataTable/DataTableInput.vue.js +2 -2
  36. package/dist/components/ImportCollection/DropEventListener.vue.d.ts +7 -0
  37. package/dist/components/ImportCollection/DropEventListener.vue.d.ts.map +1 -0
  38. package/dist/components/ImportCollection/DropEventListener.vue.js +75 -0
  39. package/dist/components/ImportCollection/DropEventListener.vue2.js +4 -0
  40. package/dist/components/ImportCollection/ImportCollectionListener.vue.d.ts +12 -0
  41. package/dist/components/ImportCollection/ImportCollectionListener.vue.d.ts.map +1 -0
  42. package/dist/components/ImportCollection/ImportCollectionListener.vue.js +30 -0
  43. package/dist/components/ImportCollection/ImportCollectionListener.vue2.js +4 -0
  44. package/dist/components/ImportCollection/ImportCollectionModal.vue.d.ts +20 -0
  45. package/dist/components/ImportCollection/ImportCollectionModal.vue.d.ts.map +1 -0
  46. package/dist/components/ImportCollection/ImportCollectionModal.vue.js +101 -0
  47. package/dist/components/ImportCollection/ImportCollectionModal.vue2.js +4 -0
  48. package/dist/components/ImportCollection/ImportNowButton.vue.d.ts +22 -0
  49. package/dist/components/ImportCollection/ImportNowButton.vue.d.ts.map +1 -0
  50. package/dist/components/ImportCollection/ImportNowButton.vue.js +85 -0
  51. package/dist/components/ImportCollection/ImportNowButton.vue2.js +4 -0
  52. package/dist/components/ImportCollection/OpenAppButton.vue.d.ts +16 -0
  53. package/dist/components/ImportCollection/OpenAppButton.vue.d.ts.map +1 -0
  54. package/dist/components/ImportCollection/OperationBadge.vue.d.ts +19 -0
  55. package/dist/components/ImportCollection/OperationBadge.vue.d.ts.map +1 -0
  56. package/dist/components/ImportCollection/PasteEventListener.vue.d.ts +7 -0
  57. package/dist/components/ImportCollection/PasteEventListener.vue.d.ts.map +1 -0
  58. package/dist/components/ImportCollection/PasteEventListener.vue.js +24 -0
  59. package/dist/components/ImportCollection/PasteEventListener.vue2.js +4 -0
  60. package/dist/components/ImportCollection/UrlQueryParameterChecker.vue.d.ts +7 -0
  61. package/dist/components/ImportCollection/UrlQueryParameterChecker.vue.d.ts.map +1 -0
  62. package/dist/components/ImportCollection/UrlQueryParameterChecker.vue.js +15 -0
  63. package/dist/components/ImportCollection/UrlQueryParameterChecker.vue2.js +4 -0
  64. package/dist/components/ImportCollection/hooks/useUrlPrefetcher.d.ts +28 -0
  65. package/dist/components/ImportCollection/hooks/useUrlPrefetcher.d.ts.map +1 -0
  66. package/dist/components/ImportCollection/hooks/useUrlPrefetcher.js +55 -0
  67. package/dist/components/ImportCollection/index.d.ts +2 -0
  68. package/dist/components/ImportCollection/index.d.ts.map +1 -0
  69. package/dist/components/ImportCollection/index.js +4 -0
  70. package/dist/components/ImportCollection/utils/getOpenApiDocumentVersion.d.ts +5 -0
  71. package/dist/components/ImportCollection/utils/getOpenApiDocumentVersion.d.ts.map +1 -0
  72. package/dist/components/ImportCollection/utils/getOpenApiDocumentVersion.js +20 -0
  73. package/dist/components/ImportCollection/utils/isDocument.d.ts +3 -0
  74. package/dist/components/ImportCollection/utils/isDocument.d.ts.map +1 -0
  75. package/dist/components/ImportCollection/utils/isDocument.js +7 -0
  76. package/dist/components/ImportCollection/utils/isUrl.d.ts +3 -0
  77. package/dist/components/ImportCollection/utils/isUrl.d.ts.map +1 -0
  78. package/dist/components/ImportCollection/utils/isUrl.js +6 -0
  79. package/dist/components/Sidebar/Actions/DeleteSidebarListElement.vue.d.ts +1 -1
  80. package/dist/layouts/App/ApiClientApp.vue.d.ts.map +1 -1
  81. package/dist/layouts/App/create-api-client-app.d.ts +129 -2
  82. package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
  83. package/dist/layouts/Modal/create-api-client-modal.d.ts +258 -4
  84. package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
  85. package/dist/libs/create-client.d.ts +130 -2
  86. package/dist/libs/create-client.d.ts.map +1 -1
  87. package/dist/libs/create-client.js +54 -41
  88. package/dist/libs/send-request.d.ts +37 -1
  89. package/dist/libs/send-request.d.ts.map +1 -1
  90. package/dist/libs/send-request.js +24 -19
  91. package/dist/router.js +1 -1
  92. package/dist/store/import-spec.d.ts +128 -2
  93. package/dist/store/import-spec.d.ts.map +1 -1
  94. package/dist/store/import-spec.js +24 -23
  95. package/dist/store/store.d.ts +256 -4
  96. package/dist/store/store.d.ts.map +1 -1
  97. package/dist/style.css +1 -1
  98. package/dist/views/Request/Request.vue.d.ts.map +1 -1
  99. package/dist/views/Request/Request.vue.js +1 -1
  100. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.d.ts.map +1 -1
  101. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.js +2 -2
  102. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue2.js +82 -88
  103. package/dist/views/Request/RequestSidebar.vue.d.ts.map +1 -1
  104. package/dist/views/Request/RequestSidebar.vue.js +1 -1
  105. package/dist/views/Request/RequestSidebar.vue2.js +106 -97
  106. package/dist/views/Request/ResponseSection/ResponseEmpty.vue.d.ts.map +1 -1
  107. package/dist/views/Request/ResponseSection/ResponseEmpty.vue.js +1 -1
  108. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +26 -26
  109. package/dist/views/Request/components/WorkspaceDropdown.vue.d.ts.map +1 -1
  110. package/dist/views/Request/components/WorkspaceDropdown.vue.js +39 -39
  111. package/package.json +13 -8
  112. package/dist/views/Components/Schemas/Schemas.vue.d.ts +0 -3
  113. package/dist/views/Components/Schemas/Schemas.vue.d.ts.map +0 -1
@@ -0,0 +1,101 @@
1
+ import { defineComponent as w, computed as d, watch as C, openBlock as l, createBlock as S, unref as o, withCtx as B, createElementVNode as t, toDisplayString as f, createVNode as i, createElementBlock as m, Fragment as I, createCommentVNode as h } from "vue";
2
+ import { useUrlPrefetcher as z } from "./hooks/useUrlPrefetcher.js";
3
+ import { getOpenApiDocumentVersion as _ } from "./utils/getOpenApiDocumentVersion.js";
4
+ import { isDocument as D } from "./utils/isDocument.js";
5
+ import { isUrl as E } from "./utils/isUrl.js";
6
+ import { useModal as F, ScalarModal as U, ScalarIcon as x, ScalarCodeBlock as V } from "@scalar/components";
7
+ import { normalize as A } from "@scalar/openapi-parser";
8
+ import M from "./ImportNowButton.vue.js";
9
+ import N from "../../views/Request/components/WorkspaceDropdown.vue.js";
10
+ import { useWorkspace as $ } from "../../store/store.js";
11
+ import { hotKeyBus as O } from "../../libs/event-busses/hot-keys-bus.js";
12
+ const P = { class: "flex gap-5 flex-col my-24" }, W = { class: "text-center text-xl font-medium" }, j = { class: "flex justify-center" }, K = { class: "inline-block bg-b-2 py-1 px-4 rounded" }, R = {
13
+ key: 0,
14
+ class: "flex gap-2 items-center p-3 font-code text-sm border rounded break-words"
15
+ }, T = { class: "break-all" }, q = { class: "flex gap-2 items-center p-3 font-code text-sm border rounded" }, G = /* @__PURE__ */ t("div", null, "This doesn’t look like a valid OpenAPI/Swagger document.", -1), H = { class: "bg-b-2 h-48 border rounded custom-scroll" }, J = {
16
+ key: 2,
17
+ class: "inline-flex flex-col gap-2 items-center mt-2"
18
+ }, ie = /* @__PURE__ */ w({
19
+ __name: "ImportCollectionModal",
20
+ props: {
21
+ source: {}
22
+ },
23
+ emits: ["importFinished"],
24
+ setup(v) {
25
+ const c = v, { activeWorkspace: k } = $(), { prefetchResult: r, prefetchUrl: g } = z(), s = F();
26
+ O.on(() => {
27
+ s.hide();
28
+ });
29
+ const b = d(() => {
30
+ try {
31
+ return A(
32
+ r.content || c.source || ""
33
+ );
34
+ } catch {
35
+ return;
36
+ }
37
+ }), y = d(() => {
38
+ var e, n;
39
+ return (n = (e = b.value) == null ? void 0 : e.info) == null ? void 0 : n.title;
40
+ }), a = d(
41
+ () => _(r.content || c.source || "")
42
+ );
43
+ return C(
44
+ () => c.source,
45
+ (e) => {
46
+ g(e, k.value.proxyUrl), e && (E(e) || D(e) && _(e)) ? s.show() : s.hide();
47
+ }
48
+ ), (e, n) => (l(), S(o(U), {
49
+ size: "md",
50
+ state: o(s)
51
+ }, {
52
+ default: B(() => {
53
+ var p, u;
54
+ return [
55
+ t("div", P, [
56
+ t("div", W, f(y.value ?? "Import Collection"), 1),
57
+ t("div", j, [
58
+ t("div", K, [
59
+ i(o(N))
60
+ ])
61
+ ]),
62
+ o(r).state !== "loading" && o(r).error ? (l(), m("div", R, [
63
+ i(o(x), {
64
+ class: "text-red flex-shrink-0",
65
+ icon: "Error",
66
+ size: "sm"
67
+ }),
68
+ t("div", T, f(o(r).error), 1)
69
+ ])) : a.value ? h("", !0) : (l(), m(I, { key: 1 }, [
70
+ t("div", q, [
71
+ i(o(x), {
72
+ class: "text-red",
73
+ icon: "Error",
74
+ size: "sm"
75
+ }),
76
+ G
77
+ ]),
78
+ t("div", H, [
79
+ i(o(V), {
80
+ content: ((p = o(r).content) == null ? void 0 : p.trim()) || ((u = c.source) == null ? void 0 : u.trim()) || "",
81
+ copy: !1
82
+ }, null, 8, ["content"])
83
+ ])
84
+ ], 64)),
85
+ a.value ? (l(), m("div", J, [
86
+ i(M, {
87
+ source: e.source,
88
+ variant: "button",
89
+ onImportFinished: n[0] || (n[0] = () => e.$emit("importFinished"))
90
+ }, null, 8, ["source"])
91
+ ])) : h("", !0)
92
+ ])
93
+ ];
94
+ }),
95
+ _: 1
96
+ }, 8, ["state"]));
97
+ }
98
+ });
99
+ export {
100
+ ie as default
101
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./ImportCollectionModal.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,22 @@
1
+ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<{
2
+ source?: string | null;
3
+ variant?: "button" | "link";
4
+ }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
5
+ importFinished: () => void;
6
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<{
7
+ source?: string | null;
8
+ variant?: "button" | "link";
9
+ }>>> & {
10
+ onImportFinished?: (() => any) | undefined;
11
+ }, {}, {}>;
12
+ export default _default;
13
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
14
+ type __VLS_TypePropsToOption<T> = {
15
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
16
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
17
+ } : {
18
+ type: import('vue').PropType<T[K]>;
19
+ required: true;
20
+ };
21
+ };
22
+ //# sourceMappingURL=ImportNowButton.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ImportNowButton.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ImportCollection/ImportNowButton.vue"],"names":[],"mappings":";aAgHW,MAAM,GAAG,IAAI;cACZ,QAAQ,GAAG,MAAM;;;;aADlB,MAAM,GAAG,IAAI;cACZ,QAAQ,GAAG,MAAM;;;;AAkL7B,wBAOG;AAOH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
@@ -0,0 +1,85 @@
1
+ import { defineComponent as y, openBlock as r, createElementBlock as w, Fragment as I, createBlock as m, unref as s, withCtx as u, createVNode as g, createTextVNode as p, createCommentVNode as F } from "vue";
2
+ import { isUrl as _ } from "./utils/isUrl.js";
3
+ import { ScalarButton as l, ScalarIcon as x } from "@scalar/components";
4
+ import { useToasts as B } from "@scalar/use-toasts";
5
+ import { useRouter as b } from "vue-router";
6
+ import { useWorkspace as q } from "../../store/store.js";
7
+ const R = /* @__PURE__ */ y({
8
+ __name: "ImportNowButton",
9
+ props: {
10
+ source: {},
11
+ variant: {}
12
+ },
13
+ emits: ["importFinished"],
14
+ setup(f, { emit: d }) {
15
+ const t = f, k = d, v = b(), { importSpecFromUrl: C, importSpecFile: h, activeWorkspace: o } = q(), { toast: i } = B();
16
+ async function n() {
17
+ try {
18
+ if (t.source) {
19
+ if (_(t.source)) {
20
+ const e = await C(
21
+ t.source,
22
+ void 0,
23
+ void 0,
24
+ o.value.uid
25
+ );
26
+ a(e);
27
+ } else {
28
+ const e = await h(
29
+ t.source,
30
+ o.value.uid
31
+ );
32
+ a(e);
33
+ }
34
+ i("Import successful", "info"), k("importFinished");
35
+ }
36
+ } catch (e) {
37
+ console.error("[importCollection]", e);
38
+ const c = (e == null ? void 0 : e.message) || "Unknown error";
39
+ i(`Import failed: ${c}`, "error");
40
+ }
41
+ }
42
+ function a(e) {
43
+ e && v.push({
44
+ name: "request",
45
+ params: {
46
+ workspace: o.value.uid,
47
+ request: e == null ? void 0 : e.requests[0]
48
+ }
49
+ });
50
+ }
51
+ return (e, c) => e.source ? (r(), w(I, { key: 0 }, [
52
+ e.variant === "button" ? (r(), m(s(l), {
53
+ key: 0,
54
+ class: "px-6 gap-2",
55
+ size: "md",
56
+ type: "button",
57
+ onClick: n
58
+ }, {
59
+ default: u(() => [
60
+ g(s(x), {
61
+ icon: "Import",
62
+ size: "md"
63
+ }),
64
+ p(" Import Collection ")
65
+ ]),
66
+ _: 1
67
+ })) : (r(), m(s(l), {
68
+ key: 1,
69
+ class: "px-6 gap-2 text-c-1",
70
+ size: "md",
71
+ type: "button",
72
+ variant: "ghost",
73
+ onClick: n
74
+ }, {
75
+ default: u(() => [
76
+ p(" Try it in the browser ")
77
+ ]),
78
+ _: 1
79
+ }))
80
+ ], 64)) : F("", !0);
81
+ }
82
+ });
83
+ export {
84
+ R as default
85
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./ImportNowButton.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,16 @@
1
+ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<{
2
+ source?: string | null;
3
+ }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<{
4
+ source?: string | null;
5
+ }>>>, {}, {}>;
6
+ export default _default;
7
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
8
+ type __VLS_TypePropsToOption<T> = {
9
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
10
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
11
+ } : {
12
+ type: import('vue').PropType<T[K]>;
13
+ required: true;
14
+ };
15
+ };
16
+ //# sourceMappingURL=OpenAppButton.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OpenAppButton.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ImportCollection/OpenAppButton.vue"],"names":[],"mappings":";aA0FW,MAAM,GAAG,IAAI;;aAAb,MAAM,GAAG,IAAI;;AA+KxB,wBAMG;AAOH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
@@ -0,0 +1,19 @@
1
+ import { REQUEST_METHODS } from '@scalar/oas-utils/helpers';
2
+ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<{
3
+ method: keyof typeof REQUEST_METHODS;
4
+ name: string;
5
+ }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<{
6
+ method: keyof typeof REQUEST_METHODS;
7
+ name: string;
8
+ }>>>, {}, {}>;
9
+ export default _default;
10
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
11
+ type __VLS_TypePropsToOption<T> = {
12
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
13
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
14
+ } : {
15
+ type: import('vue').PropType<T[K]>;
16
+ required: true;
17
+ };
18
+ };
19
+ //# sourceMappingURL=OperationBadge.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OperationBadge.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ImportCollection/OperationBadge.vue"],"names":[],"mappings":"AAuBA,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;;YAMjD,MAAM,OAAO,eAAe;UAC9B,MAAM;;YADJ,MAAM,OAAO,eAAe;UAC9B,MAAM;;AAqDd,wBAMG;AAOH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
@@ -0,0 +1,7 @@
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
2
+ input: (value: string) => void;
3
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>> & {
4
+ onInput?: ((value: string) => any) | undefined;
5
+ }, {}, {}>;
6
+ export default _default;
7
+ //# sourceMappingURL=PasteEventListener.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PasteEventListener.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ImportCollection/PasteEventListener.vue"],"names":[],"mappings":";;;;;AA2HA,wBAMG"}
@@ -0,0 +1,24 @@
1
+ import { defineComponent as r, onMounted as s, onBeforeUnmount as c } from "vue";
2
+ const u = /* @__PURE__ */ r({
3
+ __name: "PasteEventListener",
4
+ emits: ["input"],
5
+ setup(m, { emit: o }) {
6
+ const i = o;
7
+ s(() => {
8
+ document.addEventListener("paste", n);
9
+ }), c(() => {
10
+ document.removeEventListener("paste", n);
11
+ });
12
+ async function n(e) {
13
+ const t = e.target;
14
+ if (!(t && (t.tagName === "INPUT" || t.tagName === "TEXTAREA" || t.isContentEditable)) && e.clipboardData) {
15
+ const a = e.clipboardData.getData("text");
16
+ a && i("input", a);
17
+ }
18
+ }
19
+ return (e, t) => null;
20
+ }
21
+ });
22
+ export {
23
+ u as default
24
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./PasteEventListener.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,7 @@
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
2
+ input: (input: string) => void;
3
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>> & {
4
+ onInput?: ((input: string) => any) | undefined;
5
+ }, {}, {}>;
6
+ export default _default;
7
+ //# sourceMappingURL=UrlQueryParameterChecker.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UrlQueryParameterChecker.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ImportCollection/UrlQueryParameterChecker.vue"],"names":[],"mappings":";;;;;AA2EA,wBAMG"}
@@ -0,0 +1,15 @@
1
+ import { defineComponent as a, onMounted as o } from "vue";
2
+ const s = /* @__PURE__ */ a({
3
+ __name: "UrlQueryParameterChecker",
4
+ emits: ["input"],
5
+ setup(u, { emit: r }) {
6
+ const t = r;
7
+ return o(() => {
8
+ const e = new URLSearchParams(window.location.search).get("url");
9
+ e && t("input", e);
10
+ }), (n, e) => null;
11
+ }
12
+ });
13
+ export {
14
+ s as default
15
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./UrlQueryParameterChecker.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Fetches an URL and checks whether it could be an OpenAPI document
3
+ */
4
+ export declare function useUrlPrefetcher(): {
5
+ prefetchResult: {
6
+ state: "idle" | "loading";
7
+ content: string | null;
8
+ error: string | null;
9
+ };
10
+ prefetchUrl: (value: string | null, proxy?: string) => Promise<({
11
+ state: "idle" | "loading";
12
+ content: string | null;
13
+ error: string | null;
14
+ } & {
15
+ state: string;
16
+ content: string;
17
+ error: null;
18
+ }) | ({
19
+ state: "idle" | "loading";
20
+ content: string | null;
21
+ error: string | null;
22
+ } & {
23
+ state: string;
24
+ content: null;
25
+ error: any;
26
+ })>;
27
+ };
28
+ //# sourceMappingURL=useUrlPrefetcher.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useUrlPrefetcher.d.ts","sourceRoot":"","sources":["../../../../src/components/ImportCollection/hooks/useUrlPrefetcher.ts"],"names":[],"mappings":"AAUA;;GAEG;AACH,wBAAgB,gBAAgB;;eARvB,MAAM,GAAG,SAAS;iBAChB,MAAM,GAAG,IAAI;eACf,MAAM,GAAG,IAAI;;yBAec,MAAM,GAAG,IAAI,UAAU,MAAM;eAjBxD,MAAM,GAAG,SAAS;iBAChB,MAAM,GAAG,IAAI;eACf,MAAM,GAAG,IAAI;;;;;;eAFb,MAAM,GAAG,SAAS;iBAChB,MAAM,GAAG,IAAI;eACf,MAAM,GAAG,IAAI;;;;;;EA0ErB"}
@@ -0,0 +1,55 @@
1
+ import { isUrl as c } from "../utils/isUrl.js";
2
+ import { redirectToProxy as l } from "@scalar/oas-utils/helpers";
3
+ import { reactive as i } from "vue";
4
+ function m() {
5
+ const e = i({
6
+ state: "idle",
7
+ content: null,
8
+ error: null
9
+ });
10
+ async function s(r, o) {
11
+ if (!r || !c(r))
12
+ return Object.assign(e, {
13
+ state: "idle",
14
+ content: null,
15
+ error: null
16
+ });
17
+ Object.assign(e, {
18
+ state: "loading",
19
+ content: null,
20
+ error: null
21
+ });
22
+ try {
23
+ const t = await fetch(l(o, r), {
24
+ cache: "no-store"
25
+ });
26
+ if (!t.ok)
27
+ return Object.assign(e, {
28
+ state: "idle",
29
+ content: null,
30
+ error: `Couldn’t fetch ${r}, got error ${[t.status, t.statusText].join(" ").trim()}.`
31
+ });
32
+ const n = await t.text();
33
+ return Object.assign(e, {
34
+ state: "idle",
35
+ content: n,
36
+ error: null
37
+ });
38
+ } catch (t) {
39
+ console.error("[prefetchDocument]", t);
40
+ const n = (t == null ? void 0 : t.message) === "Failed to fetch" ? `Couldn’t reach ${r} — is it publicly accessible?` : t == null ? void 0 : t.message;
41
+ return Object.assign(e, {
42
+ state: "idle",
43
+ content: null,
44
+ error: n
45
+ });
46
+ }
47
+ }
48
+ return {
49
+ prefetchResult: e,
50
+ prefetchUrl: s
51
+ };
52
+ }
53
+ export {
54
+ m as useUrlPrefetcher
55
+ };
@@ -0,0 +1,2 @@
1
+ export { default as ImportCollectionListener } from './ImportCollectionListener.vue.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ImportCollection/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,wBAAwB,EAAE,MAAM,gCAAgC,CAAA"}
@@ -0,0 +1,4 @@
1
+ import { default as t } from "./ImportCollectionListener.vue.js";
2
+ export {
3
+ t as ImportCollectionListener
4
+ };
@@ -0,0 +1,5 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,20 @@
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
+ };
@@ -0,0 +1,3 @@
1
+ /** Checks whether the given string could be an OpenAPI document */
2
+ export declare function isDocument(input: string | null): boolean | "" | null;
3
+ //# sourceMappingURL=isDocument.d.ts.map
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,7 @@
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
+ };
@@ -0,0 +1,3 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,6 @@
1
+ function r(t) {
2
+ return t && (t.startsWith("http://") || t.startsWith("https://"));
3
+ }
4
+ export {
5
+ r as isUrl
6
+ };
@@ -8,8 +8,8 @@ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<{
8
8
  variableName: string;
9
9
  warningMessage?: string;
10
10
  }>>> & {
11
- onClose?: (() => any) | undefined;
12
11
  onDelete?: (() => any) | undefined;
12
+ onClose?: (() => any) | undefined;
13
13
  }, {}, {}>;
14
14
  export default _default;
15
15
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
@@ -1 +1 @@
1
- {"version":3,"file":"ApiClientApp.vue.d.ts","sourceRoot":"","sources":["../../../src/layouts/App/ApiClientApp.vue"],"names":[],"mappings":";;cAiI8B,MAAM;aAAO,MAAM;;;;cAAnB,MAAM;aAAO,MAAM;;;AAuMjD,wBAMG"}
1
+ {"version":3,"file":"ApiClientApp.vue.d.ts","sourceRoot":"","sources":["../../../src/layouts/App/ApiClientApp.vue"],"names":[],"mappings":";;cAyI8B,MAAM;aAAO,MAAM;;;;cAAnB,MAAM;aAAO,MAAM;;;AAuMjD,wBAMG"}