@talqui-oss/template-builder 0.0.0-stage → 0.1.0-alpha.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.
@@ -0,0 +1,689 @@
1
+ {
2
+ "$id": "https://template-builder.dev/schema.json",
3
+ "$ref": "#/definitions/Template",
4
+ "$schema": "http://json-schema.org/draft-07/schema#",
5
+ "definitions": {
6
+ "AuthenticationTemplate": {
7
+ "additionalProperties": false,
8
+ "properties": {
9
+ "$schema": {
10
+ "description": "Optional JSON Schema URL, for editor autocomplete in `.json` files.",
11
+ "type": "string"
12
+ },
13
+ "body": {
14
+ "additionalProperties": false,
15
+ "properties": {
16
+ "addSecurityRecommendation": {
17
+ "description": "Appends \"For your security, do not share this code.\"",
18
+ "type": "boolean"
19
+ }
20
+ },
21
+ "type": "object"
22
+ },
23
+ "button": {
24
+ "$ref": "#/definitions/OtpButton"
25
+ },
26
+ "category": {
27
+ "const": "AUTHENTICATION",
28
+ "type": "string"
29
+ },
30
+ "footer": {
31
+ "additionalProperties": false,
32
+ "properties": {
33
+ "codeExpirationMinutes": {
34
+ "description": "Appends \"This code expires in N minutes.\" (1 to 90).",
35
+ "type": "number"
36
+ }
37
+ },
38
+ "type": "object"
39
+ },
40
+ "language": {
41
+ "description": "Locale code, e.g. `en_US` or `pt_BR`.",
42
+ "type": "string"
43
+ },
44
+ "messageSendTtlSeconds": {
45
+ "description": "Seconds the provider keeps trying to deliver the message.",
46
+ "type": "number"
47
+ },
48
+ "name": {
49
+ "description": "Lowercase letters, numbers and underscores, e.g. `order_shipped`.",
50
+ "type": "string"
51
+ }
52
+ },
53
+ "required": [
54
+ "button",
55
+ "category",
56
+ "language",
57
+ "name"
58
+ ],
59
+ "type": "object"
60
+ },
61
+ "Button": {
62
+ "anyOf": [
63
+ {
64
+ "$ref": "#/definitions/QuickReplyButton"
65
+ },
66
+ {
67
+ "$ref": "#/definitions/UrlButton"
68
+ },
69
+ {
70
+ "$ref": "#/definitions/PhoneNumberButton"
71
+ },
72
+ {
73
+ "$ref": "#/definitions/VoiceCallButton"
74
+ },
75
+ {
76
+ "$ref": "#/definitions/CopyCodeButton"
77
+ },
78
+ {
79
+ "$ref": "#/definitions/FlowButton"
80
+ },
81
+ {
82
+ "$ref": "#/definitions/CatalogButton"
83
+ },
84
+ {
85
+ "$ref": "#/definitions/MultiProductButton"
86
+ },
87
+ {
88
+ "$ref": "#/definitions/SingleProductButton"
89
+ },
90
+ {
91
+ "$ref": "#/definitions/OrderDetailsButton"
92
+ },
93
+ {
94
+ "$ref": "#/definitions/PaymentRequestButton"
95
+ }
96
+ ]
97
+ },
98
+ "CarouselCard": {
99
+ "additionalProperties": false,
100
+ "properties": {
101
+ "body": {
102
+ "additionalProperties": false,
103
+ "properties": {
104
+ "text": {
105
+ "type": "string"
106
+ }
107
+ },
108
+ "required": [
109
+ "text"
110
+ ],
111
+ "type": "object"
112
+ },
113
+ "buttons": {
114
+ "items": {
115
+ "anyOf": [
116
+ {
117
+ "$ref": "#/definitions/QuickReplyButton"
118
+ },
119
+ {
120
+ "$ref": "#/definitions/UrlButton"
121
+ },
122
+ {
123
+ "$ref": "#/definitions/PhoneNumberButton"
124
+ },
125
+ {
126
+ "$ref": "#/definitions/SingleProductButton"
127
+ }
128
+ ]
129
+ },
130
+ "type": "array"
131
+ },
132
+ "header": {
133
+ "anyOf": [
134
+ {
135
+ "additionalProperties": false,
136
+ "properties": {
137
+ "type": {
138
+ "enum": [
139
+ "IMAGE",
140
+ "VIDEO"
141
+ ],
142
+ "type": "string"
143
+ },
144
+ "url": {
145
+ "type": "string"
146
+ }
147
+ },
148
+ "required": [
149
+ "type",
150
+ "url"
151
+ ],
152
+ "type": "object"
153
+ },
154
+ {
155
+ "$ref": "#/definitions/ProductHeader"
156
+ }
157
+ ]
158
+ }
159
+ },
160
+ "required": [
161
+ "header"
162
+ ],
163
+ "type": "object"
164
+ },
165
+ "CatalogButton": {
166
+ "additionalProperties": false,
167
+ "properties": {
168
+ "text": {
169
+ "type": "string"
170
+ },
171
+ "type": {
172
+ "const": "CATALOG",
173
+ "type": "string"
174
+ }
175
+ },
176
+ "required": [
177
+ "type",
178
+ "text"
179
+ ],
180
+ "type": "object"
181
+ },
182
+ "CopyCodeButton": {
183
+ "additionalProperties": false,
184
+ "properties": {
185
+ "example": {
186
+ "description": "Sample coupon code, up to 20 characters.",
187
+ "type": "string"
188
+ },
189
+ "type": {
190
+ "const": "COPY_CODE",
191
+ "type": "string"
192
+ }
193
+ },
194
+ "required": [
195
+ "type",
196
+ "example"
197
+ ],
198
+ "type": "object"
199
+ },
200
+ "FlowButton": {
201
+ "additionalProperties": false,
202
+ "properties": {
203
+ "flowAction": {
204
+ "enum": [
205
+ "navigate",
206
+ "data_exchange"
207
+ ],
208
+ "type": "string"
209
+ },
210
+ "flowId": {
211
+ "type": "string"
212
+ },
213
+ "flowJson": {
214
+ "type": "string"
215
+ },
216
+ "flowName": {
217
+ "type": "string"
218
+ },
219
+ "navigateScreen": {
220
+ "type": "string"
221
+ },
222
+ "text": {
223
+ "type": "string"
224
+ },
225
+ "type": {
226
+ "const": "FLOW",
227
+ "type": "string"
228
+ }
229
+ },
230
+ "required": [
231
+ "type",
232
+ "text"
233
+ ],
234
+ "type": "object"
235
+ },
236
+ "Header": {
237
+ "anyOf": [
238
+ {
239
+ "$ref": "#/definitions/TextHeader"
240
+ },
241
+ {
242
+ "$ref": "#/definitions/MediaHeader"
243
+ },
244
+ {
245
+ "$ref": "#/definitions/LocationHeader"
246
+ },
247
+ {
248
+ "$ref": "#/definitions/ProductHeader"
249
+ }
250
+ ]
251
+ },
252
+ "LimitedTimeOffer": {
253
+ "additionalProperties": false,
254
+ "properties": {
255
+ "hasExpiration": {
256
+ "description": "Shows a countdown; the expiration time is set when sending.",
257
+ "type": "boolean"
258
+ },
259
+ "text": {
260
+ "description": "Offer headline, e.g. \"Expiring offer!\".",
261
+ "type": "string"
262
+ }
263
+ },
264
+ "required": [
265
+ "text"
266
+ ],
267
+ "type": "object"
268
+ },
269
+ "LocationHeader": {
270
+ "additionalProperties": false,
271
+ "properties": {
272
+ "type": {
273
+ "const": "LOCATION",
274
+ "type": "string"
275
+ }
276
+ },
277
+ "required": [
278
+ "type"
279
+ ],
280
+ "type": "object"
281
+ },
282
+ "MediaHeader": {
283
+ "additionalProperties": false,
284
+ "properties": {
285
+ "filename": {
286
+ "type": "string"
287
+ },
288
+ "type": {
289
+ "enum": [
290
+ "IMAGE",
291
+ "VIDEO",
292
+ "DOCUMENT",
293
+ "GIF"
294
+ ],
295
+ "type": "string"
296
+ },
297
+ "url": {
298
+ "description": "Public URL of a sample file, used for the preview and for review.",
299
+ "type": "string"
300
+ }
301
+ },
302
+ "required": [
303
+ "type",
304
+ "url"
305
+ ],
306
+ "type": "object"
307
+ },
308
+ "MultiProductButton": {
309
+ "additionalProperties": false,
310
+ "properties": {
311
+ "text": {
312
+ "type": "string"
313
+ },
314
+ "type": {
315
+ "const": "MPM",
316
+ "type": "string"
317
+ }
318
+ },
319
+ "required": [
320
+ "type",
321
+ "text"
322
+ ],
323
+ "type": "object"
324
+ },
325
+ "OrderDetailsButton": {
326
+ "additionalProperties": false,
327
+ "properties": {
328
+ "text": {
329
+ "type": "string"
330
+ },
331
+ "type": {
332
+ "const": "ORDER_DETAILS",
333
+ "type": "string"
334
+ }
335
+ },
336
+ "required": [
337
+ "type",
338
+ "text"
339
+ ],
340
+ "type": "object"
341
+ },
342
+ "OtpButton": {
343
+ "additionalProperties": false,
344
+ "properties": {
345
+ "autofillText": {
346
+ "description": "One-tap and zero-tap only: label of the autofill button.",
347
+ "type": "string"
348
+ },
349
+ "otpType": {
350
+ "enum": [
351
+ "COPY_CODE",
352
+ "ONE_TAP",
353
+ "ZERO_TAP"
354
+ ],
355
+ "type": "string"
356
+ },
357
+ "supportedApps": {
358
+ "description": "One-tap and zero-tap only: up to 5 Android apps.",
359
+ "items": {
360
+ "$ref": "#/definitions/SupportedApp"
361
+ },
362
+ "type": "array"
363
+ },
364
+ "text": {
365
+ "description": "Button label. Meta localizes it when omitted.",
366
+ "type": "string"
367
+ },
368
+ "type": {
369
+ "const": "OTP",
370
+ "type": "string"
371
+ },
372
+ "zeroTapTermsAccepted": {
373
+ "description": "Zero-tap only: must be `true` to accept Meta's zero-tap terms.",
374
+ "type": "boolean"
375
+ }
376
+ },
377
+ "required": [
378
+ "type",
379
+ "otpType"
380
+ ],
381
+ "type": "object"
382
+ },
383
+ "PaymentRequestButton": {
384
+ "additionalProperties": false,
385
+ "properties": {
386
+ "paymentSetting": {
387
+ "enum": [
388
+ "pix_dynamic_code",
389
+ "boleto",
390
+ "payment_link",
391
+ "offsite_card_pay"
392
+ ],
393
+ "type": "string"
394
+ },
395
+ "text": {
396
+ "type": "string"
397
+ },
398
+ "type": {
399
+ "const": "PAYMENT_REQUEST",
400
+ "type": "string"
401
+ }
402
+ },
403
+ "required": [
404
+ "type",
405
+ "paymentSetting"
406
+ ],
407
+ "type": "object"
408
+ },
409
+ "PhoneNumberButton": {
410
+ "additionalProperties": false,
411
+ "properties": {
412
+ "phoneNumber": {
413
+ "description": "International format, e.g. `+15550100`.",
414
+ "type": "string"
415
+ },
416
+ "text": {
417
+ "type": "string"
418
+ },
419
+ "type": {
420
+ "const": "PHONE_NUMBER",
421
+ "type": "string"
422
+ }
423
+ },
424
+ "required": [
425
+ "type",
426
+ "text",
427
+ "phoneNumber"
428
+ ],
429
+ "type": "object"
430
+ },
431
+ "ProductHeader": {
432
+ "additionalProperties": false,
433
+ "properties": {
434
+ "type": {
435
+ "const": "PRODUCT",
436
+ "type": "string"
437
+ }
438
+ },
439
+ "required": [
440
+ "type"
441
+ ],
442
+ "type": "object"
443
+ },
444
+ "QuickReplyButton": {
445
+ "additionalProperties": false,
446
+ "properties": {
447
+ "text": {
448
+ "type": "string"
449
+ },
450
+ "type": {
451
+ "const": "QUICK_REPLY",
452
+ "type": "string"
453
+ }
454
+ },
455
+ "required": [
456
+ "type",
457
+ "text"
458
+ ],
459
+ "type": "object"
460
+ },
461
+ "SingleProductButton": {
462
+ "additionalProperties": false,
463
+ "properties": {
464
+ "text": {
465
+ "type": "string"
466
+ },
467
+ "type": {
468
+ "const": "SPM",
469
+ "type": "string"
470
+ }
471
+ },
472
+ "required": [
473
+ "type",
474
+ "text"
475
+ ],
476
+ "type": "object"
477
+ },
478
+ "StandardTemplate": {
479
+ "additionalProperties": false,
480
+ "properties": {
481
+ "$schema": {
482
+ "description": "Optional JSON Schema URL, for editor autocomplete in `.json` files.",
483
+ "type": "string"
484
+ },
485
+ "body": {
486
+ "additionalProperties": false,
487
+ "description": "Text with optional `{{name}}` placeholders and WhatsApp formatting (`*bold*`, `_italic_`).",
488
+ "properties": {
489
+ "text": {
490
+ "type": "string"
491
+ }
492
+ },
493
+ "required": [
494
+ "text"
495
+ ],
496
+ "type": "object"
497
+ },
498
+ "buttons": {
499
+ "items": {
500
+ "$ref": "#/definitions/Button"
501
+ },
502
+ "type": "array"
503
+ },
504
+ "callPermissionRequest": {
505
+ "const": true,
506
+ "description": "Asks the user for permission to call them.",
507
+ "type": "boolean"
508
+ },
509
+ "carousel": {
510
+ "additionalProperties": false,
511
+ "description": "Turns the template into a carousel of 2 to 10 cards.",
512
+ "properties": {
513
+ "cards": {
514
+ "items": {
515
+ "$ref": "#/definitions/CarouselCard"
516
+ },
517
+ "type": "array"
518
+ }
519
+ },
520
+ "required": [
521
+ "cards"
522
+ ],
523
+ "type": "object"
524
+ },
525
+ "category": {
526
+ "enum": [
527
+ "MARKETING",
528
+ "UTILITY"
529
+ ],
530
+ "type": "string"
531
+ },
532
+ "displayFormat": {
533
+ "const": "ORDER_DETAILS",
534
+ "description": "Renders the template as an order details message.",
535
+ "type": "string"
536
+ },
537
+ "footer": {
538
+ "additionalProperties": false,
539
+ "properties": {
540
+ "text": {
541
+ "type": "string"
542
+ }
543
+ },
544
+ "required": [
545
+ "text"
546
+ ],
547
+ "type": "object"
548
+ },
549
+ "header": {
550
+ "$ref": "#/definitions/Header"
551
+ },
552
+ "language": {
553
+ "description": "Locale code, e.g. `en_US` or `pt_BR`.",
554
+ "type": "string"
555
+ },
556
+ "limitedTimeOffer": {
557
+ "$ref": "#/definitions/LimitedTimeOffer",
558
+ "description": "Turns the template into a limited-time offer."
559
+ },
560
+ "messageSendTtlSeconds": {
561
+ "description": "Seconds the provider keeps trying to deliver the message.",
562
+ "type": "number"
563
+ },
564
+ "name": {
565
+ "description": "Lowercase letters, numbers and underscores, e.g. `order_shipped`.",
566
+ "type": "string"
567
+ },
568
+ "variables": {
569
+ "$ref": "#/definitions/Variables"
570
+ }
571
+ },
572
+ "required": [
573
+ "body",
574
+ "category",
575
+ "language",
576
+ "name"
577
+ ],
578
+ "type": "object"
579
+ },
580
+ "SupportedApp": {
581
+ "additionalProperties": false,
582
+ "properties": {
583
+ "packageName": {
584
+ "type": "string"
585
+ },
586
+ "signatureHash": {
587
+ "description": "11-character app signature hash.",
588
+ "type": "string"
589
+ }
590
+ },
591
+ "required": [
592
+ "packageName",
593
+ "signatureHash"
594
+ ],
595
+ "type": "object"
596
+ },
597
+ "Template": {
598
+ "anyOf": [
599
+ {
600
+ "$ref": "#/definitions/StandardTemplate"
601
+ },
602
+ {
603
+ "$ref": "#/definitions/AuthenticationTemplate"
604
+ }
605
+ ],
606
+ "description": "A WhatsApp message template. Field names follow Meta's template API in camelCase. Authentication templates have their own shape because Meta writes their body text."
607
+ },
608
+ "TextHeader": {
609
+ "additionalProperties": false,
610
+ "properties": {
611
+ "text": {
612
+ "description": "Up to one `{{name}}` placeholder.",
613
+ "type": "string"
614
+ },
615
+ "type": {
616
+ "const": "TEXT",
617
+ "type": "string"
618
+ }
619
+ },
620
+ "required": [
621
+ "type",
622
+ "text"
623
+ ],
624
+ "type": "object"
625
+ },
626
+ "UrlButton": {
627
+ "additionalProperties": false,
628
+ "properties": {
629
+ "text": {
630
+ "type": "string"
631
+ },
632
+ "type": {
633
+ "const": "URL",
634
+ "type": "string"
635
+ },
636
+ "url": {
637
+ "description": "A `{{name}}` placeholder at the end makes the URL dynamic.",
638
+ "type": "string"
639
+ }
640
+ },
641
+ "required": [
642
+ "type",
643
+ "text",
644
+ "url"
645
+ ],
646
+ "type": "object"
647
+ },
648
+ "Variable": {
649
+ "additionalProperties": false,
650
+ "properties": {
651
+ "example": {
652
+ "description": "Sample value shown in the preview and sent to the provider for review.",
653
+ "type": "string"
654
+ }
655
+ },
656
+ "required": [
657
+ "example"
658
+ ],
659
+ "type": "object"
660
+ },
661
+ "Variables": {
662
+ "additionalProperties": {
663
+ "$ref": "#/definitions/Variable"
664
+ },
665
+ "description": "Example values for the `{{name}}` placeholders used anywhere in the template.",
666
+ "type": "object"
667
+ },
668
+ "VoiceCallButton": {
669
+ "additionalProperties": false,
670
+ "properties": {
671
+ "text": {
672
+ "type": "string"
673
+ },
674
+ "ttlMinutes": {
675
+ "type": "number"
676
+ },
677
+ "type": {
678
+ "const": "VOICE_CALL",
679
+ "type": "string"
680
+ }
681
+ },
682
+ "required": [
683
+ "type",
684
+ "text"
685
+ ],
686
+ "type": "object"
687
+ }
688
+ }
689
+ }