@ecodrix/erix-api 1.1.2 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ecodrix/erix-api",
3
- "version": "1.1.2",
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.",
@@ -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