@backflow.sdk/admin 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 +2499 -0
- package/dist/index.d.ts +2499 -0
- package/dist/index.js +3664 -0
- package/dist/index.mjs +3568 -0
- package/package.json +100 -0
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,3568 @@
|
|
|
1
|
+
// src/client.ts
|
|
2
|
+
var DEFAULT_ENDPOINT = "https://api.backflow.dev";
|
|
3
|
+
var BackflowClient = class {
|
|
4
|
+
constructor(config) {
|
|
5
|
+
this.tokenCache = null;
|
|
6
|
+
this.tokenPromise = null;
|
|
7
|
+
const clientKey = config.clientKey;
|
|
8
|
+
if (!clientKey && !config.getAuthToken) {
|
|
9
|
+
throw new Error("Either clientKey or getAuthToken is required");
|
|
10
|
+
}
|
|
11
|
+
this.config = {
|
|
12
|
+
...config,
|
|
13
|
+
clientKey,
|
|
14
|
+
endpoint: config.endpoint?.replace(/\/$/, "") || DEFAULT_ENDPOINT
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
async exchangeApiKeyForToken() {
|
|
18
|
+
const response = await fetch(`${this.config.endpoint}/auth/token`, {
|
|
19
|
+
method: "POST",
|
|
20
|
+
headers: {
|
|
21
|
+
"Content-Type": "application/json",
|
|
22
|
+
"x-api-key": this.config.clientKey
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
if (!response.ok) {
|
|
26
|
+
const error = await response.json().catch(() => ({ error: "Token exchange failed" }));
|
|
27
|
+
throw new Error(error.error || "Failed to exchange API key for token");
|
|
28
|
+
}
|
|
29
|
+
const data = await response.json();
|
|
30
|
+
const expiresAt = Date.now() + data.expiresIn * 1e3 * 0.8;
|
|
31
|
+
return { token: data.token, expiresAt };
|
|
32
|
+
}
|
|
33
|
+
async getToken() {
|
|
34
|
+
if (this.config.getAuthToken) {
|
|
35
|
+
return this.config.getAuthToken();
|
|
36
|
+
}
|
|
37
|
+
if (this.tokenCache && Date.now() < this.tokenCache.expiresAt) {
|
|
38
|
+
return this.tokenCache.token;
|
|
39
|
+
}
|
|
40
|
+
if (this.tokenPromise) {
|
|
41
|
+
const cache = await this.tokenPromise.then(() => this.tokenCache);
|
|
42
|
+
return cache.token;
|
|
43
|
+
}
|
|
44
|
+
this.tokenPromise = this.exchangeApiKeyForToken().then((cache) => {
|
|
45
|
+
this.tokenCache = cache;
|
|
46
|
+
this.tokenPromise = null;
|
|
47
|
+
return cache.token;
|
|
48
|
+
}).catch((err) => {
|
|
49
|
+
this.tokenPromise = null;
|
|
50
|
+
throw err;
|
|
51
|
+
});
|
|
52
|
+
return this.tokenPromise;
|
|
53
|
+
}
|
|
54
|
+
get endpoint() {
|
|
55
|
+
return this.config.endpoint;
|
|
56
|
+
}
|
|
57
|
+
async request(path, options = {}) {
|
|
58
|
+
const { params, body, ...fetchOptions } = options;
|
|
59
|
+
const startTime = Date.now();
|
|
60
|
+
const debug = this.config.debug ?? false;
|
|
61
|
+
let ctx = {
|
|
62
|
+
method: fetchOptions.method || "GET",
|
|
63
|
+
path,
|
|
64
|
+
params,
|
|
65
|
+
body,
|
|
66
|
+
startTime
|
|
67
|
+
};
|
|
68
|
+
if (this.config.middleware?.onRequest) {
|
|
69
|
+
const result = await this.config.middleware.onRequest(ctx);
|
|
70
|
+
if (result) ctx = result;
|
|
71
|
+
}
|
|
72
|
+
let url = `${this.config.endpoint}${ctx.path}`;
|
|
73
|
+
if (ctx.params) {
|
|
74
|
+
const searchParams = new URLSearchParams();
|
|
75
|
+
Object.entries(ctx.params).forEach(([key, value]) => {
|
|
76
|
+
if (value !== void 0) {
|
|
77
|
+
searchParams.append(key, String(value));
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
const queryString = searchParams.toString();
|
|
81
|
+
if (queryString) {
|
|
82
|
+
url += `?${queryString}`;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
const headers = {
|
|
86
|
+
"Content-Type": "application/json",
|
|
87
|
+
...fetchOptions.headers || {}
|
|
88
|
+
};
|
|
89
|
+
const token = await this.getToken();
|
|
90
|
+
if (token) {
|
|
91
|
+
headers["Authorization"] = `Bearer ${token}`;
|
|
92
|
+
}
|
|
93
|
+
if (debug) {
|
|
94
|
+
console.log(`[Backflow] \u2192 ${ctx.method} ${url}`);
|
|
95
|
+
console.log(
|
|
96
|
+
`[Backflow] clientKey: ${this.config.clientKey ? "***" : "(not set)"}`
|
|
97
|
+
);
|
|
98
|
+
if (ctx.body) console.log("[Backflow] Request body:", ctx.body);
|
|
99
|
+
}
|
|
100
|
+
let response;
|
|
101
|
+
let responseData;
|
|
102
|
+
let error;
|
|
103
|
+
try {
|
|
104
|
+
response = await fetch(url, {
|
|
105
|
+
...fetchOptions,
|
|
106
|
+
headers,
|
|
107
|
+
body: ctx.body ? JSON.stringify(ctx.body) : void 0
|
|
108
|
+
});
|
|
109
|
+
if (!response.ok) {
|
|
110
|
+
error = new Error(
|
|
111
|
+
`Request failed: ${response.status}`
|
|
112
|
+
);
|
|
113
|
+
error.status = response.status;
|
|
114
|
+
try {
|
|
115
|
+
const errorBody = await response.json();
|
|
116
|
+
error.code = errorBody.code;
|
|
117
|
+
error.details = errorBody;
|
|
118
|
+
error.message = errorBody.message || errorBody.error || error.message;
|
|
119
|
+
} catch {
|
|
120
|
+
}
|
|
121
|
+
} else {
|
|
122
|
+
const contentType = response.headers.get("content-type");
|
|
123
|
+
if (contentType?.includes("application/json")) {
|
|
124
|
+
responseData = await response.json();
|
|
125
|
+
} else {
|
|
126
|
+
responseData = await response.text();
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
} catch (e) {
|
|
130
|
+
error = e;
|
|
131
|
+
error.status = 0;
|
|
132
|
+
}
|
|
133
|
+
const duration = Date.now() - startTime;
|
|
134
|
+
if (debug) {
|
|
135
|
+
const status = error?.status ?? response.status;
|
|
136
|
+
if (error) console.log("[Backflow] Error:", error.message);
|
|
137
|
+
else console.log("[Backflow] Response:", responseData);
|
|
138
|
+
}
|
|
139
|
+
if (this.config.middleware?.onResponse) {
|
|
140
|
+
const resCtx = {
|
|
141
|
+
...ctx,
|
|
142
|
+
status: error?.status ?? response.status,
|
|
143
|
+
duration,
|
|
144
|
+
response: responseData,
|
|
145
|
+
error
|
|
146
|
+
};
|
|
147
|
+
await this.config.middleware.onResponse(resCtx);
|
|
148
|
+
}
|
|
149
|
+
if (error) throw error;
|
|
150
|
+
return responseData;
|
|
151
|
+
}
|
|
152
|
+
async get(path, params) {
|
|
153
|
+
return this.request(path, { method: "GET", params });
|
|
154
|
+
}
|
|
155
|
+
async post(path, body, params) {
|
|
156
|
+
return this.request(path, { method: "POST", body, params });
|
|
157
|
+
}
|
|
158
|
+
async put(path, body, params) {
|
|
159
|
+
return this.request(path, { method: "PUT", body, params });
|
|
160
|
+
}
|
|
161
|
+
async patch(path, body, params) {
|
|
162
|
+
return this.request(path, { method: "PATCH", body, params });
|
|
163
|
+
}
|
|
164
|
+
async delete(path, params) {
|
|
165
|
+
return this.request(path, { method: "DELETE", params });
|
|
166
|
+
}
|
|
167
|
+
async upload(path, files, metadata) {
|
|
168
|
+
const formData = new FormData();
|
|
169
|
+
const fileArray = Array.isArray(files) ? files : [files];
|
|
170
|
+
const fieldName = fileArray.length === 1 ? "file" : "files";
|
|
171
|
+
fileArray.forEach((file) => formData.append(fieldName, file));
|
|
172
|
+
if (metadata) {
|
|
173
|
+
Object.entries(metadata).forEach(([key, value]) => {
|
|
174
|
+
formData.append(key, value);
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
const url = `${this.config.endpoint}${path}`;
|
|
178
|
+
const uploadHeaders = {};
|
|
179
|
+
const token = await this.getToken();
|
|
180
|
+
if (token) {
|
|
181
|
+
uploadHeaders["Authorization"] = `Bearer ${token}`;
|
|
182
|
+
}
|
|
183
|
+
const response = await fetch(url, {
|
|
184
|
+
method: "POST",
|
|
185
|
+
headers: uploadHeaders,
|
|
186
|
+
body: formData
|
|
187
|
+
});
|
|
188
|
+
if (!response.ok) {
|
|
189
|
+
const error = new Error(
|
|
190
|
+
`Upload failed: ${response.status}`
|
|
191
|
+
);
|
|
192
|
+
error.status = response.status;
|
|
193
|
+
try {
|
|
194
|
+
const errorBody = await response.json();
|
|
195
|
+
error.code = errorBody.code;
|
|
196
|
+
error.details = errorBody;
|
|
197
|
+
error.message = errorBody.message || errorBody.error || error.message;
|
|
198
|
+
} catch {
|
|
199
|
+
}
|
|
200
|
+
throw error;
|
|
201
|
+
}
|
|
202
|
+
return response.json();
|
|
203
|
+
}
|
|
204
|
+
createWebSocket(room) {
|
|
205
|
+
const wsEndpoint = this.config.endpoint.replace("http", "ws");
|
|
206
|
+
const ws = new WebSocket(`${wsEndpoint}/ws`);
|
|
207
|
+
ws.onopen = async () => {
|
|
208
|
+
const token = await this.getToken();
|
|
209
|
+
ws.send(JSON.stringify({ type: "auth", token }));
|
|
210
|
+
ws.send(JSON.stringify({ type: "join_room", room }));
|
|
211
|
+
};
|
|
212
|
+
return ws;
|
|
213
|
+
}
|
|
214
|
+
subscribeSSE(path, handlers) {
|
|
215
|
+
const es = new EventSource(`${this.config.endpoint}${path}`);
|
|
216
|
+
es.addEventListener("connected", () => handlers.onConnected?.());
|
|
217
|
+
es.addEventListener("completed", (e) => {
|
|
218
|
+
const data = JSON.parse(e.data);
|
|
219
|
+
handlers.onComplete?.(data);
|
|
220
|
+
es.close();
|
|
221
|
+
});
|
|
222
|
+
es.addEventListener("failed", (e) => {
|
|
223
|
+
const data = JSON.parse(e.data);
|
|
224
|
+
handlers.onFailed?.(data.error || data.message);
|
|
225
|
+
es.close();
|
|
226
|
+
});
|
|
227
|
+
es.addEventListener("progress", (e) => {
|
|
228
|
+
const data = JSON.parse(e.data);
|
|
229
|
+
handlers.onProgress?.(data.progress, data.message);
|
|
230
|
+
});
|
|
231
|
+
es.addEventListener("warning", (e) => {
|
|
232
|
+
handlers.onWarning?.(e.data);
|
|
233
|
+
});
|
|
234
|
+
es.onerror = (e) => {
|
|
235
|
+
handlers.onError?.(e);
|
|
236
|
+
es.close();
|
|
237
|
+
};
|
|
238
|
+
return () => es.close();
|
|
239
|
+
}
|
|
240
|
+
};
|
|
241
|
+
|
|
242
|
+
// src/generated/agent-analysis.ts
|
|
243
|
+
var AgentAnalysisResource = class {
|
|
244
|
+
constructor(client) {
|
|
245
|
+
this.client = client;
|
|
246
|
+
}
|
|
247
|
+
/** Retrieve cached analysis results from a previous scan */
|
|
248
|
+
async get(executionId) {
|
|
249
|
+
return this.client.get(`/agent/analysis/${executionId}`);
|
|
250
|
+
}
|
|
251
|
+
/** Apply fixes from cached analysis. In hybrid mode, returns fix instructions for local MCP execution. */
|
|
252
|
+
async createApply(executionId, data) {
|
|
253
|
+
return this.client.post(`/agent/analysis/${executionId}/apply`, data);
|
|
254
|
+
}
|
|
255
|
+
};
|
|
256
|
+
|
|
257
|
+
// src/generated/analytics.ts
|
|
258
|
+
var AnalyticsResource = class {
|
|
259
|
+
constructor(client) {
|
|
260
|
+
this.client = client;
|
|
261
|
+
}
|
|
262
|
+
/** Get high-level analytics overview (tenant-isolated) */
|
|
263
|
+
async list() {
|
|
264
|
+
return this.client.get("/analytics/overview");
|
|
265
|
+
}
|
|
266
|
+
/** Get endpoint statistics (tenant-isolated) */
|
|
267
|
+
async listEndpoints() {
|
|
268
|
+
return this.client.get("/analytics/endpoints");
|
|
269
|
+
}
|
|
270
|
+
/** Get recent errors (tenant-isolated) */
|
|
271
|
+
async listErrors() {
|
|
272
|
+
return this.client.get("/analytics/errors");
|
|
273
|
+
}
|
|
274
|
+
/** Get device type breakdown (tenant-isolated) */
|
|
275
|
+
async listDevices() {
|
|
276
|
+
return this.client.get("/analytics/devices");
|
|
277
|
+
}
|
|
278
|
+
/** Get geographic distribution of requests (tenant-isolated) */
|
|
279
|
+
async listGeography() {
|
|
280
|
+
return this.client.get("/analytics/geography");
|
|
281
|
+
}
|
|
282
|
+
/** Get time series data (tenant-isolated) */
|
|
283
|
+
async listTimeseries() {
|
|
284
|
+
return this.client.get("/analytics/timeseries");
|
|
285
|
+
}
|
|
286
|
+
/** Get endpoints that haven't been called recently (tenant-isolated) */
|
|
287
|
+
async listUnusedEndpoints() {
|
|
288
|
+
return this.client.get("/analytics/unused-endpoints");
|
|
289
|
+
}
|
|
290
|
+
};
|
|
291
|
+
|
|
292
|
+
// src/generated/apikeys.ts
|
|
293
|
+
var ApiKeysResource = class {
|
|
294
|
+
constructor(client) {
|
|
295
|
+
this.client = client;
|
|
296
|
+
}
|
|
297
|
+
/** List API keys */
|
|
298
|
+
async list() {
|
|
299
|
+
return this.client.get("/tenant/api-keys");
|
|
300
|
+
}
|
|
301
|
+
/** Create API key */
|
|
302
|
+
async create(data) {
|
|
303
|
+
return this.client.post("/tenant/api-keys", data);
|
|
304
|
+
}
|
|
305
|
+
/** Revoke API key */
|
|
306
|
+
async delete(keyId) {
|
|
307
|
+
return this.client.delete(`/tenant/api-keys/${keyId}`);
|
|
308
|
+
}
|
|
309
|
+
/** Rotate API key */
|
|
310
|
+
async rotate(keyId, data) {
|
|
311
|
+
return this.client.post(`/tenant/api-keys/${keyId}/rotate`, data);
|
|
312
|
+
}
|
|
313
|
+
};
|
|
314
|
+
|
|
315
|
+
// src/generated/apps.ts
|
|
316
|
+
var AppsResource = class {
|
|
317
|
+
constructor(client) {
|
|
318
|
+
this.client = client;
|
|
319
|
+
}
|
|
320
|
+
/** Create a new app (available to all authenticated users) */
|
|
321
|
+
async create(data) {
|
|
322
|
+
return this.client.post("/public/apps/create", data);
|
|
323
|
+
}
|
|
324
|
+
/** Get current app usage and limits */
|
|
325
|
+
async list() {
|
|
326
|
+
return this.client.get("/public/apps/usage");
|
|
327
|
+
}
|
|
328
|
+
/** Update app settings (name and environment only) */
|
|
329
|
+
async patch(data) {
|
|
330
|
+
return this.client.patch("/public/app/settings", data);
|
|
331
|
+
}
|
|
332
|
+
};
|
|
333
|
+
|
|
334
|
+
// src/generated/assets.ts
|
|
335
|
+
var AssetsResource = class {
|
|
336
|
+
constructor(client) {
|
|
337
|
+
this.client = client;
|
|
338
|
+
}
|
|
339
|
+
/** Upload asset to R2 with Firebase metadata */
|
|
340
|
+
async create(data) {
|
|
341
|
+
return this.client.post("/assets/upload", data);
|
|
342
|
+
}
|
|
343
|
+
/** List user assets */
|
|
344
|
+
async list() {
|
|
345
|
+
return this.client.get("/assets");
|
|
346
|
+
}
|
|
347
|
+
/** Get asset by ID */
|
|
348
|
+
async get(id) {
|
|
349
|
+
return this.client.get(`/assets/${id}`);
|
|
350
|
+
}
|
|
351
|
+
/** Delete asset from R2 and Firebase */
|
|
352
|
+
async delete(id) {
|
|
353
|
+
return this.client.delete(`/assets/${id}`);
|
|
354
|
+
}
|
|
355
|
+
/** Update asset metadata */
|
|
356
|
+
async updateMetadata(id, data) {
|
|
357
|
+
return this.client.put(`/assets/${id}/metadata`, data);
|
|
358
|
+
}
|
|
359
|
+
};
|
|
360
|
+
|
|
361
|
+
// src/generated/authentication.ts
|
|
362
|
+
var AuthenticationResource = class {
|
|
363
|
+
constructor(client) {
|
|
364
|
+
this.client = client;
|
|
365
|
+
}
|
|
366
|
+
/** Login with email and password. Returns JWT token if MFA is disabled, or requires MFA verification if enabled. */
|
|
367
|
+
async create(data) {
|
|
368
|
+
return this.client.post("/auth/login", data);
|
|
369
|
+
}
|
|
370
|
+
/** Complete login with MFA verification. Supports TOTP tokens and backup codes. */
|
|
371
|
+
async createMfa(data) {
|
|
372
|
+
return this.client.post("/auth/login/mfa", data);
|
|
373
|
+
}
|
|
374
|
+
/** Verify MFA token without full login. Production endpoint for token validation. */
|
|
375
|
+
async createVerifyMfaToken(data) {
|
|
376
|
+
return this.client.post("/auth/verify-mfa-token", data);
|
|
377
|
+
}
|
|
378
|
+
/** Switch to a different tenant. Returns a new JWT with tenantId claim. */
|
|
379
|
+
async createSwitchTenant(data) {
|
|
380
|
+
return this.client.post("/auth/switch-tenant", data);
|
|
381
|
+
}
|
|
382
|
+
/** Exchange API key for JWT token. Used by SDK for programmatic access. */
|
|
383
|
+
async createToken(data) {
|
|
384
|
+
return this.client.post("/auth/token", data);
|
|
385
|
+
}
|
|
386
|
+
/** Request password reset email */
|
|
387
|
+
async createForgotPassword(data) {
|
|
388
|
+
return this.client.post("/api/auth/forgot-password", data);
|
|
389
|
+
}
|
|
390
|
+
/** Verify password reset token is valid */
|
|
391
|
+
async createVerifyResetToken(data) {
|
|
392
|
+
return this.client.post("/auth/verify-reset-token", data);
|
|
393
|
+
}
|
|
394
|
+
/** Reset password with valid token */
|
|
395
|
+
async createResetPassword(data) {
|
|
396
|
+
return this.client.post("/auth/reset-password", data);
|
|
397
|
+
}
|
|
398
|
+
};
|
|
399
|
+
|
|
400
|
+
// src/generated/billing.ts
|
|
401
|
+
var BillingResource = class {
|
|
402
|
+
constructor(client) {
|
|
403
|
+
this.client = client;
|
|
404
|
+
}
|
|
405
|
+
/** Get all available billing plans with feature limits */
|
|
406
|
+
async list() {
|
|
407
|
+
return this.client.get("/billing/plans");
|
|
408
|
+
}
|
|
409
|
+
/** Get current usage statistics against plan limits (tenant-isolated) */
|
|
410
|
+
async listUsage() {
|
|
411
|
+
return this.client.get("/billing/usage");
|
|
412
|
+
}
|
|
413
|
+
/** Get current subscription status and details (tenant-isolated) */
|
|
414
|
+
async listSubscription() {
|
|
415
|
+
return this.client.get("/billing/subscription");
|
|
416
|
+
}
|
|
417
|
+
/** Request to upgrade to a different plan (tenant-isolated) */
|
|
418
|
+
async create(data) {
|
|
419
|
+
return this.client.post("/billing/upgrade", data);
|
|
420
|
+
}
|
|
421
|
+
/** List products from tenant's Polar organization */
|
|
422
|
+
async listProducts() {
|
|
423
|
+
return this.client.get("/billing/tenant/products");
|
|
424
|
+
}
|
|
425
|
+
/** Create a product in tenant's Polar organization */
|
|
426
|
+
async createProducts(data) {
|
|
427
|
+
return this.client.post("/billing/tenant/products", data);
|
|
428
|
+
}
|
|
429
|
+
/** Create a checkout session for a user in tenant's Polar org */
|
|
430
|
+
async createCheckout(data) {
|
|
431
|
+
return this.client.post("/billing/tenant/checkout", data);
|
|
432
|
+
}
|
|
433
|
+
/** List customers from tenant's Polar organization */
|
|
434
|
+
async listCustomers() {
|
|
435
|
+
return this.client.get("/billing/tenant/customers");
|
|
436
|
+
}
|
|
437
|
+
/** List subscriptions from tenant's Polar organization */
|
|
438
|
+
async listSubscriptions() {
|
|
439
|
+
return this.client.get("/billing/tenant/subscriptions");
|
|
440
|
+
}
|
|
441
|
+
/** Cancel a subscription in tenant's Polar organization */
|
|
442
|
+
async delete(id) {
|
|
443
|
+
return this.client.delete(`/billing/tenant/subscriptions/${id}`);
|
|
444
|
+
}
|
|
445
|
+
/** Get customer subscription state from tenant's Polar organization */
|
|
446
|
+
async state(id) {
|
|
447
|
+
return this.client.get(`/billing/tenant/customers/${id}/state`);
|
|
448
|
+
}
|
|
449
|
+
/** Stripe webhook handler for subscription events */
|
|
450
|
+
async createStripe(data) {
|
|
451
|
+
return this.client.post("/webhooks/billing/stripe", data);
|
|
452
|
+
}
|
|
453
|
+
/** Polar webhook handler for subscription events */
|
|
454
|
+
async createPolar(data) {
|
|
455
|
+
return this.client.post("/webhooks/billing/polar", data);
|
|
456
|
+
}
|
|
457
|
+
};
|
|
458
|
+
|
|
459
|
+
// src/generated/cache.ts
|
|
460
|
+
var CacheResource = class {
|
|
461
|
+
constructor(client) {
|
|
462
|
+
this.client = client;
|
|
463
|
+
}
|
|
464
|
+
/** Get cache statistics including hit rate, memory usage, and item count */
|
|
465
|
+
async list() {
|
|
466
|
+
return this.client.get("/cache/stats");
|
|
467
|
+
}
|
|
468
|
+
/** Clear all items from the cache and reset statistics */
|
|
469
|
+
async delete() {
|
|
470
|
+
return this.client.delete("/cache/flush");
|
|
471
|
+
}
|
|
472
|
+
/** Invalidate all cache entries that match a given pattern */
|
|
473
|
+
async create(data) {
|
|
474
|
+
return this.client.post("/cache/invalidate", data);
|
|
475
|
+
}
|
|
476
|
+
/** Reset cache hit/miss statistics while preserving cached data */
|
|
477
|
+
async createResetStats(data) {
|
|
478
|
+
return this.client.post("/cache/reset-stats", data);
|
|
479
|
+
}
|
|
480
|
+
};
|
|
481
|
+
|
|
482
|
+
// src/generated/config.ts
|
|
483
|
+
var ConfigResource = class {
|
|
484
|
+
constructor(client) {
|
|
485
|
+
this.client = client;
|
|
486
|
+
}
|
|
487
|
+
/** Get active tenant configuration */
|
|
488
|
+
async list() {
|
|
489
|
+
return this.client.get("/tenant/config");
|
|
490
|
+
}
|
|
491
|
+
/** Upload or update tenant configuration */
|
|
492
|
+
async create(data) {
|
|
493
|
+
return this.client.post("/tenant/config", data);
|
|
494
|
+
}
|
|
495
|
+
/** List configuration versions */
|
|
496
|
+
async listVersions() {
|
|
497
|
+
return this.client.get("/tenant/config/versions");
|
|
498
|
+
}
|
|
499
|
+
/** Rollback configuration */
|
|
500
|
+
async createRollback(version, data) {
|
|
501
|
+
return this.client.post(`/tenant/config/rollback/${version}`, data);
|
|
502
|
+
}
|
|
503
|
+
/** Get available webhook events */
|
|
504
|
+
async listEvents() {
|
|
505
|
+
return this.client.get("/tenant/events");
|
|
506
|
+
}
|
|
507
|
+
};
|
|
508
|
+
|
|
509
|
+
// src/generated/default.ts
|
|
510
|
+
var DefaultResource = class {
|
|
511
|
+
constructor(client) {
|
|
512
|
+
this.client = client;
|
|
513
|
+
}
|
|
514
|
+
/** GET /tenant/debug/raw-query */
|
|
515
|
+
async list() {
|
|
516
|
+
return this.client.get("/tenant/debug/raw-query");
|
|
517
|
+
}
|
|
518
|
+
};
|
|
519
|
+
|
|
520
|
+
// src/generated/deployment.ts
|
|
521
|
+
var DeploymentResource = class {
|
|
522
|
+
constructor(client) {
|
|
523
|
+
this.client = client;
|
|
524
|
+
}
|
|
525
|
+
/** Get deployment information */
|
|
526
|
+
async list() {
|
|
527
|
+
return this.client.get("/deployment");
|
|
528
|
+
}
|
|
529
|
+
/** Get server information */
|
|
530
|
+
async listServer() {
|
|
531
|
+
return this.client.get("/deployment/server");
|
|
532
|
+
}
|
|
533
|
+
/** Get full deployment status */
|
|
534
|
+
async listStatus() {
|
|
535
|
+
return this.client.get("/deployment/status");
|
|
536
|
+
}
|
|
537
|
+
/** Get Cloud Run service URL */
|
|
538
|
+
async listUrl() {
|
|
539
|
+
return this.client.get("/deployment/url");
|
|
540
|
+
}
|
|
541
|
+
/** Server-Sent Events (SSE) stream for real-time deployment status updates. Sends periodic status updates and heartbeats. */
|
|
542
|
+
async listStream() {
|
|
543
|
+
return this.client.get("/deployment/stream");
|
|
544
|
+
}
|
|
545
|
+
/** Filtered Server-Sent Events (SSE) stream for specific deployment event types. Filter by status, server, or url events. */
|
|
546
|
+
async listEvents() {
|
|
547
|
+
return this.client.get("/deployment/events");
|
|
548
|
+
}
|
|
549
|
+
};
|
|
550
|
+
|
|
551
|
+
// src/generated/domains.ts
|
|
552
|
+
var DomainsResource = class {
|
|
553
|
+
constructor(client) {
|
|
554
|
+
this.client = client;
|
|
555
|
+
}
|
|
556
|
+
/** List domains */
|
|
557
|
+
async list() {
|
|
558
|
+
return this.client.get("/tenant/domains");
|
|
559
|
+
}
|
|
560
|
+
/** Add domain */
|
|
561
|
+
async create(data) {
|
|
562
|
+
return this.client.post("/tenant/domains", data);
|
|
563
|
+
}
|
|
564
|
+
/** Remove domain */
|
|
565
|
+
async delete(domain) {
|
|
566
|
+
return this.client.delete(`/tenant/domains/${domain}`);
|
|
567
|
+
}
|
|
568
|
+
/** Verify domain */
|
|
569
|
+
async createVerify(domain, data) {
|
|
570
|
+
return this.client.post(`/tenant/domains/${domain}/verify`, data);
|
|
571
|
+
}
|
|
572
|
+
/** Get verification instructions */
|
|
573
|
+
async verification(domain) {
|
|
574
|
+
return this.client.get(`/tenant/domains/${domain}/verification`);
|
|
575
|
+
}
|
|
576
|
+
};
|
|
577
|
+
|
|
578
|
+
// src/generated/embeddings.ts
|
|
579
|
+
var EmbeddingsResource = class {
|
|
580
|
+
constructor(client) {
|
|
581
|
+
this.client = client;
|
|
582
|
+
}
|
|
583
|
+
/** List all embedded documents with chunk counts and metadata */
|
|
584
|
+
async list() {
|
|
585
|
+
return this.client.get("/agent/embeddings/documents");
|
|
586
|
+
}
|
|
587
|
+
/** Upload and process a document for vector embeddings with automatic chunking. Supports various content types (code, documentation, articles) with optimized chunking strategies for RAG. */
|
|
588
|
+
async create(data) {
|
|
589
|
+
return this.client.post("/agent/embeddings/document", data);
|
|
590
|
+
}
|
|
591
|
+
/** Search within a specific document using semantic similarity. Performs vector search within document chunks. */
|
|
592
|
+
async search(documentId) {
|
|
593
|
+
return this.client.get(`/agent/embeddings/document/${documentId}/search`);
|
|
594
|
+
}
|
|
595
|
+
/** Search across all embedded documents using semantic similarity */
|
|
596
|
+
async listSearch() {
|
|
597
|
+
return this.client.get("/agent/embeddings/search");
|
|
598
|
+
}
|
|
599
|
+
/** Delete all chunks and embeddings for a document. Removes the document from the vector store. */
|
|
600
|
+
async delete(documentId) {
|
|
601
|
+
return this.client.delete(`/agent/embeddings/document/${documentId}`);
|
|
602
|
+
}
|
|
603
|
+
/** 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. */
|
|
604
|
+
async createBatch(data) {
|
|
605
|
+
return this.client.post("/agent/embeddings/batch", data);
|
|
606
|
+
}
|
|
607
|
+
};
|
|
608
|
+
|
|
609
|
+
// src/generated/feedback.ts
|
|
610
|
+
var FeedbackResource = class {
|
|
611
|
+
constructor(client) {
|
|
612
|
+
this.client = client;
|
|
613
|
+
}
|
|
614
|
+
/** Submit feedback for a workflow execution. Used to optimize and improve workflow performance based on user ratings and suggestions. */
|
|
615
|
+
async create(data) {
|
|
616
|
+
return this.client.post("/agent/feedback", data);
|
|
617
|
+
}
|
|
618
|
+
/** Get feedback trends and analytics. Analyzes workflow feedback to identify patterns and areas for improvement. */
|
|
619
|
+
async list() {
|
|
620
|
+
return this.client.get("/agent/feedback/trends");
|
|
621
|
+
}
|
|
622
|
+
};
|
|
623
|
+
|
|
624
|
+
// src/generated/files.ts
|
|
625
|
+
var FilesResource = class {
|
|
626
|
+
constructor(client) {
|
|
627
|
+
this.client = client;
|
|
628
|
+
}
|
|
629
|
+
/** Upload a single file with entity association and tenant isolation */
|
|
630
|
+
async create(data) {
|
|
631
|
+
return this.client.post("/files/upload", data);
|
|
632
|
+
}
|
|
633
|
+
/** Upload multiple files with entity association and tenant isolation */
|
|
634
|
+
async createUploadMultiple(data) {
|
|
635
|
+
return this.client.post("/files/upload-multiple", data);
|
|
636
|
+
}
|
|
637
|
+
/** List files for an entity with pagination */
|
|
638
|
+
async get(entityType, entityId) {
|
|
639
|
+
return this.client.get(`/files/entity/${entityType}/${entityId}`);
|
|
640
|
+
}
|
|
641
|
+
/** Delete all files for an entity */
|
|
642
|
+
async delete(entityType, entityId) {
|
|
643
|
+
return this.client.delete(`/files/entity/${entityType}/${entityId}`);
|
|
644
|
+
}
|
|
645
|
+
/** Download file via secure signed URL redirect (5 minute expiry) */
|
|
646
|
+
async getDownload(bucket, path) {
|
|
647
|
+
return this.client.get(`/files/download/${bucket}/${path}`);
|
|
648
|
+
}
|
|
649
|
+
/** Get a signed URL for file access (max 30 seconds expiry) */
|
|
650
|
+
async getSignedUrl(bucket, path) {
|
|
651
|
+
return this.client.get(`/files/signed-url/${bucket}/${path}`);
|
|
652
|
+
}
|
|
653
|
+
/** Delete a file from storage */
|
|
654
|
+
async deleteDELETE(bucket, path) {
|
|
655
|
+
return this.client.delete(`/files/${bucket}/${path}`);
|
|
656
|
+
}
|
|
657
|
+
/** Upload JSON content to storage */
|
|
658
|
+
async createUploadJson(data) {
|
|
659
|
+
return this.client.post("/files/upload-json", data);
|
|
660
|
+
}
|
|
661
|
+
};
|
|
662
|
+
|
|
663
|
+
// src/generated/github.ts
|
|
664
|
+
var GithubResource = class {
|
|
665
|
+
constructor(client) {
|
|
666
|
+
this.client = client;
|
|
667
|
+
}
|
|
668
|
+
/** Get GitHub repositories for a user */
|
|
669
|
+
async get(username) {
|
|
670
|
+
return this.client.get(`/api/github/repos/${username}`);
|
|
671
|
+
}
|
|
672
|
+
/** Get file or directory contents from a GitHub repository */
|
|
673
|
+
async getContent(owner, repo, path) {
|
|
674
|
+
return this.client.get(`/api/github/repos/${owner}/${repo}/contents/${path}`);
|
|
675
|
+
}
|
|
676
|
+
/** Create or update a file in a GitHub repository */
|
|
677
|
+
async updateContent(owner, repo, path, data) {
|
|
678
|
+
return this.client.put(`/api/github/repos/${owner}/${repo}/contents/${path}`, data);
|
|
679
|
+
}
|
|
680
|
+
/** Delete a file from a GitHub repository */
|
|
681
|
+
async deleteContent(owner, repo, path) {
|
|
682
|
+
return this.client.delete(`/api/github/repos/${owner}/${repo}/contents/${path}`);
|
|
683
|
+
}
|
|
684
|
+
/** Compare two commits and view the diff */
|
|
685
|
+
async getCompare(owner, repo, basehead) {
|
|
686
|
+
return this.client.get(`/api/github/repos/${owner}/${repo}/compare/${basehead}`);
|
|
687
|
+
}
|
|
688
|
+
/** Get a single commit with its changes */
|
|
689
|
+
async getCommit(owner, repo, ref) {
|
|
690
|
+
return this.client.get(`/api/github/repos/${owner}/${repo}/commits/${ref}`);
|
|
691
|
+
}
|
|
692
|
+
/** List commits in a repository */
|
|
693
|
+
async commits(owner, repo) {
|
|
694
|
+
return this.client.get(`/api/github/repos/${owner}/${repo}/commits`);
|
|
695
|
+
}
|
|
696
|
+
/** Get pull request details */
|
|
697
|
+
async getPull(owner, repo, pull_number) {
|
|
698
|
+
return this.client.get(`/api/github/repos/${owner}/${repo}/pulls/${pull_number}`);
|
|
699
|
+
}
|
|
700
|
+
/** List files changed in a pull request with diffs */
|
|
701
|
+
async files(owner, repo, pull_number) {
|
|
702
|
+
return this.client.get(`/api/github/repos/${owner}/${repo}/pulls/${pull_number}/files`);
|
|
703
|
+
}
|
|
704
|
+
};
|
|
705
|
+
|
|
706
|
+
// src/generated/goals.ts
|
|
707
|
+
var GoalsResource = class {
|
|
708
|
+
constructor(client) {
|
|
709
|
+
this.client = client;
|
|
710
|
+
}
|
|
711
|
+
/** Configure goal evaluation rules for a workflow. Sets KPIs, success criteria, and evaluation parameters. */
|
|
712
|
+
async create(data) {
|
|
713
|
+
return this.client.post("/agent/goal/configure", data);
|
|
714
|
+
}
|
|
715
|
+
/** Manually trigger goal evaluation for a workflow. Evaluates workflow performance against configured KPIs and success criteria. */
|
|
716
|
+
async createEvaluate(workflowId, data) {
|
|
717
|
+
return this.client.post(`/agent/goal/evaluate/${workflowId}`, data);
|
|
718
|
+
}
|
|
719
|
+
/** Get evaluation history for a workflow. Returns all historical goal evaluation records. */
|
|
720
|
+
async get(workflowId) {
|
|
721
|
+
return this.client.get(`/agent/goal/history/${workflowId}`);
|
|
722
|
+
}
|
|
723
|
+
/** Start scheduled goal evaluation. Automatically evaluates all active workflows at specified intervals. */
|
|
724
|
+
async createStart(data) {
|
|
725
|
+
return this.client.post("/agent/goal/schedule/start", data);
|
|
726
|
+
}
|
|
727
|
+
/** Stop scheduled goal evaluation. Cancels automatic workflow evaluations. */
|
|
728
|
+
async createStop(data) {
|
|
729
|
+
return this.client.post("/agent/goal/schedule/stop", data);
|
|
730
|
+
}
|
|
731
|
+
/** Evaluate all active workflows. Generates evaluation reports for all workflows with configured goals. */
|
|
732
|
+
async createEvaluateAll(data) {
|
|
733
|
+
return this.client.post("/agent/goal/evaluate-all", data);
|
|
734
|
+
}
|
|
735
|
+
};
|
|
736
|
+
|
|
737
|
+
// src/generated/google-drive.ts
|
|
738
|
+
var GoogleDriveResource = class {
|
|
739
|
+
constructor(client) {
|
|
740
|
+
this.client = client;
|
|
741
|
+
}
|
|
742
|
+
/** List files in Google Drive */
|
|
743
|
+
async list() {
|
|
744
|
+
return this.client.get("/api/google-drive/files");
|
|
745
|
+
}
|
|
746
|
+
/** Get file metadata from Google Drive */
|
|
747
|
+
async get(fileId) {
|
|
748
|
+
return this.client.get(`/api/google-drive/files/${fileId}`);
|
|
749
|
+
}
|
|
750
|
+
/** Update file metadata (rename, move) */
|
|
751
|
+
async patch(fileId, data) {
|
|
752
|
+
return this.client.patch(`/api/google-drive/files/${fileId}`, data);
|
|
753
|
+
}
|
|
754
|
+
/** Delete a file from Google Drive */
|
|
755
|
+
async delete(fileId) {
|
|
756
|
+
return this.client.delete(`/api/google-drive/files/${fileId}`);
|
|
757
|
+
}
|
|
758
|
+
/** Download file content from Google Drive */
|
|
759
|
+
async download(fileId) {
|
|
760
|
+
return this.client.get(`/api/google-drive/files/${fileId}/download`);
|
|
761
|
+
}
|
|
762
|
+
/** Search for PDF files in Google Drive */
|
|
763
|
+
async listPdfs() {
|
|
764
|
+
return this.client.get("/api/google-drive/pdfs");
|
|
765
|
+
}
|
|
766
|
+
};
|
|
767
|
+
|
|
768
|
+
// src/generated/jira.ts
|
|
769
|
+
var JiraResource = class {
|
|
770
|
+
constructor(client) {
|
|
771
|
+
this.client = client;
|
|
772
|
+
}
|
|
773
|
+
/** Search JIRA issues using JQL */
|
|
774
|
+
async list() {
|
|
775
|
+
return this.client.get("/api/jira/issues/search");
|
|
776
|
+
}
|
|
777
|
+
/** Get JIRA issue details */
|
|
778
|
+
async get(issueKey) {
|
|
779
|
+
return this.client.get(`/api/jira/issues/${issueKey}`);
|
|
780
|
+
}
|
|
781
|
+
/** Update a JIRA issue */
|
|
782
|
+
async update(issueKey, data) {
|
|
783
|
+
return this.client.put(`/api/jira/issues/${issueKey}`, data);
|
|
784
|
+
}
|
|
785
|
+
/** Delete a JIRA issue */
|
|
786
|
+
async delete(issueKey) {
|
|
787
|
+
return this.client.delete(`/api/jira/issues/${issueKey}`);
|
|
788
|
+
}
|
|
789
|
+
/** Create a new JIRA issue */
|
|
790
|
+
async create(data) {
|
|
791
|
+
return this.client.post("/api/jira/issues", data);
|
|
792
|
+
}
|
|
793
|
+
/** Get available transitions for a JIRA issue */
|
|
794
|
+
async transitions(issueKey) {
|
|
795
|
+
return this.client.get(`/api/jira/issues/${issueKey}/transitions`);
|
|
796
|
+
}
|
|
797
|
+
/** Transition a JIRA issue to new status */
|
|
798
|
+
async createTransition(issueKey, data) {
|
|
799
|
+
return this.client.post(`/api/jira/issues/${issueKey}/transition`, data);
|
|
800
|
+
}
|
|
801
|
+
/** Get comments for a JIRA issue */
|
|
802
|
+
async comments(issueKey) {
|
|
803
|
+
return this.client.get(`/api/jira/issues/${issueKey}/comments`);
|
|
804
|
+
}
|
|
805
|
+
/** Add comment to a JIRA issue */
|
|
806
|
+
async createComment(issueKey, data) {
|
|
807
|
+
return this.client.post(`/api/jira/issues/${issueKey}/comments`, data);
|
|
808
|
+
}
|
|
809
|
+
/** Assign a JIRA issue to a user */
|
|
810
|
+
async updateAssign(issueKey, data) {
|
|
811
|
+
return this.client.put(`/api/jira/issues/${issueKey}/assign`, data);
|
|
812
|
+
}
|
|
813
|
+
/** Get all JIRA projects */
|
|
814
|
+
async listProjects() {
|
|
815
|
+
return this.client.get("/api/jira/projects");
|
|
816
|
+
}
|
|
817
|
+
/** Get JIRA project details */
|
|
818
|
+
async getProjects(projectKey) {
|
|
819
|
+
return this.client.get(`/api/jira/projects/${projectKey}`);
|
|
820
|
+
}
|
|
821
|
+
/** Get current authenticated JIRA user */
|
|
822
|
+
async listMe() {
|
|
823
|
+
return this.client.get("/api/jira/user/me");
|
|
824
|
+
}
|
|
825
|
+
/** Search JIRA users */
|
|
826
|
+
async listSearch() {
|
|
827
|
+
return this.client.get("/api/jira/users/search");
|
|
828
|
+
}
|
|
829
|
+
/** Get all JIRA issue types */
|
|
830
|
+
async listIssueTypes() {
|
|
831
|
+
return this.client.get("/api/jira/metadata/issue-types");
|
|
832
|
+
}
|
|
833
|
+
/** Get all JIRA priority levels */
|
|
834
|
+
async listPriorities() {
|
|
835
|
+
return this.client.get("/api/jira/metadata/priorities");
|
|
836
|
+
}
|
|
837
|
+
};
|
|
838
|
+
|
|
839
|
+
// src/generated/llm.ts
|
|
840
|
+
var LlmResource = class {
|
|
841
|
+
constructor(client) {
|
|
842
|
+
this.client = client;
|
|
843
|
+
}
|
|
844
|
+
/** POST /llm/stream */
|
|
845
|
+
async create(data) {
|
|
846
|
+
return this.client.post("/llm/stream", data);
|
|
847
|
+
}
|
|
848
|
+
/** GET /llm/models */
|
|
849
|
+
async list() {
|
|
850
|
+
return this.client.get("/llm/models");
|
|
851
|
+
}
|
|
852
|
+
};
|
|
853
|
+
|
|
854
|
+
// src/generated/mcptools.ts
|
|
855
|
+
var McpToolsResource = class {
|
|
856
|
+
constructor(client) {
|
|
857
|
+
this.client = client;
|
|
858
|
+
}
|
|
859
|
+
/** List all available MCP tools from connected servers. Returns tools, connection status, and server information. */
|
|
860
|
+
async list() {
|
|
861
|
+
return this.client.get("/agent/mcp/tools");
|
|
862
|
+
}
|
|
863
|
+
/** Execute a Model Context Protocol (MCP) tool. MCP tools provide external capabilities like file system access, database queries, and API calls to LLM workflows. */
|
|
864
|
+
async create(data) {
|
|
865
|
+
return this.client.post("/agent/mcp/execute", data);
|
|
866
|
+
}
|
|
867
|
+
};
|
|
868
|
+
|
|
869
|
+
// src/generated/mfa.ts
|
|
870
|
+
var MfaResource = class {
|
|
871
|
+
constructor(client) {
|
|
872
|
+
this.client = client;
|
|
873
|
+
}
|
|
874
|
+
/** Initialize MFA setup for the authenticated user. Generates TOTP secret, QR code, and backup codes. Requires JWT authentication. */
|
|
875
|
+
async create(data) {
|
|
876
|
+
return this.client.post("/mfa/setup", data);
|
|
877
|
+
}
|
|
878
|
+
/** Verify MFA setup with a TOTP token from authenticator app and enable MFA for the account. Requires JWT authentication. */
|
|
879
|
+
async createVerify(data) {
|
|
880
|
+
return this.client.post("/mfa/verify", data);
|
|
881
|
+
}
|
|
882
|
+
/** Disable MFA for the authenticated user. Requires current valid MFA token for security verification. */
|
|
883
|
+
async createDisable(data) {
|
|
884
|
+
return this.client.post("/mfa/disable", data);
|
|
885
|
+
}
|
|
886
|
+
/** Check MFA status for the authenticated user. Returns whether MFA is enabled and setup dates. */
|
|
887
|
+
async list() {
|
|
888
|
+
return this.client.get("/mfa/status");
|
|
889
|
+
}
|
|
890
|
+
/** Generate new backup codes for MFA recovery. Invalidates all previous backup codes. Requires current MFA token for security. */
|
|
891
|
+
async createRegenerateBackupCodes(data) {
|
|
892
|
+
return this.client.post("/mfa/regenerate-backup-codes", data);
|
|
893
|
+
}
|
|
894
|
+
/** Validate an MFA token without side effects. Useful for protecting sensitive operations with MFA verification. */
|
|
895
|
+
async createValidate(data) {
|
|
896
|
+
return this.client.post("/mfa/validate", data);
|
|
897
|
+
}
|
|
898
|
+
};
|
|
899
|
+
|
|
900
|
+
// src/generated/migration.ts
|
|
901
|
+
var MigrationResource = class {
|
|
902
|
+
constructor(client) {
|
|
903
|
+
this.client = client;
|
|
904
|
+
}
|
|
905
|
+
/** Get database migration SQL and instructions */
|
|
906
|
+
async list() {
|
|
907
|
+
return this.client.get("/migration");
|
|
908
|
+
}
|
|
909
|
+
/** Check if database migration has been applied */
|
|
910
|
+
async listStatus() {
|
|
911
|
+
return this.client.get("/migration/status");
|
|
912
|
+
}
|
|
913
|
+
/** Get quick migration with RLS disabled for development */
|
|
914
|
+
async listQuickFix() {
|
|
915
|
+
return this.client.get("/migration/quick-fix");
|
|
916
|
+
}
|
|
917
|
+
};
|
|
918
|
+
|
|
919
|
+
// src/generated/polar.ts
|
|
920
|
+
var PolarResource = class {
|
|
921
|
+
constructor(client) {
|
|
922
|
+
this.client = client;
|
|
923
|
+
}
|
|
924
|
+
/** Create a Polar checkout session */
|
|
925
|
+
async create(data) {
|
|
926
|
+
return this.client.post("/integrations/polar/checkouts", data);
|
|
927
|
+
}
|
|
928
|
+
/** Retrieve a Polar checkout session */
|
|
929
|
+
async get(checkoutId) {
|
|
930
|
+
return this.client.get(`/integrations/polar/checkouts/${checkoutId}`);
|
|
931
|
+
}
|
|
932
|
+
/** Create a Polar subscription */
|
|
933
|
+
async createSubscriptions(data) {
|
|
934
|
+
return this.client.post("/integrations/polar/subscriptions", data);
|
|
935
|
+
}
|
|
936
|
+
/** Cancel a Polar subscription */
|
|
937
|
+
async delete(subscriptionId) {
|
|
938
|
+
return this.client.delete(`/integrations/polar/subscriptions/${subscriptionId}`);
|
|
939
|
+
}
|
|
940
|
+
/** List Polar products */
|
|
941
|
+
async list() {
|
|
942
|
+
return this.client.get("/integrations/polar/products");
|
|
943
|
+
}
|
|
944
|
+
/** Create a Polar product */
|
|
945
|
+
async createProducts(data) {
|
|
946
|
+
return this.client.post("/integrations/polar/products", data);
|
|
947
|
+
}
|
|
948
|
+
/** Retrieve a Polar order */
|
|
949
|
+
async getOrders(orderId) {
|
|
950
|
+
return this.client.get(`/integrations/polar/orders/${orderId}`);
|
|
951
|
+
}
|
|
952
|
+
/** Create a Polar benefit */
|
|
953
|
+
async createBenefits(data) {
|
|
954
|
+
return this.client.post("/integrations/polar/benefits", data);
|
|
955
|
+
}
|
|
956
|
+
/** Grant a Polar benefit to a customer */
|
|
957
|
+
async createGrants(data) {
|
|
958
|
+
return this.client.post("/integrations/polar/benefits/grants", data);
|
|
959
|
+
}
|
|
960
|
+
};
|
|
961
|
+
|
|
962
|
+
// src/generated/projects.ts
|
|
963
|
+
var ProjectsResource = class {
|
|
964
|
+
constructor(client) {
|
|
965
|
+
this.client = client;
|
|
966
|
+
}
|
|
967
|
+
/** List version history for a project with pagination and date range filter */
|
|
968
|
+
async versions(id) {
|
|
969
|
+
return this.client.get(`/projects/${id}/versions`);
|
|
970
|
+
}
|
|
971
|
+
/** Create a new project version record (Pro tier) */
|
|
972
|
+
async createVersion(id, data) {
|
|
973
|
+
return this.client.post(`/projects/${id}/versions`, data);
|
|
974
|
+
}
|
|
975
|
+
/** Delete all versions for a project and their R2 files (parallel) */
|
|
976
|
+
async deleteAllVersions(id) {
|
|
977
|
+
return this.client.delete(`/projects/${id}/versions`);
|
|
978
|
+
}
|
|
979
|
+
/** Get a specific version record */
|
|
980
|
+
async getVersion(id, versionId) {
|
|
981
|
+
return this.client.get(`/projects/${id}/versions/${versionId}`);
|
|
982
|
+
}
|
|
983
|
+
/** Delete a specific project version and its R2 files */
|
|
984
|
+
async deleteVersion(id, versionId) {
|
|
985
|
+
return this.client.delete(`/projects/${id}/versions/${versionId}`);
|
|
986
|
+
}
|
|
987
|
+
/** Rollback project to a previous version (Pro tier) */
|
|
988
|
+
async rollback(id, version, data) {
|
|
989
|
+
return this.client.post(`/projects/${id}/rollback/${version}`, data);
|
|
990
|
+
}
|
|
991
|
+
/** Save project with parallel R2 uploads and Firestore updates */
|
|
992
|
+
async updateSave(projectId, data) {
|
|
993
|
+
return this.client.put(`/projects/${projectId}/save`, data);
|
|
994
|
+
}
|
|
995
|
+
/** Save project and execute content as workflow */
|
|
996
|
+
async saveAndRun(projectId, data) {
|
|
997
|
+
return this.client.post(`/projects/${projectId}/save-and-run`, data);
|
|
998
|
+
}
|
|
999
|
+
/** Get project by ID */
|
|
1000
|
+
async get(id) {
|
|
1001
|
+
return this.client.get(`/projects/${id}`);
|
|
1002
|
+
}
|
|
1003
|
+
/** Update project metadata (title, description, etc.) */
|
|
1004
|
+
async patch(id, data) {
|
|
1005
|
+
return this.client.patch(`/projects/${id}`, data);
|
|
1006
|
+
}
|
|
1007
|
+
/** Delete project and all related files/versions (parallel) */
|
|
1008
|
+
async delete(id) {
|
|
1009
|
+
return this.client.delete(`/projects/${id}`);
|
|
1010
|
+
}
|
|
1011
|
+
/** List all shares for a project */
|
|
1012
|
+
async shares(id) {
|
|
1013
|
+
return this.client.get(`/projects/${id}/shares`);
|
|
1014
|
+
}
|
|
1015
|
+
/** Share a project with another user */
|
|
1016
|
+
async share(id, data) {
|
|
1017
|
+
return this.client.post(`/projects/${id}/share`, data);
|
|
1018
|
+
}
|
|
1019
|
+
/** Remove share access from a user */
|
|
1020
|
+
async deleteShare(id, userId) {
|
|
1021
|
+
return this.client.delete(`/projects/${id}/share/${userId}`);
|
|
1022
|
+
}
|
|
1023
|
+
/** Get public project by ID (no auth required) */
|
|
1024
|
+
async public(projectId) {
|
|
1025
|
+
return this.client.get(`/projects/${projectId}/public`);
|
|
1026
|
+
}
|
|
1027
|
+
/** Toggle project public/private status with optional email notification */
|
|
1028
|
+
async patchPublic(id, data) {
|
|
1029
|
+
return this.client.patch(`/projects/${id}/public`, data);
|
|
1030
|
+
}
|
|
1031
|
+
/** List all projects shared with the current user */
|
|
1032
|
+
async list() {
|
|
1033
|
+
return this.client.get("/projects/shared-with-me");
|
|
1034
|
+
}
|
|
1035
|
+
/** Update project files (add/remove attached assets) */
|
|
1036
|
+
async patchFile(id, data) {
|
|
1037
|
+
return this.client.patch(`/projects/${id}/files`, data);
|
|
1038
|
+
}
|
|
1039
|
+
};
|
|
1040
|
+
|
|
1041
|
+
// src/generated/publish.ts
|
|
1042
|
+
var PublishResource = class {
|
|
1043
|
+
constructor(client) {
|
|
1044
|
+
this.client = client;
|
|
1045
|
+
}
|
|
1046
|
+
/** Initialize publishing system - checks database setup */
|
|
1047
|
+
async create(data) {
|
|
1048
|
+
return this.client.post("/publish/init", data);
|
|
1049
|
+
}
|
|
1050
|
+
/** Verify database migration was applied */
|
|
1051
|
+
async createVerify(data) {
|
|
1052
|
+
return this.client.post("/publish/verify", data);
|
|
1053
|
+
}
|
|
1054
|
+
/** Publish an entity (checks database readiness automatically) */
|
|
1055
|
+
async createEntity(data) {
|
|
1056
|
+
return this.client.post("/publish/entity", data);
|
|
1057
|
+
}
|
|
1058
|
+
};
|
|
1059
|
+
|
|
1060
|
+
// src/generated/queues.ts
|
|
1061
|
+
var QueuesResource = class {
|
|
1062
|
+
constructor(client) {
|
|
1063
|
+
this.client = client;
|
|
1064
|
+
}
|
|
1065
|
+
/** Get all queues and their statistics (tenant-isolated) */
|
|
1066
|
+
async list() {
|
|
1067
|
+
return this.client.get("/queues");
|
|
1068
|
+
}
|
|
1069
|
+
/** Get statistics for a specific queue (tenant-isolated) */
|
|
1070
|
+
async stats(name) {
|
|
1071
|
+
return this.client.get(`/queues/${name}/stats`);
|
|
1072
|
+
}
|
|
1073
|
+
/** Get jobs from a queue (tenant-isolated) */
|
|
1074
|
+
async jobs(name) {
|
|
1075
|
+
return this.client.get(`/queues/${name}/jobs`);
|
|
1076
|
+
}
|
|
1077
|
+
/** Add a job to the queue (with tenant isolation) */
|
|
1078
|
+
async createJob(name, data) {
|
|
1079
|
+
return this.client.post(`/queues/${name}/jobs`, data);
|
|
1080
|
+
}
|
|
1081
|
+
/** Get a specific job (tenant-isolated) */
|
|
1082
|
+
async getJob(name, jobId) {
|
|
1083
|
+
return this.client.get(`/queues/${name}/jobs/${jobId}`);
|
|
1084
|
+
}
|
|
1085
|
+
/** Retry a failed job (tenant-isolated) */
|
|
1086
|
+
async retry(name, jobId, data) {
|
|
1087
|
+
return this.client.post(`/queues/${name}/jobs/${jobId}/retry`, data);
|
|
1088
|
+
}
|
|
1089
|
+
/** Pause a queue (admin only - affects all tenants) */
|
|
1090
|
+
async pause(name, data) {
|
|
1091
|
+
return this.client.post(`/queues/${name}/pause`, data);
|
|
1092
|
+
}
|
|
1093
|
+
/** Resume a paused queue (admin only - affects all tenants) */
|
|
1094
|
+
async resume(name, data) {
|
|
1095
|
+
return this.client.post(`/queues/${name}/resume`, data);
|
|
1096
|
+
}
|
|
1097
|
+
/** Clean old jobs from queue (tenant-isolated) */
|
|
1098
|
+
async createClean(name, data) {
|
|
1099
|
+
return this.client.post(`/queues/${name}/clean`, data);
|
|
1100
|
+
}
|
|
1101
|
+
/** Get detailed performance metrics for a queue */
|
|
1102
|
+
async metrics(name) {
|
|
1103
|
+
return this.client.get(`/queues/${name}/metrics`);
|
|
1104
|
+
}
|
|
1105
|
+
};
|
|
1106
|
+
|
|
1107
|
+
// src/generated/search.ts
|
|
1108
|
+
var SearchResource = class {
|
|
1109
|
+
constructor(client) {
|
|
1110
|
+
this.client = client;
|
|
1111
|
+
}
|
|
1112
|
+
/** Fast search across an entity with configurable modes (exact, fuzzy, hybrid) */
|
|
1113
|
+
async get(entity) {
|
|
1114
|
+
return this.client.get(`/search/${entity}`);
|
|
1115
|
+
}
|
|
1116
|
+
/** Index entity records for vector search */
|
|
1117
|
+
async create(data) {
|
|
1118
|
+
return this.client.post("/search/index", data);
|
|
1119
|
+
}
|
|
1120
|
+
/** Delete and reindex all records for an entity */
|
|
1121
|
+
async createReindex(data) {
|
|
1122
|
+
return this.client.post("/search/reindex", data);
|
|
1123
|
+
}
|
|
1124
|
+
/** Delete all indexed records for an entity */
|
|
1125
|
+
async delete(entity) {
|
|
1126
|
+
return this.client.delete(`/search/index/${entity}`);
|
|
1127
|
+
}
|
|
1128
|
+
/** Get search index statistics */
|
|
1129
|
+
async list() {
|
|
1130
|
+
return this.client.get("/search/stats");
|
|
1131
|
+
}
|
|
1132
|
+
};
|
|
1133
|
+
|
|
1134
|
+
// src/generated/secrets.ts
|
|
1135
|
+
var SecretsResource = class {
|
|
1136
|
+
constructor(client) {
|
|
1137
|
+
this.client = client;
|
|
1138
|
+
}
|
|
1139
|
+
/** List secrets */
|
|
1140
|
+
async list() {
|
|
1141
|
+
return this.client.get("/tenant/secrets");
|
|
1142
|
+
}
|
|
1143
|
+
/** Store a secret */
|
|
1144
|
+
async create(data) {
|
|
1145
|
+
return this.client.post("/tenant/secrets", data);
|
|
1146
|
+
}
|
|
1147
|
+
/** Delete a secret */
|
|
1148
|
+
async delete(key) {
|
|
1149
|
+
return this.client.delete(`/tenant/secrets/${key}`);
|
|
1150
|
+
}
|
|
1151
|
+
/** Rotate a secret */
|
|
1152
|
+
async rotate(key, data) {
|
|
1153
|
+
return this.client.post(`/tenant/secrets/${key}/rotate`, data);
|
|
1154
|
+
}
|
|
1155
|
+
};
|
|
1156
|
+
|
|
1157
|
+
// src/generated/stripe.ts
|
|
1158
|
+
var StripeResource = class {
|
|
1159
|
+
constructor(client) {
|
|
1160
|
+
this.client = client;
|
|
1161
|
+
}
|
|
1162
|
+
/** Create a Stripe customer */
|
|
1163
|
+
async create(data) {
|
|
1164
|
+
return this.client.post("/integrations/stripe/customers", data);
|
|
1165
|
+
}
|
|
1166
|
+
/** Create a Stripe payment intent */
|
|
1167
|
+
async createPaymentIntents(data) {
|
|
1168
|
+
return this.client.post("/integrations/stripe/payment-intents", data);
|
|
1169
|
+
}
|
|
1170
|
+
/** Create a Stripe subscription */
|
|
1171
|
+
async createSubscriptions(data) {
|
|
1172
|
+
return this.client.post("/integrations/stripe/subscriptions", data);
|
|
1173
|
+
}
|
|
1174
|
+
};
|
|
1175
|
+
|
|
1176
|
+
// src/generated/system.ts
|
|
1177
|
+
var SystemResource = class {
|
|
1178
|
+
constructor(client) {
|
|
1179
|
+
this.client = client;
|
|
1180
|
+
}
|
|
1181
|
+
/** Get comprehensive system information including routes, providers, and integrations */
|
|
1182
|
+
async list() {
|
|
1183
|
+
return this.client.get("/info");
|
|
1184
|
+
}
|
|
1185
|
+
/** Get detailed information about all registered routes including tenant-specific custom routes */
|
|
1186
|
+
async listRoutes() {
|
|
1187
|
+
return this.client.get("/info/routes");
|
|
1188
|
+
}
|
|
1189
|
+
/** Get detailed information about all available integrations */
|
|
1190
|
+
async listIntegrations() {
|
|
1191
|
+
return this.client.get("/info/integrations");
|
|
1192
|
+
}
|
|
1193
|
+
/** Get information about the versioning system and how to use it */
|
|
1194
|
+
async listVersioning() {
|
|
1195
|
+
return this.client.get("/info/versioning");
|
|
1196
|
+
}
|
|
1197
|
+
/** Get information about the caching system */
|
|
1198
|
+
async listCache() {
|
|
1199
|
+
return this.client.get("/info/cache");
|
|
1200
|
+
}
|
|
1201
|
+
/** Get information about the multi-tenancy system */
|
|
1202
|
+
async listMultiTenancy() {
|
|
1203
|
+
return this.client.get("/info/multi-tenancy");
|
|
1204
|
+
}
|
|
1205
|
+
/** Get information about tenant configuration management */
|
|
1206
|
+
async listTenantConfig() {
|
|
1207
|
+
return this.client.get("/info/tenant-config");
|
|
1208
|
+
}
|
|
1209
|
+
/** Get information about role-based access control */
|
|
1210
|
+
async listRbac() {
|
|
1211
|
+
return this.client.get("/info/rbac");
|
|
1212
|
+
}
|
|
1213
|
+
/** Get information about rate limiting */
|
|
1214
|
+
async listRateLimiting() {
|
|
1215
|
+
return this.client.get("/info/rate-limiting");
|
|
1216
|
+
}
|
|
1217
|
+
/** Get information about the queue system */
|
|
1218
|
+
async listQueues() {
|
|
1219
|
+
return this.client.get("/info/queues");
|
|
1220
|
+
}
|
|
1221
|
+
/** Get information about the events system */
|
|
1222
|
+
async listEvents() {
|
|
1223
|
+
return this.client.get("/info/events");
|
|
1224
|
+
}
|
|
1225
|
+
/** Get information about webhooks */
|
|
1226
|
+
async listWebhooks() {
|
|
1227
|
+
return this.client.get("/info/webhooks");
|
|
1228
|
+
}
|
|
1229
|
+
/** Get information about file storage */
|
|
1230
|
+
async listFileStorage() {
|
|
1231
|
+
return this.client.get("/info/file-storage");
|
|
1232
|
+
}
|
|
1233
|
+
/** Get information about multi-factor authentication */
|
|
1234
|
+
async listMfa() {
|
|
1235
|
+
return this.client.get("/info/mfa");
|
|
1236
|
+
}
|
|
1237
|
+
/** Get information about analytics */
|
|
1238
|
+
async listAnalytics() {
|
|
1239
|
+
return this.client.get("/info/analytics");
|
|
1240
|
+
}
|
|
1241
|
+
/** Get information about billing and subscriptions */
|
|
1242
|
+
async listBilling() {
|
|
1243
|
+
return this.client.get("/info/billing");
|
|
1244
|
+
}
|
|
1245
|
+
/** Get information about notifications */
|
|
1246
|
+
async listNotifications() {
|
|
1247
|
+
return this.client.get("/info/notifications");
|
|
1248
|
+
}
|
|
1249
|
+
/** Get information about WebSocket and real-time features */
|
|
1250
|
+
async listWebsocket() {
|
|
1251
|
+
return this.client.get("/info/websocket");
|
|
1252
|
+
}
|
|
1253
|
+
/** Get information about the agent and AI system */
|
|
1254
|
+
async listAgent() {
|
|
1255
|
+
return this.client.get("/info/agent");
|
|
1256
|
+
}
|
|
1257
|
+
/** Get information about authentication */
|
|
1258
|
+
async listAuth() {
|
|
1259
|
+
return this.client.get("/info/auth");
|
|
1260
|
+
}
|
|
1261
|
+
/** Get information about encryption and security */
|
|
1262
|
+
async listEncryption() {
|
|
1263
|
+
return this.client.get("/info/encryption");
|
|
1264
|
+
}
|
|
1265
|
+
/** Get information about database migrations */
|
|
1266
|
+
async listMigrations() {
|
|
1267
|
+
return this.client.get("/info/migrations");
|
|
1268
|
+
}
|
|
1269
|
+
/** Get information about route aliasing */
|
|
1270
|
+
async listRouteAliasing() {
|
|
1271
|
+
return this.client.get("/info/route-aliasing");
|
|
1272
|
+
}
|
|
1273
|
+
/** Get information about the publishing system */
|
|
1274
|
+
async listPublishing() {
|
|
1275
|
+
return this.client.get("/info/publishing");
|
|
1276
|
+
}
|
|
1277
|
+
/** Get information about deployment tracking */
|
|
1278
|
+
async listDeployment() {
|
|
1279
|
+
return this.client.get("/info/deployment");
|
|
1280
|
+
}
|
|
1281
|
+
/** Get information about OpenAPI documentation */
|
|
1282
|
+
async listOpenapi() {
|
|
1283
|
+
return this.client.get("/info/openapi");
|
|
1284
|
+
}
|
|
1285
|
+
/** Get information about gRPC support */
|
|
1286
|
+
async listGrpc() {
|
|
1287
|
+
return this.client.get("/info/grpc");
|
|
1288
|
+
}
|
|
1289
|
+
/** Get information about microservices architecture */
|
|
1290
|
+
async listMicroservices() {
|
|
1291
|
+
return this.client.get("/info/microservices");
|
|
1292
|
+
}
|
|
1293
|
+
/** Get information about domain management */
|
|
1294
|
+
async listDomains() {
|
|
1295
|
+
return this.client.get("/info/domains");
|
|
1296
|
+
}
|
|
1297
|
+
/** Get information about LLM streaming */
|
|
1298
|
+
async listLlmStreaming() {
|
|
1299
|
+
return this.client.get("/info/llm-streaming");
|
|
1300
|
+
}
|
|
1301
|
+
/** Get information about user usage tracking */
|
|
1302
|
+
async listUserUsage() {
|
|
1303
|
+
return this.client.get("/info/user-usage");
|
|
1304
|
+
}
|
|
1305
|
+
};
|
|
1306
|
+
|
|
1307
|
+
// src/generated/teams.ts
|
|
1308
|
+
var TeamsResource = class {
|
|
1309
|
+
constructor(client) {
|
|
1310
|
+
this.client = client;
|
|
1311
|
+
}
|
|
1312
|
+
/** Get all teams */
|
|
1313
|
+
async list() {
|
|
1314
|
+
return this.client.get("/teams");
|
|
1315
|
+
}
|
|
1316
|
+
/** Create a new team */
|
|
1317
|
+
async create(data) {
|
|
1318
|
+
return this.client.post("/teams", data);
|
|
1319
|
+
}
|
|
1320
|
+
/** Get team by ID */
|
|
1321
|
+
async get(id) {
|
|
1322
|
+
return this.client.get(`/teams/${id}`);
|
|
1323
|
+
}
|
|
1324
|
+
/** Update team metadata (name, description, members) */
|
|
1325
|
+
async update(id, data) {
|
|
1326
|
+
return this.client.put(`/teams/${id}`, data);
|
|
1327
|
+
}
|
|
1328
|
+
/** Delete team */
|
|
1329
|
+
async delete(id) {
|
|
1330
|
+
return this.client.delete(`/teams/${id}`);
|
|
1331
|
+
}
|
|
1332
|
+
/** Get all projects for a team */
|
|
1333
|
+
async projects(id) {
|
|
1334
|
+
return this.client.get(`/teams/${id}/projects`);
|
|
1335
|
+
}
|
|
1336
|
+
};
|
|
1337
|
+
|
|
1338
|
+
// src/generated/tenant-integrations.ts
|
|
1339
|
+
var TenantIntegrationsResource = class {
|
|
1340
|
+
constructor(client) {
|
|
1341
|
+
this.client = client;
|
|
1342
|
+
}
|
|
1343
|
+
/** List integrations */
|
|
1344
|
+
async list() {
|
|
1345
|
+
return this.client.get("/tenant/integrations");
|
|
1346
|
+
}
|
|
1347
|
+
/** Create or update integration */
|
|
1348
|
+
async create(data) {
|
|
1349
|
+
return this.client.post("/tenant/integrations", data);
|
|
1350
|
+
}
|
|
1351
|
+
/** Get integration */
|
|
1352
|
+
async get(integrationId) {
|
|
1353
|
+
return this.client.get(`/tenant/integrations/${integrationId}`);
|
|
1354
|
+
}
|
|
1355
|
+
/** Delete integration */
|
|
1356
|
+
async delete(integrationId) {
|
|
1357
|
+
return this.client.delete(`/tenant/integrations/${integrationId}`);
|
|
1358
|
+
}
|
|
1359
|
+
/** Clone from default */
|
|
1360
|
+
async createClone(integrationId, data) {
|
|
1361
|
+
return this.client.post(`/tenant/integrations/${integrationId}/clone`, data);
|
|
1362
|
+
}
|
|
1363
|
+
};
|
|
1364
|
+
|
|
1365
|
+
// src/generated/tenant-jobs.ts
|
|
1366
|
+
var TenantJobsResource = class {
|
|
1367
|
+
constructor(client) {
|
|
1368
|
+
this.client = client;
|
|
1369
|
+
}
|
|
1370
|
+
/** List job definitions */
|
|
1371
|
+
async list() {
|
|
1372
|
+
return this.client.get("/tenant/jobs/definitions");
|
|
1373
|
+
}
|
|
1374
|
+
/** Create or update job definition */
|
|
1375
|
+
async create(data) {
|
|
1376
|
+
return this.client.post("/tenant/jobs/definitions", data);
|
|
1377
|
+
}
|
|
1378
|
+
/** Get job definition */
|
|
1379
|
+
async get(jobDefId) {
|
|
1380
|
+
return this.client.get(`/tenant/jobs/definitions/${jobDefId}`);
|
|
1381
|
+
}
|
|
1382
|
+
/** Delete job definition */
|
|
1383
|
+
async delete(jobDefId) {
|
|
1384
|
+
return this.client.delete(`/tenant/jobs/definitions/${jobDefId}`);
|
|
1385
|
+
}
|
|
1386
|
+
/** Enqueue job from definition */
|
|
1387
|
+
async createEnqueue(data) {
|
|
1388
|
+
return this.client.post("/tenant/jobs/enqueue", data);
|
|
1389
|
+
}
|
|
1390
|
+
/** Get job execution history */
|
|
1391
|
+
async listHistory() {
|
|
1392
|
+
return this.client.get("/tenant/jobs/history");
|
|
1393
|
+
}
|
|
1394
|
+
};
|
|
1395
|
+
|
|
1396
|
+
// src/generated/tenant-limits.ts
|
|
1397
|
+
var TenantLimitsResource = class {
|
|
1398
|
+
constructor(client) {
|
|
1399
|
+
this.client = client;
|
|
1400
|
+
}
|
|
1401
|
+
/** Get user limits configuration */
|
|
1402
|
+
async list() {
|
|
1403
|
+
return this.client.get("/tenant/limits");
|
|
1404
|
+
}
|
|
1405
|
+
/** Update user limits configuration */
|
|
1406
|
+
async update(data) {
|
|
1407
|
+
return this.client.put("/tenant/limits", data);
|
|
1408
|
+
}
|
|
1409
|
+
/** Get usage statistics */
|
|
1410
|
+
async listUsage() {
|
|
1411
|
+
return this.client.get("/tenant/limits/usage");
|
|
1412
|
+
}
|
|
1413
|
+
/** Check if action is allowed */
|
|
1414
|
+
async create(data) {
|
|
1415
|
+
return this.client.post("/tenant/limits/check", data);
|
|
1416
|
+
}
|
|
1417
|
+
/** Get storage limits configuration */
|
|
1418
|
+
async listStorage() {
|
|
1419
|
+
return this.client.get("/tenant/limits/storage");
|
|
1420
|
+
}
|
|
1421
|
+
/** Update storage limits configuration */
|
|
1422
|
+
async updateStorage(data) {
|
|
1423
|
+
return this.client.put("/tenant/limits/storage", data);
|
|
1424
|
+
}
|
|
1425
|
+
/** Get storage usage statistics */
|
|
1426
|
+
async listGET2() {
|
|
1427
|
+
return this.client.get("/tenant/limits/storage/usage");
|
|
1428
|
+
}
|
|
1429
|
+
/** Check if file upload is allowed */
|
|
1430
|
+
async createCheck(data) {
|
|
1431
|
+
return this.client.post("/tenant/limits/storage/check", data);
|
|
1432
|
+
}
|
|
1433
|
+
/** Get storage usage by user */
|
|
1434
|
+
async listByUser() {
|
|
1435
|
+
return this.client.get("/tenant/limits/storage/by-user");
|
|
1436
|
+
}
|
|
1437
|
+
/** Get resource limits configuration */
|
|
1438
|
+
async listResources() {
|
|
1439
|
+
return this.client.get("/tenant/limits/resources");
|
|
1440
|
+
}
|
|
1441
|
+
/** Update resource limits configuration */
|
|
1442
|
+
async updateResources(data) {
|
|
1443
|
+
return this.client.put("/tenant/limits/resources", data);
|
|
1444
|
+
}
|
|
1445
|
+
/** Get available resource types */
|
|
1446
|
+
async listDefinitions() {
|
|
1447
|
+
return this.client.get("/tenant/limits/resources/definitions");
|
|
1448
|
+
}
|
|
1449
|
+
/** Get resource usage statistics */
|
|
1450
|
+
async listGET3() {
|
|
1451
|
+
return this.client.get("/tenant/limits/resources/usage");
|
|
1452
|
+
}
|
|
1453
|
+
/** Check if resource action is allowed */
|
|
1454
|
+
async createPOST2(data) {
|
|
1455
|
+
return this.client.post("/tenant/limits/resources/check", data);
|
|
1456
|
+
}
|
|
1457
|
+
/** Track resource usage */
|
|
1458
|
+
async createTrack(data) {
|
|
1459
|
+
return this.client.post("/tenant/limits/resources/track", data);
|
|
1460
|
+
}
|
|
1461
|
+
/** Get limit for specific collection */
|
|
1462
|
+
async get(collection) {
|
|
1463
|
+
return this.client.get(`/tenant/limits/${collection}`);
|
|
1464
|
+
}
|
|
1465
|
+
/** Set limit for specific collection */
|
|
1466
|
+
async updateLimits(collection, data) {
|
|
1467
|
+
return this.client.put(`/tenant/limits/${collection}`, data);
|
|
1468
|
+
}
|
|
1469
|
+
/** Remove limit for specific collection */
|
|
1470
|
+
async delete(collection) {
|
|
1471
|
+
return this.client.delete(`/tenant/limits/${collection}`);
|
|
1472
|
+
}
|
|
1473
|
+
};
|
|
1474
|
+
|
|
1475
|
+
// src/generated/tenant-rbac.ts
|
|
1476
|
+
var TenantRbacResource = class {
|
|
1477
|
+
constructor(client) {
|
|
1478
|
+
this.client = client;
|
|
1479
|
+
}
|
|
1480
|
+
/** Get RBAC configuration */
|
|
1481
|
+
async list() {
|
|
1482
|
+
return this.client.get("/tenant/rbac");
|
|
1483
|
+
}
|
|
1484
|
+
/** Update RBAC configuration */
|
|
1485
|
+
async update(data) {
|
|
1486
|
+
return this.client.put("/tenant/rbac", data);
|
|
1487
|
+
}
|
|
1488
|
+
/** List all roles */
|
|
1489
|
+
async listRoles() {
|
|
1490
|
+
return this.client.get("/tenant/rbac/roles");
|
|
1491
|
+
}
|
|
1492
|
+
/** Create a new role */
|
|
1493
|
+
async create(data) {
|
|
1494
|
+
return this.client.post("/tenant/rbac/roles", data);
|
|
1495
|
+
}
|
|
1496
|
+
/** Update a role */
|
|
1497
|
+
async updateRoles(name, data) {
|
|
1498
|
+
return this.client.put(`/tenant/rbac/roles/${name}`, data);
|
|
1499
|
+
}
|
|
1500
|
+
/** Delete a role */
|
|
1501
|
+
async delete(name) {
|
|
1502
|
+
return this.client.delete(`/tenant/rbac/roles/${name}`);
|
|
1503
|
+
}
|
|
1504
|
+
};
|
|
1505
|
+
|
|
1506
|
+
// src/generated/tenant-webhook-receivers.ts
|
|
1507
|
+
var TenantWebhookReceiversResource = class {
|
|
1508
|
+
constructor(client) {
|
|
1509
|
+
this.client = client;
|
|
1510
|
+
}
|
|
1511
|
+
/** List webhook receivers */
|
|
1512
|
+
async list() {
|
|
1513
|
+
return this.client.get("/tenant/webhook-receivers");
|
|
1514
|
+
}
|
|
1515
|
+
/** Create webhook receiver */
|
|
1516
|
+
async create(data) {
|
|
1517
|
+
return this.client.post("/tenant/webhook-receivers", data);
|
|
1518
|
+
}
|
|
1519
|
+
/** Get webhook receiver */
|
|
1520
|
+
async get(id) {
|
|
1521
|
+
return this.client.get(`/tenant/webhook-receivers/${id}`);
|
|
1522
|
+
}
|
|
1523
|
+
/** Update webhook receiver */
|
|
1524
|
+
async update(id, data) {
|
|
1525
|
+
return this.client.put(`/tenant/webhook-receivers/${id}`, data);
|
|
1526
|
+
}
|
|
1527
|
+
/** Delete webhook receiver */
|
|
1528
|
+
async delete(id) {
|
|
1529
|
+
return this.client.delete(`/tenant/webhook-receivers/${id}`);
|
|
1530
|
+
}
|
|
1531
|
+
};
|
|
1532
|
+
|
|
1533
|
+
// src/generated/tenant-webhooks.ts
|
|
1534
|
+
var TenantWebhooksResource = class {
|
|
1535
|
+
constructor(client) {
|
|
1536
|
+
this.client = client;
|
|
1537
|
+
}
|
|
1538
|
+
/** List webhooks */
|
|
1539
|
+
async list() {
|
|
1540
|
+
return this.client.get("/tenant/webhooks");
|
|
1541
|
+
}
|
|
1542
|
+
/** Create webhook */
|
|
1543
|
+
async create(data) {
|
|
1544
|
+
return this.client.post("/tenant/webhooks", data);
|
|
1545
|
+
}
|
|
1546
|
+
/** Get webhook */
|
|
1547
|
+
async get(id) {
|
|
1548
|
+
return this.client.get(`/tenant/webhooks/${id}`);
|
|
1549
|
+
}
|
|
1550
|
+
/** Update webhook */
|
|
1551
|
+
async update(id, data) {
|
|
1552
|
+
return this.client.put(`/tenant/webhooks/${id}`, data);
|
|
1553
|
+
}
|
|
1554
|
+
/** Delete webhook */
|
|
1555
|
+
async delete(id) {
|
|
1556
|
+
return this.client.delete(`/tenant/webhooks/${id}`);
|
|
1557
|
+
}
|
|
1558
|
+
};
|
|
1559
|
+
|
|
1560
|
+
// src/generated/tenant-workflows.ts
|
|
1561
|
+
var TenantWorkflowsResource = class {
|
|
1562
|
+
constructor(client) {
|
|
1563
|
+
this.client = client;
|
|
1564
|
+
}
|
|
1565
|
+
/** List workflows */
|
|
1566
|
+
async list() {
|
|
1567
|
+
return this.client.get("/tenant/workflows");
|
|
1568
|
+
}
|
|
1569
|
+
/** Create or update workflow */
|
|
1570
|
+
async create(data) {
|
|
1571
|
+
return this.client.post("/tenant/workflows", data);
|
|
1572
|
+
}
|
|
1573
|
+
/** Get workflow */
|
|
1574
|
+
async get(workflowId) {
|
|
1575
|
+
return this.client.get(`/tenant/workflows/${workflowId}`);
|
|
1576
|
+
}
|
|
1577
|
+
/** Delete workflow */
|
|
1578
|
+
async delete(workflowId) {
|
|
1579
|
+
return this.client.delete(`/tenant/workflows/${workflowId}`);
|
|
1580
|
+
}
|
|
1581
|
+
/** Clone from default */
|
|
1582
|
+
async createClone(workflowId, data) {
|
|
1583
|
+
return this.client.post(`/tenant/workflows/${workflowId}/clone`, data);
|
|
1584
|
+
}
|
|
1585
|
+
};
|
|
1586
|
+
|
|
1587
|
+
// src/generated/tooldiscovery.ts
|
|
1588
|
+
var ToolDiscoveryResource = class {
|
|
1589
|
+
constructor(client) {
|
|
1590
|
+
this.client = client;
|
|
1591
|
+
}
|
|
1592
|
+
/** Get all registered tools including MCP, user-configured, and built-in tools */
|
|
1593
|
+
async list() {
|
|
1594
|
+
return this.client.get("/agent/tools");
|
|
1595
|
+
}
|
|
1596
|
+
/** Search for tools using text query, category, tags, capabilities, and performance filters */
|
|
1597
|
+
async create(data) {
|
|
1598
|
+
return this.client.post("/agent/tools/search", data);
|
|
1599
|
+
}
|
|
1600
|
+
/** Search for tools using natural language semantic similarity */
|
|
1601
|
+
async createSemanticSearch(data) {
|
|
1602
|
+
return this.client.post("/agent/tools/semantic-search", data);
|
|
1603
|
+
}
|
|
1604
|
+
/** Use AI to automatically select appropriate tools based on a natural language goal */
|
|
1605
|
+
async createSelect(data) {
|
|
1606
|
+
return this.client.post("/agent/tools/select", data);
|
|
1607
|
+
}
|
|
1608
|
+
/** Get tool recommendations based on goal and historical performance data */
|
|
1609
|
+
async createRecommend(data) {
|
|
1610
|
+
return this.client.post("/agent/tools/recommend", data);
|
|
1611
|
+
}
|
|
1612
|
+
/** Get performance metrics (success rate, latency, usage) for a specific tool */
|
|
1613
|
+
async metrics(toolName) {
|
|
1614
|
+
return this.client.get(`/agent/tools/${toolName}/metrics`);
|
|
1615
|
+
}
|
|
1616
|
+
/** Index all registered tools for semantic search using embeddings */
|
|
1617
|
+
async createIndex(data) {
|
|
1618
|
+
return this.client.post("/agent/tools/index", data);
|
|
1619
|
+
}
|
|
1620
|
+
};
|
|
1621
|
+
|
|
1622
|
+
// src/generated/tracking.ts
|
|
1623
|
+
var TrackingResource = class {
|
|
1624
|
+
constructor(client) {
|
|
1625
|
+
this.client = client;
|
|
1626
|
+
}
|
|
1627
|
+
/** Get MCP call statistics for the tenant */
|
|
1628
|
+
async list() {
|
|
1629
|
+
return this.client.get("/tracking/mcp/stats");
|
|
1630
|
+
}
|
|
1631
|
+
/** Get field-level change history for an entity */
|
|
1632
|
+
async history(entityType, entityId) {
|
|
1633
|
+
return this.client.get(`/tracking/entity/${entityType}/${entityId}/history`);
|
|
1634
|
+
}
|
|
1635
|
+
/** Get change history for a specific field */
|
|
1636
|
+
async getField(entityType, entityId, fieldName) {
|
|
1637
|
+
return this.client.get(`/tracking/entity/${entityType}/${entityId}/field/${fieldName}`);
|
|
1638
|
+
}
|
|
1639
|
+
/** Get tracking buffer status (AI usage buffer size) */
|
|
1640
|
+
async listStatus() {
|
|
1641
|
+
return this.client.get("/tracking/buffer/status");
|
|
1642
|
+
}
|
|
1643
|
+
/** Manually flush tracking buffers to database */
|
|
1644
|
+
async create(data) {
|
|
1645
|
+
return this.client.post("/tracking/buffer/flush", data);
|
|
1646
|
+
}
|
|
1647
|
+
};
|
|
1648
|
+
|
|
1649
|
+
// src/generated/twitter.ts
|
|
1650
|
+
var TwitterResource = class {
|
|
1651
|
+
constructor(client) {
|
|
1652
|
+
this.client = client;
|
|
1653
|
+
}
|
|
1654
|
+
/** Search X (Twitter) tweets by query */
|
|
1655
|
+
async list() {
|
|
1656
|
+
return this.client.get("/api/twitter/search");
|
|
1657
|
+
}
|
|
1658
|
+
/** Get details of a specific tweet */
|
|
1659
|
+
async get(tweetId) {
|
|
1660
|
+
return this.client.get(`/api/twitter/tweets/${tweetId}`);
|
|
1661
|
+
}
|
|
1662
|
+
/** Delete a tweet */
|
|
1663
|
+
async delete(tweetId) {
|
|
1664
|
+
return this.client.delete(`/api/twitter/tweets/${tweetId}`);
|
|
1665
|
+
}
|
|
1666
|
+
/** Post a new tweet */
|
|
1667
|
+
async create(data) {
|
|
1668
|
+
return this.client.post("/api/twitter/tweets", data);
|
|
1669
|
+
}
|
|
1670
|
+
/** Like a tweet */
|
|
1671
|
+
async createLike(userId, data) {
|
|
1672
|
+
return this.client.post(`/api/twitter/users/${userId}/likes`, data);
|
|
1673
|
+
}
|
|
1674
|
+
/** Unlike a tweet */
|
|
1675
|
+
async deleteLike(userId, tweetId) {
|
|
1676
|
+
return this.client.delete(`/api/twitter/users/${userId}/likes/${tweetId}`);
|
|
1677
|
+
}
|
|
1678
|
+
/** Retweet a tweet */
|
|
1679
|
+
async createRetweet(userId, data) {
|
|
1680
|
+
return this.client.post(`/api/twitter/users/${userId}/retweets`, data);
|
|
1681
|
+
}
|
|
1682
|
+
/** Remove a retweet */
|
|
1683
|
+
async deleteRetweet(userId, tweetId) {
|
|
1684
|
+
return this.client.delete(`/api/twitter/users/${userId}/retweets/${tweetId}`);
|
|
1685
|
+
}
|
|
1686
|
+
/** Get user information by username */
|
|
1687
|
+
async getUsername(username) {
|
|
1688
|
+
return this.client.get(`/api/twitter/users/by/username/${username}`);
|
|
1689
|
+
}
|
|
1690
|
+
/** Get user information by user ID */
|
|
1691
|
+
async getUsers(userId) {
|
|
1692
|
+
return this.client.get(`/api/twitter/users/${userId}`);
|
|
1693
|
+
}
|
|
1694
|
+
/** Get authenticated user information */
|
|
1695
|
+
async listMe() {
|
|
1696
|
+
return this.client.get("/api/twitter/user/me");
|
|
1697
|
+
}
|
|
1698
|
+
/** Get recent tweets from a user */
|
|
1699
|
+
async tweets(userId) {
|
|
1700
|
+
return this.client.get(`/api/twitter/users/${userId}/tweets`);
|
|
1701
|
+
}
|
|
1702
|
+
/** Follow a user */
|
|
1703
|
+
async createFollowing(userId, data) {
|
|
1704
|
+
return this.client.post(`/api/twitter/users/${userId}/following`, data);
|
|
1705
|
+
}
|
|
1706
|
+
/** Unfollow a user */
|
|
1707
|
+
async deleteFollowing(userId, targetUserId) {
|
|
1708
|
+
return this.client.delete(`/api/twitter/users/${userId}/following/${targetUserId}`);
|
|
1709
|
+
}
|
|
1710
|
+
/** Get followers of a user */
|
|
1711
|
+
async followers(userId) {
|
|
1712
|
+
return this.client.get(`/api/twitter/users/${userId}/followers`);
|
|
1713
|
+
}
|
|
1714
|
+
/** Get users that a user is following */
|
|
1715
|
+
async followingList(userId) {
|
|
1716
|
+
return this.client.get(`/api/twitter/users/${userId}/following_list`);
|
|
1717
|
+
}
|
|
1718
|
+
/** Get users who liked a tweet */
|
|
1719
|
+
async likedBy(tweetId) {
|
|
1720
|
+
return this.client.get(`/api/twitter/tweets/${tweetId}/liked_by`);
|
|
1721
|
+
}
|
|
1722
|
+
/** Get users who retweeted a tweet */
|
|
1723
|
+
async retweetedBy(tweetId) {
|
|
1724
|
+
return this.client.get(`/api/twitter/tweets/${tweetId}/retweeted_by`);
|
|
1725
|
+
}
|
|
1726
|
+
/** Get tweets in a conversation thread */
|
|
1727
|
+
async getConversations(conversationId) {
|
|
1728
|
+
return this.client.get(`/api/twitter/conversations/${conversationId}`);
|
|
1729
|
+
}
|
|
1730
|
+
/** Get tweets liked by a user */
|
|
1731
|
+
async likedTweets(userId) {
|
|
1732
|
+
return this.client.get(`/api/twitter/users/${userId}/liked_tweets`);
|
|
1733
|
+
}
|
|
1734
|
+
};
|
|
1735
|
+
|
|
1736
|
+
// src/generated/usage.ts
|
|
1737
|
+
var UsageResource = class {
|
|
1738
|
+
constructor(client) {
|
|
1739
|
+
this.client = client;
|
|
1740
|
+
}
|
|
1741
|
+
/** Get unified usage metrics for a user across AI, API, and integrations */
|
|
1742
|
+
async get(userId) {
|
|
1743
|
+
return this.client.get(`/usage/user/${userId}`);
|
|
1744
|
+
}
|
|
1745
|
+
/** Get a brief summary of user usage */
|
|
1746
|
+
async summary(userId) {
|
|
1747
|
+
return this.client.get(`/usage/user/${userId}/summary`);
|
|
1748
|
+
}
|
|
1749
|
+
/** Get usage metrics for the authenticated user */
|
|
1750
|
+
async list() {
|
|
1751
|
+
return this.client.get("/usage/me");
|
|
1752
|
+
}
|
|
1753
|
+
};
|
|
1754
|
+
|
|
1755
|
+
// src/generated/users.ts
|
|
1756
|
+
var UsersResource = class {
|
|
1757
|
+
constructor(client) {
|
|
1758
|
+
this.client = client;
|
|
1759
|
+
}
|
|
1760
|
+
/** Get all users */
|
|
1761
|
+
async list() {
|
|
1762
|
+
return this.client.get("/users");
|
|
1763
|
+
}
|
|
1764
|
+
/** Get user by ID */
|
|
1765
|
+
async get(id) {
|
|
1766
|
+
return this.client.get(`/users/${id}`);
|
|
1767
|
+
}
|
|
1768
|
+
/** Create a new user */
|
|
1769
|
+
async create(data) {
|
|
1770
|
+
return this.client.post("/users", data);
|
|
1771
|
+
}
|
|
1772
|
+
/** Update user */
|
|
1773
|
+
async update(id, data) {
|
|
1774
|
+
return this.client.put(`/users/${id}`, data);
|
|
1775
|
+
}
|
|
1776
|
+
/** Delete user */
|
|
1777
|
+
async delete(id) {
|
|
1778
|
+
return this.client.delete(`/users/${id}`);
|
|
1779
|
+
}
|
|
1780
|
+
};
|
|
1781
|
+
|
|
1782
|
+
// src/generated/websocket.ts
|
|
1783
|
+
var WebsocketResource = class {
|
|
1784
|
+
constructor(client) {
|
|
1785
|
+
this.client = client;
|
|
1786
|
+
}
|
|
1787
|
+
/** WebSocket API Documentation */
|
|
1788
|
+
async list() {
|
|
1789
|
+
return this.client.get("/websocket/info");
|
|
1790
|
+
}
|
|
1791
|
+
};
|
|
1792
|
+
|
|
1793
|
+
// src/generated/workflows.ts
|
|
1794
|
+
var WorkflowsResource = class {
|
|
1795
|
+
constructor(client) {
|
|
1796
|
+
this.client = client;
|
|
1797
|
+
}
|
|
1798
|
+
/** Orchestrate a task by ID. Executes predefined task orchestration logic. */
|
|
1799
|
+
async create(data) {
|
|
1800
|
+
return this.client.post("/agent/orchestrate", data);
|
|
1801
|
+
}
|
|
1802
|
+
/** Execute an agentic workflow with tools and steps. Workflows define a series of actions that can call LLMs, APIs, shell commands, and MCP tools. */
|
|
1803
|
+
async createWorkflow(data) {
|
|
1804
|
+
return this.client.post("/agent/workflow", data);
|
|
1805
|
+
}
|
|
1806
|
+
/** List all workflow executions with date range filter and pagination. */
|
|
1807
|
+
async list() {
|
|
1808
|
+
return this.client.get("/agent/workflows/executions");
|
|
1809
|
+
}
|
|
1810
|
+
/** Delete all workflow executions and their activity records */
|
|
1811
|
+
async delete() {
|
|
1812
|
+
return this.client.delete("/agent/workflows/executions");
|
|
1813
|
+
}
|
|
1814
|
+
/** Delete a specific workflow execution and all its activity records */
|
|
1815
|
+
async deleteExecutions(workflowId) {
|
|
1816
|
+
return this.client.delete(`/agent/workflows/executions/${workflowId}`);
|
|
1817
|
+
}
|
|
1818
|
+
/** Get execution history for a workflow by ID. Returns all historical execution records. */
|
|
1819
|
+
async history(workflowId) {
|
|
1820
|
+
return this.client.get(`/agent/workflow/${workflowId}/history`);
|
|
1821
|
+
}
|
|
1822
|
+
/** Resume a paused workflow execution. Allows continuing or cancelling execution with optional user input. */
|
|
1823
|
+
async createResume(data) {
|
|
1824
|
+
return this.client.post("/agent/workflow/resume", data);
|
|
1825
|
+
}
|
|
1826
|
+
/** Request pause for a running workflow. The workflow will pause after the current step completes. */
|
|
1827
|
+
async pause(executionId, data) {
|
|
1828
|
+
return this.client.post(`/agent/workflow/${executionId}/pause`, data);
|
|
1829
|
+
}
|
|
1830
|
+
/** Cancel a running workflow. The workflow will stop after the current step completes. */
|
|
1831
|
+
async cancel(executionId, data) {
|
|
1832
|
+
return this.client.post(`/agent/workflow/${executionId}/cancel`, data);
|
|
1833
|
+
}
|
|
1834
|
+
/** Get background execution status for workflows that returned early */
|
|
1835
|
+
async status(executionId) {
|
|
1836
|
+
return this.client.get(`/agent/workflow/${executionId}/status`);
|
|
1837
|
+
}
|
|
1838
|
+
/** Retry a workflow execution. Can restart from beginning or resume from last checkpoint. */
|
|
1839
|
+
async retry(executionId, data) {
|
|
1840
|
+
return this.client.post(`/agent/workflow/${executionId}/retry`, data);
|
|
1841
|
+
}
|
|
1842
|
+
/** Health check endpoint with detailed component status. Returns status of embeddings, vector store, MCP servers, and database. */
|
|
1843
|
+
async listHealth() {
|
|
1844
|
+
return this.client.get("/agent/health");
|
|
1845
|
+
}
|
|
1846
|
+
/** Automatically generate and execute a workflow from a natural language goal using AI */
|
|
1847
|
+
async createDynamic(data) {
|
|
1848
|
+
return this.client.post("/agent/workflow/dynamic", data);
|
|
1849
|
+
}
|
|
1850
|
+
};
|
|
1851
|
+
|
|
1852
|
+
// src/generated/workspaces.ts
|
|
1853
|
+
var WorkspacesResource = class {
|
|
1854
|
+
constructor(client) {
|
|
1855
|
+
this.client = client;
|
|
1856
|
+
}
|
|
1857
|
+
/** Get all workspaces */
|
|
1858
|
+
async list() {
|
|
1859
|
+
return this.client.get("/workspaces");
|
|
1860
|
+
}
|
|
1861
|
+
/** Create a new workspace */
|
|
1862
|
+
async create(data) {
|
|
1863
|
+
return this.client.post("/workspaces", data);
|
|
1864
|
+
}
|
|
1865
|
+
/** Get workspace by ID */
|
|
1866
|
+
async get(id) {
|
|
1867
|
+
return this.client.get(`/workspaces/${id}`);
|
|
1868
|
+
}
|
|
1869
|
+
/** Update workspace */
|
|
1870
|
+
async update(id, data) {
|
|
1871
|
+
return this.client.put(`/workspaces/${id}`, data);
|
|
1872
|
+
}
|
|
1873
|
+
/** Delete workspace */
|
|
1874
|
+
async delete(id) {
|
|
1875
|
+
return this.client.delete(`/workspaces/${id}`);
|
|
1876
|
+
}
|
|
1877
|
+
};
|
|
1878
|
+
|
|
1879
|
+
// src/resources/ai.ts
|
|
1880
|
+
var AIResource = class {
|
|
1881
|
+
constructor(client) {
|
|
1882
|
+
this.client = client;
|
|
1883
|
+
}
|
|
1884
|
+
async chat(options) {
|
|
1885
|
+
return this.client.post("/ai/chat", options);
|
|
1886
|
+
}
|
|
1887
|
+
};
|
|
1888
|
+
|
|
1889
|
+
// src/resources/collaboration.ts
|
|
1890
|
+
var CollaborationResource = class {
|
|
1891
|
+
constructor(client) {
|
|
1892
|
+
this.client = client;
|
|
1893
|
+
}
|
|
1894
|
+
async presence(data) {
|
|
1895
|
+
return this.client.post("/collaboration/presence", data);
|
|
1896
|
+
}
|
|
1897
|
+
};
|
|
1898
|
+
|
|
1899
|
+
// src/resources/webhooks.ts
|
|
1900
|
+
var WebhooksResource = class {
|
|
1901
|
+
constructor(client, projectId) {
|
|
1902
|
+
this.client = client;
|
|
1903
|
+
this.projectId = projectId;
|
|
1904
|
+
}
|
|
1905
|
+
async trigger(data) {
|
|
1906
|
+
return this.client.post(`/webhooks/${this.projectId}/trigger`, data);
|
|
1907
|
+
}
|
|
1908
|
+
};
|
|
1909
|
+
var WebhooksFactory = class {
|
|
1910
|
+
constructor(client) {
|
|
1911
|
+
this.client = client;
|
|
1912
|
+
}
|
|
1913
|
+
for(projectId) {
|
|
1914
|
+
return new WebhooksResource(this.client, projectId);
|
|
1915
|
+
}
|
|
1916
|
+
};
|
|
1917
|
+
|
|
1918
|
+
// src/resources/exports.ts
|
|
1919
|
+
var ExportsResource = class {
|
|
1920
|
+
constructor(client) {
|
|
1921
|
+
this.client = client;
|
|
1922
|
+
}
|
|
1923
|
+
async highRes(options) {
|
|
1924
|
+
const contentType = options.contentType || (options.format === "svg" ? "image/svg+xml" : options.format === "pdf" ? "application/pdf" : "image/png");
|
|
1925
|
+
return this.client.post("/exports/high-res", {
|
|
1926
|
+
...options,
|
|
1927
|
+
contentType
|
|
1928
|
+
});
|
|
1929
|
+
}
|
|
1930
|
+
};
|
|
1931
|
+
|
|
1932
|
+
// src/resources/user.ts
|
|
1933
|
+
var UserResource = class {
|
|
1934
|
+
constructor(client) {
|
|
1935
|
+
this.client = client;
|
|
1936
|
+
}
|
|
1937
|
+
async createMetrics(metrics) {
|
|
1938
|
+
return this.client.post("/user/metrics", metrics);
|
|
1939
|
+
}
|
|
1940
|
+
async getMetrics() {
|
|
1941
|
+
return this.client.get("/user/metrics");
|
|
1942
|
+
}
|
|
1943
|
+
async updateMetrics(metrics) {
|
|
1944
|
+
return this.client.put("/user/metrics", metrics);
|
|
1945
|
+
}
|
|
1946
|
+
async getProfile() {
|
|
1947
|
+
return this.client.get("/admin/users/me");
|
|
1948
|
+
}
|
|
1949
|
+
async updateProfile(options) {
|
|
1950
|
+
return this.client.put("/admin/users/me/profile", options);
|
|
1951
|
+
}
|
|
1952
|
+
};
|
|
1953
|
+
|
|
1954
|
+
// src/resources/entities.ts
|
|
1955
|
+
var EntitiesResource = class {
|
|
1956
|
+
constructor(client) {
|
|
1957
|
+
this.client = client;
|
|
1958
|
+
}
|
|
1959
|
+
async listCollections() {
|
|
1960
|
+
const response = await this.client.get("/admin/entities");
|
|
1961
|
+
return response.data || [];
|
|
1962
|
+
}
|
|
1963
|
+
async list(collection, options) {
|
|
1964
|
+
const params = new URLSearchParams();
|
|
1965
|
+
if (options?.limit) params.set("limit", String(options.limit));
|
|
1966
|
+
if (options?.offset) params.set("offset", String(options.offset));
|
|
1967
|
+
if (options?.includeDeleted) params.set("includeDeleted", "true");
|
|
1968
|
+
const query = params.toString();
|
|
1969
|
+
const url = `/admin/entities/${encodeURIComponent(collection)}${query ? `?${query}` : ""}`;
|
|
1970
|
+
return this.client.get(url);
|
|
1971
|
+
}
|
|
1972
|
+
async get(collection, id, options) {
|
|
1973
|
+
const params = new URLSearchParams();
|
|
1974
|
+
if (options?.includeDeleted) params.set("includeDeleted", "true");
|
|
1975
|
+
const query = params.toString();
|
|
1976
|
+
const response = await this.client.get(
|
|
1977
|
+
`/admin/entities/${encodeURIComponent(collection)}/${encodeURIComponent(id)}${query ? `?${query}` : ""}`
|
|
1978
|
+
);
|
|
1979
|
+
return response.data;
|
|
1980
|
+
}
|
|
1981
|
+
async create(collection, data) {
|
|
1982
|
+
const response = await this.client.post(
|
|
1983
|
+
`/admin/entities/${encodeURIComponent(collection)}`,
|
|
1984
|
+
data
|
|
1985
|
+
);
|
|
1986
|
+
return response.data;
|
|
1987
|
+
}
|
|
1988
|
+
async update(collection, id, data) {
|
|
1989
|
+
const response = await this.client.put(
|
|
1990
|
+
`/admin/entities/${encodeURIComponent(collection)}/${encodeURIComponent(id)}`,
|
|
1991
|
+
data
|
|
1992
|
+
);
|
|
1993
|
+
return response.data;
|
|
1994
|
+
}
|
|
1995
|
+
async delete(collection, id, options) {
|
|
1996
|
+
const params = new URLSearchParams();
|
|
1997
|
+
if (options?.hard) params.set("hard", "true");
|
|
1998
|
+
if (options?.softDelete === false) params.set("softDelete", "false");
|
|
1999
|
+
const query = params.toString();
|
|
2000
|
+
const url = `/admin/entities/${encodeURIComponent(collection)}/${encodeURIComponent(id)}${query ? `?${query}` : ""}`;
|
|
2001
|
+
return this.client.delete(url);
|
|
2002
|
+
}
|
|
2003
|
+
async restore(collection, id) {
|
|
2004
|
+
return this.client.post(
|
|
2005
|
+
`/admin/entities/${encodeURIComponent(collection)}/${encodeURIComponent(id)}/restore`,
|
|
2006
|
+
{}
|
|
2007
|
+
);
|
|
2008
|
+
}
|
|
2009
|
+
async getSchema() {
|
|
2010
|
+
const response = await this.client.get("/admin/schema");
|
|
2011
|
+
return response.data || [];
|
|
2012
|
+
}
|
|
2013
|
+
/**
|
|
2014
|
+
* Get schema for a specific collection
|
|
2015
|
+
*/
|
|
2016
|
+
async getCollectionSchema(collection) {
|
|
2017
|
+
const schemas = await this.getSchema();
|
|
2018
|
+
return schemas.find((s) => s.collection === collection) || null;
|
|
2019
|
+
}
|
|
2020
|
+
/**
|
|
2021
|
+
* Validate data against a collection's schema (client-side)
|
|
2022
|
+
*/
|
|
2023
|
+
async validate(collection, data) {
|
|
2024
|
+
const schema = await this.getCollectionSchema(collection);
|
|
2025
|
+
if (!schema) {
|
|
2026
|
+
return { valid: true };
|
|
2027
|
+
}
|
|
2028
|
+
const errors = [];
|
|
2029
|
+
for (const field of schema.fields) {
|
|
2030
|
+
if (field.source === "builtin") continue;
|
|
2031
|
+
const value = data[field.name];
|
|
2032
|
+
const hasValue = value !== void 0 && value !== null && value !== "";
|
|
2033
|
+
if (field.required && !hasValue) {
|
|
2034
|
+
errors.push({ field: field.name, message: `${field.name} is required` });
|
|
2035
|
+
continue;
|
|
2036
|
+
}
|
|
2037
|
+
if (!hasValue) continue;
|
|
2038
|
+
if (field.type === "integer" || field.type === "bigint") {
|
|
2039
|
+
if (typeof value !== "number" || !Number.isInteger(value)) {
|
|
2040
|
+
errors.push({ field: field.name, message: `${field.name} must be an integer` });
|
|
2041
|
+
continue;
|
|
2042
|
+
}
|
|
2043
|
+
}
|
|
2044
|
+
if (field.type === "decimal") {
|
|
2045
|
+
if (typeof value !== "number") {
|
|
2046
|
+
errors.push({ field: field.name, message: `${field.name} must be a number` });
|
|
2047
|
+
continue;
|
|
2048
|
+
}
|
|
2049
|
+
}
|
|
2050
|
+
if (field.type === "boolean") {
|
|
2051
|
+
if (typeof value !== "boolean") {
|
|
2052
|
+
errors.push({ field: field.name, message: `${field.name} must be a boolean` });
|
|
2053
|
+
continue;
|
|
2054
|
+
}
|
|
2055
|
+
}
|
|
2056
|
+
if (typeof value === "number") {
|
|
2057
|
+
if (field.min !== void 0 && value < field.min) {
|
|
2058
|
+
errors.push({ field: field.name, message: `${field.name} must be at least ${field.min}` });
|
|
2059
|
+
}
|
|
2060
|
+
if (field.max !== void 0 && value > field.max) {
|
|
2061
|
+
errors.push({ field: field.name, message: `${field.name} must be at most ${field.max}` });
|
|
2062
|
+
}
|
|
2063
|
+
}
|
|
2064
|
+
if (typeof value === "string") {
|
|
2065
|
+
if (field.min !== void 0 && value.length < field.min) {
|
|
2066
|
+
errors.push({ field: field.name, message: `${field.name} must be at least ${field.min} characters` });
|
|
2067
|
+
}
|
|
2068
|
+
if (field.max !== void 0 && value.length > field.max) {
|
|
2069
|
+
errors.push({ field: field.name, message: `${field.name} must be at most ${field.max} characters` });
|
|
2070
|
+
}
|
|
2071
|
+
}
|
|
2072
|
+
if (field.enum && field.enum.length > 0) {
|
|
2073
|
+
if (!field.enum.includes(String(value))) {
|
|
2074
|
+
errors.push({ field: field.name, message: `${field.name} must be one of: ${field.enum.join(", ")}` });
|
|
2075
|
+
}
|
|
2076
|
+
}
|
|
2077
|
+
if (field.pattern && typeof value === "string") {
|
|
2078
|
+
const regex = new RegExp(field.pattern);
|
|
2079
|
+
if (!regex.test(value)) {
|
|
2080
|
+
errors.push({ field: field.name, message: `${field.name} has invalid format` });
|
|
2081
|
+
}
|
|
2082
|
+
}
|
|
2083
|
+
if (field.preset && typeof value === "string") {
|
|
2084
|
+
const presetError = this.validatePreset(field.preset, value, field.name);
|
|
2085
|
+
if (presetError) {
|
|
2086
|
+
errors.push(presetError);
|
|
2087
|
+
}
|
|
2088
|
+
}
|
|
2089
|
+
}
|
|
2090
|
+
return errors.length > 0 ? { valid: false, errors } : { valid: true };
|
|
2091
|
+
}
|
|
2092
|
+
validatePreset(preset, value, fieldName) {
|
|
2093
|
+
const patterns = {
|
|
2094
|
+
email: { regex: /^[^\s@]+@[^\s@]+\.[^\s@]+$/, message: "must be a valid email" },
|
|
2095
|
+
url: { regex: /^https?:\/\/[^\s/$.?#].[^\s]*$/i, message: "must be a valid URL" },
|
|
2096
|
+
"phone-us": { regex: /^\+?1?[-.\s]?\(?\d{3}\)?[-.\s]?\d{3}[-.\s]?\d{4}$/, message: "must be a valid US phone" },
|
|
2097
|
+
"phone-intl": { regex: /^\+?[\d\s\-().]{7,20}$/, message: "must be a valid phone number" },
|
|
2098
|
+
uuid: { regex: /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i, message: "must be a valid UUID" },
|
|
2099
|
+
slug: { regex: /^[a-z0-9]+(?:-[a-z0-9]+)*$/, message: "must be a valid slug" },
|
|
2100
|
+
username: { regex: /^[a-zA-Z0-9_]{3,30}$/, message: "must be 3-30 chars, letters/numbers/underscores" },
|
|
2101
|
+
password: { regex: /^.{8,}$/, message: "must be at least 8 characters" },
|
|
2102
|
+
name: { regex: /^[\p{L}\s\-'.]{1,100}$/u, message: "must be a valid name" },
|
|
2103
|
+
currency: { regex: /^\d+(\.\d{1,2})?$/, message: "must be a valid currency amount" },
|
|
2104
|
+
percentage: { regex: /^(100(\.0{1,2})?|\d{1,2}(\.\d{1,2})?)$/, message: "must be 0-100" },
|
|
2105
|
+
date: { regex: /^\d{4}-\d{2}-\d{2}$/, message: "must be YYYY-MM-DD format" },
|
|
2106
|
+
datetime: { regex: /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/, message: "must be ISO datetime" },
|
|
2107
|
+
time: { regex: /^\d{2}:\d{2}(:\d{2})?$/, message: "must be HH:MM or HH:MM:SS" },
|
|
2108
|
+
ip: { regex: /^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$|^([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}$/, message: "must be a valid IP" },
|
|
2109
|
+
ipv4: { regex: /^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/, message: "must be a valid IPv4" },
|
|
2110
|
+
ipv6: { regex: /^([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}$/, message: "must be a valid IPv6" },
|
|
2111
|
+
"mac-address": { regex: /^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$/, message: "must be a valid MAC address" },
|
|
2112
|
+
"credit-card": { regex: /^\d{13,19}$/, message: "must be a valid card number" },
|
|
2113
|
+
"postal-code-us": { regex: /^\d{5}(-\d{4})?$/, message: "must be a valid US postal code" },
|
|
2114
|
+
ssn: { regex: /^\d{3}-\d{2}-\d{4}$/, message: "must be XXX-XX-XXXX format" },
|
|
2115
|
+
"hex-color": { regex: /^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/, message: "must be #RGB or #RRGGBB" },
|
|
2116
|
+
json: { regex: /^[\s\S]*$/, message: "must be valid JSON" }
|
|
2117
|
+
};
|
|
2118
|
+
const config = patterns[preset];
|
|
2119
|
+
if (!config) return null;
|
|
2120
|
+
if (preset === "json") {
|
|
2121
|
+
try {
|
|
2122
|
+
JSON.parse(value);
|
|
2123
|
+
return null;
|
|
2124
|
+
} catch {
|
|
2125
|
+
return { field: fieldName, message: `${fieldName} ${config.message}` };
|
|
2126
|
+
}
|
|
2127
|
+
}
|
|
2128
|
+
if (!config.regex.test(value)) {
|
|
2129
|
+
return { field: fieldName, message: `${fieldName} ${config.message}` };
|
|
2130
|
+
}
|
|
2131
|
+
return null;
|
|
2132
|
+
}
|
|
2133
|
+
/**
|
|
2134
|
+
* Create with validation (validates before sending to server)
|
|
2135
|
+
*/
|
|
2136
|
+
async createValidated(collection, data) {
|
|
2137
|
+
const validation = await this.validate(collection, data);
|
|
2138
|
+
if (!validation.valid) {
|
|
2139
|
+
return { errors: validation.errors };
|
|
2140
|
+
}
|
|
2141
|
+
const result = await this.create(collection, data);
|
|
2142
|
+
return { data: result };
|
|
2143
|
+
}
|
|
2144
|
+
/**
|
|
2145
|
+
* Update with validation (validates before sending to server)
|
|
2146
|
+
*/
|
|
2147
|
+
async updateValidated(collection, id, data) {
|
|
2148
|
+
const validation = await this.validate(collection, data);
|
|
2149
|
+
if (!validation.valid) {
|
|
2150
|
+
return { errors: validation.errors };
|
|
2151
|
+
}
|
|
2152
|
+
const result = await this.update(collection, id, data);
|
|
2153
|
+
return { data: result };
|
|
2154
|
+
}
|
|
2155
|
+
};
|
|
2156
|
+
|
|
2157
|
+
// src/resources/files.ts
|
|
2158
|
+
var FilesResource2 = class {
|
|
2159
|
+
constructor(client) {
|
|
2160
|
+
this.client = client;
|
|
2161
|
+
}
|
|
2162
|
+
async upload(file, options = {}) {
|
|
2163
|
+
return this.client.upload("/files/upload", file, {
|
|
2164
|
+
bucket: options.bucket || "squeed-storage",
|
|
2165
|
+
entityType: options.entityType || "project",
|
|
2166
|
+
entityId: options.entityId || "default"
|
|
2167
|
+
});
|
|
2168
|
+
}
|
|
2169
|
+
async uploadMultiple(files, options = {}) {
|
|
2170
|
+
return this.client.upload("/files/upload-multiple", files, {
|
|
2171
|
+
bucket: options.bucket || "squeed-storage",
|
|
2172
|
+
entityType: options.entityType || "project",
|
|
2173
|
+
entityId: options.entityId || "default"
|
|
2174
|
+
});
|
|
2175
|
+
}
|
|
2176
|
+
async list(entityType, entityId, options) {
|
|
2177
|
+
const params = {};
|
|
2178
|
+
if (options?.limit) params.limit = options.limit;
|
|
2179
|
+
if (options?.offset) params.offset = options.offset;
|
|
2180
|
+
const response = await this.client.get(`/files/entity/${entityType}/${entityId}`, params);
|
|
2181
|
+
return response.files || [];
|
|
2182
|
+
}
|
|
2183
|
+
async getSignedUrl(bucket, key, expiresIn = 600) {
|
|
2184
|
+
return this.client.get(`/files/signed-url/${bucket}/${encodeURIComponent(key)}`, { expiresIn });
|
|
2185
|
+
}
|
|
2186
|
+
async download(bucket, key) {
|
|
2187
|
+
const { signedUrl } = await this.getSignedUrl(bucket, key);
|
|
2188
|
+
const response = await fetch(signedUrl);
|
|
2189
|
+
return response.blob();
|
|
2190
|
+
}
|
|
2191
|
+
async delete(bucket, key) {
|
|
2192
|
+
return this.client.delete(`/files/${bucket}/${encodeURIComponent(key)}`);
|
|
2193
|
+
}
|
|
2194
|
+
async deleteByEntity(entityType, entityId) {
|
|
2195
|
+
return this.client.delete(`/files/entity/${entityType}/${entityId}`);
|
|
2196
|
+
}
|
|
2197
|
+
async uploadJson(options) {
|
|
2198
|
+
return this.client.post("/files/upload-json", options);
|
|
2199
|
+
}
|
|
2200
|
+
};
|
|
2201
|
+
|
|
2202
|
+
// src/resources/workflows.ts
|
|
2203
|
+
var TOOL_TYPES = [
|
|
2204
|
+
"llm_call",
|
|
2205
|
+
"api_call",
|
|
2206
|
+
"shell_command",
|
|
2207
|
+
"web_search",
|
|
2208
|
+
"file_edit",
|
|
2209
|
+
"git_command",
|
|
2210
|
+
"mcp_tool",
|
|
2211
|
+
"storage",
|
|
2212
|
+
"database",
|
|
2213
|
+
"notification",
|
|
2214
|
+
"workflow",
|
|
2215
|
+
"rag",
|
|
2216
|
+
"cache",
|
|
2217
|
+
"emit_event"
|
|
2218
|
+
];
|
|
2219
|
+
var TRIGGER_TYPES = ["manual", "cron", "webhook", "event"];
|
|
2220
|
+
var NOTIFY_CHANNELS = ["email", "sms", "whatsapp", "push", "slack"];
|
|
2221
|
+
var NOTIFY_PRIORITIES = ["low", "normal", "high", "urgent"];
|
|
2222
|
+
var DB_OPERATIONS = ["get", "query", "insert", "update", "upsert", "delete", "deletewhere", "arrayRemove", "updateArrayElement", "count"];
|
|
2223
|
+
var STORAGE_OPERATIONS = ["get", "download", "put", "upload", "list", "signedUrl", "delete", "deleteByPrefix", "url", "publicUrl"];
|
|
2224
|
+
var CACHE_OPERATIONS = ["get", "set", "delete", "invalidate"];
|
|
2225
|
+
var LLM_PROVIDERS = ["openai", "anthropic", "google", "openrouter", "lmstudio", "custom", "claude", "ollama"];
|
|
2226
|
+
var CLI_PROVIDERS = ["claude", "openai", "aider", "anthropic", "claude-cli", "openai-cli", "ollama-cli"];
|
|
2227
|
+
var DB_PROVIDERS = ["firebase", "supabase", "sqlite", "custom"];
|
|
2228
|
+
var HTTP_METHODS = ["GET", "POST", "PUT", "PATCH", "DELETE"];
|
|
2229
|
+
var RAG_MODES = ["single", "accumulate", "iterative"];
|
|
2230
|
+
var CHUNKING_STRATEGIES = ["fixed_size", "recursive", "token_based", "semantic"];
|
|
2231
|
+
var IMAGE_DETAILS = ["auto", "low", "high"];
|
|
2232
|
+
var CONDITION_OPERATORS = ["$eq", "$ne", "$gt", "$gte", "$lt", "$lte", "$in", "$exists"];
|
|
2233
|
+
var WORKFLOW_VALIDATION_SCHEMA = {
|
|
2234
|
+
root: {
|
|
2235
|
+
id: { type: "string", required: true, description: "Unique workflow identifier" },
|
|
2236
|
+
name: { type: "string", required: true, description: "Human-readable workflow name" },
|
|
2237
|
+
description: { type: "string", required: false, description: "Workflow purpose and details" },
|
|
2238
|
+
tools: { type: "array", required: true, multiselect: true, description: "Tool definitions available to the workflow" },
|
|
2239
|
+
workflows: { type: "array", required: true, multiselect: true, description: "Array of executable workflows" },
|
|
2240
|
+
agent: {
|
|
2241
|
+
type: "object",
|
|
2242
|
+
required: false,
|
|
2243
|
+
description: "Agent configuration with LLM instructions",
|
|
2244
|
+
properties: {
|
|
2245
|
+
id: { type: "string", required: false, description: "Unique agent identifier" },
|
|
2246
|
+
name: { type: "string", required: false, description: "Agent display name" },
|
|
2247
|
+
role: { type: "string", required: false, description: "Agent role/responsibility" },
|
|
2248
|
+
llm_prompt: { type: "string", required: false, description: "System prompt for LLM" }
|
|
2249
|
+
}
|
|
2250
|
+
},
|
|
2251
|
+
monitoring: {
|
|
2252
|
+
type: "object",
|
|
2253
|
+
required: false,
|
|
2254
|
+
description: "KPI and performance tracking",
|
|
2255
|
+
properties: {
|
|
2256
|
+
kpis: {
|
|
2257
|
+
type: "array",
|
|
2258
|
+
required: false,
|
|
2259
|
+
multiselect: true,
|
|
2260
|
+
description: "Key performance indicators",
|
|
2261
|
+
itemType: {
|
|
2262
|
+
type: "object",
|
|
2263
|
+
required: false,
|
|
2264
|
+
properties: {
|
|
2265
|
+
metric: { type: "string", required: true, description: "Metric name" },
|
|
2266
|
+
target: { type: "string", required: false, description: "Target value" },
|
|
2267
|
+
measurement: { type: "string", required: false, description: "Measurement source" }
|
|
2268
|
+
}
|
|
2269
|
+
}
|
|
2270
|
+
}
|
|
2271
|
+
}
|
|
2272
|
+
},
|
|
2273
|
+
working_directory: { type: "string", required: false, description: "Base directory for execution" },
|
|
2274
|
+
context: { type: "object", required: false, description: "Initial context variables for template substitution" },
|
|
2275
|
+
planOnly: { type: "boolean", required: false, default: false, description: "If true, only generate execution plan" },
|
|
2276
|
+
allowPause: { type: "boolean", required: false, default: false, description: "Enable pause/resume capabilities" },
|
|
2277
|
+
subscribable: { type: "boolean", required: false, default: false, description: "Enable real-time WebSocket progress updates" }
|
|
2278
|
+
},
|
|
2279
|
+
tool: {
|
|
2280
|
+
name: { type: "string", required: true, description: "Unique tool identifier" },
|
|
2281
|
+
type: { type: "enum", required: true, options: TOOL_TYPES, description: "Tool type" },
|
|
2282
|
+
description: { type: "string", required: false, description: "What the tool does" },
|
|
2283
|
+
endpoint: { type: "string", required: false, description: "API endpoint URL (for api_call type)" },
|
|
2284
|
+
params: {
|
|
2285
|
+
type: "object",
|
|
2286
|
+
required: false,
|
|
2287
|
+
description: "Configuration parameters",
|
|
2288
|
+
properties: {
|
|
2289
|
+
timeout: { type: "number", required: false, default: 3e4, description: "Timeout in milliseconds" },
|
|
2290
|
+
method: { type: "enum", required: false, options: HTTP_METHODS, description: "HTTP method" },
|
|
2291
|
+
headers: { type: "object", required: false, description: "HTTP headers" },
|
|
2292
|
+
maxBuffer: { type: "number", required: false, description: "Max buffer size for shell commands" },
|
|
2293
|
+
cwd: { type: "string", required: false, description: "Working directory" },
|
|
2294
|
+
env: { type: "object", required: false, description: "Environment variables for shell commands" },
|
|
2295
|
+
provider: { type: "enum", required: false, options: LLM_PROVIDERS, description: "LLM provider" },
|
|
2296
|
+
model: { type: "string", required: false, description: "Model identifier" },
|
|
2297
|
+
baseURL: { type: "string", required: false, description: "Custom API endpoint for LLM" },
|
|
2298
|
+
temperature: { type: "number", required: false, default: 0.7, description: "LLM temperature (0-2)" },
|
|
2299
|
+
max_tokens: { type: "number", required: false, default: 4e3, description: "Max tokens for LLM response" },
|
|
2300
|
+
maxTokens: { type: "number", required: false, default: 4e3, description: "Max tokens (alias)" },
|
|
2301
|
+
stop: { type: "array", required: false, multiselect: true, description: "Stop sequences for LLM" },
|
|
2302
|
+
saveMedia: { type: "boolean", required: false, default: false, description: "Save generated images to storage" },
|
|
2303
|
+
mediaBucket: { type: "string", required: false, description: "Storage bucket for media" },
|
|
2304
|
+
mediaPrefix: { type: "string", required: false, description: "Path prefix for media files" },
|
|
2305
|
+
cliProvider: { type: "enum", required: false, options: CLI_PROVIDERS, description: "CLI provider for shell commands" },
|
|
2306
|
+
requireAuth: { type: "boolean", required: false, description: "Check CLI authentication" },
|
|
2307
|
+
parseJSON: { type: "boolean", required: false, description: "Attempt to parse stdout as JSON" },
|
|
2308
|
+
mcpServer: { type: "string", required: false, description: "MCP server name" },
|
|
2309
|
+
toolName: { type: "string", required: false, description: "MCP tool name" },
|
|
2310
|
+
operation: { type: "enum", required: false, options: [...DB_OPERATIONS, ...STORAGE_OPERATIONS, ...CACHE_OPERATIONS], description: "Database/storage/cache operation" },
|
|
2311
|
+
bucket: { type: "string", required: false, description: "Storage bucket name" },
|
|
2312
|
+
contentKey: { type: "string", required: false, description: "Storage content key/path" },
|
|
2313
|
+
path: { type: "string", required: false, description: "File path (alias for contentKey)" },
|
|
2314
|
+
entityType: { type: "string", required: false, description: "Entity type for storage linking" },
|
|
2315
|
+
entityId: { type: "string", required: false, description: "Entity ID for storage linking" },
|
|
2316
|
+
contentType: { type: "string", required: false, description: "MIME type" },
|
|
2317
|
+
expiresIn: { type: "number", required: false, description: "Expiry in seconds for signed URLs" },
|
|
2318
|
+
prefix: { type: "string", required: false, description: "Prefix for deleteByPrefix operation" },
|
|
2319
|
+
dbProvider: { type: "enum", required: false, options: DB_PROVIDERS, default: "supabase", description: "Database provider" },
|
|
2320
|
+
collection: { type: "string", required: false, description: "Database collection/table name" },
|
|
2321
|
+
table: { type: "string", required: false, description: "Table name (alias for collection)" },
|
|
2322
|
+
id: { type: "string", required: false, description: "Document/record ID" },
|
|
2323
|
+
docId: { type: "string", required: false, description: "Document ID (alias)" },
|
|
2324
|
+
data: { type: "object", required: false, description: "Data for insert/update" },
|
|
2325
|
+
where: { type: "array", required: false, multiselect: true, description: "Query filters" },
|
|
2326
|
+
filters: { type: "array", required: false, multiselect: true, description: "Query filters (alias)" },
|
|
2327
|
+
orderBy: { type: "string", required: false, description: "Sort order" },
|
|
2328
|
+
limit: { type: "number", required: false, description: "Result limit" },
|
|
2329
|
+
offset: { type: "number", required: false, description: "Result offset" },
|
|
2330
|
+
field: { type: "string", required: false, description: "Field name for array operations" },
|
|
2331
|
+
value: { type: "string", required: false, description: "Value for array operations" },
|
|
2332
|
+
arrayField: { type: "string", required: false, description: "Array field name" },
|
|
2333
|
+
matchKey: { type: "string", required: false, description: "Key to match in array" },
|
|
2334
|
+
matchValue: { type: "string", required: false, description: "Value to match in array" },
|
|
2335
|
+
updates: { type: "object", required: false, description: "Partial update data" },
|
|
2336
|
+
channels: { type: "array", required: false, multiselect: true, options: NOTIFY_CHANNELS, description: "Notification channels" },
|
|
2337
|
+
title: { type: "string", required: false, description: "Notification title" },
|
|
2338
|
+
body: { type: "string", required: false, description: "Notification message" },
|
|
2339
|
+
userId: { type: "string", required: false, description: "Recipient user ID" },
|
|
2340
|
+
email: { type: "string", required: false, description: "Recipient email" },
|
|
2341
|
+
phone: { type: "string", required: false, description: "Recipient phone" },
|
|
2342
|
+
priority: { type: "enum", required: false, options: NOTIFY_PRIORITIES, description: "Notification priority" },
|
|
2343
|
+
category: { type: "string", required: false, description: "Notification category" },
|
|
2344
|
+
actionUrl: { type: "string", required: false, description: "Action URL" },
|
|
2345
|
+
actionText: { type: "string", required: false, description: "Action button text" },
|
|
2346
|
+
imageUrl: { type: "string", required: false, description: "Image URL" },
|
|
2347
|
+
respectUserPreferences: { type: "boolean", required: false, default: true, description: "Respect user notification preferences" },
|
|
2348
|
+
silent: { type: "boolean", required: false, default: false, description: "Silent notification" },
|
|
2349
|
+
saveToHistory: { type: "boolean", required: false, default: true, description: "Save to notification history" },
|
|
2350
|
+
pattern: { type: "string", required: false, description: "Cache invalidation pattern" },
|
|
2351
|
+
key: { type: "string", required: false, description: "Cache key" },
|
|
2352
|
+
ttl: { type: "number", required: false, description: "Cache TTL in seconds" },
|
|
2353
|
+
command: { type: "string", required: false, description: "Shell command to execute" }
|
|
2354
|
+
}
|
|
2355
|
+
}
|
|
2356
|
+
},
|
|
2357
|
+
step: {
|
|
2358
|
+
id: { type: "string", required: true, description: "Unique step identifier within workflow" },
|
|
2359
|
+
action: { type: "string", required: true, description: "Name of tool to execute" },
|
|
2360
|
+
type: { type: "enum", required: false, options: TOOL_TYPES, description: "Step type override (e.g., for rag)" },
|
|
2361
|
+
description: { type: "string", required: false, description: "Step purpose" },
|
|
2362
|
+
input: {
|
|
2363
|
+
type: "object",
|
|
2364
|
+
required: false,
|
|
2365
|
+
description: "Data passed to the step",
|
|
2366
|
+
properties: {
|
|
2367
|
+
query: { type: "string", required: false, description: "Search query for RAG" },
|
|
2368
|
+
mode: { type: "enum", required: false, options: RAG_MODES, description: "RAG search mode" },
|
|
2369
|
+
limit: { type: "number", required: false, default: 5, description: "Result limit" },
|
|
2370
|
+
filter: { type: "object", required: false, description: "RAG filter criteria" },
|
|
2371
|
+
contextKey: { type: "string", required: false, description: "Context key for RAG results" },
|
|
2372
|
+
timeout: { type: "number", required: false, default: 3e4, description: "Step timeout" }
|
|
2373
|
+
}
|
|
2374
|
+
},
|
|
2375
|
+
output: { type: "string", required: false, description: "Variable name to store output" },
|
|
2376
|
+
params: { type: "object", required: false, description: "Step-specific parameter overrides (same as tool params)" },
|
|
2377
|
+
conditions: {
|
|
2378
|
+
type: "object",
|
|
2379
|
+
required: false,
|
|
2380
|
+
description: "Conditional execution logic",
|
|
2381
|
+
properties: {
|
|
2382
|
+
if: { type: "string", required: false, description: "Expression-based condition" }
|
|
2383
|
+
}
|
|
2384
|
+
},
|
|
2385
|
+
files: {
|
|
2386
|
+
type: "array",
|
|
2387
|
+
required: false,
|
|
2388
|
+
multiselect: true,
|
|
2389
|
+
description: "File attachments for LLM steps",
|
|
2390
|
+
itemType: {
|
|
2391
|
+
type: "object",
|
|
2392
|
+
required: false,
|
|
2393
|
+
properties: {
|
|
2394
|
+
id: { type: "string", required: false, description: "File ID" },
|
|
2395
|
+
url: { type: "string", required: false, description: "File URL" },
|
|
2396
|
+
data: { type: "string", required: false, description: "Base64 encoded data" },
|
|
2397
|
+
mimeType: { type: "string", required: true, description: "MIME type" },
|
|
2398
|
+
filename: { type: "string", required: false, description: "Original filename" }
|
|
2399
|
+
}
|
|
2400
|
+
}
|
|
2401
|
+
},
|
|
2402
|
+
images: {
|
|
2403
|
+
type: "array",
|
|
2404
|
+
required: false,
|
|
2405
|
+
multiselect: true,
|
|
2406
|
+
description: "Image attachments for vision tasks",
|
|
2407
|
+
itemType: {
|
|
2408
|
+
type: "object",
|
|
2409
|
+
required: false,
|
|
2410
|
+
properties: {
|
|
2411
|
+
url: { type: "string", required: true, description: "Image URL" },
|
|
2412
|
+
detail: { type: "enum", required: false, options: IMAGE_DETAILS, default: "auto", description: "Image detail level" }
|
|
2413
|
+
}
|
|
2414
|
+
}
|
|
2415
|
+
},
|
|
2416
|
+
dependsOn: { type: "array", required: false, multiselect: true, description: "Step IDs this step depends on" },
|
|
2417
|
+
parallel: { type: "boolean", required: false, default: false, description: "Execute in parallel with other steps" },
|
|
2418
|
+
earlyReturn: { type: "boolean", required: false, default: false, description: "Return immediately, continue in background" },
|
|
2419
|
+
queueAsJob: { type: "boolean", required: false, default: false, description: "Queue background execution as a job (requires earlyReturn)" },
|
|
2420
|
+
pausePoint: { type: "object", required: false, description: "Pause/approval control" },
|
|
2421
|
+
retryCount: { type: "number", required: false, default: 0, description: "Current retry count" },
|
|
2422
|
+
maxRetries: { type: "number", required: false, default: 0, description: "Maximum retry attempts" }
|
|
2423
|
+
},
|
|
2424
|
+
trigger: {
|
|
2425
|
+
type: { type: "enum", required: true, options: TRIGGER_TYPES, description: "Trigger type" },
|
|
2426
|
+
cron: { type: "string", required: false, description: "Cron expression for scheduled triggers" },
|
|
2427
|
+
webhook: { type: "object", required: false, description: "Webhook configuration" },
|
|
2428
|
+
event: { type: "string", required: false, description: "Event name or pattern for event triggers (e.g., posts.created, posts.*)" },
|
|
2429
|
+
eventFilter: { type: "object", required: false, description: "Filter criteria for event data" }
|
|
2430
|
+
},
|
|
2431
|
+
pausePoint: {
|
|
2432
|
+
requireApproval: { type: "boolean", required: false, default: false, description: "Manual approval required" },
|
|
2433
|
+
message: { type: "string", required: false, description: "Message shown to user" },
|
|
2434
|
+
metadata: { type: "object", required: false, description: "Custom metadata for pause state" },
|
|
2435
|
+
notify: { type: "object", required: false, description: "Notification settings when paused" }
|
|
2436
|
+
},
|
|
2437
|
+
notify: {
|
|
2438
|
+
enabled: { type: "boolean", required: false, default: false, description: "Enable notifications" },
|
|
2439
|
+
channels: { type: "array", required: false, multiselect: true, options: NOTIFY_CHANNELS, description: "Notification channels" },
|
|
2440
|
+
priority: { type: "enum", required: false, options: NOTIFY_PRIORITIES, default: "normal", description: "Notification priority" },
|
|
2441
|
+
userId: { type: "string", required: false, description: "User ID to notify" }
|
|
2442
|
+
},
|
|
2443
|
+
workflow: {
|
|
2444
|
+
name: { type: "string", required: true, description: "Workflow name" },
|
|
2445
|
+
trigger: { type: "object", required: true, description: "Trigger configuration" },
|
|
2446
|
+
steps: { type: "array", required: true, multiselect: true, description: "Array of workflow steps" },
|
|
2447
|
+
config: {
|
|
2448
|
+
type: "object",
|
|
2449
|
+
required: false,
|
|
2450
|
+
description: "Workflow-specific configuration",
|
|
2451
|
+
properties: {
|
|
2452
|
+
allowPause: { type: "boolean", required: false, description: "Override parent allowPause" },
|
|
2453
|
+
maxAttempts: { type: "number", required: false, description: "Maximum retry attempts" }
|
|
2454
|
+
}
|
|
2455
|
+
}
|
|
2456
|
+
},
|
|
2457
|
+
fileAttachment: {
|
|
2458
|
+
id: { type: "string", required: false, description: "File ID" },
|
|
2459
|
+
url: { type: "string", required: false, description: "File URL" },
|
|
2460
|
+
data: { type: "string", required: false, description: "Base64 encoded file data" },
|
|
2461
|
+
mimeType: { type: "string", required: true, description: "MIME type of the file" },
|
|
2462
|
+
filename: { type: "string", required: false, description: "Original filename" }
|
|
2463
|
+
},
|
|
2464
|
+
imageAttachment: {
|
|
2465
|
+
url: { type: "string", required: true, description: "Image URL" },
|
|
2466
|
+
detail: { type: "enum", required: false, options: IMAGE_DETAILS, default: "auto", description: "Image detail level for vision" }
|
|
2467
|
+
},
|
|
2468
|
+
conditionOperators: {
|
|
2469
|
+
$eq: { type: "string", required: false, description: "Equal to value" },
|
|
2470
|
+
$ne: { type: "string", required: false, description: "Not equal to value" },
|
|
2471
|
+
$gt: { type: "number", required: false, description: "Greater than value" },
|
|
2472
|
+
$gte: { type: "number", required: false, description: "Greater than or equal to value" },
|
|
2473
|
+
$lt: { type: "number", required: false, description: "Less than value" },
|
|
2474
|
+
$lte: { type: "number", required: false, description: "Less than or equal to value" },
|
|
2475
|
+
$in: { type: "array", required: false, multiselect: true, description: "Value is in array" },
|
|
2476
|
+
$exists: { type: "boolean", required: false, description: "Property exists" }
|
|
2477
|
+
}
|
|
2478
|
+
};
|
|
2479
|
+
var WorkflowsResource2 = class {
|
|
2480
|
+
constructor(client) {
|
|
2481
|
+
this.client = client;
|
|
2482
|
+
}
|
|
2483
|
+
async execute(config) {
|
|
2484
|
+
return this.client.post("/agent/workflow", config);
|
|
2485
|
+
}
|
|
2486
|
+
async get(executionId) {
|
|
2487
|
+
return this.client.get(`/agent/workflow/${executionId}`);
|
|
2488
|
+
}
|
|
2489
|
+
async list(params) {
|
|
2490
|
+
const response = await this.client.get("/agent/workflows/executions", params);
|
|
2491
|
+
return { executions: response.executions || [], pagination: response.pagination };
|
|
2492
|
+
}
|
|
2493
|
+
async getHistory(workflowId) {
|
|
2494
|
+
return this.client.get(`/agent/workflow/${workflowId}/history`);
|
|
2495
|
+
}
|
|
2496
|
+
async pause(executionId) {
|
|
2497
|
+
return this.client.post(`/agent/workflow/${executionId}/pause`);
|
|
2498
|
+
}
|
|
2499
|
+
async resume(executionId, options) {
|
|
2500
|
+
return this.client.post("/agent/workflow/resume", {
|
|
2501
|
+
executionId,
|
|
2502
|
+
continue: options?.continue ?? true,
|
|
2503
|
+
userInput: options?.userInput
|
|
2504
|
+
});
|
|
2505
|
+
}
|
|
2506
|
+
async cancel(executionId) {
|
|
2507
|
+
return this.client.post(`/agent/workflow/${executionId}/cancel`);
|
|
2508
|
+
}
|
|
2509
|
+
async getStatus(executionId) {
|
|
2510
|
+
const response = await this.client.get(`/agent/workflow/${executionId}/status`);
|
|
2511
|
+
return response.execution;
|
|
2512
|
+
}
|
|
2513
|
+
async retry(executionId) {
|
|
2514
|
+
return this.client.post(`/agent/workflow/${executionId}/retry`);
|
|
2515
|
+
}
|
|
2516
|
+
async rerun(workflowId) {
|
|
2517
|
+
return this.client.post(`/agent/workflow/${workflowId}/rerun`);
|
|
2518
|
+
}
|
|
2519
|
+
async delete(workflowId) {
|
|
2520
|
+
return this.client.delete(`/agent/workflows/executions/${workflowId}`);
|
|
2521
|
+
}
|
|
2522
|
+
async deleteAll() {
|
|
2523
|
+
return this.client.delete("/agent/workflows/executions");
|
|
2524
|
+
}
|
|
2525
|
+
subscribe(executionId, handlers) {
|
|
2526
|
+
const ws = this.client.createWebSocket(`workflow:${executionId}`);
|
|
2527
|
+
ws.onmessage = (event) => {
|
|
2528
|
+
try {
|
|
2529
|
+
const data = JSON.parse(event.data);
|
|
2530
|
+
if (data.type === "workflow_progress" && handlers.onProgress) {
|
|
2531
|
+
handlers.onProgress(data.payload);
|
|
2532
|
+
} else if (data.type === "workflow_complete" && handlers.onComplete) {
|
|
2533
|
+
handlers.onComplete(data.payload);
|
|
2534
|
+
}
|
|
2535
|
+
} catch (error) {
|
|
2536
|
+
handlers.onError?.(error);
|
|
2537
|
+
}
|
|
2538
|
+
};
|
|
2539
|
+
ws.onerror = (error) => handlers.onError?.(error);
|
|
2540
|
+
return () => ws.close();
|
|
2541
|
+
}
|
|
2542
|
+
getValidationSchema() {
|
|
2543
|
+
return WORKFLOW_VALIDATION_SCHEMA;
|
|
2544
|
+
}
|
|
2545
|
+
getSchemaFor(section) {
|
|
2546
|
+
return WORKFLOW_VALIDATION_SCHEMA[section];
|
|
2547
|
+
}
|
|
2548
|
+
getToolTypes() {
|
|
2549
|
+
return TOOL_TYPES;
|
|
2550
|
+
}
|
|
2551
|
+
getTriggerTypes() {
|
|
2552
|
+
return TRIGGER_TYPES;
|
|
2553
|
+
}
|
|
2554
|
+
getNotifyChannels() {
|
|
2555
|
+
return NOTIFY_CHANNELS;
|
|
2556
|
+
}
|
|
2557
|
+
getNotifyPriorities() {
|
|
2558
|
+
return NOTIFY_PRIORITIES;
|
|
2559
|
+
}
|
|
2560
|
+
getDbOperations() {
|
|
2561
|
+
return DB_OPERATIONS;
|
|
2562
|
+
}
|
|
2563
|
+
getStorageOperations() {
|
|
2564
|
+
return STORAGE_OPERATIONS;
|
|
2565
|
+
}
|
|
2566
|
+
validateProperty(section, property, value) {
|
|
2567
|
+
const schema = WORKFLOW_VALIDATION_SCHEMA[section];
|
|
2568
|
+
const propSchema = schema[property];
|
|
2569
|
+
if (!propSchema) {
|
|
2570
|
+
return { valid: false, error: `Unknown property: ${property}` };
|
|
2571
|
+
}
|
|
2572
|
+
if (propSchema.required && (value === void 0 || value === null)) {
|
|
2573
|
+
return { valid: false, error: `${property} is required` };
|
|
2574
|
+
}
|
|
2575
|
+
if (value === void 0 || value === null) {
|
|
2576
|
+
return { valid: true };
|
|
2577
|
+
}
|
|
2578
|
+
if (propSchema.type === "enum" && propSchema.options) {
|
|
2579
|
+
if (!propSchema.options.includes(value)) {
|
|
2580
|
+
return { valid: false, error: `${property} must be one of: ${propSchema.options.join(", ")}` };
|
|
2581
|
+
}
|
|
2582
|
+
}
|
|
2583
|
+
if (propSchema.type === "array" && !Array.isArray(value)) {
|
|
2584
|
+
return { valid: false, error: `${property} must be an array` };
|
|
2585
|
+
}
|
|
2586
|
+
if (propSchema.type === "boolean" && typeof value !== "boolean") {
|
|
2587
|
+
return { valid: false, error: `${property} must be a boolean` };
|
|
2588
|
+
}
|
|
2589
|
+
if (propSchema.type === "number" && typeof value !== "number") {
|
|
2590
|
+
return { valid: false, error: `${property} must be a number` };
|
|
2591
|
+
}
|
|
2592
|
+
if (propSchema.type === "string" && typeof value !== "string") {
|
|
2593
|
+
return { valid: false, error: `${property} must be a string` };
|
|
2594
|
+
}
|
|
2595
|
+
return { valid: true };
|
|
2596
|
+
}
|
|
2597
|
+
};
|
|
2598
|
+
var TOOL_PARAM_CONTEXT = {
|
|
2599
|
+
llm_call: ["provider", "model", "temperature", "max_tokens", "baseURL", "stop", "saveMedia", "mediaBucket"],
|
|
2600
|
+
api_call: ["method", "headers", "timeout", "endpoint"],
|
|
2601
|
+
shell_command: ["command", "cwd", "timeout", "env", "maxBuffer", "cliProvider", "parseJSON", "requireAuth"],
|
|
2602
|
+
database: ["dbProvider", "operation", "collection", "id", "data", "where", "orderBy", "limit", "offset"],
|
|
2603
|
+
storage: ["operation", "bucket", "contentKey", "path", "data", "contentType", "expiresIn", "prefix"],
|
|
2604
|
+
notification: ["channels", "title", "body", "userId", "email", "phone", "priority", "silent"],
|
|
2605
|
+
cache: ["operation", "key", "pattern", "ttl", "value"],
|
|
2606
|
+
mcp_tool: ["mcpServer", "toolName", "timeout"],
|
|
2607
|
+
rag: ["query", "mode", "limit", "filter", "contextKey"],
|
|
2608
|
+
workflow: ["timeout"],
|
|
2609
|
+
web_search: ["query", "limit"],
|
|
2610
|
+
file_edit: ["path", "content"],
|
|
2611
|
+
git_command: ["command", "cwd"]
|
|
2612
|
+
};
|
|
2613
|
+
function formatProp(key, val, indent = "") {
|
|
2614
|
+
const req = val.required ? "*" : "";
|
|
2615
|
+
const opts = val.options ? ` [${val.options.slice(0, 6).join("|")}${val.options.length > 6 ? "..." : ""}]` : "";
|
|
2616
|
+
const multi = val.multiselect ? "[]" : "";
|
|
2617
|
+
return `${indent}${key}${req}: ${val.type}${multi}${opts}`;
|
|
2618
|
+
}
|
|
2619
|
+
function toPromptContext(options = {}) {
|
|
2620
|
+
const { sections, toolType, compact = false } = options;
|
|
2621
|
+
const sectionsToInclude = sections || ["root", "tool", "step", "trigger", "pausePoint", "notify"];
|
|
2622
|
+
let out = "# Workflow Schema\n\n";
|
|
2623
|
+
if (!compact) {
|
|
2624
|
+
out += `Tool types: ${TOOL_TYPES.join(", ")}
|
|
2625
|
+
`;
|
|
2626
|
+
out += `Triggers: ${TRIGGER_TYPES.join(", ")}
|
|
2627
|
+
`;
|
|
2628
|
+
out += `Notify channels: ${NOTIFY_CHANNELS.join(", ")}
|
|
2629
|
+
|
|
2630
|
+
`;
|
|
2631
|
+
}
|
|
2632
|
+
for (const section of sectionsToInclude) {
|
|
2633
|
+
const schema = WORKFLOW_VALIDATION_SCHEMA[section];
|
|
2634
|
+
if (!schema) continue;
|
|
2635
|
+
out += `## ${section}
|
|
2636
|
+
`;
|
|
2637
|
+
for (const [key, val] of Object.entries(schema)) {
|
|
2638
|
+
if (key === "params" && toolType && TOOL_PARAM_CONTEXT[toolType]) {
|
|
2639
|
+
out += formatProp(key, val) + "\n";
|
|
2640
|
+
const relevantParams = TOOL_PARAM_CONTEXT[toolType];
|
|
2641
|
+
if (val.properties) {
|
|
2642
|
+
for (const pk of relevantParams) {
|
|
2643
|
+
const pv = val.properties[pk];
|
|
2644
|
+
if (pv) out += formatProp(pk, pv, " ") + "\n";
|
|
2645
|
+
}
|
|
2646
|
+
}
|
|
2647
|
+
} else {
|
|
2648
|
+
out += formatProp(key, val) + "\n";
|
|
2649
|
+
if (!compact && val.properties) {
|
|
2650
|
+
for (const [pk, pv] of Object.entries(val.properties)) {
|
|
2651
|
+
out += formatProp(pk, pv, " ") + "\n";
|
|
2652
|
+
}
|
|
2653
|
+
}
|
|
2654
|
+
}
|
|
2655
|
+
}
|
|
2656
|
+
out += "\n";
|
|
2657
|
+
}
|
|
2658
|
+
return out;
|
|
2659
|
+
}
|
|
2660
|
+
function toCompactContext(toolType) {
|
|
2661
|
+
return toPromptContext({ compact: true, toolType, sections: ["step", "tool"] });
|
|
2662
|
+
}
|
|
2663
|
+
|
|
2664
|
+
// src/resources/cache.ts
|
|
2665
|
+
var CacheResource2 = class {
|
|
2666
|
+
constructor(client) {
|
|
2667
|
+
this.client = client;
|
|
2668
|
+
}
|
|
2669
|
+
async getStats() {
|
|
2670
|
+
return this.client.get("/cache/stats");
|
|
2671
|
+
}
|
|
2672
|
+
async flush() {
|
|
2673
|
+
return this.client.delete(
|
|
2674
|
+
"/cache/flush"
|
|
2675
|
+
);
|
|
2676
|
+
}
|
|
2677
|
+
async invalidate(pattern) {
|
|
2678
|
+
return this.client.post("/cache/invalidate", {
|
|
2679
|
+
pattern
|
|
2680
|
+
});
|
|
2681
|
+
}
|
|
2682
|
+
async invalidateRoute(method, path) {
|
|
2683
|
+
return this.client.post("/cache/invalidate-route", {
|
|
2684
|
+
method: method.toUpperCase(),
|
|
2685
|
+
path
|
|
2686
|
+
});
|
|
2687
|
+
}
|
|
2688
|
+
async resetStats() {
|
|
2689
|
+
return this.client.post(
|
|
2690
|
+
"/cache/reset-stats"
|
|
2691
|
+
);
|
|
2692
|
+
}
|
|
2693
|
+
};
|
|
2694
|
+
|
|
2695
|
+
// src/resources/tenant.ts
|
|
2696
|
+
var TenantResource = class {
|
|
2697
|
+
constructor(client) {
|
|
2698
|
+
this.client = client;
|
|
2699
|
+
}
|
|
2700
|
+
async getConfig() {
|
|
2701
|
+
return this.client.get("/tenant/config");
|
|
2702
|
+
}
|
|
2703
|
+
async updateConfig(config, options) {
|
|
2704
|
+
return this.client.post("/tenant/config", {
|
|
2705
|
+
config,
|
|
2706
|
+
planTier: options?.planTier,
|
|
2707
|
+
isolationLevel: options?.isolationLevel,
|
|
2708
|
+
metadata: options?.metadata
|
|
2709
|
+
});
|
|
2710
|
+
}
|
|
2711
|
+
async updateSettings(settings) {
|
|
2712
|
+
return this.client.patch("/public/app/settings", settings);
|
|
2713
|
+
}
|
|
2714
|
+
get secrets() {
|
|
2715
|
+
return new SecretsResource2(this.client);
|
|
2716
|
+
}
|
|
2717
|
+
get apiKeys() {
|
|
2718
|
+
return new ApiKeysResource2(this.client);
|
|
2719
|
+
}
|
|
2720
|
+
get cache() {
|
|
2721
|
+
return new CacheResource2(this.client);
|
|
2722
|
+
}
|
|
2723
|
+
get domains() {
|
|
2724
|
+
return new DomainsResource2(this.client);
|
|
2725
|
+
}
|
|
2726
|
+
get apps() {
|
|
2727
|
+
return new AppsResource2(this.client);
|
|
2728
|
+
}
|
|
2729
|
+
get limits() {
|
|
2730
|
+
return new LimitsResource(this.client);
|
|
2731
|
+
}
|
|
2732
|
+
get workflows() {
|
|
2733
|
+
return new TenantWorkflowsResource2(this.client);
|
|
2734
|
+
}
|
|
2735
|
+
get integrations() {
|
|
2736
|
+
return new TenantIntegrationsResource2(this.client);
|
|
2737
|
+
}
|
|
2738
|
+
get jobs() {
|
|
2739
|
+
return new TenantJobsResource2(this.client);
|
|
2740
|
+
}
|
|
2741
|
+
get rbac() {
|
|
2742
|
+
return new RBACResource(this.client);
|
|
2743
|
+
}
|
|
2744
|
+
};
|
|
2745
|
+
var SecretsResource2 = class {
|
|
2746
|
+
constructor(client) {
|
|
2747
|
+
this.client = client;
|
|
2748
|
+
}
|
|
2749
|
+
async set(key, value, metadata, expiresAt) {
|
|
2750
|
+
return this.client.post("/tenant/secrets", {
|
|
2751
|
+
key,
|
|
2752
|
+
value,
|
|
2753
|
+
metadata,
|
|
2754
|
+
expiresAt
|
|
2755
|
+
});
|
|
2756
|
+
}
|
|
2757
|
+
async list() {
|
|
2758
|
+
const response = await this.client.get(
|
|
2759
|
+
"/tenant/secrets"
|
|
2760
|
+
);
|
|
2761
|
+
return response.secrets || [];
|
|
2762
|
+
}
|
|
2763
|
+
async delete(key) {
|
|
2764
|
+
return this.client.delete(
|
|
2765
|
+
`/tenant/secrets/${encodeURIComponent(key)}`
|
|
2766
|
+
);
|
|
2767
|
+
}
|
|
2768
|
+
async rotate(key, newValue, gracePeriodDays) {
|
|
2769
|
+
return this.client.post(
|
|
2770
|
+
`/tenant/secrets/${encodeURIComponent(key)}/rotate`,
|
|
2771
|
+
{
|
|
2772
|
+
newValue,
|
|
2773
|
+
gracePeriodDays
|
|
2774
|
+
}
|
|
2775
|
+
);
|
|
2776
|
+
}
|
|
2777
|
+
};
|
|
2778
|
+
var ApiKeysResource2 = class {
|
|
2779
|
+
constructor(client) {
|
|
2780
|
+
this.client = client;
|
|
2781
|
+
}
|
|
2782
|
+
async create(name, options) {
|
|
2783
|
+
return this.client.post("/tenant/api-keys", {
|
|
2784
|
+
name,
|
|
2785
|
+
scopes: options?.scopes,
|
|
2786
|
+
expiresAt: options?.expiresAt?.toISOString()
|
|
2787
|
+
});
|
|
2788
|
+
}
|
|
2789
|
+
async list() {
|
|
2790
|
+
const response = await this.client.get("/tenant/api-keys");
|
|
2791
|
+
return response.keys || [];
|
|
2792
|
+
}
|
|
2793
|
+
async revoke(keyId) {
|
|
2794
|
+
return this.client.delete(`/tenant/api-keys/${encodeURIComponent(keyId)}`);
|
|
2795
|
+
}
|
|
2796
|
+
async rotate(keyId, gracePeriodDays) {
|
|
2797
|
+
return this.client.post(
|
|
2798
|
+
`/tenant/api-keys/${encodeURIComponent(keyId)}/rotate`,
|
|
2799
|
+
{ gracePeriodDays }
|
|
2800
|
+
);
|
|
2801
|
+
}
|
|
2802
|
+
};
|
|
2803
|
+
var DomainsResource2 = class {
|
|
2804
|
+
constructor(client) {
|
|
2805
|
+
this.client = client;
|
|
2806
|
+
}
|
|
2807
|
+
async list() {
|
|
2808
|
+
const response = await this.client.get("/tenant/domains");
|
|
2809
|
+
return response.domains || [];
|
|
2810
|
+
}
|
|
2811
|
+
async add(domain, type = "alias") {
|
|
2812
|
+
return this.client.post("/tenant/domains", { domain, type });
|
|
2813
|
+
}
|
|
2814
|
+
async remove(domain) {
|
|
2815
|
+
return this.client.delete(`/tenant/domains/${encodeURIComponent(domain)}`);
|
|
2816
|
+
}
|
|
2817
|
+
async verify(domain) {
|
|
2818
|
+
return this.client.post(
|
|
2819
|
+
`/tenant/domains/${encodeURIComponent(domain)}/verify`
|
|
2820
|
+
);
|
|
2821
|
+
}
|
|
2822
|
+
async getVerificationInstructions(domain) {
|
|
2823
|
+
return this.client.get(
|
|
2824
|
+
`/tenant/domains/${encodeURIComponent(domain)}/verification`
|
|
2825
|
+
);
|
|
2826
|
+
}
|
|
2827
|
+
};
|
|
2828
|
+
var AppsResource2 = class {
|
|
2829
|
+
constructor(client) {
|
|
2830
|
+
this.client = client;
|
|
2831
|
+
}
|
|
2832
|
+
async list() {
|
|
2833
|
+
const response = await this.client.get("/tenant/apps");
|
|
2834
|
+
return response.apps || [];
|
|
2835
|
+
}
|
|
2836
|
+
async create(options) {
|
|
2837
|
+
const response = await this.client.post("/public/apps/create", options);
|
|
2838
|
+
return response.app;
|
|
2839
|
+
}
|
|
2840
|
+
async delete(appId) {
|
|
2841
|
+
return this.client.delete(`/tenant/apps/${encodeURIComponent(appId)}`);
|
|
2842
|
+
}
|
|
2843
|
+
async getUsage() {
|
|
2844
|
+
return this.client.get("/public/apps/usage");
|
|
2845
|
+
}
|
|
2846
|
+
};
|
|
2847
|
+
var LimitsResource = class {
|
|
2848
|
+
constructor(client) {
|
|
2849
|
+
this.client = client;
|
|
2850
|
+
}
|
|
2851
|
+
async get() {
|
|
2852
|
+
return this.client.get("/tenant/limits");
|
|
2853
|
+
}
|
|
2854
|
+
async update(config) {
|
|
2855
|
+
return this.client.put("/tenant/limits", config);
|
|
2856
|
+
}
|
|
2857
|
+
async getLimit(collection) {
|
|
2858
|
+
return this.client.get(`/tenant/limits/${encodeURIComponent(collection)}`);
|
|
2859
|
+
}
|
|
2860
|
+
async setLimit(collection, config) {
|
|
2861
|
+
return this.client.put(
|
|
2862
|
+
`/tenant/limits/${encodeURIComponent(collection)}`,
|
|
2863
|
+
config
|
|
2864
|
+
);
|
|
2865
|
+
}
|
|
2866
|
+
async deleteLimit(collection) {
|
|
2867
|
+
return this.client.delete(
|
|
2868
|
+
`/tenant/limits/${encodeURIComponent(collection)}`
|
|
2869
|
+
);
|
|
2870
|
+
}
|
|
2871
|
+
async getUsage(userId) {
|
|
2872
|
+
const query = userId ? `?userId=${encodeURIComponent(userId)}` : "";
|
|
2873
|
+
return this.client.get(`/tenant/limits/usage${query}`);
|
|
2874
|
+
}
|
|
2875
|
+
async check(userId, collection, action, userTier) {
|
|
2876
|
+
return this.client.post("/tenant/limits/check", {
|
|
2877
|
+
userId,
|
|
2878
|
+
collection,
|
|
2879
|
+
action,
|
|
2880
|
+
userTier
|
|
2881
|
+
});
|
|
2882
|
+
}
|
|
2883
|
+
// Storage Limits Methods
|
|
2884
|
+
get storage() {
|
|
2885
|
+
return new StorageLimitsResource(this.client);
|
|
2886
|
+
}
|
|
2887
|
+
// Resource Limits Methods (workflows, LLM, API, etc.)
|
|
2888
|
+
get resources() {
|
|
2889
|
+
return new ResourceLimitsResource(this.client);
|
|
2890
|
+
}
|
|
2891
|
+
};
|
|
2892
|
+
var StorageLimitsResource = class {
|
|
2893
|
+
constructor(client) {
|
|
2894
|
+
this.client = client;
|
|
2895
|
+
}
|
|
2896
|
+
async getConfig() {
|
|
2897
|
+
return this.client.get("/tenant/limits/storage");
|
|
2898
|
+
}
|
|
2899
|
+
async updateConfig(config) {
|
|
2900
|
+
return this.client.put("/tenant/limits/storage", config);
|
|
2901
|
+
}
|
|
2902
|
+
async getUsage(userId, userTier) {
|
|
2903
|
+
const params = new URLSearchParams();
|
|
2904
|
+
if (userId) params.set("userId", userId);
|
|
2905
|
+
if (userTier) params.set("userTier", userTier);
|
|
2906
|
+
const query = params.toString() ? `?${params.toString()}` : "";
|
|
2907
|
+
return this.client.get(`/tenant/limits/storage/usage${query}`);
|
|
2908
|
+
}
|
|
2909
|
+
async check(userId, fileSizeBytes, userTier) {
|
|
2910
|
+
return this.client.post("/tenant/limits/storage/check", {
|
|
2911
|
+
userId,
|
|
2912
|
+
fileSizeBytes,
|
|
2913
|
+
userTier
|
|
2914
|
+
});
|
|
2915
|
+
}
|
|
2916
|
+
async getByUser() {
|
|
2917
|
+
return this.client.get("/tenant/limits/storage/by-user");
|
|
2918
|
+
}
|
|
2919
|
+
};
|
|
2920
|
+
var ResourceLimitsResource = class {
|
|
2921
|
+
constructor(client) {
|
|
2922
|
+
this.client = client;
|
|
2923
|
+
}
|
|
2924
|
+
async getConfig() {
|
|
2925
|
+
return this.client.get("/tenant/limits/resources");
|
|
2926
|
+
}
|
|
2927
|
+
async updateConfig(limits) {
|
|
2928
|
+
return this.client.put("/tenant/limits/resources", limits);
|
|
2929
|
+
}
|
|
2930
|
+
async getDefinitions() {
|
|
2931
|
+
return this.client.get("/tenant/limits/resources/definitions");
|
|
2932
|
+
}
|
|
2933
|
+
async getUsage(userId, resource) {
|
|
2934
|
+
const params = new URLSearchParams();
|
|
2935
|
+
if (userId) params.set("userId", userId);
|
|
2936
|
+
if (resource) params.set("resource", resource);
|
|
2937
|
+
const query = params.toString() ? `?${params.toString()}` : "";
|
|
2938
|
+
return this.client.get(`/tenant/limits/resources/usage${query}`);
|
|
2939
|
+
}
|
|
2940
|
+
async check(resource, metric, options) {
|
|
2941
|
+
return this.client.post("/tenant/limits/resources/check", {
|
|
2942
|
+
resource,
|
|
2943
|
+
metric,
|
|
2944
|
+
userId: options?.userId,
|
|
2945
|
+
amount: options?.amount ?? 1,
|
|
2946
|
+
context: options?.context
|
|
2947
|
+
});
|
|
2948
|
+
}
|
|
2949
|
+
async track(resource, metric, options) {
|
|
2950
|
+
return this.client.post("/tenant/limits/resources/track", {
|
|
2951
|
+
resource,
|
|
2952
|
+
metric,
|
|
2953
|
+
userId: options?.userId,
|
|
2954
|
+
amount: options?.amount ?? 1
|
|
2955
|
+
});
|
|
2956
|
+
}
|
|
2957
|
+
};
|
|
2958
|
+
var TenantWorkflowsResource2 = class {
|
|
2959
|
+
constructor(client) {
|
|
2960
|
+
this.client = client;
|
|
2961
|
+
}
|
|
2962
|
+
async list() {
|
|
2963
|
+
const response = await this.client.get("/tenant/workflows");
|
|
2964
|
+
return response.workflows || [];
|
|
2965
|
+
}
|
|
2966
|
+
async get(workflowId) {
|
|
2967
|
+
return this.client.get(`/tenant/workflows/${encodeURIComponent(workflowId)}`);
|
|
2968
|
+
}
|
|
2969
|
+
async save(definition) {
|
|
2970
|
+
return this.client.post("/tenant/workflows", definition);
|
|
2971
|
+
}
|
|
2972
|
+
async delete(workflowId) {
|
|
2973
|
+
return this.client.delete(`/tenant/workflows/${encodeURIComponent(workflowId)}`);
|
|
2974
|
+
}
|
|
2975
|
+
async cloneFromDefault(workflowId) {
|
|
2976
|
+
return this.client.post(`/tenant/workflows/${encodeURIComponent(workflowId)}/clone`);
|
|
2977
|
+
}
|
|
2978
|
+
};
|
|
2979
|
+
var TenantIntegrationsResource2 = class {
|
|
2980
|
+
constructor(client) {
|
|
2981
|
+
this.client = client;
|
|
2982
|
+
}
|
|
2983
|
+
async list() {
|
|
2984
|
+
const response = await this.client.get("/tenant/integrations");
|
|
2985
|
+
return response.integrations || [];
|
|
2986
|
+
}
|
|
2987
|
+
async get(integrationId) {
|
|
2988
|
+
return this.client.get(`/tenant/integrations/${encodeURIComponent(integrationId)}`);
|
|
2989
|
+
}
|
|
2990
|
+
async save(definition) {
|
|
2991
|
+
return this.client.post("/tenant/integrations", definition);
|
|
2992
|
+
}
|
|
2993
|
+
async delete(integrationId) {
|
|
2994
|
+
return this.client.delete(`/tenant/integrations/${encodeURIComponent(integrationId)}`);
|
|
2995
|
+
}
|
|
2996
|
+
async cloneFromDefault(integrationId) {
|
|
2997
|
+
return this.client.post(`/tenant/integrations/${encodeURIComponent(integrationId)}/clone`);
|
|
2998
|
+
}
|
|
2999
|
+
};
|
|
3000
|
+
var TenantJobsResource2 = class {
|
|
3001
|
+
constructor(client) {
|
|
3002
|
+
this.client = client;
|
|
3003
|
+
}
|
|
3004
|
+
async listDefinitions() {
|
|
3005
|
+
const response = await this.client.get("/tenant/jobs/definitions");
|
|
3006
|
+
return response.definitions || [];
|
|
3007
|
+
}
|
|
3008
|
+
async getDefinition(jobDefId) {
|
|
3009
|
+
return this.client.get(`/tenant/jobs/definitions/${encodeURIComponent(jobDefId)}`);
|
|
3010
|
+
}
|
|
3011
|
+
async saveDefinition(definition) {
|
|
3012
|
+
return this.client.post("/tenant/jobs/definitions", definition);
|
|
3013
|
+
}
|
|
3014
|
+
async deleteDefinition(jobDefId) {
|
|
3015
|
+
return this.client.delete(`/tenant/jobs/definitions/${encodeURIComponent(jobDefId)}`);
|
|
3016
|
+
}
|
|
3017
|
+
async enqueue(jobDefId, payload, options) {
|
|
3018
|
+
return this.client.post("/tenant/jobs/enqueue", {
|
|
3019
|
+
jobDefId,
|
|
3020
|
+
payload,
|
|
3021
|
+
...options
|
|
3022
|
+
});
|
|
3023
|
+
}
|
|
3024
|
+
async listHistory(options) {
|
|
3025
|
+
const params = new URLSearchParams();
|
|
3026
|
+
if (options?.jobDefId) params.set("jobDefId", options.jobDefId);
|
|
3027
|
+
if (options?.limit) params.set("limit", String(options.limit));
|
|
3028
|
+
if (options?.offset) params.set("offset", String(options.offset));
|
|
3029
|
+
const query = params.toString() ? `?${params.toString()}` : "";
|
|
3030
|
+
const response = await this.client.get(`/tenant/jobs/history${query}`);
|
|
3031
|
+
return response.executions || [];
|
|
3032
|
+
}
|
|
3033
|
+
};
|
|
3034
|
+
var RBACResource = class {
|
|
3035
|
+
constructor(client) {
|
|
3036
|
+
this.client = client;
|
|
3037
|
+
}
|
|
3038
|
+
async getConfig() {
|
|
3039
|
+
return this.client.get("/tenant/rbac");
|
|
3040
|
+
}
|
|
3041
|
+
async updateConfig(config) {
|
|
3042
|
+
return this.client.put("/tenant/rbac", config);
|
|
3043
|
+
}
|
|
3044
|
+
async listRoles() {
|
|
3045
|
+
return this.client.get("/tenant/rbac/roles");
|
|
3046
|
+
}
|
|
3047
|
+
async createRole(role) {
|
|
3048
|
+
return this.client.post("/tenant/rbac/roles", role);
|
|
3049
|
+
}
|
|
3050
|
+
async updateRole(name, updates) {
|
|
3051
|
+
return this.client.put(
|
|
3052
|
+
`/tenant/rbac/roles/${encodeURIComponent(name)}`,
|
|
3053
|
+
updates
|
|
3054
|
+
);
|
|
3055
|
+
}
|
|
3056
|
+
async deleteRole(name) {
|
|
3057
|
+
return this.client.delete(
|
|
3058
|
+
`/tenant/rbac/roles/${encodeURIComponent(name)}`
|
|
3059
|
+
);
|
|
3060
|
+
}
|
|
3061
|
+
};
|
|
3062
|
+
|
|
3063
|
+
// src/resources/embeddings.ts
|
|
3064
|
+
var EmbeddingsResource2 = class {
|
|
3065
|
+
constructor(client) {
|
|
3066
|
+
this.client = client;
|
|
3067
|
+
}
|
|
3068
|
+
async listDocuments(limit = 100) {
|
|
3069
|
+
return this.client.get("/agent/embeddings/documents", { limit });
|
|
3070
|
+
}
|
|
3071
|
+
async embedDocument(options) {
|
|
3072
|
+
return this.client.post("/agent/embeddings/document", options);
|
|
3073
|
+
}
|
|
3074
|
+
async embedBatch(documents, contentType) {
|
|
3075
|
+
return this.client.post("/agent/embeddings/batch", {
|
|
3076
|
+
documents,
|
|
3077
|
+
contentType
|
|
3078
|
+
});
|
|
3079
|
+
}
|
|
3080
|
+
async search(documentId, query, limit = 5) {
|
|
3081
|
+
return this.client.get(`/agent/embeddings/document/${encodeURIComponent(documentId)}/search`, {
|
|
3082
|
+
q: query,
|
|
3083
|
+
limit
|
|
3084
|
+
});
|
|
3085
|
+
}
|
|
3086
|
+
async delete(documentId) {
|
|
3087
|
+
return this.client.delete(`/agent/embeddings/document/${encodeURIComponent(documentId)}`);
|
|
3088
|
+
}
|
|
3089
|
+
async semanticSearch(query, limit = 10) {
|
|
3090
|
+
return this.client.post("/agent/tools/semantic-search", {
|
|
3091
|
+
query,
|
|
3092
|
+
limit
|
|
3093
|
+
});
|
|
3094
|
+
}
|
|
3095
|
+
};
|
|
3096
|
+
|
|
3097
|
+
// src/resources/usage.ts
|
|
3098
|
+
var UsageResource2 = class {
|
|
3099
|
+
constructor(client) {
|
|
3100
|
+
this.client = client;
|
|
3101
|
+
}
|
|
3102
|
+
async getMyUsage() {
|
|
3103
|
+
return this.client.get("/usage/me");
|
|
3104
|
+
}
|
|
3105
|
+
async getUserUsage(userId, options) {
|
|
3106
|
+
return this.client.get(`/usage/user/${userId}`, options);
|
|
3107
|
+
}
|
|
3108
|
+
async getSummary(userId) {
|
|
3109
|
+
return this.client.get(`/usage/user/${userId}/summary`);
|
|
3110
|
+
}
|
|
3111
|
+
};
|
|
3112
|
+
|
|
3113
|
+
// src/resources/analytics.ts
|
|
3114
|
+
var AnalyticsResource2 = class {
|
|
3115
|
+
constructor(client) {
|
|
3116
|
+
this.client = client;
|
|
3117
|
+
}
|
|
3118
|
+
async project(projectId) {
|
|
3119
|
+
return this.client.get(`/analytics/project/${projectId}`);
|
|
3120
|
+
}
|
|
3121
|
+
};
|
|
3122
|
+
|
|
3123
|
+
// src/resources/github.ts
|
|
3124
|
+
var GithubResource2 = class {
|
|
3125
|
+
constructor(client) {
|
|
3126
|
+
this.client = client;
|
|
3127
|
+
}
|
|
3128
|
+
async import(owner, repo, options) {
|
|
3129
|
+
return this.client.post(`/api/github/repos/${owner}/${repo}/import`, options);
|
|
3130
|
+
}
|
|
3131
|
+
async repos() {
|
|
3132
|
+
return this.client.get("/api/github/repos");
|
|
3133
|
+
}
|
|
3134
|
+
async contents(owner, repo, path) {
|
|
3135
|
+
const url = path ? `/api/github/repos/${owner}/${repo}/contents/${path}` : `/api/github/repos/${owner}/${repo}/contents`;
|
|
3136
|
+
return this.client.get(url);
|
|
3137
|
+
}
|
|
3138
|
+
async branches(owner, repo) {
|
|
3139
|
+
return this.client.get(`/api/github/repos/${owner}/${repo}/branches`);
|
|
3140
|
+
}
|
|
3141
|
+
async pulls(owner, repo) {
|
|
3142
|
+
return this.client.get(`/api/github/repos/${owner}/${repo}/pulls`);
|
|
3143
|
+
}
|
|
3144
|
+
async getPull(owner, repo, pullNumber) {
|
|
3145
|
+
return this.client.get(`/api/github/repos/${owner}/${repo}/pulls/${pullNumber}`);
|
|
3146
|
+
}
|
|
3147
|
+
async files(owner, repo, pullNumber) {
|
|
3148
|
+
return this.client.get(`/api/github/repos/${owner}/${repo}/pulls/${pullNumber}/files`);
|
|
3149
|
+
}
|
|
3150
|
+
};
|
|
3151
|
+
|
|
3152
|
+
// src/resources/queues.ts
|
|
3153
|
+
var QueuesResource2 = class {
|
|
3154
|
+
constructor(client) {
|
|
3155
|
+
this.client = client;
|
|
3156
|
+
}
|
|
3157
|
+
/** Get all queues and their statistics (tenant-isolated) */
|
|
3158
|
+
async list() {
|
|
3159
|
+
return this.client.get("/queues");
|
|
3160
|
+
}
|
|
3161
|
+
/** Get statistics for a specific queue (tenant-isolated) */
|
|
3162
|
+
async stats(name) {
|
|
3163
|
+
return this.client.get(`/queues/${name}/stats`);
|
|
3164
|
+
}
|
|
3165
|
+
/** Get jobs from a queue (tenant-isolated) */
|
|
3166
|
+
async jobs(name) {
|
|
3167
|
+
return this.client.get(`/queues/${name}/jobs`);
|
|
3168
|
+
}
|
|
3169
|
+
/** Add a job to the queue (with tenant isolation) */
|
|
3170
|
+
async createJob(name, data) {
|
|
3171
|
+
return this.client.post(`/queues/${name}/jobs`, data);
|
|
3172
|
+
}
|
|
3173
|
+
/** Get a specific job (tenant-isolated) */
|
|
3174
|
+
async getJob(name, jobId) {
|
|
3175
|
+
return this.client.get(`/queues/${name}/jobs/${jobId}`);
|
|
3176
|
+
}
|
|
3177
|
+
/** Retry a failed job (tenant-isolated) */
|
|
3178
|
+
async retry(name, jobId, data) {
|
|
3179
|
+
return this.client.post(`/queues/${name}/jobs/${jobId}/retry`, data);
|
|
3180
|
+
}
|
|
3181
|
+
/** Pause a queue (admin only - affects all tenants) */
|
|
3182
|
+
async pause(name, data) {
|
|
3183
|
+
return this.client.post(`/queues/${name}/pause`, data);
|
|
3184
|
+
}
|
|
3185
|
+
/** Resume a paused queue (admin only - affects all tenants) */
|
|
3186
|
+
async resume(name, data) {
|
|
3187
|
+
return this.client.post(`/queues/${name}/resume`, data);
|
|
3188
|
+
}
|
|
3189
|
+
/** Clean old jobs from queue (tenant-isolated) */
|
|
3190
|
+
async createClean(name, data) {
|
|
3191
|
+
return this.client.post(`/queues/${name}/clean`, data);
|
|
3192
|
+
}
|
|
3193
|
+
/** Get detailed performance metrics for a queue */
|
|
3194
|
+
async metrics(name) {
|
|
3195
|
+
return this.client.get(`/queues/${name}/metrics`);
|
|
3196
|
+
}
|
|
3197
|
+
/** Subscribe to job updates via SSE. Returns unsubscribe function. */
|
|
3198
|
+
subscribe(sseUrl, handlers) {
|
|
3199
|
+
return this.client.subscribeSSE(sseUrl, handlers);
|
|
3200
|
+
}
|
|
3201
|
+
};
|
|
3202
|
+
|
|
3203
|
+
// src/resources/search.ts
|
|
3204
|
+
var SearchConfigValidator = class {
|
|
3205
|
+
constructor() {
|
|
3206
|
+
this.validOperators = ["eq", "neq", "gt", "gte", "lt", "lte", "like", "ilike", "in", "not_in", "is_null", "not_null"];
|
|
3207
|
+
this.validModes = ["exact", "fuzzy", "hybrid"];
|
|
3208
|
+
}
|
|
3209
|
+
/**
|
|
3210
|
+
* Validate search options for a query
|
|
3211
|
+
*/
|
|
3212
|
+
validateSearchOptions(options) {
|
|
3213
|
+
const errors = [];
|
|
3214
|
+
if (!options.q || options.q.trim().length === 0) {
|
|
3215
|
+
errors.push({ field: "q", message: "Search query is required and cannot be empty" });
|
|
3216
|
+
}
|
|
3217
|
+
if (options.mode && !this.validModes.includes(options.mode)) {
|
|
3218
|
+
errors.push({ field: "mode", message: `Invalid mode. Must be one of: ${this.validModes.join(", ")}` });
|
|
3219
|
+
}
|
|
3220
|
+
if (options.limit !== void 0) {
|
|
3221
|
+
if (options.limit < 1 || options.limit > 100) {
|
|
3222
|
+
errors.push({ field: "limit", message: "Limit must be between 1 and 100" });
|
|
3223
|
+
}
|
|
3224
|
+
}
|
|
3225
|
+
if (options.threshold !== void 0) {
|
|
3226
|
+
if (options.threshold < 0 || options.threshold > 1) {
|
|
3227
|
+
errors.push({ field: "threshold", message: "Threshold must be between 0 and 1" });
|
|
3228
|
+
}
|
|
3229
|
+
}
|
|
3230
|
+
return { valid: errors.length === 0, errors };
|
|
3231
|
+
}
|
|
3232
|
+
/**
|
|
3233
|
+
* Validate entity configuration
|
|
3234
|
+
*/
|
|
3235
|
+
validateEntityConfig(entity, config) {
|
|
3236
|
+
const errors = [];
|
|
3237
|
+
if (!entity || entity.trim().length === 0) {
|
|
3238
|
+
errors.push({ field: "entity", message: "Entity name is required" });
|
|
3239
|
+
}
|
|
3240
|
+
if (!config.searchFields || config.searchFields.length === 0) {
|
|
3241
|
+
errors.push({ field: "searchFields", message: "At least one search field is required" });
|
|
3242
|
+
} else {
|
|
3243
|
+
config.searchFields.forEach((field, idx) => {
|
|
3244
|
+
if (!field || field.trim().length === 0) {
|
|
3245
|
+
errors.push({ field: `searchFields[${idx}]`, message: "Search field cannot be empty" });
|
|
3246
|
+
}
|
|
3247
|
+
});
|
|
3248
|
+
}
|
|
3249
|
+
if (config.filters) {
|
|
3250
|
+
config.filters.forEach((filter, idx) => {
|
|
3251
|
+
if (!filter.column) {
|
|
3252
|
+
errors.push({ field: `filters[${idx}].column`, message: "Filter column is required" });
|
|
3253
|
+
}
|
|
3254
|
+
if (!filter.operator) {
|
|
3255
|
+
errors.push({ field: `filters[${idx}].operator`, message: "Filter operator is required" });
|
|
3256
|
+
} else if (!this.validOperators.includes(filter.operator)) {
|
|
3257
|
+
errors.push({
|
|
3258
|
+
field: `filters[${idx}].operator`,
|
|
3259
|
+
message: `Invalid operator. Must be one of: ${this.validOperators.join(", ")}`
|
|
3260
|
+
});
|
|
3261
|
+
}
|
|
3262
|
+
});
|
|
3263
|
+
}
|
|
3264
|
+
return { valid: errors.length === 0, errors };
|
|
3265
|
+
}
|
|
3266
|
+
/**
|
|
3267
|
+
* Validate full search configuration
|
|
3268
|
+
*/
|
|
3269
|
+
validateConfig(config) {
|
|
3270
|
+
const errors = [];
|
|
3271
|
+
if (config.defaultMode && !this.validModes.includes(config.defaultMode)) {
|
|
3272
|
+
errors.push({ field: "defaultMode", message: `Invalid mode. Must be one of: ${this.validModes.join(", ")}` });
|
|
3273
|
+
}
|
|
3274
|
+
if (config.defaultLimit !== void 0) {
|
|
3275
|
+
if (config.defaultLimit < 1 || config.defaultLimit > 100) {
|
|
3276
|
+
errors.push({ field: "defaultLimit", message: "Default limit must be between 1 and 100" });
|
|
3277
|
+
}
|
|
3278
|
+
}
|
|
3279
|
+
if (config.cacheTTL !== void 0 && config.cacheTTL < 0) {
|
|
3280
|
+
errors.push({ field: "cacheTTL", message: "Cache TTL cannot be negative" });
|
|
3281
|
+
}
|
|
3282
|
+
if (config.threshold !== void 0) {
|
|
3283
|
+
if (config.threshold < 0 || config.threshold > 1) {
|
|
3284
|
+
errors.push({ field: "threshold", message: "Threshold must be between 0 and 1" });
|
|
3285
|
+
}
|
|
3286
|
+
}
|
|
3287
|
+
if (config.entities) {
|
|
3288
|
+
Object.entries(config.entities).forEach(([entity, entityConfig]) => {
|
|
3289
|
+
const entityResult = this.validateEntityConfig(entity, entityConfig);
|
|
3290
|
+
entityResult.errors.forEach((err) => {
|
|
3291
|
+
errors.push({ field: `entities.${entity}.${err.field}`, message: err.message });
|
|
3292
|
+
});
|
|
3293
|
+
});
|
|
3294
|
+
}
|
|
3295
|
+
return { valid: errors.length === 0, errors };
|
|
3296
|
+
}
|
|
3297
|
+
};
|
|
3298
|
+
var SearchResource2 = class {
|
|
3299
|
+
constructor(client) {
|
|
3300
|
+
this.client = client;
|
|
3301
|
+
this.validator = new SearchConfigValidator();
|
|
3302
|
+
}
|
|
3303
|
+
/**
|
|
3304
|
+
* Search an entity
|
|
3305
|
+
*
|
|
3306
|
+
* @param entity - Entity/table name to search
|
|
3307
|
+
* @param options - Search options
|
|
3308
|
+
* @returns Search results with metadata
|
|
3309
|
+
*
|
|
3310
|
+
* @example
|
|
3311
|
+
* ```typescript
|
|
3312
|
+
* // Basic search
|
|
3313
|
+
* const results = await backflow.search.query('products', { q: 'laptop' });
|
|
3314
|
+
*
|
|
3315
|
+
* // Advanced search with all options
|
|
3316
|
+
* const results = await backflow.search.query('products', {
|
|
3317
|
+
* q: 'gaming laptop',
|
|
3318
|
+
* mode: 'hybrid', // 'exact' | 'fuzzy' | 'hybrid'
|
|
3319
|
+
* limit: 20, // max results
|
|
3320
|
+
* threshold: 0.7 // similarity threshold for fuzzy/hybrid
|
|
3321
|
+
* });
|
|
3322
|
+
*
|
|
3323
|
+
* // Access results
|
|
3324
|
+
* results.results.forEach(product => {
|
|
3325
|
+
* console.log(product.name, product._score); // _score for fuzzy results
|
|
3326
|
+
* });
|
|
3327
|
+
* ```
|
|
3328
|
+
*/
|
|
3329
|
+
async query(entity, options) {
|
|
3330
|
+
const validation = this.validator.validateSearchOptions(options);
|
|
3331
|
+
if (!validation.valid) {
|
|
3332
|
+
throw new Error(`Invalid search options: ${validation.errors.map((e) => e.message).join(", ")}`);
|
|
3333
|
+
}
|
|
3334
|
+
const params = { q: options.q };
|
|
3335
|
+
if (options.mode) params.mode = options.mode;
|
|
3336
|
+
if (options.limit) params.limit = options.limit;
|
|
3337
|
+
if (options.threshold) params.threshold = options.threshold;
|
|
3338
|
+
return this.client.get(`/search/${entity}`, params);
|
|
3339
|
+
}
|
|
3340
|
+
/**
|
|
3341
|
+
* Index entity records for vector search
|
|
3342
|
+
*
|
|
3343
|
+
* @param options - Index options
|
|
3344
|
+
* @returns Index result
|
|
3345
|
+
*
|
|
3346
|
+
* @example
|
|
3347
|
+
* ```typescript
|
|
3348
|
+
* // Index all products
|
|
3349
|
+
* const result = await backflow.search.index({ entity: 'products' });
|
|
3350
|
+
* console.log(`Indexed ${result.indexed} records in ${result.latency}ms`);
|
|
3351
|
+
*
|
|
3352
|
+
* // Index specific records
|
|
3353
|
+
* await backflow.search.index({
|
|
3354
|
+
* entity: 'products',
|
|
3355
|
+
* ids: ['prod_123', 'prod_456'],
|
|
3356
|
+
* batchSize: 50
|
|
3357
|
+
* });
|
|
3358
|
+
* ```
|
|
3359
|
+
*/
|
|
3360
|
+
async index(options) {
|
|
3361
|
+
return this.client.post("/search/index", options);
|
|
3362
|
+
}
|
|
3363
|
+
/**
|
|
3364
|
+
* Delete and reindex all records for an entity
|
|
3365
|
+
*
|
|
3366
|
+
* @param options - Reindex options
|
|
3367
|
+
* @returns Reindex result
|
|
3368
|
+
*
|
|
3369
|
+
* @example
|
|
3370
|
+
* ```typescript
|
|
3371
|
+
* // Reindex all products
|
|
3372
|
+
* const result = await backflow.search.reindex({ entity: 'products' });
|
|
3373
|
+
* console.log(`Deleted ${result.deleted}, indexed ${result.indexed}`);
|
|
3374
|
+
* ```
|
|
3375
|
+
*/
|
|
3376
|
+
async reindex(options) {
|
|
3377
|
+
return this.client.post("/search/reindex", options);
|
|
3378
|
+
}
|
|
3379
|
+
/**
|
|
3380
|
+
* Delete all indexed records for an entity
|
|
3381
|
+
*
|
|
3382
|
+
* @param entity - Entity name
|
|
3383
|
+
* @returns Delete result
|
|
3384
|
+
*
|
|
3385
|
+
* @example
|
|
3386
|
+
* ```typescript
|
|
3387
|
+
* await backflow.search.delete('products');
|
|
3388
|
+
* ```
|
|
3389
|
+
*/
|
|
3390
|
+
async delete(entity) {
|
|
3391
|
+
return this.client.delete(`/search/index/${entity}`);
|
|
3392
|
+
}
|
|
3393
|
+
/**
|
|
3394
|
+
* Get search statistics
|
|
3395
|
+
*
|
|
3396
|
+
* @returns Search configuration stats
|
|
3397
|
+
*
|
|
3398
|
+
* @example
|
|
3399
|
+
* ```typescript
|
|
3400
|
+
* const stats = await backflow.search.stats();
|
|
3401
|
+
* console.log('Configured entities:', stats.configuredEntities);
|
|
3402
|
+
* console.log('Default mode:', stats.defaultMode);
|
|
3403
|
+
* ```
|
|
3404
|
+
*/
|
|
3405
|
+
async stats() {
|
|
3406
|
+
return this.client.get("/search/stats");
|
|
3407
|
+
}
|
|
3408
|
+
};
|
|
3409
|
+
|
|
3410
|
+
// src/sdk.ts
|
|
3411
|
+
var IntegrationsResource = class {
|
|
3412
|
+
constructor(client) {
|
|
3413
|
+
this.client = client;
|
|
3414
|
+
this.stripe = new StripeResource(client);
|
|
3415
|
+
this.polar = new PolarResource(client);
|
|
3416
|
+
}
|
|
3417
|
+
};
|
|
3418
|
+
var BackflowSDK = class {
|
|
3419
|
+
constructor(config) {
|
|
3420
|
+
this.client = new BackflowClient(config);
|
|
3421
|
+
this.agentAnalysis = new AgentAnalysisResource(this.client);
|
|
3422
|
+
this.apikeys = new ApiKeysResource(this.client);
|
|
3423
|
+
this.apps = new AppsResource(this.client);
|
|
3424
|
+
this.assets = new AssetsResource(this.client);
|
|
3425
|
+
this.authentication = new AuthenticationResource(this.client);
|
|
3426
|
+
this.billing = new BillingResource(this.client);
|
|
3427
|
+
this.cache = new CacheResource(this.client);
|
|
3428
|
+
this.config = new ConfigResource(this.client);
|
|
3429
|
+
this.default = new DefaultResource(this.client);
|
|
3430
|
+
this.deployment = new DeploymentResource(this.client);
|
|
3431
|
+
this.domains = new DomainsResource(this.client);
|
|
3432
|
+
this.feedback = new FeedbackResource(this.client);
|
|
3433
|
+
this.goals = new GoalsResource(this.client);
|
|
3434
|
+
this.googleDrive = new GoogleDriveResource(this.client);
|
|
3435
|
+
this.jira = new JiraResource(this.client);
|
|
3436
|
+
this.llm = new LlmResource(this.client);
|
|
3437
|
+
this.mcptools = new McpToolsResource(this.client);
|
|
3438
|
+
this.mfa = new MfaResource(this.client);
|
|
3439
|
+
this.migration = new MigrationResource(this.client);
|
|
3440
|
+
this.projects = new ProjectsResource(this.client);
|
|
3441
|
+
this.publish = new PublishResource(this.client);
|
|
3442
|
+
this.secrets = new SecretsResource(this.client);
|
|
3443
|
+
this.system = new SystemResource(this.client);
|
|
3444
|
+
this.teams = new TeamsResource(this.client);
|
|
3445
|
+
this.tenantIntegrations = new TenantIntegrationsResource(this.client);
|
|
3446
|
+
this.tenantJobs = new TenantJobsResource(this.client);
|
|
3447
|
+
this.tenantLimits = new TenantLimitsResource(this.client);
|
|
3448
|
+
this.tenantRbac = new TenantRbacResource(this.client);
|
|
3449
|
+
this.tenantWebhookReceivers = new TenantWebhookReceiversResource(this.client);
|
|
3450
|
+
this.tenantWebhooks = new TenantWebhooksResource(this.client);
|
|
3451
|
+
this.tenantWorkflows = new TenantWorkflowsResource(this.client);
|
|
3452
|
+
this.tooldiscovery = new ToolDiscoveryResource(this.client);
|
|
3453
|
+
this.tracking = new TrackingResource(this.client);
|
|
3454
|
+
this.twitter = new TwitterResource(this.client);
|
|
3455
|
+
this.users = new UsersResource(this.client);
|
|
3456
|
+
this.websocket = new WebsocketResource(this.client);
|
|
3457
|
+
this.workspaces = new WorkspacesResource(this.client);
|
|
3458
|
+
this.integrations = new IntegrationsResource(this.client);
|
|
3459
|
+
this.files = new FilesResource2(this.client);
|
|
3460
|
+
this.workflows = new WorkflowsResource2(this.client);
|
|
3461
|
+
this.tenant = new TenantResource(this.client);
|
|
3462
|
+
this.embeddings = new EmbeddingsResource2(this.client);
|
|
3463
|
+
this.usage = new UsageResource2(this.client);
|
|
3464
|
+
this.analytics = new AnalyticsResource2(this.client);
|
|
3465
|
+
this.github = new GithubResource2(this.client);
|
|
3466
|
+
this.queues = new QueuesResource2(this.client);
|
|
3467
|
+
this.search = new SearchResource2(this.client);
|
|
3468
|
+
this.ai = new AIResource(this.client);
|
|
3469
|
+
this.collaboration = new CollaborationResource(this.client);
|
|
3470
|
+
this.webhooks = (projectId) => new WebhooksFactory(this.client).for(projectId);
|
|
3471
|
+
this.exports = new ExportsResource(this.client);
|
|
3472
|
+
this.user = new UserResource(this.client);
|
|
3473
|
+
this.entities = new EntitiesResource(this.client);
|
|
3474
|
+
}
|
|
3475
|
+
get endpoint() {
|
|
3476
|
+
return this.client.endpoint;
|
|
3477
|
+
}
|
|
3478
|
+
get(path, params) {
|
|
3479
|
+
return this.client.get(path, params);
|
|
3480
|
+
}
|
|
3481
|
+
post(path, data, params) {
|
|
3482
|
+
return this.client.post(path, data, params);
|
|
3483
|
+
}
|
|
3484
|
+
put(path, data, params) {
|
|
3485
|
+
return this.client.put(path, data, params);
|
|
3486
|
+
}
|
|
3487
|
+
patch(path, data, params) {
|
|
3488
|
+
return this.client.patch(path, data, params);
|
|
3489
|
+
}
|
|
3490
|
+
delete(path, params) {
|
|
3491
|
+
return this.client.delete(path, params);
|
|
3492
|
+
}
|
|
3493
|
+
};
|
|
3494
|
+
function createBackflow(config) {
|
|
3495
|
+
return new BackflowSDK(config);
|
|
3496
|
+
}
|
|
3497
|
+
export {
|
|
3498
|
+
AgentAnalysisResource,
|
|
3499
|
+
AnalyticsResource,
|
|
3500
|
+
ApiKeysResource,
|
|
3501
|
+
AppsResource,
|
|
3502
|
+
AssetsResource,
|
|
3503
|
+
AuthenticationResource,
|
|
3504
|
+
BackflowSDK as Backflow,
|
|
3505
|
+
BackflowClient,
|
|
3506
|
+
BackflowSDK,
|
|
3507
|
+
BillingResource,
|
|
3508
|
+
CACHE_OPERATIONS,
|
|
3509
|
+
CHUNKING_STRATEGIES,
|
|
3510
|
+
CLI_PROVIDERS,
|
|
3511
|
+
CONDITION_OPERATORS,
|
|
3512
|
+
CacheResource,
|
|
3513
|
+
ConfigResource,
|
|
3514
|
+
DB_OPERATIONS,
|
|
3515
|
+
DB_PROVIDERS,
|
|
3516
|
+
DefaultResource,
|
|
3517
|
+
DeploymentResource,
|
|
3518
|
+
DomainsResource,
|
|
3519
|
+
EmbeddingsResource,
|
|
3520
|
+
FeedbackResource,
|
|
3521
|
+
FilesResource,
|
|
3522
|
+
GithubResource,
|
|
3523
|
+
GoalsResource,
|
|
3524
|
+
GoogleDriveResource,
|
|
3525
|
+
HTTP_METHODS,
|
|
3526
|
+
IMAGE_DETAILS,
|
|
3527
|
+
JiraResource,
|
|
3528
|
+
LLM_PROVIDERS,
|
|
3529
|
+
LlmResource,
|
|
3530
|
+
McpToolsResource,
|
|
3531
|
+
MfaResource,
|
|
3532
|
+
MigrationResource,
|
|
3533
|
+
NOTIFY_CHANNELS,
|
|
3534
|
+
NOTIFY_PRIORITIES,
|
|
3535
|
+
PolarResource,
|
|
3536
|
+
ProjectsResource,
|
|
3537
|
+
PublishResource,
|
|
3538
|
+
QueuesResource,
|
|
3539
|
+
RAG_MODES,
|
|
3540
|
+
STORAGE_OPERATIONS,
|
|
3541
|
+
SearchResource,
|
|
3542
|
+
SecretsResource,
|
|
3543
|
+
StripeResource,
|
|
3544
|
+
SystemResource,
|
|
3545
|
+
TOOL_PARAM_CONTEXT,
|
|
3546
|
+
TOOL_TYPES,
|
|
3547
|
+
TRIGGER_TYPES,
|
|
3548
|
+
TeamsResource,
|
|
3549
|
+
TenantIntegrationsResource,
|
|
3550
|
+
TenantJobsResource,
|
|
3551
|
+
TenantLimitsResource,
|
|
3552
|
+
TenantRbacResource,
|
|
3553
|
+
TenantWebhookReceiversResource,
|
|
3554
|
+
TenantWebhooksResource,
|
|
3555
|
+
TenantWorkflowsResource,
|
|
3556
|
+
ToolDiscoveryResource,
|
|
3557
|
+
TrackingResource,
|
|
3558
|
+
TwitterResource,
|
|
3559
|
+
UsageResource,
|
|
3560
|
+
UsersResource,
|
|
3561
|
+
WORKFLOW_VALIDATION_SCHEMA,
|
|
3562
|
+
WebsocketResource,
|
|
3563
|
+
WorkflowsResource,
|
|
3564
|
+
WorkspacesResource,
|
|
3565
|
+
createBackflow,
|
|
3566
|
+
toCompactContext,
|
|
3567
|
+
toPromptContext
|
|
3568
|
+
};
|