@backflow.sdk/client 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 +210 -0
- package/dist/index.d.mts +1845 -0
- package/dist/index.d.ts +1845 -0
- package/dist/index.js +2945 -0
- package/dist/index.mjs +2862 -0
- package/package.json +47 -0
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,1845 @@
|
|
|
1
|
+
interface RequestContext {
|
|
2
|
+
method: string;
|
|
3
|
+
path: string;
|
|
4
|
+
params?: Record<string, unknown>;
|
|
5
|
+
body?: unknown;
|
|
6
|
+
startTime: number;
|
|
7
|
+
}
|
|
8
|
+
interface ResponseContext extends RequestContext {
|
|
9
|
+
status: number;
|
|
10
|
+
duration: number;
|
|
11
|
+
response?: unknown;
|
|
12
|
+
error?: Error;
|
|
13
|
+
}
|
|
14
|
+
type RequestMiddleware = (ctx: RequestContext) => RequestContext | void | Promise<RequestContext | void>;
|
|
15
|
+
type ResponseMiddleware = (ctx: ResponseContext) => void | Promise<void>;
|
|
16
|
+
interface BackflowMiddleware {
|
|
17
|
+
onRequest?: RequestMiddleware;
|
|
18
|
+
onResponse?: ResponseMiddleware;
|
|
19
|
+
}
|
|
20
|
+
interface BackflowConfig {
|
|
21
|
+
clientKey?: string;
|
|
22
|
+
getAuthToken?: () => Promise<string>;
|
|
23
|
+
endpoint?: string;
|
|
24
|
+
middleware?: BackflowMiddleware;
|
|
25
|
+
debug?: boolean;
|
|
26
|
+
}
|
|
27
|
+
interface RequestOptions extends Omit<RequestInit, "body"> {
|
|
28
|
+
params?: Record<string, string | number | boolean | undefined>;
|
|
29
|
+
body?: unknown;
|
|
30
|
+
}
|
|
31
|
+
type HttpMethod = "get" | "post" | "put" | "patch" | "delete";
|
|
32
|
+
interface BackflowResponse<T> {
|
|
33
|
+
data: T;
|
|
34
|
+
status: number;
|
|
35
|
+
headers: Headers;
|
|
36
|
+
}
|
|
37
|
+
interface BackflowError extends Error {
|
|
38
|
+
status: number;
|
|
39
|
+
code?: string;
|
|
40
|
+
details?: unknown;
|
|
41
|
+
}
|
|
42
|
+
interface SSESubscribeHandlers<T = unknown> {
|
|
43
|
+
onConnected?: () => void;
|
|
44
|
+
onComplete?: (data: T) => void;
|
|
45
|
+
onFailed?: (error: string) => void;
|
|
46
|
+
onProgress?: (progress: number, message?: string) => void;
|
|
47
|
+
onWarning?: (message: string) => void;
|
|
48
|
+
onError?: (error: Event) => void;
|
|
49
|
+
}
|
|
50
|
+
type DatabaseProvider = 'supabase' | 'firebase' | 'sqlite' | 'custom' | string;
|
|
51
|
+
type DatabaseFilterOperator = 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte' | 'like' | 'ilike' | 'in' | 'is';
|
|
52
|
+
interface DatabaseFilter {
|
|
53
|
+
column: string;
|
|
54
|
+
operator: DatabaseFilterOperator;
|
|
55
|
+
value: unknown;
|
|
56
|
+
}
|
|
57
|
+
interface ChainedDatabaseQuery {
|
|
58
|
+
table: string;
|
|
59
|
+
operation?: 'select' | 'insert' | 'update' | 'delete';
|
|
60
|
+
filters?: DatabaseFilter[];
|
|
61
|
+
data?: Record<string, unknown>;
|
|
62
|
+
select?: string;
|
|
63
|
+
single?: boolean;
|
|
64
|
+
order?: {
|
|
65
|
+
column: string;
|
|
66
|
+
ascending?: boolean;
|
|
67
|
+
};
|
|
68
|
+
limit?: number;
|
|
69
|
+
offset?: number;
|
|
70
|
+
as: string;
|
|
71
|
+
}
|
|
72
|
+
interface DatabaseIntegrationAction {
|
|
73
|
+
type: 'database';
|
|
74
|
+
action: 'select' | 'insert' | 'update' | 'upsert' | 'delete';
|
|
75
|
+
table: string;
|
|
76
|
+
data?: Record<string, unknown>;
|
|
77
|
+
filters?: DatabaseFilter[];
|
|
78
|
+
select?: string;
|
|
79
|
+
orderBy?: {
|
|
80
|
+
column: string;
|
|
81
|
+
direction?: 'asc' | 'desc';
|
|
82
|
+
};
|
|
83
|
+
limit?: number;
|
|
84
|
+
offset?: number;
|
|
85
|
+
single?: boolean;
|
|
86
|
+
provider?: DatabaseProvider;
|
|
87
|
+
or?: Omit<DatabaseIntegrationAction, 'type' | 'action' | 'or' | 'chain'>[];
|
|
88
|
+
chain?: ChainedDatabaseQuery[];
|
|
89
|
+
saveResponseAs?: string;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
declare class BackflowClient {
|
|
93
|
+
private config;
|
|
94
|
+
private tokenCache;
|
|
95
|
+
private tokenPromise;
|
|
96
|
+
constructor(config: BackflowConfig);
|
|
97
|
+
private exchangeApiKeyForToken;
|
|
98
|
+
private getToken;
|
|
99
|
+
get endpoint(): string;
|
|
100
|
+
request<T>(path: string, options?: RequestOptions): Promise<T>;
|
|
101
|
+
get<T>(path: string, params?: Record<string, string | number | boolean | undefined>): Promise<T>;
|
|
102
|
+
post<T>(path: string, body?: unknown, params?: Record<string, string | number | boolean | undefined>): Promise<T>;
|
|
103
|
+
put<T>(path: string, body?: unknown, params?: Record<string, string | number | boolean | undefined>): Promise<T>;
|
|
104
|
+
patch<T>(path: string, body?: unknown, params?: Record<string, string | number | boolean | undefined>): Promise<T>;
|
|
105
|
+
delete<T>(path: string, params?: Record<string, string | number | boolean | undefined>): Promise<T>;
|
|
106
|
+
upload<T>(path: string, files: File | File[], metadata?: Record<string, string>): Promise<T>;
|
|
107
|
+
getRaw(path: string, params?: Record<string, string | number | boolean | undefined>): Promise<Response>;
|
|
108
|
+
createWebSocket(room: string): WebSocket;
|
|
109
|
+
subscribeSSE<T = unknown>(path: string, handlers: SSESubscribeHandlers<T>): () => void;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
declare class AgentAnalysisResource {
|
|
113
|
+
private client;
|
|
114
|
+
constructor(client: BackflowClient);
|
|
115
|
+
/** Retrieve cached analysis results from a previous scan */
|
|
116
|
+
get(executionId: string): Promise<unknown>;
|
|
117
|
+
/** Apply fixes from cached analysis. In hybrid mode, returns fix instructions for local MCP execution. */
|
|
118
|
+
createApply(executionId: string, data: Record<string, unknown>): Promise<unknown>;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
declare class AnalyticsResource$1 {
|
|
122
|
+
private client;
|
|
123
|
+
constructor(client: BackflowClient);
|
|
124
|
+
/** Get high-level analytics overview (tenant-isolated) */
|
|
125
|
+
list(): Promise<unknown>;
|
|
126
|
+
/** Get endpoint statistics (tenant-isolated) */
|
|
127
|
+
listEndpoints(): Promise<unknown>;
|
|
128
|
+
/** Get recent errors (tenant-isolated) */
|
|
129
|
+
listErrors(): Promise<unknown>;
|
|
130
|
+
/** Get device type breakdown (tenant-isolated) */
|
|
131
|
+
listDevices(): Promise<unknown>;
|
|
132
|
+
/** Get geographic distribution of requests (tenant-isolated) */
|
|
133
|
+
listGeography(): Promise<unknown>;
|
|
134
|
+
/** Get time series data (tenant-isolated) */
|
|
135
|
+
listTimeseries(): Promise<unknown>;
|
|
136
|
+
/** Get endpoints that haven't been called recently (tenant-isolated) */
|
|
137
|
+
listUnusedEndpoints(): Promise<unknown>;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
interface BatchImportOptions {
|
|
141
|
+
entity: string;
|
|
142
|
+
records: Record<string, unknown>[];
|
|
143
|
+
mode?: 'insert' | 'upsert';
|
|
144
|
+
upsertKey?: string;
|
|
145
|
+
chunkSize?: number;
|
|
146
|
+
async?: boolean;
|
|
147
|
+
}
|
|
148
|
+
interface BatchImportResult {
|
|
149
|
+
jobId?: string;
|
|
150
|
+
status: 'completed' | 'partial' | 'failed' | 'queued';
|
|
151
|
+
total: number;
|
|
152
|
+
successful: number;
|
|
153
|
+
failed: number;
|
|
154
|
+
errors?: Array<{
|
|
155
|
+
index: number;
|
|
156
|
+
error: string;
|
|
157
|
+
record?: unknown;
|
|
158
|
+
}>;
|
|
159
|
+
message?: string;
|
|
160
|
+
}
|
|
161
|
+
interface BatchJob {
|
|
162
|
+
id: string;
|
|
163
|
+
entity: string;
|
|
164
|
+
status: 'pending' | 'processing' | 'completed' | 'failed';
|
|
165
|
+
total: number;
|
|
166
|
+
processed: number;
|
|
167
|
+
successful: number;
|
|
168
|
+
failed: number;
|
|
169
|
+
errors: Array<{
|
|
170
|
+
index: number;
|
|
171
|
+
error: string;
|
|
172
|
+
}>;
|
|
173
|
+
progress: number;
|
|
174
|
+
createdAt: string;
|
|
175
|
+
updatedAt: string;
|
|
176
|
+
completedAt?: string;
|
|
177
|
+
}
|
|
178
|
+
interface BatchExportOptions {
|
|
179
|
+
entity: string;
|
|
180
|
+
filters?: Array<{
|
|
181
|
+
field: string;
|
|
182
|
+
operator: string;
|
|
183
|
+
value: unknown;
|
|
184
|
+
}>;
|
|
185
|
+
select?: string[];
|
|
186
|
+
limit?: number;
|
|
187
|
+
}
|
|
188
|
+
interface BatchExportResult {
|
|
189
|
+
entity: string;
|
|
190
|
+
count: number;
|
|
191
|
+
records: Record<string, unknown>[];
|
|
192
|
+
}
|
|
193
|
+
declare class BatchResource {
|
|
194
|
+
private client;
|
|
195
|
+
constructor(client: BackflowClient);
|
|
196
|
+
/**
|
|
197
|
+
* Import records in batch to a specified entity
|
|
198
|
+
*
|
|
199
|
+
* @param options - Import options including entity name, records, and mode
|
|
200
|
+
* @returns Import result with success/failure counts
|
|
201
|
+
*
|
|
202
|
+
* @example
|
|
203
|
+
* // Insert new records
|
|
204
|
+
* const result = await bf.batch.import({
|
|
205
|
+
* entity: 'products',
|
|
206
|
+
* records: [
|
|
207
|
+
* { name: 'Product 1', price: 100 },
|
|
208
|
+
* { name: 'Product 2', price: 200 },
|
|
209
|
+
* ],
|
|
210
|
+
* });
|
|
211
|
+
*
|
|
212
|
+
* @example
|
|
213
|
+
* // Upsert records (update existing, insert new)
|
|
214
|
+
* const result = await bf.batch.import({
|
|
215
|
+
* entity: 'products',
|
|
216
|
+
* records: products,
|
|
217
|
+
* mode: 'upsert',
|
|
218
|
+
* upsertKey: 'sku',
|
|
219
|
+
* });
|
|
220
|
+
*
|
|
221
|
+
* @example
|
|
222
|
+
* // Large async import (>1000 records or explicit async)
|
|
223
|
+
* const result = await bf.batch.import({
|
|
224
|
+
* entity: 'orders',
|
|
225
|
+
* records: largeDataset,
|
|
226
|
+
* async: true,
|
|
227
|
+
* });
|
|
228
|
+
* // Check status
|
|
229
|
+
* const status = await bf.batch.getJob(result.jobId!);
|
|
230
|
+
*/
|
|
231
|
+
import(options: BatchImportOptions): Promise<BatchImportResult>;
|
|
232
|
+
/**
|
|
233
|
+
* Get status of a batch import job
|
|
234
|
+
*
|
|
235
|
+
* @param jobId - The job ID returned from async import
|
|
236
|
+
* @returns Job status including progress and error details
|
|
237
|
+
*/
|
|
238
|
+
getJob(jobId: string): Promise<BatchJob>;
|
|
239
|
+
/**
|
|
240
|
+
* List batch jobs for the current tenant
|
|
241
|
+
*
|
|
242
|
+
* @returns List of recent batch jobs
|
|
243
|
+
*/
|
|
244
|
+
listJobs(): Promise<{
|
|
245
|
+
jobs: BatchJob[];
|
|
246
|
+
}>;
|
|
247
|
+
/**
|
|
248
|
+
* Export records from an entity
|
|
249
|
+
*
|
|
250
|
+
* @param options - Export options including entity name and optional filters
|
|
251
|
+
* @returns Exported records
|
|
252
|
+
*
|
|
253
|
+
* @example
|
|
254
|
+
* // Export all records
|
|
255
|
+
* const result = await bf.batch.export({ entity: 'products' });
|
|
256
|
+
*
|
|
257
|
+
* @example
|
|
258
|
+
* // Export with filters
|
|
259
|
+
* const result = await bf.batch.export({
|
|
260
|
+
* entity: 'orders',
|
|
261
|
+
* filters: [
|
|
262
|
+
* { field: 'status', operator: 'eq', value: 'completed' },
|
|
263
|
+
* ],
|
|
264
|
+
* select: ['id', 'total', 'created_at'],
|
|
265
|
+
* limit: 5000,
|
|
266
|
+
* });
|
|
267
|
+
*/
|
|
268
|
+
export(options: BatchExportOptions): Promise<BatchExportResult>;
|
|
269
|
+
/**
|
|
270
|
+
* Poll job until completion
|
|
271
|
+
*
|
|
272
|
+
* @param jobId - The job ID to poll
|
|
273
|
+
* @param intervalMs - Polling interval in milliseconds (default: 1000)
|
|
274
|
+
* @param timeoutMs - Timeout in milliseconds (default: 300000 = 5 minutes)
|
|
275
|
+
* @returns Final job status
|
|
276
|
+
*/
|
|
277
|
+
waitForJob(jobId: string, intervalMs?: number, timeoutMs?: number): Promise<BatchJob>;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
interface TenantAsset {
|
|
281
|
+
id: string;
|
|
282
|
+
bucket: string;
|
|
283
|
+
path: string;
|
|
284
|
+
url: string;
|
|
285
|
+
size: number;
|
|
286
|
+
content_type: string;
|
|
287
|
+
entity_type: string;
|
|
288
|
+
entity_id: string;
|
|
289
|
+
uploaded_by?: string;
|
|
290
|
+
uploaded_at: string;
|
|
291
|
+
tenant_id?: string;
|
|
292
|
+
created_at: string;
|
|
293
|
+
updated_at: string;
|
|
294
|
+
}
|
|
295
|
+
interface AssetListParams {
|
|
296
|
+
limit?: number;
|
|
297
|
+
offset?: number;
|
|
298
|
+
entityType?: string;
|
|
299
|
+
entityId?: string;
|
|
300
|
+
tenant?: string;
|
|
301
|
+
}
|
|
302
|
+
interface AssetListResponse {
|
|
303
|
+
data: TenantAsset[];
|
|
304
|
+
count: number;
|
|
305
|
+
limit: number;
|
|
306
|
+
offset: number;
|
|
307
|
+
}
|
|
308
|
+
interface AssetStatsResponse {
|
|
309
|
+
data: {
|
|
310
|
+
totalFiles: number;
|
|
311
|
+
totalSizeBytes: number;
|
|
312
|
+
totalSizeMB: number;
|
|
313
|
+
byContentType: Record<string, number>;
|
|
314
|
+
byEntityType: Record<string, number>;
|
|
315
|
+
};
|
|
316
|
+
}
|
|
317
|
+
declare class AssetsResource {
|
|
318
|
+
private client;
|
|
319
|
+
constructor(client: BackflowClient);
|
|
320
|
+
/** List tenant assets with optional filtering */
|
|
321
|
+
list(params?: AssetListParams): Promise<AssetListResponse>;
|
|
322
|
+
/** Get asset by ID */
|
|
323
|
+
get(id: string): Promise<{
|
|
324
|
+
data: TenantAsset;
|
|
325
|
+
}>;
|
|
326
|
+
/** Delete asset by ID */
|
|
327
|
+
delete(id: string): Promise<{
|
|
328
|
+
success: boolean;
|
|
329
|
+
}>;
|
|
330
|
+
/** Get asset storage statistics */
|
|
331
|
+
stats(tenant?: string): Promise<AssetStatsResponse>;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
declare class CacheResource {
|
|
335
|
+
private client;
|
|
336
|
+
constructor(client: BackflowClient);
|
|
337
|
+
/** Get cache statistics including hit rate, memory usage, and item count */
|
|
338
|
+
list(): Promise<unknown>;
|
|
339
|
+
/** Clear all items from the cache and reset statistics */
|
|
340
|
+
delete(): Promise<unknown>;
|
|
341
|
+
/** Invalidate all cache entries that match a given pattern */
|
|
342
|
+
create(data: Record<string, unknown>): Promise<unknown>;
|
|
343
|
+
/** Reset cache hit/miss statistics while preserving cached data */
|
|
344
|
+
createResetStats(data: Record<string, unknown>): Promise<unknown>;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
declare class DefaultResource {
|
|
348
|
+
private client;
|
|
349
|
+
constructor(client: BackflowClient);
|
|
350
|
+
/** GET /tenant/debug/raw-query */
|
|
351
|
+
list(): Promise<unknown>;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
declare class DeploymentResource {
|
|
355
|
+
private client;
|
|
356
|
+
constructor(client: BackflowClient);
|
|
357
|
+
/** Get deployment information */
|
|
358
|
+
list(): Promise<unknown>;
|
|
359
|
+
/** Get server information */
|
|
360
|
+
listServer(): Promise<unknown>;
|
|
361
|
+
/** Get full deployment status */
|
|
362
|
+
listStatus(): Promise<unknown>;
|
|
363
|
+
/** Get Cloud Run service URL */
|
|
364
|
+
listUrl(): Promise<unknown>;
|
|
365
|
+
/** Server-Sent Events (SSE) stream for real-time deployment status updates. Sends periodic status updates and heartbeats. */
|
|
366
|
+
listStream(): Promise<unknown>;
|
|
367
|
+
/** Filtered Server-Sent Events (SSE) stream for specific deployment event types. Filter by status, server, or url events. */
|
|
368
|
+
listEvents(): Promise<unknown>;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
declare class EmbeddingsResource$1 {
|
|
372
|
+
private client;
|
|
373
|
+
constructor(client: BackflowClient);
|
|
374
|
+
/** List all embedded documents with chunk counts and metadata */
|
|
375
|
+
list(): Promise<unknown>;
|
|
376
|
+
/** Upload and process a document for vector embeddings with automatic chunking. Supports various content types (code, documentation, articles) with optimized chunking strategies for RAG. */
|
|
377
|
+
create(data: Record<string, unknown>): Promise<unknown>;
|
|
378
|
+
/** Search within a specific document using semantic similarity. Performs vector search within document chunks. */
|
|
379
|
+
search(documentId: string): Promise<unknown>;
|
|
380
|
+
/** Search across all embedded documents using semantic similarity */
|
|
381
|
+
listSearch(): Promise<unknown>;
|
|
382
|
+
/** Delete all chunks and embeddings for a document. Removes the document from the vector store. */
|
|
383
|
+
delete(documentId: string): Promise<unknown>;
|
|
384
|
+
/** Process multiple documents (up to 50) for vector embeddings in a single batch. Supports both raw text and file references (PDF, DOCX, TXT, MD). Uses 3 concurrent processing threads. */
|
|
385
|
+
createBatch(data: Record<string, unknown>): Promise<unknown>;
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
declare class FeedbackResource {
|
|
389
|
+
private client;
|
|
390
|
+
constructor(client: BackflowClient);
|
|
391
|
+
/** Submit feedback for a workflow execution. Used to optimize and improve workflow performance based on user ratings and suggestions. */
|
|
392
|
+
create(data: Record<string, unknown>): Promise<unknown>;
|
|
393
|
+
/** Get feedback trends and analytics. Analyzes workflow feedback to identify patterns and areas for improvement. */
|
|
394
|
+
list(): Promise<unknown>;
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
declare class FilesResource$1 {
|
|
398
|
+
private client;
|
|
399
|
+
constructor(client: BackflowClient);
|
|
400
|
+
/** Upload a single file with entity association and tenant isolation */
|
|
401
|
+
create(data: Record<string, unknown>): Promise<unknown>;
|
|
402
|
+
/** Upload multiple files with entity association and tenant isolation */
|
|
403
|
+
createUploadMultiple(data: Record<string, unknown>): Promise<unknown>;
|
|
404
|
+
/** List files for an entity with pagination */
|
|
405
|
+
get(entityType: string, entityId: string): Promise<unknown>;
|
|
406
|
+
/** Delete all files for an entity */
|
|
407
|
+
delete(entityType: string, entityId: string): Promise<unknown>;
|
|
408
|
+
/** Download file via secure signed URL redirect (5 minute expiry) */
|
|
409
|
+
getDownload(bucket: string, path: string): Promise<unknown>;
|
|
410
|
+
/** Get a signed URL for file access (max 30 seconds expiry) */
|
|
411
|
+
getSignedUrl(bucket: string, path: string): Promise<unknown>;
|
|
412
|
+
/** Delete a file from storage */
|
|
413
|
+
deleteDELETE(bucket: string, path: string): Promise<unknown>;
|
|
414
|
+
/** Upload JSON content to storage */
|
|
415
|
+
createUploadJson(data: Record<string, unknown>): Promise<unknown>;
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
declare class GithubResource$1 {
|
|
419
|
+
private client;
|
|
420
|
+
constructor(client: BackflowClient);
|
|
421
|
+
/** Get GitHub repositories for a user */
|
|
422
|
+
get(username: string): Promise<unknown>;
|
|
423
|
+
/** Get file or directory contents from a GitHub repository */
|
|
424
|
+
getContent(owner: string, repo: string, path: string): Promise<unknown>;
|
|
425
|
+
/** Create or update a file in a GitHub repository */
|
|
426
|
+
updateContent(owner: string, repo: string, path: string, data: Record<string, unknown>): Promise<unknown>;
|
|
427
|
+
/** Delete a file from a GitHub repository */
|
|
428
|
+
deleteContent(owner: string, repo: string, path: string): Promise<unknown>;
|
|
429
|
+
/** Compare two commits and view the diff */
|
|
430
|
+
getCompare(owner: string, repo: string, basehead: string): Promise<unknown>;
|
|
431
|
+
/** Get a single commit with its changes */
|
|
432
|
+
getCommit(owner: string, repo: string, ref: string): Promise<unknown>;
|
|
433
|
+
/** List commits in a repository */
|
|
434
|
+
commits(owner: string, repo: string): Promise<unknown>;
|
|
435
|
+
/** Get pull request details */
|
|
436
|
+
getPull(owner: string, repo: string, pull_number: string): Promise<unknown>;
|
|
437
|
+
/** List files changed in a pull request with diffs */
|
|
438
|
+
files(owner: string, repo: string, pull_number: string): Promise<unknown>;
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
declare class GoalsResource {
|
|
442
|
+
private client;
|
|
443
|
+
constructor(client: BackflowClient);
|
|
444
|
+
/** Configure goal evaluation rules for a workflow. Sets KPIs, success criteria, and evaluation parameters. */
|
|
445
|
+
create(data: Record<string, unknown>): Promise<unknown>;
|
|
446
|
+
/** Manually trigger goal evaluation for a workflow. Evaluates workflow performance against configured KPIs and success criteria. */
|
|
447
|
+
createEvaluate(workflowId: string, data: Record<string, unknown>): Promise<unknown>;
|
|
448
|
+
/** Get evaluation history for a workflow. Returns all historical goal evaluation records. */
|
|
449
|
+
get(workflowId: string): Promise<unknown>;
|
|
450
|
+
/** Start scheduled goal evaluation. Automatically evaluates all active workflows at specified intervals. */
|
|
451
|
+
createStart(data: Record<string, unknown>): Promise<unknown>;
|
|
452
|
+
/** Stop scheduled goal evaluation. Cancels automatic workflow evaluations. */
|
|
453
|
+
createStop(data: Record<string, unknown>): Promise<unknown>;
|
|
454
|
+
/** Evaluate all active workflows. Generates evaluation reports for all workflows with configured goals. */
|
|
455
|
+
createEvaluateAll(data: Record<string, unknown>): Promise<unknown>;
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
declare class GoogleDriveResource {
|
|
459
|
+
private client;
|
|
460
|
+
constructor(client: BackflowClient);
|
|
461
|
+
/** List files in Google Drive */
|
|
462
|
+
list(): Promise<unknown>;
|
|
463
|
+
/** Get file metadata from Google Drive */
|
|
464
|
+
get(fileId: string): Promise<unknown>;
|
|
465
|
+
/** Update file metadata (rename, move) */
|
|
466
|
+
patch(fileId: string, data: Record<string, unknown>): Promise<unknown>;
|
|
467
|
+
/** Delete a file from Google Drive */
|
|
468
|
+
delete(fileId: string): Promise<unknown>;
|
|
469
|
+
/** Download file content from Google Drive */
|
|
470
|
+
download(fileId: string): Promise<unknown>;
|
|
471
|
+
/** Search for PDF files in Google Drive */
|
|
472
|
+
listPdfs(): Promise<unknown>;
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
declare class JiraResource {
|
|
476
|
+
private client;
|
|
477
|
+
constructor(client: BackflowClient);
|
|
478
|
+
/** Search JIRA issues using JQL */
|
|
479
|
+
list(): Promise<unknown>;
|
|
480
|
+
/** Get JIRA issue details */
|
|
481
|
+
get(issueKey: string): Promise<unknown>;
|
|
482
|
+
/** Update a JIRA issue */
|
|
483
|
+
update(issueKey: string, data: Record<string, unknown>): Promise<unknown>;
|
|
484
|
+
/** Delete a JIRA issue */
|
|
485
|
+
delete(issueKey: string): Promise<unknown>;
|
|
486
|
+
/** Create a new JIRA issue */
|
|
487
|
+
create(data: Record<string, unknown>): Promise<unknown>;
|
|
488
|
+
/** Get available transitions for a JIRA issue */
|
|
489
|
+
transitions(issueKey: string): Promise<unknown>;
|
|
490
|
+
/** Transition a JIRA issue to new status */
|
|
491
|
+
createTransition(issueKey: string, data: Record<string, unknown>): Promise<unknown>;
|
|
492
|
+
/** Get comments for a JIRA issue */
|
|
493
|
+
comments(issueKey: string): Promise<unknown>;
|
|
494
|
+
/** Add comment to a JIRA issue */
|
|
495
|
+
createComment(issueKey: string, data: Record<string, unknown>): Promise<unknown>;
|
|
496
|
+
/** Assign a JIRA issue to a user */
|
|
497
|
+
updateAssign(issueKey: string, data: Record<string, unknown>): Promise<unknown>;
|
|
498
|
+
/** Get all JIRA projects */
|
|
499
|
+
listProjects(): Promise<unknown>;
|
|
500
|
+
/** Get JIRA project details */
|
|
501
|
+
getProjects(projectKey: string): Promise<unknown>;
|
|
502
|
+
/** Get current authenticated JIRA user */
|
|
503
|
+
listMe(): Promise<unknown>;
|
|
504
|
+
/** Search JIRA users */
|
|
505
|
+
listSearch(): Promise<unknown>;
|
|
506
|
+
/** Get all JIRA issue types */
|
|
507
|
+
listIssueTypes(): Promise<unknown>;
|
|
508
|
+
/** Get all JIRA priority levels */
|
|
509
|
+
listPriorities(): Promise<unknown>;
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
declare class LlmResource {
|
|
513
|
+
private client;
|
|
514
|
+
constructor(client: BackflowClient);
|
|
515
|
+
/** POST /llm/stream */
|
|
516
|
+
create(data: Record<string, unknown>): Promise<unknown>;
|
|
517
|
+
/** GET /llm/models */
|
|
518
|
+
list(): Promise<unknown>;
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
declare class McpToolsResource {
|
|
522
|
+
private client;
|
|
523
|
+
constructor(client: BackflowClient);
|
|
524
|
+
/** List all available MCP tools from connected servers. Returns tools, connection status, and server information. */
|
|
525
|
+
list(): Promise<unknown>;
|
|
526
|
+
/** Execute a Model Context Protocol (MCP) tool. MCP tools provide external capabilities like file system access, database queries, and API calls to LLM workflows. */
|
|
527
|
+
create(data: Record<string, unknown>): Promise<unknown>;
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
declare class PolarResource {
|
|
531
|
+
private client;
|
|
532
|
+
constructor(client: BackflowClient);
|
|
533
|
+
/** Create a Polar checkout session */
|
|
534
|
+
create(data: Record<string, unknown>): Promise<unknown>;
|
|
535
|
+
/** Retrieve a Polar checkout session */
|
|
536
|
+
get(checkoutId: string): Promise<unknown>;
|
|
537
|
+
/** Create a Polar subscription */
|
|
538
|
+
createSubscriptions(data: Record<string, unknown>): Promise<unknown>;
|
|
539
|
+
/** Cancel a Polar subscription */
|
|
540
|
+
delete(subscriptionId: string): Promise<unknown>;
|
|
541
|
+
/** List Polar products */
|
|
542
|
+
list(): Promise<unknown>;
|
|
543
|
+
/** Create a Polar product */
|
|
544
|
+
createProducts(data: Record<string, unknown>): Promise<unknown>;
|
|
545
|
+
/** Retrieve a Polar order */
|
|
546
|
+
getOrders(orderId: string): Promise<unknown>;
|
|
547
|
+
/** Create a Polar benefit */
|
|
548
|
+
createBenefits(data: Record<string, unknown>): Promise<unknown>;
|
|
549
|
+
/** Grant a Polar benefit to a customer */
|
|
550
|
+
createGrants(data: Record<string, unknown>): Promise<unknown>;
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
declare class ProjectsResource {
|
|
554
|
+
private client;
|
|
555
|
+
constructor(client: BackflowClient);
|
|
556
|
+
/** List version history for a project with pagination and date range filter */
|
|
557
|
+
versions(id: string): Promise<unknown>;
|
|
558
|
+
/** Create a new project version record (Pro tier) */
|
|
559
|
+
createVersion(id: string, data: Record<string, unknown>): Promise<unknown>;
|
|
560
|
+
/** Delete all versions for a project and their R2 files (parallel) */
|
|
561
|
+
deleteAllVersions(id: string): Promise<unknown>;
|
|
562
|
+
/** Get a specific version record */
|
|
563
|
+
getVersion(id: string, versionId: string): Promise<unknown>;
|
|
564
|
+
/** Delete a specific project version and its R2 files */
|
|
565
|
+
deleteVersion(id: string, versionId: string): Promise<unknown>;
|
|
566
|
+
/** Rollback project to a previous version (Pro tier) */
|
|
567
|
+
rollback(id: string, version: string, data: Record<string, unknown>): Promise<unknown>;
|
|
568
|
+
/** Save project with parallel R2 uploads and Firestore updates */
|
|
569
|
+
updateSave(projectId: string, data: Record<string, unknown>): Promise<unknown>;
|
|
570
|
+
/** Save project and execute content as workflow */
|
|
571
|
+
saveAndRun(projectId: string, data: Record<string, unknown>): Promise<unknown>;
|
|
572
|
+
/** Get project by ID */
|
|
573
|
+
get(id: string): Promise<unknown>;
|
|
574
|
+
/** Update project metadata (title, description, etc.) */
|
|
575
|
+
patch(id: string, data: Record<string, unknown>): Promise<unknown>;
|
|
576
|
+
/** Delete project and all related files/versions (parallel) */
|
|
577
|
+
delete(id: string): Promise<unknown>;
|
|
578
|
+
/** List all shares for a project */
|
|
579
|
+
shares(id: string): Promise<unknown>;
|
|
580
|
+
/** Share a project with another user */
|
|
581
|
+
share(id: string, data: Record<string, unknown>): Promise<unknown>;
|
|
582
|
+
/** Remove share access from a user */
|
|
583
|
+
deleteShare(id: string, userId: string): Promise<unknown>;
|
|
584
|
+
/** Get public project by ID (no auth required) */
|
|
585
|
+
public(projectId: string): Promise<unknown>;
|
|
586
|
+
/** Toggle project public/private status with optional email notification */
|
|
587
|
+
patchPublic(id: string, data: Record<string, unknown>): Promise<unknown>;
|
|
588
|
+
/** List all projects shared with the current user */
|
|
589
|
+
list(): Promise<unknown>;
|
|
590
|
+
/** Update project files (add/remove attached assets) */
|
|
591
|
+
patchFile(id: string, data: Record<string, unknown>): Promise<unknown>;
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
declare class PublishResource {
|
|
595
|
+
private client;
|
|
596
|
+
constructor(client: BackflowClient);
|
|
597
|
+
/** Initialize publishing system - checks database setup */
|
|
598
|
+
create(data: Record<string, unknown>): Promise<unknown>;
|
|
599
|
+
/** Verify database migration was applied */
|
|
600
|
+
createVerify(data: Record<string, unknown>): Promise<unknown>;
|
|
601
|
+
/** Publish an entity (checks database readiness automatically) */
|
|
602
|
+
createEntity(data: Record<string, unknown>): Promise<unknown>;
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
declare class QueuesResource$1 {
|
|
606
|
+
private client;
|
|
607
|
+
constructor(client: BackflowClient);
|
|
608
|
+
/** Get all queues and their statistics (tenant-isolated) */
|
|
609
|
+
list(): Promise<unknown>;
|
|
610
|
+
/** Get statistics for a specific queue (tenant-isolated) */
|
|
611
|
+
stats(name: string): Promise<unknown>;
|
|
612
|
+
/** Get jobs from a queue (tenant-isolated) */
|
|
613
|
+
jobs(name: string): Promise<unknown>;
|
|
614
|
+
/** Add a job to the queue (with tenant isolation) */
|
|
615
|
+
createJob(name: string, data: Record<string, unknown>): Promise<unknown>;
|
|
616
|
+
/** Get a specific job (tenant-isolated) */
|
|
617
|
+
getJob(name: string, jobId: string): Promise<unknown>;
|
|
618
|
+
/** Retry a failed job (tenant-isolated) */
|
|
619
|
+
retry(name: string, jobId: string, data: Record<string, unknown>): Promise<unknown>;
|
|
620
|
+
/** Pause a queue (admin only - affects all tenants) */
|
|
621
|
+
pause(name: string, data: Record<string, unknown>): Promise<unknown>;
|
|
622
|
+
/** Resume a paused queue (admin only - affects all tenants) */
|
|
623
|
+
resume(name: string, data: Record<string, unknown>): Promise<unknown>;
|
|
624
|
+
/** Clean old jobs from queue (tenant-isolated) */
|
|
625
|
+
createClean(name: string, data: Record<string, unknown>): Promise<unknown>;
|
|
626
|
+
/** Get detailed performance metrics for a queue */
|
|
627
|
+
metrics(name: string): Promise<unknown>;
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
declare class SearchResource$1 {
|
|
631
|
+
private client;
|
|
632
|
+
constructor(client: BackflowClient);
|
|
633
|
+
/** Fast search across an entity with configurable modes (exact, fuzzy, hybrid) */
|
|
634
|
+
get(entity: string): Promise<unknown>;
|
|
635
|
+
/** Index entity records for vector search */
|
|
636
|
+
create(data: Record<string, unknown>): Promise<unknown>;
|
|
637
|
+
/** Delete and reindex all records for an entity */
|
|
638
|
+
createReindex(data: Record<string, unknown>): Promise<unknown>;
|
|
639
|
+
/** Delete all indexed records for an entity */
|
|
640
|
+
delete(entity: string): Promise<unknown>;
|
|
641
|
+
/** Get search index statistics */
|
|
642
|
+
list(): Promise<unknown>;
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
declare class StripeResource {
|
|
646
|
+
private client;
|
|
647
|
+
constructor(client: BackflowClient);
|
|
648
|
+
/** Create a Stripe customer */
|
|
649
|
+
create(data: Record<string, unknown>): Promise<unknown>;
|
|
650
|
+
/** Create a Stripe payment intent */
|
|
651
|
+
createPaymentIntents(data: Record<string, unknown>): Promise<unknown>;
|
|
652
|
+
/** Create a Stripe subscription */
|
|
653
|
+
createSubscriptions(data: Record<string, unknown>): Promise<unknown>;
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
declare class TeamsResource {
|
|
657
|
+
private client;
|
|
658
|
+
constructor(client: BackflowClient);
|
|
659
|
+
/** Get all teams */
|
|
660
|
+
list(): Promise<unknown>;
|
|
661
|
+
/** Create a new team */
|
|
662
|
+
create(data: Record<string, unknown>): Promise<unknown>;
|
|
663
|
+
/** Get team by ID */
|
|
664
|
+
get(id: string): Promise<unknown>;
|
|
665
|
+
/** Update team metadata (name, description, members) */
|
|
666
|
+
update(id: string, data: Record<string, unknown>): Promise<unknown>;
|
|
667
|
+
/** Delete team */
|
|
668
|
+
delete(id: string): Promise<unknown>;
|
|
669
|
+
/** Get all projects for a team */
|
|
670
|
+
projects(id: string): Promise<unknown>;
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
declare class TenantWebhookReceiversResource {
|
|
674
|
+
private client;
|
|
675
|
+
constructor(client: BackflowClient);
|
|
676
|
+
/** List webhook receivers */
|
|
677
|
+
list(): Promise<unknown>;
|
|
678
|
+
/** Create webhook receiver */
|
|
679
|
+
create(data: Record<string, unknown>): Promise<unknown>;
|
|
680
|
+
/** Get webhook receiver */
|
|
681
|
+
get(id: string): Promise<unknown>;
|
|
682
|
+
/** Update webhook receiver */
|
|
683
|
+
update(id: string, data: Record<string, unknown>): Promise<unknown>;
|
|
684
|
+
/** Delete webhook receiver */
|
|
685
|
+
delete(id: string): Promise<unknown>;
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
declare class TenantWebhooksResource {
|
|
689
|
+
private client;
|
|
690
|
+
constructor(client: BackflowClient);
|
|
691
|
+
/** List webhooks */
|
|
692
|
+
list(): Promise<unknown>;
|
|
693
|
+
/** Create webhook */
|
|
694
|
+
create(data: Record<string, unknown>): Promise<unknown>;
|
|
695
|
+
/** Get webhook */
|
|
696
|
+
get(id: string): Promise<unknown>;
|
|
697
|
+
/** Update webhook */
|
|
698
|
+
update(id: string, data: Record<string, unknown>): Promise<unknown>;
|
|
699
|
+
/** Delete webhook */
|
|
700
|
+
delete(id: string): Promise<unknown>;
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
declare class ToolDiscoveryResource {
|
|
704
|
+
private client;
|
|
705
|
+
constructor(client: BackflowClient);
|
|
706
|
+
/** Get all registered tools including MCP, user-configured, and built-in tools */
|
|
707
|
+
list(): Promise<unknown>;
|
|
708
|
+
/** Search for tools using text query, category, tags, capabilities, and performance filters */
|
|
709
|
+
create(data: Record<string, unknown>): Promise<unknown>;
|
|
710
|
+
/** Search for tools using natural language semantic similarity */
|
|
711
|
+
createSemanticSearch(data: Record<string, unknown>): Promise<unknown>;
|
|
712
|
+
/** Use AI to automatically select appropriate tools based on a natural language goal */
|
|
713
|
+
createSelect(data: Record<string, unknown>): Promise<unknown>;
|
|
714
|
+
/** Get tool recommendations based on goal and historical performance data */
|
|
715
|
+
createRecommend(data: Record<string, unknown>): Promise<unknown>;
|
|
716
|
+
/** Get performance metrics (success rate, latency, usage) for a specific tool */
|
|
717
|
+
metrics(toolName: string): Promise<unknown>;
|
|
718
|
+
/** Index all registered tools for semantic search using embeddings */
|
|
719
|
+
createIndex(data: Record<string, unknown>): Promise<unknown>;
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
declare class TrackingResource {
|
|
723
|
+
private client;
|
|
724
|
+
constructor(client: BackflowClient);
|
|
725
|
+
/** Get MCP call statistics for the tenant */
|
|
726
|
+
list(): Promise<unknown>;
|
|
727
|
+
/** Get field-level change history for an entity */
|
|
728
|
+
history(entityType: string, entityId: string): Promise<unknown>;
|
|
729
|
+
/** Get change history for a specific field */
|
|
730
|
+
getField(entityType: string, entityId: string, fieldName: string): Promise<unknown>;
|
|
731
|
+
/** Get tracking buffer status (AI usage buffer size) */
|
|
732
|
+
listStatus(): Promise<unknown>;
|
|
733
|
+
/** Manually flush tracking buffers to database */
|
|
734
|
+
create(data: Record<string, unknown>): Promise<unknown>;
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
declare class TwitterResource {
|
|
738
|
+
private client;
|
|
739
|
+
constructor(client: BackflowClient);
|
|
740
|
+
/** Search X (Twitter) tweets by query */
|
|
741
|
+
list(): Promise<unknown>;
|
|
742
|
+
/** Get details of a specific tweet */
|
|
743
|
+
get(tweetId: string): Promise<unknown>;
|
|
744
|
+
/** Delete a tweet */
|
|
745
|
+
delete(tweetId: string): Promise<unknown>;
|
|
746
|
+
/** Post a new tweet */
|
|
747
|
+
create(data: Record<string, unknown>): Promise<unknown>;
|
|
748
|
+
/** Like a tweet */
|
|
749
|
+
createLike(userId: string, data: Record<string, unknown>): Promise<unknown>;
|
|
750
|
+
/** Unlike a tweet */
|
|
751
|
+
deleteLike(userId: string, tweetId: string): Promise<unknown>;
|
|
752
|
+
/** Retweet a tweet */
|
|
753
|
+
createRetweet(userId: string, data: Record<string, unknown>): Promise<unknown>;
|
|
754
|
+
/** Remove a retweet */
|
|
755
|
+
deleteRetweet(userId: string, tweetId: string): Promise<unknown>;
|
|
756
|
+
/** Get user information by username */
|
|
757
|
+
getUsername(username: string): Promise<unknown>;
|
|
758
|
+
/** Get user information by user ID */
|
|
759
|
+
getUsers(userId: string): Promise<unknown>;
|
|
760
|
+
/** Get authenticated user information */
|
|
761
|
+
listMe(): Promise<unknown>;
|
|
762
|
+
/** Get recent tweets from a user */
|
|
763
|
+
tweets(userId: string): Promise<unknown>;
|
|
764
|
+
/** Follow a user */
|
|
765
|
+
createFollowing(userId: string, data: Record<string, unknown>): Promise<unknown>;
|
|
766
|
+
/** Unfollow a user */
|
|
767
|
+
deleteFollowing(userId: string, targetUserId: string): Promise<unknown>;
|
|
768
|
+
/** Get followers of a user */
|
|
769
|
+
followers(userId: string): Promise<unknown>;
|
|
770
|
+
/** Get users that a user is following */
|
|
771
|
+
followingList(userId: string): Promise<unknown>;
|
|
772
|
+
/** Get users who liked a tweet */
|
|
773
|
+
likedBy(tweetId: string): Promise<unknown>;
|
|
774
|
+
/** Get users who retweeted a tweet */
|
|
775
|
+
retweetedBy(tweetId: string): Promise<unknown>;
|
|
776
|
+
/** Get tweets in a conversation thread */
|
|
777
|
+
getConversations(conversationId: string): Promise<unknown>;
|
|
778
|
+
/** Get tweets liked by a user */
|
|
779
|
+
likedTweets(userId: string): Promise<unknown>;
|
|
780
|
+
}
|
|
781
|
+
|
|
782
|
+
declare class UsageResource$1 {
|
|
783
|
+
private client;
|
|
784
|
+
constructor(client: BackflowClient);
|
|
785
|
+
/** Get unified usage metrics for a user across AI, API, and integrations */
|
|
786
|
+
get(userId: string): Promise<unknown>;
|
|
787
|
+
/** Get a brief summary of user usage */
|
|
788
|
+
summary(userId: string): Promise<unknown>;
|
|
789
|
+
/** Get usage metrics for the authenticated user */
|
|
790
|
+
list(): Promise<unknown>;
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
declare class WebsocketResource {
|
|
794
|
+
private client;
|
|
795
|
+
constructor(client: BackflowClient);
|
|
796
|
+
/** WebSocket API Documentation */
|
|
797
|
+
list(): Promise<unknown>;
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
declare class WorkflowsResource$1 {
|
|
801
|
+
private client;
|
|
802
|
+
constructor(client: BackflowClient);
|
|
803
|
+
/** Orchestrate a task by ID. Executes predefined task orchestration logic. */
|
|
804
|
+
create(data: Record<string, unknown>): Promise<unknown>;
|
|
805
|
+
/** Execute an agentic workflow with tools and steps. Workflows define a series of actions that can call LLMs, APIs, shell commands, and MCP tools. */
|
|
806
|
+
createWorkflow(data: Record<string, unknown>): Promise<unknown>;
|
|
807
|
+
/** List all workflow executions with date range filter and pagination. */
|
|
808
|
+
list(): Promise<unknown>;
|
|
809
|
+
/** Delete all workflow executions and their activity records */
|
|
810
|
+
delete(): Promise<unknown>;
|
|
811
|
+
/** Delete a specific workflow execution and all its activity records */
|
|
812
|
+
deleteExecutions(workflowId: string): Promise<unknown>;
|
|
813
|
+
/** Get execution history for a workflow by ID. Returns all historical execution records. */
|
|
814
|
+
history(workflowId: string): Promise<unknown>;
|
|
815
|
+
/** Resume a paused workflow execution. Allows continuing or cancelling execution with optional user input. */
|
|
816
|
+
createResume(data: Record<string, unknown>): Promise<unknown>;
|
|
817
|
+
/** Request pause for a running workflow. The workflow will pause after the current step completes. */
|
|
818
|
+
pause(executionId: string, data: Record<string, unknown>): Promise<unknown>;
|
|
819
|
+
/** Cancel a running workflow. The workflow will stop after the current step completes. */
|
|
820
|
+
cancel(executionId: string, data: Record<string, unknown>): Promise<unknown>;
|
|
821
|
+
/** Get background execution status for workflows that returned early */
|
|
822
|
+
status(executionId: string): Promise<unknown>;
|
|
823
|
+
/** Retry a workflow execution. Can restart from beginning or resume from last checkpoint. */
|
|
824
|
+
retry(executionId: string, data: Record<string, unknown>): Promise<unknown>;
|
|
825
|
+
/** Health check endpoint with detailed component status. Returns status of embeddings, vector store, MCP servers, and database. */
|
|
826
|
+
listHealth(): Promise<unknown>;
|
|
827
|
+
/** Automatically generate and execute a workflow from a natural language goal using AI */
|
|
828
|
+
createDynamic(data: Record<string, unknown>): Promise<unknown>;
|
|
829
|
+
}
|
|
830
|
+
|
|
831
|
+
declare class WorkspacesResource {
|
|
832
|
+
private client;
|
|
833
|
+
constructor(client: BackflowClient);
|
|
834
|
+
/** Get all workspaces */
|
|
835
|
+
list(): Promise<unknown>;
|
|
836
|
+
/** Create a new workspace */
|
|
837
|
+
create(data: Record<string, unknown>): Promise<unknown>;
|
|
838
|
+
/** Get workspace by ID */
|
|
839
|
+
get(id: string): Promise<unknown>;
|
|
840
|
+
/** Update workspace */
|
|
841
|
+
update(id: string, data: Record<string, unknown>): Promise<unknown>;
|
|
842
|
+
/** Delete workspace */
|
|
843
|
+
delete(id: string): Promise<unknown>;
|
|
844
|
+
}
|
|
845
|
+
|
|
846
|
+
interface AIChatOptions {
|
|
847
|
+
messages: Array<{
|
|
848
|
+
role: string;
|
|
849
|
+
content: string;
|
|
850
|
+
}>;
|
|
851
|
+
projectContext?: unknown;
|
|
852
|
+
}
|
|
853
|
+
interface AIChatResponse {
|
|
854
|
+
chatResponse: {
|
|
855
|
+
message: string;
|
|
856
|
+
suggestions?: string[];
|
|
857
|
+
};
|
|
858
|
+
}
|
|
859
|
+
declare class AIResource {
|
|
860
|
+
private client;
|
|
861
|
+
constructor(client: BackflowClient);
|
|
862
|
+
chat(options: AIChatOptions): Promise<AIChatResponse>;
|
|
863
|
+
}
|
|
864
|
+
|
|
865
|
+
interface PresenceData {
|
|
866
|
+
projectId: string;
|
|
867
|
+
cursor?: unknown;
|
|
868
|
+
selection?: unknown;
|
|
869
|
+
}
|
|
870
|
+
declare class CollaborationResource {
|
|
871
|
+
private client;
|
|
872
|
+
constructor(client: BackflowClient);
|
|
873
|
+
presence(data: PresenceData): Promise<{
|
|
874
|
+
success: boolean;
|
|
875
|
+
}>;
|
|
876
|
+
}
|
|
877
|
+
|
|
878
|
+
interface HighResExportOptions {
|
|
879
|
+
format: 'png' | 'svg' | 'pdf';
|
|
880
|
+
scale: number;
|
|
881
|
+
content: unknown;
|
|
882
|
+
contentType?: string;
|
|
883
|
+
}
|
|
884
|
+
interface HighResExportResult {
|
|
885
|
+
export: string;
|
|
886
|
+
r2Upload: {
|
|
887
|
+
url: string;
|
|
888
|
+
};
|
|
889
|
+
}
|
|
890
|
+
declare class ExportsResource {
|
|
891
|
+
private client;
|
|
892
|
+
constructor(client: BackflowClient);
|
|
893
|
+
highRes(options: HighResExportOptions): Promise<HighResExportResult>;
|
|
894
|
+
}
|
|
895
|
+
|
|
896
|
+
interface UserMetrics {
|
|
897
|
+
role?: string;
|
|
898
|
+
teamSize?: string;
|
|
899
|
+
useCase?: string;
|
|
900
|
+
createdAt?: string;
|
|
901
|
+
updatedAt?: string;
|
|
902
|
+
}
|
|
903
|
+
interface UserProfile {
|
|
904
|
+
uid: string;
|
|
905
|
+
email?: string;
|
|
906
|
+
displayName?: string;
|
|
907
|
+
photoURL?: string;
|
|
908
|
+
emailVerified?: boolean;
|
|
909
|
+
}
|
|
910
|
+
interface UpdateProfileOptions {
|
|
911
|
+
displayName?: string;
|
|
912
|
+
photoURL?: string;
|
|
913
|
+
}
|
|
914
|
+
declare class UserResource {
|
|
915
|
+
private client;
|
|
916
|
+
constructor(client: BackflowClient);
|
|
917
|
+
createMetrics(metrics: UserMetrics): Promise<{
|
|
918
|
+
success: boolean;
|
|
919
|
+
}>;
|
|
920
|
+
getMetrics(): Promise<{
|
|
921
|
+
data: UserMetrics;
|
|
922
|
+
}>;
|
|
923
|
+
updateMetrics(metrics: Partial<UserMetrics>): Promise<{
|
|
924
|
+
success: boolean;
|
|
925
|
+
}>;
|
|
926
|
+
getProfile(): Promise<{
|
|
927
|
+
user: UserProfile;
|
|
928
|
+
}>;
|
|
929
|
+
updateProfile(options: UpdateProfileOptions): Promise<{
|
|
930
|
+
success: boolean;
|
|
931
|
+
user: UserProfile;
|
|
932
|
+
}>;
|
|
933
|
+
}
|
|
934
|
+
|
|
935
|
+
interface RouteInfo {
|
|
936
|
+
path: string;
|
|
937
|
+
method: string;
|
|
938
|
+
description?: string;
|
|
939
|
+
tags?: string[];
|
|
940
|
+
}
|
|
941
|
+
interface CollectionInfo {
|
|
942
|
+
collection: string;
|
|
943
|
+
routes: RouteInfo[];
|
|
944
|
+
}
|
|
945
|
+
interface EntityRecord {
|
|
946
|
+
id: string;
|
|
947
|
+
[key: string]: unknown;
|
|
948
|
+
}
|
|
949
|
+
interface ListEntitiesOptions {
|
|
950
|
+
limit?: number;
|
|
951
|
+
offset?: number;
|
|
952
|
+
includeDeleted?: boolean;
|
|
953
|
+
}
|
|
954
|
+
interface GetEntityOptions {
|
|
955
|
+
includeDeleted?: boolean;
|
|
956
|
+
}
|
|
957
|
+
interface DeleteEntityOptions {
|
|
958
|
+
hard?: boolean;
|
|
959
|
+
softDelete?: boolean;
|
|
960
|
+
}
|
|
961
|
+
interface DeleteEntityResult {
|
|
962
|
+
success: boolean;
|
|
963
|
+
softDeleted?: boolean;
|
|
964
|
+
}
|
|
965
|
+
interface RestoreEntityResult {
|
|
966
|
+
success: boolean;
|
|
967
|
+
data?: EntityRecord;
|
|
968
|
+
}
|
|
969
|
+
interface ListEntitiesResult {
|
|
970
|
+
data: EntityRecord[];
|
|
971
|
+
count?: number;
|
|
972
|
+
}
|
|
973
|
+
type ValidationPreset = "email" | "url" | "phone-us" | "phone-intl" | "uuid" | "slug" | "username" | "password" | "name" | "currency" | "percentage" | "date" | "datetime" | "time" | "ip" | "ipv4" | "ipv6" | "mac-address" | "credit-card" | "postal-code-us" | "ssn" | "hex-color" | "json";
|
|
974
|
+
type FieldType = "text" | "varchar" | "integer" | "bigint" | "decimal" | "boolean" | "timestamp" | "date" | "json" | "jsonb" | "array" | "uuid" | "enum";
|
|
975
|
+
interface SchemaField {
|
|
976
|
+
name: string;
|
|
977
|
+
source: "builtin" | "route" | "entity";
|
|
978
|
+
type?: FieldType;
|
|
979
|
+
required?: boolean;
|
|
980
|
+
preset?: ValidationPreset;
|
|
981
|
+
min?: number;
|
|
982
|
+
max?: number;
|
|
983
|
+
pattern?: string;
|
|
984
|
+
enum?: string[];
|
|
985
|
+
}
|
|
986
|
+
interface CollectionSchema {
|
|
987
|
+
collection: string;
|
|
988
|
+
fields: SchemaField[];
|
|
989
|
+
}
|
|
990
|
+
interface ValidationResult$1 {
|
|
991
|
+
valid: boolean;
|
|
992
|
+
errors?: Array<{
|
|
993
|
+
field: string;
|
|
994
|
+
message: string;
|
|
995
|
+
}>;
|
|
996
|
+
}
|
|
997
|
+
declare class EntitiesResource {
|
|
998
|
+
private client;
|
|
999
|
+
constructor(client: BackflowClient);
|
|
1000
|
+
listCollections(): Promise<CollectionInfo[]>;
|
|
1001
|
+
list(collection: string, options?: ListEntitiesOptions): Promise<ListEntitiesResult>;
|
|
1002
|
+
get(collection: string, id: string, options?: GetEntityOptions): Promise<EntityRecord>;
|
|
1003
|
+
create(collection: string, data: Record<string, unknown>): Promise<EntityRecord>;
|
|
1004
|
+
update(collection: string, id: string, data: Record<string, unknown>): Promise<EntityRecord>;
|
|
1005
|
+
delete(collection: string, id: string, options?: DeleteEntityOptions): Promise<DeleteEntityResult>;
|
|
1006
|
+
restore(collection: string, id: string): Promise<RestoreEntityResult>;
|
|
1007
|
+
getSchema(): Promise<CollectionSchema[]>;
|
|
1008
|
+
/**
|
|
1009
|
+
* Get schema for a specific collection
|
|
1010
|
+
*/
|
|
1011
|
+
getCollectionSchema(collection: string): Promise<CollectionSchema | null>;
|
|
1012
|
+
/**
|
|
1013
|
+
* Validate data against a collection's schema (client-side)
|
|
1014
|
+
*/
|
|
1015
|
+
validate(collection: string, data: Record<string, unknown>): Promise<ValidationResult$1>;
|
|
1016
|
+
private validatePreset;
|
|
1017
|
+
/**
|
|
1018
|
+
* Create with validation (validates before sending to server)
|
|
1019
|
+
*/
|
|
1020
|
+
createValidated(collection: string, data: Record<string, unknown>): Promise<{
|
|
1021
|
+
data?: EntityRecord;
|
|
1022
|
+
errors?: ValidationResult$1["errors"];
|
|
1023
|
+
}>;
|
|
1024
|
+
/**
|
|
1025
|
+
* Update with validation (validates before sending to server)
|
|
1026
|
+
*/
|
|
1027
|
+
updateValidated(collection: string, id: string, data: Record<string, unknown>): Promise<{
|
|
1028
|
+
data?: EntityRecord;
|
|
1029
|
+
errors?: ValidationResult$1["errors"];
|
|
1030
|
+
}>;
|
|
1031
|
+
}
|
|
1032
|
+
|
|
1033
|
+
interface FileUploadOptions {
|
|
1034
|
+
bucket?: string;
|
|
1035
|
+
entityType?: string;
|
|
1036
|
+
entityId?: string;
|
|
1037
|
+
}
|
|
1038
|
+
interface FileMetadata {
|
|
1039
|
+
id: string;
|
|
1040
|
+
bucket: string;
|
|
1041
|
+
path: string;
|
|
1042
|
+
url: string;
|
|
1043
|
+
size: number;
|
|
1044
|
+
content_type: string;
|
|
1045
|
+
uploaded_at: string;
|
|
1046
|
+
uploaded_by: string;
|
|
1047
|
+
tenant_id: string;
|
|
1048
|
+
entity_type: string;
|
|
1049
|
+
entity_id: string;
|
|
1050
|
+
created_at?: {
|
|
1051
|
+
_seconds: number;
|
|
1052
|
+
_nanoseconds: number;
|
|
1053
|
+
} | string;
|
|
1054
|
+
}
|
|
1055
|
+
interface SignedUrlResponse {
|
|
1056
|
+
success: boolean;
|
|
1057
|
+
signedUrl: string;
|
|
1058
|
+
expiresAt: string;
|
|
1059
|
+
}
|
|
1060
|
+
interface DownloadProgress {
|
|
1061
|
+
loaded: number;
|
|
1062
|
+
total: number;
|
|
1063
|
+
percentage: number;
|
|
1064
|
+
}
|
|
1065
|
+
declare class FilesResource {
|
|
1066
|
+
private client;
|
|
1067
|
+
constructor(client: BackflowClient);
|
|
1068
|
+
upload(file: File, options?: FileUploadOptions): Promise<FileMetadata>;
|
|
1069
|
+
uploadMultiple(files: File[], options?: FileUploadOptions): Promise<FileMetadata[]>;
|
|
1070
|
+
list(entityType: string, entityId: string, options?: {
|
|
1071
|
+
limit?: number;
|
|
1072
|
+
offset?: number;
|
|
1073
|
+
}): Promise<FileMetadata[]>;
|
|
1074
|
+
getSignedUrl(bucket: string, key: string, expiresIn?: number): Promise<SignedUrlResponse>;
|
|
1075
|
+
download(bucket: string, key: string): Promise<Blob>;
|
|
1076
|
+
/**
|
|
1077
|
+
* Stream file download with optional progress tracking
|
|
1078
|
+
* More efficient for large files than standard download()
|
|
1079
|
+
* Streaming must be enabled in backend config (r2.streaming.enabled: true)
|
|
1080
|
+
*/
|
|
1081
|
+
downloadStream(bucket: string, key: string, options?: {
|
|
1082
|
+
onProgress?: (progress: DownloadProgress) => void;
|
|
1083
|
+
}): Promise<Blob>;
|
|
1084
|
+
/**
|
|
1085
|
+
* Get a raw stream for the file
|
|
1086
|
+
* Useful for custom processing or piping to other streams
|
|
1087
|
+
* Streaming must be enabled in backend config (r2.streaming.enabled: true)
|
|
1088
|
+
*/
|
|
1089
|
+
getDownloadStream(bucket: string, key: string): Promise<ReadableStream<Uint8Array>>;
|
|
1090
|
+
delete(bucket: string, key: string): Promise<{
|
|
1091
|
+
success: boolean;
|
|
1092
|
+
}>;
|
|
1093
|
+
deleteByEntity(entityType: string, entityId: string): Promise<{
|
|
1094
|
+
success: boolean;
|
|
1095
|
+
deleted: number;
|
|
1096
|
+
}>;
|
|
1097
|
+
uploadJson(options: {
|
|
1098
|
+
content: string;
|
|
1099
|
+
filename: string;
|
|
1100
|
+
entityType?: string;
|
|
1101
|
+
entityId?: string;
|
|
1102
|
+
bucket?: string;
|
|
1103
|
+
}): Promise<{
|
|
1104
|
+
upload: {
|
|
1105
|
+
url: string;
|
|
1106
|
+
key: string;
|
|
1107
|
+
bucket: string;
|
|
1108
|
+
path: string;
|
|
1109
|
+
};
|
|
1110
|
+
}>;
|
|
1111
|
+
}
|
|
1112
|
+
|
|
1113
|
+
declare const TOOL_TYPES: readonly ["llm_call", "api_call", "shell_command", "web_search", "file_edit", "git_command", "mcp_tool", "storage", "database", "notification", "workflow", "rag", "cache", "emit_event", "transform"];
|
|
1114
|
+
declare const TRIGGER_TYPES: readonly ["manual", "cron", "webhook", "event"];
|
|
1115
|
+
declare const NOTIFY_CHANNELS: readonly ["email", "sms", "whatsapp", "push", "slack"];
|
|
1116
|
+
declare const NOTIFY_PRIORITIES: readonly ["low", "normal", "high", "urgent"];
|
|
1117
|
+
declare const DB_OPERATIONS: readonly ["get", "query", "insert", "update", "upsert", "delete", "deletewhere", "arrayRemove", "updateArrayElement", "count"];
|
|
1118
|
+
declare const STORAGE_OPERATIONS: readonly ["get", "download", "put", "upload", "list", "signedUrl", "delete", "deleteByPrefix", "url", "publicUrl"];
|
|
1119
|
+
declare const CACHE_OPERATIONS: readonly ["get", "set", "delete", "invalidate"];
|
|
1120
|
+
declare const LLM_PROVIDERS: readonly ["openai", "anthropic", "google", "openrouter", "lmstudio", "custom", "claude", "ollama"];
|
|
1121
|
+
declare const CLI_PROVIDERS: readonly ["claude", "openai", "aider", "anthropic", "claude-cli", "openai-cli", "ollama-cli"];
|
|
1122
|
+
declare const DB_PROVIDERS: readonly ["firebase", "supabase", "sqlite", "custom"];
|
|
1123
|
+
declare const HTTP_METHODS: readonly ["GET", "POST", "PUT", "PATCH", "DELETE"];
|
|
1124
|
+
declare const RAG_MODES: readonly ["single", "accumulate", "iterative"];
|
|
1125
|
+
declare const CHUNKING_STRATEGIES: readonly ["fixed_size", "recursive", "token_based", "semantic"];
|
|
1126
|
+
declare const IMAGE_DETAILS: readonly ["auto", "low", "high"];
|
|
1127
|
+
declare const CONDITION_OPERATORS: readonly ["$eq", "$ne", "$gt", "$gte", "$lt", "$lte", "$in", "$exists"];
|
|
1128
|
+
type ToolType = typeof TOOL_TYPES[number];
|
|
1129
|
+
type TriggerType = typeof TRIGGER_TYPES[number];
|
|
1130
|
+
type NotifyChannel = typeof NOTIFY_CHANNELS[number];
|
|
1131
|
+
type NotifyPriority = typeof NOTIFY_PRIORITIES[number];
|
|
1132
|
+
interface PropertyValidation {
|
|
1133
|
+
type: 'string' | 'number' | 'boolean' | 'array' | 'object' | 'enum';
|
|
1134
|
+
required: boolean;
|
|
1135
|
+
multiselect?: boolean;
|
|
1136
|
+
options?: readonly string[];
|
|
1137
|
+
itemType?: PropertyValidation;
|
|
1138
|
+
properties?: Record<string, PropertyValidation>;
|
|
1139
|
+
description?: string;
|
|
1140
|
+
default?: unknown;
|
|
1141
|
+
}
|
|
1142
|
+
interface WorkflowValidationSchema {
|
|
1143
|
+
root: Record<string, PropertyValidation>;
|
|
1144
|
+
tool: Record<string, PropertyValidation>;
|
|
1145
|
+
step: Record<string, PropertyValidation>;
|
|
1146
|
+
trigger: Record<string, PropertyValidation>;
|
|
1147
|
+
pausePoint: Record<string, PropertyValidation>;
|
|
1148
|
+
notify: Record<string, PropertyValidation>;
|
|
1149
|
+
workflow: Record<string, PropertyValidation>;
|
|
1150
|
+
fileAttachment: Record<string, PropertyValidation>;
|
|
1151
|
+
imageAttachment: Record<string, PropertyValidation>;
|
|
1152
|
+
conditionOperators: Record<string, PropertyValidation>;
|
|
1153
|
+
}
|
|
1154
|
+
declare const WORKFLOW_VALIDATION_SCHEMA: WorkflowValidationSchema;
|
|
1155
|
+
interface WorkflowConfig {
|
|
1156
|
+
id?: string;
|
|
1157
|
+
name?: string;
|
|
1158
|
+
steps: WorkflowStep[];
|
|
1159
|
+
tools?: WorkflowTool[];
|
|
1160
|
+
masterContext?: string;
|
|
1161
|
+
}
|
|
1162
|
+
interface WorkflowStep {
|
|
1163
|
+
id: string;
|
|
1164
|
+
action: string;
|
|
1165
|
+
params?: Record<string, unknown>;
|
|
1166
|
+
dependsOn?: string[];
|
|
1167
|
+
parallel?: boolean;
|
|
1168
|
+
earlyReturn?: boolean;
|
|
1169
|
+
queueAsJob?: boolean;
|
|
1170
|
+
condition?: string;
|
|
1171
|
+
pausePoint?: PausePoint;
|
|
1172
|
+
files?: string[];
|
|
1173
|
+
images?: string[];
|
|
1174
|
+
/** If true, step failure won't stop the workflow */
|
|
1175
|
+
optional?: boolean;
|
|
1176
|
+
/** Alias for optional */
|
|
1177
|
+
continueOnError?: boolean;
|
|
1178
|
+
/** Value to use if step fails when optional=true */
|
|
1179
|
+
defaultValue?: unknown;
|
|
1180
|
+
/** Variable name to store step output */
|
|
1181
|
+
output?: string;
|
|
1182
|
+
}
|
|
1183
|
+
interface PausePoint {
|
|
1184
|
+
requireApproval?: boolean;
|
|
1185
|
+
message?: string;
|
|
1186
|
+
metadata?: Record<string, unknown>;
|
|
1187
|
+
notify?: NotifyConfig;
|
|
1188
|
+
}
|
|
1189
|
+
interface NotifyConfig {
|
|
1190
|
+
enabled?: boolean;
|
|
1191
|
+
channels?: NotifyChannel[];
|
|
1192
|
+
priority?: NotifyPriority;
|
|
1193
|
+
userId?: string;
|
|
1194
|
+
}
|
|
1195
|
+
interface WorkflowTool {
|
|
1196
|
+
name: string;
|
|
1197
|
+
type: ToolType;
|
|
1198
|
+
description?: string;
|
|
1199
|
+
endpoint?: string;
|
|
1200
|
+
params?: Record<string, unknown>;
|
|
1201
|
+
}
|
|
1202
|
+
interface WorkflowExecution {
|
|
1203
|
+
id: string;
|
|
1204
|
+
workflowId: string;
|
|
1205
|
+
status: 'pending' | 'running' | 'paused' | 'completed' | 'failed' | 'cancelled' | 'accepted';
|
|
1206
|
+
result?: unknown;
|
|
1207
|
+
error?: string;
|
|
1208
|
+
channel?: string;
|
|
1209
|
+
jobId?: string;
|
|
1210
|
+
startedAt: string;
|
|
1211
|
+
completedAt?: string;
|
|
1212
|
+
}
|
|
1213
|
+
interface BackgroundExecutionStatus {
|
|
1214
|
+
executionId: string;
|
|
1215
|
+
workflowId: string;
|
|
1216
|
+
status: 'running' | 'completed' | 'failed' | 'cancelled';
|
|
1217
|
+
completedSteps: string[];
|
|
1218
|
+
pendingSteps: string[];
|
|
1219
|
+
error?: string;
|
|
1220
|
+
}
|
|
1221
|
+
type StepStatus = 'pending' | 'success' | 'failed' | 'skipped';
|
|
1222
|
+
interface WorkflowProgressEvent {
|
|
1223
|
+
stepId: string;
|
|
1224
|
+
status: StepStatus;
|
|
1225
|
+
result?: unknown;
|
|
1226
|
+
error?: string;
|
|
1227
|
+
}
|
|
1228
|
+
interface WorkflowActivityEvent {
|
|
1229
|
+
timestamp: string;
|
|
1230
|
+
type: string;
|
|
1231
|
+
stepId?: string;
|
|
1232
|
+
data?: unknown;
|
|
1233
|
+
}
|
|
1234
|
+
interface WorkflowSubscribeHandlers {
|
|
1235
|
+
onProgress?: (event: WorkflowProgressEvent) => void;
|
|
1236
|
+
onComplete?: (execution: WorkflowExecution) => void;
|
|
1237
|
+
onError?: (error: unknown) => void;
|
|
1238
|
+
/** Called when a step starts */
|
|
1239
|
+
onStepStarted?: (stepId: string) => void;
|
|
1240
|
+
/** Called when a step completes successfully */
|
|
1241
|
+
onStepCompleted?: (stepId: string, duration?: number) => void;
|
|
1242
|
+
/** Called when a non-optional step fails */
|
|
1243
|
+
onStepFailed?: (stepId: string, error?: string) => void;
|
|
1244
|
+
/** Called when an optional step fails but workflow continues */
|
|
1245
|
+
onStepSkipped?: (stepId: string, error?: string) => void;
|
|
1246
|
+
}
|
|
1247
|
+
declare class WorkflowsResource {
|
|
1248
|
+
private client;
|
|
1249
|
+
constructor(client: BackflowClient);
|
|
1250
|
+
execute(config: WorkflowConfig): Promise<WorkflowExecution>;
|
|
1251
|
+
get(executionId: string): Promise<WorkflowExecution>;
|
|
1252
|
+
list(params?: {
|
|
1253
|
+
limit?: number;
|
|
1254
|
+
page?: number;
|
|
1255
|
+
startDate?: string;
|
|
1256
|
+
endDate?: string;
|
|
1257
|
+
}): Promise<{
|
|
1258
|
+
executions: WorkflowExecution[];
|
|
1259
|
+
pagination: {
|
|
1260
|
+
page: number;
|
|
1261
|
+
limit: number;
|
|
1262
|
+
total: number;
|
|
1263
|
+
hasMore: boolean;
|
|
1264
|
+
};
|
|
1265
|
+
}>;
|
|
1266
|
+
getHistory(workflowId: string): Promise<{
|
|
1267
|
+
history: WorkflowActivityEvent[];
|
|
1268
|
+
}>;
|
|
1269
|
+
pause(executionId: string): Promise<{
|
|
1270
|
+
success: boolean;
|
|
1271
|
+
message: string;
|
|
1272
|
+
}>;
|
|
1273
|
+
resume(executionId: string, options?: {
|
|
1274
|
+
continue?: boolean;
|
|
1275
|
+
userInput?: unknown;
|
|
1276
|
+
}): Promise<{
|
|
1277
|
+
success: boolean;
|
|
1278
|
+
result?: unknown;
|
|
1279
|
+
}>;
|
|
1280
|
+
cancel(executionId: string): Promise<{
|
|
1281
|
+
success: boolean;
|
|
1282
|
+
message: string;
|
|
1283
|
+
}>;
|
|
1284
|
+
getStatus(executionId: string): Promise<BackgroundExecutionStatus>;
|
|
1285
|
+
retry(executionId: string): Promise<{
|
|
1286
|
+
success: boolean;
|
|
1287
|
+
message: string;
|
|
1288
|
+
}>;
|
|
1289
|
+
rerun(workflowId: string): Promise<WorkflowExecution>;
|
|
1290
|
+
delete(workflowId: string): Promise<{
|
|
1291
|
+
success: boolean;
|
|
1292
|
+
}>;
|
|
1293
|
+
deleteAll(): Promise<{
|
|
1294
|
+
success: boolean;
|
|
1295
|
+
deleted: number;
|
|
1296
|
+
}>;
|
|
1297
|
+
subscribe(executionId: string, handlers: WorkflowSubscribeHandlers): () => void;
|
|
1298
|
+
getValidationSchema(): WorkflowValidationSchema;
|
|
1299
|
+
getSchemaFor(section: keyof WorkflowValidationSchema): Record<string, PropertyValidation>;
|
|
1300
|
+
getToolTypes(): readonly string[];
|
|
1301
|
+
getTriggerTypes(): readonly string[];
|
|
1302
|
+
getNotifyChannels(): readonly string[];
|
|
1303
|
+
getNotifyPriorities(): readonly string[];
|
|
1304
|
+
getDbOperations(): readonly string[];
|
|
1305
|
+
getStorageOperations(): readonly string[];
|
|
1306
|
+
validateProperty(section: keyof WorkflowValidationSchema, property: string, value: unknown): {
|
|
1307
|
+
valid: boolean;
|
|
1308
|
+
error?: string;
|
|
1309
|
+
};
|
|
1310
|
+
}
|
|
1311
|
+
declare const TOOL_PARAM_CONTEXT: Record<string, string[]>;
|
|
1312
|
+
interface PromptContextOptions {
|
|
1313
|
+
sections?: (keyof WorkflowValidationSchema)[];
|
|
1314
|
+
toolType?: string;
|
|
1315
|
+
compact?: boolean;
|
|
1316
|
+
}
|
|
1317
|
+
declare function toPromptContext(options?: PromptContextOptions): string;
|
|
1318
|
+
declare function toCompactContext(toolType?: string): string;
|
|
1319
|
+
|
|
1320
|
+
type EmbeddingContentType = 'article' | 'code' | 'conversation' | 'document' | 'general';
|
|
1321
|
+
interface EmbedDocumentOptions {
|
|
1322
|
+
document: string;
|
|
1323
|
+
documentId?: string;
|
|
1324
|
+
contentType?: EmbeddingContentType;
|
|
1325
|
+
metadata?: Record<string, unknown>;
|
|
1326
|
+
subscribable?: boolean;
|
|
1327
|
+
}
|
|
1328
|
+
interface EmbeddingResult {
|
|
1329
|
+
documentId: string;
|
|
1330
|
+
chunksCreated: number;
|
|
1331
|
+
success: boolean;
|
|
1332
|
+
}
|
|
1333
|
+
interface SubscribableResponse {
|
|
1334
|
+
accepted: true;
|
|
1335
|
+
jobId: string;
|
|
1336
|
+
subscribe: {
|
|
1337
|
+
sse: string;
|
|
1338
|
+
websocket: {
|
|
1339
|
+
path: string;
|
|
1340
|
+
channel: string;
|
|
1341
|
+
};
|
|
1342
|
+
poll: string;
|
|
1343
|
+
};
|
|
1344
|
+
}
|
|
1345
|
+
interface BatchEmbeddingDocument {
|
|
1346
|
+
document: string;
|
|
1347
|
+
documentId?: string;
|
|
1348
|
+
metadata?: Record<string, unknown>;
|
|
1349
|
+
}
|
|
1350
|
+
interface BatchEmbeddingResult {
|
|
1351
|
+
results: EmbeddingResult[];
|
|
1352
|
+
totalChunks: number;
|
|
1353
|
+
success: boolean;
|
|
1354
|
+
}
|
|
1355
|
+
interface DocumentSearchResult {
|
|
1356
|
+
content: string;
|
|
1357
|
+
score: number;
|
|
1358
|
+
metadata?: Record<string, unknown>;
|
|
1359
|
+
}
|
|
1360
|
+
interface EmbeddedDocument {
|
|
1361
|
+
documentId: string;
|
|
1362
|
+
chunkCount: number;
|
|
1363
|
+
metadata: Record<string, unknown>;
|
|
1364
|
+
}
|
|
1365
|
+
declare class EmbeddingsResource {
|
|
1366
|
+
private client;
|
|
1367
|
+
constructor(client: BackflowClient);
|
|
1368
|
+
listDocuments(limit?: number): Promise<{
|
|
1369
|
+
success: boolean;
|
|
1370
|
+
documents: EmbeddedDocument[];
|
|
1371
|
+
}>;
|
|
1372
|
+
embedDocument(options: EmbedDocumentOptions & {
|
|
1373
|
+
subscribable: true;
|
|
1374
|
+
}): Promise<SubscribableResponse>;
|
|
1375
|
+
embedDocument(options: EmbedDocumentOptions & {
|
|
1376
|
+
subscribable?: false;
|
|
1377
|
+
}): Promise<EmbeddingResult>;
|
|
1378
|
+
embedBatch(documents: BatchEmbeddingDocument[], contentType?: EmbeddingContentType): Promise<BatchEmbeddingResult>;
|
|
1379
|
+
search(documentId: string, query: string, limit?: number): Promise<{
|
|
1380
|
+
results: DocumentSearchResult[];
|
|
1381
|
+
}>;
|
|
1382
|
+
delete(documentId: string): Promise<{
|
|
1383
|
+
success: boolean;
|
|
1384
|
+
}>;
|
|
1385
|
+
semanticSearch(query: string, limit?: number): Promise<{
|
|
1386
|
+
results: DocumentSearchResult[];
|
|
1387
|
+
}>;
|
|
1388
|
+
}
|
|
1389
|
+
|
|
1390
|
+
interface UsageMetrics {
|
|
1391
|
+
userId: string;
|
|
1392
|
+
apiCalls: number;
|
|
1393
|
+
tokensUsed: number;
|
|
1394
|
+
storageUsed: number;
|
|
1395
|
+
workflowsRun: number;
|
|
1396
|
+
period: string;
|
|
1397
|
+
}
|
|
1398
|
+
interface UsageSummary {
|
|
1399
|
+
total: UsageMetrics;
|
|
1400
|
+
breakdown: {
|
|
1401
|
+
date: string;
|
|
1402
|
+
metrics: Partial<UsageMetrics>;
|
|
1403
|
+
}[];
|
|
1404
|
+
}
|
|
1405
|
+
declare class UsageResource {
|
|
1406
|
+
private client;
|
|
1407
|
+
constructor(client: BackflowClient);
|
|
1408
|
+
getMyUsage(): Promise<UsageMetrics>;
|
|
1409
|
+
getUserUsage(userId: string, options?: {
|
|
1410
|
+
startDate?: string;
|
|
1411
|
+
endDate?: string;
|
|
1412
|
+
}): Promise<UsageMetrics>;
|
|
1413
|
+
getSummary(userId: string): Promise<UsageSummary>;
|
|
1414
|
+
}
|
|
1415
|
+
|
|
1416
|
+
interface ProjectAnalytics {
|
|
1417
|
+
views: number;
|
|
1418
|
+
edits: number;
|
|
1419
|
+
collaborators: number;
|
|
1420
|
+
lastActive: string;
|
|
1421
|
+
}
|
|
1422
|
+
declare class AnalyticsResource {
|
|
1423
|
+
private client;
|
|
1424
|
+
constructor(client: BackflowClient);
|
|
1425
|
+
project(projectId: string): Promise<ProjectAnalytics>;
|
|
1426
|
+
}
|
|
1427
|
+
|
|
1428
|
+
interface GithubImportResult {
|
|
1429
|
+
diagram: unknown;
|
|
1430
|
+
r2Upload: {
|
|
1431
|
+
url: string;
|
|
1432
|
+
};
|
|
1433
|
+
}
|
|
1434
|
+
declare class GithubResource {
|
|
1435
|
+
private client;
|
|
1436
|
+
constructor(client: BackflowClient);
|
|
1437
|
+
import(owner: string, repo: string, options: {
|
|
1438
|
+
path: string;
|
|
1439
|
+
ref?: string;
|
|
1440
|
+
githubToken: string;
|
|
1441
|
+
}): Promise<GithubImportResult>;
|
|
1442
|
+
repos(): Promise<unknown[]>;
|
|
1443
|
+
contents(owner: string, repo: string, path?: string): Promise<unknown>;
|
|
1444
|
+
branches(owner: string, repo: string): Promise<unknown[]>;
|
|
1445
|
+
pulls(owner: string, repo: string): Promise<unknown[]>;
|
|
1446
|
+
getPull(owner: string, repo: string, pullNumber: string): Promise<unknown>;
|
|
1447
|
+
files(owner: string, repo: string, pullNumber: string): Promise<unknown[]>;
|
|
1448
|
+
}
|
|
1449
|
+
|
|
1450
|
+
declare class QueuesResource {
|
|
1451
|
+
private client;
|
|
1452
|
+
constructor(client: BackflowClient);
|
|
1453
|
+
/** Get all queues and their statistics (tenant-isolated) */
|
|
1454
|
+
list(): Promise<unknown>;
|
|
1455
|
+
/** Get statistics for a specific queue (tenant-isolated) */
|
|
1456
|
+
stats(name: string): Promise<unknown>;
|
|
1457
|
+
/** Get jobs from a queue (tenant-isolated) */
|
|
1458
|
+
jobs(name: string): Promise<unknown>;
|
|
1459
|
+
/** Add a job to the queue (with tenant isolation) */
|
|
1460
|
+
createJob(name: string, data: Record<string, unknown>): Promise<unknown>;
|
|
1461
|
+
/** Get a specific job (tenant-isolated) */
|
|
1462
|
+
getJob(name: string, jobId: string): Promise<unknown>;
|
|
1463
|
+
/** Retry a failed job (tenant-isolated) */
|
|
1464
|
+
retry(name: string, jobId: string, data: Record<string, unknown>): Promise<unknown>;
|
|
1465
|
+
/** Pause a queue (admin only - affects all tenants) */
|
|
1466
|
+
pause(name: string, data: Record<string, unknown>): Promise<unknown>;
|
|
1467
|
+
/** Resume a paused queue (admin only - affects all tenants) */
|
|
1468
|
+
resume(name: string, data: Record<string, unknown>): Promise<unknown>;
|
|
1469
|
+
/** Clean old jobs from queue (tenant-isolated) */
|
|
1470
|
+
createClean(name: string, data: Record<string, unknown>): Promise<unknown>;
|
|
1471
|
+
/** Get detailed performance metrics for a queue */
|
|
1472
|
+
metrics(name: string): Promise<unknown>;
|
|
1473
|
+
/** Subscribe to job updates via SSE. Returns unsubscribe function. */
|
|
1474
|
+
subscribe<T = unknown>(sseUrl: string, handlers: {
|
|
1475
|
+
onConnected?: () => void;
|
|
1476
|
+
onComplete?: (result: T) => void;
|
|
1477
|
+
onFailed?: (error: string) => void;
|
|
1478
|
+
onProgress?: (progress: number, message?: string) => void;
|
|
1479
|
+
onWarning?: (warning: string) => void;
|
|
1480
|
+
onError?: (error: Event) => void;
|
|
1481
|
+
}): () => void;
|
|
1482
|
+
}
|
|
1483
|
+
|
|
1484
|
+
type SearchMode = 'exact' | 'fuzzy' | 'hybrid';
|
|
1485
|
+
interface SearchOptions {
|
|
1486
|
+
q: string;
|
|
1487
|
+
mode?: SearchMode;
|
|
1488
|
+
limit?: number;
|
|
1489
|
+
threshold?: number;
|
|
1490
|
+
}
|
|
1491
|
+
interface SearchMeta {
|
|
1492
|
+
entity: string;
|
|
1493
|
+
query: string;
|
|
1494
|
+
mode: SearchMode;
|
|
1495
|
+
cached: boolean;
|
|
1496
|
+
latency: number;
|
|
1497
|
+
total: number;
|
|
1498
|
+
}
|
|
1499
|
+
interface SearchResponse<T = Record<string, unknown>> {
|
|
1500
|
+
results: T[];
|
|
1501
|
+
meta: SearchMeta;
|
|
1502
|
+
}
|
|
1503
|
+
interface IndexOptions {
|
|
1504
|
+
entity: string;
|
|
1505
|
+
ids?: string[];
|
|
1506
|
+
batchSize?: number;
|
|
1507
|
+
}
|
|
1508
|
+
interface IndexResult {
|
|
1509
|
+
success: boolean;
|
|
1510
|
+
entity: string;
|
|
1511
|
+
indexed: number;
|
|
1512
|
+
latency: number;
|
|
1513
|
+
}
|
|
1514
|
+
interface ReindexOptions {
|
|
1515
|
+
entity: string;
|
|
1516
|
+
batchSize?: number;
|
|
1517
|
+
}
|
|
1518
|
+
interface ReindexResult {
|
|
1519
|
+
success: boolean;
|
|
1520
|
+
entity: string;
|
|
1521
|
+
deleted: number;
|
|
1522
|
+
indexed: number;
|
|
1523
|
+
latency: number;
|
|
1524
|
+
}
|
|
1525
|
+
interface DeleteIndexResult {
|
|
1526
|
+
success: boolean;
|
|
1527
|
+
entity: string;
|
|
1528
|
+
deleted: number;
|
|
1529
|
+
latency: number;
|
|
1530
|
+
}
|
|
1531
|
+
interface SearchStats {
|
|
1532
|
+
enabled: boolean;
|
|
1533
|
+
configuredEntities: string[];
|
|
1534
|
+
defaultMode: SearchMode;
|
|
1535
|
+
cacheTTL: number;
|
|
1536
|
+
}
|
|
1537
|
+
interface SearchEntityConfig {
|
|
1538
|
+
searchFields: string[];
|
|
1539
|
+
filters?: Array<{
|
|
1540
|
+
column: string;
|
|
1541
|
+
operator: string;
|
|
1542
|
+
value: unknown;
|
|
1543
|
+
}>;
|
|
1544
|
+
idField?: string;
|
|
1545
|
+
}
|
|
1546
|
+
interface SearchConfig {
|
|
1547
|
+
enabled: boolean;
|
|
1548
|
+
defaultMode: SearchMode;
|
|
1549
|
+
defaultLimit: number;
|
|
1550
|
+
cacheTTL: number;
|
|
1551
|
+
threshold: number;
|
|
1552
|
+
entities: Record<string, SearchEntityConfig>;
|
|
1553
|
+
}
|
|
1554
|
+
interface ValidationError {
|
|
1555
|
+
field: string;
|
|
1556
|
+
message: string;
|
|
1557
|
+
}
|
|
1558
|
+
interface ValidationResult {
|
|
1559
|
+
valid: boolean;
|
|
1560
|
+
errors: ValidationError[];
|
|
1561
|
+
}
|
|
1562
|
+
/**
|
|
1563
|
+
* Context-aware field validator for search configuration
|
|
1564
|
+
*
|
|
1565
|
+
* @example
|
|
1566
|
+
* ```typescript
|
|
1567
|
+
* const validator = new SearchConfigValidator();
|
|
1568
|
+
*
|
|
1569
|
+
* // Validate entity config
|
|
1570
|
+
* const result = validator.validateEntityConfig('products', {
|
|
1571
|
+
* searchFields: ['name', 'description'],
|
|
1572
|
+
* filters: [{ column: 'is_active', operator: 'eq', value: true }]
|
|
1573
|
+
* });
|
|
1574
|
+
*
|
|
1575
|
+
* if (!result.valid) {
|
|
1576
|
+
* console.error('Validation errors:', result.errors);
|
|
1577
|
+
* }
|
|
1578
|
+
* ```
|
|
1579
|
+
*/
|
|
1580
|
+
declare class SearchConfigValidator {
|
|
1581
|
+
private validOperators;
|
|
1582
|
+
private validModes;
|
|
1583
|
+
/**
|
|
1584
|
+
* Validate search options for a query
|
|
1585
|
+
*/
|
|
1586
|
+
validateSearchOptions(options: SearchOptions): ValidationResult;
|
|
1587
|
+
/**
|
|
1588
|
+
* Validate entity configuration
|
|
1589
|
+
*/
|
|
1590
|
+
validateEntityConfig(entity: string, config: SearchEntityConfig): ValidationResult;
|
|
1591
|
+
/**
|
|
1592
|
+
* Validate full search configuration
|
|
1593
|
+
*/
|
|
1594
|
+
validateConfig(config: Partial<SearchConfig>): ValidationResult;
|
|
1595
|
+
}
|
|
1596
|
+
/**
|
|
1597
|
+
* Search resource for fast entity search
|
|
1598
|
+
*
|
|
1599
|
+
* @example
|
|
1600
|
+
* ```typescript
|
|
1601
|
+
* import { createBackflow } from '@backflow/sdk';
|
|
1602
|
+
*
|
|
1603
|
+
* const backflow = createBackflow({ apiKey: 'your-api-key' });
|
|
1604
|
+
*
|
|
1605
|
+
* // Search products with hybrid mode (vector + cache)
|
|
1606
|
+
* const results = await backflow.search.query('products', {
|
|
1607
|
+
* q: 'wireless headphones',
|
|
1608
|
+
* mode: 'hybrid',
|
|
1609
|
+
* limit: 10
|
|
1610
|
+
* });
|
|
1611
|
+
*
|
|
1612
|
+
* console.log(`Found ${results.meta.total} results in ${results.meta.latency}ms`);
|
|
1613
|
+
* console.log('Cached:', results.meta.cached);
|
|
1614
|
+
*
|
|
1615
|
+
* // Index products for vector search
|
|
1616
|
+
* await backflow.search.index({ entity: 'products' });
|
|
1617
|
+
*
|
|
1618
|
+
* // Search with exact mode (faster, no typo tolerance)
|
|
1619
|
+
* const exact = await backflow.search.query('products', {
|
|
1620
|
+
* q: 'Sony WH-1000XM5',
|
|
1621
|
+
* mode: 'exact'
|
|
1622
|
+
* });
|
|
1623
|
+
*
|
|
1624
|
+
* // Search with fuzzy mode (semantic, typo tolerant)
|
|
1625
|
+
* const fuzzy = await backflow.search.query('products', {
|
|
1626
|
+
* q: 'wireles headfones',
|
|
1627
|
+
* mode: 'fuzzy',
|
|
1628
|
+
* threshold: 0.6
|
|
1629
|
+
* });
|
|
1630
|
+
* ```
|
|
1631
|
+
*/
|
|
1632
|
+
declare class SearchResource {
|
|
1633
|
+
private client;
|
|
1634
|
+
readonly validator: SearchConfigValidator;
|
|
1635
|
+
constructor(client: BackflowClient);
|
|
1636
|
+
/**
|
|
1637
|
+
* Search an entity
|
|
1638
|
+
*
|
|
1639
|
+
* @param entity - Entity/table name to search
|
|
1640
|
+
* @param options - Search options
|
|
1641
|
+
* @returns Search results with metadata
|
|
1642
|
+
*
|
|
1643
|
+
* @example
|
|
1644
|
+
* ```typescript
|
|
1645
|
+
* // Basic search
|
|
1646
|
+
* const results = await backflow.search.query('products', { q: 'laptop' });
|
|
1647
|
+
*
|
|
1648
|
+
* // Advanced search with all options
|
|
1649
|
+
* const results = await backflow.search.query('products', {
|
|
1650
|
+
* q: 'gaming laptop',
|
|
1651
|
+
* mode: 'hybrid', // 'exact' | 'fuzzy' | 'hybrid'
|
|
1652
|
+
* limit: 20, // max results
|
|
1653
|
+
* threshold: 0.7 // similarity threshold for fuzzy/hybrid
|
|
1654
|
+
* });
|
|
1655
|
+
*
|
|
1656
|
+
* // Access results
|
|
1657
|
+
* results.results.forEach(product => {
|
|
1658
|
+
* console.log(product.name, product._score); // _score for fuzzy results
|
|
1659
|
+
* });
|
|
1660
|
+
* ```
|
|
1661
|
+
*/
|
|
1662
|
+
query<T = Record<string, unknown>>(entity: string, options: SearchOptions): Promise<SearchResponse<T>>;
|
|
1663
|
+
/**
|
|
1664
|
+
* Index entity records for vector search
|
|
1665
|
+
*
|
|
1666
|
+
* @param options - Index options
|
|
1667
|
+
* @returns Index result
|
|
1668
|
+
*
|
|
1669
|
+
* @example
|
|
1670
|
+
* ```typescript
|
|
1671
|
+
* // Index all products
|
|
1672
|
+
* const result = await backflow.search.index({ entity: 'products' });
|
|
1673
|
+
* console.log(`Indexed ${result.indexed} records in ${result.latency}ms`);
|
|
1674
|
+
*
|
|
1675
|
+
* // Index specific records
|
|
1676
|
+
* await backflow.search.index({
|
|
1677
|
+
* entity: 'products',
|
|
1678
|
+
* ids: ['prod_123', 'prod_456'],
|
|
1679
|
+
* batchSize: 50
|
|
1680
|
+
* });
|
|
1681
|
+
* ```
|
|
1682
|
+
*/
|
|
1683
|
+
index(options: IndexOptions): Promise<IndexResult>;
|
|
1684
|
+
/**
|
|
1685
|
+
* Delete and reindex all records for an entity
|
|
1686
|
+
*
|
|
1687
|
+
* @param options - Reindex options
|
|
1688
|
+
* @returns Reindex result
|
|
1689
|
+
*
|
|
1690
|
+
* @example
|
|
1691
|
+
* ```typescript
|
|
1692
|
+
* // Reindex all products
|
|
1693
|
+
* const result = await backflow.search.reindex({ entity: 'products' });
|
|
1694
|
+
* console.log(`Deleted ${result.deleted}, indexed ${result.indexed}`);
|
|
1695
|
+
* ```
|
|
1696
|
+
*/
|
|
1697
|
+
reindex(options: ReindexOptions): Promise<ReindexResult>;
|
|
1698
|
+
/**
|
|
1699
|
+
* Delete all indexed records for an entity
|
|
1700
|
+
*
|
|
1701
|
+
* @param entity - Entity name
|
|
1702
|
+
* @returns Delete result
|
|
1703
|
+
*
|
|
1704
|
+
* @example
|
|
1705
|
+
* ```typescript
|
|
1706
|
+
* await backflow.search.delete('products');
|
|
1707
|
+
* ```
|
|
1708
|
+
*/
|
|
1709
|
+
delete(entity: string): Promise<DeleteIndexResult>;
|
|
1710
|
+
/**
|
|
1711
|
+
* Get search statistics
|
|
1712
|
+
*
|
|
1713
|
+
* @returns Search configuration stats
|
|
1714
|
+
*
|
|
1715
|
+
* @example
|
|
1716
|
+
* ```typescript
|
|
1717
|
+
* const stats = await backflow.search.stats();
|
|
1718
|
+
* console.log('Configured entities:', stats.configuredEntities);
|
|
1719
|
+
* console.log('Default mode:', stats.defaultMode);
|
|
1720
|
+
* ```
|
|
1721
|
+
*/
|
|
1722
|
+
stats(): Promise<SearchStats>;
|
|
1723
|
+
}
|
|
1724
|
+
|
|
1725
|
+
interface TenantConfig {
|
|
1726
|
+
tenantId: string;
|
|
1727
|
+
name?: string;
|
|
1728
|
+
plan?: string;
|
|
1729
|
+
features?: string[];
|
|
1730
|
+
routes?: any[];
|
|
1731
|
+
[key: string]: any;
|
|
1732
|
+
}
|
|
1733
|
+
interface TenantInfo {
|
|
1734
|
+
id: string;
|
|
1735
|
+
name: string;
|
|
1736
|
+
plan: string;
|
|
1737
|
+
createdAt: string;
|
|
1738
|
+
subscriptionStatus: string;
|
|
1739
|
+
}
|
|
1740
|
+
interface TenantUsage {
|
|
1741
|
+
entities: number;
|
|
1742
|
+
workflows: number;
|
|
1743
|
+
apiCalls: number;
|
|
1744
|
+
storage: number;
|
|
1745
|
+
quotas: {
|
|
1746
|
+
entities?: number;
|
|
1747
|
+
workflows?: number;
|
|
1748
|
+
apiCalls?: number;
|
|
1749
|
+
storage?: number;
|
|
1750
|
+
};
|
|
1751
|
+
}
|
|
1752
|
+
declare class TenantResource {
|
|
1753
|
+
private client;
|
|
1754
|
+
constructor(client: BackflowClient);
|
|
1755
|
+
getInfo(): Promise<TenantInfo>;
|
|
1756
|
+
getConfig(): Promise<{
|
|
1757
|
+
config: TenantConfig;
|
|
1758
|
+
version: number;
|
|
1759
|
+
}>;
|
|
1760
|
+
updateConfig(config: Partial<TenantConfig>): Promise<{
|
|
1761
|
+
config: TenantConfig;
|
|
1762
|
+
version: number;
|
|
1763
|
+
}>;
|
|
1764
|
+
getUsage(): Promise<TenantUsage>;
|
|
1765
|
+
getId(): Promise<string>;
|
|
1766
|
+
}
|
|
1767
|
+
|
|
1768
|
+
declare class IntegrationsResource {
|
|
1769
|
+
private client;
|
|
1770
|
+
readonly stripe: StripeResource;
|
|
1771
|
+
readonly polar: PolarResource;
|
|
1772
|
+
constructor(client: BackflowClient);
|
|
1773
|
+
}
|
|
1774
|
+
declare class BackflowSDK {
|
|
1775
|
+
private client;
|
|
1776
|
+
readonly agentAnalysis: AgentAnalysisResource;
|
|
1777
|
+
readonly assets: AssetsResource;
|
|
1778
|
+
readonly batch: BatchResource;
|
|
1779
|
+
readonly cache: CacheResource;
|
|
1780
|
+
readonly default: DefaultResource;
|
|
1781
|
+
readonly deployment: DeploymentResource;
|
|
1782
|
+
readonly feedback: FeedbackResource;
|
|
1783
|
+
readonly goals: GoalsResource;
|
|
1784
|
+
readonly googleDrive: GoogleDriveResource;
|
|
1785
|
+
readonly jira: JiraResource;
|
|
1786
|
+
readonly llm: LlmResource;
|
|
1787
|
+
readonly mcptools: McpToolsResource;
|
|
1788
|
+
readonly projects: ProjectsResource;
|
|
1789
|
+
readonly publish: PublishResource;
|
|
1790
|
+
readonly teams: TeamsResource;
|
|
1791
|
+
readonly tenantWebhookReceivers: TenantWebhookReceiversResource;
|
|
1792
|
+
readonly tenantWebhooks: TenantWebhooksResource;
|
|
1793
|
+
readonly tooldiscovery: ToolDiscoveryResource;
|
|
1794
|
+
readonly tracking: TrackingResource;
|
|
1795
|
+
readonly twitter: TwitterResource;
|
|
1796
|
+
readonly websocket: WebsocketResource;
|
|
1797
|
+
readonly workspaces: WorkspacesResource;
|
|
1798
|
+
readonly integrations: IntegrationsResource;
|
|
1799
|
+
readonly files: FilesResource;
|
|
1800
|
+
readonly workflows: WorkflowsResource;
|
|
1801
|
+
readonly embeddings: EmbeddingsResource;
|
|
1802
|
+
readonly usage: UsageResource;
|
|
1803
|
+
readonly analytics: AnalyticsResource;
|
|
1804
|
+
readonly github: GithubResource;
|
|
1805
|
+
readonly queues: QueuesResource;
|
|
1806
|
+
readonly search: SearchResource;
|
|
1807
|
+
readonly ai: AIResource;
|
|
1808
|
+
readonly collaboration: CollaborationResource;
|
|
1809
|
+
readonly webhooks: (projectId: string) => {
|
|
1810
|
+
trigger: (data: {
|
|
1811
|
+
event: string;
|
|
1812
|
+
data: unknown;
|
|
1813
|
+
}) => Promise<unknown>;
|
|
1814
|
+
};
|
|
1815
|
+
readonly exports: ExportsResource;
|
|
1816
|
+
readonly user: UserResource;
|
|
1817
|
+
readonly tenant: TenantResource;
|
|
1818
|
+
readonly entities: EntitiesResource;
|
|
1819
|
+
constructor(config: BackflowConfig);
|
|
1820
|
+
get endpoint(): string;
|
|
1821
|
+
get<T>(path: string, params?: Record<string, string | number | boolean | undefined>): Promise<T>;
|
|
1822
|
+
post<T>(path: string, data?: unknown, params?: Record<string, string | number | boolean | undefined>): Promise<T>;
|
|
1823
|
+
put<T>(path: string, data?: unknown, params?: Record<string, string | number | boolean | undefined>): Promise<T>;
|
|
1824
|
+
patch<T>(path: string, data?: unknown, params?: Record<string, string | number | boolean | undefined>): Promise<T>;
|
|
1825
|
+
delete<T>(path: string, params?: Record<string, string | number | boolean | undefined>): Promise<T>;
|
|
1826
|
+
}
|
|
1827
|
+
type BackflowSDKWithDynamicResources = BackflowSDK & {
|
|
1828
|
+
[key: string]: {
|
|
1829
|
+
[method: string]: (...args: unknown[]) => Promise<unknown>;
|
|
1830
|
+
};
|
|
1831
|
+
};
|
|
1832
|
+
declare function createBackflow(config: BackflowConfig): BackflowSDKWithDynamicResources;
|
|
1833
|
+
|
|
1834
|
+
/**
|
|
1835
|
+
* SDK Documentation for LLM App Generation
|
|
1836
|
+
* This is injected into the app generation prompt so the LLM knows
|
|
1837
|
+
* what SDK methods are available for generated apps.
|
|
1838
|
+
*/
|
|
1839
|
+
declare function getSDKDocs(): string;
|
|
1840
|
+
/**
|
|
1841
|
+
* Get compact SDK reference for shorter prompts
|
|
1842
|
+
*/
|
|
1843
|
+
declare function getSDKDocsCompact(): string;
|
|
1844
|
+
|
|
1845
|
+
export { AgentAnalysisResource, AnalyticsResource$1 as AnalyticsResource, type AssetListParams, type AssetListResponse, type AssetStatsResponse, AssetsResource, BackflowSDK as Backflow, BackflowClient, type BackflowConfig, type BackflowError, type BackflowResponse, BackflowSDK, type BackflowSDKWithDynamicResources, type BatchExportOptions, type BatchExportResult, type BatchImportOptions, type BatchImportResult, type BatchJob, BatchResource, CACHE_OPERATIONS, CHUNKING_STRATEGIES, CLI_PROVIDERS, CONDITION_OPERATORS, CacheResource, DB_OPERATIONS, DB_PROVIDERS, type DatabaseFilter, type DatabaseFilterOperator, type DatabaseIntegrationAction, type DatabaseProvider, DefaultResource, DeploymentResource, EmbeddingsResource$1 as EmbeddingsResource, FeedbackResource, FilesResource$1 as FilesResource, GithubResource$1 as GithubResource, GoalsResource, GoogleDriveResource, HTTP_METHODS, type HttpMethod, IMAGE_DETAILS, JiraResource, LLM_PROVIDERS, LlmResource, McpToolsResource, NOTIFY_CHANNELS, NOTIFY_PRIORITIES, type NotifyChannel, type NotifyConfig, type NotifyPriority, type PausePoint, PolarResource, ProjectsResource, type PromptContextOptions, type PropertyValidation, PublishResource, QueuesResource$1 as QueuesResource, RAG_MODES, type RequestOptions, type SSESubscribeHandlers, STORAGE_OPERATIONS, SearchResource$1 as SearchResource, StripeResource, TOOL_PARAM_CONTEXT, TOOL_TYPES, TRIGGER_TYPES, TeamsResource, type TenantAsset, TenantWebhookReceiversResource, TenantWebhooksResource, ToolDiscoveryResource, type ToolType, TrackingResource, type TriggerType, TwitterResource, UsageResource$1 as UsageResource, WORKFLOW_VALIDATION_SCHEMA, WebsocketResource, type WorkflowValidationSchema, WorkflowsResource$1 as WorkflowsResource, WorkspacesResource, createBackflow, getSDKDocs, getSDKDocsCompact, toCompactContext, toPromptContext };
|