@ecodrix/erix-api 1.3.4 → 1.3.6
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 +5 -5
- package/dist/ts/cjs/index.cjs +1 -2
- package/dist/ts/esm/index.d.ts +474 -389
- package/dist/ts/esm/index.js +1 -2
- package/package.json +5 -9
- package/dist/index.d.ts +0 -3384
- package/dist/ts/browser/index.global.js +0 -52
- package/dist/ts/browser/index.global.js.map +0 -1
- package/dist/ts/cjs/index.cjs.map +0 -1
- package/dist/ts/cjs/index.d.cts +0 -3384
- package/dist/ts/esm/index.js.map +0 -1
package/dist/ts/esm/index.d.ts
CHANGED
|
@@ -23,6 +23,174 @@ declare abstract class APIResource {
|
|
|
23
23
|
private handleError;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
+
declare class Agency extends APIResource {
|
|
27
|
+
/**
|
|
28
|
+
* List all available blueprints.
|
|
29
|
+
*/
|
|
30
|
+
listBlueprints<T = any>(): Promise<T>;
|
|
31
|
+
/**
|
|
32
|
+
* Create a new blueprint configuration ("Gold Standard").
|
|
33
|
+
*/
|
|
34
|
+
createBlueprint<T = any>(payload: any): Promise<T>;
|
|
35
|
+
/**
|
|
36
|
+
* Deploy a blueprint to a specific tenant client code.
|
|
37
|
+
*/
|
|
38
|
+
deployBlueprint<T = any>(payload: {
|
|
39
|
+
clientCode: string;
|
|
40
|
+
blueprintId: string;
|
|
41
|
+
}): Promise<T>;
|
|
42
|
+
/**
|
|
43
|
+
* Get aggregate portfolio statistics for an agency.
|
|
44
|
+
*/
|
|
45
|
+
getPortfolioStats<T = any>(agencyCode: string): Promise<T>;
|
|
46
|
+
/**
|
|
47
|
+
* Get proactive health report for an agency portfolio.
|
|
48
|
+
*/
|
|
49
|
+
getPortfolioHealth<T = any>(agencyCode: string): Promise<T>;
|
|
50
|
+
/**
|
|
51
|
+
* View consumption usage for a specific client code.
|
|
52
|
+
*/
|
|
53
|
+
getUsage<T = any>(clientCode: string): Promise<T>;
|
|
54
|
+
/**
|
|
55
|
+
* List staff members under a specific agency code.
|
|
56
|
+
*/
|
|
57
|
+
listStaff<T = any>(agencyCode: string): Promise<T>;
|
|
58
|
+
/**
|
|
59
|
+
* Create a new staff member for an agency.
|
|
60
|
+
*/
|
|
61
|
+
createStaff<T = any>(payload: any): Promise<T>;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
interface CheckoutProduct {
|
|
65
|
+
externalId: string;
|
|
66
|
+
name: string;
|
|
67
|
+
price: number;
|
|
68
|
+
image?: string;
|
|
69
|
+
}
|
|
70
|
+
interface CheckoutAmountBreakdown {
|
|
71
|
+
subtotal: number;
|
|
72
|
+
discount: number;
|
|
73
|
+
delivery: number;
|
|
74
|
+
total: number;
|
|
75
|
+
}
|
|
76
|
+
interface CheckoutSession {
|
|
77
|
+
sessionId: string;
|
|
78
|
+
product: {
|
|
79
|
+
name: string;
|
|
80
|
+
price: number;
|
|
81
|
+
image?: string;
|
|
82
|
+
};
|
|
83
|
+
amounts: CheckoutAmountBreakdown;
|
|
84
|
+
items: Array<{
|
|
85
|
+
productId: string;
|
|
86
|
+
quantity: number;
|
|
87
|
+
}>;
|
|
88
|
+
}
|
|
89
|
+
interface CreateSessionPayload {
|
|
90
|
+
productId: string;
|
|
91
|
+
quantity: number;
|
|
92
|
+
couponCode?: string;
|
|
93
|
+
}
|
|
94
|
+
interface ApplyCouponPayload {
|
|
95
|
+
sessionId: string;
|
|
96
|
+
couponCode: string;
|
|
97
|
+
}
|
|
98
|
+
interface VerifyPayload {
|
|
99
|
+
sessionId: string;
|
|
100
|
+
method: "truecaller" | "otp";
|
|
101
|
+
token?: string;
|
|
102
|
+
phone?: string;
|
|
103
|
+
otp?: string;
|
|
104
|
+
}
|
|
105
|
+
interface CreateOrderPayload {
|
|
106
|
+
sessionId: string;
|
|
107
|
+
customer: {
|
|
108
|
+
name: string;
|
|
109
|
+
phone: string;
|
|
110
|
+
email?: string;
|
|
111
|
+
address: {
|
|
112
|
+
line1: string;
|
|
113
|
+
city: string;
|
|
114
|
+
state: string;
|
|
115
|
+
pincode: string;
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
paymentProvider: "razorpay" | "cod";
|
|
119
|
+
}
|
|
120
|
+
interface CheckoutOrderResponse {
|
|
121
|
+
order_id: string;
|
|
122
|
+
payment_order_id?: string;
|
|
123
|
+
amount?: number;
|
|
124
|
+
currency?: string;
|
|
125
|
+
status?: string;
|
|
126
|
+
message?: string;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Resource for managing the ErixCheckout one-click flow.
|
|
131
|
+
*
|
|
132
|
+
* This resource handles session creation, coupon application,
|
|
133
|
+
* identity verification, and final order placement.
|
|
134
|
+
*/
|
|
135
|
+
declare class Checkout extends APIResource {
|
|
136
|
+
/**
|
|
137
|
+
* Retrieves product information for the checkout modal.
|
|
138
|
+
* @param productId - External SKU/ID of the product.
|
|
139
|
+
*/
|
|
140
|
+
getProduct(productId: string): Promise<CheckoutProduct>;
|
|
141
|
+
/**
|
|
142
|
+
* Initializes a new checkout session.
|
|
143
|
+
*/
|
|
144
|
+
createSession(payload: CreateSessionPayload): Promise<CheckoutSession>;
|
|
145
|
+
/**
|
|
146
|
+
* Applies a discount coupon to an active session.
|
|
147
|
+
*/
|
|
148
|
+
applyCoupon(payload: ApplyCouponPayload): Promise<CheckoutSession>;
|
|
149
|
+
/**
|
|
150
|
+
* Verifies user identity via Truecaller or OTP.
|
|
151
|
+
*/
|
|
152
|
+
verify(payload: VerifyPayload): Promise<{
|
|
153
|
+
verified: boolean;
|
|
154
|
+
data?: any;
|
|
155
|
+
}>;
|
|
156
|
+
/**
|
|
157
|
+
* Finalizes the order and initiates payment.
|
|
158
|
+
*/
|
|
159
|
+
createOrder(payload: CreateOrderPayload): Promise<CheckoutOrderResponse>;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
interface CorsOriginCreatePayload {
|
|
163
|
+
url: string;
|
|
164
|
+
name?: string;
|
|
165
|
+
allowedHeaders?: string[];
|
|
166
|
+
allowedMethods?: string[];
|
|
167
|
+
}
|
|
168
|
+
interface CorsOriginUpdatePayload {
|
|
169
|
+
url?: string;
|
|
170
|
+
name?: string;
|
|
171
|
+
allowedHeaders?: string[];
|
|
172
|
+
allowedMethods?: string[];
|
|
173
|
+
isActive?: boolean;
|
|
174
|
+
}
|
|
175
|
+
declare class Cors extends APIResource {
|
|
176
|
+
/**
|
|
177
|
+
* List all dynamic cross-origin policies.
|
|
178
|
+
*/
|
|
179
|
+
list<T = any>(): Promise<T>;
|
|
180
|
+
/**
|
|
181
|
+
* Register a new cross-origin client for the SaaS API network dynamically.
|
|
182
|
+
*/
|
|
183
|
+
create<T = any>(payload: CorsOriginCreatePayload): Promise<T>;
|
|
184
|
+
/**
|
|
185
|
+
* Adjust active states or configurations for an existing origin policy.
|
|
186
|
+
*/
|
|
187
|
+
update<T = any>(id: string, payload: CorsOriginUpdatePayload): Promise<T>;
|
|
188
|
+
/**
|
|
189
|
+
* Irreversibly drop support for a cross-origin client URL policy permanently.
|
|
190
|
+
*/
|
|
191
|
+
delete<T = any>(id: string): Promise<T>;
|
|
192
|
+
}
|
|
193
|
+
|
|
26
194
|
interface LogActivityParams {
|
|
27
195
|
leadId: string;
|
|
28
196
|
type: "note" | "call" | "email" | "meeting" | "whatsapp" | "system";
|
|
@@ -1065,41 +1233,80 @@ interface SendCampaignPayload {
|
|
|
1065
1233
|
* Interface representing the result of a campaign dispatch.
|
|
1066
1234
|
*/
|
|
1067
1235
|
interface CampaignResult {
|
|
1236
|
+
/** Indicates if the campaign was successfully queued/sent. */
|
|
1068
1237
|
success: boolean;
|
|
1238
|
+
/** Optional message detailing the result. */
|
|
1069
1239
|
message?: string;
|
|
1240
|
+
/** Additional dynamic properties. */
|
|
1070
1241
|
[key: string]: any;
|
|
1071
1242
|
}
|
|
1243
|
+
/**
|
|
1244
|
+
* Represents an email template within the system.
|
|
1245
|
+
*/
|
|
1072
1246
|
interface EmailTemplate {
|
|
1247
|
+
/** Unique identifier of the template. */
|
|
1073
1248
|
id: string;
|
|
1249
|
+
/** Human-readable name of the template. */
|
|
1074
1250
|
name: string;
|
|
1251
|
+
/** Optional description explaining the template's purpose. */
|
|
1075
1252
|
description?: string;
|
|
1253
|
+
/** Subject line used when sending emails with this template. */
|
|
1076
1254
|
subject: string;
|
|
1255
|
+
/** Optional preheader text (hidden snippet visible in email clients). */
|
|
1077
1256
|
preheader?: string;
|
|
1257
|
+
/** Raw HTML content of the template. */
|
|
1078
1258
|
htmlBody: string;
|
|
1259
|
+
/** Optional plain-text fallback content. */
|
|
1079
1260
|
textBody?: string;
|
|
1261
|
+
/** Broad category classification for the template. */
|
|
1080
1262
|
category: "marketing" | "transactional" | "sequence";
|
|
1263
|
+
/** Current state of the template. */
|
|
1081
1264
|
status: "draft" | "published" | "archived";
|
|
1265
|
+
/** Type of template, whether standard or a reusable layout. */
|
|
1082
1266
|
type: "standard" | "layout";
|
|
1267
|
+
/** Optional layout ID if this template inherits from a layout. */
|
|
1083
1268
|
layoutId?: string;
|
|
1269
|
+
/** Optional URL to a thumbnail image representing the template. */
|
|
1084
1270
|
thumbnail?: string;
|
|
1271
|
+
/** Array defining dynamic variables used within the template. */
|
|
1085
1272
|
variableMapping?: any[];
|
|
1273
|
+
/** ISO timestamp of when the template was created. */
|
|
1086
1274
|
createdAt: string;
|
|
1275
|
+
/** ISO timestamp of when the template was last updated. */
|
|
1087
1276
|
updatedAt: string;
|
|
1088
1277
|
}
|
|
1278
|
+
/**
|
|
1279
|
+
* Data transfer object for creating a new email template.
|
|
1280
|
+
*/
|
|
1089
1281
|
interface CreateTemplateDTO {
|
|
1282
|
+
/** Name of the template. */
|
|
1090
1283
|
name: string;
|
|
1284
|
+
/** Email subject line. */
|
|
1091
1285
|
subject: string;
|
|
1286
|
+
/** Raw HTML content. */
|
|
1092
1287
|
htmlBody: string;
|
|
1288
|
+
/** Optional description. */
|
|
1093
1289
|
description?: string;
|
|
1290
|
+
/** Category of the template. Defaults to marketing if not provided. */
|
|
1094
1291
|
category?: "marketing" | "transactional" | "sequence";
|
|
1292
|
+
/** Initial status. Defaults to draft. */
|
|
1095
1293
|
status?: "draft" | "published" | "archived";
|
|
1294
|
+
/** Optional variable mapping definitions. */
|
|
1096
1295
|
variableMapping?: any[];
|
|
1097
1296
|
}
|
|
1297
|
+
/**
|
|
1298
|
+
* Response structure when previewing an email template.
|
|
1299
|
+
*/
|
|
1098
1300
|
interface TemplatePreviewResponse {
|
|
1301
|
+
/** Indicates if the preview generation was successful. */
|
|
1099
1302
|
success: boolean;
|
|
1303
|
+
/** The generated preview content. */
|
|
1100
1304
|
data: {
|
|
1305
|
+
/** Resolved subject line. */
|
|
1101
1306
|
subject: string;
|
|
1307
|
+
/** Resolved HTML body. */
|
|
1102
1308
|
html: string;
|
|
1309
|
+
/** Resolved plain text fallback (if available). */
|
|
1103
1310
|
text?: string;
|
|
1104
1311
|
};
|
|
1105
1312
|
}
|
|
@@ -1111,14 +1318,40 @@ interface TemplatePreviewResponse {
|
|
|
1111
1318
|
declare class Email extends APIResource {
|
|
1112
1319
|
/**
|
|
1113
1320
|
* Send an HTML email campaign to a list of recipients.
|
|
1321
|
+
*
|
|
1322
|
+
* @param payload - Data required to send a campaign.
|
|
1323
|
+
* @returns A promise resolving to the campaign result.
|
|
1324
|
+
* @example
|
|
1325
|
+
* ```typescript
|
|
1326
|
+
* await erixClient.email.sendCampaign({
|
|
1327
|
+
* recipients: ["test@example.com"],
|
|
1328
|
+
* subject: "Hello!",
|
|
1329
|
+
* html: "<h1>Hi there</h1>"
|
|
1330
|
+
* });
|
|
1331
|
+
* ```
|
|
1114
1332
|
*/
|
|
1115
1333
|
sendCampaign(payload: SendCampaignPayload): Promise<CampaignResult>;
|
|
1116
1334
|
/**
|
|
1117
1335
|
* Send a system test email to validate your current SMTP configuration.
|
|
1336
|
+
*
|
|
1337
|
+
* @param to - The recipient email address for the test email.
|
|
1338
|
+
* @returns A promise resolving to the result of the test email dispatch.
|
|
1339
|
+
* @example
|
|
1340
|
+
* ```typescript
|
|
1341
|
+
* await erixClient.email.sendTest("admin@mycompany.com");
|
|
1342
|
+
* ```
|
|
1118
1343
|
*/
|
|
1119
1344
|
sendTest(to: string): Promise<CampaignResult>;
|
|
1120
1345
|
/**
|
|
1121
1346
|
* List all email templates.
|
|
1347
|
+
*
|
|
1348
|
+
* @param query - Optional query parameters for filtering and pagination.
|
|
1349
|
+
* @returns A promise resolving to a paginated or filtered list of templates.
|
|
1350
|
+
* @example
|
|
1351
|
+
* ```typescript
|
|
1352
|
+
* const response = await erixClient.email.listTemplates({ category: "marketing" });
|
|
1353
|
+
* console.log(response.data);
|
|
1354
|
+
* ```
|
|
1122
1355
|
*/
|
|
1123
1356
|
listTemplates(query?: any): Promise<{
|
|
1124
1357
|
success: boolean;
|
|
@@ -1126,6 +1359,13 @@ declare class Email extends APIResource {
|
|
|
1126
1359
|
}>;
|
|
1127
1360
|
/**
|
|
1128
1361
|
* Get a single email template by ID.
|
|
1362
|
+
*
|
|
1363
|
+
* @param id - The unique identifier of the template.
|
|
1364
|
+
* @returns A promise resolving to the requested template details.
|
|
1365
|
+
* @example
|
|
1366
|
+
* ```typescript
|
|
1367
|
+
* const template = await erixClient.email.getTemplate("tpl_123abc");
|
|
1368
|
+
* ```
|
|
1129
1369
|
*/
|
|
1130
1370
|
getTemplate(id: string): Promise<{
|
|
1131
1371
|
success: boolean;
|
|
@@ -1133,6 +1373,17 @@ declare class Email extends APIResource {
|
|
|
1133
1373
|
}>;
|
|
1134
1374
|
/**
|
|
1135
1375
|
* Create a new email template.
|
|
1376
|
+
*
|
|
1377
|
+
* @param data - The template data transfer object containing the details.
|
|
1378
|
+
* @returns A promise resolving to the newly created template.
|
|
1379
|
+
* @example
|
|
1380
|
+
* ```typescript
|
|
1381
|
+
* const newTpl = await erixClient.email.createTemplate({
|
|
1382
|
+
* name: "Welcome Series 1",
|
|
1383
|
+
* subject: "Welcome to our platform!",
|
|
1384
|
+
* htmlBody: "<h1>Welcome</h1><p>We are glad you are here.</p>"
|
|
1385
|
+
* });
|
|
1386
|
+
* ```
|
|
1136
1387
|
*/
|
|
1137
1388
|
createTemplate(data: CreateTemplateDTO): Promise<{
|
|
1138
1389
|
success: boolean;
|
|
@@ -1140,6 +1391,16 @@ declare class Email extends APIResource {
|
|
|
1140
1391
|
}>;
|
|
1141
1392
|
/**
|
|
1142
1393
|
* Update an existing email template.
|
|
1394
|
+
*
|
|
1395
|
+
* @param id - The unique identifier of the template to update.
|
|
1396
|
+
* @param data - The partial data transfer object to update the template with.
|
|
1397
|
+
* @returns A promise resolving to the updated template.
|
|
1398
|
+
* @example
|
|
1399
|
+
* ```typescript
|
|
1400
|
+
* await erixClient.email.updateTemplate("tpl_123abc", {
|
|
1401
|
+
* subject: "Updated Welcome Subject"
|
|
1402
|
+
* });
|
|
1403
|
+
* ```
|
|
1143
1404
|
*/
|
|
1144
1405
|
updateTemplate(id: string, data: Partial<CreateTemplateDTO>): Promise<{
|
|
1145
1406
|
success: boolean;
|
|
@@ -1147,12 +1408,32 @@ declare class Email extends APIResource {
|
|
|
1147
1408
|
}>;
|
|
1148
1409
|
/**
|
|
1149
1410
|
* Delete an email template.
|
|
1411
|
+
*
|
|
1412
|
+
* @param id - The unique identifier of the template to delete.
|
|
1413
|
+
* @param force - Optional flag to force deletion even if the template is in use (default: false).
|
|
1414
|
+
* @returns A promise resolving to a success indicator.
|
|
1415
|
+
* @example
|
|
1416
|
+
* ```typescript
|
|
1417
|
+
* await erixClient.email.deleteTemplate("tpl_123abc");
|
|
1418
|
+
* ```
|
|
1150
1419
|
*/
|
|
1151
1420
|
deleteTemplate(id: string, force?: boolean): Promise<{
|
|
1152
1421
|
success: boolean;
|
|
1153
1422
|
}>;
|
|
1154
1423
|
/**
|
|
1155
1424
|
* Preview a template with dynamic variable resolution.
|
|
1425
|
+
* Use this to see how a template renders with specific lead data or custom variables.
|
|
1426
|
+
*
|
|
1427
|
+
* @param id - The unique identifier of the template.
|
|
1428
|
+
* @param params - Parameters containing the lead ID or custom variables to inject.
|
|
1429
|
+
* @returns A promise resolving to the rendered HTML and subject.
|
|
1430
|
+
* @example
|
|
1431
|
+
* ```typescript
|
|
1432
|
+
* const preview = await erixClient.email.previewTemplate("tpl_123abc", {
|
|
1433
|
+
* variables: { first_name: "Jane" }
|
|
1434
|
+
* });
|
|
1435
|
+
* console.log(preview.data.html);
|
|
1436
|
+
* ```
|
|
1156
1437
|
*/
|
|
1157
1438
|
previewTemplate(id: string, params: {
|
|
1158
1439
|
leadId?: string;
|
|
@@ -1473,9 +1754,15 @@ declare class Logs extends APIResource {
|
|
|
1473
1754
|
}>;
|
|
1474
1755
|
}
|
|
1475
1756
|
|
|
1757
|
+
/**
|
|
1758
|
+
* Parameters required to send an email campaign.
|
|
1759
|
+
*/
|
|
1476
1760
|
interface SendCampaignParams {
|
|
1761
|
+
/** Array of recipient email addresses. */
|
|
1477
1762
|
recipients: string[];
|
|
1763
|
+
/** Subject line of the email. */
|
|
1478
1764
|
subject: string;
|
|
1765
|
+
/** HTML body content of the email. */
|
|
1479
1766
|
html: string;
|
|
1480
1767
|
}
|
|
1481
1768
|
declare class Emails extends APIResource {
|
|
@@ -1496,14 +1783,21 @@ declare class Emails extends APIResource {
|
|
|
1496
1783
|
sendCampaign<T = any>(params: SendCampaignParams): Promise<T>;
|
|
1497
1784
|
/**
|
|
1498
1785
|
* Send a test verification email (used to verify SMTP functionality).
|
|
1786
|
+
*
|
|
1787
|
+
* @param to - The recipient email address for the test email.
|
|
1788
|
+
* @returns A promise resolving to the result of the test email dispatch.
|
|
1789
|
+
* @example
|
|
1790
|
+
* ```typescript
|
|
1791
|
+
* await erixClient.marketing.emails.sendTest("admin@mycompany.com");
|
|
1792
|
+
* ```
|
|
1499
1793
|
*/
|
|
1500
1794
|
sendTest<T = any>(to: string): Promise<T>;
|
|
1501
1795
|
}
|
|
1502
1796
|
declare class Campaigns extends APIResource {
|
|
1503
1797
|
/**
|
|
1504
|
-
* List all email
|
|
1798
|
+
* List all email marketing campaigns with optional status filtering.
|
|
1505
1799
|
*
|
|
1506
|
-
* @param params - Optional filters (status, limit).
|
|
1800
|
+
* @param params - Optional filters (status, limit, startDate, endDate, page).
|
|
1507
1801
|
* @returns Paginated list of campaign objects.
|
|
1508
1802
|
* @example
|
|
1509
1803
|
* ```typescript
|
|
@@ -1513,66 +1807,9 @@ declare class Campaigns extends APIResource {
|
|
|
1513
1807
|
list<T = any>(params?: {
|
|
1514
1808
|
status?: string;
|
|
1515
1809
|
limit?: number;
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
*
|
|
1520
|
-
* @param payload - Campaign details (name, type, content).
|
|
1521
|
-
* @returns The created campaign record.
|
|
1522
|
-
* @example
|
|
1523
|
-
* ```typescript
|
|
1524
|
-
* await erixClient.marketing.campaigns.create({
|
|
1525
|
-
* name: "Spring Sale",
|
|
1526
|
-
* type: "email",
|
|
1527
|
-
* subject: "Our Spring Sale is Here!",
|
|
1528
|
-
* html: "<h1>BIG DEALS!</h1>"
|
|
1529
|
-
* });
|
|
1530
|
-
* ```
|
|
1531
|
-
*/
|
|
1532
|
-
create<T = any>(payload: {
|
|
1533
|
-
name: string;
|
|
1534
|
-
type: string;
|
|
1535
|
-
subject?: string;
|
|
1536
|
-
html?: string;
|
|
1537
|
-
templateId?: string;
|
|
1538
|
-
recipients?: string[];
|
|
1539
|
-
}): Promise<T>;
|
|
1540
|
-
/**
|
|
1541
|
-
* Retrieve full details for a specific marketing campaign.
|
|
1542
|
-
*
|
|
1543
|
-
* @param campaignId - The unique ID of the campaign.
|
|
1544
|
-
* @example
|
|
1545
|
-
* ```typescript
|
|
1546
|
-
* const campaign = await erixClient.marketing.campaigns.retrieve("camp_123");
|
|
1547
|
-
* ```
|
|
1548
|
-
*/
|
|
1549
|
-
retrieve<T = any>(campaignId: string): Promise<T>;
|
|
1550
|
-
/**
|
|
1551
|
-
* Update a campaign.
|
|
1552
|
-
*/
|
|
1553
|
-
update<T = any>(campaignId: string, payload: any): Promise<T>;
|
|
1554
|
-
/**
|
|
1555
|
-
* Delete a campaign.
|
|
1556
|
-
*/
|
|
1557
|
-
delete<T = any>(campaignId: string): Promise<T>;
|
|
1558
|
-
/**
|
|
1559
|
-
* Send a campaign immediately or schedule it for a later date.
|
|
1560
|
-
*
|
|
1561
|
-
* @param campaignId - The ID of the campaign to dispatch.
|
|
1562
|
-
* @param payload - Optional scheduling information (ISO timestamp).
|
|
1563
|
-
* @example
|
|
1564
|
-
* ```typescript
|
|
1565
|
-
* // Send immediately
|
|
1566
|
-
* await erixClient.marketing.campaigns.send("camp_123");
|
|
1567
|
-
*
|
|
1568
|
-
* // Schedule for tomorrow
|
|
1569
|
-
* await erixClient.marketing.campaigns.send("camp_123", {
|
|
1570
|
-
* scheduledAt: "2026-04-10T09:00:00Z"
|
|
1571
|
-
* });
|
|
1572
|
-
* ```
|
|
1573
|
-
*/
|
|
1574
|
-
send<T = any>(campaignId: string, payload?: {
|
|
1575
|
-
scheduledAt?: string;
|
|
1810
|
+
page?: number;
|
|
1811
|
+
startDate?: string;
|
|
1812
|
+
endDate?: string;
|
|
1576
1813
|
}): Promise<T>;
|
|
1577
1814
|
/**
|
|
1578
1815
|
* Get detailed delivery and engagement statistics for a campaign.
|
|
@@ -1583,7 +1820,7 @@ declare class Campaigns extends APIResource {
|
|
|
1583
1820
|
* @example
|
|
1584
1821
|
* ```typescript
|
|
1585
1822
|
* const report = await erixClient.marketing.campaigns.stats("camp_123");
|
|
1586
|
-
* console.log(`Open Rate: ${report.openRate}%`);
|
|
1823
|
+
* console.log(`Open Rate: ${report.data.openRate}%`);
|
|
1587
1824
|
* ```
|
|
1588
1825
|
*/
|
|
1589
1826
|
stats<T = any>(campaignId: string): Promise<T>;
|
|
@@ -1592,7 +1829,7 @@ declare class WhatsAppMarketing extends APIResource {
|
|
|
1592
1829
|
/**
|
|
1593
1830
|
* Dispatch a template-based WhatsApp message with CRM-integrated variable resolution.
|
|
1594
1831
|
*
|
|
1595
|
-
* Unlike direct WhatsApp sending, this endpoint
|
|
1832
|
+
* Unlike direct WhatsApp sending, this endpoint automatically pulls data from the CRM
|
|
1596
1833
|
* based on the provided variables mapping.
|
|
1597
1834
|
*
|
|
1598
1835
|
* @param params - Template details and recipient phone.
|
|
@@ -1606,16 +1843,29 @@ declare class WhatsAppMarketing extends APIResource {
|
|
|
1606
1843
|
* ```
|
|
1607
1844
|
*/
|
|
1608
1845
|
sendTemplate<T = any>(params: {
|
|
1846
|
+
/** Recipient's phone number. */
|
|
1609
1847
|
phone: string;
|
|
1848
|
+
/** The WhatsApp template name approved in Meta. */
|
|
1610
1849
|
templateName: string;
|
|
1850
|
+
/** Language code for the template (e.g. en_US). */
|
|
1611
1851
|
languageCode?: string;
|
|
1852
|
+
/** CRM mapped variables. */
|
|
1612
1853
|
variables?: Record<string, string>;
|
|
1854
|
+
/** Directly resolved variables to inject into the template. */
|
|
1613
1855
|
resolvedVariables?: Record<string, string>;
|
|
1614
1856
|
}): Promise<T>;
|
|
1615
1857
|
}
|
|
1858
|
+
/**
|
|
1859
|
+
* Global Marketing resource namespace.
|
|
1860
|
+
*
|
|
1861
|
+
* Access via `ecod.marketing`.
|
|
1862
|
+
*/
|
|
1616
1863
|
declare class Marketing extends APIResource {
|
|
1864
|
+
/** Email marketing resources */
|
|
1617
1865
|
emails: Emails;
|
|
1866
|
+
/** Campaign analytics and lists */
|
|
1618
1867
|
campaigns: Campaigns;
|
|
1868
|
+
/** WhatsApp marketing resources */
|
|
1619
1869
|
whatsapp: WhatsAppMarketing;
|
|
1620
1870
|
constructor(client: any);
|
|
1621
1871
|
}
|
|
@@ -2142,7 +2392,162 @@ declare class Queue extends APIResource {
|
|
|
2142
2392
|
deleteJob<T = any>(jobId: string): Promise<T>;
|
|
2143
2393
|
}
|
|
2144
2394
|
|
|
2145
|
-
declare class
|
|
2395
|
+
declare class Clients extends APIResource {
|
|
2396
|
+
/**
|
|
2397
|
+
* List all clients in the ecosystem.
|
|
2398
|
+
*/
|
|
2399
|
+
list<T = any>(): Promise<T>;
|
|
2400
|
+
/**
|
|
2401
|
+
* Get client count and auto-generate a unique code.
|
|
2402
|
+
*/
|
|
2403
|
+
getCountAndGenerateCode<T = any>(): Promise<T>;
|
|
2404
|
+
/**
|
|
2405
|
+
* Retrieve a single client by client code.
|
|
2406
|
+
*/
|
|
2407
|
+
retrieve<T = any>(clientCode: string): Promise<T>;
|
|
2408
|
+
/**
|
|
2409
|
+
* Get API Key for a specific client (Admin Only).
|
|
2410
|
+
*/
|
|
2411
|
+
getApiKey<T = any>(clientCode: string): Promise<T>;
|
|
2412
|
+
/**
|
|
2413
|
+
* Generate or rotate API Key for a specific client (Admin Only).
|
|
2414
|
+
*/
|
|
2415
|
+
rotateApiKey<T = any>(clientCode: string): Promise<T>;
|
|
2416
|
+
/**
|
|
2417
|
+
* Create a new client identity and provision initial resources.
|
|
2418
|
+
*/
|
|
2419
|
+
create<T = any>(payload: {
|
|
2420
|
+
name: string;
|
|
2421
|
+
clientCode: string;
|
|
2422
|
+
business?: any;
|
|
2423
|
+
plan?: any;
|
|
2424
|
+
}): Promise<T>;
|
|
2425
|
+
/**
|
|
2426
|
+
* Get active service configuration for a specific client.
|
|
2427
|
+
*/
|
|
2428
|
+
getConfig<T = any>(clientCode: string): Promise<T>;
|
|
2429
|
+
/**
|
|
2430
|
+
* Update active service configuration for a specific client.
|
|
2431
|
+
*/
|
|
2432
|
+
updateConfig<T = any>(clientCode: string, payload: any): Promise<T>;
|
|
2433
|
+
/**
|
|
2434
|
+
* Get decrypted secrets for a specific client.
|
|
2435
|
+
*/
|
|
2436
|
+
getSecrets<T = any>(clientCode: string): Promise<T>;
|
|
2437
|
+
/**
|
|
2438
|
+
* Set secrets for a specific client.
|
|
2439
|
+
*/
|
|
2440
|
+
updateSecrets<T = any>(clientCode: string, payload: any): Promise<T>;
|
|
2441
|
+
/**
|
|
2442
|
+
* Completely replace secrets for a specific client.
|
|
2443
|
+
*/
|
|
2444
|
+
replaceSecrets<T = any>(clientCode: string, payload: any): Promise<T>;
|
|
2445
|
+
/**
|
|
2446
|
+
* Partially update secrets for a specific client.
|
|
2447
|
+
*/
|
|
2448
|
+
patchSecrets<T = any>(clientCode: string, payload: any): Promise<T>;
|
|
2449
|
+
/**
|
|
2450
|
+
* Retrieve Data Source connection metadata.
|
|
2451
|
+
*/
|
|
2452
|
+
getDataSource<T = any>(clientCode: string): Promise<T>;
|
|
2453
|
+
/**
|
|
2454
|
+
* Configure Data Source metadata.
|
|
2455
|
+
*/
|
|
2456
|
+
manageDataSource<T = any>(clientCode: string, payload: any): Promise<T>;
|
|
2457
|
+
/**
|
|
2458
|
+
* Update Client Identity and perform cascading updates if required.
|
|
2459
|
+
*/
|
|
2460
|
+
updateIdentity<T = any>(id: string, payload: any): Promise<T>;
|
|
2461
|
+
/**
|
|
2462
|
+
* Initiate Google Re-authentication for OAuth tokens.
|
|
2463
|
+
*/
|
|
2464
|
+
googleReauth<T = any>(clientCode: string, payload?: {
|
|
2465
|
+
authCode?: string;
|
|
2466
|
+
}): Promise<T>;
|
|
2467
|
+
/**
|
|
2468
|
+
* Delete a client and perform cascading cleanup.
|
|
2469
|
+
*/
|
|
2470
|
+
delete<T = any>(id: string): Promise<T>;
|
|
2471
|
+
}
|
|
2472
|
+
declare class Blogs extends APIResource {
|
|
2473
|
+
/**
|
|
2474
|
+
* Retrieve public corporate blogs/news.
|
|
2475
|
+
*/
|
|
2476
|
+
list<T = any>(): Promise<T>;
|
|
2477
|
+
}
|
|
2478
|
+
declare class GlobalLeads extends APIResource {
|
|
2479
|
+
/**
|
|
2480
|
+
* Add a corporate lead capture entry.
|
|
2481
|
+
*/
|
|
2482
|
+
add<T = any>(payload: any): Promise<T>;
|
|
2483
|
+
}
|
|
2484
|
+
declare class Services extends APIResource {
|
|
2485
|
+
clients: Clients;
|
|
2486
|
+
blogs: Blogs;
|
|
2487
|
+
globalLeads: GlobalLeads;
|
|
2488
|
+
constructor(client: any);
|
|
2489
|
+
}
|
|
2490
|
+
|
|
2491
|
+
declare class EmailConfig extends APIResource {
|
|
2492
|
+
/**
|
|
2493
|
+
* Retrieve current email provider configuration and domain verification statuses.
|
|
2494
|
+
*/
|
|
2495
|
+
getConfig<T = any>(): Promise<T>;
|
|
2496
|
+
/**
|
|
2497
|
+
* Switch the active email provider.
|
|
2498
|
+
*/
|
|
2499
|
+
switchProvider<T = any>(provider: string): Promise<T>;
|
|
2500
|
+
/**
|
|
2501
|
+
* Provide explicit SMTP credentials and connection preferences.
|
|
2502
|
+
*/
|
|
2503
|
+
saveSmtp<T = any>(payload: any): Promise<T>;
|
|
2504
|
+
/**
|
|
2505
|
+
* Initialize a new domain for SES identity verification.
|
|
2506
|
+
*/
|
|
2507
|
+
initDomainVerification<T = any>(domain: string): Promise<T>;
|
|
2508
|
+
/**
|
|
2509
|
+
* Confirm "From" details and finalize configuration payload.
|
|
2510
|
+
*/
|
|
2511
|
+
saveEmailConfig<T = any>(payload: {
|
|
2512
|
+
fromName: string;
|
|
2513
|
+
fromEmail: string;
|
|
2514
|
+
replyTo?: string;
|
|
2515
|
+
}): Promise<T>;
|
|
2516
|
+
/**
|
|
2517
|
+
* Check status of AWS SES domain validation DNS records.
|
|
2518
|
+
*/
|
|
2519
|
+
checkSesVerification<T = any>(): Promise<T>;
|
|
2520
|
+
/**
|
|
2521
|
+
* Remove a verified SES domain identity and clean up local secrets.
|
|
2522
|
+
*/
|
|
2523
|
+
removeSesIdentity<T = any>(): Promise<T>;
|
|
2524
|
+
/**
|
|
2525
|
+
* Send a test email to verify infrastructure is correctly bound.
|
|
2526
|
+
*/
|
|
2527
|
+
sendTest<T = any>(toEmail: string): Promise<T>;
|
|
2528
|
+
/**
|
|
2529
|
+
* Define customized global email footers, limits, and specific campaign policies.
|
|
2530
|
+
*/
|
|
2531
|
+
saveAdvancedConfig<T = any>(payload: any): Promise<T>;
|
|
2532
|
+
/**
|
|
2533
|
+
* Retrieve email configuration health properties including bounce limits metrics.
|
|
2534
|
+
*/
|
|
2535
|
+
getHealth<T = any>(): Promise<T>;
|
|
2536
|
+
/**
|
|
2537
|
+
* Upgrade configurations dynamically to add DMARC enforcement records.
|
|
2538
|
+
*/
|
|
2539
|
+
fixDmarc<T = any>(): Promise<T>;
|
|
2540
|
+
/**
|
|
2541
|
+
* Discover internally available providers constants metadata.
|
|
2542
|
+
*/
|
|
2543
|
+
listProviders<T = any>(): Promise<T>;
|
|
2544
|
+
}
|
|
2545
|
+
declare class Settings extends APIResource {
|
|
2546
|
+
email: EmailConfig;
|
|
2547
|
+
constructor(client: any);
|
|
2548
|
+
}
|
|
2549
|
+
|
|
2550
|
+
declare class Folders extends APIResource {
|
|
2146
2551
|
/**
|
|
2147
2552
|
* Create a new folder in the tenant's cloud storage.
|
|
2148
2553
|
*
|
|
@@ -2872,329 +3277,6 @@ declare class WhatsApp extends APIResource {
|
|
|
2872
3277
|
}>;
|
|
2873
3278
|
}
|
|
2874
3279
|
|
|
2875
|
-
declare class Agency extends APIResource {
|
|
2876
|
-
/**
|
|
2877
|
-
* List all available blueprints.
|
|
2878
|
-
*/
|
|
2879
|
-
listBlueprints<T = any>(): Promise<T>;
|
|
2880
|
-
/**
|
|
2881
|
-
* Create a new blueprint configuration ("Gold Standard").
|
|
2882
|
-
*/
|
|
2883
|
-
createBlueprint<T = any>(payload: any): Promise<T>;
|
|
2884
|
-
/**
|
|
2885
|
-
* Deploy a blueprint to a specific tenant client code.
|
|
2886
|
-
*/
|
|
2887
|
-
deployBlueprint<T = any>(payload: {
|
|
2888
|
-
clientCode: string;
|
|
2889
|
-
blueprintId: string;
|
|
2890
|
-
}): Promise<T>;
|
|
2891
|
-
/**
|
|
2892
|
-
* Get aggregate portfolio statistics for an agency.
|
|
2893
|
-
*/
|
|
2894
|
-
getPortfolioStats<T = any>(agencyCode: string): Promise<T>;
|
|
2895
|
-
/**
|
|
2896
|
-
* Get proactive health report for an agency portfolio.
|
|
2897
|
-
*/
|
|
2898
|
-
getPortfolioHealth<T = any>(agencyCode: string): Promise<T>;
|
|
2899
|
-
/**
|
|
2900
|
-
* View consumption usage for a specific client code.
|
|
2901
|
-
*/
|
|
2902
|
-
getUsage<T = any>(clientCode: string): Promise<T>;
|
|
2903
|
-
/**
|
|
2904
|
-
* List staff members under a specific agency code.
|
|
2905
|
-
*/
|
|
2906
|
-
listStaff<T = any>(agencyCode: string): Promise<T>;
|
|
2907
|
-
/**
|
|
2908
|
-
* Create a new staff member for an agency.
|
|
2909
|
-
*/
|
|
2910
|
-
createStaff<T = any>(payload: any): Promise<T>;
|
|
2911
|
-
}
|
|
2912
|
-
|
|
2913
|
-
declare class Clients extends APIResource {
|
|
2914
|
-
/**
|
|
2915
|
-
* List all clients in the ecosystem.
|
|
2916
|
-
*/
|
|
2917
|
-
list<T = any>(): Promise<T>;
|
|
2918
|
-
/**
|
|
2919
|
-
* Get client count and auto-generate a unique code.
|
|
2920
|
-
*/
|
|
2921
|
-
getCountAndGenerateCode<T = any>(): Promise<T>;
|
|
2922
|
-
/**
|
|
2923
|
-
* Retrieve a single client by client code.
|
|
2924
|
-
*/
|
|
2925
|
-
retrieve<T = any>(clientCode: string): Promise<T>;
|
|
2926
|
-
/**
|
|
2927
|
-
* Get API Key for a specific client (Admin Only).
|
|
2928
|
-
*/
|
|
2929
|
-
getApiKey<T = any>(clientCode: string): Promise<T>;
|
|
2930
|
-
/**
|
|
2931
|
-
* Generate or rotate API Key for a specific client (Admin Only).
|
|
2932
|
-
*/
|
|
2933
|
-
rotateApiKey<T = any>(clientCode: string): Promise<T>;
|
|
2934
|
-
/**
|
|
2935
|
-
* Create a new client identity and provision initial resources.
|
|
2936
|
-
*/
|
|
2937
|
-
create<T = any>(payload: {
|
|
2938
|
-
name: string;
|
|
2939
|
-
clientCode: string;
|
|
2940
|
-
business?: any;
|
|
2941
|
-
plan?: any;
|
|
2942
|
-
}): Promise<T>;
|
|
2943
|
-
/**
|
|
2944
|
-
* Get active service configuration for a specific client.
|
|
2945
|
-
*/
|
|
2946
|
-
getConfig<T = any>(clientCode: string): Promise<T>;
|
|
2947
|
-
/**
|
|
2948
|
-
* Update active service configuration for a specific client.
|
|
2949
|
-
*/
|
|
2950
|
-
updateConfig<T = any>(clientCode: string, payload: any): Promise<T>;
|
|
2951
|
-
/**
|
|
2952
|
-
* Get decrypted secrets for a specific client.
|
|
2953
|
-
*/
|
|
2954
|
-
getSecrets<T = any>(clientCode: string): Promise<T>;
|
|
2955
|
-
/**
|
|
2956
|
-
* Set secrets for a specific client.
|
|
2957
|
-
*/
|
|
2958
|
-
updateSecrets<T = any>(clientCode: string, payload: any): Promise<T>;
|
|
2959
|
-
/**
|
|
2960
|
-
* Completely replace secrets for a specific client.
|
|
2961
|
-
*/
|
|
2962
|
-
replaceSecrets<T = any>(clientCode: string, payload: any): Promise<T>;
|
|
2963
|
-
/**
|
|
2964
|
-
* Partially update secrets for a specific client.
|
|
2965
|
-
*/
|
|
2966
|
-
patchSecrets<T = any>(clientCode: string, payload: any): Promise<T>;
|
|
2967
|
-
/**
|
|
2968
|
-
* Retrieve Data Source connection metadata.
|
|
2969
|
-
*/
|
|
2970
|
-
getDataSource<T = any>(clientCode: string): Promise<T>;
|
|
2971
|
-
/**
|
|
2972
|
-
* Configure Data Source metadata.
|
|
2973
|
-
*/
|
|
2974
|
-
manageDataSource<T = any>(clientCode: string, payload: any): Promise<T>;
|
|
2975
|
-
/**
|
|
2976
|
-
* Update Client Identity and perform cascading updates if required.
|
|
2977
|
-
*/
|
|
2978
|
-
updateIdentity<T = any>(id: string, payload: any): Promise<T>;
|
|
2979
|
-
/**
|
|
2980
|
-
* Initiate Google Re-authentication for OAuth tokens.
|
|
2981
|
-
*/
|
|
2982
|
-
googleReauth<T = any>(clientCode: string, payload?: {
|
|
2983
|
-
authCode?: string;
|
|
2984
|
-
}): Promise<T>;
|
|
2985
|
-
/**
|
|
2986
|
-
* Delete a client and perform cascading cleanup.
|
|
2987
|
-
*/
|
|
2988
|
-
delete<T = any>(id: string): Promise<T>;
|
|
2989
|
-
}
|
|
2990
|
-
declare class Blogs extends APIResource {
|
|
2991
|
-
/**
|
|
2992
|
-
* Retrieve public corporate blogs/news.
|
|
2993
|
-
*/
|
|
2994
|
-
list<T = any>(): Promise<T>;
|
|
2995
|
-
}
|
|
2996
|
-
declare class GlobalLeads extends APIResource {
|
|
2997
|
-
/**
|
|
2998
|
-
* Add a corporate lead capture entry.
|
|
2999
|
-
*/
|
|
3000
|
-
add<T = any>(payload: any): Promise<T>;
|
|
3001
|
-
}
|
|
3002
|
-
declare class Services extends APIResource {
|
|
3003
|
-
clients: Clients;
|
|
3004
|
-
blogs: Blogs;
|
|
3005
|
-
globalLeads: GlobalLeads;
|
|
3006
|
-
constructor(client: any);
|
|
3007
|
-
}
|
|
3008
|
-
|
|
3009
|
-
declare class EmailConfig extends APIResource {
|
|
3010
|
-
/**
|
|
3011
|
-
* Retrieve current email provider configuration and domain verification statuses.
|
|
3012
|
-
*/
|
|
3013
|
-
getConfig<T = any>(): Promise<T>;
|
|
3014
|
-
/**
|
|
3015
|
-
* Switch the active email provider.
|
|
3016
|
-
*/
|
|
3017
|
-
switchProvider<T = any>(provider: string): Promise<T>;
|
|
3018
|
-
/**
|
|
3019
|
-
* Provide explicit SMTP credentials and connection preferences.
|
|
3020
|
-
*/
|
|
3021
|
-
saveSmtp<T = any>(payload: any): Promise<T>;
|
|
3022
|
-
/**
|
|
3023
|
-
* Initialize a new domain for SES identity verification.
|
|
3024
|
-
*/
|
|
3025
|
-
initDomainVerification<T = any>(domain: string): Promise<T>;
|
|
3026
|
-
/**
|
|
3027
|
-
* Confirm "From" details and finalize configuration payload.
|
|
3028
|
-
*/
|
|
3029
|
-
saveEmailConfig<T = any>(payload: {
|
|
3030
|
-
fromName: string;
|
|
3031
|
-
fromEmail: string;
|
|
3032
|
-
replyTo?: string;
|
|
3033
|
-
}): Promise<T>;
|
|
3034
|
-
/**
|
|
3035
|
-
* Check status of AWS SES domain validation DNS records.
|
|
3036
|
-
*/
|
|
3037
|
-
checkSesVerification<T = any>(): Promise<T>;
|
|
3038
|
-
/**
|
|
3039
|
-
* Remove a verified SES domain identity and clean up local secrets.
|
|
3040
|
-
*/
|
|
3041
|
-
removeSesIdentity<T = any>(): Promise<T>;
|
|
3042
|
-
/**
|
|
3043
|
-
* Send a test email to verify infrastructure is correctly bound.
|
|
3044
|
-
*/
|
|
3045
|
-
sendTest<T = any>(toEmail: string): Promise<T>;
|
|
3046
|
-
/**
|
|
3047
|
-
* Define customized global email footers, limits, and specific campaign policies.
|
|
3048
|
-
*/
|
|
3049
|
-
saveAdvancedConfig<T = any>(payload: any): Promise<T>;
|
|
3050
|
-
/**
|
|
3051
|
-
* Retrieve email configuration health properties including bounce limits metrics.
|
|
3052
|
-
*/
|
|
3053
|
-
getHealth<T = any>(): Promise<T>;
|
|
3054
|
-
/**
|
|
3055
|
-
* Upgrade configurations dynamically to add DMARC enforcement records.
|
|
3056
|
-
*/
|
|
3057
|
-
fixDmarc<T = any>(): Promise<T>;
|
|
3058
|
-
/**
|
|
3059
|
-
* Discover internally available providers constants metadata.
|
|
3060
|
-
*/
|
|
3061
|
-
listProviders<T = any>(): Promise<T>;
|
|
3062
|
-
}
|
|
3063
|
-
declare class Settings extends APIResource {
|
|
3064
|
-
email: EmailConfig;
|
|
3065
|
-
constructor(client: any);
|
|
3066
|
-
}
|
|
3067
|
-
|
|
3068
|
-
interface CorsOriginCreatePayload {
|
|
3069
|
-
url: string;
|
|
3070
|
-
name?: string;
|
|
3071
|
-
allowedHeaders?: string[];
|
|
3072
|
-
allowedMethods?: string[];
|
|
3073
|
-
}
|
|
3074
|
-
interface CorsOriginUpdatePayload {
|
|
3075
|
-
url?: string;
|
|
3076
|
-
name?: string;
|
|
3077
|
-
allowedHeaders?: string[];
|
|
3078
|
-
allowedMethods?: string[];
|
|
3079
|
-
isActive?: boolean;
|
|
3080
|
-
}
|
|
3081
|
-
declare class Cors extends APIResource {
|
|
3082
|
-
/**
|
|
3083
|
-
* List all dynamic cross-origin policies.
|
|
3084
|
-
*/
|
|
3085
|
-
list<T = any>(): Promise<T>;
|
|
3086
|
-
/**
|
|
3087
|
-
* Register a new cross-origin client for the SaaS API network dynamically.
|
|
3088
|
-
*/
|
|
3089
|
-
create<T = any>(payload: CorsOriginCreatePayload): Promise<T>;
|
|
3090
|
-
/**
|
|
3091
|
-
* Adjust active states or configurations for an existing origin policy.
|
|
3092
|
-
*/
|
|
3093
|
-
update<T = any>(id: string, payload: CorsOriginUpdatePayload): Promise<T>;
|
|
3094
|
-
/**
|
|
3095
|
-
* Irreversibly drop support for a cross-origin client URL policy permanently.
|
|
3096
|
-
*/
|
|
3097
|
-
delete<T = any>(id: string): Promise<T>;
|
|
3098
|
-
}
|
|
3099
|
-
|
|
3100
|
-
interface CheckoutProduct {
|
|
3101
|
-
externalId: string;
|
|
3102
|
-
name: string;
|
|
3103
|
-
price: number;
|
|
3104
|
-
image?: string;
|
|
3105
|
-
}
|
|
3106
|
-
interface CheckoutAmountBreakdown {
|
|
3107
|
-
subtotal: number;
|
|
3108
|
-
discount: number;
|
|
3109
|
-
delivery: number;
|
|
3110
|
-
total: number;
|
|
3111
|
-
}
|
|
3112
|
-
interface CheckoutSession {
|
|
3113
|
-
sessionId: string;
|
|
3114
|
-
product: {
|
|
3115
|
-
name: string;
|
|
3116
|
-
price: number;
|
|
3117
|
-
image?: string;
|
|
3118
|
-
};
|
|
3119
|
-
amounts: CheckoutAmountBreakdown;
|
|
3120
|
-
items: Array<{
|
|
3121
|
-
productId: string;
|
|
3122
|
-
quantity: number;
|
|
3123
|
-
}>;
|
|
3124
|
-
}
|
|
3125
|
-
interface CreateSessionPayload {
|
|
3126
|
-
productId: string;
|
|
3127
|
-
quantity: number;
|
|
3128
|
-
couponCode?: string;
|
|
3129
|
-
}
|
|
3130
|
-
interface ApplyCouponPayload {
|
|
3131
|
-
sessionId: string;
|
|
3132
|
-
couponCode: string;
|
|
3133
|
-
}
|
|
3134
|
-
interface VerifyPayload {
|
|
3135
|
-
sessionId: string;
|
|
3136
|
-
method: "truecaller" | "otp";
|
|
3137
|
-
token?: string;
|
|
3138
|
-
phone?: string;
|
|
3139
|
-
otp?: string;
|
|
3140
|
-
}
|
|
3141
|
-
interface CreateOrderPayload {
|
|
3142
|
-
sessionId: string;
|
|
3143
|
-
customer: {
|
|
3144
|
-
name: string;
|
|
3145
|
-
phone: string;
|
|
3146
|
-
email?: string;
|
|
3147
|
-
address: {
|
|
3148
|
-
line1: string;
|
|
3149
|
-
city: string;
|
|
3150
|
-
state: string;
|
|
3151
|
-
pincode: string;
|
|
3152
|
-
};
|
|
3153
|
-
};
|
|
3154
|
-
paymentProvider: "razorpay" | "cod";
|
|
3155
|
-
}
|
|
3156
|
-
interface CheckoutOrderResponse {
|
|
3157
|
-
order_id: string;
|
|
3158
|
-
payment_order_id?: string;
|
|
3159
|
-
amount?: number;
|
|
3160
|
-
currency?: string;
|
|
3161
|
-
status?: string;
|
|
3162
|
-
message?: string;
|
|
3163
|
-
}
|
|
3164
|
-
|
|
3165
|
-
/**
|
|
3166
|
-
* Resource for managing the ErixCheckout one-click flow.
|
|
3167
|
-
*
|
|
3168
|
-
* This resource handles session creation, coupon application,
|
|
3169
|
-
* identity verification, and final order placement.
|
|
3170
|
-
*/
|
|
3171
|
-
declare class Checkout extends APIResource {
|
|
3172
|
-
/**
|
|
3173
|
-
* Retrieves product information for the checkout modal.
|
|
3174
|
-
* @param productId - External SKU/ID of the product.
|
|
3175
|
-
*/
|
|
3176
|
-
getProduct(productId: string): Promise<CheckoutProduct>;
|
|
3177
|
-
/**
|
|
3178
|
-
* Initializes a new checkout session.
|
|
3179
|
-
*/
|
|
3180
|
-
createSession(payload: CreateSessionPayload): Promise<CheckoutSession>;
|
|
3181
|
-
/**
|
|
3182
|
-
* Applies a discount coupon to an active session.
|
|
3183
|
-
*/
|
|
3184
|
-
applyCoupon(payload: ApplyCouponPayload): Promise<CheckoutSession>;
|
|
3185
|
-
/**
|
|
3186
|
-
* Verifies user identity via Truecaller or OTP.
|
|
3187
|
-
*/
|
|
3188
|
-
verify(payload: VerifyPayload): Promise<{
|
|
3189
|
-
verified: boolean;
|
|
3190
|
-
data?: any;
|
|
3191
|
-
}>;
|
|
3192
|
-
/**
|
|
3193
|
-
* Finalizes the order and initiates payment.
|
|
3194
|
-
*/
|
|
3195
|
-
createOrder(payload: CreateOrderPayload): Promise<CheckoutOrderResponse>;
|
|
3196
|
-
}
|
|
3197
|
-
|
|
3198
3280
|
/**
|
|
3199
3281
|
* Configuration options for the ECODrIxAPI client.
|
|
3200
3282
|
*
|
|
@@ -3257,7 +3339,9 @@ declare class ECODrIxAPI {
|
|
|
3257
3339
|
/**
|
|
3258
3340
|
* @internal Socket.io client for real-time events.
|
|
3259
3341
|
*/
|
|
3260
|
-
private
|
|
3342
|
+
private socket;
|
|
3343
|
+
private socketPromise;
|
|
3344
|
+
private socketQueue;
|
|
3261
3345
|
/**
|
|
3262
3346
|
* The tenant client code this SDK instance is scoped to.
|
|
3263
3347
|
* Useful for components that need to read the clientCode back
|
|
@@ -3301,6 +3385,7 @@ declare class ECODrIxAPI {
|
|
|
3301
3385
|
/** ErixCheckout one-click checkout flow management. */
|
|
3302
3386
|
readonly checkout: Checkout;
|
|
3303
3387
|
constructor(options: ECODrIxAPIOptions);
|
|
3388
|
+
private initSocket;
|
|
3304
3389
|
/**
|
|
3305
3390
|
* Join a specific real-time room (e.g., a conversation or a lead).
|
|
3306
3391
|
*
|