@burdenoff/fe-libs 2026.1112.1 → 2026.1112.3
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.
|
@@ -58,6 +58,27 @@ export interface ConnectionsApiOptions {
|
|
|
58
58
|
export declare function normalizeAuthType(value: unknown): ProviderAuthType;
|
|
59
59
|
export declare function mapAuthMethod(raw: unknown): ConnectionAuthMethod;
|
|
60
60
|
export declare function mapProvider(raw: unknown): ConnectionProvider;
|
|
61
|
+
/** The most providers the service returns in one page. */
|
|
62
|
+
export declare const PROVIDER_PAGE_SIZE = 100;
|
|
63
|
+
/** Upper bound on pages read for one list: 20 × 100 = 2,000 providers. */
|
|
64
|
+
export declare const MAX_PROVIDER_PAGES = 20;
|
|
65
|
+
/** One page of `getProviders` / `getProviderCatalog`. */
|
|
66
|
+
export interface ProviderPage {
|
|
67
|
+
items?: unknown[] | null;
|
|
68
|
+
hasMore?: boolean | null;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Every provider of a list, read page by page. The service caps a page at
|
|
72
|
+
* {@link PROVIDER_PAGE_SIZE} rows and the catalog has outgrown one page, so a
|
|
73
|
+
* single request left every provider with a late display order out of the
|
|
74
|
+
* picker, and its search could not find them (BOFF-11224).
|
|
75
|
+
*
|
|
76
|
+
* Reading stops when the service reports no further page, when a page adds no
|
|
77
|
+
* provider not already read (a server that ignored the offset would otherwise
|
|
78
|
+
* repeat page one), or after {@link MAX_PROVIDER_PAGES}. A failed first page
|
|
79
|
+
* is the caller's error; a failed later page keeps the providers read so far.
|
|
80
|
+
*/
|
|
81
|
+
export declare function readAllProviderPages(readPage: (offset: number) => Promise<ProviderPage | null | undefined>): Promise<unknown[]>;
|
|
61
82
|
/**
|
|
62
83
|
* Throw an operation's error. Host clients are configured with
|
|
63
84
|
* `errorPolicy: 'all'`, so a failed call RESOLVES with the failure in
|
package/dist/connections/api.js
CHANGED
|
@@ -10,6 +10,7 @@ var n = "\n id\n key\n name\n description\n category\n authType\n icon\n
|
|
|
10
10
|
items {
|
|
11
11
|
${n}
|
|
12
12
|
}
|
|
13
|
+
hasMore
|
|
13
14
|
}
|
|
14
15
|
}
|
|
15
16
|
`, i = t`
|
|
@@ -18,6 +19,7 @@ var n = "\n id\n key\n name\n description\n category\n authType\n icon\n
|
|
|
18
19
|
items {
|
|
19
20
|
${n}
|
|
20
21
|
}
|
|
22
|
+
hasMore
|
|
21
23
|
}
|
|
22
24
|
}
|
|
23
25
|
`, a = t`
|
|
@@ -170,22 +172,49 @@ function T(e) {
|
|
|
170
172
|
} : null;
|
|
171
173
|
}
|
|
172
174
|
function E(e) {
|
|
175
|
+
let t = g(e).id;
|
|
176
|
+
return typeof t == "string" && t ? t : void 0;
|
|
177
|
+
}
|
|
178
|
+
async function D(e) {
|
|
179
|
+
let t = /* @__PURE__ */ new Set(), n = async (r, i) => {
|
|
180
|
+
let a;
|
|
181
|
+
try {
|
|
182
|
+
a = await e(r * 100);
|
|
183
|
+
} catch (e) {
|
|
184
|
+
if (r === 0) throw e;
|
|
185
|
+
return i;
|
|
186
|
+
}
|
|
187
|
+
let o = (a?.items ?? []).filter((e) => {
|
|
188
|
+
let n = E(e);
|
|
189
|
+
return !n || !t.has(n) && (t.add(n), !0);
|
|
190
|
+
}), s = [...i, ...o];
|
|
191
|
+
return a?.hasMore === !0 && o.length > 0 && r + 1 < 20 ? n(r + 1, s) : s;
|
|
192
|
+
};
|
|
193
|
+
return n(0, []);
|
|
194
|
+
}
|
|
195
|
+
function O(e) {
|
|
173
196
|
if (e.error) throw e.error instanceof Error ? e.error : /* @__PURE__ */ Error("The request failed");
|
|
174
197
|
return e.data ?? null;
|
|
175
198
|
}
|
|
176
|
-
function
|
|
177
|
-
let n = async (t, n, r = {}) =>
|
|
199
|
+
function k(e, t = {}) {
|
|
200
|
+
let n = async (t, n, r = {}) => O(await e.query({
|
|
178
201
|
query: t,
|
|
179
202
|
variables: n,
|
|
180
203
|
fetchPolicy: "network-only",
|
|
181
204
|
...r.fresh ? { context: { queryDeduplication: !1 } } : {}
|
|
182
|
-
})), s = async (t, n) =>
|
|
205
|
+
})), s = async (t, n) => O(await e.mutate({
|
|
183
206
|
mutation: t,
|
|
184
207
|
variables: n
|
|
185
208
|
}));
|
|
186
209
|
return {
|
|
187
210
|
async listProviders(e) {
|
|
188
|
-
return
|
|
211
|
+
return (await D(async (t) => {
|
|
212
|
+
let a = {
|
|
213
|
+
limit: 100,
|
|
214
|
+
offset: t
|
|
215
|
+
};
|
|
216
|
+
return e === "catalog" ? (await n(i, { pagination: a }))?.getProviderCatalog : (await n(r, { pagination: a }))?.getProviders;
|
|
217
|
+
})).map(w);
|
|
189
218
|
},
|
|
190
219
|
async getProvider({ id: e, key: t }) {
|
|
191
220
|
if (e) {
|
|
@@ -256,4 +285,4 @@ function D(e, t = {}) {
|
|
|
256
285
|
}
|
|
257
286
|
};
|
|
258
287
|
}
|
|
259
|
-
export {
|
|
288
|
+
export { k as createConnectionsApi, C as mapAuthMethod, w as mapProvider, x as normalizeAuthType, D as readAllProviderPages, O as unwrap };
|
|
@@ -194,8 +194,8 @@ function f(e, t, n, r) {
|
|
|
194
194
|
case "aitoolevent": return "/vibecontrols/agents";
|
|
195
195
|
case "workspace": return `/workspaces/${t}`;
|
|
196
196
|
case "project": return n ? `/workspaces/${n}/projects/${t}` : `/projects/${t}`;
|
|
197
|
+
case "file": return `/files/preview/${encodeURIComponent(t)}`;
|
|
197
198
|
case "document":
|
|
198
|
-
case "file":
|
|
199
199
|
case "page": return `/docs/${t}`;
|
|
200
200
|
case "task": return `/tasks/${t}`;
|
|
201
201
|
case "universaltag":
|