@ecodrix/erix-api 1.1.1 → 1.1.3
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 +2 -2
- package/dist/index.d.ts +19 -8
- package/dist/ts/browser/index.global.js +1 -1
- package/dist/ts/browser/index.global.js.map +1 -1
- package/dist/ts/cjs/index.cjs +1 -1
- package/dist/ts/cjs/index.cjs.map +1 -1
- package/dist/ts/cjs/index.d.cts +19 -8
- package/dist/ts/esm/index.d.ts +19 -8
- package/dist/ts/esm/index.js +1 -1
- package/dist/ts/esm/index.js.map +1 -1
- package/package.json +1 -1
- package/src/core.ts +7 -6
- package/src/resources/whatsapp/messages.ts +15 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ecodrix/erix-api",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.3",
|
|
4
4
|
"author": "ECODrIx Team <contact@ecodrix.com>",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "Official Isomorphic SDK for the ECODrIx platform. Native support for WhatsApp, CRM, Storage, and Meetings across TS, JS, Python, and Java.",
|
package/src/core.ts
CHANGED
|
@@ -216,13 +216,14 @@ export class Ecodrix {
|
|
|
216
216
|
* your own tenant.
|
|
217
217
|
*
|
|
218
218
|
* **Standard events:**
|
|
219
|
-
* - `
|
|
220
|
-
* - `
|
|
221
|
-
* - `
|
|
222
|
-
* - `
|
|
219
|
+
* - `new_message` — inbound WhatsApp message (includes conversation and message payload)
|
|
220
|
+
* - `message_sent` — outbound message successfully sent
|
|
221
|
+
* - `message_status_update` — WhatsApp message status change (delivered, read, failed)
|
|
222
|
+
* - `conversation_updated` — metadata change (unread count, last message, status)
|
|
223
|
+
* - `message_updated` — real-time updates for reactions or media processing
|
|
224
|
+
* - `notification:new` — new system or CRM notification
|
|
225
|
+
* - `workflow-run-update` — automation execution progress
|
|
223
226
|
* - `meet.scheduled` — Google Meet appointment booked
|
|
224
|
-
* - `storage.upload_confirmed` — file upload completed
|
|
225
|
-
* - `automation.failed` — automation execution error
|
|
226
227
|
*
|
|
227
228
|
* @param event - The event name to subscribe to.
|
|
228
229
|
* @param callback - The handler function invoked when the event fires.
|
|
@@ -25,6 +25,14 @@ export interface SendMessageParams {
|
|
|
25
25
|
filename?: string;
|
|
26
26
|
/** Arbitrary metadata stored with the message record. */
|
|
27
27
|
metadata?: Record<string, any>;
|
|
28
|
+
/** Template name for template messages. */
|
|
29
|
+
templateName?: string;
|
|
30
|
+
/** Template language for template messages. */
|
|
31
|
+
templateLanguage?: string;
|
|
32
|
+
/** Alternative language parameter. */
|
|
33
|
+
language?: string;
|
|
34
|
+
/** Template variables. */
|
|
35
|
+
variables?: string[];
|
|
28
36
|
}
|
|
29
37
|
|
|
30
38
|
/**
|
|
@@ -60,6 +68,8 @@ export interface SendTemplateParams {
|
|
|
60
68
|
userId?: string;
|
|
61
69
|
/** Optional filename for media headers. */
|
|
62
70
|
filename?: string;
|
|
71
|
+
/** Template language for template messages. */
|
|
72
|
+
templateLanguage?: string;
|
|
63
73
|
}
|
|
64
74
|
|
|
65
75
|
/**
|
|
@@ -103,8 +113,8 @@ export class Messages extends APIResource {
|
|
|
103
113
|
* });
|
|
104
114
|
* ```
|
|
105
115
|
*/
|
|
106
|
-
async send(params: SendMessageParams) {
|
|
107
|
-
return this.post("/api/saas/chat/send", params);
|
|
116
|
+
async send<T = any>(params: SendMessageParams) {
|
|
117
|
+
return this.post<T>("/api/saas/chat/send", params);
|
|
108
118
|
}
|
|
109
119
|
|
|
110
120
|
/**
|
|
@@ -127,10 +137,10 @@ export class Messages extends APIResource {
|
|
|
127
137
|
* });
|
|
128
138
|
* ```
|
|
129
139
|
*/
|
|
130
|
-
async sendTemplate(params: SendTemplateParams) {
|
|
131
|
-
return this.post("/api/saas/chat/send", {
|
|
140
|
+
async sendTemplate<T = any>(params: SendTemplateParams) {
|
|
141
|
+
return this.post<T>("/api/saas/chat/send", {
|
|
132
142
|
...params,
|
|
133
|
-
templateLanguage: params.language || "en_US",
|
|
143
|
+
templateLanguage: params.language || params.templateLanguage || "en_US",
|
|
134
144
|
});
|
|
135
145
|
}
|
|
136
146
|
|