lua-cli 3.17.3 → 3.17.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/api-exports.d.ts +10 -4
- package/dist/api-exports.js.map +1 -1
- package/dist/index.js +417 -548
- package/dist/index.js.map +1 -1
- package/docs/api/Templates.md +21 -3
- package/package.json +1 -1
- package/template/package.json +1 -1
package/docs/api/Templates.md
CHANGED
|
@@ -107,7 +107,7 @@ Sends a template message to one or more phone numbers.
|
|
|
107
107
|
- `data` (object)
|
|
108
108
|
- `phoneNumbers` (string[]) - Array of phone numbers (E.164 format)
|
|
109
109
|
- `values` (object, optional) - Template variable values
|
|
110
|
-
- `header` (object) - Header variables (key-value pairs)
|
|
110
|
+
- `header` (object) - Header variables (key-value pairs). For media-header templates, pass the media URL instead: `image_url` (IMAGE), `video_url` (VIDEO), or `document_url` + optional `document_filename` (DOCUMENT). URLs must be publicly reachable over HTTPS.
|
|
111
111
|
- `body` (object) - Body variables (key-value pairs)
|
|
112
112
|
- `buttons` (array) - Button values
|
|
113
113
|
|
|
@@ -137,6 +137,23 @@ console.log(`Sent ${response.totalProcessed} messages`);
|
|
|
137
137
|
console.log(`Errors: ${response.totalErrors}`);
|
|
138
138
|
```
|
|
139
139
|
|
|
140
|
+
**Example (media header):**
|
|
141
|
+
```typescript
|
|
142
|
+
// Template approved with an IMAGE header — pass the image to display via image_url.
|
|
143
|
+
// VIDEO headers take video_url; DOCUMENT headers take document_url (+ optional document_filename).
|
|
144
|
+
const response = await Templates.whatsapp.send(
|
|
145
|
+
'channel_123',
|
|
146
|
+
'promo_template',
|
|
147
|
+
{
|
|
148
|
+
phoneNumbers: ['+1234567890'],
|
|
149
|
+
values: {
|
|
150
|
+
header: { image_url: 'https://example.com/promo.jpg' },
|
|
151
|
+
body: { discount: '20%' }
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
);
|
|
155
|
+
```
|
|
156
|
+
|
|
140
157
|
## Template Structure
|
|
141
158
|
|
|
142
159
|
### Template Components
|
|
@@ -153,8 +170,9 @@ interface WhatsAppTemplate {
|
|
|
153
170
|
components: [
|
|
154
171
|
{
|
|
155
172
|
type: 'HEADER';
|
|
156
|
-
|
|
157
|
-
|
|
173
|
+
// TEXT headers carry `text`; media headers (IMAGE/VIDEO/DOCUMENT) have no text
|
|
174
|
+
format: 'TEXT' | 'IMAGE' | 'VIDEO' | 'DOCUMENT';
|
|
175
|
+
text?: string;
|
|
158
176
|
},
|
|
159
177
|
{
|
|
160
178
|
type: 'BODY';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lua-cli",
|
|
3
|
-
"version": "3.17.
|
|
3
|
+
"version": "3.17.6",
|
|
4
4
|
"description": "Build, test, and deploy AI agents with custom tools, webhooks, and scheduled jobs. Features LuaAgent unified configuration, streaming chat, and batch deployment.",
|
|
5
5
|
"readmeFilename": "README.md",
|
|
6
6
|
"main": "dist/api-exports.js",
|