@ecodrix/erix-api 2.1.5 → 3.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/dist/cli.js +8 -8
- package/dist/ts/cjs/index.cjs +1 -1
- package/dist/ts/esm/index.d.ts +866 -3197
- package/dist/ts/esm/index.js +1 -1
- package/package.json +4 -3
package/dist/ts/esm/index.d.ts
CHANGED
|
@@ -256,235 +256,6 @@ declare class Analytics extends APIResource {
|
|
|
256
256
|
retention<T = any>(): Promise<T>;
|
|
257
257
|
}
|
|
258
258
|
|
|
259
|
-
declare class AutomationDashboard extends APIResource {
|
|
260
|
-
/**
|
|
261
|
-
* Retrieve summary statistics for automation health (total, success, failed).
|
|
262
|
-
*
|
|
263
|
-
* @returns Stats object.
|
|
264
|
-
* @example
|
|
265
|
-
* ```typescript
|
|
266
|
-
* const stats = await erixClient.crm.automationDashboard.stats();
|
|
267
|
-
* ```
|
|
268
|
-
*/
|
|
269
|
-
stats<T = any>(): Promise<T>;
|
|
270
|
-
/**
|
|
271
|
-
* List recent EventLog entries representing automation executions.
|
|
272
|
-
*
|
|
273
|
-
* @param params - Optional filters (limit, status).
|
|
274
|
-
* @example
|
|
275
|
-
* ```typescript
|
|
276
|
-
* const logs = await erixClient.crm.automationDashboard.logs({ status: "failed" });
|
|
277
|
-
* ```
|
|
278
|
-
*/
|
|
279
|
-
logs<T = any>(params?: {
|
|
280
|
-
limit?: number;
|
|
281
|
-
status?: string;
|
|
282
|
-
}): Promise<T>;
|
|
283
|
-
/**
|
|
284
|
-
* Re-emit a failed event log to re-trigger its associated automation rules.
|
|
285
|
-
*
|
|
286
|
-
* @param logId - The unique ID of the failed event log.
|
|
287
|
-
* @example
|
|
288
|
-
* ```typescript
|
|
289
|
-
* await erixClient.crm.automationDashboard.retryFailedEvent("log_123");
|
|
290
|
-
* ```
|
|
291
|
-
*/
|
|
292
|
-
retryFailedEvent<T = any>(logId: string): Promise<T>;
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
interface AutomationRulePayload {
|
|
296
|
-
name: string;
|
|
297
|
-
trigger: string;
|
|
298
|
-
isActive?: boolean;
|
|
299
|
-
nodes: any[];
|
|
300
|
-
edges: any[];
|
|
301
|
-
}
|
|
302
|
-
declare class Automations extends APIResource {
|
|
303
|
-
/**
|
|
304
|
-
* List all automation rules (workflows) configured for the tenant.
|
|
305
|
-
*
|
|
306
|
-
* @returns Array of automation rule objects.
|
|
307
|
-
* @example
|
|
308
|
-
* ```typescript
|
|
309
|
-
* const rules = await erixClient.crm.automations.list();
|
|
310
|
-
* ```
|
|
311
|
-
*/
|
|
312
|
-
list<T = any>(): Promise<T>;
|
|
313
|
-
/**
|
|
314
|
-
* Create a new automation rule with triggers and workflow nodes.
|
|
315
|
-
*
|
|
316
|
-
* @param payload - The automation rule definition (trigger, nodes, edges).
|
|
317
|
-
* @returns The created automation rule.
|
|
318
|
-
* @example
|
|
319
|
-
* ```typescript
|
|
320
|
-
* await erixClient.crm.automations.create({
|
|
321
|
-
* name: "Welcome Email Workflow",
|
|
322
|
-
* trigger: "contact_created",
|
|
323
|
-
* nodes: [...],
|
|
324
|
-
* edges: [...]
|
|
325
|
-
* });
|
|
326
|
-
* ```
|
|
327
|
-
*/
|
|
328
|
-
create<T = any>(payload: AutomationRulePayload): Promise<T>;
|
|
329
|
-
/**
|
|
330
|
-
* Update an existing automation rule.
|
|
331
|
-
*/
|
|
332
|
-
update<T = any>(ruleId: string, payload: Partial<AutomationRulePayload>): Promise<T>;
|
|
333
|
-
/**
|
|
334
|
-
* Enable or disable an automation rule.
|
|
335
|
-
*/
|
|
336
|
-
toggle<T = any>(ruleId: string): Promise<T>;
|
|
337
|
-
/**
|
|
338
|
-
* Delete an automation rule.
|
|
339
|
-
*/
|
|
340
|
-
delete<T = any>(ruleId: string): Promise<unknown>;
|
|
341
|
-
/**
|
|
342
|
-
* Bulk delete rules.
|
|
343
|
-
*/
|
|
344
|
-
bulkDelete<T = any>(ruleIds: string[]): Promise<T>;
|
|
345
|
-
/**
|
|
346
|
-
* Dry-run test an automation rule against a specific lead to verify logic.
|
|
347
|
-
*
|
|
348
|
-
* @param ruleId - The ID of the rule to test.
|
|
349
|
-
* @param leadId - The ID of the lead to run the test against.
|
|
350
|
-
* @example
|
|
351
|
-
* ```typescript
|
|
352
|
-
* await erixClient.crm.automations.test("rule_123", "lead_456");
|
|
353
|
-
* ```
|
|
354
|
-
*/
|
|
355
|
-
test<T = any>(ruleId: string, leadId: string): Promise<T>;
|
|
356
|
-
/**
|
|
357
|
-
* Get available event triggers for automations.
|
|
358
|
-
*/
|
|
359
|
-
getAvailableEvents<T = any>(): Promise<T>;
|
|
360
|
-
/**
|
|
361
|
-
* List enrollments for a rule.
|
|
362
|
-
*/
|
|
363
|
-
enrollments<T = any>(ruleId: string, params?: {
|
|
364
|
-
status?: string;
|
|
365
|
-
page?: number;
|
|
366
|
-
limit?: number;
|
|
367
|
-
startDate?: string;
|
|
368
|
-
endDate?: string;
|
|
369
|
-
}): Promise<T>;
|
|
370
|
-
/**
|
|
371
|
-
* Get an enrollment detail.
|
|
372
|
-
*/
|
|
373
|
-
getEnrollment<T = any>(enrollmentId: string): Promise<T>;
|
|
374
|
-
/**
|
|
375
|
-
* Pause an enrollment.
|
|
376
|
-
*/
|
|
377
|
-
pauseEnrollment<T = any>(ruleId: string, enrollmentId: string): Promise<T>;
|
|
378
|
-
/**
|
|
379
|
-
* Resume an enrollment.
|
|
380
|
-
*/
|
|
381
|
-
resumeEnrollment<T = any>(ruleId: string, enrollmentId: string): Promise<T>;
|
|
382
|
-
/**
|
|
383
|
-
* List workflow runs.
|
|
384
|
-
*/
|
|
385
|
-
runs<T = any>(ruleId: string): Promise<T>;
|
|
386
|
-
/**
|
|
387
|
-
* Get run details.
|
|
388
|
-
*/
|
|
389
|
-
getRun<T = any>(runId: string): Promise<T>;
|
|
390
|
-
/**
|
|
391
|
-
* Resume a paused run.
|
|
392
|
-
*/
|
|
393
|
-
resumeRun<T = any>(runId: string): Promise<T>;
|
|
394
|
-
/**
|
|
395
|
-
* Abort a running workflow.
|
|
396
|
-
*/
|
|
397
|
-
abortRun<T = any>(runId: string): Promise<T>;
|
|
398
|
-
/**
|
|
399
|
-
* Emit an external webhook event to unlock a `wait_event` node inside a
|
|
400
|
-
* paused workflow run. Required when integrating third-party tools that
|
|
401
|
-
* need to resume a suspended automation.
|
|
402
|
-
*
|
|
403
|
-
* @param ruleId - The automation rule that contains the wait_event node.
|
|
404
|
-
* @param eventName - The event name that should match the node's condition.
|
|
405
|
-
* @param payload - Arbitrary data forwarded to the node context.
|
|
406
|
-
*/
|
|
407
|
-
webhookEvent<T = any>(ruleId: string, eventName: string, payload?: any): Promise<T>;
|
|
408
|
-
/**
|
|
409
|
-
* Fire a CRM automation trigger for a given phone number.
|
|
410
|
-
*
|
|
411
|
-
* @param params - Trigger payload (trigger name, phone, variables, etc.)
|
|
412
|
-
*/
|
|
413
|
-
trigger<T = any>(params: {
|
|
414
|
-
trigger: string;
|
|
415
|
-
phone: string;
|
|
416
|
-
email?: string;
|
|
417
|
-
variables?: Record<string, string>;
|
|
418
|
-
createLeadIfMissing?: boolean;
|
|
419
|
-
leadData?: any;
|
|
420
|
-
delayMinutes?: number;
|
|
421
|
-
runAt?: Date | string;
|
|
422
|
-
}): Promise<T>;
|
|
423
|
-
}
|
|
424
|
-
|
|
425
|
-
/**
|
|
426
|
-
* CRM Campaigns — broadcast campaigns with A/B testing.
|
|
427
|
-
*
|
|
428
|
-
* @example
|
|
429
|
-
* ```typescript
|
|
430
|
-
* const campaigns = await ecod.crm.campaigns.list();
|
|
431
|
-
* const analytics = await ecod.crm.campaigns.analytics("campaign-id");
|
|
432
|
-
* const ab = await ecod.crm.campaigns.createAB({ channel: "email", ... });
|
|
433
|
-
* ```
|
|
434
|
-
*/
|
|
435
|
-
declare class CRMCampaigns extends APIResource {
|
|
436
|
-
/**
|
|
437
|
-
* List campaigns with metrics.
|
|
438
|
-
*/
|
|
439
|
-
list<T = any>(params?: {
|
|
440
|
-
status?: string;
|
|
441
|
-
startDate?: string;
|
|
442
|
-
endDate?: string;
|
|
443
|
-
page?: number;
|
|
444
|
-
limit?: number;
|
|
445
|
-
}): Promise<T>;
|
|
446
|
-
/**
|
|
447
|
-
* Get analytics for a specific campaign.
|
|
448
|
-
*/
|
|
449
|
-
analytics<T = any>(campaignId: string): Promise<T>;
|
|
450
|
-
/**
|
|
451
|
-
* Create and send a campaign.
|
|
452
|
-
*/
|
|
453
|
-
create<T = any>(payload: {
|
|
454
|
-
channel: "email" | "whatsapp";
|
|
455
|
-
recipients: Array<string | {
|
|
456
|
-
email?: string;
|
|
457
|
-
phone?: string;
|
|
458
|
-
name?: string;
|
|
459
|
-
}>;
|
|
460
|
-
subject?: string;
|
|
461
|
-
html?: string;
|
|
462
|
-
templateName?: string;
|
|
463
|
-
languageCode?: string;
|
|
464
|
-
variables?: Record<string, unknown>;
|
|
465
|
-
}): Promise<T>;
|
|
466
|
-
/**
|
|
467
|
-
* Create an A/B split test campaign.
|
|
468
|
-
*/
|
|
469
|
-
createAB<T = any>(payload: {
|
|
470
|
-
channel: "email" | "whatsapp";
|
|
471
|
-
recipients: Array<string | {
|
|
472
|
-
email?: string;
|
|
473
|
-
phone?: string;
|
|
474
|
-
name?: string;
|
|
475
|
-
}>;
|
|
476
|
-
variants: Array<{
|
|
477
|
-
name: string;
|
|
478
|
-
subject?: string;
|
|
479
|
-
html?: string;
|
|
480
|
-
templateName?: string;
|
|
481
|
-
}>;
|
|
482
|
-
testPercent?: number;
|
|
483
|
-
waitHours?: number;
|
|
484
|
-
winnerMetric?: "open" | "click" | "reply" | "delivered";
|
|
485
|
-
}): Promise<T>;
|
|
486
|
-
}
|
|
487
|
-
|
|
488
259
|
/**
|
|
489
260
|
* CRM Documents — document checklist management per lead.
|
|
490
261
|
*
|
|
@@ -692,6 +463,10 @@ interface Lead {
|
|
|
692
463
|
};
|
|
693
464
|
score?: number;
|
|
694
465
|
lastContactedAt?: string;
|
|
466
|
+
/** When to get back to this contact (ISO), or null. */
|
|
467
|
+
nextFollowUpAt?: string | null;
|
|
468
|
+
/** Why — shown with the follow-up. */
|
|
469
|
+
nextFollowUpNote?: string | null;
|
|
695
470
|
createdAt: string;
|
|
696
471
|
updatedAt: string;
|
|
697
472
|
metadata?: Record<string, unknown>;
|
|
@@ -768,6 +543,14 @@ interface UpsertLeadParams {
|
|
|
768
543
|
phone: string;
|
|
769
544
|
name?: string;
|
|
770
545
|
};
|
|
546
|
+
/**
|
|
547
|
+
* Generic, tenant-agnostic cross-reference map ({ refKey: refValue }) the
|
|
548
|
+
* caller controls — e.g. `{ orderId: "..." }`, `{ appointmentId: "..." }`,
|
|
549
|
+
* or any custom key. Merged into the lead's `metadata.refs`. Preferred over
|
|
550
|
+
* the deprecated `moduleInfo`.
|
|
551
|
+
*/
|
|
552
|
+
refs?: Record<string, string>;
|
|
553
|
+
/** @deprecated Use `refs` instead. Retained for backward compatibility. */
|
|
771
554
|
moduleInfo?: any;
|
|
772
555
|
trigger?: string;
|
|
773
556
|
pipelineId?: string;
|
|
@@ -928,6 +711,14 @@ declare class Leads extends APIResource {
|
|
|
928
711
|
* ```
|
|
929
712
|
*/
|
|
930
713
|
update<T = any>(leadId: string, params: Partial<CreateLeadParams>): Promise<T>;
|
|
714
|
+
/**
|
|
715
|
+
* Set the contact's next follow-up (replaces any earlier one), or clear it
|
|
716
|
+
* with `at: null`. When it comes due, `lead.follow_up_due` fires and the
|
|
717
|
+
* morning briefing counts it.
|
|
718
|
+
*
|
|
719
|
+
* @param at - ISO time with offset, e.g. "2026-10-20T15:00:00+05:30".
|
|
720
|
+
*/
|
|
721
|
+
setFollowUp<T = any>(leadId: string, at: string | null, note?: string): Promise<T>;
|
|
931
722
|
/**
|
|
932
723
|
* Move a lead to a new stage in a pipeline.
|
|
933
724
|
*
|
|
@@ -1049,9 +840,10 @@ declare class Leads extends APIResource {
|
|
|
1049
840
|
*/
|
|
1050
841
|
meetings<T = any>(leadId: string): Promise<T>;
|
|
1051
842
|
/**
|
|
1052
|
-
* List
|
|
843
|
+
* List automation history for this lead as Flow runs. Flow is the automation
|
|
844
|
+
* engine — this returns the workflow runs triggered for the lead.
|
|
1053
845
|
*/
|
|
1054
|
-
|
|
846
|
+
flowRuns<T = any>(leadId: string): Promise<T>;
|
|
1055
847
|
/**
|
|
1056
848
|
* Merge two duplicate leads. Primary survives, secondary's data is merged in
|
|
1057
849
|
* (conversations, activities, tags) and the secondary is deleted.
|
|
@@ -1083,6 +875,8 @@ declare class Payments extends APIResource {
|
|
|
1083
875
|
currency?: string;
|
|
1084
876
|
description?: string;
|
|
1085
877
|
appointmentId?: string;
|
|
878
|
+
/** Your reference for this payment; a retry with the same id is counted once. */
|
|
879
|
+
orderId?: string;
|
|
1086
880
|
}): Promise<T>;
|
|
1087
881
|
}
|
|
1088
882
|
|
|
@@ -1301,516 +1095,116 @@ declare class Scoring extends APIResource {
|
|
|
1301
1095
|
preview<T = any>(leadId: string): Promise<T>;
|
|
1302
1096
|
}
|
|
1303
1097
|
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
*
|
|
1308
|
-
* @param payload - Enrollment details (leadId, ruleId, and custom variables).
|
|
1309
|
-
* @example
|
|
1310
|
-
* ```typescript
|
|
1311
|
-
* await erixClient.crm.sequences.enroll({
|
|
1312
|
-
* leadId: "lead_123",
|
|
1313
|
-
* ruleId: "rule_456",
|
|
1314
|
-
* variables: { start_date: "2026-05-01" }
|
|
1315
|
-
* });
|
|
1316
|
-
* ```
|
|
1317
|
-
*/
|
|
1318
|
-
enroll<T = any>(payload: {
|
|
1319
|
-
leadId: string;
|
|
1320
|
-
ruleId: string;
|
|
1321
|
-
variables?: Record<string, any>;
|
|
1322
|
-
}): Promise<T>;
|
|
1323
|
-
/**
|
|
1324
|
-
* Unenroll a lead from a currently running automation sequence.
|
|
1325
|
-
*
|
|
1326
|
-
* @param enrollmentId - The unique ID of the sequence enrollment.
|
|
1327
|
-
* @example
|
|
1328
|
-
* ```typescript
|
|
1329
|
-
* await erixClient.crm.sequences.unenroll("enroll_123");
|
|
1330
|
-
* ```
|
|
1331
|
-
*/
|
|
1332
|
-
unenroll<T = any>(enrollmentId: string): Promise<unknown>;
|
|
1333
|
-
/**
|
|
1334
|
-
* List all active and completed sequence enrollments for a specific lead.
|
|
1335
|
-
*
|
|
1336
|
-
* @param leadId - The unique ID of the lead.
|
|
1337
|
-
* @returns Array of enrollment records.
|
|
1338
|
-
* @example
|
|
1339
|
-
* ```typescript
|
|
1340
|
-
* const enrollments = await erixClient.crm.sequences.listForLead("lead_123");
|
|
1341
|
-
* ```
|
|
1342
|
-
*/
|
|
1343
|
-
listForLead<T = any>(leadId: string): Promise<T>;
|
|
1344
|
-
}
|
|
1345
|
-
|
|
1346
|
-
/**
|
|
1347
|
-
* Broadcast campaign entity returned by `/product/erix/chat/broadcasts`.
|
|
1348
|
-
*
|
|
1349
|
-
* Tracks the lifecycle of a bulk WhatsApp send and its delivery counters.
|
|
1350
|
-
*/
|
|
1351
|
-
interface Broadcast {
|
|
1352
|
-
_id: string;
|
|
1353
|
-
name: string;
|
|
1354
|
-
templateName: string;
|
|
1355
|
-
status: "draft" | "scheduled" | "sending" | "completed" | "failed";
|
|
1356
|
-
recipientCount: number;
|
|
1357
|
-
sentCount: number;
|
|
1358
|
-
deliveredCount: number;
|
|
1359
|
-
readCount: number;
|
|
1360
|
-
createdAt: string;
|
|
1361
|
-
scheduledAt?: string;
|
|
1362
|
-
completedAt?: string;
|
|
1363
|
-
}
|
|
1364
|
-
interface CreateBroadcastParams {
|
|
1365
|
-
/** Optional name for the broadcast campaign */
|
|
1366
|
-
name?: string;
|
|
1367
|
-
/** Name of the Meta template to send */
|
|
1368
|
-
templateName: string;
|
|
1369
|
-
/** Language code (defaults to en_US) */
|
|
1370
|
-
templateLanguage?: string;
|
|
1371
|
-
/** List of recipients with their phone numbers and variable overrides */
|
|
1372
|
-
recipients: {
|
|
1373
|
-
phone: string;
|
|
1374
|
-
variables?: string[];
|
|
1375
|
-
}[];
|
|
1376
|
-
}
|
|
1377
|
-
declare class Broadcasts extends APIResource {
|
|
1378
|
-
/**
|
|
1379
|
-
* List past and active WhatsApp broadcast campaigns.
|
|
1380
|
-
*
|
|
1381
|
-
* @param params - Optional filter parameters (page, limit, status).
|
|
1382
|
-
* @returns Paginated list of broadcast records.
|
|
1383
|
-
* @example
|
|
1384
|
-
* ```typescript
|
|
1385
|
-
* const broadcasts = await erixClient.whatsapp.broadcasts.list({ limit: 10 });
|
|
1386
|
-
* ```
|
|
1387
|
-
*/
|
|
1388
|
-
list<T = any>(params?: Record<string, any>): Promise<T>;
|
|
1389
|
-
/**
|
|
1390
|
-
* Retrieve full details and real-time stats for a specific broadcast campaign.
|
|
1391
|
-
*
|
|
1392
|
-
* @param id - The unique identifier of the broadcast.
|
|
1393
|
-
* @returns The broadcast record including sent/failed counts.
|
|
1394
|
-
* @example
|
|
1395
|
-
* ```typescript
|
|
1396
|
-
* const stats = await erixClient.whatsapp.broadcasts.retrieve("bc_123");
|
|
1397
|
-
* console.log(`Success Rate: ${(stats.sentCount / stats.totalRecipients) * 100}%`);
|
|
1398
|
-
* ```
|
|
1399
|
-
*/
|
|
1400
|
-
retrieve<T = any>(id: string): Promise<T>;
|
|
1401
|
-
/**
|
|
1402
|
-
* Create a new broadcast campaign to send template messages to multiple recipients.
|
|
1403
|
-
*
|
|
1404
|
-
* @param params - Broadcast configuration (name, templateName, recipients).
|
|
1405
|
-
* @returns The newly created broadcast record.
|
|
1406
|
-
* @example
|
|
1407
|
-
* ```typescript
|
|
1408
|
-
* await erixClient.whatsapp.broadcasts.create({
|
|
1409
|
-
* name: "Spring Sale",
|
|
1410
|
-
* templateName: "promo_code",
|
|
1411
|
-
* recipients: [
|
|
1412
|
-
* { phone: "+919876543210", variables: ["SAVE10"] }
|
|
1413
|
-
* ]
|
|
1414
|
-
* });
|
|
1415
|
-
* ```
|
|
1416
|
-
*/
|
|
1417
|
-
create<T = any>(params: CreateBroadcastParams): Promise<T>;
|
|
1418
|
-
/**
|
|
1419
|
-
* Update broadcast metadata, such as its name or administrative status.
|
|
1420
|
-
*
|
|
1421
|
-
* @param id - The unique ID of the broadcast.
|
|
1422
|
-
* @param data - The fields to update (name, status).
|
|
1423
|
-
* @example
|
|
1424
|
-
* ```typescript
|
|
1425
|
-
* await erixClient.whatsapp.broadcasts.update("bc_123", { name: "Revised Spring Sale" });
|
|
1426
|
-
* ```
|
|
1427
|
-
*/
|
|
1428
|
-
update<T = any>(id: string, data: {
|
|
1429
|
-
name?: string;
|
|
1430
|
-
status?: string;
|
|
1431
|
-
}): Promise<T>;
|
|
1432
|
-
/**
|
|
1433
|
-
* Delete a broadcast campaign record.
|
|
1434
|
-
* Note: This does not cancel messages already in flight but removes the record from the dashboard.
|
|
1435
|
-
*
|
|
1436
|
-
* @param id - The unique ID of the broadcast.
|
|
1437
|
-
* @example
|
|
1438
|
-
* ```typescript
|
|
1439
|
-
* await erixClient.whatsapp.broadcasts.delete("bc_123");
|
|
1440
|
-
* ```
|
|
1441
|
-
*/
|
|
1442
|
-
delete<T = any>(id: string): Promise<T>;
|
|
1443
|
-
}
|
|
1444
|
-
|
|
1445
|
-
/**
|
|
1446
|
-
* Conversation entity returned by `/product/erix/chat/conversations`.
|
|
1447
|
-
*
|
|
1448
|
-
* Represents a single WhatsApp thread between the workspace and an
|
|
1449
|
-
* external phone number. `status` is the conversation lifecycle (open
|
|
1450
|
-
* vs resolved) — distinct from `LeadStatus` on the linked lead.
|
|
1451
|
-
*/
|
|
1098
|
+
/** Channels the platform inbox carries. */
|
|
1099
|
+
type InboxChannel = "whatsapp" | "instagram" | "facebook" | "telegram" | "email" | "webchat";
|
|
1100
|
+
/** One inbox thread (any channel) — served by `/platform/inbox`. */
|
|
1452
1101
|
interface Conversation {
|
|
1453
|
-
|
|
1102
|
+
id: string;
|
|
1103
|
+
leadId: string | null;
|
|
1104
|
+
channel: InboxChannel;
|
|
1105
|
+
/** The contact's address on that channel (phone, IG id, chat id…). */
|
|
1454
1106
|
phone: string;
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
direction: "inbound" | "outbound";
|
|
1460
|
-
};
|
|
1107
|
+
userName: string | null;
|
|
1108
|
+
profilePicture: string | null;
|
|
1109
|
+
lastMessage: string | null;
|
|
1110
|
+
lastMessageAt: string | null;
|
|
1461
1111
|
unreadCount: number;
|
|
1462
|
-
status:
|
|
1463
|
-
|
|
1464
|
-
leadId?: string;
|
|
1465
|
-
updatedAt: string;
|
|
1112
|
+
status: string;
|
|
1113
|
+
updatedAt: string | null;
|
|
1466
1114
|
}
|
|
1467
1115
|
interface ListParams {
|
|
1468
|
-
|
|
1469
|
-
before?: string;
|
|
1470
|
-
after?: string;
|
|
1116
|
+
channel?: InboxChannel;
|
|
1471
1117
|
status?: string;
|
|
1118
|
+
search?: string;
|
|
1119
|
+
limit?: number;
|
|
1120
|
+
offset?: number;
|
|
1472
1121
|
}
|
|
1122
|
+
/**
|
|
1123
|
+
* The unified inbox (WhatsApp, Instagram, Facebook, Telegram, email, webchat)
|
|
1124
|
+
* — one set of threads for every channel.
|
|
1125
|
+
*/
|
|
1473
1126
|
declare class Conversations extends APIResource {
|
|
1474
|
-
/**
|
|
1475
|
-
* List conversations for the tenant.
|
|
1476
|
-
* @deprecated Use `list` method from `ErixClient` instead.
|
|
1477
|
-
* @param params - List parameters.
|
|
1478
|
-
* @returns List of conversations.
|
|
1479
|
-
* @example
|
|
1480
|
-
* ```typescript
|
|
1481
|
-
* import { ErixClient } from "erix-react";
|
|
1482
|
-
* const erixClient = new ErixClient({ apiKey: "YOUR_API_KEY" });
|
|
1483
|
-
* const conversations = await erixClient.whatsapp.conversations.list();
|
|
1484
|
-
* ```
|
|
1485
|
-
*/
|
|
1127
|
+
/** Threads, newest first. Response: `{ success, data, total }`. */
|
|
1486
1128
|
list<T = any>(params?: ListParams): Promise<T>;
|
|
1487
|
-
/**
|
|
1488
|
-
* Create a new conversation explicitly.
|
|
1489
|
-
*
|
|
1490
|
-
* @param params - Conversation details.
|
|
1491
|
-
* @example
|
|
1492
|
-
* ```typescript
|
|
1493
|
-
* const conversation = await erixClient.whatsapp.conversations.create({
|
|
1494
|
-
* phone: "+919876543210",
|
|
1495
|
-
* name: "John Doe"
|
|
1496
|
-
* });
|
|
1497
|
-
* ```
|
|
1498
|
-
*/
|
|
1129
|
+
/** Find or open the thread for a contact (defaults to WhatsApp). */
|
|
1499
1130
|
create<T = any>(params: {
|
|
1500
1131
|
phone: string;
|
|
1501
1132
|
name?: string;
|
|
1133
|
+
channel?: InboxChannel;
|
|
1502
1134
|
}): Promise<T>;
|
|
1503
|
-
/**
|
|
1504
|
-
|
|
1505
|
-
*
|
|
1506
|
-
* @param conversationId - The unique ID of the conversation.
|
|
1507
|
-
* @example
|
|
1508
|
-
* ```typescript
|
|
1509
|
-
* const conversation = await erixClient.whatsapp.conversations.retrieve("conv_123");
|
|
1510
|
-
* ```
|
|
1511
|
-
*/
|
|
1135
|
+
/** Link the thread to one of your CRM leads (e.g. after creating it). */
|
|
1136
|
+
linkLead<T = any>(conversationId: string, leadId: string): Promise<T>;
|
|
1512
1137
|
retrieve<T = any>(conversationId: string): Promise<T>;
|
|
1513
1138
|
/**
|
|
1514
|
-
*
|
|
1515
|
-
*
|
|
1516
|
-
* @param conversationId - The unique ID of the conversation.
|
|
1517
|
-
* @param params - Pagination and filter parameters.
|
|
1518
|
-
* @example
|
|
1519
|
-
* ```typescript
|
|
1520
|
-
* const messages = await erixClient.whatsapp.conversations.messages("conv_123", { limit: 50 });
|
|
1521
|
-
* ```
|
|
1522
|
-
*/
|
|
1523
|
-
messages<T = any>(conversationId: string, params?: ListParams): Promise<T>;
|
|
1524
|
-
/**
|
|
1525
|
-
* Link a conversation to a lead in the CRM.
|
|
1526
|
-
*
|
|
1527
|
-
* @param conversationId - The unique ID of the conversation.
|
|
1528
|
-
* @param leadId - The unique ID of the lead to link.
|
|
1529
|
-
* @param leadData - Optional additional lead metadata.
|
|
1530
|
-
* @example
|
|
1531
|
-
* ```typescript
|
|
1532
|
-
* await erixClient.whatsapp.conversations.linkLead("conv_123", "lead_456");
|
|
1533
|
-
* ```
|
|
1534
|
-
*/
|
|
1535
|
-
linkLead<T = any>(conversationId: string, leadId: string, leadData?: any): Promise<T>;
|
|
1536
|
-
/**
|
|
1537
|
-
* Mark a conversation as read (clear unread count).
|
|
1538
|
-
*
|
|
1539
|
-
* @param conversationId - The unique ID of the conversation.
|
|
1540
|
-
* @example
|
|
1541
|
-
* ```typescript
|
|
1542
|
-
* await erixClient.whatsapp.conversations.markRead("conv_123");
|
|
1543
|
-
* ```
|
|
1139
|
+
* Messages of a thread, newest page first. Page back with `before` = the
|
|
1140
|
+
* oldest message's `createdAt` you have. Response: `{ data, hasMore }`.
|
|
1544
1141
|
*/
|
|
1142
|
+
messages<T = any>(conversationId: string, params?: {
|
|
1143
|
+
limit?: number;
|
|
1144
|
+
before?: string;
|
|
1145
|
+
}): Promise<T>;
|
|
1545
1146
|
markRead<T = any>(conversationId: string): Promise<T>;
|
|
1546
|
-
/**
|
|
1547
|
-
* Delete a conversation.
|
|
1548
|
-
*
|
|
1549
|
-
* @param conversationId - The unique ID of the conversation.
|
|
1550
|
-
* @example
|
|
1551
|
-
* ```typescript
|
|
1552
|
-
* await erixClient.whatsapp.conversations.delete("conv_123");
|
|
1553
|
-
* ```
|
|
1554
|
-
*/
|
|
1555
1147
|
delete(conversationId: string): Promise<unknown>;
|
|
1556
|
-
/**
|
|
1557
|
-
* Bulk delete conversations.
|
|
1558
|
-
*
|
|
1559
|
-
* @param ids - Array of conversation IDs to delete.
|
|
1560
|
-
* @example
|
|
1561
|
-
* ```typescript
|
|
1562
|
-
* await erixClient.whatsapp.conversations.bulkDelete(["conv_1", "conv_2"]);
|
|
1563
|
-
* ```
|
|
1564
|
-
*/
|
|
1148
|
+
/** Delete 1–100 threads. */
|
|
1565
1149
|
bulkDelete<T = any>(ids: string[]): Promise<T>;
|
|
1566
1150
|
}
|
|
1567
1151
|
|
|
1568
|
-
/**
|
|
1569
|
-
* A single chat message inside a `Conversation`.
|
|
1570
|
-
*/
|
|
1152
|
+
/** One inbox message (any channel). */
|
|
1571
1153
|
interface Message {
|
|
1572
|
-
|
|
1154
|
+
id: string;
|
|
1573
1155
|
conversationId: string;
|
|
1574
|
-
body?: string;
|
|
1575
|
-
mediaUrl?: string;
|
|
1576
|
-
mediaType?: "image" | "video" | "audio" | "document";
|
|
1577
1156
|
direction: "inbound" | "outbound";
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1157
|
+
messageType: string;
|
|
1158
|
+
text: string | null;
|
|
1159
|
+
mediaUrl: string | null;
|
|
1160
|
+
mediaType: string | null;
|
|
1161
|
+
caption: string | null;
|
|
1162
|
+
status: string;
|
|
1163
|
+
isStarred: boolean;
|
|
1164
|
+
createdAt?: string;
|
|
1165
|
+
}
|
|
1166
|
+
/** A file already uploaded to YOUR tenant storage (see {@link Messages.upload}). */
|
|
1167
|
+
interface OutboundMedia {
|
|
1168
|
+
key: string;
|
|
1169
|
+
mimeType: string;
|
|
1170
|
+
fileName?: string;
|
|
1581
1171
|
}
|
|
1582
|
-
/**
|
|
1583
|
-
* Parameters for sending a free-form WhatsApp message.
|
|
1584
|
-
*/
|
|
1585
1172
|
interface SendMessageParams {
|
|
1586
|
-
/**
|
|
1587
|
-
* Recipient's phone number in E.164 format.
|
|
1588
|
-
* @example "+919876543210"
|
|
1589
|
-
*/
|
|
1590
|
-
to?: string;
|
|
1591
|
-
/**
|
|
1592
|
-
* The unique ID of the conversation. If supplied, `to` is resolved automatically.
|
|
1593
|
-
*/
|
|
1173
|
+
/** Reply in an existing inbox thread (any channel). */
|
|
1594
1174
|
conversationId?: string;
|
|
1595
|
-
/**
|
|
1175
|
+
/** …or message a WhatsApp number directly (free text needs an open 24h window). */
|
|
1176
|
+
to?: string;
|
|
1596
1177
|
text?: string;
|
|
1597
|
-
/**
|
|
1598
|
-
|
|
1599
|
-
/** MIME category of the media. */
|
|
1600
|
-
mediaType?: "image" | "video" | "audio" | "document";
|
|
1601
|
-
/** The `messageId` of the message to reply to (quoted replies). */
|
|
1602
|
-
replyToId?: string;
|
|
1603
|
-
/** Filename shown to the recipient (required for `document` type). */
|
|
1604
|
-
filename?: string;
|
|
1605
|
-
/** Arbitrary metadata stored with the message record. */
|
|
1606
|
-
metadata?: Record<string, any>;
|
|
1607
|
-
/** Template name for template messages. */
|
|
1608
|
-
templateName?: string;
|
|
1609
|
-
/** Template language for template messages. */
|
|
1610
|
-
templateLanguage?: string;
|
|
1611
|
-
/** Alternative language parameter. */
|
|
1612
|
-
language?: string;
|
|
1613
|
-
/** Template variables. */
|
|
1614
|
-
variables?: string[];
|
|
1178
|
+
/** An uploaded file — inbox threads only (WhatsApp today). */
|
|
1179
|
+
media?: OutboundMedia;
|
|
1615
1180
|
}
|
|
1616
|
-
/**
|
|
1617
|
-
* Parameters for sending a pre-approved WhatsApp Business template.
|
|
1618
|
-
*/
|
|
1619
1181
|
interface SendTemplateParams {
|
|
1620
|
-
/**
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
*/
|
|
1624
|
-
to?: string;
|
|
1625
|
-
/**
|
|
1626
|
-
* The unique ID of the conversation.
|
|
1627
|
-
*/
|
|
1628
|
-
conversationId?: string;
|
|
1629
|
-
/** The exact template name as approved in Meta Business Manager. */
|
|
1182
|
+
/** Recipient phone (E.164). */
|
|
1183
|
+
to: string;
|
|
1184
|
+
/** Template name as approved in Meta Business Manager. */
|
|
1630
1185
|
templateName: string;
|
|
1631
|
-
/**
|
|
1632
|
-
* BCP-47 language code for the template.
|
|
1633
|
-
* @default "en_US"
|
|
1634
|
-
*/
|
|
1635
1186
|
language?: string;
|
|
1636
|
-
/**
|
|
1637
|
-
* Ordered array of variable substitutions for template placeholders.
|
|
1638
|
-
* @example ["Alice", "10 April 2026", "10:00 AM"]
|
|
1639
|
-
*/
|
|
1640
1187
|
variables?: string[];
|
|
1641
|
-
/** Optional header media URL (for templates with media headers). */
|
|
1642
|
-
mediaUrl?: string;
|
|
1643
|
-
/** Media type for the header (e.g. "image", "document"). */
|
|
1644
|
-
mediaType?: string;
|
|
1645
|
-
/** User ID of the agent sending the message. */
|
|
1646
|
-
userId?: string;
|
|
1647
|
-
/** Optional filename for media headers. */
|
|
1648
|
-
filename?: string;
|
|
1649
|
-
/** Template language for template messages. */
|
|
1650
|
-
templateLanguage?: string;
|
|
1651
|
-
}
|
|
1652
|
-
/**
|
|
1653
|
-
* WhatsApp outbound messaging resource.
|
|
1654
|
-
*
|
|
1655
|
-
* Access via `ecod.whatsapp.messages`.
|
|
1656
|
-
*
|
|
1657
|
-
* @example
|
|
1658
|
-
* ```typescript
|
|
1659
|
-
* await ecod.whatsapp.messages.send({
|
|
1660
|
-
* to: "+919876543210",
|
|
1661
|
-
* text: "Your appointment is confirmed!",
|
|
1662
|
-
* });
|
|
1663
|
-
* ```
|
|
1664
|
-
*/
|
|
1665
|
-
/**
|
|
1666
|
-
* Resolved media metadata returned by any upload endpoint.
|
|
1667
|
-
* `variants` is only present for raster images (JPEG, PNG, WebP, AVIF, GIF).
|
|
1668
|
-
*/
|
|
1669
|
-
interface ChatMediaMeta {
|
|
1670
|
-
/** Raw CDN URL — always present, all media types */
|
|
1671
|
-
url: string;
|
|
1672
|
-
/** Categorical type — "image" | "video" | "audio" | "document" */
|
|
1673
|
-
type: "image" | "video" | "audio" | "document";
|
|
1674
|
-
/** Cloudflare-optimised variant URLs. Only present for raster images. */
|
|
1675
|
-
variants?: {
|
|
1676
|
-
/** 150px WebP — use for list thumbnails and chat bubbles */
|
|
1677
|
-
thumb: string;
|
|
1678
|
-
/** 600px WebP — use for modal previews */
|
|
1679
|
-
medium: string;
|
|
1680
|
-
/** 1200px WebP — use for hero or full-screen views */
|
|
1681
|
-
full: string;
|
|
1682
|
-
/** Original CDN URL, no transformation */
|
|
1683
|
-
raw: string;
|
|
1684
|
-
};
|
|
1685
|
-
/** Storage key within the tenant bucket */
|
|
1686
|
-
key?: string;
|
|
1687
|
-
/** Original filename */
|
|
1688
|
-
fileName?: string;
|
|
1689
1188
|
}
|
|
1690
1189
|
declare class Messages extends APIResource {
|
|
1691
1190
|
/**
|
|
1692
|
-
* Send a
|
|
1693
|
-
*
|
|
1694
|
-
* For text-only messages, supply `text`. For media, supply `mediaUrl`
|
|
1695
|
-
* and `mediaType`. Both can be combined in a single message.
|
|
1696
|
-
*
|
|
1697
|
-
* @param params - Message parameters including recipient, text, and media.
|
|
1698
|
-
* @returns The created message record from the database.
|
|
1699
|
-
*
|
|
1700
|
-
* @example Send a simple text message
|
|
1701
|
-
* ```typescript
|
|
1702
|
-
* await erixClient.whatsapp.messages.send({
|
|
1703
|
-
* to: "+919876543210",
|
|
1704
|
-
* text: "Hello from Ecodrix!",
|
|
1705
|
-
* });
|
|
1706
|
-
* ```
|
|
1707
|
-
*
|
|
1708
|
-
* @example Send an image with a caption
|
|
1709
|
-
* ```typescript
|
|
1710
|
-
* await erixClient.whatsapp.messages.send({
|
|
1711
|
-
* to: "+919876543210",
|
|
1712
|
-
* text: "Check out this flyer",
|
|
1713
|
-
* mediaUrl: "https://example.com/flyer.jpg",
|
|
1714
|
-
* mediaType: "image",
|
|
1715
|
-
* });
|
|
1716
|
-
* ```
|
|
1191
|
+
* Send a message. With `conversationId` it goes through the unified inbox
|
|
1192
|
+
* (text and/or `media`); with `to` it's a direct WhatsApp text.
|
|
1717
1193
|
*/
|
|
1718
1194
|
send<T = any>(params: SendMessageParams): Promise<T>;
|
|
1719
|
-
/**
|
|
1720
|
-
* Send a pre-approved WhatsApp Business template message.
|
|
1721
|
-
*
|
|
1722
|
-
* Templates must be approved in Meta Business Manager before they can be sent.
|
|
1723
|
-
* Variable placeholders (e.g., {{1}}, {{2}}) are replaced with values from the
|
|
1724
|
-
* `variables` array in order.
|
|
1725
|
-
*
|
|
1726
|
-
* @param params - Template message configuration (name, language, variables).
|
|
1727
|
-
* @returns The created message record.
|
|
1728
|
-
*
|
|
1729
|
-
* @example
|
|
1730
|
-
* ```typescript
|
|
1731
|
-
* await erixClient.whatsapp.messages.sendTemplate({
|
|
1732
|
-
* to: "+919876543210",
|
|
1733
|
-
* templateName: "welcome_user",
|
|
1734
|
-
* language: "en_US",
|
|
1735
|
-
* variables: ["Alice"], // Replaces {{1}} in template
|
|
1736
|
-
* });
|
|
1737
|
-
* ```
|
|
1738
|
-
*/
|
|
1195
|
+
/** Send an approved WhatsApp template (opens a conversation). */
|
|
1739
1196
|
sendTemplate<T = any>(params: SendTemplateParams): Promise<T>;
|
|
1740
|
-
/**
|
|
1741
|
-
* Star or unstar a message.
|
|
1742
|
-
*
|
|
1743
|
-
* @param messageId - The ID of the message.
|
|
1744
|
-
* @param isStarred - Boolean indicating whether to star or unstar.
|
|
1745
|
-
*/
|
|
1746
1197
|
star<T = any>(messageId: string, isStarred: boolean): Promise<T>;
|
|
1747
|
-
/**
|
|
1748
|
-
* React to a message with an emoji.
|
|
1749
|
-
*
|
|
1750
|
-
* @param messageId - The ID of the message.
|
|
1751
|
-
* @param reaction - The emoji (e.g. "👍") to react with, or empty string to remove.
|
|
1752
|
-
*/
|
|
1753
|
-
react<T = any>(messageId: string, reaction: string): Promise<T>;
|
|
1754
|
-
/**
|
|
1755
|
-
* Mark all messages in a conversation as read (double-tick).
|
|
1756
|
-
*
|
|
1757
|
-
* @param conversationId - The conversation to mark as read.
|
|
1758
|
-
*
|
|
1759
|
-
* @example
|
|
1760
|
-
* ```typescript
|
|
1761
|
-
* await ecod.whatsapp.messages.markRead("conv_64abc...");
|
|
1762
|
-
* ```
|
|
1763
|
-
*/
|
|
1764
1198
|
markRead(conversationId: string): Promise<unknown>;
|
|
1765
1199
|
/**
|
|
1766
|
-
* Upload a
|
|
1767
|
-
*
|
|
1768
|
-
*
|
|
1769
|
-
* For raster images the response includes Cloudflare-optimised `variants`
|
|
1770
|
-
* (thumb 150px, medium 600px, full 1200px). Non-image types return only `url`.
|
|
1771
|
-
*
|
|
1772
|
-
* @param file - The file to upload (File, Blob, or Buffer).
|
|
1773
|
-
* @returns Full media metadata `{ url, type, variants?, key, fileName }`.
|
|
1774
|
-
*
|
|
1775
|
-
* @example
|
|
1776
|
-
* ```typescript
|
|
1777
|
-
* const file = input.files[0];
|
|
1778
|
-
* const { data } = await ecod.whatsapp.messages.upload(file);
|
|
1779
|
-
* // For images: data.variants.thumb → 150px WebP from Cloudflare
|
|
1780
|
-
* // For video/audio: use data.url directly in <video> or <audio>
|
|
1781
|
-
* ```
|
|
1782
|
-
*/
|
|
1783
|
-
upload(file: any): Promise<{
|
|
1784
|
-
success: boolean;
|
|
1785
|
-
data: ChatMediaMeta;
|
|
1786
|
-
}>;
|
|
1787
|
-
}
|
|
1788
|
-
|
|
1789
|
-
/**
|
|
1790
|
-
* Channel-agnostic marketing campaigns (email / SMS / WhatsApp) owned by
|
|
1791
|
-
* ERIX-CRM. Mounted at `/product/erix/crm/campaigns`.
|
|
1792
|
-
*
|
|
1793
|
-
* Access via `ecod.product.erix.campaigns`.
|
|
1794
|
-
*/
|
|
1795
|
-
declare class Campaigns extends APIResource {
|
|
1796
|
-
/**
|
|
1797
|
-
* List campaigns with optional status filtering.
|
|
1798
|
-
*/
|
|
1799
|
-
list<T = any>(params?: {
|
|
1800
|
-
status?: string;
|
|
1801
|
-
limit?: number;
|
|
1802
|
-
page?: number;
|
|
1803
|
-
startDate?: string;
|
|
1804
|
-
endDate?: string;
|
|
1805
|
-
}): Promise<T>;
|
|
1806
|
-
/**
|
|
1807
|
-
* Create a campaign.
|
|
1808
|
-
*/
|
|
1809
|
-
create<T = any>(payload: Record<string, unknown>): Promise<T>;
|
|
1810
|
-
/**
|
|
1811
|
-
* Delivery + engagement analytics for a campaign (opens, clicks, bounces).
|
|
1200
|
+
* Upload a file to your tenant storage for sending as `media`:
|
|
1201
|
+
* presign → PUT straight to storage → confirm (counts usage). Your API key
|
|
1202
|
+
* never goes to the storage host.
|
|
1812
1203
|
*/
|
|
1813
|
-
|
|
1204
|
+
upload(file: Blob, opts?: {
|
|
1205
|
+
fileName?: string;
|
|
1206
|
+
folder?: string;
|
|
1207
|
+
}): Promise<OutboundMedia>;
|
|
1814
1208
|
}
|
|
1815
1209
|
|
|
1816
1210
|
interface CheckoutProduct {
|
|
@@ -1917,9 +1311,15 @@ declare class Checkout extends APIResource {
|
|
|
1917
1311
|
interface TriggerPayload {
|
|
1918
1312
|
/** The name of the event to fire (e.g., "webinar_joined") */
|
|
1919
1313
|
trigger: string;
|
|
1920
|
-
/**
|
|
1921
|
-
|
|
1922
|
-
|
|
1314
|
+
/**
|
|
1315
|
+
* Phone number of the lead (E.164 format). Phone OR email is required —
|
|
1316
|
+
* at least one of `phone`/`email` must be provided (enforced server-side).
|
|
1317
|
+
*/
|
|
1318
|
+
phone?: string;
|
|
1319
|
+
/**
|
|
1320
|
+
* Email of the lead. Phone OR email is required — at least one of
|
|
1321
|
+
* `phone`/`email` must be provided (enforced server-side).
|
|
1322
|
+
*/
|
|
1923
1323
|
email?: string;
|
|
1924
1324
|
/** Key-value pairs for string templates */
|
|
1925
1325
|
variables?: Record<string, string>;
|
|
@@ -1964,18 +1364,18 @@ interface TriggerResponse {
|
|
|
1964
1364
|
eventLogId: string;
|
|
1965
1365
|
trigger: string;
|
|
1966
1366
|
leadId: string;
|
|
1967
|
-
rulesMatched: number;
|
|
1968
1367
|
};
|
|
1969
1368
|
message?: string;
|
|
1970
1369
|
code?: string;
|
|
1971
1370
|
}
|
|
1972
1371
|
declare class EventsResource extends APIResource {
|
|
1973
1372
|
/**
|
|
1974
|
-
* Programmatically trigger an automation
|
|
1975
|
-
* This matches the event against active
|
|
1373
|
+
* Programmatically trigger an automation by firing a specific event.
|
|
1374
|
+
* This matches the event against active Flows (Flow is the automation
|
|
1375
|
+
* engine) and starts each flow whose declared trigger matches.
|
|
1976
1376
|
*
|
|
1977
1377
|
* @param payload - The trigger details (event name, lead phone/email, variables).
|
|
1978
|
-
* @returns Trigger response with diagnostic info (eventLogId,
|
|
1378
|
+
* @returns Trigger response with diagnostic info (eventLogId, trigger, leadId).
|
|
1979
1379
|
* @example
|
|
1980
1380
|
* ```typescript
|
|
1981
1381
|
* await erixClient.events.trigger({
|
|
@@ -1988,7 +1388,8 @@ declare class EventsResource extends APIResource {
|
|
|
1988
1388
|
*/
|
|
1989
1389
|
trigger(payload: TriggerPayload): Promise<TriggerResponse>;
|
|
1990
1390
|
/**
|
|
1991
|
-
*
|
|
1391
|
+
* Every trigger a flow can start on: built-ins plus your custom events.
|
|
1392
|
+
* Response: `{ success, data: { triggers } }`.
|
|
1992
1393
|
*/
|
|
1993
1394
|
listCustomEvents<T = any>(): Promise<T>;
|
|
1994
1395
|
/**
|
|
@@ -2039,10 +1440,8 @@ declare class Invoices extends APIResource {
|
|
|
2039
1440
|
* Update an invoice.
|
|
2040
1441
|
*/
|
|
2041
1442
|
update<T = any>(id: string, payload: Record<string, unknown>): Promise<T>;
|
|
2042
|
-
/**
|
|
2043
|
-
|
|
2044
|
-
*/
|
|
2045
|
-
delete<T = any>(id: string): Promise<T>;
|
|
1443
|
+
/** Void an invoice (invoices are never deleted — GST records stay). */
|
|
1444
|
+
void<T = any>(id: string): Promise<T>;
|
|
2046
1445
|
/**
|
|
2047
1446
|
* Send an invoice via WhatsApp to the linked lead.
|
|
2048
1447
|
*/
|
|
@@ -2057,89 +1456,6 @@ declare class Invoices extends APIResource {
|
|
|
2057
1456
|
updateSettings<T = any>(payload: Record<string, unknown>): Promise<T>;
|
|
2058
1457
|
}
|
|
2059
1458
|
|
|
2060
|
-
interface LogPaginationQuery {
|
|
2061
|
-
page?: number;
|
|
2062
|
-
limit?: number;
|
|
2063
|
-
trigger?: string;
|
|
2064
|
-
status?: "received" | "processing" | "completed" | "partial" | "failed";
|
|
2065
|
-
from?: string;
|
|
2066
|
-
to?: string;
|
|
2067
|
-
}
|
|
2068
|
-
interface EventLog {
|
|
2069
|
-
id: string;
|
|
2070
|
-
trigger: string;
|
|
2071
|
-
phone?: string;
|
|
2072
|
-
email?: string;
|
|
2073
|
-
status: "received" | "processing" | "completed" | "partial" | "failed";
|
|
2074
|
-
rulesMatched: number;
|
|
2075
|
-
jobsCreated: number;
|
|
2076
|
-
meetLink?: string;
|
|
2077
|
-
callbackUrl?: string;
|
|
2078
|
-
callbackStatus: "not_required" | "sent" | "failed";
|
|
2079
|
-
payload: any;
|
|
2080
|
-
error?: string;
|
|
2081
|
-
idempotencyKey?: string;
|
|
2082
|
-
processedAt?: string;
|
|
2083
|
-
createdAt: string;
|
|
2084
|
-
updatedAt: string;
|
|
2085
|
-
}
|
|
2086
|
-
interface CallbackLog {
|
|
2087
|
-
id: string;
|
|
2088
|
-
callbackUrl: string;
|
|
2089
|
-
method: string;
|
|
2090
|
-
payload: any;
|
|
2091
|
-
jobId?: string;
|
|
2092
|
-
enrollmentId?: string;
|
|
2093
|
-
responseStatus: number;
|
|
2094
|
-
responseBody: string;
|
|
2095
|
-
status: "sent" | "failed" | "pending_retry";
|
|
2096
|
-
attempts: number;
|
|
2097
|
-
lastAttemptAt?: string;
|
|
2098
|
-
signature?: string;
|
|
2099
|
-
createdAt: string;
|
|
2100
|
-
}
|
|
2101
|
-
interface LogResponse<T> {
|
|
2102
|
-
success: boolean;
|
|
2103
|
-
data: T[];
|
|
2104
|
-
pagination: {
|
|
2105
|
-
total: number;
|
|
2106
|
-
page: number;
|
|
2107
|
-
limit: number;
|
|
2108
|
-
pages: number;
|
|
2109
|
-
};
|
|
2110
|
-
}
|
|
2111
|
-
/**
|
|
2112
|
-
* Audit and execution logs for platform events and webhooks.
|
|
2113
|
-
*
|
|
2114
|
-
* Access via `ecod.logs`.
|
|
2115
|
-
*/
|
|
2116
|
-
declare class Logs extends APIResource {
|
|
2117
|
-
/**
|
|
2118
|
-
* List event execution logs with optional filtering.
|
|
2119
|
-
*
|
|
2120
|
-
* Use this to audit automation triggers and debug workflow execution.
|
|
2121
|
-
*/
|
|
2122
|
-
listEventLogs(query?: LogPaginationQuery): Promise<LogResponse<EventLog>>;
|
|
2123
|
-
/**
|
|
2124
|
-
* Get detailed information for a single event execution.
|
|
2125
|
-
*/
|
|
2126
|
-
getEventLog(id: string): Promise<{
|
|
2127
|
-
success: boolean;
|
|
2128
|
-
data: EventLog;
|
|
2129
|
-
}>;
|
|
2130
|
-
/**
|
|
2131
|
-
* List webhook callback logs (outbound responses from ECODrIx to your system).
|
|
2132
|
-
*/
|
|
2133
|
-
listCallbackLogs(query?: LogPaginationQuery): Promise<LogResponse<CallbackLog>>;
|
|
2134
|
-
/**
|
|
2135
|
-
* Get high-level execution statistics for the tenant.
|
|
2136
|
-
*/
|
|
2137
|
-
getStats(): Promise<{
|
|
2138
|
-
success: boolean;
|
|
2139
|
-
data: any;
|
|
2140
|
-
}>;
|
|
2141
|
-
}
|
|
2142
|
-
|
|
2143
1459
|
/**
|
|
2144
1460
|
* Niche Resources — Workflow packs + WhatsApp template suggestions.
|
|
2145
1461
|
*
|
|
@@ -2170,41 +1486,6 @@ declare class NicheResources extends APIResource {
|
|
|
2170
1486
|
templateSuggestions<T = any>(): Promise<T>;
|
|
2171
1487
|
}
|
|
2172
1488
|
|
|
2173
|
-
/**
|
|
2174
|
-
* Portal Inbox — team-side unified inbox for portal conversations.
|
|
2175
|
-
*
|
|
2176
|
-
* Lists all projects with active client threads, retrieves messages,
|
|
2177
|
-
* and posts replies. Mounted at `/product/erix/portal-inbox`.
|
|
2178
|
-
*
|
|
2179
|
-
* @example
|
|
2180
|
-
* ```typescript
|
|
2181
|
-
* const threads = await ecod.portalInbox.conversations();
|
|
2182
|
-
* const messages = await ecod.portalInbox.messages(projectId);
|
|
2183
|
-
* await ecod.portalInbox.reply(projectId, { body: "We'll get back to you!" });
|
|
2184
|
-
* ```
|
|
2185
|
-
*/
|
|
2186
|
-
declare class PortalInbox extends APIResource {
|
|
2187
|
-
/**
|
|
2188
|
-
* List all projects with active portal conversation threads.
|
|
2189
|
-
* Returns projectId, projectName, lastMessageAt, lastBody, lastSender, unreadCount.
|
|
2190
|
-
*/
|
|
2191
|
-
conversations<T = any>(): Promise<T>;
|
|
2192
|
-
/**
|
|
2193
|
-
* Get paginated messages for a project's portal thread.
|
|
2194
|
-
*/
|
|
2195
|
-
messages<T = any>(projectId: string): Promise<T>;
|
|
2196
|
-
/**
|
|
2197
|
-
* Post a reply from the team to a project's portal thread.
|
|
2198
|
-
*/
|
|
2199
|
-
reply<T = any>(projectId: string, payload: {
|
|
2200
|
-
body: string;
|
|
2201
|
-
attachments?: Array<{
|
|
2202
|
-
name: string;
|
|
2203
|
-
url: string;
|
|
2204
|
-
}>;
|
|
2205
|
-
}): Promise<T>;
|
|
2206
|
-
}
|
|
2207
|
-
|
|
2208
1489
|
/**
|
|
2209
1490
|
* Project Documents + E-Sign — document management and digital signatures
|
|
2210
1491
|
* for CRM projects.
|
|
@@ -2343,6 +1624,16 @@ declare class Connect extends APIResource {
|
|
|
2343
1624
|
module: "crm" | "flow" | "laie";
|
|
2344
1625
|
enabled: boolean;
|
|
2345
1626
|
}): Promise<T>;
|
|
1627
|
+
/**
|
|
1628
|
+
* One-click Google OAuth: the consent-popup URL for the signed-in tenant.
|
|
1629
|
+
* It carries a short-lived (5 min) ticket, so open it right away.
|
|
1630
|
+
*/
|
|
1631
|
+
googleConnectUrl(): Promise<{
|
|
1632
|
+
success: boolean;
|
|
1633
|
+
data: {
|
|
1634
|
+
url: string;
|
|
1635
|
+
};
|
|
1636
|
+
}>;
|
|
2346
1637
|
/**
|
|
2347
1638
|
* Create a payment link on the tenant's OWN connected gateway
|
|
2348
1639
|
* (Razorpay / Stripe). Tenant-scoped; requires the `payments` provider to be
|
|
@@ -2967,10 +2258,6 @@ declare class Templates extends APIResource {
|
|
|
2967
2258
|
* @param templateIdentifier - The name or ID of the template.
|
|
2968
2259
|
*/
|
|
2969
2260
|
getVariableManifest(templateIdentifier: string): Promise<ResourceManifest>;
|
|
2970
|
-
/**
|
|
2971
|
-
* Check which automations or sequences are currently using this template.
|
|
2972
|
-
*/
|
|
2973
|
-
checkUsage<T = any>(templateName: string): Promise<T>;
|
|
2974
2261
|
}
|
|
2975
2262
|
|
|
2976
2263
|
/**
|
|
@@ -3154,10 +2441,6 @@ declare class Folders extends APIResource {
|
|
|
3154
2441
|
* ```
|
|
3155
2442
|
*/
|
|
3156
2443
|
create<T = any>(name: string): Promise<T>;
|
|
3157
|
-
/**
|
|
3158
|
-
* Delete a folder and its contents.
|
|
3159
|
-
*/
|
|
3160
|
-
delete<T = any>(folderPath: string): Promise<T>;
|
|
3161
2444
|
}
|
|
3162
2445
|
declare class Files extends APIResource {
|
|
3163
2446
|
/**
|
|
@@ -3211,63 +2494,140 @@ declare class Files extends APIResource {
|
|
|
3211
2494
|
delete(key: string): Promise<unknown>;
|
|
3212
2495
|
}
|
|
3213
2496
|
|
|
3214
|
-
|
|
3215
|
-
|
|
3216
|
-
|
|
3217
|
-
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
|
-
|
|
3221
|
-
|
|
3222
|
-
* NO RUNTIME CODE. Types only. Both saas (Next.js) and server (Express)
|
|
3223
|
-
* import from here so the wire shape stays in lockstep.
|
|
3224
|
-
*/
|
|
3225
|
-
/**
|
|
3226
|
-
* Renderable step kinds. The saas selects the appropriate React component
|
|
3227
|
-
* from `components/onboarding/steps/*` based on this discriminator.
|
|
3228
|
-
*/
|
|
3229
|
-
type OnboardingStepType = "single_choice" | "multi_choice" | "text_input" | "ai_summary_confirm" | "feature_preview" | "completion";
|
|
3230
|
-
/**
|
|
3231
|
-
* One selectable answer option in a `single_choice` / `multi_choice` step.
|
|
3232
|
-
*/
|
|
3233
|
-
interface OnboardingOption {
|
|
3234
|
-
/** Internal value persisted in `session.answers[stepId]`. */
|
|
3235
|
-
value: string;
|
|
3236
|
-
/** Human-readable label shown to the user. */
|
|
3237
|
-
label: string;
|
|
3238
|
-
/** Optional short description rendered under the label. */
|
|
3239
|
-
description?: string;
|
|
3240
|
-
/** Optional icon identifier (Lucide name, image URL, or emoji). */
|
|
3241
|
-
icon?: string;
|
|
2497
|
+
interface SystemHealth {
|
|
2498
|
+
status: string;
|
|
2499
|
+
version: string;
|
|
2500
|
+
env: string;
|
|
2501
|
+
uptime: number;
|
|
2502
|
+
db: string;
|
|
2503
|
+
queueDepth: number;
|
|
2504
|
+
timestamp: string;
|
|
3242
2505
|
}
|
|
3243
2506
|
/**
|
|
3244
|
-
*
|
|
2507
|
+
* Platform health diagnostics.
|
|
3245
2508
|
*
|
|
3246
|
-
*
|
|
3247
|
-
* `session.draftPersona.<targetField>`, optionally passed through a named
|
|
3248
|
-
* transformation. On `complete()` the draft persona is upserted to
|
|
3249
|
-
* `ecodrix_ai_personas`.
|
|
2509
|
+
* Access via `ecod.platform.health`.
|
|
3250
2510
|
*/
|
|
3251
|
-
|
|
3252
|
-
/**
|
|
3253
|
-
* Dot-path into the persona document, e.g.
|
|
3254
|
-
* `"identity.nicheSubtype"` or `"behaviorRules.outreachTone"`.
|
|
3255
|
-
*/
|
|
3256
|
-
targetField: string;
|
|
2511
|
+
declare class Health extends APIResource {
|
|
3257
2512
|
/**
|
|
3258
|
-
*
|
|
3259
|
-
*
|
|
3260
|
-
* etc.).
|
|
2513
|
+
* Global platform health check — verifies the core API is operational.
|
|
2514
|
+
* Public endpoint: `GET /health`.
|
|
3261
2515
|
*/
|
|
3262
|
-
|
|
2516
|
+
system(): Promise<SystemHealth>;
|
|
3263
2517
|
}
|
|
2518
|
+
|
|
3264
2519
|
/**
|
|
3265
|
-
*
|
|
2520
|
+
* Automation event log and provider callback resource.
|
|
3266
2521
|
*
|
|
3267
|
-
*
|
|
3268
|
-
*
|
|
3269
|
-
*
|
|
3270
|
-
|
|
2522
|
+
* Access via `ecod.notifications`.
|
|
2523
|
+
*
|
|
2524
|
+
* This resource is **read-only**. It exposes platform audit trails — useful
|
|
2525
|
+
* for debugging automation failures, monitoring webhook callbacks, and
|
|
2526
|
+
* building internal ops dashboards.
|
|
2527
|
+
*
|
|
2528
|
+
* @example
|
|
2529
|
+
* ```typescript
|
|
2530
|
+
* // Find failed automations in April
|
|
2531
|
+
* const { data } = await ecod.notifications.listLogs({
|
|
2532
|
+
* status: "failed",
|
|
2533
|
+
* startDate: "2026-04-01",
|
|
2534
|
+
* endDate: "2026-04-30",
|
|
2535
|
+
* });
|
|
2536
|
+
* ```
|
|
2537
|
+
*/
|
|
2538
|
+
declare class Notifications extends APIResource {
|
|
2539
|
+
/**
|
|
2540
|
+
* List unread CRM notifications and alerts (e.g., lead assignments, system alerts).
|
|
2541
|
+
*
|
|
2542
|
+
* @param params - Optional filters (limit, unreadOnly).
|
|
2543
|
+
* @returns Paginated list of notification objects.
|
|
2544
|
+
* @example
|
|
2545
|
+
* ```typescript
|
|
2546
|
+
* const alerts = await erixClient.notifications.listAlerts({ unreadOnly: true });
|
|
2547
|
+
* ```
|
|
2548
|
+
*/
|
|
2549
|
+
listAlerts<T = any>(params?: {
|
|
2550
|
+
limit?: number;
|
|
2551
|
+
unreadOnly?: boolean;
|
|
2552
|
+
}): Promise<T>;
|
|
2553
|
+
/**
|
|
2554
|
+
* Dismiss/mark a specific notification alert as read.
|
|
2555
|
+
*
|
|
2556
|
+
* @param notificationId - The unique ID of the notification.
|
|
2557
|
+
* @example
|
|
2558
|
+
* ```typescript
|
|
2559
|
+
* await erixClient.notifications.dismissAlert("alert_123");
|
|
2560
|
+
* ```
|
|
2561
|
+
*/
|
|
2562
|
+
dismissAlert<T = any>(notificationId: string): Promise<T>;
|
|
2563
|
+
/**
|
|
2564
|
+
* Clear all notifications for the current tenant immediately.
|
|
2565
|
+
*
|
|
2566
|
+
* @example
|
|
2567
|
+
* ```typescript
|
|
2568
|
+
* await erixClient.notifications.clearAllAlerts();
|
|
2569
|
+
* ```
|
|
2570
|
+
*/
|
|
2571
|
+
clearAllAlerts<T = any>(): Promise<T>;
|
|
2572
|
+
}
|
|
2573
|
+
|
|
2574
|
+
/**
|
|
2575
|
+
* Adaptive Onboarding type definitions.
|
|
2576
|
+
*
|
|
2577
|
+
* These types mirror the Postgres data shapes from the
|
|
2578
|
+
* `adaptive-onboarding-ai-persona` spec — see
|
|
2579
|
+
* `.kiro/specs/adaptive-onboarding-ai-persona/design.md` §"Data Models" and
|
|
2580
|
+
* §"Onboarding engine".
|
|
2581
|
+
*
|
|
2582
|
+
* NO RUNTIME CODE. Types only. Both saas (Next.js) and server (Express)
|
|
2583
|
+
* import from here so the wire shape stays in lockstep.
|
|
2584
|
+
*/
|
|
2585
|
+
/**
|
|
2586
|
+
* Renderable step kinds. The saas selects the appropriate React component
|
|
2587
|
+
* from `components/onboarding/steps/*` based on this discriminator.
|
|
2588
|
+
*/
|
|
2589
|
+
type OnboardingStepType = "single_choice" | "multi_choice" | "text_input" | "ai_summary_confirm" | "feature_preview" | "completion";
|
|
2590
|
+
/**
|
|
2591
|
+
* One selectable answer option in a `single_choice` / `multi_choice` step.
|
|
2592
|
+
*/
|
|
2593
|
+
interface OnboardingOption {
|
|
2594
|
+
/** Internal value persisted in `session.answers[stepId]`. */
|
|
2595
|
+
value: string;
|
|
2596
|
+
/** Human-readable label shown to the user. */
|
|
2597
|
+
label: string;
|
|
2598
|
+
/** Optional short description rendered under the label. */
|
|
2599
|
+
description?: string;
|
|
2600
|
+
/** Optional icon identifier (Lucide name, image URL, or emoji). */
|
|
2601
|
+
icon?: string;
|
|
2602
|
+
}
|
|
2603
|
+
/**
|
|
2604
|
+
* Declares which persona field a step's answer writes to.
|
|
2605
|
+
*
|
|
2606
|
+
* Engine flow: when the step is answered, the value is written to
|
|
2607
|
+
* `session.draftPersona.<targetField>`, optionally passed through a named
|
|
2608
|
+
* transformation. On `complete()` the draft persona is upserted to
|
|
2609
|
+
* `ecodrix_ai_personas`.
|
|
2610
|
+
*/
|
|
2611
|
+
interface OnboardingMemoryMapping {
|
|
2612
|
+
/**
|
|
2613
|
+
* Dot-path into the persona document, e.g.
|
|
2614
|
+
* `"identity.nicheSubtype"` or `"behaviorRules.outreachTone"`.
|
|
2615
|
+
*/
|
|
2616
|
+
targetField: string;
|
|
2617
|
+
/**
|
|
2618
|
+
* Optional named transformation applied to the raw answer before write.
|
|
2619
|
+
* Engine-defined (`"map_to_niche_config"`, `"lowercase"`, `"split_csv"`,
|
|
2620
|
+
* etc.).
|
|
2621
|
+
*/
|
|
2622
|
+
transformation?: string;
|
|
2623
|
+
}
|
|
2624
|
+
/**
|
|
2625
|
+
* A single step in an `OnboardingConfig`.
|
|
2626
|
+
*
|
|
2627
|
+
* Branching is via `showIf` / `skipIf` JsonLogic expressions evaluated
|
|
2628
|
+
* against `session.answers`. The engine never reaches an undefined step —
|
|
2629
|
+
* a missing `nextStepId` terminates the flow.
|
|
2630
|
+
*/
|
|
3271
2631
|
interface OnboardingStep {
|
|
3272
2632
|
/** Stable identifier referenced by branch expressions and analytics. */
|
|
3273
2633
|
stepId: string;
|
|
@@ -3645,6 +3005,135 @@ interface NichePack {
|
|
|
3645
3005
|
researchConfig?: NichePackResearchConfig;
|
|
3646
3006
|
}
|
|
3647
3007
|
|
|
3008
|
+
/**
|
|
3009
|
+
* Body of `POST /platform/tenants/onboarding/global` — the four-question signup form.
|
|
3010
|
+
*
|
|
3011
|
+
* Fields land directly on `ecodrix_organizations.*` columns (workspace
|
|
3012
|
+
* name, timezone) and `service_config -> 'global'` (primary product,
|
|
3013
|
+
* adaptive flag). See REQ-001.
|
|
3014
|
+
*/
|
|
3015
|
+
interface GlobalOnboardingPayload {
|
|
3016
|
+
/** Workspace / org display name. Persisted to `ecodrix_organizations.name`. */
|
|
3017
|
+
workspaceName: string;
|
|
3018
|
+
/** Personal display name of the signing-up user. */
|
|
3019
|
+
displayName: string;
|
|
3020
|
+
/** IANA timezone, e.g. `"Asia/Kolkata"`. Persisted to `organizations.timezone`. */
|
|
3021
|
+
timezone: string;
|
|
3022
|
+
/**
|
|
3023
|
+
* The product the user wants to start with. `"not_sure"` defers
|
|
3024
|
+
* per-product onboarding to first product open.
|
|
3025
|
+
*/
|
|
3026
|
+
primaryProduct: "crm" | "laie" | "flow" | "not_sure";
|
|
3027
|
+
}
|
|
3028
|
+
/**
|
|
3029
|
+
* Body of `POST /platform/tenants/onboarding/${productId}/start` — opens a per-product onboarding
|
|
3030
|
+
* session. Triggered by the explicit "Enable {Product}" click on
|
|
3031
|
+
* `/products/<productId>` (REQ-002).
|
|
3032
|
+
*/
|
|
3033
|
+
interface StartOnboardingPayload {
|
|
3034
|
+
productId: "crm" | "laie" | "flow";
|
|
3035
|
+
}
|
|
3036
|
+
/**
|
|
3037
|
+
* Body of `POST /platform/tenants/onboarding/${productId}/answer` — records one step's answer and
|
|
3038
|
+
* advances the engine. The saas calls this on every step submit (and as
|
|
3039
|
+
* a debounced PATCH for resumability).
|
|
3040
|
+
*/
|
|
3041
|
+
interface AnswerOnboardingPayload {
|
|
3042
|
+
sessionId: string;
|
|
3043
|
+
stepId: string;
|
|
3044
|
+
/** Shape depends on the step type — string, string[], boolean, etc. */
|
|
3045
|
+
answer: unknown;
|
|
3046
|
+
}
|
|
3047
|
+
/**
|
|
3048
|
+
* Body of `POST /platform/tenants/onboarding/complete` — terminates the session,
|
|
3049
|
+
* upserts the persona, and materializes the workspace defaults.
|
|
3050
|
+
*/
|
|
3051
|
+
interface CompleteOnboardingPayload {
|
|
3052
|
+
sessionId: string;
|
|
3053
|
+
}
|
|
3054
|
+
/**
|
|
3055
|
+
* Body of `POST /platform/tenants/onboarding/${productId}/edit` — post-completion edit of a single
|
|
3056
|
+
* answer from `/settings/onboarding`. Triggers a `persona_recomputed`
|
|
3057
|
+
* event (REQ-010).
|
|
3058
|
+
*/
|
|
3059
|
+
interface EditOnboardingPayload {
|
|
3060
|
+
stepId: string;
|
|
3061
|
+
answer: unknown;
|
|
3062
|
+
}
|
|
3063
|
+
/**
|
|
3064
|
+
* Result of `POST /platform/tenants/onboarding/${productId}/start`.
|
|
3065
|
+
*/
|
|
3066
|
+
interface StartOnboardingResponse {
|
|
3067
|
+
sessionId: string;
|
|
3068
|
+
firstStep: OnboardingStep;
|
|
3069
|
+
}
|
|
3070
|
+
/**
|
|
3071
|
+
* Result of `POST /platform/tenants/onboarding/${productId}/answer`.
|
|
3072
|
+
*/
|
|
3073
|
+
interface AnswerOnboardingResponse {
|
|
3074
|
+
/** `null` when the engine has reached the final step. */
|
|
3075
|
+
nextStep: OnboardingStep | null;
|
|
3076
|
+
draftPersona: Record<string, unknown>;
|
|
3077
|
+
}
|
|
3078
|
+
/**
|
|
3079
|
+
* Result of `GET /platform/tenants/onboarding/${productId}/state`. Returns the active session
|
|
3080
|
+
* (status `"active"`) for `(userId, productId)`, plus the step the
|
|
3081
|
+
* renderer should currently show.
|
|
3082
|
+
*/
|
|
3083
|
+
interface OnboardingStateResponse {
|
|
3084
|
+
session: OnboardingSession | null;
|
|
3085
|
+
currentStep: OnboardingStep | null;
|
|
3086
|
+
}
|
|
3087
|
+
/**
|
|
3088
|
+
* Result of `POST /platform/tenants/onboarding/complete`.
|
|
3089
|
+
*/
|
|
3090
|
+
interface CompleteOnboardingResponse {
|
|
3091
|
+
/** Opaque persona document — full type lives in `resources/persona.ts`. */
|
|
3092
|
+
persona: Record<string, unknown>;
|
|
3093
|
+
workspaceProfile: WorkspaceProfile;
|
|
3094
|
+
}
|
|
3095
|
+
/**
|
|
3096
|
+
* Result of `POST /platform/tenants/onboarding/${productId}/edit`.
|
|
3097
|
+
*/
|
|
3098
|
+
interface EditOnboardingResponse {
|
|
3099
|
+
persona: Record<string, unknown>;
|
|
3100
|
+
/** RFC 6902 JSON Patch describing what changed in the persona. */
|
|
3101
|
+
diff: Array<Record<string, unknown>>;
|
|
3102
|
+
}
|
|
3103
|
+
/**
|
|
3104
|
+
* Adaptive onboarding resource.
|
|
3105
|
+
*
|
|
3106
|
+
* Mounted on the main client as `ecod.onboarding`. Mirrors the seven
|
|
3107
|
+
* tenant-facing routes documented in `design.md` § "API surface".
|
|
3108
|
+
*
|
|
3109
|
+
* @example
|
|
3110
|
+
* ```typescript
|
|
3111
|
+
* await ecod.onboarding.global({
|
|
3112
|
+
* workspaceName: "Acme Health",
|
|
3113
|
+
* displayName: "Alice",
|
|
3114
|
+
* timezone: "Asia/Kolkata",
|
|
3115
|
+
* primaryProduct: "crm",
|
|
3116
|
+
* });
|
|
3117
|
+
*
|
|
3118
|
+
* const { sessionId, firstStep } = await ecod.onboarding.start({ productId: "crm" });
|
|
3119
|
+
* await ecod.onboarding.answer({ sessionId, stepId: firstStep.stepId, answer: "healthcare" });
|
|
3120
|
+
* await ecod.onboarding.complete({ sessionId });
|
|
3121
|
+
* ```
|
|
3122
|
+
*/
|
|
3123
|
+
declare class Onboarding extends APIResource {
|
|
3124
|
+
/**
|
|
3125
|
+
* Submit the four-question global onboarding form (REQ-001).
|
|
3126
|
+
* Updates `ecodrix_organizations.*` columns and
|
|
3127
|
+
* `service_config.global.primaryProduct`.
|
|
3128
|
+
*/
|
|
3129
|
+
global<T = unknown>(payload: GlobalOnboardingPayload): Promise<T>;
|
|
3130
|
+
/**
|
|
3131
|
+
* Finalise the session, upsert the persona, and materialize the
|
|
3132
|
+
* niche-tuned workspace defaults.
|
|
3133
|
+
*/
|
|
3134
|
+
complete(payload: CompleteOnboardingPayload): Promise<CompleteOnboardingResponse>;
|
|
3135
|
+
}
|
|
3136
|
+
|
|
3648
3137
|
/**
|
|
3649
3138
|
* Identity block — who the user is, what they sell, where they operate.
|
|
3650
3139
|
* Stored at `ecodrix_ai_personas.identity` (JSONB).
|
|
@@ -4262,2450 +3751,647 @@ declare class Persona extends APIResource {
|
|
|
4262
3751
|
}
|
|
4263
3752
|
|
|
4264
3753
|
/**
|
|
4265
|
-
*
|
|
4266
|
-
*
|
|
4267
|
-
* Mounted on the main client as `ecod.adminOnboarding`. Mirrors the
|
|
4268
|
-
* platform-admin endpoints under `/platform/admin/onboarding/*`
|
|
4269
|
-
* documented in `server/src/platform/routes/admin/onboarding.routes.ts`.
|
|
4270
|
-
*
|
|
4271
|
-
* Auth: every method requires the elevated platform `coreApiKey`. The
|
|
4272
|
-
* SDK forwards it as `x-core-api-key`; admin server-side callers should
|
|
4273
|
-
* always construct a client with `coreApiKey` set (see
|
|
4274
|
-
* `admin/src/lib/client/erix-admin.ts`).
|
|
4275
|
-
*
|
|
4276
|
-
* Endpoints covered in this build (task 4.1.1 — list page):
|
|
4277
|
-
*
|
|
4278
|
-
* - GET /platform/admin/onboarding/niche-packs list
|
|
4279
|
-
* - GET /platform/admin/onboarding/niche-packs/:slug fetch one
|
|
4280
|
-
* - POST /platform/admin/onboarding/niche-packs create
|
|
4281
|
-
* - PATCH /platform/admin/onboarding/niche-packs/:slug update
|
|
4282
|
-
* - POST /platform/admin/onboarding/niche-packs/:slug/publish publish
|
|
4283
|
-
* - POST /platform/admin/onboarding/niche-packs/:slug/unpublish back to draft
|
|
4284
|
-
* - POST /platform/admin/onboarding/niche-packs/:slug/fork new draft copy
|
|
4285
|
-
* - GET /platform/admin/onboarding/configs list configs
|
|
4286
|
-
* - POST /platform/admin/onboarding/configs create config
|
|
4287
|
-
* - PATCH /platform/admin/onboarding/configs/:productId/:version update
|
|
4288
|
-
* - POST /platform/admin/onboarding/configs/:productId/:version/publish publish
|
|
4289
|
-
*
|
|
4290
|
-
* Endpoints for A/B onboarding experiments (task 4.2.2):
|
|
4291
|
-
*
|
|
4292
|
-
* - GET /platform/admin/onboarding/experiments list
|
|
4293
|
-
* - GET /platform/admin/onboarding/experiments/:slug fetch one
|
|
4294
|
-
* - POST /platform/admin/onboarding/experiments create draft
|
|
4295
|
-
* - PATCH /platform/admin/onboarding/experiments/:slug partial update
|
|
4296
|
-
* - DELETE /platform/admin/onboarding/experiments/:slug hard-delete
|
|
3754
|
+
* Copilot resource — synchronous chat, confirmation, and session management.
|
|
4297
3755
|
*
|
|
4298
|
-
*
|
|
4299
|
-
* publish flows on top of these primitives.
|
|
3756
|
+
* Access via `ecod.platform.ai.copilot`.
|
|
4300
3757
|
*/
|
|
4301
|
-
|
|
4302
|
-
/** Niche pack row as returned by the admin list endpoint. */
|
|
4303
|
-
interface NichePackSummary {
|
|
4304
|
-
id: string;
|
|
4305
|
-
slug: string;
|
|
4306
|
-
productId: NichePack["productId"];
|
|
4307
|
-
version: string;
|
|
4308
|
-
status: NichePackStatus;
|
|
4309
|
-
/** ISO 8601 — creation timestamp (server clock). */
|
|
4310
|
-
createdAt: string;
|
|
4311
|
-
/** ISO 8601 — last edit timestamp. */
|
|
4312
|
-
updatedAt: string;
|
|
4313
|
-
/** ISO 8601 — first time `status` flipped to `published`. */
|
|
4314
|
-
publishedAt?: string | null;
|
|
4315
|
-
/** Admin staff id who created this version. */
|
|
4316
|
-
createdBy?: string | null;
|
|
4317
|
-
}
|
|
4318
|
-
/** Filters accepted by `adminOnboarding.listNichePacks`. */
|
|
4319
|
-
interface ListNichePacksParams {
|
|
4320
|
-
/** Restrict to a single product family. */
|
|
4321
|
-
productId?: NichePack["productId"];
|
|
4322
|
-
/** Restrict to one lifecycle status. */
|
|
4323
|
-
status?: NichePackStatus;
|
|
3758
|
+
declare class Copilot extends APIResource {
|
|
4324
3759
|
/**
|
|
4325
|
-
*
|
|
4326
|
-
* and `productId`. Whitespace is trimmed.
|
|
4327
|
-
*/
|
|
4328
|
-
search?: string;
|
|
4329
|
-
/** Page size — server clamps to 1..100, default 25. */
|
|
4330
|
-
limit?: number;
|
|
4331
|
-
/** Pagination offset, default 0. */
|
|
4332
|
-
offset?: number;
|
|
4333
|
-
}
|
|
4334
|
-
/** Body accepted by the create-pack endpoint. */
|
|
4335
|
-
interface CreateNichePackPayload {
|
|
4336
|
-
slug: string;
|
|
4337
|
-
productId: NichePack["productId"];
|
|
4338
|
-
/** Defaults to `"1.0.0"` server-side. */
|
|
4339
|
-
version?: string;
|
|
4340
|
-
onboardingConfig?: Record<string, unknown>;
|
|
4341
|
-
workspaceProfile?: Record<string, unknown>;
|
|
4342
|
-
researchConfig?: Record<string, unknown>;
|
|
4343
|
-
}
|
|
4344
|
-
/** Body accepted by the update-pack endpoint. At least one field required. */
|
|
4345
|
-
interface UpdateNichePackPayload {
|
|
4346
|
-
status?: NichePackStatus;
|
|
4347
|
-
onboardingConfig?: Record<string, unknown>;
|
|
4348
|
-
workspaceProfile?: Record<string, unknown>;
|
|
4349
|
-
researchConfig?: Record<string, unknown>;
|
|
4350
|
-
}
|
|
4351
|
-
/** Body accepted by the fork-pack endpoint. */
|
|
4352
|
-
interface ForkNichePackPayload {
|
|
4353
|
-
/** Source version to clone; defaults to the latest row for the slug. */
|
|
4354
|
-
fromVersion?: string;
|
|
4355
|
-
/** Target version for the new draft; defaults to a server-side bump. */
|
|
4356
|
-
version?: string;
|
|
4357
|
-
}
|
|
4358
|
-
/**
|
|
4359
|
-
* Body accepted by `adminOnboarding.smokeTestNichePack` (task 4.1.5).
|
|
4360
|
-
*
|
|
4361
|
-
* Both fields are optional:
|
|
4362
|
-
*
|
|
4363
|
-
* - `fromVersion` pins a specific row for the slug; without it the
|
|
4364
|
-
* server picks the most recent (typically the latest draft).
|
|
4365
|
-
* - `answers` is a `{ stepId: value }` map. When omitted (or missing
|
|
4366
|
-
* keys for some steps) the in-memory runner auto-picks the first
|
|
4367
|
-
* option of `single_choice` / `multi_choice` steps and uses a
|
|
4368
|
-
* placeholder for `text_input`.
|
|
4369
|
-
*/
|
|
4370
|
-
interface SmokeTestNichePackPayload {
|
|
4371
|
-
fromVersion?: string;
|
|
4372
|
-
answers?: Record<string, unknown>;
|
|
4373
|
-
}
|
|
4374
|
-
/**
|
|
4375
|
-
* One materializer action the live `workspaceShaper.materialize` call
|
|
4376
|
-
* WOULD perform if the smoke-tested pack were used in a real
|
|
4377
|
-
* onboarding-complete flow. The summary string is what the admin
|
|
4378
|
-
* panel renders verbatim ("Would create pipeline 'Patient Journey'
|
|
4379
|
-
* with 5 stages").
|
|
4380
|
-
*/
|
|
4381
|
-
type SmokeTestMaterializerAction = {
|
|
4382
|
-
kind: "pipeline";
|
|
4383
|
-
name: string;
|
|
4384
|
-
stageCount: number;
|
|
4385
|
-
isDefault: boolean;
|
|
4386
|
-
summary: string;
|
|
4387
|
-
} | {
|
|
4388
|
-
kind: "field";
|
|
4389
|
-
key: string;
|
|
4390
|
-
label: string;
|
|
4391
|
-
type: string;
|
|
4392
|
-
required: boolean;
|
|
4393
|
-
summary: string;
|
|
4394
|
-
} | {
|
|
4395
|
-
kind: "automation";
|
|
4396
|
-
name: string;
|
|
4397
|
-
trigger: string;
|
|
4398
|
-
enabled: boolean;
|
|
4399
|
-
summary: string;
|
|
4400
|
-
};
|
|
4401
|
-
/**
|
|
4402
|
-
* Result envelope returned by `adminOnboarding.smokeTestNichePack`.
|
|
4403
|
-
*
|
|
4404
|
-
* Mirrors `SmokeTestResult` in
|
|
4405
|
-
* `server/src/erix/services/onboarding/smokeTestRunner.ts`.
|
|
4406
|
-
*/
|
|
4407
|
-
interface SmokeTestResult {
|
|
4408
|
-
/** In-memory `OnboardingSession` produced by the simulator. */
|
|
4409
|
-
session: OnboardingSession;
|
|
4410
|
-
/** Persona shaped from the answers + memory mappings. */
|
|
4411
|
-
persona: AIPersona;
|
|
4412
|
-
/** Workspace profile produced by `workspaceShaper.produce`. */
|
|
4413
|
-
workspaceProfile: WorkspaceProfile;
|
|
4414
|
-
/** Actions the live materializer would perform. */
|
|
4415
|
-
materializerActions: SmokeTestMaterializerAction[];
|
|
4416
|
-
/** Wall-clock duration (millis) of the simulation. */
|
|
4417
|
-
durationMs: number;
|
|
4418
|
-
/** Step ids the engine visited (in order). */
|
|
4419
|
-
visitedStepIds: string[];
|
|
4420
|
-
/** Step ids the engine skipped via branching predicates. */
|
|
4421
|
-
skippedStepIds: string[];
|
|
4422
|
-
/** Whether the runner had to auto-pick at least one answer. */
|
|
4423
|
-
autoPicked: boolean;
|
|
4424
|
-
}
|
|
4425
|
-
/** Standard `{ success, data }` envelope used by every admin endpoint. */
|
|
4426
|
-
interface ApiEnvelope<T> {
|
|
4427
|
-
success: boolean;
|
|
4428
|
-
data: T;
|
|
4429
|
-
}
|
|
4430
|
-
/** Envelope returned by `GET /platform/admin/onboarding/niche-packs`. */
|
|
4431
|
-
interface ListNichePacksResponse extends ApiEnvelope<NichePackSummary[]> {
|
|
4432
|
-
/**
|
|
4433
|
-
* Total niche-pack rows matching the current filter set, ignoring
|
|
4434
|
-
* the page window. Drives the saas-side paginator. Falls back to
|
|
4435
|
-
* `data.length` when the server can't compute a true count.
|
|
4436
|
-
*/
|
|
4437
|
-
total: number;
|
|
4438
|
-
}
|
|
4439
|
-
/** Envelope returned by single-pack endpoints (get / create / update / fork). */
|
|
4440
|
-
type NichePackResponse = ApiEnvelope<NichePack & NichePackSummary>;
|
|
4441
|
-
/** Filters accepted by `adminOnboarding.listOnboardingConfigs`. */
|
|
4442
|
-
interface ListOnboardingConfigsParams {
|
|
4443
|
-
productId?: OnboardingConfig["productId"];
|
|
4444
|
-
status?: NichePackStatus;
|
|
4445
|
-
}
|
|
4446
|
-
/** Body accepted by the create-config endpoint. */
|
|
4447
|
-
interface CreateOnboardingConfigPayload {
|
|
4448
|
-
productId: OnboardingConfig["productId"];
|
|
4449
|
-
version?: string;
|
|
4450
|
-
config?: Record<string, unknown>;
|
|
4451
|
-
}
|
|
4452
|
-
/** Body accepted by the update-config endpoint. */
|
|
4453
|
-
interface UpdateOnboardingConfigPayload {
|
|
4454
|
-
status?: NichePackStatus;
|
|
4455
|
-
config?: Record<string, unknown>;
|
|
4456
|
-
}
|
|
4457
|
-
/** Filters accepted by `adminOnboarding.listOnboardingExperiments`. */
|
|
4458
|
-
interface ListOnboardingExperimentsParams {
|
|
4459
|
-
productId?: OnboardingExperiment["productId"];
|
|
4460
|
-
status?: OnboardingExperimentStatus;
|
|
4461
|
-
/** Page size — server clamps to 1..100, default 25. */
|
|
4462
|
-
limit?: number;
|
|
4463
|
-
/** Pagination offset, default 0. */
|
|
4464
|
-
offset?: number;
|
|
4465
|
-
} /** Body accepted by the create-experiment endpoint. */
|
|
4466
|
-
interface CreateOnboardingExperimentPayload {
|
|
4467
|
-
/** Admin-facing handle; unique platform-wide. */
|
|
4468
|
-
slug: string;
|
|
4469
|
-
productId: OnboardingExperiment["productId"];
|
|
4470
|
-
/** Display name shown in the admin panel. */
|
|
4471
|
-
name: string;
|
|
4472
|
-
description?: string;
|
|
4473
|
-
/** Defaults to `"draft"` server-side. */
|
|
4474
|
-
status?: OnboardingExperimentStatus;
|
|
4475
|
-
/**
|
|
4476
|
-
* Variant routing table — may be empty for a freshly created
|
|
4477
|
-
* draft. Variants whose `cohortRange` overlaps are rejected with
|
|
4478
|
-
* `OVERLAPPING_VARIANTS`.
|
|
4479
|
-
*/
|
|
4480
|
-
variants?: OnboardingExperimentVariant[];
|
|
4481
|
-
/** Fallback config version when no variant matches the user's bucket. */
|
|
4482
|
-
controlConfigVersion?: string | null;
|
|
4483
|
-
}
|
|
4484
|
-
/** Body accepted by the patch-experiment endpoint. */
|
|
4485
|
-
interface UpdateOnboardingExperimentPayload {
|
|
4486
|
-
name?: string;
|
|
4487
|
-
description?: string | null;
|
|
4488
|
-
status?: OnboardingExperimentStatus;
|
|
4489
|
-
variants?: OnboardingExperimentVariant[];
|
|
4490
|
-
controlConfigVersion?: string | null;
|
|
4491
|
-
}
|
|
4492
|
-
/** Envelope returned by `GET /platform/admin/onboarding/experiments`. */
|
|
4493
|
-
interface ListOnboardingExperimentsResponse extends ApiEnvelope<OnboardingExperiment[]> {
|
|
4494
|
-
/**
|
|
4495
|
-
* Total experiments matching the current filter set, ignoring the
|
|
4496
|
-
* page window. Drives the saas-side paginator. Falls back to
|
|
4497
|
-
* `data.length` when the server can't compute a true count.
|
|
4498
|
-
*/
|
|
4499
|
-
total: number;
|
|
4500
|
-
}
|
|
4501
|
-
/** Envelope returned by single-experiment endpoints. */
|
|
4502
|
-
type OnboardingExperimentResponse = ApiEnvelope<OnboardingExperiment>;
|
|
4503
|
-
/**
|
|
4504
|
-
* Filters accepted by every analytics endpoint
|
|
4505
|
-
* (`getOnboardingFunnel`, `getOnboardingTimeOnStep`,
|
|
4506
|
-
* `getOnboardingAbandonment`).
|
|
4507
|
-
*
|
|
4508
|
-
* `productId` constrains by product family, `nicheSubtype` by the
|
|
4509
|
-
* `nichePackSlug` recorded on the originating session row. `fromDate`
|
|
4510
|
-
* / `toDate` are wire-side ISO 8601 strings (the server coerces them
|
|
4511
|
-
* via Zod's `z.coerce.date()`); when omitted, the server defaults to
|
|
4512
|
-
* the trailing 30 days. The server hard-caps the requested window at
|
|
4513
|
-
* 180 days and rejects `fromDate >= toDate` with 400 INVALID_FIELD.
|
|
4514
|
-
*/
|
|
4515
|
-
interface OnboardingAnalyticsFiltersParams {
|
|
4516
|
-
productId?: "crm" | "laie" | "flow" | string;
|
|
4517
|
-
nicheSubtype?: string;
|
|
4518
|
-
/** ISO 8601 datetime, e.g. `"2025-01-01T00:00:00.000Z"`. */
|
|
4519
|
-
fromDate?: string;
|
|
4520
|
-
/** ISO 8601 datetime. */
|
|
4521
|
-
toDate?: string;
|
|
4522
|
-
}
|
|
4523
|
-
/** One funnel row — distinct sessions that reached `stepId`. */
|
|
4524
|
-
interface OnboardingFunnelStep {
|
|
4525
|
-
productId: string;
|
|
4526
|
-
nichePackSlug: string | null;
|
|
4527
|
-
stepId: string;
|
|
4528
|
-
/** Distinct sessions that emitted at least one event for this step. */
|
|
4529
|
-
sessions: number;
|
|
4530
|
-
/**
|
|
4531
|
-
* Fraction `[0, 1]` of sessions that reached this step relative to
|
|
4532
|
-
* the first step in the same `(productId, nichePackSlug)` flow.
|
|
4533
|
-
* The first step always has `conversionRate = 1`.
|
|
4534
|
-
*/
|
|
4535
|
-
conversionRate: number;
|
|
4536
|
-
}
|
|
4537
|
-
/** Result envelope for `getOnboardingFunnel`. */
|
|
4538
|
-
interface OnboardingFunnelResult {
|
|
4539
|
-
/** Flat list, ordered by `(productId, nichePackSlug, sessions DESC)`. */
|
|
4540
|
-
funnel: OnboardingFunnelStep[];
|
|
4541
|
-
/** Distinct sessions across all rows in the window. */
|
|
4542
|
-
totalSessions: number;
|
|
4543
|
-
}
|
|
4544
|
-
/** One time-on-step row — per `(productId, nichePackSlug, stepId)`. */
|
|
4545
|
-
interface OnboardingTimeOnStepRow {
|
|
4546
|
-
productId: string;
|
|
4547
|
-
nichePackSlug: string | null;
|
|
4548
|
-
stepId: string;
|
|
4549
|
-
/** Median (p50) milliseconds from `stepId` first event → next step. */
|
|
4550
|
-
medianMs: number;
|
|
4551
|
-
/** p95 milliseconds. */
|
|
4552
|
-
p95Ms: number;
|
|
4553
|
-
/** Number of (session, step) pairs that contributed a delta. */
|
|
4554
|
-
sampleSize: number;
|
|
4555
|
-
}
|
|
4556
|
-
/** Result envelope for `getOnboardingTimeOnStep`. */
|
|
4557
|
-
interface OnboardingTimeOnStepResult {
|
|
4558
|
-
rows: OnboardingTimeOnStepRow[];
|
|
4559
|
-
}
|
|
4560
|
-
/** One abandonment bucket — abandoned sessions whose last seen step was `stepId`. */
|
|
4561
|
-
interface OnboardingAbandonmentRow {
|
|
4562
|
-
productId: string;
|
|
4563
|
-
nichePackSlug: string | null;
|
|
4564
|
-
stepId: string;
|
|
4565
|
-
abandonedSessions: number;
|
|
4566
|
-
}
|
|
4567
|
-
/** Result envelope for `getOnboardingAbandonment`. */
|
|
4568
|
-
interface OnboardingAbandonmentResult {
|
|
4569
|
-
rows: OnboardingAbandonmentRow[];
|
|
4570
|
-
totalAbandoned: number;
|
|
4571
|
-
}
|
|
4572
|
-
/** `{ success, data: OnboardingFunnelResult }`. */
|
|
4573
|
-
type OnboardingFunnelResponse = ApiEnvelope<OnboardingFunnelResult>;
|
|
4574
|
-
/** `{ success, data: OnboardingTimeOnStepResult }`. */
|
|
4575
|
-
type OnboardingTimeOnStepResponse = ApiEnvelope<OnboardingTimeOnStepResult>;
|
|
4576
|
-
/** `{ success, data: OnboardingAbandonmentResult }`. */
|
|
4577
|
-
type OnboardingAbandonmentResponse = ApiEnvelope<OnboardingAbandonmentResult>;
|
|
4578
|
-
/**
|
|
4579
|
-
* Admin-side onboarding control plane.
|
|
4580
|
-
*
|
|
4581
|
-
* @example
|
|
4582
|
-
* ```typescript
|
|
4583
|
-
* const { data, total } = await ecod.adminOnboarding.listNichePacks({
|
|
4584
|
-
* productId: "crm",
|
|
4585
|
-
* status: "published",
|
|
4586
|
-
* search: "clinic",
|
|
4587
|
-
* limit: 25,
|
|
4588
|
-
* offset: 0,
|
|
4589
|
-
* });
|
|
4590
|
-
* ```
|
|
4591
|
-
*/
|
|
4592
|
-
declare class AdminOnboarding extends APIResource {
|
|
4593
|
-
/**
|
|
4594
|
-
* List niche packs with optional filtering, search, and pagination.
|
|
4595
|
-
* Server response shape: `{ success, data, total }`.
|
|
4596
|
-
*/
|
|
4597
|
-
listNichePacks(params?: ListNichePacksParams): Promise<ListNichePacksResponse>;
|
|
4598
|
-
/** Fetch a single niche pack by slug. Without `version` returns the latest. */
|
|
4599
|
-
getNichePack(slug: string, version?: string): Promise<NichePackResponse>;
|
|
4600
|
-
/** Create a new niche pack draft. */
|
|
4601
|
-
createNichePack(payload: CreateNichePackPayload): Promise<NichePackResponse>;
|
|
4602
|
-
/** Patch a draft niche pack. Server enforces "at least one field". */
|
|
4603
|
-
updateNichePack(slug: string, payload: UpdateNichePackPayload, version?: string): Promise<NichePackResponse>;
|
|
4604
|
-
/** Flip a niche pack to `published`. */
|
|
4605
|
-
publishNichePack(slug: string, version?: string): Promise<NichePackResponse>;
|
|
4606
|
-
/** Flip a niche pack back to `draft`. */
|
|
4607
|
-
unpublishNichePack(slug: string, version?: string): Promise<NichePackResponse>;
|
|
4608
|
-
/** Fork an existing niche pack into a new draft version. */
|
|
4609
|
-
forkNichePack(slug: string, payload?: ForkNichePackPayload): Promise<NichePackResponse>;
|
|
4610
|
-
/**
|
|
4611
|
-
* Run an in-memory smoke test against a niche pack (task 4.1.5).
|
|
4612
|
-
*
|
|
4613
|
-
* The server resolves the pack row, walks its `onboardingConfig`
|
|
4614
|
-
* with the supplied (or auto-picked) answers, shapes a persona
|
|
4615
|
-
* + workspace profile, and returns the result without writing
|
|
4616
|
-
* anything. Useful for admins to validate a draft pack before
|
|
4617
|
-
* publishing.
|
|
4618
|
-
*
|
|
4619
|
-
* @param slug - Niche pack slug.
|
|
4620
|
-
* @param payload - Optional `{ fromVersion?, answers? }`. Both
|
|
4621
|
-
* fields are independently optional; `version` (the legacy
|
|
4622
|
-
* query-string equivalent) is also supported as a third
|
|
4623
|
-
* argument for parity with the other slug-keyed methods.
|
|
4624
|
-
* @param version - Optional version override applied as a
|
|
4625
|
-
* `?version=` query param (kept for callers that already
|
|
4626
|
-
* thread version through the URL).
|
|
4627
|
-
*/
|
|
4628
|
-
smokeTestNichePack(slug: string, payload?: SmokeTestNichePackPayload, version?: string): Promise<ApiEnvelope<SmokeTestResult>>;
|
|
4629
|
-
listOnboardingConfigs(params?: ListOnboardingConfigsParams): Promise<ApiEnvelope<unknown[]>>;
|
|
4630
|
-
createOnboardingConfig(payload: CreateOnboardingConfigPayload): Promise<ApiEnvelope<unknown>>;
|
|
4631
|
-
updateOnboardingConfig(productId: OnboardingConfig["productId"], version: string, payload: UpdateOnboardingConfigPayload): Promise<ApiEnvelope<unknown>>;
|
|
4632
|
-
publishOnboardingConfig(productId: OnboardingConfig["productId"], version: string): Promise<ApiEnvelope<unknown>>;
|
|
4633
|
-
/**
|
|
4634
|
-
* List onboarding A/B experiments with optional filters and
|
|
4635
|
-
* pagination. Server response shape: `{ success, data, total }`.
|
|
4636
|
-
*/
|
|
4637
|
-
listOnboardingExperiments(params?: ListOnboardingExperimentsParams): Promise<ListOnboardingExperimentsResponse>;
|
|
4638
|
-
/** Fetch a single experiment by its slug. 404 when absent. */
|
|
4639
|
-
getOnboardingExperiment(slug: string): Promise<OnboardingExperimentResponse>;
|
|
4640
|
-
/**
|
|
4641
|
-
* Create a draft experiment. The server enforces:
|
|
4642
|
-
*
|
|
4643
|
-
* - `slug` non-empty + globally unique.
|
|
4644
|
-
* - `productId ∈ {crm, laie, flow}`.
|
|
4645
|
-
* - `variants` is an array (may be empty for a draft).
|
|
4646
|
-
* - Each variant's `cohortRange.from < cohortRange.to`, both in
|
|
4647
|
-
* `[0, 100]`.
|
|
4648
|
-
* - Variants don't overlap (returns 400 `OVERLAPPING_VARIANTS`).
|
|
4649
|
-
*/
|
|
4650
|
-
createOnboardingExperiment(payload: CreateOnboardingExperimentPayload): Promise<OnboardingExperimentResponse>;
|
|
4651
|
-
/**
|
|
4652
|
-
* Patch an experiment. At least one of `name | description |
|
|
4653
|
-
* status | variants | controlConfigVersion` must be supplied —
|
|
4654
|
-
* the server returns 400 `NO_UPDATES` for an empty body. When
|
|
4655
|
-
* `variants` is supplied the overlap validator re-runs.
|
|
4656
|
-
*/
|
|
4657
|
-
updateOnboardingExperiment(slug: string, payload: UpdateOnboardingExperimentPayload): Promise<OnboardingExperimentResponse>;
|
|
4658
|
-
/**
|
|
4659
|
-
* Hard-delete an experiment. Returns the deleted row in `data` for
|
|
4660
|
-
* audit-log convenience. Admin-only — no soft-delete column.
|
|
4661
|
-
*/
|
|
4662
|
-
deleteOnboardingExperiment(slug: string): Promise<OnboardingExperimentResponse>;
|
|
4663
|
-
/**
|
|
4664
|
-
* Funnel-by-step counts for `(productId, nichePackSlug)`, plus
|
|
4665
|
-
* conversion rates relative to each flow's first step.
|
|
4666
|
-
*
|
|
4667
|
-
* Server-side filters: `productId`, `nicheSubtype` (the niche pack
|
|
4668
|
-
* slug — UI-friendly alias of the column name), `fromDate`,
|
|
4669
|
-
* `toDate`. Both date bounds default to the trailing 30 days. The
|
|
4670
|
-
* server clamps the window at 180 days and rejects
|
|
4671
|
-
* `fromDate >= toDate` with 400 INVALID_FIELD.
|
|
4672
|
-
*
|
|
4673
|
-
* Powers the admin Sankey + per-step bar chart in Task 4.3.2.
|
|
4674
|
-
*/
|
|
4675
|
-
getOnboardingFunnel(params?: OnboardingAnalyticsFiltersParams): Promise<OnboardingFunnelResponse>;
|
|
4676
|
-
/**
|
|
4677
|
-
* Median + p95 milliseconds spent on each step (per
|
|
4678
|
-
* `(productId, nichePackSlug, stepId)`), computed via
|
|
4679
|
-
* `LEAD(created_at) OVER (PARTITION BY session_id …)` on the event
|
|
4680
|
-
* stream. Sample size accompanies each row so the saas can
|
|
4681
|
-
* grey-out under-sampled buckets.
|
|
4682
|
-
*/
|
|
4683
|
-
getOnboardingTimeOnStep(params?: OnboardingAnalyticsFiltersParams): Promise<OnboardingTimeOnStepResponse>;
|
|
4684
|
-
/**
|
|
4685
|
-
* Histogram of `stepId` values where sessions went inactive — i.e.
|
|
4686
|
-
* `status = 'abandoned'` OR (active for >24h with no further
|
|
4687
|
-
* events). The server also tallies a `totalAbandoned` aggregate so
|
|
4688
|
-
* the saas can render a percentage column without re-summing.
|
|
4689
|
-
*/
|
|
4690
|
-
getOnboardingAbandonment(params?: OnboardingAnalyticsFiltersParams): Promise<OnboardingAbandonmentResponse>;
|
|
4691
|
-
}
|
|
4692
|
-
|
|
4693
|
-
interface CorsOriginCreatePayload {
|
|
4694
|
-
url: string;
|
|
4695
|
-
name?: string;
|
|
4696
|
-
allowedHeaders?: string[];
|
|
4697
|
-
allowedMethods?: string[];
|
|
4698
|
-
}
|
|
4699
|
-
interface CorsOriginUpdatePayload {
|
|
4700
|
-
url?: string;
|
|
4701
|
-
name?: string;
|
|
4702
|
-
allowedHeaders?: string[];
|
|
4703
|
-
allowedMethods?: string[];
|
|
4704
|
-
isActive?: boolean;
|
|
4705
|
-
}
|
|
4706
|
-
declare class Cors extends APIResource {
|
|
4707
|
-
/**
|
|
4708
|
-
* List all dynamic cross-origin policies.
|
|
4709
|
-
*/
|
|
4710
|
-
list<T = any>(): Promise<T>;
|
|
4711
|
-
/**
|
|
4712
|
-
* Register a new cross-origin client for the SaaS API network dynamically.
|
|
4713
|
-
*/
|
|
4714
|
-
create<T = any>(payload: CorsOriginCreatePayload): Promise<T>;
|
|
4715
|
-
/**
|
|
4716
|
-
* Adjust active states or configurations for an existing origin policy.
|
|
4717
|
-
*/
|
|
4718
|
-
update<T = any>(id: string, payload: CorsOriginUpdatePayload): Promise<T>;
|
|
4719
|
-
/**
|
|
4720
|
-
* Irreversibly drop support for a cross-origin client URL policy permanently.
|
|
4721
|
-
*/
|
|
4722
|
-
delete<T = any>(id: string): Promise<T>;
|
|
4723
|
-
}
|
|
4724
|
-
|
|
4725
|
-
interface SystemHealth {
|
|
4726
|
-
status: string;
|
|
4727
|
-
version: string;
|
|
4728
|
-
env: string;
|
|
4729
|
-
uptime: number;
|
|
4730
|
-
db: string;
|
|
4731
|
-
queueDepth: number;
|
|
4732
|
-
timestamp: string;
|
|
4733
|
-
}
|
|
4734
|
-
/**
|
|
4735
|
-
* Platform health diagnostics.
|
|
4736
|
-
*
|
|
4737
|
-
* Access via `ecod.platform.health`.
|
|
4738
|
-
*/
|
|
4739
|
-
declare class Health extends APIResource {
|
|
4740
|
-
/**
|
|
4741
|
-
* Global platform health check — verifies the core API is operational.
|
|
4742
|
-
* Public endpoint: `GET /health`.
|
|
4743
|
-
*/
|
|
4744
|
-
system(): Promise<SystemHealth>;
|
|
4745
|
-
}
|
|
4746
|
-
|
|
4747
|
-
/**
|
|
4748
|
-
* Filters for querying event and automation execution logs.
|
|
4749
|
-
*/
|
|
4750
|
-
interface LogFilter {
|
|
4751
|
-
/** Page number for pagination (1-indexed). */
|
|
4752
|
-
page?: number;
|
|
4753
|
-
/** Maximum number of records to return per page. */
|
|
4754
|
-
limit?: number;
|
|
4755
|
-
/**
|
|
4756
|
-
* Filter by automation trigger name.
|
|
4757
|
-
* @example "lead_created" | "appointment_booked"
|
|
4758
|
-
*/
|
|
4759
|
-
trigger?: string;
|
|
4760
|
-
/**
|
|
4761
|
-
* Filter by execution status.
|
|
4762
|
-
* @example "success" | "failed" | "pending"
|
|
4763
|
-
*/
|
|
4764
|
-
status?: string;
|
|
4765
|
-
/** Filter logs associated with a specific phone number. */
|
|
4766
|
-
phone?: string;
|
|
4767
|
-
/** Start of the date range (inclusive). ISO 8601 or Date object. */
|
|
4768
|
-
startDate?: string | Date;
|
|
4769
|
-
/** End of the date range (inclusive). ISO 8601 or Date object. */
|
|
4770
|
-
endDate?: string | Date;
|
|
4771
|
-
}
|
|
4772
|
-
/**
|
|
4773
|
-
* Automation event log and provider callback resource.
|
|
4774
|
-
*
|
|
4775
|
-
* Access via `ecod.notifications`.
|
|
4776
|
-
*
|
|
4777
|
-
* This resource is **read-only**. It exposes platform audit trails — useful
|
|
4778
|
-
* for debugging automation failures, monitoring webhook callbacks, and
|
|
4779
|
-
* building internal ops dashboards.
|
|
4780
|
-
*
|
|
4781
|
-
* @example
|
|
4782
|
-
* ```typescript
|
|
4783
|
-
* // Find failed automations in April
|
|
4784
|
-
* const { data } = await ecod.notifications.listLogs({
|
|
4785
|
-
* status: "failed",
|
|
4786
|
-
* startDate: "2026-04-01",
|
|
4787
|
-
* endDate: "2026-04-30",
|
|
4788
|
-
* });
|
|
4789
|
-
* ```
|
|
4790
|
-
*/
|
|
4791
|
-
declare class Notifications extends APIResource {
|
|
4792
|
-
/**
|
|
4793
|
-
* List automation execution logs with optional filtering.
|
|
4794
|
-
*
|
|
4795
|
-
* Each log entry represents one automation run triggered by a platform event.
|
|
4796
|
-
* Filter by `status: "failed"` to build a failure alerting pipeline.
|
|
4797
|
-
*
|
|
4798
|
-
* @param params - Optional filter criteria.
|
|
4799
|
-
* @returns Paginated list of event log objects.
|
|
4800
|
-
*
|
|
4801
|
-
* @example
|
|
4802
|
-
* ```typescript
|
|
4803
|
-
* const { data: failed } = await ecod.notifications.listLogs({
|
|
4804
|
-
* status: "failed",
|
|
4805
|
-
* trigger: "lead_created",
|
|
4806
|
-
* limit: 50,
|
|
4807
|
-
* });
|
|
4808
|
-
* ```
|
|
4809
|
-
*/
|
|
4810
|
-
listLogs(params?: LogFilter): Promise<unknown>;
|
|
4811
|
-
/**
|
|
4812
|
-
* Retrieve the full details for a single automation event log entry.
|
|
4813
|
-
*
|
|
4814
|
-
* @param logId - The unique log ID.
|
|
4815
|
-
* @returns A single event log document including the payload and error trace.
|
|
4816
|
-
*
|
|
4817
|
-
* @example
|
|
4818
|
-
* ```typescript
|
|
4819
|
-
* const { data } = await ecod.notifications.retrieveLog("log_64abc...");
|
|
4820
|
-
* console.log(data.error); // → "Provider timeout after 30s"
|
|
4821
|
-
* ```
|
|
4822
|
-
*/
|
|
4823
|
-
retrieveLog(logId: string): Promise<unknown>;
|
|
4824
|
-
/**
|
|
4825
|
-
* Get a summary statistics object for automation event execution.
|
|
4826
|
-
*
|
|
4827
|
-
* @param params - Optional date range for the summary window.
|
|
4828
|
-
* @returns `{ total, success, failed, pending }` counts.
|
|
4829
|
-
*
|
|
4830
|
-
* @example
|
|
4831
|
-
* ```typescript
|
|
4832
|
-
* const { data: stats } = await ecod.notifications.getStats({
|
|
4833
|
-
* startDate: "2026-04-01",
|
|
4834
|
-
* endDate: "2026-04-30",
|
|
4835
|
-
* });
|
|
4836
|
-
* console.log(`Failed: ${stats.failed} / ${stats.total}`);
|
|
4837
|
-
* ```
|
|
4838
|
-
*/
|
|
4839
|
-
getStats(params?: {
|
|
4840
|
-
startDate?: string;
|
|
4841
|
-
endDate?: string;
|
|
4842
|
-
}): Promise<unknown>;
|
|
4843
|
-
/**
|
|
4844
|
-
* List external provider webhook callback logs.
|
|
4845
|
-
*
|
|
4846
|
-
* These are inbound HTTP callbacks from third-party providers
|
|
4847
|
-
* (payment gateways, email services, etc.) stored for audit purposes.
|
|
4848
|
-
*
|
|
4849
|
-
* @param params - Pagination and date filter options.
|
|
4850
|
-
* @returns Paginated list of callback log records.
|
|
4851
|
-
*
|
|
4852
|
-
* @example
|
|
4853
|
-
* ```typescript
|
|
4854
|
-
* const { data } = await ecod.notifications.listCallbacks({ limit: 20 });
|
|
4855
|
-
* ```
|
|
4856
|
-
*/
|
|
4857
|
-
listCallbacks(params?: Omit<LogFilter, "trigger" | "phone">): Promise<unknown>;
|
|
4858
|
-
/**
|
|
4859
|
-
* List unread CRM notifications and alerts (e.g., lead assignments, system alerts).
|
|
4860
|
-
*
|
|
4861
|
-
* @param params - Optional filters (limit, unreadOnly).
|
|
4862
|
-
* @returns Paginated list of notification objects.
|
|
4863
|
-
* @example
|
|
4864
|
-
* ```typescript
|
|
4865
|
-
* const alerts = await erixClient.notifications.listAlerts({ unreadOnly: true });
|
|
4866
|
-
* ```
|
|
4867
|
-
*/
|
|
4868
|
-
listAlerts<T = any>(params?: {
|
|
4869
|
-
limit?: number;
|
|
4870
|
-
unreadOnly?: boolean;
|
|
4871
|
-
}): Promise<T>;
|
|
4872
|
-
/**
|
|
4873
|
-
* Dismiss/mark a specific notification alert as read.
|
|
4874
|
-
*
|
|
4875
|
-
* @param notificationId - The unique ID of the notification.
|
|
4876
|
-
* @example
|
|
4877
|
-
* ```typescript
|
|
4878
|
-
* await erixClient.notifications.dismissAlert("alert_123");
|
|
4879
|
-
* ```
|
|
4880
|
-
*/
|
|
4881
|
-
dismissAlert<T = any>(notificationId: string): Promise<T>;
|
|
4882
|
-
/**
|
|
4883
|
-
* Clear all notifications for the current tenant immediately.
|
|
4884
|
-
*
|
|
4885
|
-
* @example
|
|
4886
|
-
* ```typescript
|
|
4887
|
-
* await erixClient.notifications.clearAllAlerts();
|
|
4888
|
-
* ```
|
|
4889
|
-
*/
|
|
4890
|
-
clearAllAlerts<T = any>(): Promise<T>;
|
|
4891
|
-
/**
|
|
4892
|
-
* Retry an action from a notification (e.g. failed automation send).
|
|
4893
|
-
*
|
|
4894
|
-
* @param notificationId - The unique ID of the notification.
|
|
4895
|
-
* @example
|
|
4896
|
-
* ```typescript
|
|
4897
|
-
* await erixClient.notifications.retryAction("alert_123");
|
|
4898
|
-
* ```
|
|
4899
|
-
*/
|
|
4900
|
-
retryAction<T = any>(notificationId: string): Promise<T>;
|
|
4901
|
-
}
|
|
4902
|
-
|
|
4903
|
-
/**
|
|
4904
|
-
* Body of `POST /platform/tenants/onboarding/global` — the four-question signup form.
|
|
4905
|
-
*
|
|
4906
|
-
* Fields land directly on `ecodrix_organizations.*` columns (workspace
|
|
4907
|
-
* name, timezone) and `service_config -> 'global'` (primary product,
|
|
4908
|
-
* adaptive flag). See REQ-001.
|
|
4909
|
-
*/
|
|
4910
|
-
interface GlobalOnboardingPayload {
|
|
4911
|
-
/** Workspace / org display name. Persisted to `ecodrix_organizations.name`. */
|
|
4912
|
-
workspaceName: string;
|
|
4913
|
-
/** Personal display name of the signing-up user. */
|
|
4914
|
-
displayName: string;
|
|
4915
|
-
/** IANA timezone, e.g. `"Asia/Kolkata"`. Persisted to `organizations.timezone`. */
|
|
4916
|
-
timezone: string;
|
|
4917
|
-
/**
|
|
4918
|
-
* The product the user wants to start with. `"not_sure"` defers
|
|
4919
|
-
* per-product onboarding to first product open.
|
|
4920
|
-
*/
|
|
4921
|
-
primaryProduct: "crm" | "laie" | "flow" | "not_sure";
|
|
4922
|
-
}
|
|
4923
|
-
/**
|
|
4924
|
-
* Body of `POST /platform/tenants/onboarding/${productId}/start` — opens a per-product onboarding
|
|
4925
|
-
* session. Triggered by the explicit "Enable {Product}" click on
|
|
4926
|
-
* `/products/<productId>` (REQ-002).
|
|
4927
|
-
*/
|
|
4928
|
-
interface StartOnboardingPayload {
|
|
4929
|
-
productId: "crm" | "laie" | "flow";
|
|
4930
|
-
}
|
|
4931
|
-
/**
|
|
4932
|
-
* Body of `POST /platform/tenants/onboarding/${productId}/answer` — records one step's answer and
|
|
4933
|
-
* advances the engine. The saas calls this on every step submit (and as
|
|
4934
|
-
* a debounced PATCH for resumability).
|
|
4935
|
-
*/
|
|
4936
|
-
interface AnswerOnboardingPayload {
|
|
4937
|
-
sessionId: string;
|
|
4938
|
-
stepId: string;
|
|
4939
|
-
/** Shape depends on the step type — string, string[], boolean, etc. */
|
|
4940
|
-
answer: unknown;
|
|
4941
|
-
}
|
|
4942
|
-
/**
|
|
4943
|
-
* Body of `POST /platform/tenants/onboarding/complete` — terminates the session,
|
|
4944
|
-
* upserts the persona, and materializes the workspace defaults.
|
|
4945
|
-
*/
|
|
4946
|
-
interface CompleteOnboardingPayload {
|
|
4947
|
-
sessionId: string;
|
|
4948
|
-
}
|
|
4949
|
-
/**
|
|
4950
|
-
* Body of `POST /platform/tenants/onboarding/${productId}/edit` — post-completion edit of a single
|
|
4951
|
-
* answer from `/settings/onboarding`. Triggers a `persona_recomputed`
|
|
4952
|
-
* event (REQ-010).
|
|
4953
|
-
*/
|
|
4954
|
-
interface EditOnboardingPayload {
|
|
4955
|
-
stepId: string;
|
|
4956
|
-
answer: unknown;
|
|
4957
|
-
}
|
|
4958
|
-
/**
|
|
4959
|
-
* Result of `POST /platform/tenants/onboarding/${productId}/start`.
|
|
4960
|
-
*/
|
|
4961
|
-
interface StartOnboardingResponse {
|
|
4962
|
-
sessionId: string;
|
|
4963
|
-
firstStep: OnboardingStep;
|
|
4964
|
-
}
|
|
4965
|
-
/**
|
|
4966
|
-
* Result of `POST /platform/tenants/onboarding/${productId}/answer`.
|
|
4967
|
-
*/
|
|
4968
|
-
interface AnswerOnboardingResponse {
|
|
4969
|
-
/** `null` when the engine has reached the final step. */
|
|
4970
|
-
nextStep: OnboardingStep | null;
|
|
4971
|
-
draftPersona: Record<string, unknown>;
|
|
4972
|
-
}
|
|
4973
|
-
/**
|
|
4974
|
-
* Result of `GET /platform/tenants/onboarding/${productId}/state`. Returns the active session
|
|
4975
|
-
* (status `"active"`) for `(userId, productId)`, plus the step the
|
|
4976
|
-
* renderer should currently show.
|
|
4977
|
-
*/
|
|
4978
|
-
interface OnboardingStateResponse {
|
|
4979
|
-
session: OnboardingSession | null;
|
|
4980
|
-
currentStep: OnboardingStep | null;
|
|
4981
|
-
}
|
|
4982
|
-
/**
|
|
4983
|
-
* Result of `POST /platform/tenants/onboarding/complete`.
|
|
4984
|
-
*/
|
|
4985
|
-
interface CompleteOnboardingResponse {
|
|
4986
|
-
/** Opaque persona document — full type lives in `resources/persona.ts`. */
|
|
4987
|
-
persona: Record<string, unknown>;
|
|
4988
|
-
workspaceProfile: WorkspaceProfile;
|
|
4989
|
-
}
|
|
4990
|
-
/**
|
|
4991
|
-
* Result of `POST /platform/tenants/onboarding/${productId}/edit`.
|
|
4992
|
-
*/
|
|
4993
|
-
interface EditOnboardingResponse {
|
|
4994
|
-
persona: Record<string, unknown>;
|
|
4995
|
-
/** RFC 6902 JSON Patch describing what changed in the persona. */
|
|
4996
|
-
diff: Array<Record<string, unknown>>;
|
|
4997
|
-
}
|
|
4998
|
-
/**
|
|
4999
|
-
* Adaptive onboarding resource.
|
|
5000
|
-
*
|
|
5001
|
-
* Mounted on the main client as `ecod.onboarding`. Mirrors the seven
|
|
5002
|
-
* tenant-facing routes documented in `design.md` § "API surface".
|
|
5003
|
-
*
|
|
5004
|
-
* @example
|
|
5005
|
-
* ```typescript
|
|
5006
|
-
* await ecod.onboarding.global({
|
|
5007
|
-
* workspaceName: "Acme Health",
|
|
5008
|
-
* displayName: "Alice",
|
|
5009
|
-
* timezone: "Asia/Kolkata",
|
|
5010
|
-
* primaryProduct: "crm",
|
|
5011
|
-
* });
|
|
5012
|
-
*
|
|
5013
|
-
* const { sessionId, firstStep } = await ecod.onboarding.start({ productId: "crm" });
|
|
5014
|
-
* await ecod.onboarding.answer({ sessionId, stepId: firstStep.stepId, answer: "healthcare" });
|
|
5015
|
-
* await ecod.onboarding.complete({ sessionId });
|
|
5016
|
-
* ```
|
|
5017
|
-
*/
|
|
5018
|
-
declare class Onboarding extends APIResource {
|
|
5019
|
-
/**
|
|
5020
|
-
* Submit the four-question global onboarding form (REQ-001).
|
|
5021
|
-
* Updates `ecodrix_organizations.*` columns and
|
|
5022
|
-
* `service_config.global.primaryProduct`.
|
|
5023
|
-
*/
|
|
5024
|
-
global<T = unknown>(payload: GlobalOnboardingPayload): Promise<T>;
|
|
5025
|
-
/**
|
|
5026
|
-
* Open a per-product onboarding session. Called when the user clicks
|
|
5027
|
-
* "Enable {Product}" on `/products/<productId>` (REQ-002).
|
|
5028
|
-
*/
|
|
5029
|
-
start(payload: StartOnboardingPayload): Promise<StartOnboardingResponse>;
|
|
5030
|
-
/**
|
|
5031
|
-
* Record one step's answer and advance the engine. Returns the next
|
|
5032
|
-
* step (or `null` at the end) and the in-progress draft persona.
|
|
5033
|
-
*/
|
|
5034
|
-
answer(payload: AnswerOnboardingPayload): Promise<AnswerOnboardingResponse>;
|
|
5035
|
-
/**
|
|
5036
|
-
* Load the active session for the calling user + product. Used on
|
|
5037
|
-
* page mount + every revisit to support resumability (REQ-010).
|
|
5038
|
-
*/
|
|
5039
|
-
state(productId: string): Promise<OnboardingStateResponse>;
|
|
5040
|
-
/**
|
|
5041
|
-
* Finalise the session, upsert the persona, and materialize the
|
|
5042
|
-
* niche-tuned workspace defaults.
|
|
5043
|
-
*/
|
|
5044
|
-
complete(payload: CompleteOnboardingPayload): Promise<CompleteOnboardingResponse>;
|
|
5045
|
-
/**
|
|
5046
|
-
* Edit a previously-answered step from `/settings/onboarding`. The
|
|
5047
|
-
* server emits a `persona_recomputed` event so the workspace and
|
|
5048
|
-
* persona update in-session (REQ-010).
|
|
5049
|
-
*/
|
|
5050
|
-
edit(payload: EditOnboardingPayload): Promise<EditOnboardingResponse>;
|
|
5051
|
-
/**
|
|
5052
|
-
* Preview the workspace profile that would be materialized if the
|
|
5053
|
-
* session completed right now. Used by the `feature_preview` step.
|
|
5054
|
-
*/
|
|
5055
|
-
previewWorkspace(sessionId: string): Promise<WorkspaceProfile>;
|
|
5056
|
-
}
|
|
5057
|
-
|
|
5058
|
-
declare class Clients extends APIResource {
|
|
5059
|
-
/**
|
|
5060
|
-
* List all clients in the ecosystem.
|
|
5061
|
-
*/
|
|
5062
|
-
list<T = any>(): Promise<T>;
|
|
5063
|
-
/**
|
|
5064
|
-
* Get client count and auto-generate a unique code.
|
|
5065
|
-
*/
|
|
5066
|
-
getCountAndGenerateCode<T = any>(): Promise<T>;
|
|
5067
|
-
/**
|
|
5068
|
-
* Retrieve a single client by client code.
|
|
5069
|
-
*/
|
|
5070
|
-
retrieve<T = any>(clientCode: string): Promise<T>;
|
|
5071
|
-
/**
|
|
5072
|
-
* Get API Key for a specific client (Admin Only).
|
|
5073
|
-
*/
|
|
5074
|
-
getApiKey<T = any>(clientCode: string): Promise<T>;
|
|
5075
|
-
/**
|
|
5076
|
-
* Generate or rotate API Key for a specific client (Admin Only).
|
|
5077
|
-
*/
|
|
5078
|
-
rotateApiKey<T = any>(clientCode: string): Promise<T>;
|
|
5079
|
-
/**
|
|
5080
|
-
* Create a new client identity and provision initial resources.
|
|
5081
|
-
*/
|
|
5082
|
-
create<T = any>(payload: {
|
|
5083
|
-
name: string;
|
|
5084
|
-
clientCode: string;
|
|
5085
|
-
business?: any;
|
|
5086
|
-
plan?: any;
|
|
5087
|
-
}): Promise<T>;
|
|
5088
|
-
/**
|
|
5089
|
-
* Get active service configuration for a specific client.
|
|
5090
|
-
*/
|
|
5091
|
-
getConfig<T = any>(clientCode: string): Promise<T>;
|
|
5092
|
-
/**
|
|
5093
|
-
* Update active service configuration for a specific client.
|
|
5094
|
-
*/
|
|
5095
|
-
updateConfig<T = any>(clientCode: string, payload: any): Promise<T>;
|
|
5096
|
-
/**
|
|
5097
|
-
* List a client's ERIX-Connect connections (masked status + per-module
|
|
5098
|
-
* grants). Replaces the legacy `getSecrets` — credentials are never returned
|
|
5099
|
-
* in plaintext.
|
|
5100
|
-
*/
|
|
5101
|
-
getConnections<T = any>(clientCode: string): Promise<T>;
|
|
5102
|
-
/**
|
|
5103
|
-
* List the ERIX-Connect provider registry (cards + methods + field metadata).
|
|
5104
|
-
*/
|
|
5105
|
-
getConnectProviders<T = any>(clientCode: string): Promise<T>;
|
|
5106
|
-
/**
|
|
5107
|
-
* Connect a provider for a client via a chosen method.
|
|
5108
|
-
*/
|
|
5109
|
-
connectProvider<T = any>(clientCode: string, providerId: string, payload: {
|
|
5110
|
-
method: string;
|
|
5111
|
-
config: Record<string, unknown>;
|
|
5112
|
-
}): Promise<T>;
|
|
5113
|
-
/**
|
|
5114
|
-
* Update an already-connected provider's configuration.
|
|
5115
|
-
*/
|
|
5116
|
-
configureProvider<T = any>(clientCode: string, providerId: string, payload: {
|
|
5117
|
-
method: string;
|
|
5118
|
-
config: Record<string, unknown>;
|
|
5119
|
-
}): Promise<T>;
|
|
5120
|
-
/**
|
|
5121
|
-
* Disconnect a provider for a client.
|
|
5122
|
-
*/
|
|
5123
|
-
disconnectProvider<T = any>(clientCode: string, providerId: string): Promise<T>;
|
|
5124
|
-
/**
|
|
5125
|
-
* Reveal a client's DECRYPTED credentials for a provider (admin/agency).
|
|
5126
|
-
*/
|
|
5127
|
-
revealConnection<T = any>(clientCode: string, providerId: string): Promise<T>;
|
|
5128
|
-
/**
|
|
5129
|
-
* Toggle a per-module access grant (crm | flow | laie) for a client's
|
|
5130
|
-
* connector.
|
|
5131
|
-
*/
|
|
5132
|
-
setConnectionAccess<T = any>(clientCode: string, providerId: string, payload: {
|
|
5133
|
-
module: "crm" | "flow" | "laie";
|
|
5134
|
-
enabled: boolean;
|
|
5135
|
-
}): Promise<T>;
|
|
5136
|
-
/**
|
|
5137
|
-
* Retrieve Data Source connection metadata.
|
|
5138
|
-
*/
|
|
5139
|
-
getDataSource<T = any>(clientCode: string): Promise<T>;
|
|
5140
|
-
/**
|
|
5141
|
-
* Configure Data Source metadata.
|
|
5142
|
-
*/
|
|
5143
|
-
manageDataSource<T = any>(clientCode: string, payload: any): Promise<T>;
|
|
5144
|
-
/**
|
|
5145
|
-
* Update Client Identity and perform cascading updates if required.
|
|
5146
|
-
*/
|
|
5147
|
-
updateIdentity<T = any>(id: string, payload: any): Promise<T>;
|
|
5148
|
-
/**
|
|
5149
|
-
* Initiate Google Re-authentication for OAuth tokens.
|
|
5150
|
-
*/
|
|
5151
|
-
googleReauth<T = any>(clientCode: string, payload?: {
|
|
5152
|
-
authCode?: string;
|
|
5153
|
-
}): Promise<T>;
|
|
5154
|
-
/**
|
|
5155
|
-
* Delete a client and perform cascading cleanup.
|
|
5156
|
-
*/
|
|
5157
|
-
delete<T = any>(id: string): Promise<T>;
|
|
5158
|
-
}
|
|
5159
|
-
declare class Blogs extends APIResource {
|
|
5160
|
-
/**
|
|
5161
|
-
* Retrieve public corporate blogs/news.
|
|
5162
|
-
*/
|
|
5163
|
-
list<T = any>(): Promise<T>;
|
|
5164
|
-
}
|
|
5165
|
-
declare class GlobalLeads extends APIResource {
|
|
5166
|
-
/**
|
|
5167
|
-
* Add a corporate lead capture entry.
|
|
5168
|
-
*/
|
|
5169
|
-
add<T = any>(payload: any): Promise<T>;
|
|
5170
|
-
}
|
|
5171
|
-
declare class Services extends APIResource {
|
|
5172
|
-
clients: Clients;
|
|
5173
|
-
blogs: Blogs;
|
|
5174
|
-
globalLeads: GlobalLeads;
|
|
5175
|
-
constructor(client: any);
|
|
5176
|
-
}
|
|
5177
|
-
|
|
5178
|
-
/**
|
|
5179
|
-
* Copilot resource — synchronous chat, confirmation, and session management.
|
|
5180
|
-
*
|
|
5181
|
-
* Access via `ecod.platform.ai.copilot`.
|
|
5182
|
-
*/
|
|
5183
|
-
declare class Copilot extends APIResource {
|
|
5184
|
-
/**
|
|
5185
|
-
* Send a synchronous (non-streaming) chat message to the copilot.
|
|
5186
|
-
*/
|
|
5187
|
-
chatSync<T = any>(body: Record<string, unknown>): Promise<T>;
|
|
5188
|
-
/**
|
|
5189
|
-
* Confirm a pending copilot action.
|
|
5190
|
-
*/
|
|
5191
|
-
confirm<T = any>(body: Record<string, unknown>): Promise<T>;
|
|
5192
|
-
/**
|
|
5193
|
-
* List all copilot sessions.
|
|
5194
|
-
*/
|
|
5195
|
-
listSessions<T = any>(): Promise<T>;
|
|
5196
|
-
/**
|
|
5197
|
-
* Retrieve a single copilot session by its ID.
|
|
5198
|
-
*
|
|
5199
|
-
* @param id - The session ID.
|
|
5200
|
-
*/
|
|
5201
|
-
getSession<T = any>(id: string): Promise<T>;
|
|
5202
|
-
/**
|
|
5203
|
-
* Delete a copilot session by its ID.
|
|
5204
|
-
*
|
|
5205
|
-
* @param id - The session ID.
|
|
5206
|
-
*/
|
|
5207
|
-
deleteSession<T = any>(id: string): Promise<T>;
|
|
5208
|
-
/**
|
|
5209
|
-
* Returns the version-relative path for the copilot chat streaming
|
|
5210
|
-
* endpoint (`POST /platform/ai/copilot/chat`).
|
|
5211
|
-
*
|
|
5212
|
-
* NOTE: This endpoint is a Server-Sent-Events (SSE) stream. The axios
|
|
5213
|
-
* client is not used for streaming, so SSE consumption must be handled by
|
|
5214
|
-
* the caller (e.g. using `fetch` with a `ReadableStream` reader or an
|
|
5215
|
-
* `EventSource`-compatible client). This method intentionally does not
|
|
5216
|
-
* perform the request or implement streaming.
|
|
5217
|
-
*
|
|
5218
|
-
* @returns The version-relative SSE endpoint path.
|
|
5219
|
-
*/
|
|
5220
|
-
chatStreamUrl(): string;
|
|
5221
|
-
}
|
|
5222
|
-
/**
|
|
5223
|
-
* Platform AI container — groups the `copilot` sub-resource.
|
|
5224
|
-
*
|
|
5225
|
-
* Access via `ecod.platform.ai`.
|
|
5226
|
-
*/
|
|
5227
|
-
declare class PlatformAI {
|
|
5228
|
-
readonly copilot: Copilot;
|
|
5229
|
-
constructor(client: AxiosInstance);
|
|
5230
|
-
}
|
|
5231
|
-
|
|
5232
|
-
/**
|
|
5233
|
-
* Platform authentication resource — registration, login, sessions,
|
|
5234
|
-
* password management, OAuth linking, and organization invitations.
|
|
5235
|
-
*
|
|
5236
|
-
* Access via `ecod.platform.auth`.
|
|
5237
|
-
*/
|
|
5238
|
-
declare class Auth extends APIResource {
|
|
5239
|
-
/**
|
|
5240
|
-
* Register a new platform user / organization.
|
|
5241
|
-
*/
|
|
5242
|
-
register<T = any>(body: Record<string, unknown>): Promise<T>;
|
|
5243
|
-
/**
|
|
5244
|
-
* Authenticate a user and establish a session.
|
|
5245
|
-
*/
|
|
5246
|
-
login<T = any>(body: Record<string, unknown>): Promise<T>;
|
|
5247
|
-
/**
|
|
5248
|
-
* Log out of the current session.
|
|
5249
|
-
*/
|
|
5250
|
-
logout<T = any>(body: Record<string, unknown>): Promise<T>;
|
|
5251
|
-
/**
|
|
5252
|
-
* Log out of every active session for the current user.
|
|
5253
|
-
*/
|
|
5254
|
-
logoutAll<T = any>(body: Record<string, unknown>): Promise<T>;
|
|
5255
|
-
/**
|
|
5256
|
-
* Validate the current session token.
|
|
5257
|
-
*/
|
|
5258
|
-
validateSession<T = any>(body: Record<string, unknown>): Promise<T>;
|
|
5259
|
-
/**
|
|
5260
|
-
* List all active sessions for the current user.
|
|
5261
|
-
*/
|
|
5262
|
-
listSessions<T = any>(): Promise<T>;
|
|
5263
|
-
/**
|
|
5264
|
-
* Revoke a specific session by its ID.
|
|
5265
|
-
*
|
|
5266
|
-
* @param id - The session ID to revoke.
|
|
5267
|
-
*/
|
|
5268
|
-
revokeSession<T = any>(id: string): Promise<T>;
|
|
5269
|
-
/**
|
|
5270
|
-
* Request a one-time password (OTP) to set or change a password.
|
|
5271
|
-
*/
|
|
5272
|
-
requestPasswordOtp<T = any>(body: Record<string, unknown>): Promise<T>;
|
|
5273
|
-
/**
|
|
5274
|
-
* Set a password for the current user.
|
|
5275
|
-
*/
|
|
5276
|
-
setPassword<T = any>(body: Record<string, unknown>): Promise<T>;
|
|
5277
|
-
/**
|
|
5278
|
-
* Change the current user's password.
|
|
5279
|
-
*/
|
|
5280
|
-
changePassword<T = any>(body: Record<string, unknown>): Promise<T>;
|
|
5281
|
-
/**
|
|
5282
|
-
* Begin the forgot-password flow.
|
|
5283
|
-
*/
|
|
5284
|
-
forgotPassword<T = any>(body: Record<string, unknown>): Promise<T>;
|
|
5285
|
-
/**
|
|
5286
|
-
* Reset a password using a reset token.
|
|
5287
|
-
*/
|
|
5288
|
-
resetPassword<T = any>(body: Record<string, unknown>): Promise<T>;
|
|
5289
|
-
/**
|
|
5290
|
-
* Link an OAuth identity to the current user.
|
|
5291
|
-
*/
|
|
5292
|
-
linkOAuth<T = any>(body: Record<string, unknown>): Promise<T>;
|
|
5293
|
-
/**
|
|
5294
|
-
* Retrieve details about an organization invitation by token.
|
|
5295
|
-
*
|
|
5296
|
-
* @param token - The invitation token.
|
|
5297
|
-
*/
|
|
5298
|
-
getInvitation<T = any>(token: string): Promise<T>;
|
|
5299
|
-
/**
|
|
5300
|
-
* Accept an organization invitation by token.
|
|
5301
|
-
*
|
|
5302
|
-
* @param token - The invitation token.
|
|
5303
|
-
* @param body - Optional acceptance payload.
|
|
5304
|
-
*/
|
|
5305
|
-
acceptInvitation<T = any>(token: string, body?: Record<string, unknown>): Promise<T>;
|
|
5306
|
-
}
|
|
5307
|
-
|
|
5308
|
-
/**
|
|
5309
|
-
* Entitlements resource — read current plan entitlements and usage.
|
|
5310
|
-
*
|
|
5311
|
-
* Access via `ecod.platform.billing.entitlements`.
|
|
5312
|
-
*/
|
|
5313
|
-
declare class Entitlements extends APIResource {
|
|
5314
|
-
/**
|
|
5315
|
-
* Retrieve the current organization's entitlements.
|
|
5316
|
-
*/
|
|
5317
|
-
get<T = any>(): Promise<T>;
|
|
5318
|
-
/**
|
|
5319
|
-
* Retrieve current usage against entitlements.
|
|
5320
|
-
*/
|
|
5321
|
-
usage<T = any>(): Promise<T>;
|
|
5322
|
-
}
|
|
5323
|
-
/**
|
|
5324
|
-
* Subscriptions resource — manage plan upgrades, downgrades, cancellations,
|
|
5325
|
-
* and add-ons.
|
|
5326
|
-
*
|
|
5327
|
-
* Access via `ecod.platform.billing.subscriptions`.
|
|
5328
|
-
*/
|
|
5329
|
-
declare class Subscriptions extends APIResource {
|
|
5330
|
-
/**
|
|
5331
|
-
* Upgrade the current subscription plan.
|
|
5332
|
-
*/
|
|
5333
|
-
upgrade<T = any>(body: Record<string, unknown>): Promise<T>;
|
|
5334
|
-
/**
|
|
5335
|
-
* Downgrade the current subscription plan.
|
|
5336
|
-
*/
|
|
5337
|
-
downgrade<T = any>(body: Record<string, unknown>): Promise<T>;
|
|
5338
|
-
/**
|
|
5339
|
-
* Cancel the current subscription.
|
|
5340
|
-
*/
|
|
5341
|
-
cancel<T = any>(body: Record<string, unknown>): Promise<T>;
|
|
5342
|
-
/**
|
|
5343
|
-
* Purchase an add-on for the current subscription.
|
|
5344
|
-
*/
|
|
5345
|
-
purchaseAddon<T = any>(body: Record<string, unknown>): Promise<T>;
|
|
5346
|
-
/**
|
|
5347
|
-
* Cancel a previously purchased add-on.
|
|
5348
|
-
*/
|
|
5349
|
-
cancelAddon<T = any>(body: Record<string, unknown>): Promise<T>;
|
|
5350
|
-
}
|
|
5351
|
-
/**
|
|
5352
|
-
* Plans resource — read publicly available plans.
|
|
5353
|
-
*
|
|
5354
|
-
* Access via `ecod.platform.billing.plans`.
|
|
5355
|
-
*/
|
|
5356
|
-
declare class Plans extends APIResource {
|
|
5357
|
-
/**
|
|
5358
|
-
* List all publicly available plans.
|
|
5359
|
-
*/
|
|
5360
|
-
listPublic<T = any>(): Promise<T>;
|
|
5361
|
-
}
|
|
5362
|
-
/**
|
|
5363
|
-
* Billing checkout resource — plan selection, subscription, verification,
|
|
5364
|
-
* and synchronization.
|
|
5365
|
-
*
|
|
5366
|
-
* Access via `ecod.platform.billing.checkout`.
|
|
5367
|
-
*/
|
|
5368
|
-
declare class BillingCheckout extends APIResource {
|
|
5369
|
-
/**
|
|
5370
|
-
* List plans available at checkout.
|
|
5371
|
-
*/
|
|
5372
|
-
plans<T = any>(): Promise<T>;
|
|
5373
|
-
/**
|
|
5374
|
-
* Subscribe to a plan via checkout.
|
|
5375
|
-
*/
|
|
5376
|
-
subscribe<T = any>(body: Record<string, unknown>): Promise<T>;
|
|
5377
|
-
/**
|
|
5378
|
-
* Verify a checkout payment.
|
|
5379
|
-
*/
|
|
5380
|
-
verify<T = any>(body: Record<string, unknown>): Promise<T>;
|
|
5381
|
-
/**
|
|
5382
|
-
* Cancel an in-progress checkout.
|
|
5383
|
-
*/
|
|
5384
|
-
cancel<T = any>(body: Record<string, unknown>): Promise<T>;
|
|
5385
|
-
/**
|
|
5386
|
-
* Retrieve the current checkout status.
|
|
5387
|
-
*/
|
|
5388
|
-
status<T = any>(): Promise<T>;
|
|
5389
|
-
/**
|
|
5390
|
-
* Synchronize the checkout plan state with the provider.
|
|
5391
|
-
*/
|
|
5392
|
-
syncPlan<T = any>(body: Record<string, unknown>): Promise<T>;
|
|
5393
|
-
}
|
|
5394
|
-
/**
|
|
5395
|
-
* Billing user resource — transactions, subscription, and disputes for the
|
|
5396
|
-
* current user.
|
|
5397
|
-
*
|
|
5398
|
-
* Access via `ecod.platform.billing.user`.
|
|
5399
|
-
*/
|
|
5400
|
-
declare class BillingUser extends APIResource {
|
|
5401
|
-
/**
|
|
5402
|
-
* List the current user's billing transactions.
|
|
5403
|
-
*/
|
|
5404
|
-
transactions<T = any>(): Promise<T>;
|
|
5405
|
-
/**
|
|
5406
|
-
* Retrieve the current user's subscription.
|
|
5407
|
-
*/
|
|
5408
|
-
subscription<T = any>(): Promise<T>;
|
|
5409
|
-
/**
|
|
5410
|
-
* Raise a billing dispute.
|
|
5411
|
-
*/
|
|
5412
|
-
raiseDispute<T = any>(body: Record<string, unknown>): Promise<T>;
|
|
5413
|
-
/**
|
|
5414
|
-
* List the current user's billing disputes.
|
|
5415
|
-
*/
|
|
5416
|
-
disputes<T = any>(): Promise<T>;
|
|
5417
|
-
}
|
|
5418
|
-
/**
|
|
5419
|
-
* Credits resource — balance, transactions, packs, and top-ups.
|
|
5420
|
-
*
|
|
5421
|
-
* Access via `ecod.platform.billing.credits`.
|
|
5422
|
-
*/
|
|
5423
|
-
declare class Credits extends APIResource {
|
|
5424
|
-
/**
|
|
5425
|
-
* Retrieve the current credit balance.
|
|
5426
|
-
*/
|
|
5427
|
-
balance<T = any>(): Promise<T>;
|
|
5428
|
-
/**
|
|
5429
|
-
* List credit transactions.
|
|
5430
|
-
*/
|
|
5431
|
-
transactions<T = any>(): Promise<T>;
|
|
5432
|
-
/**
|
|
5433
|
-
* List available credit packs.
|
|
5434
|
-
*/
|
|
5435
|
-
packs<T = any>(): Promise<T>;
|
|
5436
|
-
/**
|
|
5437
|
-
* Create a credit top-up order.
|
|
5438
|
-
*/
|
|
5439
|
-
topupOrder<T = any>(body: Record<string, unknown>): Promise<T>;
|
|
5440
|
-
/**
|
|
5441
|
-
* Verify a credit top-up payment.
|
|
5442
|
-
*/
|
|
5443
|
-
verifyTopup<T = any>(body: Record<string, unknown>): Promise<T>;
|
|
5444
|
-
/**
|
|
5445
|
-
* Configure automatic credit top-ups.
|
|
5446
|
-
*/
|
|
5447
|
-
setAutoTopup<T = any>(body: Record<string, unknown>): Promise<T>;
|
|
5448
|
-
/**
|
|
5449
|
-
* Configure the daily spend cap (cost control).
|
|
5450
|
-
* Body: `{ dailyCap: number | null, alertPct?: number }`.
|
|
5451
|
-
*/
|
|
5452
|
-
setSpendCap<T = any>(body: Record<string, unknown>): Promise<T>;
|
|
5453
|
-
}
|
|
5454
|
-
/**
|
|
5455
|
-
* Platform billing container — groups the `entitlements`, `subscriptions`,
|
|
5456
|
-
* `plans`, `checkout`, `user`, and `credits` sub-resources.
|
|
5457
|
-
*
|
|
5458
|
-
* Access via `ecod.platform.billing`.
|
|
5459
|
-
*/
|
|
5460
|
-
declare class Billing {
|
|
5461
|
-
readonly entitlements: Entitlements;
|
|
5462
|
-
readonly subscriptions: Subscriptions;
|
|
5463
|
-
readonly plans: Plans;
|
|
5464
|
-
readonly checkout: BillingCheckout;
|
|
5465
|
-
readonly user: BillingUser;
|
|
5466
|
-
readonly credits: Credits;
|
|
5467
|
-
constructor(client: AxiosInstance);
|
|
5468
|
-
}
|
|
5469
|
-
|
|
5470
|
-
/**
|
|
5471
|
-
* Platform support resource — categories and support ticket lifecycle.
|
|
5472
|
-
*
|
|
5473
|
-
* Access via `ecod.platform.support`.
|
|
5474
|
-
*/
|
|
5475
|
-
declare class Support extends APIResource {
|
|
5476
|
-
/**
|
|
5477
|
-
* List available support categories.
|
|
5478
|
-
*/
|
|
5479
|
-
categories<T = any>(): Promise<T>;
|
|
5480
|
-
/**
|
|
5481
|
-
* List support tickets with optional filtering.
|
|
5482
|
-
*
|
|
5483
|
-
* @param params - Optional query parameters (status, pagination, etc.).
|
|
5484
|
-
*/
|
|
5485
|
-
listTickets<T = any>(params?: Record<string, unknown>): Promise<T>;
|
|
5486
|
-
/**
|
|
5487
|
-
* Create a new support ticket.
|
|
5488
|
-
*/
|
|
5489
|
-
createTicket<T = any>(body: Record<string, unknown>): Promise<T>;
|
|
5490
|
-
/**
|
|
5491
|
-
* Retrieve a single support ticket by its ID.
|
|
5492
|
-
*
|
|
5493
|
-
* @param id - The support ticket ID.
|
|
5494
|
-
*/
|
|
5495
|
-
getTicket<T = any>(id: string): Promise<T>;
|
|
5496
|
-
/**
|
|
5497
|
-
* Reply to an existing support ticket.
|
|
5498
|
-
*
|
|
5499
|
-
* @param id - The support ticket ID.
|
|
5500
|
-
* @param body - The reply payload.
|
|
5501
|
-
*/
|
|
5502
|
-
reply<T = any>(id: string, body: Record<string, unknown>): Promise<T>;
|
|
5503
|
-
/**
|
|
5504
|
-
* Close a support ticket.
|
|
5505
|
-
*
|
|
5506
|
-
* @param id - The support ticket ID.
|
|
5507
|
-
*/
|
|
5508
|
-
close<T = any>(id: string): Promise<T>;
|
|
5509
|
-
}
|
|
5510
|
-
|
|
5511
|
-
/**
|
|
5512
|
-
* Current-user ("me") resource — profile, organization, modules,
|
|
5513
|
-
* workspaces, and active-org management.
|
|
5514
|
-
*
|
|
5515
|
-
* Access via `ecod.platform.users.me`.
|
|
5516
|
-
*/
|
|
5517
|
-
declare class Me extends APIResource {
|
|
5518
|
-
/**
|
|
5519
|
-
* Retrieve the current authenticated user's profile.
|
|
5520
|
-
*/
|
|
5521
|
-
get<T = any>(): Promise<T>;
|
|
5522
|
-
/**
|
|
5523
|
-
* Update the current user's profile.
|
|
5524
|
-
*/
|
|
5525
|
-
update<T = any>(body: Record<string, unknown>): Promise<T>;
|
|
5526
|
-
/**
|
|
5527
|
-
* Update the current user's active organization details.
|
|
5528
|
-
*/
|
|
5529
|
-
updateOrganization<T = any>(body: Record<string, unknown>): Promise<T>;
|
|
5530
|
-
/**
|
|
5531
|
-
* Toggle enabled modules for the current user / organization.
|
|
5532
|
-
*/
|
|
5533
|
-
toggleModules<T = any>(body: Record<string, unknown>): Promise<T>;
|
|
5534
|
-
/**
|
|
5535
|
-
* List the workspaces available to the current user.
|
|
5536
|
-
*/
|
|
5537
|
-
workspaces<T = any>(): Promise<T>;
|
|
5538
|
-
/**
|
|
5539
|
-
* Set the active organization for the current user.
|
|
5540
|
-
*/
|
|
5541
|
-
setActiveOrg<T = any>(body: Record<string, unknown>): Promise<T>;
|
|
5542
|
-
/**
|
|
5543
|
-
* Dismiss the workspace setup prompt for the current user.
|
|
5544
|
-
*/
|
|
5545
|
-
dismissWorkspaceSetup<T = any>(): Promise<T>;
|
|
5546
|
-
}
|
|
5547
|
-
/**
|
|
5548
|
-
* Organization members resource — list, invite, and remove members.
|
|
5549
|
-
*
|
|
5550
|
-
* Access via `ecod.platform.users.members`.
|
|
5551
|
-
*/
|
|
5552
|
-
declare class Members extends APIResource {
|
|
5553
|
-
/**
|
|
5554
|
-
* List all members of the current organization.
|
|
5555
|
-
*/
|
|
5556
|
-
list<T = any>(): Promise<T>;
|
|
5557
|
-
/**
|
|
5558
|
-
* Invite a new member to the current organization.
|
|
5559
|
-
*/
|
|
5560
|
-
invite<T = any>(body: Record<string, unknown>): Promise<T>;
|
|
5561
|
-
/**
|
|
5562
|
-
* Remove a member from the current organization.
|
|
5563
|
-
*
|
|
5564
|
-
* @param id - The member ID to remove.
|
|
5565
|
-
*/
|
|
5566
|
-
remove<T = any>(id: string): Promise<T>;
|
|
5567
|
-
}
|
|
5568
|
-
/**
|
|
5569
|
-
* User sessions resource — list and revoke sessions.
|
|
5570
|
-
*
|
|
5571
|
-
* Access via `ecod.platform.users.sessions`.
|
|
5572
|
-
*/
|
|
5573
|
-
declare class Sessions extends APIResource {
|
|
5574
|
-
/**
|
|
5575
|
-
* List all sessions for the current user.
|
|
5576
|
-
*/
|
|
5577
|
-
list<T = any>(): Promise<T>;
|
|
5578
|
-
/**
|
|
5579
|
-
* Revoke a specific session by its ID.
|
|
5580
|
-
*
|
|
5581
|
-
* @param id - The session ID to revoke.
|
|
5582
|
-
*/
|
|
5583
|
-
revoke<T = any>(id: string): Promise<T>;
|
|
5584
|
-
/**
|
|
5585
|
-
* Revoke all sessions for the current user.
|
|
5586
|
-
*/
|
|
5587
|
-
revokeAll<T = any>(): Promise<T>;
|
|
5588
|
-
}
|
|
5589
|
-
|
|
5590
|
-
/**
|
|
5591
|
-
* Platform-admin activity logs resource — list and export activity logs.
|
|
5592
|
-
*
|
|
5593
|
-
* Access via `ecod.platform.admin.activityLogs`.
|
|
5594
|
-
*/
|
|
5595
|
-
declare class AdminActivityLogs extends APIResource {
|
|
5596
|
-
/**
|
|
5597
|
-
* List activity logs.
|
|
5598
|
-
*/
|
|
5599
|
-
list<T = any>(params?: Record<string, unknown>): Promise<T>;
|
|
5600
|
-
/**
|
|
5601
|
-
* Export activity logs.
|
|
5602
|
-
*/
|
|
5603
|
-
export<T = any>(params?: Record<string, unknown>): Promise<T>;
|
|
5604
|
-
}
|
|
5605
|
-
|
|
5606
|
-
/**
|
|
5607
|
-
* Platform-admin agency invoices resource — agency invoice settings and CRUD.
|
|
5608
|
-
*
|
|
5609
|
-
* NOTE: the doubled `admin/invoice-settings` / `admin/invoices` segments are
|
|
5610
|
-
* intentional — a legacy router is mounted under the new prefix.
|
|
5611
|
-
*
|
|
5612
|
-
* Access via `ecod.platform.admin.agencyInvoices`.
|
|
5613
|
-
*/
|
|
5614
|
-
declare class AdminAgencyInvoices extends APIResource {
|
|
5615
|
-
/**
|
|
5616
|
-
* Retrieve agency invoice settings.
|
|
5617
|
-
*/
|
|
5618
|
-
getSettings<T = any>(): Promise<T>;
|
|
5619
|
-
/**
|
|
5620
|
-
* Update agency invoice settings.
|
|
5621
|
-
*/
|
|
5622
|
-
updateSettings<T = any>(body: Record<string, unknown>): Promise<T>;
|
|
5623
|
-
/**
|
|
5624
|
-
* List agency invoices.
|
|
5625
|
-
*/
|
|
5626
|
-
list<T = any>(params?: Record<string, unknown>): Promise<T>;
|
|
5627
|
-
/**
|
|
5628
|
-
* Create an agency invoice.
|
|
5629
|
-
*/
|
|
5630
|
-
create<T = any>(body: Record<string, unknown>): Promise<T>;
|
|
5631
|
-
/**
|
|
5632
|
-
* Retrieve a single agency invoice by ID.
|
|
5633
|
-
*/
|
|
5634
|
-
retrieve<T = any>(id: string): Promise<T>;
|
|
5635
|
-
/**
|
|
5636
|
-
* Update an agency invoice.
|
|
5637
|
-
*/
|
|
5638
|
-
update<T = any>(id: string, body: Record<string, unknown>): Promise<T>;
|
|
5639
|
-
/**
|
|
5640
|
-
* Delete an agency invoice.
|
|
5641
|
-
*/
|
|
5642
|
-
remove<T = any>(id: string): Promise<T>;
|
|
5643
|
-
}
|
|
5644
|
-
|
|
5645
|
-
/**
|
|
5646
|
-
* Platform-admin agents resource — inspect and manage agents.
|
|
5647
|
-
*
|
|
5648
|
-
* Access via `ecod.platform.admin.agents`.
|
|
5649
|
-
*/
|
|
5650
|
-
declare class AdminAgents extends APIResource {
|
|
5651
|
-
/**
|
|
5652
|
-
* Retrieve aggregate agent statistics.
|
|
5653
|
-
*/
|
|
5654
|
-
stats<T = any>(params?: Record<string, unknown>): Promise<T>;
|
|
5655
|
-
/**
|
|
5656
|
-
* List all agents.
|
|
5657
|
-
*/
|
|
5658
|
-
list<T = any>(params?: Record<string, unknown>): Promise<T>;
|
|
5659
|
-
/**
|
|
5660
|
-
* Retrieve a single agent by ID.
|
|
5661
|
-
*/
|
|
5662
|
-
retrieve<T = any>(id: string): Promise<T>;
|
|
5663
|
-
/**
|
|
5664
|
-
* Update an existing agent.
|
|
5665
|
-
*/
|
|
5666
|
-
update<T = any>(id: string, body: Record<string, unknown>): Promise<T>;
|
|
5667
|
-
/**
|
|
5668
|
-
* List runs for an agent.
|
|
5669
|
-
*/
|
|
5670
|
-
runs<T = any>(id: string): Promise<T>;
|
|
5671
|
-
}
|
|
5672
|
-
|
|
5673
|
-
/**
|
|
5674
|
-
* Platform-admin analytics resource — platform-wide analytics overviews.
|
|
5675
|
-
*
|
|
5676
|
-
* Access via `ecod.platform.admin.analytics`.
|
|
5677
|
-
*/
|
|
5678
|
-
declare class AdminAnalytics extends APIResource {
|
|
5679
|
-
/**
|
|
5680
|
-
* Retrieve the analytics overview.
|
|
5681
|
-
*/
|
|
5682
|
-
overview<T = any>(params?: Record<string, unknown>): Promise<T>;
|
|
5683
|
-
/**
|
|
5684
|
-
* Retrieve per-endpoint analytics.
|
|
5685
|
-
*/
|
|
5686
|
-
endpoints<T = any>(params?: Record<string, unknown>): Promise<T>;
|
|
5687
|
-
/**
|
|
5688
|
-
* Retrieve error analytics.
|
|
5689
|
-
*/
|
|
5690
|
-
errors<T = any>(params?: Record<string, unknown>): Promise<T>;
|
|
5691
|
-
/**
|
|
5692
|
-
* Retrieve per-tenant analytics.
|
|
5693
|
-
*/
|
|
5694
|
-
tenants<T = any>(params?: Record<string, unknown>): Promise<T>;
|
|
5695
|
-
}
|
|
5696
|
-
|
|
5697
|
-
/**
|
|
5698
|
-
* Platform-admin announcements resource — manage communications,
|
|
5699
|
-
* broadcasts, maintenance windows, and changelog entries.
|
|
5700
|
-
*
|
|
5701
|
-
* Access via `ecod.platform.admin.announcements`.
|
|
5702
|
-
*/
|
|
5703
|
-
declare class AdminAnnouncements extends APIResource {
|
|
5704
|
-
/**
|
|
5705
|
-
* List all communications.
|
|
5706
|
-
*/
|
|
5707
|
-
list<T = any>(params?: Record<string, unknown>): Promise<T>;
|
|
5708
|
-
/**
|
|
5709
|
-
* Create a new communication.
|
|
5710
|
-
*/
|
|
5711
|
-
create<T = any>(body: Record<string, unknown>): Promise<T>;
|
|
5712
|
-
/**
|
|
5713
|
-
* Update an existing communication.
|
|
5714
|
-
*/
|
|
5715
|
-
update<T = any>(id: string, body: Record<string, unknown>): Promise<T>;
|
|
5716
|
-
/**
|
|
5717
|
-
* Delete a communication.
|
|
5718
|
-
*/
|
|
5719
|
-
remove<T = any>(id: string): Promise<T>;
|
|
5720
|
-
/**
|
|
5721
|
-
* Publish a communication.
|
|
5722
|
-
*/
|
|
5723
|
-
publish<T = any>(id: string, body?: Record<string, unknown>): Promise<T>;
|
|
5724
|
-
/**
|
|
5725
|
-
* Broadcast a communication to recipients.
|
|
5726
|
-
*/
|
|
5727
|
-
broadcast<T = any>(body: Record<string, unknown>): Promise<T>;
|
|
5728
|
-
/**
|
|
5729
|
-
* Set the maintenance window.
|
|
5730
|
-
*/
|
|
5731
|
-
setMaintenance<T = any>(body: Record<string, unknown>): Promise<T>;
|
|
5732
|
-
/**
|
|
5733
|
-
* Retrieve the current maintenance window.
|
|
5734
|
-
*/
|
|
5735
|
-
getMaintenance<T = any>(params?: Record<string, unknown>): Promise<T>;
|
|
5736
|
-
/**
|
|
5737
|
-
* Post a changelog entry.
|
|
5738
|
-
*/
|
|
5739
|
-
changelog<T = any>(body: Record<string, unknown>): Promise<T>;
|
|
5740
|
-
}
|
|
5741
|
-
|
|
5742
|
-
/**
|
|
5743
|
-
* Platform-admin audit logs resource — audit statistics, listing, and export.
|
|
5744
|
-
*
|
|
5745
|
-
* Access via `ecod.platform.admin.auditLogs`.
|
|
5746
|
-
*/
|
|
5747
|
-
declare class AdminAuditLogs extends APIResource {
|
|
5748
|
-
/**
|
|
5749
|
-
* Retrieve aggregate audit statistics.
|
|
5750
|
-
*/
|
|
5751
|
-
stats<T = any>(params?: Record<string, unknown>): Promise<T>;
|
|
5752
|
-
/**
|
|
5753
|
-
* List audit log entries.
|
|
5754
|
-
*/
|
|
5755
|
-
list<T = any>(params?: Record<string, unknown>): Promise<T>;
|
|
5756
|
-
/**
|
|
5757
|
-
* Export audit log entries.
|
|
5758
|
-
*/
|
|
5759
|
-
export<T = any>(params?: Record<string, unknown>): Promise<T>;
|
|
5760
|
-
}
|
|
5761
|
-
|
|
5762
|
-
/**
|
|
5763
|
-
* Platform-admin billing resource — billing events, trial extensions,
|
|
5764
|
-
* grandfathering, and reconciliation.
|
|
5765
|
-
*
|
|
5766
|
-
* Access via `ecod.platform.admin.billing`.
|
|
5767
|
-
*/
|
|
5768
|
-
declare class AdminBilling extends APIResource {
|
|
5769
|
-
/**
|
|
5770
|
-
* List all billing events.
|
|
5771
|
-
*/
|
|
5772
|
-
events<T = any>(params?: Record<string, unknown>): Promise<T>;
|
|
5773
|
-
/**
|
|
5774
|
-
* List billing events for a specific organization.
|
|
5775
|
-
*/
|
|
5776
|
-
orgEvents<T = any>(orgId: string): Promise<T>;
|
|
5777
|
-
/**
|
|
5778
|
-
* List failed billing events.
|
|
5779
|
-
*/
|
|
5780
|
-
failed<T = any>(params?: Record<string, unknown>): Promise<T>;
|
|
5781
|
-
/**
|
|
5782
|
-
* Record a billing event.
|
|
5783
|
-
*/
|
|
5784
|
-
recordEvent<T = any>(body: Record<string, unknown>): Promise<T>;
|
|
5785
|
-
/**
|
|
5786
|
-
* Extend a trial period.
|
|
5787
|
-
*/
|
|
5788
|
-
extendTrial<T = any>(body: Record<string, unknown>): Promise<T>;
|
|
5789
|
-
/**
|
|
5790
|
-
* Grandfather an organization onto legacy pricing.
|
|
5791
|
-
*/
|
|
5792
|
-
grandfather<T = any>(body: Record<string, unknown>): Promise<T>;
|
|
5793
|
-
/**
|
|
5794
|
-
* Reconcile billing state with the provider.
|
|
5795
|
-
*/
|
|
5796
|
-
reconcile<T = any>(params?: Record<string, unknown>): Promise<T>;
|
|
5797
|
-
}
|
|
5798
|
-
|
|
5799
|
-
/**
|
|
5800
|
-
* Platform-admin blogs resource — blog content management.
|
|
5801
|
-
*
|
|
5802
|
-
* NOTE: the doubled `services/blogs` segments are intentional — a legacy
|
|
5803
|
-
* router is mounted under the new prefix.
|
|
5804
|
-
*
|
|
5805
|
-
* Access via `ecod.platform.admin.blogs`.
|
|
5806
|
-
*/
|
|
5807
|
-
declare class AdminBlogs extends APIResource {
|
|
5808
|
-
/**
|
|
5809
|
-
* List blog posts.
|
|
5810
|
-
*/
|
|
5811
|
-
list<T = any>(params?: Record<string, unknown>): Promise<T>;
|
|
5812
|
-
/**
|
|
5813
|
-
* Retrieve a single blog post by slug or ID.
|
|
5814
|
-
*/
|
|
5815
|
-
retrieve<T = any>(slugOrId: string): Promise<T>;
|
|
5816
|
-
/**
|
|
5817
|
-
* Create a blog post.
|
|
5818
|
-
*/
|
|
5819
|
-
create<T = any>(body: Record<string, unknown>): Promise<T>;
|
|
5820
|
-
/**
|
|
5821
|
-
* Update a blog post by slug or ID.
|
|
5822
|
-
*/
|
|
5823
|
-
update<T = any>(slugOrId: string, body: Record<string, unknown>): Promise<T>;
|
|
5824
|
-
/**
|
|
5825
|
-
* Delete a blog post by slug or ID.
|
|
5826
|
-
*/
|
|
5827
|
-
remove<T = any>(slugOrId: string): Promise<T>;
|
|
5828
|
-
}
|
|
5829
|
-
|
|
5830
|
-
/**
|
|
5831
|
-
* Platform-admin compliance resource — manage compliance requests and
|
|
5832
|
-
* organization data exports.
|
|
5833
|
-
*
|
|
5834
|
-
* Access via `ecod.platform.admin.compliance`.
|
|
5835
|
-
*/
|
|
5836
|
-
declare class AdminCompliance extends APIResource {
|
|
5837
|
-
/**
|
|
5838
|
-
* List compliance requests.
|
|
5839
|
-
*/
|
|
5840
|
-
requests<T = any>(params?: Record<string, unknown>): Promise<T>;
|
|
5841
|
-
/**
|
|
5842
|
-
* Create a new compliance request.
|
|
5843
|
-
*/
|
|
5844
|
-
createRequest<T = any>(body: Record<string, unknown>): Promise<T>;
|
|
5845
|
-
/**
|
|
5846
|
-
* Update an existing compliance request.
|
|
5847
|
-
*/
|
|
5848
|
-
updateRequest<T = any>(id: string, body: Record<string, unknown>): Promise<T>;
|
|
5849
|
-
/**
|
|
5850
|
-
* Export compliance data for an organization.
|
|
5851
|
-
*/
|
|
5852
|
-
exportOrg<T = any>(orgId: string, body?: Record<string, unknown>): Promise<T>;
|
|
5853
|
-
}
|
|
5854
|
-
|
|
5855
|
-
/**
|
|
5856
|
-
* Platform-admin credits resource — rate cards, credit packs, and wallets.
|
|
5857
|
-
*
|
|
5858
|
-
* Access via `ecod.platform.admin.credits`.
|
|
5859
|
-
*/
|
|
5860
|
-
declare class AdminCredits extends APIResource {
|
|
5861
|
-
/**
|
|
5862
|
-
* Retrieve the credits rate card.
|
|
5863
|
-
*/
|
|
5864
|
-
rateCard<T = any>(params?: Record<string, unknown>): Promise<T>;
|
|
5865
|
-
/**
|
|
5866
|
-
* List all credit packs.
|
|
5867
|
-
*/
|
|
5868
|
-
packs<T = any>(params?: Record<string, unknown>): Promise<T>;
|
|
5869
|
-
/**
|
|
5870
|
-
* Create a new credit pack.
|
|
5871
|
-
*/
|
|
5872
|
-
createPack<T = any>(body: Record<string, unknown>): Promise<T>;
|
|
5873
|
-
/**
|
|
5874
|
-
* Update an existing credit pack.
|
|
5875
|
-
*/
|
|
5876
|
-
updatePack<T = any>(id: string, body: Record<string, unknown>): Promise<T>;
|
|
5877
|
-
/**
|
|
5878
|
-
* Delete a credit pack.
|
|
5879
|
-
*/
|
|
5880
|
-
deletePack<T = any>(id: string): Promise<T>;
|
|
5881
|
-
/**
|
|
5882
|
-
* Retrieve the credit wallet for an organization.
|
|
5883
|
-
*/
|
|
5884
|
-
wallet<T = any>(orgId: string): Promise<T>;
|
|
5885
|
-
/**
|
|
5886
|
-
* Adjust the credit wallet balance for an organization.
|
|
5887
|
-
*/
|
|
5888
|
-
adjustWallet<T = any>(orgId: string, body: Record<string, unknown>): Promise<T>;
|
|
5889
|
-
}
|
|
5890
|
-
|
|
5891
|
-
/**
|
|
5892
|
-
* Platform-admin dashboard resource — admin dashboard statistics.
|
|
5893
|
-
*
|
|
5894
|
-
* Access via `ecod.platform.admin.dashboard`.
|
|
5895
|
-
*/
|
|
5896
|
-
declare class AdminDashboard extends APIResource {
|
|
5897
|
-
/**
|
|
5898
|
-
* Retrieve admin dashboard statistics.
|
|
5899
|
-
*
|
|
5900
|
-
* NOTE: the doubled `admin/dashboard` segment is intentional — a legacy
|
|
5901
|
-
* router is mounted under the new prefix.
|
|
5902
|
-
*/
|
|
5903
|
-
stats<T = any>(params?: Record<string, unknown>): Promise<T>;
|
|
5904
|
-
}
|
|
5905
|
-
|
|
5906
|
-
/**
|
|
5907
|
-
* Platform-admin email monitor resource — cross-tenant email monitoring.
|
|
5908
|
-
*
|
|
5909
|
-
* Access via `ecod.platform.admin.email`.
|
|
5910
|
-
*/
|
|
5911
|
-
declare class AdminEmail extends APIResource {
|
|
5912
|
-
/**
|
|
5913
|
-
* Retrieve the platform-wide email overview.
|
|
5914
|
-
*/
|
|
5915
|
-
overview<T = any>(params?: Record<string, unknown>): Promise<T>;
|
|
5916
|
-
/**
|
|
5917
|
-
* List email campaigns across tenants.
|
|
5918
|
-
*/
|
|
5919
|
-
campaigns<T = any>(params?: Record<string, unknown>): Promise<T>;
|
|
5920
|
-
/**
|
|
5921
|
-
* List email events (opens, clicks, bounces, etc.).
|
|
5922
|
-
*/
|
|
5923
|
-
events<T = any>(params?: Record<string, unknown>): Promise<T>;
|
|
5924
|
-
/**
|
|
5925
|
-
* Retrieve SES health metrics.
|
|
5926
|
-
*/
|
|
5927
|
-
sesHealth<T = any>(params?: Record<string, unknown>): Promise<T>;
|
|
5928
|
-
}
|
|
5929
|
-
|
|
5930
|
-
/**
|
|
5931
|
-
* Platform-admin Erix resource — Erix tenant provisioning and lifecycle.
|
|
5932
|
-
*
|
|
5933
|
-
* Access via `ecod.platform.admin.erix`.
|
|
5934
|
-
*/
|
|
5935
|
-
declare class AdminErix extends APIResource {
|
|
5936
|
-
/**
|
|
5937
|
-
* Create a new Erix tenant.
|
|
5938
|
-
*/
|
|
5939
|
-
createTenant<T = any>(body: Record<string, unknown>): Promise<T>;
|
|
5940
|
-
/**
|
|
5941
|
-
* List Erix tenants.
|
|
5942
|
-
*/
|
|
5943
|
-
tenants<T = any>(params?: Record<string, unknown>): Promise<T>;
|
|
5944
|
-
/**
|
|
5945
|
-
* Retrieve a single Erix tenant by ID.
|
|
5946
|
-
*/
|
|
5947
|
-
tenant<T = any>(id: string): Promise<T>;
|
|
5948
|
-
/**
|
|
5949
|
-
* Update the plan for an Erix tenant.
|
|
5950
|
-
*/
|
|
5951
|
-
updatePlan<T = any>(id: string, body: Record<string, unknown>): Promise<T>;
|
|
5952
|
-
/**
|
|
5953
|
-
* Suspend an Erix tenant.
|
|
5954
|
-
*/
|
|
5955
|
-
suspend<T = any>(id: string, body?: Record<string, unknown>): Promise<T>;
|
|
5956
|
-
/**
|
|
5957
|
-
* Reactivate a suspended Erix tenant.
|
|
5958
|
-
*/
|
|
5959
|
-
reactivate<T = any>(id: string, body?: Record<string, unknown>): Promise<T>;
|
|
5960
|
-
/**
|
|
5961
|
-
* Rotate the API key for an Erix tenant.
|
|
5962
|
-
*/
|
|
5963
|
-
rotateKey<T = any>(id: string, body?: Record<string, unknown>): Promise<T>;
|
|
5964
|
-
/**
|
|
5965
|
-
* Retrieve usage metrics for an Erix tenant.
|
|
5966
|
-
*/
|
|
5967
|
-
usage<T = any>(id: string): Promise<T>;
|
|
5968
|
-
}
|
|
5969
|
-
|
|
5970
|
-
/**
|
|
5971
|
-
* Platform-admin feature flags resource — manage feature flags and their
|
|
5972
|
-
* per-organization overrides.
|
|
5973
|
-
*
|
|
5974
|
-
* Access via `ecod.platform.admin.featureFlags`.
|
|
5975
|
-
*/
|
|
5976
|
-
declare class AdminFeatureFlags extends APIResource {
|
|
5977
|
-
/**
|
|
5978
|
-
* List all feature flags.
|
|
5979
|
-
*/
|
|
5980
|
-
list<T = any>(params?: Record<string, unknown>): Promise<T>;
|
|
5981
|
-
/**
|
|
5982
|
-
* Create a new feature flag.
|
|
5983
|
-
*/
|
|
5984
|
-
create<T = any>(body: Record<string, unknown>): Promise<T>;
|
|
5985
|
-
/**
|
|
5986
|
-
* Update an existing feature flag.
|
|
5987
|
-
*/
|
|
5988
|
-
update<T = any>(id: string, body: Record<string, unknown>): Promise<T>;
|
|
5989
|
-
/**
|
|
5990
|
-
* Delete a feature flag.
|
|
5991
|
-
*/
|
|
5992
|
-
remove<T = any>(id: string): Promise<T>;
|
|
5993
|
-
/**
|
|
5994
|
-
* List per-organization overrides for a feature flag.
|
|
5995
|
-
*/
|
|
5996
|
-
listOverrides<T = any>(id: string): Promise<T>;
|
|
5997
|
-
/**
|
|
5998
|
-
* Add a per-organization override to a feature flag.
|
|
5999
|
-
*/
|
|
6000
|
-
addOverride<T = any>(id: string, body: Record<string, unknown>): Promise<T>;
|
|
6001
|
-
/**
|
|
6002
|
-
* Remove a per-organization override from a feature flag.
|
|
6003
|
-
*/
|
|
6004
|
-
removeOverride<T = any>(id: string, orgId: string): Promise<T>;
|
|
6005
|
-
/**
|
|
6006
|
-
* Retrieve resolved feature flags for a specific organization.
|
|
3760
|
+
* Send a synchronous (non-streaming) chat message to the copilot.
|
|
6007
3761
|
*/
|
|
6008
|
-
|
|
6009
|
-
}
|
|
6010
|
-
|
|
6011
|
-
/**
|
|
6012
|
-
* Platform-admin flow monitor resource — cross-tenant flow run monitoring.
|
|
6013
|
-
*
|
|
6014
|
-
* Access via `ecod.platform.admin.flow`.
|
|
6015
|
-
*/
|
|
6016
|
-
declare class AdminFlow extends APIResource {
|
|
3762
|
+
chatSync<T = any>(body: Record<string, unknown>): Promise<T>;
|
|
6017
3763
|
/**
|
|
6018
|
-
*
|
|
3764
|
+
* Confirm a pending copilot action.
|
|
6019
3765
|
*/
|
|
6020
|
-
|
|
3766
|
+
confirm<T = any>(body: Record<string, unknown>): Promise<T>;
|
|
6021
3767
|
/**
|
|
6022
|
-
* List
|
|
3768
|
+
* List all copilot sessions.
|
|
6023
3769
|
*/
|
|
6024
|
-
|
|
3770
|
+
listSessions<T = any>(): Promise<T>;
|
|
6025
3771
|
/**
|
|
6026
|
-
*
|
|
3772
|
+
* Retrieve a single copilot session by its ID.
|
|
3773
|
+
*
|
|
3774
|
+
* @param id - The session ID.
|
|
6027
3775
|
*/
|
|
6028
|
-
|
|
3776
|
+
getSession<T = any>(id: string): Promise<T>;
|
|
6029
3777
|
/**
|
|
6030
|
-
*
|
|
3778
|
+
* Delete a copilot session by its ID.
|
|
3779
|
+
*
|
|
3780
|
+
* @param id - The session ID.
|
|
6031
3781
|
*/
|
|
6032
|
-
|
|
3782
|
+
deleteSession<T = any>(id: string): Promise<T>;
|
|
6033
3783
|
/**
|
|
6034
|
-
*
|
|
3784
|
+
* Returns the version-relative path for the copilot chat streaming
|
|
3785
|
+
* endpoint (`POST /platform/ai/copilot/chat`).
|
|
3786
|
+
*
|
|
3787
|
+
* NOTE: This endpoint is a Server-Sent-Events (SSE) stream. The axios
|
|
3788
|
+
* client is not used for streaming, so SSE consumption must be handled by
|
|
3789
|
+
* the caller (e.g. using `fetch` with a `ReadableStream` reader or an
|
|
3790
|
+
* `EventSource`-compatible client). This method intentionally does not
|
|
3791
|
+
* perform the request or implement streaming.
|
|
3792
|
+
*
|
|
3793
|
+
* @returns The version-relative SSE endpoint path.
|
|
6035
3794
|
*/
|
|
6036
|
-
|
|
3795
|
+
chatStreamUrl(): string;
|
|
6037
3796
|
}
|
|
6038
|
-
|
|
6039
3797
|
/**
|
|
6040
|
-
* Platform
|
|
3798
|
+
* Platform AI container — groups the `copilot` sub-resource.
|
|
6041
3799
|
*
|
|
6042
|
-
* Access via `ecod.platform.
|
|
3800
|
+
* Access via `ecod.platform.ai`.
|
|
6043
3801
|
*/
|
|
6044
|
-
declare class
|
|
6045
|
-
|
|
6046
|
-
|
|
6047
|
-
*/
|
|
6048
|
-
list<T = any>(orgId: string): Promise<T>;
|
|
6049
|
-
/**
|
|
6050
|
-
* Connect a provider integration for a tenant organization.
|
|
6051
|
-
*/
|
|
6052
|
-
connect<T = any>(orgId: string, providerId: string, body?: Record<string, unknown>): Promise<T>;
|
|
6053
|
-
/**
|
|
6054
|
-
* Disconnect a provider integration for a tenant organization.
|
|
6055
|
-
*/
|
|
6056
|
-
disconnect<T = any>(orgId: string, providerId: string): Promise<T>;
|
|
6057
|
-
/**
|
|
6058
|
-
* Test a provider integration for a tenant organization.
|
|
6059
|
-
*/
|
|
6060
|
-
test<T = any>(orgId: string, providerId: string, body?: Record<string, unknown>): Promise<T>;
|
|
6061
|
-
/**
|
|
6062
|
-
* Send an integration invite for a tenant organization.
|
|
6063
|
-
*/
|
|
6064
|
-
invite<T = any>(orgId: string, body: Record<string, unknown>): Promise<T>;
|
|
3802
|
+
declare class PlatformAI {
|
|
3803
|
+
readonly copilot: Copilot;
|
|
3804
|
+
constructor(client: AxiosInstance);
|
|
6065
3805
|
}
|
|
6066
3806
|
|
|
6067
|
-
/**
|
|
6068
|
-
|
|
6069
|
-
|
|
6070
|
-
|
|
6071
|
-
|
|
6072
|
-
*/
|
|
6073
|
-
|
|
6074
|
-
|
|
6075
|
-
|
|
6076
|
-
|
|
6077
|
-
|
|
6078
|
-
|
|
6079
|
-
|
|
6080
|
-
|
|
6081
|
-
|
|
6082
|
-
/**
|
|
6083
|
-
* List LAIE proxies.
|
|
6084
|
-
*/
|
|
6085
|
-
proxies<T = any>(params?: Record<string, unknown>): Promise<T>;
|
|
6086
|
-
/**
|
|
6087
|
-
* Retrieve LAIE vault statistics.
|
|
6088
|
-
*/
|
|
6089
|
-
vaultStats<T = any>(params?: Record<string, unknown>): Promise<T>;
|
|
6090
|
-
/**
|
|
6091
|
-
* Retrieve LAIE credit usage.
|
|
6092
|
-
*/
|
|
6093
|
-
credits<T = any>(params?: Record<string, unknown>): Promise<T>;
|
|
6094
|
-
/**
|
|
6095
|
-
* List LAIE actors.
|
|
6096
|
-
*/
|
|
6097
|
-
actors<T = any>(params?: Record<string, unknown>): Promise<T>;
|
|
6098
|
-
/**
|
|
6099
|
-
* Retrieve the LAIE actor registry.
|
|
6100
|
-
*/
|
|
6101
|
-
actorRegistry<T = any>(params?: Record<string, unknown>): Promise<T>;
|
|
6102
|
-
/**
|
|
6103
|
-
* Run a named LAIE actor.
|
|
6104
|
-
*/
|
|
6105
|
-
runActor<T = any>(name: string, body?: Record<string, unknown>): Promise<T>;
|
|
6106
|
-
/**
|
|
6107
|
-
* Retrieve the LAIE enrichment configuration.
|
|
6108
|
-
*/
|
|
6109
|
-
getEnrichmentConfig<T = any>(): Promise<T>;
|
|
6110
|
-
/**
|
|
6111
|
-
* Update the LAIE enrichment configuration.
|
|
6112
|
-
*/
|
|
6113
|
-
setEnrichmentConfig<T = any>(body: Record<string, unknown>): Promise<T>;
|
|
6114
|
-
/**
|
|
6115
|
-
* List LAIE audit records.
|
|
6116
|
-
*/
|
|
6117
|
-
audits<T = any>(params?: Record<string, unknown>): Promise<T>;
|
|
6118
|
-
/**
|
|
6119
|
-
* Retrieve a single LAIE audit record by ID.
|
|
6120
|
-
*/
|
|
6121
|
-
audit<T = any>(id: string): Promise<T>;
|
|
3807
|
+
/** One thing the AI agent knows from: pasted text, a web page or a file. */
|
|
3808
|
+
interface KnowledgeSource {
|
|
3809
|
+
id: string;
|
|
3810
|
+
kind: "text" | "url" | "file";
|
|
3811
|
+
title: string;
|
|
3812
|
+
/** The URL (kind=url) or storage key (kind=file). */
|
|
3813
|
+
ref: string | null;
|
|
3814
|
+
mimeType: string | null;
|
|
3815
|
+
/** `pending` → `processing` → `ready` | `failed` (live: `knowledge.source_updated`). */
|
|
3816
|
+
status: "pending" | "processing" | "ready" | "failed";
|
|
3817
|
+
/** Why it failed, readable as-is. */
|
|
3818
|
+
error: string | null;
|
|
3819
|
+
chunkCount: number;
|
|
3820
|
+
createdAt: string;
|
|
3821
|
+
updatedAt: string;
|
|
6122
3822
|
}
|
|
6123
|
-
|
|
6124
|
-
|
|
6125
|
-
|
|
6126
|
-
|
|
6127
|
-
|
|
6128
|
-
|
|
6129
|
-
|
|
6130
|
-
declare class AdminLaieRuntime extends APIResource {
|
|
6131
|
-
/**
|
|
6132
|
-
* Retrieve LAIE runtime queue statistics.
|
|
6133
|
-
*/
|
|
6134
|
-
queueStats<T = any>(params?: Record<string, unknown>): Promise<T>;
|
|
6135
|
-
/**
|
|
6136
|
-
* Retrieve LAIE runtime proxy health.
|
|
6137
|
-
*/
|
|
6138
|
-
proxyHealth<T = any>(params?: Record<string, unknown>): Promise<T>;
|
|
6139
|
-
/**
|
|
6140
|
-
* Retrieve LAIE runtime browser pool statistics.
|
|
6141
|
-
*/
|
|
6142
|
-
browserPoolStats<T = any>(params?: Record<string, unknown>): Promise<T>;
|
|
6143
|
-
/**
|
|
6144
|
-
* Replay the LAIE runtime dead-letter queue.
|
|
6145
|
-
*/
|
|
6146
|
-
replayDlq<T = any>(body?: Record<string, unknown>): Promise<T>;
|
|
6147
|
-
/**
|
|
6148
|
-
* Retrieve LAIE runtime run statistics.
|
|
6149
|
-
*/
|
|
6150
|
-
runStats<T = any>(params?: Record<string, unknown>): Promise<T>;
|
|
3823
|
+
/** A passage the agent would use for a question. */
|
|
3824
|
+
interface KnowledgePassage {
|
|
3825
|
+
chunkId: string;
|
|
3826
|
+
sourceId: string;
|
|
3827
|
+
title: string;
|
|
3828
|
+
content: string;
|
|
3829
|
+
score: number;
|
|
6151
3830
|
}
|
|
6152
|
-
|
|
3831
|
+
/** File types the knowledge base can read. */
|
|
3832
|
+
declare const KNOWLEDGE_FILE_TYPES: readonly ["application/pdf", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "text/plain", "text/markdown", "text/csv", "text/html", "image/png", "image/jpeg", "image/webp"];
|
|
3833
|
+
type Res<T> = {
|
|
3834
|
+
success: boolean;
|
|
3835
|
+
data: T;
|
|
3836
|
+
};
|
|
6153
3837
|
/**
|
|
6154
|
-
*
|
|
6155
|
-
*
|
|
6156
|
-
* Access via `ecod.platform.admin.laieVault`.
|
|
3838
|
+
* The AI agent's knowledge base (RAG): what it answers from. Adding and
|
|
3839
|
+
* removing sources needs a workspace admin; reading and test-searching don't.
|
|
6157
3840
|
*/
|
|
6158
|
-
declare class
|
|
6159
|
-
|
|
6160
|
-
|
|
6161
|
-
|
|
6162
|
-
|
|
6163
|
-
|
|
6164
|
-
|
|
6165
|
-
|
|
3841
|
+
declare class Knowledge extends APIResource {
|
|
3842
|
+
list(): Promise<Res<KnowledgeSource[]>>;
|
|
3843
|
+
/** Paste text — an FAQ, a price list, a policy. */
|
|
3844
|
+
addText(params: {
|
|
3845
|
+
title: string;
|
|
3846
|
+
content: string;
|
|
3847
|
+
}): Promise<Res<KnowledgeSource>>;
|
|
3848
|
+
/** A public web page (re-read it later with `reindex`). */
|
|
3849
|
+
addUrl(params: {
|
|
3850
|
+
url: string;
|
|
3851
|
+
title?: string;
|
|
3852
|
+
}): Promise<Res<KnowledgeSource>>;
|
|
3853
|
+
/** Upload a file (PDF, Word, text, image) to your storage and add it. */
|
|
3854
|
+
addFile(file: Blob, opts?: {
|
|
3855
|
+
title?: string;
|
|
3856
|
+
}): Promise<Res<KnowledgeSource>>;
|
|
3857
|
+
remove(id: string): Promise<{
|
|
3858
|
+
success: boolean;
|
|
3859
|
+
}>;
|
|
3860
|
+
/** Read the source again (e.g. the web page changed). */
|
|
3861
|
+
reindex(id: string): Promise<Res<KnowledgeSource>>;
|
|
3862
|
+
/** What the agent would retrieve for a question. */
|
|
3863
|
+
search(query: string, limit?: number): Promise<Res<KnowledgePassage[]>>;
|
|
6166
3864
|
}
|
|
6167
3865
|
|
|
6168
|
-
/**
|
|
6169
|
-
|
|
6170
|
-
|
|
6171
|
-
|
|
6172
|
-
|
|
6173
|
-
|
|
6174
|
-
|
|
6175
|
-
|
|
6176
|
-
*/
|
|
6177
|
-
|
|
6178
|
-
|
|
6179
|
-
|
|
6180
|
-
|
|
6181
|
-
|
|
6182
|
-
|
|
6183
|
-
|
|
6184
|
-
|
|
6185
|
-
|
|
6186
|
-
|
|
6187
|
-
|
|
6188
|
-
|
|
6189
|
-
|
|
6190
|
-
|
|
6191
|
-
*
|
|
6192
|
-
*/
|
|
6193
|
-
|
|
6194
|
-
/**
|
|
6195
|
-
*
|
|
6196
|
-
|
|
6197
|
-
|
|
6198
|
-
|
|
6199
|
-
|
|
6200
|
-
|
|
6201
|
-
|
|
6202
|
-
|
|
6203
|
-
|
|
6204
|
-
|
|
6205
|
-
|
|
6206
|
-
/**
|
|
6207
|
-
|
|
6208
|
-
|
|
6209
|
-
|
|
6210
|
-
|
|
6211
|
-
|
|
6212
|
-
|
|
6213
|
-
|
|
6214
|
-
|
|
6215
|
-
|
|
6216
|
-
|
|
6217
|
-
|
|
6218
|
-
|
|
6219
|
-
|
|
6220
|
-
|
|
6221
|
-
|
|
6222
|
-
|
|
6223
|
-
|
|
6224
|
-
|
|
6225
|
-
|
|
6226
|
-
|
|
6227
|
-
|
|
6228
|
-
|
|
6229
|
-
|
|
3866
|
+
/** A tool the org can let its AI agent use (from the server's catalog). */
|
|
3867
|
+
interface AiAgentTool {
|
|
3868
|
+
id: string;
|
|
3869
|
+
label: string;
|
|
3870
|
+
description: string;
|
|
3871
|
+
/** True when it changes data (books, updates…). */
|
|
3872
|
+
sideEffect: boolean;
|
|
3873
|
+
}
|
|
3874
|
+
/** The org's AI agent (inbox auto-reply on WhatsApp, Instagram, Facebook, Telegram, email). */
|
|
3875
|
+
interface AiAgentSettings {
|
|
3876
|
+
aiAgentEnabled: boolean;
|
|
3877
|
+
/** The persona / instructions the agent follows. */
|
|
3878
|
+
aiAgentPrompt: string | null;
|
|
3879
|
+
/** Auto-send replies (otherwise they wait in the inbox as suggestions). */
|
|
3880
|
+
aiAutoReply: boolean;
|
|
3881
|
+
/** 0–1: below this, an auto-reply becomes a suggestion instead. */
|
|
3882
|
+
aiConfidenceThreshold: number;
|
|
3883
|
+
/** Ids from `availableTools` the agent may use. */
|
|
3884
|
+
aiAllowedTools: string[];
|
|
3885
|
+
/** Read-only: every tool that can be granted. */
|
|
3886
|
+
availableTools?: AiAgentTool[];
|
|
3887
|
+
/**
|
|
3888
|
+
* Returned by `updateSettings` when the agent is on: the channels whose
|
|
3889
|
+
* AI Auto-Reply flow is set up (connected channels only).
|
|
3890
|
+
*/
|
|
3891
|
+
autoReplyChannels?: string[];
|
|
3892
|
+
/**
|
|
3893
|
+
* Returned by `updateSettings` when the agent is on: channels that are
|
|
3894
|
+
* connected but not yet allowed for Flow, so the agent can't answer there.
|
|
3895
|
+
*/
|
|
3896
|
+
needsFlowGrant?: string[];
|
|
3897
|
+
}
|
|
3898
|
+
/** An AI draft waiting for a person in the inbox (kept up to 7 days). */
|
|
3899
|
+
interface AiSuggestion {
|
|
3900
|
+
id: string;
|
|
3901
|
+
conversationId: string;
|
|
3902
|
+
text: string;
|
|
3903
|
+
confidence: number;
|
|
3904
|
+
/** A data-changing step the agent proposed with the reply (approve to run). */
|
|
3905
|
+
pendingAction?: {
|
|
3906
|
+
action: string;
|
|
3907
|
+
input: Record<string, unknown>;
|
|
3908
|
+
};
|
|
3909
|
+
/** Knowledge sources the draft was grounded on. */
|
|
3910
|
+
sources?: {
|
|
3911
|
+
sourceId: string;
|
|
3912
|
+
title: string;
|
|
3913
|
+
}[];
|
|
3914
|
+
/** Set once a person approved `pendingAction`. */
|
|
3915
|
+
actionApprovedAt?: string;
|
|
3916
|
+
generatedAt: string;
|
|
3917
|
+
}
|
|
3918
|
+
/** How much a module agent may do on its own. */
|
|
3919
|
+
type AgentAutonomy = "off" | "suggest" | "approve" | "act";
|
|
3920
|
+
/** One tool a module agent can be given. */
|
|
3921
|
+
interface ModuleAgentTool {
|
|
3922
|
+
id: string;
|
|
3923
|
+
label: string;
|
|
3924
|
+
description?: string;
|
|
3925
|
+
/** Changes data. */
|
|
3926
|
+
sideEffect: boolean;
|
|
3927
|
+
/** Money or a message to a customer: always waits for a person. */
|
|
3928
|
+
needsApproval: boolean;
|
|
3929
|
+
}
|
|
3930
|
+
/** Monthly caps per agent (safety limits, not prices). */
|
|
3931
|
+
interface AgentBudget {
|
|
3932
|
+
/** Model calls. */
|
|
3933
|
+
turns: number;
|
|
3934
|
+
/** Data-changing actions. */
|
|
3935
|
+
actions: number;
|
|
3936
|
+
tokens: number;
|
|
3937
|
+
}
|
|
3938
|
+
interface ModuleAgentSettings {
|
|
3939
|
+
autonomy: AgentAutonomy;
|
|
3940
|
+
/** Ids from the agent's `tools` that are switched on. */
|
|
3941
|
+
tools: string[];
|
|
3942
|
+
budget: AgentBudget;
|
|
3943
|
+
/** Kill switch: a running agent stops before its next model call. */
|
|
3944
|
+
paused: boolean;
|
|
3945
|
+
updatedBy: string | null;
|
|
3946
|
+
updatedAt: string | null;
|
|
3947
|
+
}
|
|
3948
|
+
/** A module agent (e.g. `erix.sales`, `connect.channels`) with this month's usage. */
|
|
3949
|
+
interface ModuleAgent {
|
|
3950
|
+
id: string;
|
|
3951
|
+
label: string;
|
|
3952
|
+
description: string;
|
|
3953
|
+
/** Every tool this agent can be given. */
|
|
3954
|
+
tools: ModuleAgentTool[];
|
|
3955
|
+
settings: ModuleAgentSettings;
|
|
3956
|
+
usage: AgentBudget;
|
|
3957
|
+
}
|
|
3958
|
+
type ModuleAgentPatch = Partial<Pick<ModuleAgentSettings, "autonomy" | "tools" | "paused">> & {
|
|
3959
|
+
budget?: Partial<AgentBudget>;
|
|
3960
|
+
};
|
|
3961
|
+
/** A Flow run held at an approval step. */
|
|
3962
|
+
interface PausedRun {
|
|
3963
|
+
id: string;
|
|
3964
|
+
flowId: string;
|
|
3965
|
+
flowName: string;
|
|
3966
|
+
leadId: string | null;
|
|
3967
|
+
recordsHeld: number | null;
|
|
3968
|
+
startedAt: string | null;
|
|
3969
|
+
createdAt: string;
|
|
6230
3970
|
}
|
|
6231
|
-
|
|
6232
3971
|
/**
|
|
6233
|
-
*
|
|
6234
|
-
*
|
|
6235
|
-
*
|
|
3972
|
+
* The AI agent: its settings and the drafts it leaves in the inbox. Drafts
|
|
3973
|
+
* also arrive live on `ai_suggestion` and leave on `ai_suggestion.resolved`;
|
|
3974
|
+
* held runs change on `workflow-run-update`.
|
|
6236
3975
|
*/
|
|
6237
|
-
declare class
|
|
3976
|
+
declare class AiAgent extends APIResource {
|
|
3977
|
+
/** Settings plus `availableTools`. */
|
|
3978
|
+
settings(): Promise<{
|
|
3979
|
+
success: boolean;
|
|
3980
|
+
data: AiAgentSettings;
|
|
3981
|
+
}>;
|
|
3982
|
+
/** Change settings (workspace admins only). */
|
|
3983
|
+
updateSettings(patch: Partial<Omit<AiAgentSettings, "availableTools">>): Promise<{
|
|
3984
|
+
success: boolean;
|
|
3985
|
+
data: AiAgentSettings;
|
|
3986
|
+
}>;
|
|
3987
|
+
/** The draft waiting on a conversation (`data: null` when none). */
|
|
3988
|
+
suggestion(conversationId: string): Promise<{
|
|
3989
|
+
success: boolean;
|
|
3990
|
+
data: AiSuggestion | null;
|
|
3991
|
+
}>;
|
|
6238
3992
|
/**
|
|
6239
|
-
*
|
|
3993
|
+
* Run the action the draft proposed (exactly the server's copy — once per
|
|
3994
|
+
* draft). Send the reply afterwards through the inbox as usual.
|
|
6240
3995
|
*/
|
|
6241
|
-
|
|
3996
|
+
approveAction(conversationId: string): Promise<{
|
|
3997
|
+
success: boolean;
|
|
3998
|
+
data: {
|
|
3999
|
+
action: string;
|
|
4000
|
+
output: unknown;
|
|
4001
|
+
};
|
|
4002
|
+
}>;
|
|
4003
|
+
/** Record that a person sent the draft (possibly edited) and clear it. */
|
|
4004
|
+
markSent(conversationId: string, text: string, confidence: number): Promise<unknown>;
|
|
4005
|
+
/** Discard the draft. */
|
|
4006
|
+
dismiss(conversationId: string): Promise<unknown>;
|
|
6242
4007
|
/**
|
|
6243
|
-
*
|
|
4008
|
+
* Everything waiting on a person: AI drafts across every conversation, and
|
|
4009
|
+
* Flow runs held at an approval step.
|
|
6244
4010
|
*/
|
|
6245
|
-
|
|
4011
|
+
approvals(): Promise<{
|
|
4012
|
+
success: boolean;
|
|
4013
|
+
data: {
|
|
4014
|
+
drafts: AiSuggestion[];
|
|
4015
|
+
runs: PausedRun[];
|
|
4016
|
+
};
|
|
4017
|
+
}>;
|
|
6246
4018
|
/**
|
|
6247
|
-
*
|
|
4019
|
+
* The module agents with this workspace's settings and month's usage.
|
|
4020
|
+
* Released per workspace (`agents.v1`); a 404 means not available yet.
|
|
6248
4021
|
*/
|
|
6249
|
-
|
|
4022
|
+
agents(): Promise<{
|
|
4023
|
+
success: boolean;
|
|
4024
|
+
data: ModuleAgent[];
|
|
4025
|
+
}>;
|
|
4026
|
+
/** Change an agent's autonomy, tools, budget or kill switch (workspace admins). */
|
|
4027
|
+
updateAgent(id: string, patch: ModuleAgentPatch): Promise<{
|
|
4028
|
+
success: boolean;
|
|
4029
|
+
data: ModuleAgentSettings;
|
|
4030
|
+
}>;
|
|
4031
|
+
/** Let a held run continue, or stop it. */
|
|
4032
|
+
decideRun(runId: string, decision: "approve" | "reject"): Promise<{
|
|
4033
|
+
success: boolean;
|
|
4034
|
+
decision: string;
|
|
4035
|
+
}>;
|
|
6250
4036
|
}
|
|
6251
4037
|
|
|
6252
4038
|
/**
|
|
6253
|
-
* Platform
|
|
4039
|
+
* Platform authentication resource — registration, login, sessions,
|
|
4040
|
+
* password management, OAuth linking, and organization invitations.
|
|
6254
4041
|
*
|
|
6255
|
-
* Access via `ecod.platform.
|
|
4042
|
+
* Access via `ecod.platform.auth`.
|
|
6256
4043
|
*/
|
|
6257
|
-
declare class
|
|
6258
|
-
/**
|
|
6259
|
-
* Retrieve aggregate partner statistics.
|
|
6260
|
-
*/
|
|
6261
|
-
stats<T = any>(params?: Record<string, unknown>): Promise<T>;
|
|
6262
|
-
/**
|
|
6263
|
-
* List all partners.
|
|
6264
|
-
*/
|
|
6265
|
-
list<T = any>(params?: Record<string, unknown>): Promise<T>;
|
|
6266
|
-
/**
|
|
6267
|
-
* Create a new partner.
|
|
6268
|
-
*/
|
|
6269
|
-
create<T = any>(body: Record<string, unknown>): Promise<T>;
|
|
6270
|
-
/**
|
|
6271
|
-
* Retrieve a single partner by ID.
|
|
6272
|
-
*/
|
|
6273
|
-
retrieve<T = any>(id: string): Promise<T>;
|
|
6274
|
-
/**
|
|
6275
|
-
* Update an existing partner.
|
|
6276
|
-
*/
|
|
6277
|
-
update<T = any>(id: string, body: Record<string, unknown>): Promise<T>;
|
|
4044
|
+
declare class Auth extends APIResource {
|
|
6278
4045
|
/**
|
|
6279
|
-
*
|
|
4046
|
+
* Register a new platform user / organization.
|
|
6280
4047
|
*/
|
|
6281
|
-
|
|
4048
|
+
register<T = any>(body: Record<string, unknown>): Promise<T>;
|
|
6282
4049
|
/**
|
|
6283
|
-
*
|
|
4050
|
+
* Authenticate a user and establish a session.
|
|
6284
4051
|
*/
|
|
6285
|
-
|
|
4052
|
+
login<T = any>(body: Record<string, unknown>): Promise<T>;
|
|
6286
4053
|
/**
|
|
6287
|
-
*
|
|
4054
|
+
* Log out of the current session.
|
|
6288
4055
|
*/
|
|
6289
|
-
|
|
6290
|
-
}
|
|
6291
|
-
|
|
6292
|
-
/**
|
|
6293
|
-
* Platform-admin payment operations resource — refunds, payment validation,
|
|
6294
|
-
* retries, timelines, and risk assessment.
|
|
6295
|
-
*
|
|
6296
|
-
* Access via `ecod.platform.admin.paymentOps`.
|
|
6297
|
-
*/
|
|
6298
|
-
declare class AdminPaymentOps extends APIResource {
|
|
4056
|
+
logout<T = any>(body: Record<string, unknown>): Promise<T>;
|
|
6299
4057
|
/**
|
|
6300
|
-
*
|
|
4058
|
+
* Log out of every active session for the current user.
|
|
6301
4059
|
*/
|
|
6302
|
-
|
|
4060
|
+
logoutAll<T = any>(body: Record<string, unknown>): Promise<T>;
|
|
6303
4061
|
/**
|
|
6304
|
-
* Validate
|
|
4062
|
+
* Validate the current session token.
|
|
6305
4063
|
*/
|
|
6306
|
-
|
|
4064
|
+
validateSession<T = any>(body: Record<string, unknown>): Promise<T>;
|
|
6307
4065
|
/**
|
|
6308
|
-
*
|
|
4066
|
+
* List all active sessions for the current user.
|
|
6309
4067
|
*/
|
|
6310
|
-
|
|
4068
|
+
listSessions<T = any>(): Promise<T>;
|
|
6311
4069
|
/**
|
|
6312
|
-
*
|
|
4070
|
+
* Revoke a specific session by its ID.
|
|
4071
|
+
*
|
|
4072
|
+
* @param id - The session ID to revoke.
|
|
6313
4073
|
*/
|
|
6314
|
-
|
|
4074
|
+
revokeSession<T = any>(id: string): Promise<T>;
|
|
6315
4075
|
/**
|
|
6316
|
-
*
|
|
4076
|
+
* Request a one-time password (OTP) to set or change a password.
|
|
6317
4077
|
*/
|
|
6318
|
-
|
|
4078
|
+
requestPasswordOtp<T = any>(body: Record<string, unknown>): Promise<T>;
|
|
6319
4079
|
/**
|
|
6320
|
-
*
|
|
4080
|
+
* Set a password for the current user.
|
|
6321
4081
|
*/
|
|
6322
|
-
|
|
4082
|
+
setPassword<T = any>(body: Record<string, unknown>): Promise<T>;
|
|
6323
4083
|
/**
|
|
6324
|
-
*
|
|
4084
|
+
* Change the current user's password.
|
|
6325
4085
|
*/
|
|
6326
|
-
|
|
4086
|
+
changePassword<T = any>(body: Record<string, unknown>): Promise<T>;
|
|
6327
4087
|
/**
|
|
6328
|
-
*
|
|
4088
|
+
* Begin the forgot-password flow.
|
|
6329
4089
|
*/
|
|
6330
|
-
|
|
6331
|
-
}
|
|
6332
|
-
|
|
6333
|
-
/**
|
|
6334
|
-
* Platform-admin persona history resource — inspect persona version history.
|
|
6335
|
-
*
|
|
6336
|
-
* Access via `ecod.platform.admin.personaHistory`.
|
|
6337
|
-
*/
|
|
6338
|
-
declare class AdminPersonaHistory extends APIResource {
|
|
4090
|
+
forgotPassword<T = any>(body: Record<string, unknown>): Promise<T>;
|
|
6339
4091
|
/**
|
|
6340
|
-
*
|
|
4092
|
+
* Reset a password using a reset token.
|
|
6341
4093
|
*/
|
|
6342
|
-
|
|
4094
|
+
resetPassword<T = any>(body: Record<string, unknown>): Promise<T>;
|
|
6343
4095
|
/**
|
|
6344
|
-
*
|
|
4096
|
+
* Link an OAuth identity to the current user.
|
|
6345
4097
|
*/
|
|
6346
|
-
|
|
4098
|
+
linkOAuth<T = any>(body: Record<string, unknown>): Promise<T>;
|
|
6347
4099
|
/**
|
|
6348
|
-
* Retrieve
|
|
4100
|
+
* Retrieve details about an organization invitation by token.
|
|
4101
|
+
*
|
|
4102
|
+
* @param token - The invitation token.
|
|
6349
4103
|
*/
|
|
6350
|
-
|
|
4104
|
+
getInvitation<T = any>(token: string): Promise<T>;
|
|
6351
4105
|
/**
|
|
6352
|
-
*
|
|
4106
|
+
* Accept an organization invitation by token.
|
|
4107
|
+
*
|
|
4108
|
+
* @param token - The invitation token.
|
|
4109
|
+
* @param body - Optional acceptance payload.
|
|
6353
4110
|
*/
|
|
6354
|
-
|
|
4111
|
+
acceptInvitation<T = any>(token: string, body?: Record<string, unknown>): Promise<T>;
|
|
6355
4112
|
}
|
|
6356
4113
|
|
|
6357
4114
|
/**
|
|
6358
|
-
*
|
|
6359
|
-
* provisioning.
|
|
4115
|
+
* Entitlements resource — read current plan entitlements and usage.
|
|
6360
4116
|
*
|
|
6361
|
-
* Access via `ecod.platform.
|
|
4117
|
+
* Access via `ecod.platform.billing.entitlements`.
|
|
6362
4118
|
*/
|
|
6363
|
-
declare class
|
|
6364
|
-
/**
|
|
6365
|
-
* List pipeline templates.
|
|
6366
|
-
*/
|
|
6367
|
-
templates<T = any>(params?: Record<string, unknown>): Promise<T>;
|
|
6368
|
-
/**
|
|
6369
|
-
* Create a new pipeline template.
|
|
6370
|
-
*/
|
|
6371
|
-
createTemplate<T = any>(body: Record<string, unknown>): Promise<T>;
|
|
6372
|
-
/**
|
|
6373
|
-
* Update an existing pipeline template.
|
|
6374
|
-
*/
|
|
6375
|
-
updateTemplate<T = any>(id: string, body: Record<string, unknown>): Promise<T>;
|
|
6376
|
-
/**
|
|
6377
|
-
* Delete a pipeline template.
|
|
6378
|
-
*/
|
|
6379
|
-
deleteTemplate<T = any>(id: string): Promise<T>;
|
|
4119
|
+
declare class Entitlements extends APIResource {
|
|
6380
4120
|
/**
|
|
6381
|
-
*
|
|
4121
|
+
* Retrieve the current organization's entitlements.
|
|
6382
4122
|
*/
|
|
6383
|
-
|
|
4123
|
+
get<T = any>(): Promise<T>;
|
|
6384
4124
|
/**
|
|
6385
|
-
* Retrieve
|
|
4125
|
+
* Retrieve current usage against entitlements.
|
|
6386
4126
|
*/
|
|
6387
|
-
|
|
4127
|
+
usage<T = any>(): Promise<T>;
|
|
6388
4128
|
}
|
|
6389
|
-
|
|
6390
4129
|
/**
|
|
6391
|
-
*
|
|
4130
|
+
* Subscriptions resource — manage plan upgrades, downgrades, cancellations,
|
|
4131
|
+
* and add-ons.
|
|
6392
4132
|
*
|
|
6393
|
-
* Access via `ecod.platform.
|
|
4133
|
+
* Access via `ecod.platform.billing.subscriptions`.
|
|
6394
4134
|
*/
|
|
6395
|
-
declare class
|
|
4135
|
+
declare class Subscriptions extends APIResource {
|
|
6396
4136
|
/**
|
|
6397
|
-
*
|
|
4137
|
+
* Upgrade the current subscription plan.
|
|
6398
4138
|
*/
|
|
6399
|
-
|
|
4139
|
+
upgrade<T = any>(body: Record<string, unknown>): Promise<T>;
|
|
6400
4140
|
/**
|
|
6401
|
-
*
|
|
4141
|
+
* Downgrade the current subscription plan.
|
|
6402
4142
|
*/
|
|
6403
|
-
|
|
4143
|
+
downgrade<T = any>(body: Record<string, unknown>): Promise<T>;
|
|
6404
4144
|
/**
|
|
6405
|
-
*
|
|
4145
|
+
* Cancel the current subscription.
|
|
6406
4146
|
*/
|
|
6407
|
-
|
|
4147
|
+
cancel<T = any>(body: Record<string, unknown>): Promise<T>;
|
|
6408
4148
|
/**
|
|
6409
|
-
*
|
|
4149
|
+
* Purchase an add-on for the current subscription.
|
|
6410
4150
|
*/
|
|
6411
|
-
|
|
4151
|
+
purchaseAddon<T = any>(body: Record<string, unknown>): Promise<T>;
|
|
6412
4152
|
/**
|
|
6413
|
-
*
|
|
4153
|
+
* Cancel a previously purchased add-on.
|
|
6414
4154
|
*/
|
|
6415
|
-
|
|
4155
|
+
cancelAddon<T = any>(body: Record<string, unknown>): Promise<T>;
|
|
6416
4156
|
}
|
|
6417
|
-
|
|
6418
4157
|
/**
|
|
6419
|
-
*
|
|
4158
|
+
* Plans resource — read publicly available plans.
|
|
6420
4159
|
*
|
|
6421
|
-
* Access via `ecod.platform.
|
|
4160
|
+
* Access via `ecod.platform.billing.plans`.
|
|
6422
4161
|
*/
|
|
6423
|
-
declare class
|
|
6424
|
-
/**
|
|
6425
|
-
* Retrieve the aggregated revenue summary.
|
|
6426
|
-
*/
|
|
6427
|
-
summary<T = any>(params?: Record<string, unknown>): Promise<T>;
|
|
6428
|
-
/**
|
|
6429
|
-
* List historical revenue snapshots.
|
|
6430
|
-
*/
|
|
6431
|
-
snapshots<T = any>(params?: Record<string, unknown>): Promise<T>;
|
|
4162
|
+
declare class Plans extends APIResource {
|
|
6432
4163
|
/**
|
|
6433
|
-
*
|
|
4164
|
+
* List all publicly available plans.
|
|
6434
4165
|
*/
|
|
6435
|
-
|
|
4166
|
+
listPublic<T = any>(): Promise<T>;
|
|
6436
4167
|
}
|
|
6437
|
-
|
|
6438
4168
|
/**
|
|
6439
|
-
*
|
|
6440
|
-
*
|
|
6441
|
-
* NOTE: the doubled `admin/staff` segments are intentional — a legacy router
|
|
6442
|
-
* is mounted under the new prefix.
|
|
4169
|
+
* Billing checkout resource — plan selection, subscription, verification,
|
|
4170
|
+
* and synchronization.
|
|
6443
4171
|
*
|
|
6444
|
-
* Access via `ecod.platform.
|
|
4172
|
+
* Access via `ecod.platform.billing.checkout`.
|
|
6445
4173
|
*/
|
|
6446
|
-
declare class
|
|
4174
|
+
declare class BillingCheckout extends APIResource {
|
|
6447
4175
|
/**
|
|
6448
|
-
*
|
|
4176
|
+
* List plans available at checkout.
|
|
6449
4177
|
*/
|
|
6450
|
-
|
|
4178
|
+
plans<T = any>(): Promise<T>;
|
|
6451
4179
|
/**
|
|
6452
|
-
*
|
|
4180
|
+
* Subscribe to a plan via checkout.
|
|
6453
4181
|
*/
|
|
6454
|
-
|
|
4182
|
+
subscribe<T = any>(body: Record<string, unknown>): Promise<T>;
|
|
6455
4183
|
/**
|
|
6456
|
-
*
|
|
4184
|
+
* Verify a checkout payment.
|
|
6457
4185
|
*/
|
|
6458
|
-
|
|
4186
|
+
verify<T = any>(body: Record<string, unknown>): Promise<T>;
|
|
6459
4187
|
/**
|
|
6460
|
-
*
|
|
4188
|
+
* Cancel an in-progress checkout.
|
|
6461
4189
|
*/
|
|
6462
|
-
|
|
4190
|
+
cancel<T = any>(body: Record<string, unknown>): Promise<T>;
|
|
6463
4191
|
/**
|
|
6464
|
-
*
|
|
4192
|
+
* Retrieve the current checkout status.
|
|
6465
4193
|
*/
|
|
6466
|
-
|
|
4194
|
+
status<T = any>(): Promise<T>;
|
|
6467
4195
|
/**
|
|
6468
|
-
*
|
|
4196
|
+
* Synchronize the checkout plan state with the provider.
|
|
6469
4197
|
*/
|
|
6470
|
-
|
|
4198
|
+
syncPlan<T = any>(body: Record<string, unknown>): Promise<T>;
|
|
6471
4199
|
}
|
|
6472
|
-
|
|
6473
4200
|
/**
|
|
6474
|
-
*
|
|
4201
|
+
* Billing user resource — transactions, subscription, and disputes for the
|
|
4202
|
+
* current user.
|
|
6475
4203
|
*
|
|
6476
|
-
* Access via `ecod.platform.
|
|
4204
|
+
* Access via `ecod.platform.billing.user`.
|
|
6477
4205
|
*/
|
|
6478
|
-
declare class
|
|
4206
|
+
declare class BillingUser extends APIResource {
|
|
6479
4207
|
/**
|
|
6480
|
-
*
|
|
4208
|
+
* List the current user's billing transactions.
|
|
6481
4209
|
*/
|
|
6482
|
-
|
|
4210
|
+
transactions<T = any>(): Promise<T>;
|
|
6483
4211
|
/**
|
|
6484
|
-
*
|
|
4212
|
+
* Retrieve the current user's subscription.
|
|
6485
4213
|
*/
|
|
6486
|
-
|
|
4214
|
+
subscription<T = any>(): Promise<T>;
|
|
6487
4215
|
/**
|
|
6488
|
-
*
|
|
4216
|
+
* Raise a billing dispute.
|
|
6489
4217
|
*/
|
|
6490
|
-
|
|
6491
|
-
}
|
|
6492
|
-
|
|
6493
|
-
/**
|
|
6494
|
-
* Platform-admin system health resource — system health overview.
|
|
6495
|
-
*
|
|
6496
|
-
* Access via `ecod.platform.admin.health`.
|
|
6497
|
-
*/
|
|
6498
|
-
declare class AdminHealth extends APIResource {
|
|
4218
|
+
raiseDispute<T = any>(body: Record<string, unknown>): Promise<T>;
|
|
6499
4219
|
/**
|
|
6500
|
-
*
|
|
4220
|
+
* List the current user's billing disputes.
|
|
6501
4221
|
*/
|
|
6502
|
-
|
|
4222
|
+
disputes<T = any>(): Promise<T>;
|
|
6503
4223
|
}
|
|
6504
|
-
|
|
6505
4224
|
/**
|
|
6506
|
-
*
|
|
6507
|
-
* plan assignments.
|
|
4225
|
+
* Credits resource — balance, transactions, packs, and top-ups.
|
|
6508
4226
|
*
|
|
6509
|
-
* Access via `ecod.platform.
|
|
4227
|
+
* Access via `ecod.platform.billing.credits`.
|
|
6510
4228
|
*/
|
|
6511
|
-
declare class
|
|
6512
|
-
/**
|
|
6513
|
-
* List all templates.
|
|
6514
|
-
*/
|
|
6515
|
-
list<T = any>(params?: Record<string, unknown>): Promise<T>;
|
|
4229
|
+
declare class Credits extends APIResource {
|
|
6516
4230
|
/**
|
|
6517
|
-
*
|
|
4231
|
+
* Retrieve the current credit balance.
|
|
6518
4232
|
*/
|
|
6519
|
-
|
|
4233
|
+
balance<T = any>(): Promise<T>;
|
|
6520
4234
|
/**
|
|
6521
|
-
*
|
|
4235
|
+
* List credit transactions.
|
|
6522
4236
|
*/
|
|
6523
|
-
|
|
4237
|
+
transactions<T = any>(): Promise<T>;
|
|
6524
4238
|
/**
|
|
6525
|
-
*
|
|
4239
|
+
* List available credit packs.
|
|
6526
4240
|
*/
|
|
6527
|
-
|
|
4241
|
+
packs<T = any>(): Promise<T>;
|
|
6528
4242
|
/**
|
|
6529
|
-
*
|
|
4243
|
+
* Create a credit top-up order.
|
|
6530
4244
|
*/
|
|
6531
|
-
|
|
4245
|
+
topupOrder<T = any>(body: Record<string, unknown>): Promise<T>;
|
|
6532
4246
|
/**
|
|
6533
|
-
*
|
|
4247
|
+
* Verify a credit top-up payment.
|
|
6534
4248
|
*/
|
|
6535
|
-
|
|
4249
|
+
verifyTopup<T = any>(body: Record<string, unknown>): Promise<T>;
|
|
6536
4250
|
/**
|
|
6537
|
-
*
|
|
4251
|
+
* Configure automatic credit top-ups.
|
|
6538
4252
|
*/
|
|
6539
|
-
|
|
4253
|
+
setAutoTopup<T = any>(body: Record<string, unknown>): Promise<T>;
|
|
6540
4254
|
/**
|
|
6541
|
-
*
|
|
4255
|
+
* Configure the daily spend cap (cost control).
|
|
4256
|
+
* Body: `{ dailyCap: number | null, alertPct?: number }`.
|
|
6542
4257
|
*/
|
|
6543
|
-
|
|
4258
|
+
setSpendCap<T = any>(body: Record<string, unknown>): Promise<T>;
|
|
4259
|
+
}
|
|
4260
|
+
/**
|
|
4261
|
+
* Platform billing container — groups the `entitlements`, `subscriptions`,
|
|
4262
|
+
* `plans`, `checkout`, `user`, and `credits` sub-resources.
|
|
4263
|
+
*
|
|
4264
|
+
* Access via `ecod.platform.billing`.
|
|
4265
|
+
*/
|
|
4266
|
+
declare class Billing {
|
|
4267
|
+
readonly entitlements: Entitlements;
|
|
4268
|
+
readonly subscriptions: Subscriptions;
|
|
4269
|
+
readonly plans: Plans;
|
|
4270
|
+
readonly checkout: BillingCheckout;
|
|
4271
|
+
readonly user: BillingUser;
|
|
4272
|
+
readonly credits: Credits;
|
|
4273
|
+
constructor(client: AxiosInstance);
|
|
6544
4274
|
}
|
|
6545
4275
|
|
|
6546
4276
|
/**
|
|
6547
|
-
* Platform
|
|
4277
|
+
* Platform support resource — categories and support ticket lifecycle.
|
|
6548
4278
|
*
|
|
6549
|
-
* Access via `ecod.platform.
|
|
4279
|
+
* Access via `ecod.platform.support`.
|
|
6550
4280
|
*/
|
|
6551
|
-
declare class
|
|
6552
|
-
/**
|
|
6553
|
-
* Retrieve a deep, fully-expanded view of a tenant organization.
|
|
6554
|
-
*/
|
|
6555
|
-
deep<T = any>(orgId: string): Promise<T>;
|
|
6556
|
-
/**
|
|
6557
|
-
* Retrieve usage metrics for a tenant organization.
|
|
6558
|
-
*/
|
|
6559
|
-
usage<T = any>(orgId: string): Promise<T>;
|
|
6560
|
-
/**
|
|
6561
|
-
* Retrieve the team/members for a tenant organization.
|
|
6562
|
-
*/
|
|
6563
|
-
team<T = any>(orgId: string): Promise<T>;
|
|
6564
|
-
/**
|
|
6565
|
-
* Retrieve billing details for a tenant organization.
|
|
6566
|
-
*/
|
|
6567
|
-
billing<T = any>(orgId: string): Promise<T>;
|
|
6568
|
-
/**
|
|
6569
|
-
* Retrieve WhatsApp configuration for a tenant organization.
|
|
6570
|
-
*/
|
|
6571
|
-
whatsapp<T = any>(orgId: string): Promise<T>;
|
|
6572
|
-
/**
|
|
6573
|
-
* Retrieve automation flows for a tenant organization.
|
|
6574
|
-
*/
|
|
6575
|
-
flows<T = any>(orgId: string): Promise<T>;
|
|
6576
|
-
/**
|
|
6577
|
-
* Retrieve CRM statistics for a tenant organization.
|
|
6578
|
-
*/
|
|
6579
|
-
crmStats<T = any>(orgId: string): Promise<T>;
|
|
6580
|
-
/**
|
|
6581
|
-
* Impersonate a tenant organization.
|
|
6582
|
-
*/
|
|
6583
|
-
impersonate<T = any>(orgId: string, body?: Record<string, unknown>): Promise<T>;
|
|
4281
|
+
declare class Support extends APIResource {
|
|
6584
4282
|
/**
|
|
6585
|
-
*
|
|
4283
|
+
* List available support categories.
|
|
6586
4284
|
*/
|
|
6587
|
-
|
|
4285
|
+
categories<T = any>(): Promise<T>;
|
|
6588
4286
|
/**
|
|
6589
|
-
*
|
|
4287
|
+
* List support tickets with optional filtering.
|
|
4288
|
+
*
|
|
4289
|
+
* @param params - Optional query parameters (status, pagination, etc.).
|
|
6590
4290
|
*/
|
|
6591
|
-
|
|
4291
|
+
listTickets<T = any>(params?: Record<string, unknown>): Promise<T>;
|
|
6592
4292
|
/**
|
|
6593
|
-
*
|
|
4293
|
+
* Create a new support ticket.
|
|
6594
4294
|
*/
|
|
6595
|
-
|
|
4295
|
+
createTicket<T = any>(body: Record<string, unknown>): Promise<T>;
|
|
6596
4296
|
/**
|
|
6597
|
-
*
|
|
4297
|
+
* Retrieve a single support ticket by its ID.
|
|
4298
|
+
*
|
|
4299
|
+
* @param id - The support ticket ID.
|
|
6598
4300
|
*/
|
|
6599
|
-
|
|
4301
|
+
getTicket<T = any>(id: string): Promise<T>;
|
|
6600
4302
|
/**
|
|
6601
|
-
*
|
|
4303
|
+
* Reply to an existing support ticket.
|
|
4304
|
+
*
|
|
4305
|
+
* @param id - The support ticket ID.
|
|
4306
|
+
* @param body - The reply payload.
|
|
6602
4307
|
*/
|
|
6603
|
-
|
|
4308
|
+
reply<T = any>(id: string, body: Record<string, unknown>): Promise<T>;
|
|
6604
4309
|
/**
|
|
6605
|
-
*
|
|
4310
|
+
* Close a support ticket.
|
|
4311
|
+
*
|
|
4312
|
+
* @param id - The support ticket ID.
|
|
6606
4313
|
*/
|
|
6607
|
-
|
|
4314
|
+
close<T = any>(id: string): Promise<T>;
|
|
6608
4315
|
}
|
|
6609
4316
|
|
|
6610
4317
|
/**
|
|
6611
|
-
*
|
|
6612
|
-
*
|
|
4318
|
+
* Current-user ("me") resource — profile, organization, modules,
|
|
4319
|
+
* workspaces, and active-org management.
|
|
6613
4320
|
*
|
|
6614
|
-
* Access via `ecod.platform.
|
|
4321
|
+
* Access via `ecod.platform.users.me`.
|
|
6615
4322
|
*/
|
|
6616
|
-
declare class
|
|
6617
|
-
/**
|
|
6618
|
-
* Retrieve aggregate ticket statistics.
|
|
6619
|
-
*/
|
|
6620
|
-
stats<T = any>(params?: Record<string, unknown>): Promise<T>;
|
|
4323
|
+
declare class Me extends APIResource {
|
|
6621
4324
|
/**
|
|
6622
|
-
*
|
|
4325
|
+
* Retrieve the current authenticated user's profile.
|
|
6623
4326
|
*/
|
|
6624
|
-
|
|
4327
|
+
get<T = any>(): Promise<T>;
|
|
6625
4328
|
/**
|
|
6626
|
-
*
|
|
4329
|
+
* Update the current user's profile.
|
|
6627
4330
|
*/
|
|
6628
|
-
|
|
4331
|
+
update<T = any>(body: Record<string, unknown>): Promise<T>;
|
|
6629
4332
|
/**
|
|
6630
|
-
*
|
|
4333
|
+
* Update the current user's active organization details.
|
|
6631
4334
|
*/
|
|
6632
|
-
|
|
4335
|
+
updateOrganization<T = any>(body: Record<string, unknown>): Promise<T>;
|
|
6633
4336
|
/**
|
|
6634
|
-
*
|
|
4337
|
+
* Toggle enabled modules for the current user / organization.
|
|
6635
4338
|
*/
|
|
6636
|
-
|
|
4339
|
+
toggleModules<T = any>(body: Record<string, unknown>): Promise<T>;
|
|
6637
4340
|
/**
|
|
6638
|
-
*
|
|
4341
|
+
* List the workspaces available to the current user.
|
|
6639
4342
|
*/
|
|
6640
|
-
|
|
4343
|
+
workspaces<T = any>(): Promise<T>;
|
|
6641
4344
|
/**
|
|
6642
|
-
*
|
|
4345
|
+
* Set the active organization for the current user.
|
|
6643
4346
|
*/
|
|
6644
|
-
|
|
4347
|
+
setActiveOrg<T = any>(body: Record<string, unknown>): Promise<T>;
|
|
6645
4348
|
/**
|
|
6646
|
-
*
|
|
4349
|
+
* Dismiss the workspace setup prompt for the current user.
|
|
6647
4350
|
*/
|
|
6648
|
-
|
|
4351
|
+
dismissWorkspaceSetup<T = any>(): Promise<T>;
|
|
6649
4352
|
}
|
|
6650
|
-
|
|
6651
4353
|
/**
|
|
6652
|
-
*
|
|
4354
|
+
* Organization members resource — list, invite, and remove members.
|
|
6653
4355
|
*
|
|
6654
|
-
* Access via `ecod.platform.
|
|
4356
|
+
* Access via `ecod.platform.users.members`.
|
|
6655
4357
|
*/
|
|
6656
|
-
declare class
|
|
6657
|
-
/**
|
|
6658
|
-
* Retrieve aggregate waitlist statistics.
|
|
6659
|
-
*/
|
|
6660
|
-
stats<T = any>(params?: Record<string, unknown>): Promise<T>;
|
|
4358
|
+
declare class Members extends APIResource {
|
|
6661
4359
|
/**
|
|
6662
|
-
* List
|
|
4360
|
+
* List all members of the current organization.
|
|
6663
4361
|
*/
|
|
6664
|
-
list<T = any>(
|
|
4362
|
+
list<T = any>(): Promise<T>;
|
|
6665
4363
|
/**
|
|
6666
|
-
*
|
|
4364
|
+
* Invite a new member to the current organization.
|
|
6667
4365
|
*/
|
|
6668
|
-
|
|
4366
|
+
invite<T = any>(body: Record<string, unknown>): Promise<T>;
|
|
6669
4367
|
/**
|
|
6670
|
-
*
|
|
4368
|
+
* Change a member's role (`owner` | `admin` | `agent` | `viewer`).
|
|
4369
|
+
* Admins may switch agent ↔ viewer; admin and owner changes need the owner.
|
|
6671
4370
|
*/
|
|
6672
|
-
|
|
4371
|
+
updateRole<T = any>(id: string, role: "owner" | "admin" | "agent" | "viewer"): Promise<T>;
|
|
6673
4372
|
/**
|
|
6674
|
-
* Remove a
|
|
4373
|
+
* Remove a member from the current organization.
|
|
4374
|
+
*
|
|
4375
|
+
* @param id - The member ID to remove.
|
|
6675
4376
|
*/
|
|
6676
4377
|
remove<T = any>(id: string): Promise<T>;
|
|
6677
|
-
/**
|
|
6678
|
-
* Perform a bulk operation on waitlist entries.
|
|
6679
|
-
*/
|
|
6680
|
-
bulk<T = any>(body: Record<string, unknown>): Promise<T>;
|
|
6681
4378
|
}
|
|
6682
|
-
|
|
6683
4379
|
/**
|
|
6684
|
-
*
|
|
4380
|
+
* User sessions resource — list and revoke sessions.
|
|
6685
4381
|
*
|
|
6686
|
-
* Access via `ecod.platform.
|
|
4382
|
+
* Access via `ecod.platform.users.sessions`.
|
|
6687
4383
|
*/
|
|
6688
|
-
declare class
|
|
6689
|
-
/**
|
|
6690
|
-
* Retrieve the platform-wide WhatsApp overview.
|
|
6691
|
-
*/
|
|
6692
|
-
overview<T = any>(params?: Record<string, unknown>): Promise<T>;
|
|
6693
|
-
/**
|
|
6694
|
-
* List all WhatsApp Business Accounts (WABAs).
|
|
6695
|
-
*/
|
|
6696
|
-
wabas<T = any>(params?: Record<string, unknown>): Promise<T>;
|
|
6697
|
-
/**
|
|
6698
|
-
* List WhatsApp message templates across tenants.
|
|
6699
|
-
*/
|
|
6700
|
-
templates<T = any>(params?: Record<string, unknown>): Promise<T>;
|
|
4384
|
+
declare class Sessions extends APIResource {
|
|
6701
4385
|
/**
|
|
6702
|
-
*
|
|
4386
|
+
* List all sessions for the current user.
|
|
6703
4387
|
*/
|
|
6704
|
-
|
|
4388
|
+
list<T = any>(): Promise<T>;
|
|
6705
4389
|
/**
|
|
6706
|
-
*
|
|
4390
|
+
* Revoke a specific session by its ID.
|
|
4391
|
+
*
|
|
4392
|
+
* @param id - The session ID to revoke.
|
|
6707
4393
|
*/
|
|
6708
|
-
|
|
4394
|
+
revoke<T = any>(id: string): Promise<T>;
|
|
6709
4395
|
}
|
|
6710
4396
|
|
|
6711
4397
|
/**
|
|
@@ -6723,36 +4409,34 @@ declare class AdminWhatsApp extends APIResource {
|
|
|
6723
4409
|
* mounted v1 endpoint are wired.
|
|
6724
4410
|
*/
|
|
6725
4411
|
|
|
6726
|
-
/**
|
|
4412
|
+
/**
|
|
4413
|
+
* The unified inbox (`/v1/api/platform/inbox/*`) — every channel's threads.
|
|
4414
|
+
* Bulk sends are Flow campaigns (a flow run over a CRM segment), not a raw
|
|
4415
|
+
* broadcast API.
|
|
4416
|
+
*/
|
|
6727
4417
|
declare class ErixChat {
|
|
6728
4418
|
readonly messages: Messages;
|
|
6729
4419
|
readonly conversations: Conversations;
|
|
6730
|
-
readonly broadcasts: Broadcasts;
|
|
6731
4420
|
constructor(client: AxiosInstance);
|
|
6732
4421
|
}
|
|
6733
4422
|
/** Every ERIX product resource (`/v1/api/product/erix/*`). */
|
|
6734
4423
|
declare class ErixProduct {
|
|
6735
4424
|
readonly leads: Leads;
|
|
6736
4425
|
readonly pipelines: Pipelines;
|
|
6737
|
-
readonly automations: Automations;
|
|
6738
4426
|
readonly activities: Activities;
|
|
6739
4427
|
readonly analytics: Analytics;
|
|
6740
4428
|
readonly scoring: Scoring;
|
|
6741
4429
|
readonly payments: Payments;
|
|
6742
|
-
readonly sequences: Sequences;
|
|
6743
|
-
readonly automationDashboard: AutomationDashboard;
|
|
6744
4430
|
readonly chat: ErixChat;
|
|
6745
4431
|
readonly events: EventsResource;
|
|
6746
|
-
readonly eventLog: Logs;
|
|
6747
4432
|
readonly invoices: Invoices;
|
|
6748
4433
|
readonly checkout: Checkout;
|
|
6749
4434
|
readonly projects: ProjectDocuments;
|
|
6750
|
-
readonly campaigns: Campaigns;
|
|
6751
|
-
readonly portalInbox: PortalInbox;
|
|
6752
4435
|
readonly niche: NicheResources;
|
|
6753
4436
|
readonly documents: CRMDocuments;
|
|
6754
4437
|
readonly invoiceExport: CRMInvoiceExport;
|
|
6755
|
-
|
|
4438
|
+
/** The AI agent: settings + inbox drafts. */
|
|
4439
|
+
readonly ai: AiAgent;
|
|
6756
4440
|
constructor(client: AxiosInstance);
|
|
6757
4441
|
}
|
|
6758
4442
|
/** Product domain root (`/v1/api/product/*`). */
|
|
@@ -6806,52 +4490,6 @@ declare class PlatformUsers {
|
|
|
6806
4490
|
readonly notifications: Notifications;
|
|
6807
4491
|
constructor(client: AxiosInstance);
|
|
6808
4492
|
}
|
|
6809
|
-
/**
|
|
6810
|
-
* Admin control plane (`/platform/admin/*`) — requires the elevated
|
|
6811
|
-
* `coreApiKey`. This is the full platform-admin console surface consumed by
|
|
6812
|
-
* the `admin` app.
|
|
6813
|
-
*/
|
|
6814
|
-
declare class PlatformAdmin {
|
|
6815
|
-
readonly revenue: AdminRevenue;
|
|
6816
|
-
readonly billing: AdminBilling;
|
|
6817
|
-
readonly payments: AdminPaymentOps;
|
|
6818
|
-
readonly credits: AdminCredits;
|
|
6819
|
-
readonly plans: AdminPlans;
|
|
6820
|
-
readonly agencyInvoices: AdminAgencyInvoices;
|
|
6821
|
-
readonly flags: AdminFeatureFlags;
|
|
6822
|
-
readonly activityLogs: AdminActivityLogs;
|
|
6823
|
-
readonly auditLogs: AdminAuditLogs;
|
|
6824
|
-
readonly analytics: AdminAnalytics;
|
|
6825
|
-
readonly health: AdminHealth;
|
|
6826
|
-
readonly storage: AdminStorage;
|
|
6827
|
-
readonly announcements: AdminAnnouncements;
|
|
6828
|
-
readonly compliance: AdminCompliance;
|
|
6829
|
-
readonly tickets: AdminTickets;
|
|
6830
|
-
readonly templates: AdminTemplates;
|
|
6831
|
-
readonly agents: AdminAgents;
|
|
6832
|
-
readonly personaHistory: AdminPersonaHistory;
|
|
6833
|
-
readonly openapi: AdminOpenApi;
|
|
6834
|
-
readonly staff: AdminStaff;
|
|
6835
|
-
readonly tenants: AdminTenants;
|
|
6836
|
-
readonly whatsapp: AdminWhatsApp;
|
|
6837
|
-
readonly laie: AdminLaie;
|
|
6838
|
-
readonly laieRuntime: AdminLaieRuntime;
|
|
6839
|
-
readonly laieVault: AdminLaieVault;
|
|
6840
|
-
readonly flow: AdminFlow;
|
|
6841
|
-
readonly email: AdminEmail;
|
|
6842
|
-
readonly pipelines: AdminPipelines;
|
|
6843
|
-
readonly integrations: AdminIntegrations;
|
|
6844
|
-
readonly erix: AdminErix;
|
|
6845
|
-
readonly dashboard: AdminDashboard;
|
|
6846
|
-
readonly partners: AdminPartners;
|
|
6847
|
-
readonly waitlist: AdminWaitlist;
|
|
6848
|
-
readonly blogs: AdminBlogs;
|
|
6849
|
-
readonly leads: AdminLeads;
|
|
6850
|
-
readonly onboarding: AdminOnboarding;
|
|
6851
|
-
readonly cors: Cors;
|
|
6852
|
-
readonly clients: Services;
|
|
6853
|
-
constructor(client: AxiosInstance);
|
|
6854
|
-
}
|
|
6855
4493
|
/** Platform control plane (`/platform/*`). */
|
|
6856
4494
|
declare class PlatformDomain {
|
|
6857
4495
|
readonly auth: Auth;
|
|
@@ -6860,7 +4498,8 @@ declare class PlatformDomain {
|
|
|
6860
4498
|
readonly billing: Billing;
|
|
6861
4499
|
readonly support: Support;
|
|
6862
4500
|
readonly ai: PlatformAI;
|
|
6863
|
-
|
|
4501
|
+
/** The AI agent's knowledge base (RAG). */
|
|
4502
|
+
readonly knowledge: Knowledge;
|
|
6864
4503
|
readonly health: Health;
|
|
6865
4504
|
constructor(client: AxiosInstance);
|
|
6866
4505
|
}
|
|
@@ -6959,7 +4598,8 @@ declare class Webhooks {
|
|
|
6959
4598
|
/**
|
|
6960
4599
|
* Configuration options for the ECODrIxAPI client.
|
|
6961
4600
|
*
|
|
6962
|
-
*
|
|
4601
|
+
* Server-side: `apiKey` and `clientCode`. In a browser use `proxy` instead —
|
|
4602
|
+
* a workspace key must never ship to a browser.
|
|
6963
4603
|
* The backend URL is managed internally and should not need to be changed.
|
|
6964
4604
|
*/
|
|
6965
4605
|
interface ECODrIxAPIOptions {
|
|
@@ -6968,18 +4608,13 @@ interface ECODrIxAPIOptions {
|
|
|
6968
4608
|
* Obtain this from the ECODrIx dashboard under Settings → API Keys.
|
|
6969
4609
|
* @example "ecod_live_sk_..."
|
|
6970
4610
|
*/
|
|
6971
|
-
apiKey
|
|
4611
|
+
apiKey?: string;
|
|
6972
4612
|
/**
|
|
6973
4613
|
* Your tenant ID (Client Code).
|
|
6974
4614
|
* This scopes all API requests to your specific organisation.
|
|
6975
4615
|
* @example "ERIX_CLNT_JHBJHF"
|
|
6976
4616
|
*/
|
|
6977
4617
|
clientCode?: string;
|
|
6978
|
-
/**
|
|
6979
|
-
* Optional Core API Key for deep system-level bypasses.
|
|
6980
|
-
* Only used by elevated internal SaaS modules like Nirvisham.
|
|
6981
|
-
*/
|
|
6982
|
-
coreApiKey?: string;
|
|
6983
4618
|
/**
|
|
6984
4619
|
* API route version to target. This is the ONLY knob for moving the entire
|
|
6985
4620
|
* SDK to a new server API version — every endpoint is issued relative to
|
|
@@ -7010,6 +4645,27 @@ interface ECODrIxAPIOptions {
|
|
|
7010
4645
|
* caller forever). Defaults to 30000 (30s). Set 0 to disable.
|
|
7011
4646
|
*/
|
|
7012
4647
|
timeout?: number;
|
|
4648
|
+
/**
|
|
4649
|
+
* Browser mode — no workspace key in the page. Requests go to YOUR server
|
|
4650
|
+
* route at `url` (it checks your signed-in user, adds `x-api-key` /
|
|
4651
|
+
* `x-client-code`, and forwards `<url>/<version>/api/*` to ECODrIx). For
|
|
4652
|
+
* realtime, `ticket` returns a short-lived socket ticket your server gets
|
|
4653
|
+
* from `POST /v1/api/platform/realtime/ticket`; without it no socket opens.
|
|
4654
|
+
*
|
|
4655
|
+
* @example
|
|
4656
|
+
* ```typescript
|
|
4657
|
+
* new ECODrIxAPI({
|
|
4658
|
+
* proxy: {
|
|
4659
|
+
* url: "/api/erix",
|
|
4660
|
+
* ticket: () => fetch("/api/erix/ticket").then((r) => r.text()),
|
|
4661
|
+
* },
|
|
4662
|
+
* });
|
|
4663
|
+
* ```
|
|
4664
|
+
*/
|
|
4665
|
+
proxy?: {
|
|
4666
|
+
url: string;
|
|
4667
|
+
ticket?: () => Promise<string>;
|
|
4668
|
+
};
|
|
7013
4669
|
}
|
|
7014
4670
|
/**
|
|
7015
4671
|
* The primary entry point for the ECODrIx SDK.
|
|
@@ -7081,6 +4737,8 @@ declare class ECODrIxAPI {
|
|
|
7081
4737
|
* @param roomId - The unique identifier for the room.
|
|
7082
4738
|
*/
|
|
7083
4739
|
leaveRoom(roomId: string): void;
|
|
4740
|
+
/** Highest event `seq` seen — sent on reconnect so missed events replay. */
|
|
4741
|
+
private lastSeq;
|
|
7084
4742
|
private setupSocket;
|
|
7085
4743
|
/**
|
|
7086
4744
|
* Subscribe to a real-time event emitted by the ECODrIx platform.
|
|
@@ -7090,14 +4748,24 @@ declare class ECODrIxAPI {
|
|
|
7090
4748
|
* your own tenant.
|
|
7091
4749
|
*
|
|
7092
4750
|
* **Standard events:**
|
|
7093
|
-
* - `
|
|
7094
|
-
*
|
|
7095
|
-
*
|
|
7096
|
-
* - `
|
|
7097
|
-
*
|
|
7098
|
-
* - `
|
|
4751
|
+
* - `inbox.message` — `{ conversationId, message }` for EVERY message the
|
|
4752
|
+
* inbox stores: any channel, inbound or outbound, sent by anyone
|
|
4753
|
+
* (customer, agent, Flow, the AI). The one event an inbox needs.
|
|
4754
|
+
* - `message_status_update` — `{ messageId, conversationId, status }`
|
|
4755
|
+
* (sent → delivered → read, or failed)
|
|
4756
|
+
* - `new_message` / `message_sent` / `conversation_updated` /
|
|
4757
|
+
* `message_updated` — WhatsApp-specific detail (reactions, media)
|
|
4758
|
+
* - `ai_suggestion` — an AI draft is waiting on a conversation
|
|
4759
|
+
* - `ai_handoff` — `{ conversationId, reason }`: the AI handed a chat to a person
|
|
4760
|
+
* - `platform:notification` / `platform:notification_count` — notifications
|
|
4761
|
+
* - `knowledge.source_updated` / `knowledge.source_removed` — knowledge base
|
|
7099
4762
|
* - `workflow-run-update` — automation execution progress
|
|
7100
|
-
* - `
|
|
4763
|
+
* - `resync` — after a reconnect the server couldn't replay everything that
|
|
4764
|
+
* was missed (gap too old/large): refetch your data.
|
|
4765
|
+
*
|
|
4766
|
+
* Every event's last argument is `{ seq }` (plus `replay: true` when it was
|
|
4767
|
+
* re-sent after a reconnect). A replay can repeat an event you already got,
|
|
4768
|
+
* so make handlers idempotent (e.g. upsert by id).
|
|
7101
4769
|
*
|
|
7102
4770
|
* @param event - The event name to subscribe to.
|
|
7103
4771
|
* @param callback - The handler function invoked when the event fires.
|
|
@@ -7121,6 +4789,7 @@ declare class ECODrIxAPI {
|
|
|
7121
4789
|
* process.on("SIGTERM", () => ecod.disconnect());
|
|
7122
4790
|
* ```
|
|
7123
4791
|
*/
|
|
4792
|
+
private closed;
|
|
7124
4793
|
disconnect(): void;
|
|
7125
4794
|
/**
|
|
7126
4795
|
* Remove a previously registered event listener.
|
|
@@ -7513,4 +5182,4 @@ declare function getRetryConfig(error: any): {
|
|
|
7513
5182
|
readonly reason: "Generic API errors may be transient and worth retrying";
|
|
7514
5183
|
};
|
|
7515
5184
|
|
|
7516
|
-
export { type AIPersona, APIError,
|
|
5185
|
+
export { type AIPersona, APIError, APIResource, type AgentAutonomy, type AgentBudget, AiAgent, type AiAgentSettings, type AiAgentTool, type AiSuggestion, type AnswerFollowupBody, type AnswerOnboardingPayload, type AnswerOnboardingResponse, type ApplyCouponPayload, AuthenticationError, type BehaviorRules, type CheckboxConfig, type CheckoutAmountBreakdown, type CheckoutOrderResponse, type CheckoutProduct, type CheckoutSession, type ColorRule, type ColumnConfig, type CompleteOnboardingPayload, type CompleteOnboardingResponse, type ConfidenceResponse, ConnectInfra, type Conversation, type ListParams as ConversationListParams, type Correction, type CreateLeadParams, type CreateOrderPayload, type CreatePipelineParams, type CreateSessionPayload, type CrmView, type CurrencyConfig, type CurrencyValue, type CustomFieldFilter, type DateConfig, type DateTimeConfig, type DropdownConfig, ECODrIxAPI as ECODrIx, ECODrIxAPI, type ECODrIxAPIOptions, ERROR_RETRY_CONFIG, EcodrixError, type EditOnboardingPayload, type EditOnboardingResponse, type EmailConfig, EmailConnect, ErixChat, ErixProduct, type FieldConfig, type FieldDefinition, type FieldManifest, type FieldType, type FileConfig, type FilterOperator, type FilterRule, type FormulaConfig, type GlobalOnboardingPayload, HTTP_STATUS_ERROR_MAP, type ICP, type InboxChannel, InfraDomain, KNOWLEDGE_FILE_TYPES, Knowledge, type KnowledgePassage, type KnowledgeSource, LEAD_STATUS_VALUES, type LayoutType, type Lead, type LeadPattern, type LeadSource, type LeadStatus, type LearningMemory, type ListLeadsParams, type ManifestFieldType, type MappingField, type MappingPreviewResult, type MappingSources, type MappingValidationResult, type Message, type ModuleAgent, type ModuleAgentPatch, type ModuleAgentSettings, type ModuleAgentTool, type NichePack, type NichePackResearchConfig, type NichePackStatus, type NormalizedFieldValue, type NumberConfig, Onboarding, type OnboardingCohortRange, type OnboardingConfig, type OnboardingExperiment, type OnboardingExperimentStatus, type OnboardingExperimentVariant, type OnboardingMemoryMapping, type OnboardingOption, type OnboardingSession, type OnboardingSessionStatus, type OnboardingStateResponse, type OnboardingStep, type OnboardingStepType, type OutboundMedia, type OutreachEdit, type PaginatedResponse, type PausedRun, Persona, type PersonaFollowupQuestion, type PersonaFollowupsResponse, type PersonaIdentity, type PersonaTimelineEntry, type PersonaTimelineOptions, type PersonaTimelineResponse, type PhoneConfig, type Pipeline, type PipelineStage, type PipelineStageParams, PlatformDomain, PlatformTenants, PlatformUsers, ProductDomain, type ProgressConfig, RateLimitError, type RatingConfig, type ReinforceResponse, type ReinforcementEvent, type RelationConfig, type RelationValue, type RequestOptions, type ResourceManifest, type SendMessageParams, type SendTemplateParams, type ServiceConfig, type ServiceConfigGlobal, type ServiceConfigPerProduct, type SortRule, type StartOnboardingPayload, type StartOnboardingResponse, StorageInfra, type StoredFieldValue, type SuggestionEvent, type TagsConfig, type Template, type TemplateApiResponse, type TemplateBinding, type TemplateBindingSource, type TemplateComponent, type TemplateEmptyPolicy, type TemplateMapping, type TextConfig, type UpsertLeadParams, type UrlConfig, type VerifyPayload, type ViewConfig, type Vocabulary, WhatsAppConnect, type WorkspaceDashboardLayout, type WorkspaceDefaultAutomation, type WorkspaceDefaultField, type WorkspaceDefaultPipeline, type WorkspaceModuleConfig, type WorkspaceProfile, ECODrIxAPI as default, getErrorDetails, getRetryConfig, handleAPIError, isAPIError };
|