@scalar/api-client 2.23.3 → 2.24.0

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 (97) hide show
  1. package/CHANGELOG.md +55 -0
  2. package/dist/layouts/Modal/ApiClientModal.vue.d.ts.map +1 -1
  3. package/dist/layouts/Modal/ApiClientModal.vue.js +2 -2
  4. package/dist/style.css +1 -1
  5. package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts +8 -0
  6. package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts.map +1 -1
  7. package/dist/v2/blocks/operation-block/OperationBlock.vue.js +33 -29
  8. package/dist/v2/blocks/operation-block/components/Header.vue.d.ts +6 -0
  9. package/dist/v2/blocks/operation-block/components/Header.vue.d.ts.map +1 -1
  10. package/dist/v2/blocks/operation-block/components/Header.vue.js +2 -2
  11. package/dist/v2/blocks/operation-block/components/Header.vue2.js +46 -29
  12. package/dist/v2/blocks/request-block/helpers/get-default-headers.js +1 -1
  13. package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue.d.ts +15 -0
  14. package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue.d.ts.map +1 -0
  15. package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue.js +125 -0
  16. package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue2.js +4 -0
  17. package/dist/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.d.ts +5 -1
  18. package/dist/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.d.ts.map +1 -1
  19. package/dist/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.js +61 -61
  20. package/dist/v2/components/sidebar/SidebarMenu.vue.js +6 -6
  21. package/dist/v2/features/app/App.vue.d.ts +5 -0
  22. package/dist/v2/features/app/App.vue.d.ts.map +1 -1
  23. package/dist/v2/features/app/App.vue.js +89 -108
  24. package/dist/v2/features/app/app-state.d.ts +5 -7
  25. package/dist/v2/features/app/app-state.d.ts.map +1 -1
  26. package/dist/v2/features/app/app-state.js +210 -205
  27. package/dist/v2/features/app/hooks/use-document-watcher.js +8 -8
  28. package/dist/v2/features/collection/components/Environment.vue.d.ts.map +1 -1
  29. package/dist/v2/features/collection/components/Environment.vue.js +12 -11
  30. package/dist/v2/features/collection/components/Settings.vue.d.ts.map +1 -1
  31. package/dist/v2/features/collection/components/Settings.vue.js +17 -25
  32. package/dist/v2/features/command-palette/components/CommandPaletteImport.vue.d.ts +1 -1
  33. package/dist/v2/features/command-palette/components/CommandPaletteImport.vue.d.ts.map +1 -1
  34. package/dist/v2/features/command-palette/components/CommandPaletteImport.vue.js +115 -118
  35. package/dist/v2/features/{import-listener → command-palette}/helpers/generate-unique-slug.d.ts.map +1 -1
  36. package/dist/v2/features/command-palette/helpers/get-openapi-from-postman.d.ts +14 -4
  37. package/dist/v2/features/command-palette/helpers/get-openapi-from-postman.d.ts.map +1 -1
  38. package/dist/v2/features/command-palette/helpers/get-openapi-from-postman.js +5 -6
  39. package/dist/v2/features/{import-listener → command-palette}/helpers/import-document-to-workspace.d.ts.map +1 -1
  40. package/dist/v2/features/command-palette/helpers/load-document-from-source.d.ts +16 -0
  41. package/dist/v2/features/command-palette/helpers/load-document-from-source.d.ts.map +1 -0
  42. package/dist/v2/features/command-palette/helpers/load-document-from-source.js +34 -0
  43. package/dist/v2/features/command-palette/index.d.ts +4 -0
  44. package/dist/v2/features/command-palette/index.d.ts.map +1 -0
  45. package/dist/v2/features/command-palette/index.js +8 -0
  46. package/dist/v2/features/environments/EnvironmentsList.vue.d.ts +4 -0
  47. package/dist/v2/features/environments/EnvironmentsList.vue.d.ts.map +1 -1
  48. package/dist/v2/features/environments/EnvironmentsList.vue.js +29 -27
  49. package/dist/v2/features/environments/components/Environment.vue.d.ts +1 -0
  50. package/dist/v2/features/environments/components/Environment.vue.d.ts.map +1 -1
  51. package/dist/v2/features/environments/components/Environment.vue.js +37 -24
  52. package/dist/v2/features/modal/Modal.vue.d.ts.map +1 -1
  53. package/dist/v2/features/modal/Modal.vue.js +1 -1
  54. package/dist/v2/features/modal/Modal.vue2.js +35 -36
  55. package/dist/v2/features/modal/helpers/create-api-client-modal.d.ts.map +1 -1
  56. package/dist/v2/features/modal/helpers/create-api-client-modal.js +58 -41
  57. package/dist/v2/features/modal/helpers/restore-workspace-state.d.ts +18 -0
  58. package/dist/v2/features/modal/helpers/restore-workspace-state.d.ts.map +1 -0
  59. package/dist/v2/features/modal/helpers/restore-workspace-state.js +36 -0
  60. package/dist/v2/features/operation/Operation.vue.d.ts.map +1 -1
  61. package/dist/v2/features/operation/Operation.vue.js +35 -26
  62. package/dist/v2/workspace-events.d.ts.map +1 -1
  63. package/dist/v2/workspace-events.js +7 -0
  64. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  65. package/package.json +20 -20
  66. package/dist/v2/features/import-listener/ImportListener.vue.d.ts +0 -52
  67. package/dist/v2/features/import-listener/ImportListener.vue.d.ts.map +0 -1
  68. package/dist/v2/features/import-listener/ImportListener.vue.js +0 -91
  69. package/dist/v2/features/import-listener/ImportListener.vue2.js +0 -4
  70. package/dist/v2/features/import-listener/components/DropEventListener.vue.d.ts +0 -7
  71. package/dist/v2/features/import-listener/components/DropEventListener.vue.d.ts.map +0 -1
  72. package/dist/v2/features/import-listener/components/DropEventListener.vue.js +0 -81
  73. package/dist/v2/features/import-listener/components/DropEventListener.vue2.js +0 -4
  74. package/dist/v2/features/import-listener/components/ImportModal.vue.d.ts +0 -40
  75. package/dist/v2/features/import-listener/components/ImportModal.vue.d.ts.map +0 -1
  76. package/dist/v2/features/import-listener/components/ImportModal.vue.js +0 -170
  77. package/dist/v2/features/import-listener/components/ImportModal.vue3.js +0 -5
  78. package/dist/v2/features/import-listener/components/WorkspaceSelector.vue.d.ts +0 -29
  79. package/dist/v2/features/import-listener/components/WorkspaceSelector.vue.d.ts.map +0 -1
  80. package/dist/v2/features/import-listener/components/WorkspaceSelector.vue.js +0 -83
  81. package/dist/v2/features/import-listener/components/WorkspaceSelector.vue2.js +0 -4
  82. package/dist/v2/features/import-listener/helpers/get-url-query-parameter.d.ts +0 -8
  83. package/dist/v2/features/import-listener/helpers/get-url-query-parameter.d.ts.map +0 -1
  84. package/dist/v2/features/import-listener/helpers/get-url-query-parameter.js +0 -4
  85. package/dist/v2/features/import-listener/helpers/load-document-from-source.d.ts +0 -15
  86. package/dist/v2/features/import-listener/helpers/load-document-from-source.d.ts.map +0 -1
  87. package/dist/v2/features/import-listener/helpers/load-document-from-source.js +0 -28
  88. package/dist/v2/features/import-listener/helpers/wait-for-condition.d.ts +0 -15
  89. package/dist/v2/features/import-listener/helpers/wait-for-condition.d.ts.map +0 -1
  90. package/dist/v2/features/import-listener/helpers/wait-for-condition.js +0 -16
  91. package/dist/v2/features/import-listener/index.d.ts +0 -2
  92. package/dist/v2/features/import-listener/index.d.ts.map +0 -1
  93. package/dist/v2/features/import-listener/index.js +0 -4
  94. /package/dist/v2/features/{import-listener → command-palette}/helpers/generate-unique-slug.d.ts +0 -0
  95. /package/dist/v2/features/{import-listener → command-palette}/helpers/generate-unique-slug.js +0 -0
  96. /package/dist/v2/features/{import-listener → command-palette}/helpers/import-document-to-workspace.d.ts +0 -0
  97. /package/dist/v2/features/{import-listener → command-palette}/helpers/import-document-to-workspace.js +0 -0
@@ -1,170 +0,0 @@
1
- import { defineComponent as W, ref as w, computed as d, watch as y, onUnmounted as N, createBlock as V, openBlock as s, unref as m, withCtx as b, createElementVNode as e, normalizeClass as M, createElementBlock as n, Fragment as k, createTextVNode as u, createCommentVNode as f, toDisplayString as O, createVNode as p } from "vue";
2
- import { ScalarModal as j, ScalarButton as B, ScalarIcon as T } from "@scalar/components";
3
- import { createWorkspaceStore as U } from "@scalar/workspace-store/client";
4
- import z from "../../../../components/CommandPalette/WatchModeToggle.vue.js";
5
- import E from "./WorkspaceSelector.vue.js";
6
- import { loadDocumentFromSource as F } from "../helpers/load-document-from-source.js";
7
- import { isUrl as g } from "../../../helpers/is-url.js";
8
- const q = { class: "relative flex h-screen flex-col justify-center overflow-hidden px-6 md:px-0" }, R = {
9
- key: 0,
10
- class: "w-full text-center text-sm font-medium break-words"
11
- }, $ = ["href"], G = {
12
- key: 1,
13
- class: "w-full text-center text-sm font-medium break-words"
14
- }, H = ["src"], J = {
15
- key: 1,
16
- class: "text-md mb-2 line-clamp-1 text-center font-bold"
17
- }, K = { class: "z-10 inline-flex w-full flex-col items-center gap-2" }, Q = { class: "flex justify-center" }, X = { class: "text-c-3 inline-flex items-center px-4 py-1 text-xs font-medium" }, Y = {
18
- key: 0,
19
- class: "mt-5 overflow-hidden border-t pt-4 text-sm"
20
- }, Z = { class: "flex items-center justify-center" }, _ = { class: "flex flex-col items-center justify-center pb-8" }, ee = { class: "flex flex-col items-center text-center" }, te = { class: "mb-2 flex h-10 w-10 items-center justify-center rounded-[10px] border" }, oe = {
21
- href: "https://scalar.com/download",
22
- target: "_blank"
23
- }, h = "draft", de = /* @__PURE__ */ W({
24
- __name: "ImportModal",
25
- props: {
26
- source: {},
27
- modalState: {},
28
- companyLogo: {},
29
- isLoading: { type: Boolean, default: !1 },
30
- activeWorkspace: {},
31
- workspaces: {}
32
- },
33
- emits: ["import:document", "select:workspace", "create:workspace"],
34
- setup(o, { emit: I }) {
35
- const x = I, l = w("idle"), c = w(!1), i = U(), S = d(
36
- () => i.workspace.activeDocument?.info.title || "Untitled Document"
37
- ), A = d(
38
- () => !!i.workspace.activeDocument?.info.version
39
- ), C = d(() => o.source && g(o.source)), D = d(() => l.value === "loading"), v = (a) => {
40
- a && o.modalState.open ? document.body.classList.add("has-import-url") : document.body.classList.remove("has-import-url");
41
- }, L = async (a) => {
42
- if (!a)
43
- return l.value = "idle", c.value = !1, v(!1);
44
- if (v(!0), l.value = "loading", !await F(
45
- i,
46
- o.source,
47
- h,
48
- c.value
49
- )) {
50
- l.value = "error";
51
- return;
52
- }
53
- l.value = "success";
54
- }, P = () => {
55
- x(
56
- "import:document",
57
- i.exportWorkspace(),
58
- h
59
- );
60
- };
61
- return y(() => o.modalState.open, L), y(c, (a) => {
62
- i.updateDocument("active", "x-scalar-watch-mode", a);
63
- }), N(() => v(!1)), (a, t) => (s(), V(m(j), {
64
- size: "full",
65
- state: o.modalState
66
- }, {
67
- default: b(() => [
68
- e("div", q, [
69
- t[10] || (t[10] = e("div", { class: "section-flare" }, [
70
- e("div", { class: "section-flare-item" }),
71
- e("div", { class: "section-flare-item" }),
72
- e("div", { class: "section-flare-item" }),
73
- e("div", { class: "section-flare-item" }),
74
- e("div", { class: "section-flare-item" }),
75
- e("div", { class: "section-flare-item" }),
76
- e("div", { class: "section-flare-item" }),
77
- e("div", { class: "section-flare-item" })
78
- ], -1)),
79
- e("div", {
80
- class: M(["m-auto flex w-full max-w-[380px] flex-col items-center rounded-xl border px-8 py-8 transition-opacity", { "opacity-0": D.value }])
81
- }, [
82
- l.value === "error" ? (s(), n(k, { key: 0 }, [
83
- t[4] || (t[4] = e("div", { class: "text-md mb-2 line-clamp-1 text-center font-bold" }, " No OpenAPI document found ", -1)),
84
- o.source && m(g)(o.source) ? (s(), n("div", R, [
85
- t[3] || (t[3] = u(" We couldn't find an OpenAPI document at the provided URL. Please download and import the ", -1)),
86
- e("a", {
87
- href: o.source,
88
- rel: "noopener nofollow",
89
- target: "_blank",
90
- textContent: "OpenAPI document manually"
91
- }, null, 8, $)
92
- ])) : (s(), n("div", G, " We can't import this document because it's not a valid OpenAPI document. "))
93
- ], 64)) : (s(), n(k, { key: 1 }, [
94
- o.companyLogo ? (s(), n("img", {
95
- key: 0,
96
- alt: "Company Logo",
97
- class: "mb-2 w-full object-contain",
98
- src: o.companyLogo
99
- }, null, 8, H)) : f("", !0),
100
- o.companyLogo ? f("", !0) : (s(), n("div", J, O(S.value), 1)),
101
- t[8] || (t[8] = e("div", { class: "text-c-1 text-center text-sm font-medium text-balance" }, " Import the OpenAPI document to instantly send API requests. No signup required. ", -1)),
102
- A.value ? (s(), n(k, { key: 2 }, [
103
- e("div", K, [
104
- p(m(B), {
105
- class: "mt-3 h-fit w-full rounded-lg px-6 py-2.5 font-bold",
106
- disabled: o.isLoading,
107
- size: "md",
108
- type: "button",
109
- onClick: P
110
- }, {
111
- default: b(() => [...t[5] || (t[5] = [
112
- u(" Import Collection ", -1)
113
- ])]),
114
- _: 1
115
- }, 8, ["disabled"])
116
- ]),
117
- e("div", Q, [
118
- e("div", X, [
119
- t[6] || (t[6] = u(" Import to: ", -1)),
120
- p(E, {
121
- activeWorkspace: o.activeWorkspace,
122
- workspaces: o.workspaces,
123
- "onCreate:workspace": t[0] || (t[0] = (r) => x("create:workspace", r)),
124
- "onSelect:workspace": t[1] || (t[1] = (r) => x("select:workspace", r))
125
- }, null, 8, ["activeWorkspace", "workspaces"])
126
- ])
127
- ]),
128
- C.value ? (s(), n("div", Y, [
129
- e("div", Z, [
130
- p(z, {
131
- modelValue: c.value,
132
- "onUpdate:modelValue": t[2] || (t[2] = (r) => c.value = r),
133
- disableToolTip: !0
134
- }, null, 8, ["modelValue"])
135
- ]),
136
- t[7] || (t[7] = e("div", { class: "text-c-3 pt-0 text-center text-xs font-medium text-balance" }, " Automatically update your API client when the OpenAPI document content changes. ", -1))
137
- ])) : f("", !0)
138
- ], 64)) : f("", !0)
139
- ], 64))
140
- ], 2),
141
- e("div", _, [
142
- e("div", ee, [
143
- e("div", te, [
144
- e("a", oe, [
145
- p(m(T), {
146
- icon: "Logo",
147
- size: "xl"
148
- })
149
- ])
150
- ]),
151
- t[9] || (t[9] = e("span", { class: "text-c-2 text-sm leading-snug font-medium" }, [
152
- e("a", {
153
- class: "hover:text-c-1 mb-1 inline-block underline-offset-2",
154
- href: "https://scalar.com/download",
155
- target: "_blank"
156
- }, " Download Desktop App "),
157
- e("br"),
158
- u(" free · open-source · offline first ")
159
- ], -1))
160
- ])
161
- ])
162
- ])
163
- ]),
164
- _: 1
165
- }, 8, ["state"]));
166
- }
167
- });
168
- export {
169
- de as default
170
- };
@@ -1,5 +0,0 @@
1
- import o from "./ImportModal.vue.js";
2
- /* empty css */
3
- export {
4
- o as default
5
- };
@@ -1,29 +0,0 @@
1
- import { type ScalarListboxOption } from '@scalar/components';
2
- type __VLS_Props = {
3
- /**
4
- * The currently active workspace.
5
- * This represents the workspace that the user is currently working in.
6
- */
7
- activeWorkspace: {
8
- id: string;
9
- label: string;
10
- } | null;
11
- /**
12
- * The list of all available workspaces.
13
- * Used to render options for workspace switching and selection.
14
- */
15
- workspaces: ScalarListboxOption[];
16
- };
17
- declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
18
- "create:workspace": (payload: {
19
- name: string;
20
- }) => any;
21
- "select:workspace": (id?: string | undefined) => any;
22
- }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
23
- "onCreate:workspace"?: ((payload: {
24
- name: string;
25
- }) => any) | undefined;
26
- "onSelect:workspace"?: ((id?: string | undefined) => any) | undefined;
27
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
28
- export default _default;
29
- //# sourceMappingURL=WorkspaceSelector.vue.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"WorkspaceSelector.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/import-listener/components/WorkspaceSelector.vue"],"names":[],"mappings":"AAkGA,OAAO,EAOL,KAAK,mBAAmB,EACzB,MAAM,oBAAoB,CAAA;AAI3B,KAAK,WAAW,GAAG;IACjB;;;OAGG;IACH,eAAe,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAA;IACrD;;;OAGG;IACH,UAAU,EAAE,mBAAmB,EAAE,CAAA;CAClC,CAAC;;;cAOyC,MAAM;;;;;cAAN,MAAM;;;;AAwPjD,wBAOG"}
@@ -1,83 +0,0 @@
1
- import { defineComponent as w, createElementBlock as p, openBlock as i, createVNode as t, unref as e, withCtx as l, createElementVNode as o, toDisplayString as m, Fragment as x, renderList as k, createBlock as h, withModifiers as v, normalizeClass as _ } from "vue";
2
- import { useModal as g, ScalarDropdown as C, ScalarButton as b, ScalarIcon as n, ScalarDropdownItem as f, ScalarDropdownDivider as S } from "@scalar/components";
3
- import y from "../../app/components/CreateWorkspaceModal.vue.js";
4
- const D = { class: "flex w-[inherit] items-center text-base" }, W = { class: "m-0 flex items-center gap-1 text-sm font-medium" }, z = { class: "line-clamp-1 w-[calc(100%-10px)] text-left text-xs" }, B = { class: "overflow-hidden text-ellipsis" }, j = { class: "flex h-4 w-4 items-center justify-center" }, V = /* @__PURE__ */ w({
5
- __name: "WorkspaceSelector",
6
- props: {
7
- activeWorkspace: {},
8
- workspaces: {}
9
- },
10
- emits: ["select:workspace", "create:workspace"],
11
- setup(r, { emit: u }) {
12
- const c = u, d = g();
13
- return (M, a) => (i(), p("div", D, [
14
- t(e(C), null, {
15
- items: l(() => [
16
- (i(!0), p(x, null, k(r.workspaces, (s) => (i(), h(e(f), {
17
- key: s.id,
18
- class: "group/item flex w-full items-center gap-1.5 overflow-hidden text-ellipsis whitespace-nowrap",
19
- onClick: v((N) => c("select:workspace", s.id), ["stop"])
20
- }, {
21
- default: l(() => [
22
- o("div", {
23
- class: _([
24
- "flex h-4 w-4 items-center justify-center rounded-full p-[3px]",
25
- r.activeWorkspace?.id === s.id ? "bg-c-accent text-b-1" : "shadow-border text-transparent"
26
- ])
27
- }, [
28
- t(e(n), {
29
- class: "size-2.5",
30
- icon: "Checkmark",
31
- thickness: "3"
32
- })
33
- ], 2),
34
- o("span", B, m(s.label), 1)
35
- ]),
36
- _: 2
37
- }, 1032, ["onClick"]))), 128)),
38
- t(e(S)),
39
- t(e(f), {
40
- class: "flex items-center gap-1.5",
41
- onClick: a[0] || (a[0] = (s) => e(d).show())
42
- }, {
43
- default: l(() => [
44
- o("div", j, [
45
- t(e(n), {
46
- icon: "Add",
47
- size: "sm"
48
- })
49
- ]),
50
- a[2] || (a[2] = o("span", null, "New Workspace", -1))
51
- ]),
52
- _: 1
53
- })
54
- ]),
55
- default: l(() => [
56
- t(e(b), {
57
- class: "hover:bg-b-2 text-c-3 line-clamp-1 h-full w-fit justify-start px-1.5 py-1 font-normal",
58
- variant: "ghost"
59
- }, {
60
- default: l(() => [
61
- o("div", W, [
62
- o("h2", z, m(r.activeWorkspace?.label), 1),
63
- t(e(n), {
64
- icon: "ChevronDown",
65
- size: "md"
66
- })
67
- ])
68
- ]),
69
- _: 1
70
- })
71
- ]),
72
- _: 1
73
- }),
74
- t(e(y), {
75
- state: e(d),
76
- "onCreate:workspace": a[1] || (a[1] = (s) => c("create:workspace", s))
77
- }, null, 8, ["state"])
78
- ]));
79
- }
80
- });
81
- export {
82
- V as default
83
- };
@@ -1,4 +0,0 @@
1
- import f from "./WorkspaceSelector.vue.js";
2
- export {
3
- f as default
4
- };
@@ -1,8 +0,0 @@
1
- /**
2
- * Gets the value of a specific query parameter from the current URL.
3
- *
4
- * @param parameterName - The name of the query parameter to retrieve
5
- * @returns The value of the query parameter, or null if it does not exist
6
- */
7
- export declare const getUrlQueryParameter: (parameterName: string) => string | null;
8
- //# sourceMappingURL=get-url-query-parameter.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-url-query-parameter.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/import-listener/helpers/get-url-query-parameter.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,GAAI,eAAe,MAAM,KAAG,MAAM,GAAG,IAGrE,CAAA"}
@@ -1,4 +0,0 @@
1
- const a = (e) => new URLSearchParams(window.location.search).get(e);
2
- export {
3
- a as getUrlQueryParameter
4
- };
@@ -1,15 +0,0 @@
1
- import type { WorkspaceStore } from '@scalar/workspace-store/client';
2
- /**
3
- * Loads a document from a given source (URL or raw content) and adds it to the workspace.
4
- *
5
- * - If the source is a URL, adds the document from the URL and enables/disables watch mode as requested.
6
- * - If the source is raw content (like pasted JSON/YAML), normalizes and adds it as a document.
7
- *
8
- * @param workspaceStore The workspace store to add the document to
9
- * @param source The source to load the document from (URL or raw content)
10
- * @param name The name of the document
11
- * @param watchMode Whether to enable watch mode for URL sources
12
- * @returns Promise resolving to true if the document is added successfully, false otherwise
13
- */
14
- export declare const loadDocumentFromSource: (workspaceStore: WorkspaceStore, source: string | null, name: string, watchMode: boolean) => Promise<boolean>;
15
- //# sourceMappingURL=load-document-from-source.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"load-document-from-source.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/import-listener/helpers/load-document-from-source.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AAIpE;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,sBAAsB,GACjC,gBAAgB,cAAc,EAC9B,QAAQ,MAAM,GAAG,IAAI,EACrB,MAAM,MAAM,EACZ,WAAW,OAAO,KACjB,OAAO,CAAC,OAAO,CAqCjB,CAAA"}
@@ -1,28 +0,0 @@
1
- import { normalize as m } from "@scalar/openapi-parser";
2
- import { isUrl as i } from "../../../helpers/is-url.js";
3
- const f = async (r, t, n, o) => {
4
- if (!t)
5
- return !1;
6
- if (i(t))
7
- return await r.addDocument({
8
- name: n,
9
- url: t,
10
- meta: {
11
- "x-scalar-watch-mode": o
12
- }
13
- });
14
- const e = ((a) => {
15
- try {
16
- return m(a);
17
- } catch (l) {
18
- return console.error(l), null;
19
- }
20
- })(t);
21
- return e === null ? !1 : await r.addDocument({
22
- name: n,
23
- document: e
24
- });
25
- };
26
- export {
27
- f as loadDocumentFromSource
28
- };
@@ -1,15 +0,0 @@
1
- /**
2
- * Waits for a condition to be true with a timeout.
3
- * Checks the condition at a specified interval up to a maximum wait time.
4
- *
5
- * @param checkCondition - Function that returns true when the condition is met
6
- * @param options - Configuration options
7
- * @param options.checkInterval - Time in milliseconds between checks (default: 100)
8
- * @param options.maxWaitTime - Maximum time in milliseconds to wait (default: 3000)
9
- * @returns Promise that resolves to true if the condition is met, false if it timed out
10
- */
11
- export declare const waitForCondition: (checkCondition: () => boolean, options?: {
12
- checkInterval?: number;
13
- maxWaitTime?: number;
14
- }) => Promise<boolean>;
15
- //# sourceMappingURL=wait-for-condition.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"wait-for-condition.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/import-listener/helpers/wait-for-condition.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,eAAO,MAAM,gBAAgB,GAC3B,gBAAgB,MAAM,OAAO,EAC7B,UAAS;IACP,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,WAAW,CAAC,EAAE,MAAM,CAAA;CAChB,KACL,OAAO,CAAC,OAAO,CAuBjB,CAAA"}
@@ -1,16 +0,0 @@
1
- const s = (t, l = {}) => {
2
- const { checkInterval: r = 100, maxWaitTime: i = 3e3 } = l;
3
- return new Promise((e) => {
4
- if (t()) {
5
- e(!0);
6
- return;
7
- }
8
- let a = 0;
9
- const n = setInterval(() => {
10
- a += r, t() ? (clearInterval(n), e(!0)) : a >= i && (clearInterval(n), e(!1));
11
- }, r);
12
- });
13
- };
14
- export {
15
- s as waitForCondition
16
- };
@@ -1,2 +0,0 @@
1
- export { default as ImportListener } from './ImportListener.vue.js';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/import-listener/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,sBAAsB,CAAA"}
@@ -1,4 +0,0 @@
1
- import { default as t } from "./ImportListener.vue.js";
2
- export {
3
- t as ImportListener
4
- };