@openbeam/sdk 0.1.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.
- package/README.md +271 -0
- package/dist/index.d.ts +720 -0
- package/dist/index.js +497 -0
- package/package.json +46 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,720 @@
|
|
|
1
|
+
//#region src/types.d.ts
|
|
2
|
+
interface OpenBeamConfig {
|
|
3
|
+
apiKey: string;
|
|
4
|
+
baseUrl?: string;
|
|
5
|
+
timeout?: number;
|
|
6
|
+
maxRetries?: number;
|
|
7
|
+
}
|
|
8
|
+
interface RequestOptions {
|
|
9
|
+
signal?: AbortSignal;
|
|
10
|
+
timeout?: number;
|
|
11
|
+
}
|
|
12
|
+
interface SearchResult {
|
|
13
|
+
id: string;
|
|
14
|
+
title: string | null;
|
|
15
|
+
snippet: string | null;
|
|
16
|
+
source: string | null;
|
|
17
|
+
connectorType: string | null;
|
|
18
|
+
documentType: string | null;
|
|
19
|
+
sourceName: string | null;
|
|
20
|
+
sourceType: string | null;
|
|
21
|
+
authorName: string | null;
|
|
22
|
+
authorEmail: string | null;
|
|
23
|
+
authorAvatarUrl: string | null;
|
|
24
|
+
url: string | null;
|
|
25
|
+
score: number | null;
|
|
26
|
+
createdAt: string | null;
|
|
27
|
+
updatedAt: string | null;
|
|
28
|
+
}
|
|
29
|
+
interface SearchDocumentsOptions extends RequestOptions {
|
|
30
|
+
limit?: number;
|
|
31
|
+
cursor?: string;
|
|
32
|
+
connectorTypes?: string[];
|
|
33
|
+
documentTypes?: string[];
|
|
34
|
+
authorIds?: string[];
|
|
35
|
+
ranking?: "hybrid" | "semantic" | "bm25" | "recency";
|
|
36
|
+
dateFrom?: string;
|
|
37
|
+
dateTo?: string;
|
|
38
|
+
}
|
|
39
|
+
interface SearchDocumentsResponse {
|
|
40
|
+
meta: {
|
|
41
|
+
query: string;
|
|
42
|
+
totalResults: number;
|
|
43
|
+
returned: number;
|
|
44
|
+
hasNextPage: boolean;
|
|
45
|
+
nextCursor: string | null;
|
|
46
|
+
ranking: string;
|
|
47
|
+
queryTimeMs?: number;
|
|
48
|
+
embeddingTimeMs?: number;
|
|
49
|
+
connectorFacets?: Record<string, number>;
|
|
50
|
+
};
|
|
51
|
+
data: SearchResult[];
|
|
52
|
+
}
|
|
53
|
+
interface PersonResult {
|
|
54
|
+
id: string;
|
|
55
|
+
name: string | null;
|
|
56
|
+
email: string | null;
|
|
57
|
+
title: string | null;
|
|
58
|
+
department: string | null;
|
|
59
|
+
avatarUrl: string | null;
|
|
60
|
+
connectorType: string | null;
|
|
61
|
+
documentCount?: number;
|
|
62
|
+
}
|
|
63
|
+
interface SearchPeopleOptions extends RequestOptions {
|
|
64
|
+
limit?: number;
|
|
65
|
+
connectorTypes?: string[];
|
|
66
|
+
}
|
|
67
|
+
interface SearchPeopleResponse {
|
|
68
|
+
data: PersonResult[];
|
|
69
|
+
}
|
|
70
|
+
interface RecentResult {
|
|
71
|
+
id: string;
|
|
72
|
+
title: string | null;
|
|
73
|
+
connectorType: string | null;
|
|
74
|
+
documentType: string | null;
|
|
75
|
+
authorName: string | null;
|
|
76
|
+
url: string | null;
|
|
77
|
+
createdAt: string | null;
|
|
78
|
+
}
|
|
79
|
+
interface SearchRecentOptions extends RequestOptions {
|
|
80
|
+
hours?: number;
|
|
81
|
+
connectorTypes?: string[];
|
|
82
|
+
limit?: number;
|
|
83
|
+
}
|
|
84
|
+
interface SearchRecentResponse {
|
|
85
|
+
meta: {
|
|
86
|
+
hours: number;
|
|
87
|
+
totalResults: number;
|
|
88
|
+
hasNextPage: boolean;
|
|
89
|
+
};
|
|
90
|
+
data: RecentResult[];
|
|
91
|
+
}
|
|
92
|
+
interface SearchSemanticOptions extends RequestOptions {
|
|
93
|
+
limit?: number;
|
|
94
|
+
connectorTypes?: string[];
|
|
95
|
+
}
|
|
96
|
+
interface SearchSemanticResponse {
|
|
97
|
+
meta: {
|
|
98
|
+
query: string;
|
|
99
|
+
totalResults: number;
|
|
100
|
+
ranking: "semantic";
|
|
101
|
+
hasNextPage: boolean;
|
|
102
|
+
};
|
|
103
|
+
data: SearchResult[];
|
|
104
|
+
}
|
|
105
|
+
interface SearchSimilarOptions extends RequestOptions {
|
|
106
|
+
limit?: number;
|
|
107
|
+
}
|
|
108
|
+
interface SearchSimilarResponse {
|
|
109
|
+
meta: {
|
|
110
|
+
sourceDocumentId: string;
|
|
111
|
+
totalResults: number;
|
|
112
|
+
hasNextPage: boolean;
|
|
113
|
+
};
|
|
114
|
+
data: SearchResult[];
|
|
115
|
+
}
|
|
116
|
+
interface SearchByAuthorOptions extends RequestOptions {
|
|
117
|
+
query?: string;
|
|
118
|
+
limit?: number;
|
|
119
|
+
}
|
|
120
|
+
interface SearchByAuthorResponse {
|
|
121
|
+
meta: {
|
|
122
|
+
authorId: string;
|
|
123
|
+
query: string | null;
|
|
124
|
+
totalResults: number;
|
|
125
|
+
hasNextPage: boolean;
|
|
126
|
+
};
|
|
127
|
+
data: SearchResult[];
|
|
128
|
+
}
|
|
129
|
+
interface Connector {
|
|
130
|
+
id: string;
|
|
131
|
+
name: string | null;
|
|
132
|
+
type: string | null;
|
|
133
|
+
status: string | null;
|
|
134
|
+
lastSyncAt: string | null;
|
|
135
|
+
createdAt?: string | null;
|
|
136
|
+
documentCount: number | null;
|
|
137
|
+
}
|
|
138
|
+
interface ConnectorDetail extends Connector {
|
|
139
|
+
config?: Record<string, unknown> | null;
|
|
140
|
+
syncSchedule?: string | null;
|
|
141
|
+
errorMessage?: string | null;
|
|
142
|
+
health?: {
|
|
143
|
+
score: number | null;
|
|
144
|
+
status: string | null;
|
|
145
|
+
lastCheckedAt: string | null;
|
|
146
|
+
} | null;
|
|
147
|
+
}
|
|
148
|
+
interface ConnectorHealth {
|
|
149
|
+
connectorId: string;
|
|
150
|
+
status: string;
|
|
151
|
+
score: number | null;
|
|
152
|
+
lastSyncAt: string | null;
|
|
153
|
+
lastSyncDuration?: number | null;
|
|
154
|
+
documentCount: number | null;
|
|
155
|
+
errorCount?: number | null;
|
|
156
|
+
lastError: string | null;
|
|
157
|
+
}
|
|
158
|
+
interface ConnectorListOptions extends RequestOptions {
|
|
159
|
+
status?: "active" | "error" | "pending" | "disabled";
|
|
160
|
+
type?: string;
|
|
161
|
+
cursor?: string;
|
|
162
|
+
pageSize?: number;
|
|
163
|
+
}
|
|
164
|
+
interface ConnectorListResponse {
|
|
165
|
+
meta: {
|
|
166
|
+
cursor: string | null;
|
|
167
|
+
hasNextPage: boolean;
|
|
168
|
+
};
|
|
169
|
+
data: Connector[];
|
|
170
|
+
}
|
|
171
|
+
interface AvailableConnector {
|
|
172
|
+
app: string;
|
|
173
|
+
name: string;
|
|
174
|
+
description: string | null;
|
|
175
|
+
category: string | null;
|
|
176
|
+
authType: string;
|
|
177
|
+
logoUrl: string | null;
|
|
178
|
+
requiredFields?: Array<{
|
|
179
|
+
id: string;
|
|
180
|
+
label: string;
|
|
181
|
+
type: string;
|
|
182
|
+
required: boolean;
|
|
183
|
+
placeholder?: string;
|
|
184
|
+
}>;
|
|
185
|
+
}
|
|
186
|
+
interface ConnectorAvailableOptions extends RequestOptions {
|
|
187
|
+
authType?: "OAUTH" | "API_KEY";
|
|
188
|
+
category?: string;
|
|
189
|
+
}
|
|
190
|
+
interface ConnectorAvailableResponse {
|
|
191
|
+
data: AvailableConnector[];
|
|
192
|
+
}
|
|
193
|
+
interface SyncJob {
|
|
194
|
+
id: string;
|
|
195
|
+
connectorId: string;
|
|
196
|
+
connectorType?: string | null;
|
|
197
|
+
status: string;
|
|
198
|
+
type?: string | null;
|
|
199
|
+
startedAt?: string | null;
|
|
200
|
+
completedAt?: string | null;
|
|
201
|
+
documentsProcessed?: number | null;
|
|
202
|
+
documentsErrored?: number | null;
|
|
203
|
+
errorMessage?: string | null;
|
|
204
|
+
}
|
|
205
|
+
interface SyncTriggerResponse {
|
|
206
|
+
syncJobId: string;
|
|
207
|
+
workflowId: string;
|
|
208
|
+
connectorId: string;
|
|
209
|
+
type: string;
|
|
210
|
+
}
|
|
211
|
+
interface SyncStatusResponse {
|
|
212
|
+
connector: Record<string, unknown>;
|
|
213
|
+
latestSync: {
|
|
214
|
+
id: string;
|
|
215
|
+
status: string;
|
|
216
|
+
startedAt: string | null;
|
|
217
|
+
finishedAt: string | null;
|
|
218
|
+
durationMs: number | null;
|
|
219
|
+
dataAdded: number | null;
|
|
220
|
+
dataUpdated: number | null;
|
|
221
|
+
dataDeleted: number | null;
|
|
222
|
+
errorMessage: string | null;
|
|
223
|
+
} | null;
|
|
224
|
+
stats: Record<string, unknown>;
|
|
225
|
+
processing: Record<string, unknown>;
|
|
226
|
+
syncJobs: unknown[];
|
|
227
|
+
webhookStatus: unknown;
|
|
228
|
+
}
|
|
229
|
+
interface SyncHistoryOptions extends RequestOptions {
|
|
230
|
+
limit?: number;
|
|
231
|
+
offset?: number;
|
|
232
|
+
}
|
|
233
|
+
interface SyncHistoryResponse {
|
|
234
|
+
meta: {
|
|
235
|
+
cursor: string | null;
|
|
236
|
+
hasNextPage: boolean;
|
|
237
|
+
total: number;
|
|
238
|
+
};
|
|
239
|
+
data: SyncJob[];
|
|
240
|
+
}
|
|
241
|
+
interface SyncTriggerAllResponse {
|
|
242
|
+
type: string;
|
|
243
|
+
triggered: number;
|
|
244
|
+
alreadyRunning: number;
|
|
245
|
+
failed: number;
|
|
246
|
+
total: number;
|
|
247
|
+
connectors: Array<{
|
|
248
|
+
connectorId: string;
|
|
249
|
+
connectorName: string;
|
|
250
|
+
connectorType: string;
|
|
251
|
+
status: string;
|
|
252
|
+
syncJobId?: string;
|
|
253
|
+
workflowId?: string;
|
|
254
|
+
error?: string;
|
|
255
|
+
}>;
|
|
256
|
+
}
|
|
257
|
+
interface SyncProgressEntry {
|
|
258
|
+
workflowId: string;
|
|
259
|
+
stage: string;
|
|
260
|
+
processed: number;
|
|
261
|
+
indexed: number;
|
|
262
|
+
errors: number;
|
|
263
|
+
dataAdded: number;
|
|
264
|
+
dataUpdated: number;
|
|
265
|
+
dataDeleted: number;
|
|
266
|
+
batchNumber?: number;
|
|
267
|
+
progressMessage?: string;
|
|
268
|
+
isPaused?: boolean;
|
|
269
|
+
}
|
|
270
|
+
interface SyncProgressResponse {
|
|
271
|
+
connectorId: string;
|
|
272
|
+
activeSyncs: SyncProgressEntry[];
|
|
273
|
+
}
|
|
274
|
+
interface SyncHealthEntry {
|
|
275
|
+
connectorId: string;
|
|
276
|
+
connectorName: string;
|
|
277
|
+
connectorType: string;
|
|
278
|
+
status: string;
|
|
279
|
+
documentCount: number;
|
|
280
|
+
lastSyncStatus: string | null;
|
|
281
|
+
lastSyncAt: string | null;
|
|
282
|
+
}
|
|
283
|
+
interface SyncHealthResponse {
|
|
284
|
+
healthy: number;
|
|
285
|
+
warning: number;
|
|
286
|
+
error: number;
|
|
287
|
+
total: number;
|
|
288
|
+
connectors: SyncHealthEntry[];
|
|
289
|
+
}
|
|
290
|
+
interface SyncControlResponse {
|
|
291
|
+
connectorId: string;
|
|
292
|
+
action: string;
|
|
293
|
+
affected: number;
|
|
294
|
+
}
|
|
295
|
+
interface SyncErrorEntry {
|
|
296
|
+
connectorId: string;
|
|
297
|
+
connectorType: string | null;
|
|
298
|
+
status: string;
|
|
299
|
+
type: string | null;
|
|
300
|
+
startedAt: string | null;
|
|
301
|
+
errorMessage: string | null;
|
|
302
|
+
documentsProcessed: number | null;
|
|
303
|
+
}
|
|
304
|
+
interface SyncErrorsResponse {
|
|
305
|
+
errors: SyncErrorEntry[];
|
|
306
|
+
total: number;
|
|
307
|
+
}
|
|
308
|
+
interface ConnectorAction {
|
|
309
|
+
id: string;
|
|
310
|
+
name: string;
|
|
311
|
+
description: string;
|
|
312
|
+
connectorType: string;
|
|
313
|
+
category: string;
|
|
314
|
+
stakes: string;
|
|
315
|
+
reversible: boolean;
|
|
316
|
+
inputs: Array<{
|
|
317
|
+
id: string;
|
|
318
|
+
name: string;
|
|
319
|
+
type: string;
|
|
320
|
+
required: boolean;
|
|
321
|
+
description: string | null;
|
|
322
|
+
}>;
|
|
323
|
+
}
|
|
324
|
+
interface ActionsListOptions extends RequestOptions {
|
|
325
|
+
connectorType?: string;
|
|
326
|
+
category?: "create" | "read" | "update" | "delete" | "search" | "list" | "notify";
|
|
327
|
+
}
|
|
328
|
+
interface ActionsListResponse {
|
|
329
|
+
meta: {
|
|
330
|
+
totalActions: number;
|
|
331
|
+
connectorTypes: string[];
|
|
332
|
+
hasNextPage: boolean;
|
|
333
|
+
};
|
|
334
|
+
data: ConnectorAction[];
|
|
335
|
+
}
|
|
336
|
+
interface ActionExecuteResponse {
|
|
337
|
+
success: boolean;
|
|
338
|
+
data: unknown;
|
|
339
|
+
error?: string;
|
|
340
|
+
}
|
|
341
|
+
interface Team {
|
|
342
|
+
id: string;
|
|
343
|
+
name: string | null;
|
|
344
|
+
slug: string | null;
|
|
345
|
+
plan: string | null;
|
|
346
|
+
connectorCount: number | null;
|
|
347
|
+
memberCount: number | null;
|
|
348
|
+
documentCount: number | null;
|
|
349
|
+
createdAt: string | null;
|
|
350
|
+
}
|
|
351
|
+
interface TeamMember {
|
|
352
|
+
id: string;
|
|
353
|
+
name: string | null;
|
|
354
|
+
email: string | null;
|
|
355
|
+
role: string | null;
|
|
356
|
+
avatarUrl: string | null;
|
|
357
|
+
joinedAt: string | null;
|
|
358
|
+
}
|
|
359
|
+
interface KnowledgeEntity {
|
|
360
|
+
id: string;
|
|
361
|
+
name: string | null;
|
|
362
|
+
type: string | null;
|
|
363
|
+
aliases?: string[] | null;
|
|
364
|
+
expertiseScore?: number | null;
|
|
365
|
+
mentionCount?: number | null;
|
|
366
|
+
}
|
|
367
|
+
interface KnowledgeRelation {
|
|
368
|
+
id: string;
|
|
369
|
+
relationType: string;
|
|
370
|
+
weight?: number | null;
|
|
371
|
+
fromEntity?: KnowledgeEntity | null;
|
|
372
|
+
toEntity?: KnowledgeEntity | null;
|
|
373
|
+
}
|
|
374
|
+
interface EntitySearchOptions extends RequestOptions {
|
|
375
|
+
type?: string;
|
|
376
|
+
limit?: number;
|
|
377
|
+
}
|
|
378
|
+
interface EntitySearchResponse {
|
|
379
|
+
data: KnowledgeEntity[];
|
|
380
|
+
}
|
|
381
|
+
interface EntityPanelResponse {
|
|
382
|
+
data: {
|
|
383
|
+
entity: KnowledgeEntity;
|
|
384
|
+
relations: {
|
|
385
|
+
outgoing: KnowledgeRelation[];
|
|
386
|
+
incoming: KnowledgeRelation[];
|
|
387
|
+
};
|
|
388
|
+
expertise: Array<{
|
|
389
|
+
topic: KnowledgeEntity;
|
|
390
|
+
score: number | null;
|
|
391
|
+
}>;
|
|
392
|
+
recentMentions: Array<{
|
|
393
|
+
id: string;
|
|
394
|
+
documentId: string | null;
|
|
395
|
+
createdAt: string | null;
|
|
396
|
+
}>;
|
|
397
|
+
};
|
|
398
|
+
}
|
|
399
|
+
interface TopicExpertsResponse {
|
|
400
|
+
data: Array<{
|
|
401
|
+
person: KnowledgeEntity;
|
|
402
|
+
score: number | null;
|
|
403
|
+
}>;
|
|
404
|
+
}
|
|
405
|
+
interface AgentTemplate {
|
|
406
|
+
name: string;
|
|
407
|
+
description: string;
|
|
408
|
+
category: string;
|
|
409
|
+
estimatedDuration: string;
|
|
410
|
+
}
|
|
411
|
+
interface AgentRunOptions extends RequestOptions {
|
|
412
|
+
maxSources?: number;
|
|
413
|
+
}
|
|
414
|
+
interface AgentRunResponse {
|
|
415
|
+
data: {
|
|
416
|
+
agentName: string;
|
|
417
|
+
output: string;
|
|
418
|
+
stepsUsed: number;
|
|
419
|
+
durationMs: number;
|
|
420
|
+
citations: Array<{
|
|
421
|
+
title: string | null;
|
|
422
|
+
source: string | null;
|
|
423
|
+
}> | null;
|
|
424
|
+
};
|
|
425
|
+
}
|
|
426
|
+
interface ContextEntry {
|
|
427
|
+
uri: string;
|
|
428
|
+
title?: string | null;
|
|
429
|
+
abstract: string | null;
|
|
430
|
+
overview?: string | null;
|
|
431
|
+
contextType: string | null;
|
|
432
|
+
category: string | null;
|
|
433
|
+
score?: number | null;
|
|
434
|
+
updatedAt: string | null;
|
|
435
|
+
}
|
|
436
|
+
interface ContextDetail extends ContextEntry {
|
|
437
|
+
content?: string | null;
|
|
438
|
+
parentUri?: string | null;
|
|
439
|
+
ownerType?: string | null;
|
|
440
|
+
activeCount?: number | null;
|
|
441
|
+
relations?: Array<{
|
|
442
|
+
targetUri: string;
|
|
443
|
+
reason: string | null;
|
|
444
|
+
}> | null;
|
|
445
|
+
}
|
|
446
|
+
interface ContextSearchOptions extends RequestOptions {
|
|
447
|
+
contextType?: "resource" | "memory" | "skill" | "tool";
|
|
448
|
+
category?: string;
|
|
449
|
+
limit?: number;
|
|
450
|
+
}
|
|
451
|
+
interface ContextSearchResponse {
|
|
452
|
+
meta: {
|
|
453
|
+
query: string;
|
|
454
|
+
totalResults: number;
|
|
455
|
+
hasNextPage: boolean;
|
|
456
|
+
};
|
|
457
|
+
data: ContextEntry[];
|
|
458
|
+
}
|
|
459
|
+
interface ContextReadOptions extends RequestOptions {
|
|
460
|
+
level?: "0" | "1" | "2";
|
|
461
|
+
}
|
|
462
|
+
interface AskQuestionOptions extends RequestOptions {
|
|
463
|
+
connectorTypes?: string[];
|
|
464
|
+
maxSources?: number;
|
|
465
|
+
}
|
|
466
|
+
interface AnswerResponse {
|
|
467
|
+
data: {
|
|
468
|
+
answer: string;
|
|
469
|
+
confidence: number | null;
|
|
470
|
+
citations: Array<{
|
|
471
|
+
uri: string | null;
|
|
472
|
+
title: string | null;
|
|
473
|
+
snippet: string | null;
|
|
474
|
+
source: string | null;
|
|
475
|
+
}> | null;
|
|
476
|
+
};
|
|
477
|
+
}
|
|
478
|
+
//#endregion
|
|
479
|
+
//#region src/client.d.ts
|
|
480
|
+
declare class HttpClient {
|
|
481
|
+
private readonly apiKey;
|
|
482
|
+
private readonly baseUrl;
|
|
483
|
+
private readonly timeout;
|
|
484
|
+
private readonly maxRetries;
|
|
485
|
+
private requestId;
|
|
486
|
+
constructor(config: OpenBeamConfig);
|
|
487
|
+
callTool<T>(toolName: string, args: Record<string, unknown>, options?: RequestOptions): Promise<T>;
|
|
488
|
+
private nextId;
|
|
489
|
+
private buildSignal;
|
|
490
|
+
private fetchWithRetry;
|
|
491
|
+
private retryDelay;
|
|
492
|
+
private handleHttpError;
|
|
493
|
+
}
|
|
494
|
+
//#endregion
|
|
495
|
+
//#region src/resources/actions.d.ts
|
|
496
|
+
declare class ActionsResource {
|
|
497
|
+
private readonly client;
|
|
498
|
+
constructor(client: HttpClient);
|
|
499
|
+
list(options?: ActionsListOptions): Promise<ActionsListResponse>;
|
|
500
|
+
execute(connectorId: string, actionId: string, params: Record<string, unknown>, options?: RequestOptions): Promise<ActionExecuteResponse>;
|
|
501
|
+
}
|
|
502
|
+
//#endregion
|
|
503
|
+
//#region src/resources/agents.d.ts
|
|
504
|
+
declare class AgentsResource {
|
|
505
|
+
private readonly client;
|
|
506
|
+
constructor(client: HttpClient);
|
|
507
|
+
list(options?: RequestOptions & {
|
|
508
|
+
category?: "analysis" | "content";
|
|
509
|
+
}): Promise<{
|
|
510
|
+
data: AgentTemplate[];
|
|
511
|
+
}>;
|
|
512
|
+
run(agentName: string, input: string, options?: AgentRunOptions): Promise<AgentRunResponse>;
|
|
513
|
+
ask(question: string, options?: AskQuestionOptions): Promise<AnswerResponse>;
|
|
514
|
+
contextSearch(query: string, options?: ContextSearchOptions): Promise<ContextSearchResponse>;
|
|
515
|
+
contextRead(uri: string, options?: ContextReadOptions): Promise<{
|
|
516
|
+
data: ContextDetail;
|
|
517
|
+
}>;
|
|
518
|
+
}
|
|
519
|
+
//#endregion
|
|
520
|
+
//#region src/resources/apikeys.d.ts
|
|
521
|
+
interface ApiKey {
|
|
522
|
+
id: string;
|
|
523
|
+
name: string;
|
|
524
|
+
prefix: string;
|
|
525
|
+
scopes: string[];
|
|
526
|
+
createdAt: string;
|
|
527
|
+
lastUsedAt: string | null;
|
|
528
|
+
revoked: boolean;
|
|
529
|
+
}
|
|
530
|
+
interface ApiKeyCreated {
|
|
531
|
+
id: string;
|
|
532
|
+
key: string;
|
|
533
|
+
name: string;
|
|
534
|
+
prefix: string;
|
|
535
|
+
scopes: string[];
|
|
536
|
+
}
|
|
537
|
+
interface ApiKeyRevoked {
|
|
538
|
+
id: string;
|
|
539
|
+
revoked: boolean;
|
|
540
|
+
}
|
|
541
|
+
declare class ApiKeysResource {
|
|
542
|
+
private readonly client;
|
|
543
|
+
constructor(client: HttpClient);
|
|
544
|
+
list(options?: RequestOptions): Promise<ApiKey[]>;
|
|
545
|
+
create(name: string, scopes?: string[], options?: RequestOptions): Promise<ApiKeyCreated>;
|
|
546
|
+
revoke(apiKeyId: string, options?: RequestOptions): Promise<ApiKeyRevoked>;
|
|
547
|
+
}
|
|
548
|
+
//#endregion
|
|
549
|
+
//#region src/resources/connectors.d.ts
|
|
550
|
+
declare class ConnectorsResource {
|
|
551
|
+
private readonly client;
|
|
552
|
+
constructor(client: HttpClient);
|
|
553
|
+
list(options?: ConnectorListOptions): Promise<ConnectorListResponse>;
|
|
554
|
+
get(id: string, options?: RequestOptions): Promise<{
|
|
555
|
+
data: ConnectorDetail;
|
|
556
|
+
}>;
|
|
557
|
+
health(id: string, options?: RequestOptions): Promise<{
|
|
558
|
+
data: ConnectorHealth;
|
|
559
|
+
}>;
|
|
560
|
+
available(options?: ConnectorAvailableOptions): Promise<ConnectorAvailableResponse>;
|
|
561
|
+
disconnect(connectorId: string, options?: RequestOptions): Promise<{
|
|
562
|
+
connectorId: string;
|
|
563
|
+
name: string;
|
|
564
|
+
status: string;
|
|
565
|
+
}>;
|
|
566
|
+
}
|
|
567
|
+
//#endregion
|
|
568
|
+
//#region src/resources/knowledge.d.ts
|
|
569
|
+
declare class KnowledgeResource {
|
|
570
|
+
private readonly client;
|
|
571
|
+
constructor(client: HttpClient);
|
|
572
|
+
searchEntities(query: string, options?: EntitySearchOptions): Promise<EntitySearchResponse>;
|
|
573
|
+
getEntity(entityId: string, options?: RequestOptions): Promise<EntityPanelResponse>;
|
|
574
|
+
getRelations(entityId: string, opts?: RequestOptions & {
|
|
575
|
+
direction?: "incoming" | "outgoing" | "both";
|
|
576
|
+
relationType?: string;
|
|
577
|
+
limit?: number;
|
|
578
|
+
}): Promise<{
|
|
579
|
+
data: {
|
|
580
|
+
outgoing: KnowledgeRelation[];
|
|
581
|
+
incoming: KnowledgeRelation[];
|
|
582
|
+
};
|
|
583
|
+
}>;
|
|
584
|
+
topicExperts(topicId: string, options?: RequestOptions & {
|
|
585
|
+
limit?: number;
|
|
586
|
+
}): Promise<TopicExpertsResponse>;
|
|
587
|
+
personExpertise(personId: string, options?: RequestOptions & {
|
|
588
|
+
limit?: number;
|
|
589
|
+
}): Promise<{
|
|
590
|
+
data: Array<{
|
|
591
|
+
topic: {
|
|
592
|
+
id: string;
|
|
593
|
+
name: string | null;
|
|
594
|
+
};
|
|
595
|
+
score: number | null;
|
|
596
|
+
}>;
|
|
597
|
+
}>;
|
|
598
|
+
topics(options?: RequestOptions & {
|
|
599
|
+
parentId?: string;
|
|
600
|
+
limit?: number;
|
|
601
|
+
}): Promise<{
|
|
602
|
+
data: Array<{
|
|
603
|
+
id: string;
|
|
604
|
+
name: string;
|
|
605
|
+
documentCount: number | null;
|
|
606
|
+
children?: unknown[];
|
|
607
|
+
}>;
|
|
608
|
+
}>;
|
|
609
|
+
}
|
|
610
|
+
//#endregion
|
|
611
|
+
//#region src/resources/search.d.ts
|
|
612
|
+
declare class SearchResource {
|
|
613
|
+
private readonly client;
|
|
614
|
+
constructor(client: HttpClient);
|
|
615
|
+
documents(query: string, options?: SearchDocumentsOptions): Promise<SearchDocumentsResponse>;
|
|
616
|
+
people(query: string, options?: SearchPeopleOptions): Promise<SearchPeopleResponse>;
|
|
617
|
+
recent(options?: SearchRecentOptions): Promise<SearchRecentResponse>;
|
|
618
|
+
semantic(query: string, options?: SearchSemanticOptions): Promise<SearchSemanticResponse>;
|
|
619
|
+
similar(documentId: string, options?: SearchSimilarOptions): Promise<SearchSimilarResponse>;
|
|
620
|
+
byAuthor(authorId: string, options?: SearchByAuthorOptions): Promise<SearchByAuthorResponse>;
|
|
621
|
+
}
|
|
622
|
+
//#endregion
|
|
623
|
+
//#region src/resources/sync.d.ts
|
|
624
|
+
declare class SyncResource {
|
|
625
|
+
private readonly client;
|
|
626
|
+
constructor(client: HttpClient);
|
|
627
|
+
trigger(connectorId: string, type?: "full" | "incremental", options?: RequestOptions): Promise<SyncTriggerResponse>;
|
|
628
|
+
triggerAll(options?: RequestOptions & {
|
|
629
|
+
type?: "full" | "incremental";
|
|
630
|
+
connectorTypes?: string[];
|
|
631
|
+
}): Promise<SyncTriggerAllResponse>;
|
|
632
|
+
status(connectorId: string, options?: RequestOptions): Promise<SyncStatusResponse>;
|
|
633
|
+
history(connectorId: string, options?: SyncHistoryOptions): Promise<SyncHistoryResponse>;
|
|
634
|
+
progress(connectorId: string, options?: RequestOptions): Promise<SyncProgressResponse>;
|
|
635
|
+
health(options?: RequestOptions): Promise<SyncHealthResponse>;
|
|
636
|
+
errors(options?: RequestOptions & {
|
|
637
|
+
connectorId?: string;
|
|
638
|
+
limit?: number;
|
|
639
|
+
}): Promise<SyncErrorsResponse>;
|
|
640
|
+
cancel(connectorId: string, options?: RequestOptions): Promise<SyncControlResponse>;
|
|
641
|
+
pause(connectorId: string, options?: RequestOptions): Promise<SyncControlResponse>;
|
|
642
|
+
resume(connectorId: string, options?: RequestOptions): Promise<SyncControlResponse>;
|
|
643
|
+
}
|
|
644
|
+
//#endregion
|
|
645
|
+
//#region src/resources/team.d.ts
|
|
646
|
+
interface InviteResult {
|
|
647
|
+
id: string;
|
|
648
|
+
email: string;
|
|
649
|
+
role: string;
|
|
650
|
+
code: string;
|
|
651
|
+
createdAt: string | null;
|
|
652
|
+
}
|
|
653
|
+
interface RoleUpdateResult {
|
|
654
|
+
userId: string;
|
|
655
|
+
role: string;
|
|
656
|
+
}
|
|
657
|
+
interface MemberRemovedResult {
|
|
658
|
+
userId: string;
|
|
659
|
+
removed: boolean;
|
|
660
|
+
}
|
|
661
|
+
declare class TeamResource {
|
|
662
|
+
private readonly client;
|
|
663
|
+
constructor(client: HttpClient);
|
|
664
|
+
info(options?: RequestOptions): Promise<{
|
|
665
|
+
data: Team;
|
|
666
|
+
}>;
|
|
667
|
+
members(options?: RequestOptions): Promise<{
|
|
668
|
+
data: TeamMember[];
|
|
669
|
+
}>;
|
|
670
|
+
inviteMember(email: string, role?: "ADMIN" | "MEMBER", options?: RequestOptions): Promise<{
|
|
671
|
+
data: InviteResult;
|
|
672
|
+
}>;
|
|
673
|
+
removeMember(userId: string, options?: RequestOptions): Promise<{
|
|
674
|
+
data: MemberRemovedResult;
|
|
675
|
+
}>;
|
|
676
|
+
updateRole(userId: string, role: "OWNER" | "ADMIN" | "MEMBER", options?: RequestOptions): Promise<{
|
|
677
|
+
data: RoleUpdateResult;
|
|
678
|
+
}>;
|
|
679
|
+
}
|
|
680
|
+
//#endregion
|
|
681
|
+
//#region src/errors.d.ts
|
|
682
|
+
declare class OpenBeamError extends Error {
|
|
683
|
+
readonly status: number;
|
|
684
|
+
readonly code: string;
|
|
685
|
+
constructor(message: string, status: number, code: string);
|
|
686
|
+
}
|
|
687
|
+
declare class AuthenticationError extends OpenBeamError {
|
|
688
|
+
constructor(message?: string);
|
|
689
|
+
}
|
|
690
|
+
declare class PermissionError extends OpenBeamError {
|
|
691
|
+
constructor(message?: string);
|
|
692
|
+
}
|
|
693
|
+
declare class NotFoundError extends OpenBeamError {
|
|
694
|
+
constructor(message?: string);
|
|
695
|
+
}
|
|
696
|
+
declare class RateLimitError extends OpenBeamError {
|
|
697
|
+
readonly retryAfter: number | null;
|
|
698
|
+
constructor(message?: string, retryAfter?: number | null);
|
|
699
|
+
}
|
|
700
|
+
declare class ServerError extends OpenBeamError {
|
|
701
|
+
constructor(message?: string);
|
|
702
|
+
}
|
|
703
|
+
declare class ToolError extends OpenBeamError {
|
|
704
|
+
constructor(message: string);
|
|
705
|
+
}
|
|
706
|
+
//#endregion
|
|
707
|
+
//#region src/index.d.ts
|
|
708
|
+
declare class OpenBeam {
|
|
709
|
+
readonly search: SearchResource;
|
|
710
|
+
readonly connectors: ConnectorsResource;
|
|
711
|
+
readonly sync: SyncResource;
|
|
712
|
+
readonly actions: ActionsResource;
|
|
713
|
+
readonly team: TeamResource;
|
|
714
|
+
readonly knowledge: KnowledgeResource;
|
|
715
|
+
readonly agents: AgentsResource;
|
|
716
|
+
readonly apiKeys: ApiKeysResource;
|
|
717
|
+
constructor(config: OpenBeamConfig);
|
|
718
|
+
}
|
|
719
|
+
//#endregion
|
|
720
|
+
export { type ActionExecuteResponse, type ActionsListOptions, type ActionsListResponse, type AgentRunOptions, type AgentRunResponse, type AgentTemplate, type AnswerResponse, type AskQuestionOptions, AuthenticationError, type AvailableConnector, type Connector, type ConnectorAction, type ConnectorAvailableOptions, type ConnectorAvailableResponse, type ConnectorDetail, type ConnectorHealth, type ConnectorListOptions, type ConnectorListResponse, type ContextDetail, type ContextEntry, type ContextReadOptions, type ContextSearchOptions, type ContextSearchResponse, type EntityPanelResponse, type EntitySearchOptions, type EntitySearchResponse, type KnowledgeEntity, type KnowledgeRelation, NotFoundError, OpenBeam, OpenBeam as default, type OpenBeamConfig, OpenBeamError, PermissionError, type PersonResult, RateLimitError, type RecentResult, type RequestOptions, type SearchByAuthorOptions, type SearchByAuthorResponse, type SearchDocumentsOptions, type SearchDocumentsResponse, type SearchPeopleOptions, type SearchPeopleResponse, type SearchRecentOptions, type SearchRecentResponse, type SearchResult, type SearchSemanticOptions, type SearchSemanticResponse, type SearchSimilarOptions, type SearchSimilarResponse, ServerError, type SyncControlResponse, type SyncErrorEntry, type SyncErrorsResponse, type SyncHealthEntry, type SyncHealthResponse, type SyncHistoryOptions, type SyncHistoryResponse, type SyncJob, type SyncProgressEntry, type SyncProgressResponse, type SyncStatusResponse, type SyncTriggerAllResponse, type SyncTriggerResponse, type Team, type TeamMember, ToolError, type TopicExpertsResponse };
|