lua-cli 3.21.0 → 3.22.0

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/docs/README.md CHANGED
@@ -1,6 +1,6 @@
1
- # lua-cli v3.21.0
1
+ # lua-cli v3.22.0
2
2
 
3
- Welcome to the comprehensive API documentation for lua-cli v3.21.0. This guide covers every API, class, and function exported by the package.
3
+ Welcome to the comprehensive API documentation for lua-cli v3.22.0. This guide covers every API, class, and function exported by the package.
4
4
 
5
5
  ## 📚 Documentation Index
6
6
 
@@ -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). 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.
110
+ - `header` (object) - Header variables (key-value pairs). For media-header templates, pass the media instead, either as a URL `image_url` (IMAGE), `video_url` (VIDEO), `document_url` + optional `document_filename` (DOCUMENT), all of which must be publicly reachable over HTTPS — or as a Meta media id: `image_id`, `video_id`, `document_id`. An id takes precedence if both are given.
111
111
  - `body` (object) - Body variables (key-value pairs)
112
112
  - `buttons` (array) - Button values
113
113
 
@@ -154,6 +154,29 @@ const response = await Templates.whatsapp.send(
154
154
  );
155
155
  ```
156
156
 
157
+ **Example (media header by Meta media id):**
158
+ ```typescript
159
+ // Upload the image to Meta once via POST /{phone-number-id}/media, then reuse the returned
160
+ // media id across every send. WhatsApp skips the per-send URL fetch entirely, which is the
161
+ // cheaper and more reliable option for bulk campaigns.
162
+ //
163
+ // Three constraints: the id must come from POST /{phone-number-id}/media (NOT the Resumable
164
+ // Upload API, whose "h:..." handle is only valid for template creation); it is scoped to the
165
+ // business phone number it was uploaded on, which must be the one behind this channel; and
166
+ // Meta expires media ids after 30 days.
167
+ const response = await Templates.whatsapp.send(
168
+ 'channel_123',
169
+ 'promo_template',
170
+ {
171
+ phoneNumbers: ['+1234567890'],
172
+ values: {
173
+ header: { image_id: '1234567890123456' },
174
+ body: { discount: '20%' }
175
+ }
176
+ }
177
+ );
178
+ ```
179
+
157
180
  ## Template Structure
158
181
 
159
182
  ### Template Components
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lua-cli",
3
- "version": "3.21.0",
3
+ "version": "3.22.0",
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",
@@ -110,8 +110,8 @@
110
110
  "ts-node": "^10.9.2",
111
111
  "tsup": "^8.5.1",
112
112
  "@lua/shared-source-sync": "0.0.1",
113
- "@lua/shared-sandbox": "0.0.1",
114
- "@lua/shared-types": "0.0.1"
113
+ "@lua/shared-types": "0.0.1",
114
+ "@lua/shared-sandbox": "0.0.1"
115
115
  },
116
116
  "scripts": {
117
117
  "clean": "rm -rf dist temp",
@@ -20,7 +20,7 @@
20
20
  "inquirer": "^12.9.6",
21
21
  "stripe": "^17.5.0",
22
22
  "js-yaml": "^4.1.0",
23
- "lua-cli": "^3.21.0",
23
+ "lua-cli": "^3.22.0",
24
24
  "openai": "^5.23.0",
25
25
  "uuid": "^13.0.0",
26
26
  "zod": "^3.24.1"