@ecodrix/erix-api 1.1.0 → 1.1.2
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 +1 -1
- package/dist/index.d.ts +19 -6
- 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 -6
- package/dist/ts/esm/index.d.ts +19 -6
- 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 +25 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ecodrix/erix-api",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
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
|
@@ -181,6 +181,24 @@ export class Ecodrix {
|
|
|
181
181
|
this.setupSocket(options.clientCode);
|
|
182
182
|
}
|
|
183
183
|
|
|
184
|
+
/**
|
|
185
|
+
* Join a specific real-time room (e.g., a conversation or a lead).
|
|
186
|
+
*
|
|
187
|
+
* @param roomId - The unique identifier for the room.
|
|
188
|
+
*/
|
|
189
|
+
public joinRoom(roomId: string) {
|
|
190
|
+
this.socket.emit("join-room", roomId);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Leave a previously joined real-time room.
|
|
195
|
+
*
|
|
196
|
+
* @param roomId - The unique identifier for the room.
|
|
197
|
+
*/
|
|
198
|
+
public leaveRoom(roomId: string) {
|
|
199
|
+
this.socket.emit("leave-room", roomId);
|
|
200
|
+
}
|
|
201
|
+
|
|
184
202
|
private setupSocket(clientCode?: string) {
|
|
185
203
|
this.socket.on("connect", () => {
|
|
186
204
|
if (clientCode) {
|
|
@@ -198,13 +216,14 @@ export class Ecodrix {
|
|
|
198
216
|
* your own tenant.
|
|
199
217
|
*
|
|
200
218
|
* **Standard events:**
|
|
201
|
-
* - `
|
|
202
|
-
* - `
|
|
203
|
-
* - `
|
|
204
|
-
* - `
|
|
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
|
|
205
226
|
* - `meet.scheduled` — Google Meet appointment booked
|
|
206
|
-
* - `storage.upload_confirmed` — file upload completed
|
|
207
|
-
* - `automation.failed` — automation execution error
|
|
208
227
|
*
|
|
209
228
|
* @param event - The event name to subscribe to.
|
|
210
229
|
* @param callback - The handler function invoked when the event fires.
|