@adatechnology/meta-whatsapp-contracts 0.2.0 → 0.4.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.
@@ -103,6 +103,26 @@ declare const whatsAppOrderSchema: z.ZodObject<{
103
103
  text?: string | undefined;
104
104
  }>;
105
105
  type WhatsAppOrder = z.infer<typeof whatsAppOrderSchema>;
106
+ declare const whatsAppLocationSchema: z.ZodObject<{
107
+ latitude: z.ZodNumber;
108
+ longitude: z.ZodNumber;
109
+ name: z.ZodOptional<z.ZodString>;
110
+ address: z.ZodOptional<z.ZodString>;
111
+ url: z.ZodOptional<z.ZodString>;
112
+ }, "strip", z.ZodTypeAny, {
113
+ latitude: number;
114
+ longitude: number;
115
+ name?: string | undefined;
116
+ address?: string | undefined;
117
+ url?: string | undefined;
118
+ }, {
119
+ latitude: number;
120
+ longitude: number;
121
+ name?: string | undefined;
122
+ address?: string | undefined;
123
+ url?: string | undefined;
124
+ }>;
125
+ type WhatsAppLocation = z.infer<typeof whatsAppLocationSchema>;
106
126
  declare const whatsAppMessageSchema: z.ZodObject<{
107
127
  id: z.ZodString;
108
128
  from: z.ZodString;
@@ -290,6 +310,25 @@ declare const whatsAppMessageSchema: z.ZodObject<{
290
310
  }[];
291
311
  text?: string | undefined;
292
312
  }>>;
313
+ location: z.ZodOptional<z.ZodObject<{
314
+ latitude: z.ZodNumber;
315
+ longitude: z.ZodNumber;
316
+ name: z.ZodOptional<z.ZodString>;
317
+ address: z.ZodOptional<z.ZodString>;
318
+ url: z.ZodOptional<z.ZodString>;
319
+ }, "strip", z.ZodTypeAny, {
320
+ latitude: number;
321
+ longitude: number;
322
+ name?: string | undefined;
323
+ address?: string | undefined;
324
+ url?: string | undefined;
325
+ }, {
326
+ latitude: number;
327
+ longitude: number;
328
+ name?: string | undefined;
329
+ address?: string | undefined;
330
+ url?: string | undefined;
331
+ }>>;
293
332
  context: z.ZodOptional<z.ZodObject<{
294
333
  from: z.ZodOptional<z.ZodString>;
295
334
  id: z.ZodOptional<z.ZodString>;
@@ -383,6 +422,13 @@ declare const whatsAppMessageSchema: z.ZodObject<{
383
422
  }[];
384
423
  text?: string | undefined;
385
424
  } | undefined;
425
+ location?: {
426
+ latitude: number;
427
+ longitude: number;
428
+ name?: string | undefined;
429
+ address?: string | undefined;
430
+ url?: string | undefined;
431
+ } | undefined;
386
432
  context?: {
387
433
  id?: string | undefined;
388
434
  from?: string | undefined;
@@ -455,6 +501,13 @@ declare const whatsAppMessageSchema: z.ZodObject<{
455
501
  }[];
456
502
  text?: string | undefined;
457
503
  } | undefined;
504
+ location?: {
505
+ latitude: number;
506
+ longitude: number;
507
+ name?: string | undefined;
508
+ address?: string | undefined;
509
+ url?: string | undefined;
510
+ } | undefined;
458
511
  context?: {
459
512
  id?: string | undefined;
460
513
  from?: string | undefined;
@@ -552,6 +605,34 @@ declare const whatsAppPhoneNumberQualityUpdateSchema: z.ZodObject<{
552
605
  old_limit?: string | undefined;
553
606
  }>;
554
607
  type WhatsAppPhoneNumberQualityUpdate = z.infer<typeof whatsAppPhoneNumberQualityUpdateSchema>;
608
+ /**
609
+ * O contato que a Meta manda junto das mensagens. `profile.name` é o nome que a PESSOA escolheu no
610
+ * WhatsApp dela — é o único nome que existe antes de alguém digitar um, e sem ele o cliente criado
611
+ * por mensagem nasce sem nome nenhum.
612
+ *
613
+ * `profile` é opcional: a pessoa pode não ter nome definido, e a Meta omite o objeto nesse caso.
614
+ */
615
+ declare const whatsAppContactSchema: z.ZodObject<{
616
+ wa_id: z.ZodString;
617
+ profile: z.ZodOptional<z.ZodObject<{
618
+ name: z.ZodString;
619
+ }, "strip", z.ZodTypeAny, {
620
+ name: string;
621
+ }, {
622
+ name: string;
623
+ }>>;
624
+ }, "strip", z.ZodTypeAny, {
625
+ wa_id: string;
626
+ profile?: {
627
+ name: string;
628
+ } | undefined;
629
+ }, {
630
+ wa_id: string;
631
+ profile?: {
632
+ name: string;
633
+ } | undefined;
634
+ }>;
635
+ type WhatsAppContact = z.infer<typeof whatsAppContactSchema>;
555
636
  declare const whatsAppWebhookValueSchema: z.ZodObject<{
556
637
  messaging_product: z.ZodOptional<z.ZodString>;
557
638
  messages: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -741,6 +822,25 @@ declare const whatsAppWebhookValueSchema: z.ZodObject<{
741
822
  }[];
742
823
  text?: string | undefined;
743
824
  }>>;
825
+ location: z.ZodOptional<z.ZodObject<{
826
+ latitude: z.ZodNumber;
827
+ longitude: z.ZodNumber;
828
+ name: z.ZodOptional<z.ZodString>;
829
+ address: z.ZodOptional<z.ZodString>;
830
+ url: z.ZodOptional<z.ZodString>;
831
+ }, "strip", z.ZodTypeAny, {
832
+ latitude: number;
833
+ longitude: number;
834
+ name?: string | undefined;
835
+ address?: string | undefined;
836
+ url?: string | undefined;
837
+ }, {
838
+ latitude: number;
839
+ longitude: number;
840
+ name?: string | undefined;
841
+ address?: string | undefined;
842
+ url?: string | undefined;
843
+ }>>;
744
844
  context: z.ZodOptional<z.ZodObject<{
745
845
  from: z.ZodOptional<z.ZodString>;
746
846
  id: z.ZodOptional<z.ZodString>;
@@ -834,6 +934,13 @@ declare const whatsAppWebhookValueSchema: z.ZodObject<{
834
934
  }[];
835
935
  text?: string | undefined;
836
936
  } | undefined;
937
+ location?: {
938
+ latitude: number;
939
+ longitude: number;
940
+ name?: string | undefined;
941
+ address?: string | undefined;
942
+ url?: string | undefined;
943
+ } | undefined;
837
944
  context?: {
838
945
  id?: string | undefined;
839
946
  from?: string | undefined;
@@ -906,6 +1013,13 @@ declare const whatsAppWebhookValueSchema: z.ZodObject<{
906
1013
  }[];
907
1014
  text?: string | undefined;
908
1015
  } | undefined;
1016
+ location?: {
1017
+ latitude: number;
1018
+ longitude: number;
1019
+ name?: string | undefined;
1020
+ address?: string | undefined;
1021
+ url?: string | undefined;
1022
+ } | undefined;
909
1023
  context?: {
910
1024
  id?: string | undefined;
911
1025
  from?: string | undefined;
@@ -915,6 +1029,26 @@ declare const whatsAppWebhookValueSchema: z.ZodObject<{
915
1029
  } | undefined;
916
1030
  } | undefined;
917
1031
  }>, "many">>;
1032
+ contacts: z.ZodOptional<z.ZodArray<z.ZodObject<{
1033
+ wa_id: z.ZodString;
1034
+ profile: z.ZodOptional<z.ZodObject<{
1035
+ name: z.ZodString;
1036
+ }, "strip", z.ZodTypeAny, {
1037
+ name: string;
1038
+ }, {
1039
+ name: string;
1040
+ }>>;
1041
+ }, "strip", z.ZodTypeAny, {
1042
+ wa_id: string;
1043
+ profile?: {
1044
+ name: string;
1045
+ } | undefined;
1046
+ }, {
1047
+ wa_id: string;
1048
+ profile?: {
1049
+ name: string;
1050
+ } | undefined;
1051
+ }>, "many">>;
918
1052
  message_echoes: z.ZodOptional<z.ZodArray<z.ZodObject<{
919
1053
  id: z.ZodString;
920
1054
  from: z.ZodString;
@@ -1146,6 +1280,25 @@ declare const whatsAppWebhookValueSchema: z.ZodObject<{
1146
1280
  }[];
1147
1281
  text?: string | undefined;
1148
1282
  }>>;
1283
+ location: z.ZodOptional<z.ZodObject<{
1284
+ latitude: z.ZodNumber;
1285
+ longitude: z.ZodNumber;
1286
+ name: z.ZodOptional<z.ZodString>;
1287
+ address: z.ZodOptional<z.ZodString>;
1288
+ url: z.ZodOptional<z.ZodString>;
1289
+ }, "strip", z.ZodTypeAny, {
1290
+ latitude: number;
1291
+ longitude: number;
1292
+ name?: string | undefined;
1293
+ address?: string | undefined;
1294
+ url?: string | undefined;
1295
+ }, {
1296
+ latitude: number;
1297
+ longitude: number;
1298
+ name?: string | undefined;
1299
+ address?: string | undefined;
1300
+ url?: string | undefined;
1301
+ }>>;
1149
1302
  context: z.ZodOptional<z.ZodObject<{
1150
1303
  from: z.ZodOptional<z.ZodString>;
1151
1304
  id: z.ZodOptional<z.ZodString>;
@@ -1239,6 +1392,13 @@ declare const whatsAppWebhookValueSchema: z.ZodObject<{
1239
1392
  }[];
1240
1393
  text?: string | undefined;
1241
1394
  } | undefined;
1395
+ location?: {
1396
+ latitude: number;
1397
+ longitude: number;
1398
+ name?: string | undefined;
1399
+ address?: string | undefined;
1400
+ url?: string | undefined;
1401
+ } | undefined;
1242
1402
  context?: {
1243
1403
  id?: string | undefined;
1244
1404
  from?: string | undefined;
@@ -1311,6 +1471,13 @@ declare const whatsAppWebhookValueSchema: z.ZodObject<{
1311
1471
  }[];
1312
1472
  text?: string | undefined;
1313
1473
  } | undefined;
1474
+ location?: {
1475
+ latitude: number;
1476
+ longitude: number;
1477
+ name?: string | undefined;
1478
+ address?: string | undefined;
1479
+ url?: string | undefined;
1480
+ } | undefined;
1314
1481
  context?: {
1315
1482
  id?: string | undefined;
1316
1483
  from?: string | undefined;
@@ -1320,6 +1487,26 @@ declare const whatsAppWebhookValueSchema: z.ZodObject<{
1320
1487
  } | undefined;
1321
1488
  } | undefined;
1322
1489
  }>, "many">>;
1490
+ contacts: z.ZodOptional<z.ZodArray<z.ZodObject<{
1491
+ wa_id: z.ZodString;
1492
+ profile: z.ZodOptional<z.ZodObject<{
1493
+ name: z.ZodString;
1494
+ }, "strip", z.ZodTypeAny, {
1495
+ name: string;
1496
+ }, {
1497
+ name: string;
1498
+ }>>;
1499
+ }, "strip", z.ZodTypeAny, {
1500
+ wa_id: string;
1501
+ profile?: {
1502
+ name: string;
1503
+ } | undefined;
1504
+ }, {
1505
+ wa_id: string;
1506
+ profile?: {
1507
+ name: string;
1508
+ } | undefined;
1509
+ }>, "many">>;
1323
1510
  message_echoes: z.ZodOptional<z.ZodArray<z.ZodObject<{
1324
1511
  id: z.ZodString;
1325
1512
  from: z.ZodString;
@@ -1551,6 +1738,25 @@ declare const whatsAppWebhookValueSchema: z.ZodObject<{
1551
1738
  }[];
1552
1739
  text?: string | undefined;
1553
1740
  }>>;
1741
+ location: z.ZodOptional<z.ZodObject<{
1742
+ latitude: z.ZodNumber;
1743
+ longitude: z.ZodNumber;
1744
+ name: z.ZodOptional<z.ZodString>;
1745
+ address: z.ZodOptional<z.ZodString>;
1746
+ url: z.ZodOptional<z.ZodString>;
1747
+ }, "strip", z.ZodTypeAny, {
1748
+ latitude: number;
1749
+ longitude: number;
1750
+ name?: string | undefined;
1751
+ address?: string | undefined;
1752
+ url?: string | undefined;
1753
+ }, {
1754
+ latitude: number;
1755
+ longitude: number;
1756
+ name?: string | undefined;
1757
+ address?: string | undefined;
1758
+ url?: string | undefined;
1759
+ }>>;
1554
1760
  context: z.ZodOptional<z.ZodObject<{
1555
1761
  from: z.ZodOptional<z.ZodString>;
1556
1762
  id: z.ZodOptional<z.ZodString>;
@@ -1644,6 +1850,13 @@ declare const whatsAppWebhookValueSchema: z.ZodObject<{
1644
1850
  }[];
1645
1851
  text?: string | undefined;
1646
1852
  } | undefined;
1853
+ location?: {
1854
+ latitude: number;
1855
+ longitude: number;
1856
+ name?: string | undefined;
1857
+ address?: string | undefined;
1858
+ url?: string | undefined;
1859
+ } | undefined;
1647
1860
  context?: {
1648
1861
  id?: string | undefined;
1649
1862
  from?: string | undefined;
@@ -1716,6 +1929,13 @@ declare const whatsAppWebhookValueSchema: z.ZodObject<{
1716
1929
  }[];
1717
1930
  text?: string | undefined;
1718
1931
  } | undefined;
1932
+ location?: {
1933
+ latitude: number;
1934
+ longitude: number;
1935
+ name?: string | undefined;
1936
+ address?: string | undefined;
1937
+ url?: string | undefined;
1938
+ } | undefined;
1719
1939
  context?: {
1720
1940
  id?: string | undefined;
1721
1941
  from?: string | undefined;
@@ -1725,6 +1945,26 @@ declare const whatsAppWebhookValueSchema: z.ZodObject<{
1725
1945
  } | undefined;
1726
1946
  } | undefined;
1727
1947
  }>, "many">>;
1948
+ contacts: z.ZodOptional<z.ZodArray<z.ZodObject<{
1949
+ wa_id: z.ZodString;
1950
+ profile: z.ZodOptional<z.ZodObject<{
1951
+ name: z.ZodString;
1952
+ }, "strip", z.ZodTypeAny, {
1953
+ name: string;
1954
+ }, {
1955
+ name: string;
1956
+ }>>;
1957
+ }, "strip", z.ZodTypeAny, {
1958
+ wa_id: string;
1959
+ profile?: {
1960
+ name: string;
1961
+ } | undefined;
1962
+ }, {
1963
+ wa_id: string;
1964
+ profile?: {
1965
+ name: string;
1966
+ } | undefined;
1967
+ }>, "many">>;
1728
1968
  message_echoes: z.ZodOptional<z.ZodArray<z.ZodObject<{
1729
1969
  id: z.ZodString;
1730
1970
  from: z.ZodString;
@@ -1960,6 +2200,25 @@ declare const whatsAppWebhookChangeSchema: z.ZodObject<{
1960
2200
  }[];
1961
2201
  text?: string | undefined;
1962
2202
  }>>;
2203
+ location: z.ZodOptional<z.ZodObject<{
2204
+ latitude: z.ZodNumber;
2205
+ longitude: z.ZodNumber;
2206
+ name: z.ZodOptional<z.ZodString>;
2207
+ address: z.ZodOptional<z.ZodString>;
2208
+ url: z.ZodOptional<z.ZodString>;
2209
+ }, "strip", z.ZodTypeAny, {
2210
+ latitude: number;
2211
+ longitude: number;
2212
+ name?: string | undefined;
2213
+ address?: string | undefined;
2214
+ url?: string | undefined;
2215
+ }, {
2216
+ latitude: number;
2217
+ longitude: number;
2218
+ name?: string | undefined;
2219
+ address?: string | undefined;
2220
+ url?: string | undefined;
2221
+ }>>;
1963
2222
  context: z.ZodOptional<z.ZodObject<{
1964
2223
  from: z.ZodOptional<z.ZodString>;
1965
2224
  id: z.ZodOptional<z.ZodString>;
@@ -2053,6 +2312,13 @@ declare const whatsAppWebhookChangeSchema: z.ZodObject<{
2053
2312
  }[];
2054
2313
  text?: string | undefined;
2055
2314
  } | undefined;
2315
+ location?: {
2316
+ latitude: number;
2317
+ longitude: number;
2318
+ name?: string | undefined;
2319
+ address?: string | undefined;
2320
+ url?: string | undefined;
2321
+ } | undefined;
2056
2322
  context?: {
2057
2323
  id?: string | undefined;
2058
2324
  from?: string | undefined;
@@ -2125,6 +2391,13 @@ declare const whatsAppWebhookChangeSchema: z.ZodObject<{
2125
2391
  }[];
2126
2392
  text?: string | undefined;
2127
2393
  } | undefined;
2394
+ location?: {
2395
+ latitude: number;
2396
+ longitude: number;
2397
+ name?: string | undefined;
2398
+ address?: string | undefined;
2399
+ url?: string | undefined;
2400
+ } | undefined;
2128
2401
  context?: {
2129
2402
  id?: string | undefined;
2130
2403
  from?: string | undefined;
@@ -2134,6 +2407,26 @@ declare const whatsAppWebhookChangeSchema: z.ZodObject<{
2134
2407
  } | undefined;
2135
2408
  } | undefined;
2136
2409
  }>, "many">>;
2410
+ contacts: z.ZodOptional<z.ZodArray<z.ZodObject<{
2411
+ wa_id: z.ZodString;
2412
+ profile: z.ZodOptional<z.ZodObject<{
2413
+ name: z.ZodString;
2414
+ }, "strip", z.ZodTypeAny, {
2415
+ name: string;
2416
+ }, {
2417
+ name: string;
2418
+ }>>;
2419
+ }, "strip", z.ZodTypeAny, {
2420
+ wa_id: string;
2421
+ profile?: {
2422
+ name: string;
2423
+ } | undefined;
2424
+ }, {
2425
+ wa_id: string;
2426
+ profile?: {
2427
+ name: string;
2428
+ } | undefined;
2429
+ }>, "many">>;
2137
2430
  message_echoes: z.ZodOptional<z.ZodArray<z.ZodObject<{
2138
2431
  id: z.ZodString;
2139
2432
  from: z.ZodString;
@@ -2365,6 +2658,25 @@ declare const whatsAppWebhookChangeSchema: z.ZodObject<{
2365
2658
  }[];
2366
2659
  text?: string | undefined;
2367
2660
  }>>;
2661
+ location: z.ZodOptional<z.ZodObject<{
2662
+ latitude: z.ZodNumber;
2663
+ longitude: z.ZodNumber;
2664
+ name: z.ZodOptional<z.ZodString>;
2665
+ address: z.ZodOptional<z.ZodString>;
2666
+ url: z.ZodOptional<z.ZodString>;
2667
+ }, "strip", z.ZodTypeAny, {
2668
+ latitude: number;
2669
+ longitude: number;
2670
+ name?: string | undefined;
2671
+ address?: string | undefined;
2672
+ url?: string | undefined;
2673
+ }, {
2674
+ latitude: number;
2675
+ longitude: number;
2676
+ name?: string | undefined;
2677
+ address?: string | undefined;
2678
+ url?: string | undefined;
2679
+ }>>;
2368
2680
  context: z.ZodOptional<z.ZodObject<{
2369
2681
  from: z.ZodOptional<z.ZodString>;
2370
2682
  id: z.ZodOptional<z.ZodString>;
@@ -2458,6 +2770,13 @@ declare const whatsAppWebhookChangeSchema: z.ZodObject<{
2458
2770
  }[];
2459
2771
  text?: string | undefined;
2460
2772
  } | undefined;
2773
+ location?: {
2774
+ latitude: number;
2775
+ longitude: number;
2776
+ name?: string | undefined;
2777
+ address?: string | undefined;
2778
+ url?: string | undefined;
2779
+ } | undefined;
2461
2780
  context?: {
2462
2781
  id?: string | undefined;
2463
2782
  from?: string | undefined;
@@ -2530,6 +2849,13 @@ declare const whatsAppWebhookChangeSchema: z.ZodObject<{
2530
2849
  }[];
2531
2850
  text?: string | undefined;
2532
2851
  } | undefined;
2852
+ location?: {
2853
+ latitude: number;
2854
+ longitude: number;
2855
+ name?: string | undefined;
2856
+ address?: string | undefined;
2857
+ url?: string | undefined;
2858
+ } | undefined;
2533
2859
  context?: {
2534
2860
  id?: string | undefined;
2535
2861
  from?: string | undefined;
@@ -2539,6 +2865,26 @@ declare const whatsAppWebhookChangeSchema: z.ZodObject<{
2539
2865
  } | undefined;
2540
2866
  } | undefined;
2541
2867
  }>, "many">>;
2868
+ contacts: z.ZodOptional<z.ZodArray<z.ZodObject<{
2869
+ wa_id: z.ZodString;
2870
+ profile: z.ZodOptional<z.ZodObject<{
2871
+ name: z.ZodString;
2872
+ }, "strip", z.ZodTypeAny, {
2873
+ name: string;
2874
+ }, {
2875
+ name: string;
2876
+ }>>;
2877
+ }, "strip", z.ZodTypeAny, {
2878
+ wa_id: string;
2879
+ profile?: {
2880
+ name: string;
2881
+ } | undefined;
2882
+ }, {
2883
+ wa_id: string;
2884
+ profile?: {
2885
+ name: string;
2886
+ } | undefined;
2887
+ }>, "many">>;
2542
2888
  message_echoes: z.ZodOptional<z.ZodArray<z.ZodObject<{
2543
2889
  id: z.ZodString;
2544
2890
  from: z.ZodString;
@@ -2770,6 +3116,25 @@ declare const whatsAppWebhookChangeSchema: z.ZodObject<{
2770
3116
  }[];
2771
3117
  text?: string | undefined;
2772
3118
  }>>;
3119
+ location: z.ZodOptional<z.ZodObject<{
3120
+ latitude: z.ZodNumber;
3121
+ longitude: z.ZodNumber;
3122
+ name: z.ZodOptional<z.ZodString>;
3123
+ address: z.ZodOptional<z.ZodString>;
3124
+ url: z.ZodOptional<z.ZodString>;
3125
+ }, "strip", z.ZodTypeAny, {
3126
+ latitude: number;
3127
+ longitude: number;
3128
+ name?: string | undefined;
3129
+ address?: string | undefined;
3130
+ url?: string | undefined;
3131
+ }, {
3132
+ latitude: number;
3133
+ longitude: number;
3134
+ name?: string | undefined;
3135
+ address?: string | undefined;
3136
+ url?: string | undefined;
3137
+ }>>;
2773
3138
  context: z.ZodOptional<z.ZodObject<{
2774
3139
  from: z.ZodOptional<z.ZodString>;
2775
3140
  id: z.ZodOptional<z.ZodString>;
@@ -2863,6 +3228,13 @@ declare const whatsAppWebhookChangeSchema: z.ZodObject<{
2863
3228
  }[];
2864
3229
  text?: string | undefined;
2865
3230
  } | undefined;
3231
+ location?: {
3232
+ latitude: number;
3233
+ longitude: number;
3234
+ name?: string | undefined;
3235
+ address?: string | undefined;
3236
+ url?: string | undefined;
3237
+ } | undefined;
2866
3238
  context?: {
2867
3239
  id?: string | undefined;
2868
3240
  from?: string | undefined;
@@ -2935,6 +3307,13 @@ declare const whatsAppWebhookChangeSchema: z.ZodObject<{
2935
3307
  }[];
2936
3308
  text?: string | undefined;
2937
3309
  } | undefined;
3310
+ location?: {
3311
+ latitude: number;
3312
+ longitude: number;
3313
+ name?: string | undefined;
3314
+ address?: string | undefined;
3315
+ url?: string | undefined;
3316
+ } | undefined;
2938
3317
  context?: {
2939
3318
  id?: string | undefined;
2940
3319
  from?: string | undefined;
@@ -2944,6 +3323,26 @@ declare const whatsAppWebhookChangeSchema: z.ZodObject<{
2944
3323
  } | undefined;
2945
3324
  } | undefined;
2946
3325
  }>, "many">>;
3326
+ contacts: z.ZodOptional<z.ZodArray<z.ZodObject<{
3327
+ wa_id: z.ZodString;
3328
+ profile: z.ZodOptional<z.ZodObject<{
3329
+ name: z.ZodString;
3330
+ }, "strip", z.ZodTypeAny, {
3331
+ name: string;
3332
+ }, {
3333
+ name: string;
3334
+ }>>;
3335
+ }, "strip", z.ZodTypeAny, {
3336
+ wa_id: string;
3337
+ profile?: {
3338
+ name: string;
3339
+ } | undefined;
3340
+ }, {
3341
+ wa_id: string;
3342
+ profile?: {
3343
+ name: string;
3344
+ } | undefined;
3345
+ }>, "many">>;
2947
3346
  message_echoes: z.ZodOptional<z.ZodArray<z.ZodObject<{
2948
3347
  id: z.ZodString;
2949
3348
  from: z.ZodString;
@@ -3053,6 +3452,13 @@ declare const whatsAppWebhookChangeSchema: z.ZodObject<{
3053
3452
  }[];
3054
3453
  text?: string | undefined;
3055
3454
  } | undefined;
3455
+ location?: {
3456
+ latitude: number;
3457
+ longitude: number;
3458
+ name?: string | undefined;
3459
+ address?: string | undefined;
3460
+ url?: string | undefined;
3461
+ } | undefined;
3056
3462
  context?: {
3057
3463
  id?: string | undefined;
3058
3464
  from?: string | undefined;
@@ -3069,6 +3475,12 @@ declare const whatsAppWebhookChangeSchema: z.ZodObject<{
3069
3475
  timestamp: string;
3070
3476
  }[] | undefined;
3071
3477
  messaging_product?: string | undefined;
3478
+ contacts?: {
3479
+ wa_id: string;
3480
+ profile?: {
3481
+ name: string;
3482
+ } | undefined;
3483
+ }[] | undefined;
3072
3484
  statuses?: {
3073
3485
  id: string;
3074
3486
  status: "sent" | "delivered" | "read" | "failed";
@@ -3149,6 +3561,13 @@ declare const whatsAppWebhookChangeSchema: z.ZodObject<{
3149
3561
  }[];
3150
3562
  text?: string | undefined;
3151
3563
  } | undefined;
3564
+ location?: {
3565
+ latitude: number;
3566
+ longitude: number;
3567
+ name?: string | undefined;
3568
+ address?: string | undefined;
3569
+ url?: string | undefined;
3570
+ } | undefined;
3152
3571
  context?: {
3153
3572
  id?: string | undefined;
3154
3573
  from?: string | undefined;
@@ -3165,6 +3584,12 @@ declare const whatsAppWebhookChangeSchema: z.ZodObject<{
3165
3584
  timestamp: string;
3166
3585
  }[] | undefined;
3167
3586
  messaging_product?: string | undefined;
3587
+ contacts?: {
3588
+ wa_id: string;
3589
+ profile?: {
3590
+ name: string;
3591
+ } | undefined;
3592
+ }[] | undefined;
3168
3593
  statuses?: {
3169
3594
  id: string;
3170
3595
  status: "sent" | "delivered" | "read" | "failed";
@@ -3376,6 +3801,25 @@ declare const whatsAppWebhookPayloadSchema: z.ZodObject<{
3376
3801
  }[];
3377
3802
  text?: string | undefined;
3378
3803
  }>>;
3804
+ location: z.ZodOptional<z.ZodObject<{
3805
+ latitude: z.ZodNumber;
3806
+ longitude: z.ZodNumber;
3807
+ name: z.ZodOptional<z.ZodString>;
3808
+ address: z.ZodOptional<z.ZodString>;
3809
+ url: z.ZodOptional<z.ZodString>;
3810
+ }, "strip", z.ZodTypeAny, {
3811
+ latitude: number;
3812
+ longitude: number;
3813
+ name?: string | undefined;
3814
+ address?: string | undefined;
3815
+ url?: string | undefined;
3816
+ }, {
3817
+ latitude: number;
3818
+ longitude: number;
3819
+ name?: string | undefined;
3820
+ address?: string | undefined;
3821
+ url?: string | undefined;
3822
+ }>>;
3379
3823
  context: z.ZodOptional<z.ZodObject<{
3380
3824
  from: z.ZodOptional<z.ZodString>;
3381
3825
  id: z.ZodOptional<z.ZodString>;
@@ -3469,6 +3913,13 @@ declare const whatsAppWebhookPayloadSchema: z.ZodObject<{
3469
3913
  }[];
3470
3914
  text?: string | undefined;
3471
3915
  } | undefined;
3916
+ location?: {
3917
+ latitude: number;
3918
+ longitude: number;
3919
+ name?: string | undefined;
3920
+ address?: string | undefined;
3921
+ url?: string | undefined;
3922
+ } | undefined;
3472
3923
  context?: {
3473
3924
  id?: string | undefined;
3474
3925
  from?: string | undefined;
@@ -3541,6 +3992,13 @@ declare const whatsAppWebhookPayloadSchema: z.ZodObject<{
3541
3992
  }[];
3542
3993
  text?: string | undefined;
3543
3994
  } | undefined;
3995
+ location?: {
3996
+ latitude: number;
3997
+ longitude: number;
3998
+ name?: string | undefined;
3999
+ address?: string | undefined;
4000
+ url?: string | undefined;
4001
+ } | undefined;
3544
4002
  context?: {
3545
4003
  id?: string | undefined;
3546
4004
  from?: string | undefined;
@@ -3550,6 +4008,26 @@ declare const whatsAppWebhookPayloadSchema: z.ZodObject<{
3550
4008
  } | undefined;
3551
4009
  } | undefined;
3552
4010
  }>, "many">>;
4011
+ contacts: z.ZodOptional<z.ZodArray<z.ZodObject<{
4012
+ wa_id: z.ZodString;
4013
+ profile: z.ZodOptional<z.ZodObject<{
4014
+ name: z.ZodString;
4015
+ }, "strip", z.ZodTypeAny, {
4016
+ name: string;
4017
+ }, {
4018
+ name: string;
4019
+ }>>;
4020
+ }, "strip", z.ZodTypeAny, {
4021
+ wa_id: string;
4022
+ profile?: {
4023
+ name: string;
4024
+ } | undefined;
4025
+ }, {
4026
+ wa_id: string;
4027
+ profile?: {
4028
+ name: string;
4029
+ } | undefined;
4030
+ }>, "many">>;
3553
4031
  message_echoes: z.ZodOptional<z.ZodArray<z.ZodObject<{
3554
4032
  id: z.ZodString;
3555
4033
  from: z.ZodString;
@@ -3781,6 +4259,25 @@ declare const whatsAppWebhookPayloadSchema: z.ZodObject<{
3781
4259
  }[];
3782
4260
  text?: string | undefined;
3783
4261
  }>>;
4262
+ location: z.ZodOptional<z.ZodObject<{
4263
+ latitude: z.ZodNumber;
4264
+ longitude: z.ZodNumber;
4265
+ name: z.ZodOptional<z.ZodString>;
4266
+ address: z.ZodOptional<z.ZodString>;
4267
+ url: z.ZodOptional<z.ZodString>;
4268
+ }, "strip", z.ZodTypeAny, {
4269
+ latitude: number;
4270
+ longitude: number;
4271
+ name?: string | undefined;
4272
+ address?: string | undefined;
4273
+ url?: string | undefined;
4274
+ }, {
4275
+ latitude: number;
4276
+ longitude: number;
4277
+ name?: string | undefined;
4278
+ address?: string | undefined;
4279
+ url?: string | undefined;
4280
+ }>>;
3784
4281
  context: z.ZodOptional<z.ZodObject<{
3785
4282
  from: z.ZodOptional<z.ZodString>;
3786
4283
  id: z.ZodOptional<z.ZodString>;
@@ -3874,6 +4371,13 @@ declare const whatsAppWebhookPayloadSchema: z.ZodObject<{
3874
4371
  }[];
3875
4372
  text?: string | undefined;
3876
4373
  } | undefined;
4374
+ location?: {
4375
+ latitude: number;
4376
+ longitude: number;
4377
+ name?: string | undefined;
4378
+ address?: string | undefined;
4379
+ url?: string | undefined;
4380
+ } | undefined;
3877
4381
  context?: {
3878
4382
  id?: string | undefined;
3879
4383
  from?: string | undefined;
@@ -3946,6 +4450,13 @@ declare const whatsAppWebhookPayloadSchema: z.ZodObject<{
3946
4450
  }[];
3947
4451
  text?: string | undefined;
3948
4452
  } | undefined;
4453
+ location?: {
4454
+ latitude: number;
4455
+ longitude: number;
4456
+ name?: string | undefined;
4457
+ address?: string | undefined;
4458
+ url?: string | undefined;
4459
+ } | undefined;
3949
4460
  context?: {
3950
4461
  id?: string | undefined;
3951
4462
  from?: string | undefined;
@@ -3955,6 +4466,26 @@ declare const whatsAppWebhookPayloadSchema: z.ZodObject<{
3955
4466
  } | undefined;
3956
4467
  } | undefined;
3957
4468
  }>, "many">>;
4469
+ contacts: z.ZodOptional<z.ZodArray<z.ZodObject<{
4470
+ wa_id: z.ZodString;
4471
+ profile: z.ZodOptional<z.ZodObject<{
4472
+ name: z.ZodString;
4473
+ }, "strip", z.ZodTypeAny, {
4474
+ name: string;
4475
+ }, {
4476
+ name: string;
4477
+ }>>;
4478
+ }, "strip", z.ZodTypeAny, {
4479
+ wa_id: string;
4480
+ profile?: {
4481
+ name: string;
4482
+ } | undefined;
4483
+ }, {
4484
+ wa_id: string;
4485
+ profile?: {
4486
+ name: string;
4487
+ } | undefined;
4488
+ }>, "many">>;
3958
4489
  message_echoes: z.ZodOptional<z.ZodArray<z.ZodObject<{
3959
4490
  id: z.ZodString;
3960
4491
  from: z.ZodString;
@@ -4186,6 +4717,25 @@ declare const whatsAppWebhookPayloadSchema: z.ZodObject<{
4186
4717
  }[];
4187
4718
  text?: string | undefined;
4188
4719
  }>>;
4720
+ location: z.ZodOptional<z.ZodObject<{
4721
+ latitude: z.ZodNumber;
4722
+ longitude: z.ZodNumber;
4723
+ name: z.ZodOptional<z.ZodString>;
4724
+ address: z.ZodOptional<z.ZodString>;
4725
+ url: z.ZodOptional<z.ZodString>;
4726
+ }, "strip", z.ZodTypeAny, {
4727
+ latitude: number;
4728
+ longitude: number;
4729
+ name?: string | undefined;
4730
+ address?: string | undefined;
4731
+ url?: string | undefined;
4732
+ }, {
4733
+ latitude: number;
4734
+ longitude: number;
4735
+ name?: string | undefined;
4736
+ address?: string | undefined;
4737
+ url?: string | undefined;
4738
+ }>>;
4189
4739
  context: z.ZodOptional<z.ZodObject<{
4190
4740
  from: z.ZodOptional<z.ZodString>;
4191
4741
  id: z.ZodOptional<z.ZodString>;
@@ -4279,6 +4829,13 @@ declare const whatsAppWebhookPayloadSchema: z.ZodObject<{
4279
4829
  }[];
4280
4830
  text?: string | undefined;
4281
4831
  } | undefined;
4832
+ location?: {
4833
+ latitude: number;
4834
+ longitude: number;
4835
+ name?: string | undefined;
4836
+ address?: string | undefined;
4837
+ url?: string | undefined;
4838
+ } | undefined;
4282
4839
  context?: {
4283
4840
  id?: string | undefined;
4284
4841
  from?: string | undefined;
@@ -4351,6 +4908,13 @@ declare const whatsAppWebhookPayloadSchema: z.ZodObject<{
4351
4908
  }[];
4352
4909
  text?: string | undefined;
4353
4910
  } | undefined;
4911
+ location?: {
4912
+ latitude: number;
4913
+ longitude: number;
4914
+ name?: string | undefined;
4915
+ address?: string | undefined;
4916
+ url?: string | undefined;
4917
+ } | undefined;
4354
4918
  context?: {
4355
4919
  id?: string | undefined;
4356
4920
  from?: string | undefined;
@@ -4360,6 +4924,26 @@ declare const whatsAppWebhookPayloadSchema: z.ZodObject<{
4360
4924
  } | undefined;
4361
4925
  } | undefined;
4362
4926
  }>, "many">>;
4927
+ contacts: z.ZodOptional<z.ZodArray<z.ZodObject<{
4928
+ wa_id: z.ZodString;
4929
+ profile: z.ZodOptional<z.ZodObject<{
4930
+ name: z.ZodString;
4931
+ }, "strip", z.ZodTypeAny, {
4932
+ name: string;
4933
+ }, {
4934
+ name: string;
4935
+ }>>;
4936
+ }, "strip", z.ZodTypeAny, {
4937
+ wa_id: string;
4938
+ profile?: {
4939
+ name: string;
4940
+ } | undefined;
4941
+ }, {
4942
+ wa_id: string;
4943
+ profile?: {
4944
+ name: string;
4945
+ } | undefined;
4946
+ }>, "many">>;
4363
4947
  message_echoes: z.ZodOptional<z.ZodArray<z.ZodObject<{
4364
4948
  id: z.ZodString;
4365
4949
  from: z.ZodString;
@@ -4469,6 +5053,13 @@ declare const whatsAppWebhookPayloadSchema: z.ZodObject<{
4469
5053
  }[];
4470
5054
  text?: string | undefined;
4471
5055
  } | undefined;
5056
+ location?: {
5057
+ latitude: number;
5058
+ longitude: number;
5059
+ name?: string | undefined;
5060
+ address?: string | undefined;
5061
+ url?: string | undefined;
5062
+ } | undefined;
4472
5063
  context?: {
4473
5064
  id?: string | undefined;
4474
5065
  from?: string | undefined;
@@ -4485,6 +5076,12 @@ declare const whatsAppWebhookPayloadSchema: z.ZodObject<{
4485
5076
  timestamp: string;
4486
5077
  }[] | undefined;
4487
5078
  messaging_product?: string | undefined;
5079
+ contacts?: {
5080
+ wa_id: string;
5081
+ profile?: {
5082
+ name: string;
5083
+ } | undefined;
5084
+ }[] | undefined;
4488
5085
  statuses?: {
4489
5086
  id: string;
4490
5087
  status: "sent" | "delivered" | "read" | "failed";
@@ -4565,6 +5162,13 @@ declare const whatsAppWebhookPayloadSchema: z.ZodObject<{
4565
5162
  }[];
4566
5163
  text?: string | undefined;
4567
5164
  } | undefined;
5165
+ location?: {
5166
+ latitude: number;
5167
+ longitude: number;
5168
+ name?: string | undefined;
5169
+ address?: string | undefined;
5170
+ url?: string | undefined;
5171
+ } | undefined;
4568
5172
  context?: {
4569
5173
  id?: string | undefined;
4570
5174
  from?: string | undefined;
@@ -4581,6 +5185,12 @@ declare const whatsAppWebhookPayloadSchema: z.ZodObject<{
4581
5185
  timestamp: string;
4582
5186
  }[] | undefined;
4583
5187
  messaging_product?: string | undefined;
5188
+ contacts?: {
5189
+ wa_id: string;
5190
+ profile?: {
5191
+ name: string;
5192
+ } | undefined;
5193
+ }[] | undefined;
4584
5194
  statuses?: {
4585
5195
  id: string;
4586
5196
  status: "sent" | "delivered" | "read" | "failed";
@@ -4664,6 +5274,13 @@ declare const whatsAppWebhookPayloadSchema: z.ZodObject<{
4664
5274
  }[];
4665
5275
  text?: string | undefined;
4666
5276
  } | undefined;
5277
+ location?: {
5278
+ latitude: number;
5279
+ longitude: number;
5280
+ name?: string | undefined;
5281
+ address?: string | undefined;
5282
+ url?: string | undefined;
5283
+ } | undefined;
4667
5284
  context?: {
4668
5285
  id?: string | undefined;
4669
5286
  from?: string | undefined;
@@ -4680,6 +5297,12 @@ declare const whatsAppWebhookPayloadSchema: z.ZodObject<{
4680
5297
  timestamp: string;
4681
5298
  }[] | undefined;
4682
5299
  messaging_product?: string | undefined;
5300
+ contacts?: {
5301
+ wa_id: string;
5302
+ profile?: {
5303
+ name: string;
5304
+ } | undefined;
5305
+ }[] | undefined;
4683
5306
  statuses?: {
4684
5307
  id: string;
4685
5308
  status: "sent" | "delivered" | "read" | "failed";
@@ -4763,6 +5386,13 @@ declare const whatsAppWebhookPayloadSchema: z.ZodObject<{
4763
5386
  }[];
4764
5387
  text?: string | undefined;
4765
5388
  } | undefined;
5389
+ location?: {
5390
+ latitude: number;
5391
+ longitude: number;
5392
+ name?: string | undefined;
5393
+ address?: string | undefined;
5394
+ url?: string | undefined;
5395
+ } | undefined;
4766
5396
  context?: {
4767
5397
  id?: string | undefined;
4768
5398
  from?: string | undefined;
@@ -4779,6 +5409,12 @@ declare const whatsAppWebhookPayloadSchema: z.ZodObject<{
4779
5409
  timestamp: string;
4780
5410
  }[] | undefined;
4781
5411
  messaging_product?: string | undefined;
5412
+ contacts?: {
5413
+ wa_id: string;
5414
+ profile?: {
5415
+ name: string;
5416
+ } | undefined;
5417
+ }[] | undefined;
4782
5418
  statuses?: {
4783
5419
  id: string;
4784
5420
  status: "sent" | "delivered" | "read" | "failed";
@@ -4865,6 +5501,13 @@ declare const whatsAppWebhookPayloadSchema: z.ZodObject<{
4865
5501
  }[];
4866
5502
  text?: string | undefined;
4867
5503
  } | undefined;
5504
+ location?: {
5505
+ latitude: number;
5506
+ longitude: number;
5507
+ name?: string | undefined;
5508
+ address?: string | undefined;
5509
+ url?: string | undefined;
5510
+ } | undefined;
4868
5511
  context?: {
4869
5512
  id?: string | undefined;
4870
5513
  from?: string | undefined;
@@ -4881,6 +5524,12 @@ declare const whatsAppWebhookPayloadSchema: z.ZodObject<{
4881
5524
  timestamp: string;
4882
5525
  }[] | undefined;
4883
5526
  messaging_product?: string | undefined;
5527
+ contacts?: {
5528
+ wa_id: string;
5529
+ profile?: {
5530
+ name: string;
5531
+ } | undefined;
5532
+ }[] | undefined;
4884
5533
  statuses?: {
4885
5534
  id: string;
4886
5535
  status: "sent" | "delivered" | "read" | "failed";
@@ -4967,6 +5616,13 @@ declare const whatsAppWebhookPayloadSchema: z.ZodObject<{
4967
5616
  }[];
4968
5617
  text?: string | undefined;
4969
5618
  } | undefined;
5619
+ location?: {
5620
+ latitude: number;
5621
+ longitude: number;
5622
+ name?: string | undefined;
5623
+ address?: string | undefined;
5624
+ url?: string | undefined;
5625
+ } | undefined;
4970
5626
  context?: {
4971
5627
  id?: string | undefined;
4972
5628
  from?: string | undefined;
@@ -4983,6 +5639,12 @@ declare const whatsAppWebhookPayloadSchema: z.ZodObject<{
4983
5639
  timestamp: string;
4984
5640
  }[] | undefined;
4985
5641
  messaging_product?: string | undefined;
5642
+ contacts?: {
5643
+ wa_id: string;
5644
+ profile?: {
5645
+ name: string;
5646
+ } | undefined;
5647
+ }[] | undefined;
4986
5648
  statuses?: {
4987
5649
  id: string;
4988
5650
  status: "sent" | "delivered" | "read" | "failed";
@@ -5001,5 +5663,19 @@ declare const whatsAppWebhookPayloadSchema: z.ZodObject<{
5001
5663
  }[];
5002
5664
  }>;
5003
5665
  type WhatsAppWebhookPayload = z.infer<typeof whatsAppWebhookPayloadSchema>;
5666
+ /**
5667
+ * O nome de perfil de quem mandou a mensagem.
5668
+ *
5669
+ * Casa por `wa_id`. Quando nenhum casa e há UM contato só, é dele: a Meta agrupa as mensagens de um
5670
+ * mesmo contato num `change`, e o `wa_id` nem sempre é idêntico ao `from` — no Brasil o nono dígito
5671
+ * aparece num e não no outro, e exigir igualdade perderia o nome exatamente nos números móveis.
5672
+ *
5673
+ * Com dois ou mais contatos sem casamento, devolve `undefined`: pendurar o nome errado numa ficha é
5674
+ * pior que ficha sem nome.
5675
+ */
5676
+ declare function resolveContactProfileName(params: {
5677
+ readonly contacts: readonly WhatsAppContact[] | undefined;
5678
+ readonly from: string;
5679
+ }): string | undefined;
5004
5680
 
5005
- export { whatsAppWebhookChangeSchema as A, whatsAppWebhookPayloadSchema as B, whatsAppWebhookValueSchema as C, WHATSAPP_WEBHOOK_FIELDS as W, type WhatsAppInteractive as a, type WhatsAppMedia as b, type WhatsAppMessage as c, type WhatsAppMessageEcho as d, type WhatsAppMessageStatusValue as e, type WhatsAppOrder as f, type WhatsAppPhoneNumberQualityUpdate as g, type WhatsAppQualityEvent as h, type WhatsAppStatus as i, type WhatsAppTemplateStatusEvent as j, type WhatsAppTemplateStatusUpdate as k, type WhatsAppWebhookChange as l, type WhatsAppWebhookField as m, type WhatsAppWebhookPayload as n, type WhatsAppWebhookValue as o, whatsAppMediaSchema as p, whatsAppMessageEchoSchema as q, whatsAppMessageSchema as r, whatsAppMessageStatusSchema as s, whatsAppOrderSchema as t, whatsAppPhoneNumberQualityUpdateSchema as u, whatsAppQualityEventSchema as v, whatsAppInteractiveSchema as w, whatsAppStatusSchema as x, whatsAppTemplateStatusEventSchema as y, whatsAppTemplateStatusUpdateSchema as z };
5681
+ export { whatsAppPhoneNumberQualityUpdateSchema as A, whatsAppQualityEventSchema as B, whatsAppStatusSchema as C, whatsAppTemplateStatusEventSchema as D, whatsAppTemplateStatusUpdateSchema as E, whatsAppWebhookChangeSchema as F, whatsAppWebhookPayloadSchema as G, whatsAppWebhookValueSchema as H, type WhatsAppMessage as W, type WhatsAppStatus as a, type WhatsAppTemplateStatusUpdate as b, type WhatsAppPhoneNumberQualityUpdate as c, WHATSAPP_WEBHOOK_FIELDS as d, type WhatsAppContact as e, type WhatsAppInteractive as f, type WhatsAppLocation as g, type WhatsAppMedia as h, type WhatsAppMessageEcho as i, type WhatsAppMessageStatusValue as j, type WhatsAppOrder as k, type WhatsAppQualityEvent as l, type WhatsAppTemplateStatusEvent as m, type WhatsAppWebhookChange as n, type WhatsAppWebhookField as o, type WhatsAppWebhookPayload as p, type WhatsAppWebhookValue as q, resolveContactProfileName as r, whatsAppInteractiveSchema as s, whatsAppLocationSchema as t, whatsAppMediaSchema as u, whatsAppMessageEchoSchema as v, whatsAppContactSchema as w, whatsAppMessageSchema as x, whatsAppMessageStatusSchema as y, whatsAppOrderSchema as z };