evo360-types 1.3.697 → 1.3.703

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.
@@ -78,6 +78,61 @@ export declare const zNotificationErrorSchema: z.ZodObject<{
78
78
  code: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
79
79
  details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
80
80
  }, z.ZodTypeAny, "passthrough">>;
81
+ /** Human email content; plain text remains in the legacy top-level body_text. */
82
+ export declare const zNotificationEmailContentSchema: z.ZodEffects<z.ZodObject<{
83
+ subject: z.ZodOptional<z.ZodString>;
84
+ body_text: z.ZodOptional<z.ZodString>;
85
+ body_html: z.ZodOptional<z.ZodString>;
86
+ thread_id: z.ZodOptional<z.ZodString>;
87
+ reply_to_message_id: z.ZodOptional<z.ZodString>;
88
+ }, "strict", z.ZodTypeAny, {
89
+ thread_id?: string | undefined;
90
+ body_text?: string | undefined;
91
+ subject?: string | undefined;
92
+ body_html?: string | undefined;
93
+ reply_to_message_id?: string | undefined;
94
+ }, {
95
+ thread_id?: string | undefined;
96
+ body_text?: string | undefined;
97
+ subject?: string | undefined;
98
+ body_html?: string | undefined;
99
+ reply_to_message_id?: string | undefined;
100
+ }>, {
101
+ thread_id?: string | undefined;
102
+ body_text?: string | undefined;
103
+ subject?: string | undefined;
104
+ body_html?: string | undefined;
105
+ reply_to_message_id?: string | undefined;
106
+ }, {
107
+ thread_id?: string | undefined;
108
+ body_text?: string | undefined;
109
+ subject?: string | undefined;
110
+ body_html?: string | undefined;
111
+ reply_to_message_id?: string | undefined;
112
+ }>;
113
+ export declare const EMAIL_ATTACHMENT_TOTAL_MAX_BYTES: number;
114
+ export declare const zEmailSmtpConfigSchema: z.ZodObject<{
115
+ host: z.ZodString;
116
+ port: z.ZodNumber;
117
+ secure: z.ZodBoolean;
118
+ username: z.ZodString;
119
+ password_secret_ref: z.ZodString;
120
+ max_attachment_total_bytes: z.ZodOptional<z.ZodNumber>;
121
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
122
+ host: z.ZodString;
123
+ port: z.ZodNumber;
124
+ secure: z.ZodBoolean;
125
+ username: z.ZodString;
126
+ password_secret_ref: z.ZodString;
127
+ max_attachment_total_bytes: z.ZodOptional<z.ZodNumber>;
128
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
129
+ host: z.ZodString;
130
+ port: z.ZodNumber;
131
+ secure: z.ZodBoolean;
132
+ username: z.ZodString;
133
+ password_secret_ref: z.ZodString;
134
+ max_attachment_total_bytes: z.ZodOptional<z.ZodNumber>;
135
+ }, z.ZodTypeAny, "passthrough">>;
81
136
  export declare const zNotificationMessageSchema: z.ZodObject<{
82
137
  id: z.ZodString;
83
138
  ref: z.ZodAny;
@@ -119,6 +174,37 @@ export declare const zNotificationMessageSchema: z.ZodObject<{
119
174
  version: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
120
175
  }, z.ZodTypeAny, "passthrough">>>;
121
176
  body_text: z.ZodOptional<z.ZodString>;
177
+ email: z.ZodOptional<z.ZodEffects<z.ZodObject<{
178
+ subject: z.ZodOptional<z.ZodString>;
179
+ body_text: z.ZodOptional<z.ZodString>;
180
+ body_html: z.ZodOptional<z.ZodString>;
181
+ thread_id: z.ZodOptional<z.ZodString>;
182
+ reply_to_message_id: z.ZodOptional<z.ZodString>;
183
+ }, "strict", z.ZodTypeAny, {
184
+ thread_id?: string | undefined;
185
+ body_text?: string | undefined;
186
+ subject?: string | undefined;
187
+ body_html?: string | undefined;
188
+ reply_to_message_id?: string | undefined;
189
+ }, {
190
+ thread_id?: string | undefined;
191
+ body_text?: string | undefined;
192
+ subject?: string | undefined;
193
+ body_html?: string | undefined;
194
+ reply_to_message_id?: string | undefined;
195
+ }>, {
196
+ thread_id?: string | undefined;
197
+ body_text?: string | undefined;
198
+ subject?: string | undefined;
199
+ body_html?: string | undefined;
200
+ reply_to_message_id?: string | undefined;
201
+ }, {
202
+ thread_id?: string | undefined;
203
+ body_text?: string | undefined;
204
+ subject?: string | undefined;
205
+ body_html?: string | undefined;
206
+ reply_to_message_id?: string | undefined;
207
+ }>>;
122
208
  recipient: z.ZodObject<{
123
209
  kind: z.ZodEnum<["patient", "professional", "preconfigured", "raw"]>;
124
210
  id: z.ZodOptional<z.ZodString>;
@@ -314,6 +400,37 @@ export declare const zNotificationMessageSchema: z.ZodObject<{
314
400
  version: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
315
401
  }, z.ZodTypeAny, "passthrough">>>;
316
402
  body_text: z.ZodOptional<z.ZodString>;
403
+ email: z.ZodOptional<z.ZodEffects<z.ZodObject<{
404
+ subject: z.ZodOptional<z.ZodString>;
405
+ body_text: z.ZodOptional<z.ZodString>;
406
+ body_html: z.ZodOptional<z.ZodString>;
407
+ thread_id: z.ZodOptional<z.ZodString>;
408
+ reply_to_message_id: z.ZodOptional<z.ZodString>;
409
+ }, "strict", z.ZodTypeAny, {
410
+ thread_id?: string | undefined;
411
+ body_text?: string | undefined;
412
+ subject?: string | undefined;
413
+ body_html?: string | undefined;
414
+ reply_to_message_id?: string | undefined;
415
+ }, {
416
+ thread_id?: string | undefined;
417
+ body_text?: string | undefined;
418
+ subject?: string | undefined;
419
+ body_html?: string | undefined;
420
+ reply_to_message_id?: string | undefined;
421
+ }>, {
422
+ thread_id?: string | undefined;
423
+ body_text?: string | undefined;
424
+ subject?: string | undefined;
425
+ body_html?: string | undefined;
426
+ reply_to_message_id?: string | undefined;
427
+ }, {
428
+ thread_id?: string | undefined;
429
+ body_text?: string | undefined;
430
+ subject?: string | undefined;
431
+ body_html?: string | undefined;
432
+ reply_to_message_id?: string | undefined;
433
+ }>>;
317
434
  recipient: z.ZodObject<{
318
435
  kind: z.ZodEnum<["patient", "professional", "preconfigured", "raw"]>;
319
436
  id: z.ZodOptional<z.ZodString>;
@@ -509,6 +626,37 @@ export declare const zNotificationMessageSchema: z.ZodObject<{
509
626
  version: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
510
627
  }, z.ZodTypeAny, "passthrough">>>;
511
628
  body_text: z.ZodOptional<z.ZodString>;
629
+ email: z.ZodOptional<z.ZodEffects<z.ZodObject<{
630
+ subject: z.ZodOptional<z.ZodString>;
631
+ body_text: z.ZodOptional<z.ZodString>;
632
+ body_html: z.ZodOptional<z.ZodString>;
633
+ thread_id: z.ZodOptional<z.ZodString>;
634
+ reply_to_message_id: z.ZodOptional<z.ZodString>;
635
+ }, "strict", z.ZodTypeAny, {
636
+ thread_id?: string | undefined;
637
+ body_text?: string | undefined;
638
+ subject?: string | undefined;
639
+ body_html?: string | undefined;
640
+ reply_to_message_id?: string | undefined;
641
+ }, {
642
+ thread_id?: string | undefined;
643
+ body_text?: string | undefined;
644
+ subject?: string | undefined;
645
+ body_html?: string | undefined;
646
+ reply_to_message_id?: string | undefined;
647
+ }>, {
648
+ thread_id?: string | undefined;
649
+ body_text?: string | undefined;
650
+ subject?: string | undefined;
651
+ body_html?: string | undefined;
652
+ reply_to_message_id?: string | undefined;
653
+ }, {
654
+ thread_id?: string | undefined;
655
+ body_text?: string | undefined;
656
+ subject?: string | undefined;
657
+ body_html?: string | undefined;
658
+ reply_to_message_id?: string | undefined;
659
+ }>>;
512
660
  recipient: z.ZodObject<{
513
661
  kind: z.ZodEnum<["patient", "professional", "preconfigured", "raw"]>;
514
662
  id: z.ZodOptional<z.ZodString>;
@@ -923,6 +1071,37 @@ export declare const zDirectSendPayloadSchema: z.ZodEffects<z.ZodObject<{
923
1071
  locale: z.ZodOptional<z.ZodString>;
924
1072
  version: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
925
1073
  }, z.ZodTypeAny, "passthrough">>>;
1074
+ email: z.ZodOptional<z.ZodEffects<z.ZodObject<{
1075
+ subject: z.ZodOptional<z.ZodString>;
1076
+ body_text: z.ZodOptional<z.ZodString>;
1077
+ body_html: z.ZodOptional<z.ZodString>;
1078
+ thread_id: z.ZodOptional<z.ZodString>;
1079
+ reply_to_message_id: z.ZodOptional<z.ZodString>;
1080
+ }, "strict", z.ZodTypeAny, {
1081
+ thread_id?: string | undefined;
1082
+ body_text?: string | undefined;
1083
+ subject?: string | undefined;
1084
+ body_html?: string | undefined;
1085
+ reply_to_message_id?: string | undefined;
1086
+ }, {
1087
+ thread_id?: string | undefined;
1088
+ body_text?: string | undefined;
1089
+ subject?: string | undefined;
1090
+ body_html?: string | undefined;
1091
+ reply_to_message_id?: string | undefined;
1092
+ }>, {
1093
+ thread_id?: string | undefined;
1094
+ body_text?: string | undefined;
1095
+ subject?: string | undefined;
1096
+ body_html?: string | undefined;
1097
+ reply_to_message_id?: string | undefined;
1098
+ }, {
1099
+ thread_id?: string | undefined;
1100
+ body_text?: string | undefined;
1101
+ subject?: string | undefined;
1102
+ body_html?: string | undefined;
1103
+ reply_to_message_id?: string | undefined;
1104
+ }>>;
926
1105
  /** WhatsApp session text (no HSM). Max length per Meta. */
927
1106
  body_text: z.ZodOptional<z.ZodString>;
928
1107
  direct_send: z.ZodOptional<z.ZodObject<{
@@ -1129,6 +1308,37 @@ export declare const zDirectSendPayloadSchema: z.ZodEffects<z.ZodObject<{
1129
1308
  locale: z.ZodOptional<z.ZodString>;
1130
1309
  version: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
1131
1310
  }, z.ZodTypeAny, "passthrough">>>;
1311
+ email: z.ZodOptional<z.ZodEffects<z.ZodObject<{
1312
+ subject: z.ZodOptional<z.ZodString>;
1313
+ body_text: z.ZodOptional<z.ZodString>;
1314
+ body_html: z.ZodOptional<z.ZodString>;
1315
+ thread_id: z.ZodOptional<z.ZodString>;
1316
+ reply_to_message_id: z.ZodOptional<z.ZodString>;
1317
+ }, "strict", z.ZodTypeAny, {
1318
+ thread_id?: string | undefined;
1319
+ body_text?: string | undefined;
1320
+ subject?: string | undefined;
1321
+ body_html?: string | undefined;
1322
+ reply_to_message_id?: string | undefined;
1323
+ }, {
1324
+ thread_id?: string | undefined;
1325
+ body_text?: string | undefined;
1326
+ subject?: string | undefined;
1327
+ body_html?: string | undefined;
1328
+ reply_to_message_id?: string | undefined;
1329
+ }>, {
1330
+ thread_id?: string | undefined;
1331
+ body_text?: string | undefined;
1332
+ subject?: string | undefined;
1333
+ body_html?: string | undefined;
1334
+ reply_to_message_id?: string | undefined;
1335
+ }, {
1336
+ thread_id?: string | undefined;
1337
+ body_text?: string | undefined;
1338
+ subject?: string | undefined;
1339
+ body_html?: string | undefined;
1340
+ reply_to_message_id?: string | undefined;
1341
+ }>>;
1132
1342
  /** WhatsApp session text (no HSM). Max length per Meta. */
1133
1343
  body_text: z.ZodOptional<z.ZodString>;
1134
1344
  direct_send: z.ZodOptional<z.ZodObject<{
@@ -1335,6 +1545,37 @@ export declare const zDirectSendPayloadSchema: z.ZodEffects<z.ZodObject<{
1335
1545
  locale: z.ZodOptional<z.ZodString>;
1336
1546
  version: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
1337
1547
  }, z.ZodTypeAny, "passthrough">>>;
1548
+ email: z.ZodOptional<z.ZodEffects<z.ZodObject<{
1549
+ subject: z.ZodOptional<z.ZodString>;
1550
+ body_text: z.ZodOptional<z.ZodString>;
1551
+ body_html: z.ZodOptional<z.ZodString>;
1552
+ thread_id: z.ZodOptional<z.ZodString>;
1553
+ reply_to_message_id: z.ZodOptional<z.ZodString>;
1554
+ }, "strict", z.ZodTypeAny, {
1555
+ thread_id?: string | undefined;
1556
+ body_text?: string | undefined;
1557
+ subject?: string | undefined;
1558
+ body_html?: string | undefined;
1559
+ reply_to_message_id?: string | undefined;
1560
+ }, {
1561
+ thread_id?: string | undefined;
1562
+ body_text?: string | undefined;
1563
+ subject?: string | undefined;
1564
+ body_html?: string | undefined;
1565
+ reply_to_message_id?: string | undefined;
1566
+ }>, {
1567
+ thread_id?: string | undefined;
1568
+ body_text?: string | undefined;
1569
+ subject?: string | undefined;
1570
+ body_html?: string | undefined;
1571
+ reply_to_message_id?: string | undefined;
1572
+ }, {
1573
+ thread_id?: string | undefined;
1574
+ body_text?: string | undefined;
1575
+ subject?: string | undefined;
1576
+ body_html?: string | undefined;
1577
+ reply_to_message_id?: string | undefined;
1578
+ }>>;
1338
1579
  /** WhatsApp session text (no HSM). Max length per Meta. */
1339
1580
  body_text: z.ZodOptional<z.ZodString>;
1340
1581
  direct_send: z.ZodOptional<z.ZodObject<{
@@ -1541,6 +1782,37 @@ export declare const zDirectSendPayloadSchema: z.ZodEffects<z.ZodObject<{
1541
1782
  locale: z.ZodOptional<z.ZodString>;
1542
1783
  version: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
1543
1784
  }, z.ZodTypeAny, "passthrough">>>;
1785
+ email: z.ZodOptional<z.ZodEffects<z.ZodObject<{
1786
+ subject: z.ZodOptional<z.ZodString>;
1787
+ body_text: z.ZodOptional<z.ZodString>;
1788
+ body_html: z.ZodOptional<z.ZodString>;
1789
+ thread_id: z.ZodOptional<z.ZodString>;
1790
+ reply_to_message_id: z.ZodOptional<z.ZodString>;
1791
+ }, "strict", z.ZodTypeAny, {
1792
+ thread_id?: string | undefined;
1793
+ body_text?: string | undefined;
1794
+ subject?: string | undefined;
1795
+ body_html?: string | undefined;
1796
+ reply_to_message_id?: string | undefined;
1797
+ }, {
1798
+ thread_id?: string | undefined;
1799
+ body_text?: string | undefined;
1800
+ subject?: string | undefined;
1801
+ body_html?: string | undefined;
1802
+ reply_to_message_id?: string | undefined;
1803
+ }>, {
1804
+ thread_id?: string | undefined;
1805
+ body_text?: string | undefined;
1806
+ subject?: string | undefined;
1807
+ body_html?: string | undefined;
1808
+ reply_to_message_id?: string | undefined;
1809
+ }, {
1810
+ thread_id?: string | undefined;
1811
+ body_text?: string | undefined;
1812
+ subject?: string | undefined;
1813
+ body_html?: string | undefined;
1814
+ reply_to_message_id?: string | undefined;
1815
+ }>>;
1544
1816
  /** WhatsApp session text (no HSM). Max length per Meta. */
1545
1817
  body_text: z.ZodOptional<z.ZodString>;
1546
1818
  direct_send: z.ZodOptional<z.ZodObject<{
@@ -1747,6 +2019,37 @@ export declare const zDirectSendPayloadSchema: z.ZodEffects<z.ZodObject<{
1747
2019
  locale: z.ZodOptional<z.ZodString>;
1748
2020
  version: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
1749
2021
  }, z.ZodTypeAny, "passthrough">>>;
2022
+ email: z.ZodOptional<z.ZodEffects<z.ZodObject<{
2023
+ subject: z.ZodOptional<z.ZodString>;
2024
+ body_text: z.ZodOptional<z.ZodString>;
2025
+ body_html: z.ZodOptional<z.ZodString>;
2026
+ thread_id: z.ZodOptional<z.ZodString>;
2027
+ reply_to_message_id: z.ZodOptional<z.ZodString>;
2028
+ }, "strict", z.ZodTypeAny, {
2029
+ thread_id?: string | undefined;
2030
+ body_text?: string | undefined;
2031
+ subject?: string | undefined;
2032
+ body_html?: string | undefined;
2033
+ reply_to_message_id?: string | undefined;
2034
+ }, {
2035
+ thread_id?: string | undefined;
2036
+ body_text?: string | undefined;
2037
+ subject?: string | undefined;
2038
+ body_html?: string | undefined;
2039
+ reply_to_message_id?: string | undefined;
2040
+ }>, {
2041
+ thread_id?: string | undefined;
2042
+ body_text?: string | undefined;
2043
+ subject?: string | undefined;
2044
+ body_html?: string | undefined;
2045
+ reply_to_message_id?: string | undefined;
2046
+ }, {
2047
+ thread_id?: string | undefined;
2048
+ body_text?: string | undefined;
2049
+ subject?: string | undefined;
2050
+ body_html?: string | undefined;
2051
+ reply_to_message_id?: string | undefined;
2052
+ }>>;
1750
2053
  /** WhatsApp session text (no HSM). Max length per Meta. */
1751
2054
  body_text: z.ZodOptional<z.ZodString>;
1752
2055
  direct_send: z.ZodOptional<z.ZodObject<{
@@ -1954,6 +2257,37 @@ export declare const zNexusDirectSendPayloadSchema: z.ZodEffects<z.ZodObject<{
1954
2257
  version: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
1955
2258
  }, z.ZodTypeAny, "passthrough">>>;
1956
2259
  body_text: z.ZodOptional<z.ZodString>;
2260
+ email: z.ZodOptional<z.ZodEffects<z.ZodObject<{
2261
+ subject: z.ZodOptional<z.ZodString>;
2262
+ body_text: z.ZodOptional<z.ZodString>;
2263
+ body_html: z.ZodOptional<z.ZodString>;
2264
+ thread_id: z.ZodOptional<z.ZodString>;
2265
+ reply_to_message_id: z.ZodOptional<z.ZodString>;
2266
+ }, "strict", z.ZodTypeAny, {
2267
+ thread_id?: string | undefined;
2268
+ body_text?: string | undefined;
2269
+ subject?: string | undefined;
2270
+ body_html?: string | undefined;
2271
+ reply_to_message_id?: string | undefined;
2272
+ }, {
2273
+ thread_id?: string | undefined;
2274
+ body_text?: string | undefined;
2275
+ subject?: string | undefined;
2276
+ body_html?: string | undefined;
2277
+ reply_to_message_id?: string | undefined;
2278
+ }>, {
2279
+ thread_id?: string | undefined;
2280
+ body_text?: string | undefined;
2281
+ subject?: string | undefined;
2282
+ body_html?: string | undefined;
2283
+ reply_to_message_id?: string | undefined;
2284
+ }, {
2285
+ thread_id?: string | undefined;
2286
+ body_text?: string | undefined;
2287
+ subject?: string | undefined;
2288
+ body_html?: string | undefined;
2289
+ reply_to_message_id?: string | undefined;
2290
+ }>>;
1957
2291
  direct_send: z.ZodOptional<z.ZodObject<{
1958
2292
  category: z.ZodLiteral<"utility">;
1959
2293
  ttl_seconds: z.ZodOptional<z.ZodNumber>;
@@ -2145,6 +2479,37 @@ export declare const zNexusDirectSendPayloadSchema: z.ZodEffects<z.ZodObject<{
2145
2479
  version: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
2146
2480
  }, z.ZodTypeAny, "passthrough">>>;
2147
2481
  body_text: z.ZodOptional<z.ZodString>;
2482
+ email: z.ZodOptional<z.ZodEffects<z.ZodObject<{
2483
+ subject: z.ZodOptional<z.ZodString>;
2484
+ body_text: z.ZodOptional<z.ZodString>;
2485
+ body_html: z.ZodOptional<z.ZodString>;
2486
+ thread_id: z.ZodOptional<z.ZodString>;
2487
+ reply_to_message_id: z.ZodOptional<z.ZodString>;
2488
+ }, "strict", z.ZodTypeAny, {
2489
+ thread_id?: string | undefined;
2490
+ body_text?: string | undefined;
2491
+ subject?: string | undefined;
2492
+ body_html?: string | undefined;
2493
+ reply_to_message_id?: string | undefined;
2494
+ }, {
2495
+ thread_id?: string | undefined;
2496
+ body_text?: string | undefined;
2497
+ subject?: string | undefined;
2498
+ body_html?: string | undefined;
2499
+ reply_to_message_id?: string | undefined;
2500
+ }>, {
2501
+ thread_id?: string | undefined;
2502
+ body_text?: string | undefined;
2503
+ subject?: string | undefined;
2504
+ body_html?: string | undefined;
2505
+ reply_to_message_id?: string | undefined;
2506
+ }, {
2507
+ thread_id?: string | undefined;
2508
+ body_text?: string | undefined;
2509
+ subject?: string | undefined;
2510
+ body_html?: string | undefined;
2511
+ reply_to_message_id?: string | undefined;
2512
+ }>>;
2148
2513
  direct_send: z.ZodOptional<z.ZodObject<{
2149
2514
  category: z.ZodLiteral<"utility">;
2150
2515
  ttl_seconds: z.ZodOptional<z.ZodNumber>;
@@ -2336,6 +2701,37 @@ export declare const zNexusDirectSendPayloadSchema: z.ZodEffects<z.ZodObject<{
2336
2701
  version: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
2337
2702
  }, z.ZodTypeAny, "passthrough">>>;
2338
2703
  body_text: z.ZodOptional<z.ZodString>;
2704
+ email: z.ZodOptional<z.ZodEffects<z.ZodObject<{
2705
+ subject: z.ZodOptional<z.ZodString>;
2706
+ body_text: z.ZodOptional<z.ZodString>;
2707
+ body_html: z.ZodOptional<z.ZodString>;
2708
+ thread_id: z.ZodOptional<z.ZodString>;
2709
+ reply_to_message_id: z.ZodOptional<z.ZodString>;
2710
+ }, "strict", z.ZodTypeAny, {
2711
+ thread_id?: string | undefined;
2712
+ body_text?: string | undefined;
2713
+ subject?: string | undefined;
2714
+ body_html?: string | undefined;
2715
+ reply_to_message_id?: string | undefined;
2716
+ }, {
2717
+ thread_id?: string | undefined;
2718
+ body_text?: string | undefined;
2719
+ subject?: string | undefined;
2720
+ body_html?: string | undefined;
2721
+ reply_to_message_id?: string | undefined;
2722
+ }>, {
2723
+ thread_id?: string | undefined;
2724
+ body_text?: string | undefined;
2725
+ subject?: string | undefined;
2726
+ body_html?: string | undefined;
2727
+ reply_to_message_id?: string | undefined;
2728
+ }, {
2729
+ thread_id?: string | undefined;
2730
+ body_text?: string | undefined;
2731
+ subject?: string | undefined;
2732
+ body_html?: string | undefined;
2733
+ reply_to_message_id?: string | undefined;
2734
+ }>>;
2339
2735
  direct_send: z.ZodOptional<z.ZodObject<{
2340
2736
  category: z.ZodLiteral<"utility">;
2341
2737
  ttl_seconds: z.ZodOptional<z.ZodNumber>;
@@ -2527,6 +2923,37 @@ export declare const zNexusDirectSendPayloadSchema: z.ZodEffects<z.ZodObject<{
2527
2923
  version: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
2528
2924
  }, z.ZodTypeAny, "passthrough">>>;
2529
2925
  body_text: z.ZodOptional<z.ZodString>;
2926
+ email: z.ZodOptional<z.ZodEffects<z.ZodObject<{
2927
+ subject: z.ZodOptional<z.ZodString>;
2928
+ body_text: z.ZodOptional<z.ZodString>;
2929
+ body_html: z.ZodOptional<z.ZodString>;
2930
+ thread_id: z.ZodOptional<z.ZodString>;
2931
+ reply_to_message_id: z.ZodOptional<z.ZodString>;
2932
+ }, "strict", z.ZodTypeAny, {
2933
+ thread_id?: string | undefined;
2934
+ body_text?: string | undefined;
2935
+ subject?: string | undefined;
2936
+ body_html?: string | undefined;
2937
+ reply_to_message_id?: string | undefined;
2938
+ }, {
2939
+ thread_id?: string | undefined;
2940
+ body_text?: string | undefined;
2941
+ subject?: string | undefined;
2942
+ body_html?: string | undefined;
2943
+ reply_to_message_id?: string | undefined;
2944
+ }>, {
2945
+ thread_id?: string | undefined;
2946
+ body_text?: string | undefined;
2947
+ subject?: string | undefined;
2948
+ body_html?: string | undefined;
2949
+ reply_to_message_id?: string | undefined;
2950
+ }, {
2951
+ thread_id?: string | undefined;
2952
+ body_text?: string | undefined;
2953
+ subject?: string | undefined;
2954
+ body_html?: string | undefined;
2955
+ reply_to_message_id?: string | undefined;
2956
+ }>>;
2530
2957
  direct_send: z.ZodOptional<z.ZodObject<{
2531
2958
  category: z.ZodLiteral<"utility">;
2532
2959
  ttl_seconds: z.ZodOptional<z.ZodNumber>;
@@ -2718,6 +3145,37 @@ export declare const zNexusDirectSendPayloadSchema: z.ZodEffects<z.ZodObject<{
2718
3145
  version: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
2719
3146
  }, z.ZodTypeAny, "passthrough">>>;
2720
3147
  body_text: z.ZodOptional<z.ZodString>;
3148
+ email: z.ZodOptional<z.ZodEffects<z.ZodObject<{
3149
+ subject: z.ZodOptional<z.ZodString>;
3150
+ body_text: z.ZodOptional<z.ZodString>;
3151
+ body_html: z.ZodOptional<z.ZodString>;
3152
+ thread_id: z.ZodOptional<z.ZodString>;
3153
+ reply_to_message_id: z.ZodOptional<z.ZodString>;
3154
+ }, "strict", z.ZodTypeAny, {
3155
+ thread_id?: string | undefined;
3156
+ body_text?: string | undefined;
3157
+ subject?: string | undefined;
3158
+ body_html?: string | undefined;
3159
+ reply_to_message_id?: string | undefined;
3160
+ }, {
3161
+ thread_id?: string | undefined;
3162
+ body_text?: string | undefined;
3163
+ subject?: string | undefined;
3164
+ body_html?: string | undefined;
3165
+ reply_to_message_id?: string | undefined;
3166
+ }>, {
3167
+ thread_id?: string | undefined;
3168
+ body_text?: string | undefined;
3169
+ subject?: string | undefined;
3170
+ body_html?: string | undefined;
3171
+ reply_to_message_id?: string | undefined;
3172
+ }, {
3173
+ thread_id?: string | undefined;
3174
+ body_text?: string | undefined;
3175
+ subject?: string | undefined;
3176
+ body_html?: string | undefined;
3177
+ reply_to_message_id?: string | undefined;
3178
+ }>>;
2721
3179
  direct_send: z.ZodOptional<z.ZodObject<{
2722
3180
  category: z.ZodLiteral<"utility">;
2723
3181
  ttl_seconds: z.ZodOptional<z.ZodNumber>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.zNexusDirectSendPayloadSchema = exports.zDirectSendPayloadSchema = exports.zNotificationAttachmentSchema = exports.NOTIFICATION_ATTACHMENT_MAX_BASE64_BYTES = exports.zNotificationDirectSendSchema = exports.zNotificationLogSchema = exports.zNotificationAttemptSchema = exports.zNotificationMessageSchema = exports.zNotificationErrorSchema = exports.zNotificationProviderMetaSchema = exports.zNotificationTemplateRefSchema = exports.zNotificationChannelRefSchema = exports.zNotificationRecipientSchema = exports.zNotificationLogLevelSchema = exports.zNotificationRecipientKindSchema = exports.zNotificationAttemptStatusSchema = exports.zNotificationMessageStatusSchema = exports.zNotificationChannelTypeSchema = void 0;
3
+ exports.zNexusDirectSendPayloadSchema = exports.zDirectSendPayloadSchema = exports.zNotificationAttachmentSchema = exports.NOTIFICATION_ATTACHMENT_MAX_BASE64_BYTES = exports.zNotificationDirectSendSchema = exports.zNotificationLogSchema = exports.zNotificationAttemptSchema = exports.zNotificationMessageSchema = exports.zEmailSmtpConfigSchema = exports.EMAIL_ATTACHMENT_TOTAL_MAX_BYTES = exports.zNotificationEmailContentSchema = exports.zNotificationErrorSchema = exports.zNotificationProviderMetaSchema = exports.zNotificationTemplateRefSchema = exports.zNotificationChannelRefSchema = exports.zNotificationRecipientSchema = exports.zNotificationLogLevelSchema = exports.zNotificationRecipientKindSchema = exports.zNotificationAttemptStatusSchema = exports.zNotificationMessageStatusSchema = exports.zNotificationChannelTypeSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const zod_schemas_1 = require("../shared/zod-schemas");
6
6
  const zod_schemas_2 = require("../evo-task/zod-schemas");
@@ -78,6 +78,41 @@ exports.zNotificationErrorSchema = zod_1.z
78
78
  details: zod_1.z.record(zod_1.z.unknown()).optional(),
79
79
  })
80
80
  .passthrough();
81
+ /** Human email content; plain text remains in the legacy top-level body_text. */
82
+ exports.zNotificationEmailContentSchema = zod_1.z
83
+ .object({
84
+ subject: zod_1.z.string().trim().min(1).max(998).optional(),
85
+ body_text: zod_1.z.string().optional(),
86
+ body_html: zod_1.z.string().optional(),
87
+ thread_id: zod_1.z.string().min(1).optional(),
88
+ reply_to_message_id: zod_1.z.string().min(1).optional(),
89
+ })
90
+ .strict()
91
+ .superRefine((data, ctx) => {
92
+ if (!data.reply_to_message_id && !data.subject) {
93
+ ctx.addIssue({
94
+ code: zod_1.z.ZodIssueCode.custom,
95
+ message: "Informe o assunto para iniciar uma nova conversa por email.",
96
+ path: ["subject"],
97
+ });
98
+ }
99
+ });
100
+ exports.EMAIL_ATTACHMENT_TOTAL_MAX_BYTES = 15 * 1024 * 1024;
101
+ exports.zEmailSmtpConfigSchema = zod_1.z
102
+ .object({
103
+ host: zod_1.z.string(),
104
+ port: zod_1.z.number(),
105
+ secure: zod_1.z.boolean(),
106
+ username: zod_1.z.string(),
107
+ password_secret_ref: zod_1.z.string(),
108
+ max_attachment_total_bytes: zod_1.z
109
+ .number()
110
+ .int()
111
+ .positive()
112
+ .max(exports.EMAIL_ATTACHMENT_TOTAL_MAX_BYTES)
113
+ .optional(),
114
+ })
115
+ .passthrough();
81
116
  // ---- Main document schemas ----
82
117
  exports.zNotificationMessageSchema = zod_schemas_1.zFireDocSchema
83
118
  .extend({
@@ -90,6 +125,7 @@ exports.zNotificationMessageSchema = zod_schemas_1.zFireDocSchema
90
125
  channel: exports.zNotificationChannelRefSchema,
91
126
  template: exports.zNotificationTemplateRefSchema.optional(),
92
127
  body_text: zod_1.z.string().max(4096).optional(),
128
+ email: exports.zNotificationEmailContentSchema.optional(),
93
129
  recipient: exports.zNotificationRecipientSchema,
94
130
  variables: zod_1.z.record(zod_1.z.unknown()).optional(),
95
131
  status: exports.zNotificationMessageStatusSchema,
@@ -160,6 +196,7 @@ exports.zDirectSendPayloadSchema = zod_1.z
160
196
  recipient: exports.zNotificationRecipientSchema,
161
197
  channel: exports.zNotificationChannelRefSchema,
162
198
  template: exports.zNotificationTemplateRefSchema.optional(),
199
+ email: exports.zNotificationEmailContentSchema.optional(),
163
200
  /** WhatsApp session text (no HSM). Max length per Meta. */
164
201
  body_text: zod_1.z.string().max(4096).optional(),
165
202
  direct_send: exports.zNotificationDirectSendSchema.optional(),
@@ -219,6 +256,7 @@ exports.zNexusDirectSendPayloadSchema = zod_1.z
219
256
  channel: exports.zNotificationChannelRefSchema,
220
257
  template: exports.zNotificationTemplateRefSchema.optional(),
221
258
  body_text: zod_1.z.string().max(4096).optional(),
259
+ email: exports.zNotificationEmailContentSchema.optional(),
222
260
  direct_send: exports.zNotificationDirectSendSchema.optional(),
223
261
  variables: zod_1.z.record(zod_1.z.unknown()).optional(),
224
262
  routine: zod_1.z
@@ -88,6 +88,44 @@ export const zNotificationErrorSchema = z
88
88
  })
89
89
  .passthrough();
90
90
 
91
+ /** Human email content; plain text remains in the legacy top-level body_text. */
92
+ export const zNotificationEmailContentSchema = z
93
+ .object({
94
+ subject: z.string().trim().min(1).max(998).optional(),
95
+ body_text: z.string().optional(),
96
+ body_html: z.string().optional(),
97
+ thread_id: z.string().min(1).optional(),
98
+ reply_to_message_id: z.string().min(1).optional(),
99
+ })
100
+ .strict()
101
+ .superRefine((data, ctx) => {
102
+ if (!data.reply_to_message_id && !data.subject) {
103
+ ctx.addIssue({
104
+ code: z.ZodIssueCode.custom,
105
+ message: "Informe o assunto para iniciar uma nova conversa por email.",
106
+ path: ["subject"],
107
+ });
108
+ }
109
+ });
110
+
111
+ export const EMAIL_ATTACHMENT_TOTAL_MAX_BYTES = 15 * 1024 * 1024;
112
+
113
+ export const zEmailSmtpConfigSchema = z
114
+ .object({
115
+ host: z.string(),
116
+ port: z.number(),
117
+ secure: z.boolean(),
118
+ username: z.string(),
119
+ password_secret_ref: z.string(),
120
+ max_attachment_total_bytes: z
121
+ .number()
122
+ .int()
123
+ .positive()
124
+ .max(EMAIL_ATTACHMENT_TOTAL_MAX_BYTES)
125
+ .optional(),
126
+ })
127
+ .passthrough();
128
+
91
129
  // ---- Main document schemas ----
92
130
 
93
131
  export const zNotificationMessageSchema = zFireDocSchema
@@ -101,6 +139,7 @@ export const zNotificationMessageSchema = zFireDocSchema
101
139
  channel: zNotificationChannelRefSchema,
102
140
  template: zNotificationTemplateRefSchema.optional(),
103
141
  body_text: z.string().max(4096).optional(),
142
+ email: zNotificationEmailContentSchema.optional(),
104
143
  recipient: zNotificationRecipientSchema,
105
144
  variables: z.record(z.unknown()).optional(),
106
145
  status: zNotificationMessageStatusSchema,
@@ -179,6 +218,7 @@ export const zDirectSendPayloadSchema = z
179
218
  recipient: zNotificationRecipientSchema,
180
219
  channel: zNotificationChannelRefSchema,
181
220
  template: zNotificationTemplateRefSchema.optional(),
221
+ email: zNotificationEmailContentSchema.optional(),
182
222
  /** WhatsApp session text (no HSM). Max length per Meta. */
183
223
  body_text: z.string().max(4096).optional(),
184
224
  direct_send: zNotificationDirectSendSchema.optional(),
@@ -244,6 +284,7 @@ export const zNexusDirectSendPayloadSchema = z
244
284
  channel: zNotificationChannelRefSchema,
245
285
  template: zNotificationTemplateRefSchema.optional(),
246
286
  body_text: z.string().max(4096).optional(),
287
+ email: zNotificationEmailContentSchema.optional(),
247
288
  direct_send: zNotificationDirectSendSchema.optional(),
248
289
  variables: z.record(z.unknown()).optional(),
249
290
  routine: z
@@ -9,6 +9,7 @@ export * from "./common/nfse-fee-reimbursement";
9
9
  export * from "./providers";
10
10
  export * from "./providers/provider_fiscal_types";
11
11
  export * from "./providers/asaas/asaas_provider";
12
+ export * from "./providers/asaas/asaas_kyc";
12
13
  export * from "./providers/inter/inter_provider";
13
14
  export * from "./dic";
14
15
  export * from "./invoices";
@@ -26,6 +26,7 @@ __exportStar(require("./common/nfse-fee-reimbursement"), exports);
26
26
  __exportStar(require("./providers"), exports);
27
27
  __exportStar(require("./providers/provider_fiscal_types"), exports);
28
28
  __exportStar(require("./providers/asaas/asaas_provider"), exports);
29
+ __exportStar(require("./providers/asaas/asaas_kyc"), exports);
29
30
  __exportStar(require("./providers/inter/inter_provider"), exports);
30
31
  __exportStar(require("./dic"), exports);
31
32
  __exportStar(require("./invoices"), exports);
@@ -11,6 +11,7 @@ export * from "./common/nfse-fee-reimbursement";
11
11
  export * from "./providers";
12
12
  export * from "./providers/provider_fiscal_types";
13
13
  export * from "./providers/asaas/asaas_provider";
14
+ export * from "./providers/asaas/asaas_kyc";
14
15
  export * from "./providers/inter/inter_provider";
15
16
  export * from "./dic";
16
17
  export * from "./invoices";
@@ -0,0 +1,63 @@
1
+ import { AsaasAccessTokenStatus, AsaasAccountStatusValue, AsaasEnvironment, AsaasKycNotificationTrigger, AsaasOnboardingNextAction, IAsaasCommercialInfoExpiration } from "./asaas_provider";
2
+ /** Tópico Pub/Sub dos pedidos de aviso de KYC (publicado pelo functions-app). */
3
+ export declare const FINOPS_ASAAS_KYC_NOTIFY_TOPIC = "app_evo-finops_asaas-kyc_notify-requested";
4
+ /** Gatilho do aviso: os de KYC + alerta de chave de API (destinado ao staff). */
5
+ export type FinopsAsaasKycNotifyTrigger = AsaasKycNotificationTrigger | "access_token_alert";
6
+ export interface IFinopsAsaasKycNotifyRecipient {
7
+ name?: string | null;
8
+ email?: string | null;
9
+ /** E.164 normalizado. */
10
+ mobile_phone?: string | null;
11
+ }
12
+ export interface IFinopsAsaasKycNotifyMessage {
13
+ tenant: string;
14
+ provider_id: string;
15
+ provider_name?: string;
16
+ trigger: FinopsAsaasKycNotifyTrigger;
17
+ /** Escopo do dedup (ex.: hash do link, data agendada). Chave = `${trigger}:${dedup_scope}`. */
18
+ dedup_scope: string;
19
+ /**
20
+ * Opcional: o consumidor resolve o contato administrativo da clínica
21
+ * (cliente do Nexus por `tenant_refs[].tenant`, leads com role `administrative`).
22
+ */
23
+ recipients?: IFinopsAsaasKycNotifyRecipient[];
24
+ /** Usado quando o cliente do Nexus não tem contato administrativo (vem do `holder_contact`). */
25
+ fallback_recipients?: IFinopsAsaasKycNotifyRecipient[];
26
+ /** nome, clinica, link, data_limite, motivo… */
27
+ variables: Record<string, string>;
28
+ /** ISO datetime. */
29
+ requested_at: string;
30
+ }
31
+ /** Grupo de documento pendente, resumido para a fila. */
32
+ export interface INexKycQueuePendingGroup {
33
+ title?: string | null;
34
+ status?: string | null;
35
+ }
36
+ /** Resumo de `IAsaasAccessTokenMeta` exibido na fila. */
37
+ export interface INexKycQueueAccessTokenSummary {
38
+ status: AsaasAccessTokenStatus;
39
+ projected_expiration_by_lack_of_use?: string | null;
40
+ last_event?: string | null;
41
+ }
42
+ /** feat-275 — linha da fila de KYC do Nexus (uma por provider `asaas_subaccount` não aprovado). */
43
+ export interface INexKycQueueItem {
44
+ tenant: string;
45
+ provider_id: string;
46
+ provider_name?: string | null;
47
+ /** Ambiente do snapshot exibido. */
48
+ env?: AsaasEnvironment;
49
+ /** ISO datetime de criação do provider. */
50
+ created_at?: string | null;
51
+ general?: AsaasAccountStatusValue | null;
52
+ documentation?: AsaasAccountStatusValue | null;
53
+ commercialInfo?: AsaasAccountStatusValue | null;
54
+ next_action?: AsaasOnboardingNextAction | null;
55
+ documents_fetched_at?: string | null;
56
+ has_onboarding_url: boolean;
57
+ pending_groups: INexKycQueuePendingGroup[];
58
+ commercial_info_expiration?: IAsaasCommercialInfoExpiration | null;
59
+ access_token_meta?: INexKycQueueAccessTokenSummary | null;
60
+ last_error?: {
61
+ code?: string | null;
62
+ } | null;
63
+ }
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ // ── feat-275 — KYC da subconta Asaas (BaaS) ──
3
+ //
4
+ // Contratos compartilhados functions-app ↔ functions-nexus:
5
+ // - mensagem Pub/Sub que pede um aviso de KYC ao cliente (o consumidor no
6
+ // functions-nexus resolve o contato administrativo da clínica no cadastro do
7
+ // cliente do Nexus; `fallback_recipients` vem do `holder_contact` da subconta);
8
+ // - linha da fila de KYC do Nexus.
9
+ //
10
+ // Runtime `lib: es6`: as constantes abaixo são só dados.
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.FINOPS_ASAAS_KYC_NOTIFY_TOPIC = void 0;
13
+ /** Tópico Pub/Sub dos pedidos de aviso de KYC (publicado pelo functions-app). */
14
+ exports.FINOPS_ASAAS_KYC_NOTIFY_TOPIC = "app_evo-finops_asaas-kyc_notify-requested";
@@ -0,0 +1,85 @@
1
+ // ── feat-275 — KYC da subconta Asaas (BaaS) ──
2
+ //
3
+ // Contratos compartilhados functions-app ↔ functions-nexus:
4
+ // - mensagem Pub/Sub que pede um aviso de KYC ao cliente (o consumidor no
5
+ // functions-nexus resolve o contato administrativo da clínica no cadastro do
6
+ // cliente do Nexus; `fallback_recipients` vem do `holder_contact` da subconta);
7
+ // - linha da fila de KYC do Nexus.
8
+ //
9
+ // Runtime `lib: es6`: as constantes abaixo são só dados.
10
+
11
+ import {
12
+ AsaasAccessTokenStatus,
13
+ AsaasAccountStatusValue,
14
+ AsaasEnvironment,
15
+ AsaasKycNotificationTrigger,
16
+ AsaasOnboardingNextAction,
17
+ IAsaasCommercialInfoExpiration,
18
+ } from "./asaas_provider";
19
+
20
+ /** Tópico Pub/Sub dos pedidos de aviso de KYC (publicado pelo functions-app). */
21
+ export const FINOPS_ASAAS_KYC_NOTIFY_TOPIC = "app_evo-finops_asaas-kyc_notify-requested";
22
+
23
+ /** Gatilho do aviso: os de KYC + alerta de chave de API (destinado ao staff). */
24
+ export type FinopsAsaasKycNotifyTrigger = AsaasKycNotificationTrigger | "access_token_alert";
25
+
26
+ export interface IFinopsAsaasKycNotifyRecipient {
27
+ name?: string | null;
28
+ email?: string | null;
29
+ /** E.164 normalizado. */
30
+ mobile_phone?: string | null;
31
+ }
32
+
33
+ export interface IFinopsAsaasKycNotifyMessage {
34
+ tenant: string;
35
+ provider_id: string;
36
+ provider_name?: string;
37
+ trigger: FinopsAsaasKycNotifyTrigger;
38
+ /** Escopo do dedup (ex.: hash do link, data agendada). Chave = `${trigger}:${dedup_scope}`. */
39
+ dedup_scope: string;
40
+ /**
41
+ * Opcional: o consumidor resolve o contato administrativo da clínica
42
+ * (cliente do Nexus por `tenant_refs[].tenant`, leads com role `administrative`).
43
+ */
44
+ recipients?: IFinopsAsaasKycNotifyRecipient[];
45
+ /** Usado quando o cliente do Nexus não tem contato administrativo (vem do `holder_contact`). */
46
+ fallback_recipients?: IFinopsAsaasKycNotifyRecipient[];
47
+ /** nome, clinica, link, data_limite, motivo… */
48
+ variables: Record<string, string>;
49
+ /** ISO datetime. */
50
+ requested_at: string;
51
+ }
52
+
53
+ /** Grupo de documento pendente, resumido para a fila. */
54
+ export interface INexKycQueuePendingGroup {
55
+ title?: string | null;
56
+ status?: string | null;
57
+ }
58
+
59
+ /** Resumo de `IAsaasAccessTokenMeta` exibido na fila. */
60
+ export interface INexKycQueueAccessTokenSummary {
61
+ status: AsaasAccessTokenStatus;
62
+ projected_expiration_by_lack_of_use?: string | null;
63
+ last_event?: string | null;
64
+ }
65
+
66
+ /** feat-275 — linha da fila de KYC do Nexus (uma por provider `asaas_subaccount` não aprovado). */
67
+ export interface INexKycQueueItem {
68
+ tenant: string;
69
+ provider_id: string;
70
+ provider_name?: string | null;
71
+ /** Ambiente do snapshot exibido. */
72
+ env?: AsaasEnvironment;
73
+ /** ISO datetime de criação do provider. */
74
+ created_at?: string | null;
75
+ general?: AsaasAccountStatusValue | null;
76
+ documentation?: AsaasAccountStatusValue | null;
77
+ commercialInfo?: AsaasAccountStatusValue | null;
78
+ next_action?: AsaasOnboardingNextAction | null;
79
+ documents_fetched_at?: string | null;
80
+ has_onboarding_url: boolean;
81
+ pending_groups: INexKycQueuePendingGroup[];
82
+ commercial_info_expiration?: IAsaasCommercialInfoExpiration | null;
83
+ access_token_meta?: INexKycQueueAccessTokenSummary | null;
84
+ last_error?: { code?: string | null } | null;
85
+ }
@@ -99,9 +99,27 @@ export interface IAsaasSubaccountInput {
99
99
  /** Valores do status cadastral devolvidos pelo Asaas em GET /v3/myAccount/status. */
100
100
  export type AsaasAccountStatusValue = "APPROVED" | "AWAITING_APPROVAL" | "PENDING" | "REJECTED" | "EXPIRING_SOON" | "EXPIRED";
101
101
  /** O que originou a escrita do snapshot cadastral. */
102
- export type AsaasOnboardingSource = "manual_refresh" | "webhook" | "provider_create" | "scheduled_refresh";
102
+ export type AsaasOnboardingSource = "manual_refresh" | "webhook" | "provider_create" | "scheduled_refresh"
103
+ /** feat-275 — rebusca de documentos disparada por webhook ACCOUNT_STATUS_*. */
104
+ | "webhook_refetch"
105
+ /** feat-275 — refresh inline no gate de emissão (subconta sem snapshot). */
106
+ | "gate_refresh"
107
+ /** feat-275 — upload de documento pela nossa tela. */
108
+ | "document_upload"
109
+ /** feat-275 — atualização/confirmação dos dados comerciais pela nossa tela. */
110
+ | "commercial_info_update"
111
+ /** feat-275 — troca/registro de chave de API da subconta. */
112
+ | "key_rotation";
103
113
  /** Próxima ação que o dono da conta precisa executar para destravar a subconta. */
104
- export type AsaasOnboardingNextAction = "approved" | "rejected" | "awaiting_analysis" | "open_onboarding_link" | "send_documents_external" | "fix_commercial_info" | "pending_bank_account" | "unknown";
114
+ export type AsaasOnboardingNextAction = "approved" | "rejected" | "awaiting_analysis" | "open_onboarding_link"
115
+ /** Legado: permanece para snapshots antigos; o mapper da feat-275 deixa de emiti-lo. */
116
+ | "send_documents_external" | "fix_commercial_info" | "pending_bank_account"
117
+ /** feat-275 — grupo sem onboarding_url: upload pela nossa tela. */
118
+ | "upload_documents"
119
+ /** feat-275 — confirmação anual dos dados comerciais (EXPIRING_SOON / EXPIRED). */
120
+ | "confirm_commercial_info"
121
+ /** feat-275 — subconta recém-criada; o Asaas ainda não gerou os documentos. */
122
+ | "awaiting_link" | "unknown";
105
123
  /** Snapshot de GET /v3/myAccount/status. Sobrescrito inteiro a cada leitura/evento. */
106
124
  export interface IAsaasAccountStatusSnapshot {
107
125
  fetched_at: string;
@@ -134,6 +152,10 @@ export interface IAsaasOnboardingDocumentGroup {
134
152
  id?: string;
135
153
  status?: string;
136
154
  }>;
155
+ /** feat-275 — quando fizemos o último upload deste grupo (metadado; nunca o arquivo). */
156
+ last_upload_at?: string | null;
157
+ /** feat-275 — userId de quem fez o último upload. */
158
+ last_upload_by?: string | null;
137
159
  }
138
160
  /** Snapshot de GET /v3/myAccount/documents + próxima ação derivada. */
139
161
  export interface IAsaasOnboardingSnapshot {
@@ -142,6 +164,61 @@ export interface IAsaasOnboardingSnapshot {
142
164
  document_groups: IAsaasOnboardingDocumentGroup[];
143
165
  next_action: AsaasOnboardingNextAction;
144
166
  }
167
+ /**
168
+ * feat-275 — confirmação anual dos dados comerciais.
169
+ * Com `is_expired` o Asaas responde 403 em tudo, exceto GET/POST /myAccount/commercialInfo.
170
+ */
171
+ export interface IAsaasCommercialInfoExpiration {
172
+ is_expired: boolean;
173
+ /** YYYY-MM-DD (`additionalInfo.scheduledDate` do evento EXPIRING_SOON). */
174
+ scheduled_date?: string | null;
175
+ updated_at: string;
176
+ source: "provider_create" | "webhook" | "commercial_info_fetch" | "commercial_info_update";
177
+ }
178
+ /** feat-275 — contato de negócio do titular da subconta (LGPD: só nome, e-mail e celular). */
179
+ export interface IAsaasHolderContact {
180
+ name?: string | null;
181
+ email?: string | null;
182
+ /** E.164 normalizado. */
183
+ mobile_phone?: string | null;
184
+ source: "provider_create" | "commercial_info";
185
+ updated_at: string;
186
+ }
187
+ /** feat-275 — gatilhos de aviso de KYC ao cliente. */
188
+ export type AsaasKycNotificationTrigger = "link_available" | "link_renewed" | "rejected" | "commercial_info_expiring" | "commercial_info_expired";
189
+ /** feat-275 — estado de dedup dos avisos de KYC. */
190
+ export interface IAsaasKycNotificationState {
191
+ /** chave = `${trigger}:${scope}` (ex.: `link_available:3f9a...`); valor = quando foi publicado. */
192
+ sent?: Record<string, {
193
+ at: string;
194
+ trigger: AsaasKycNotificationTrigger;
195
+ }>;
196
+ /** sha256(url).slice(0,16) — nunca a URL. */
197
+ last_link_hash?: string | null;
198
+ }
199
+ /** feat-275 — estado da chave de API da subconta. */
200
+ export type AsaasAccessTokenStatus = "active" | "disabled" | "expired" | "deleted" | "invalid" | "unknown";
201
+ /**
202
+ * feat-275 — metadado da chave de API (nunca o valor). Alimentado por eventos ACCESS_TOKEN_*
203
+ * e pela checagem diária (`GET /myAccount/status` com a chave da subconta).
204
+ */
205
+ export interface IAsaasAccessTokenMeta {
206
+ asaas_access_token_id?: string | null;
207
+ name?: string | null;
208
+ status: AsaasAccessTokenStatus;
209
+ enabled?: boolean | null;
210
+ /** MANUAL | LACK_OF_USE */
211
+ disable_reason?: string | null;
212
+ expiration_date?: string | null;
213
+ /** A chave BaaS expira após 6 meses SEM USO; data projetada pelo Asaas. */
214
+ projected_expiration_by_lack_of_use?: string | null;
215
+ /** ACCESS_TOKEN_* */
216
+ last_event?: string | null;
217
+ last_event_at?: string | null;
218
+ rotated_at?: string | null;
219
+ /** loginId do staff. */
220
+ rotated_by?: string | null;
221
+ }
145
222
  export interface IAsaasEnvAuthConfig {
146
223
  enabled: boolean;
147
224
  base_url?: string;
@@ -152,6 +229,14 @@ export interface IAsaasEnvAuthConfig {
152
229
  account_scope?: IAsaasAccountScope;
153
230
  account_status?: IAsaasAccountStatusSnapshot;
154
231
  onboarding?: IAsaasOnboardingSnapshot;
232
+ /** feat-275 — confirmação anual dos dados comerciais. */
233
+ commercial_info_expiration?: IAsaasCommercialInfoExpiration;
234
+ /** feat-275 — contato do titular (fallback de destinatário dos avisos de KYC). */
235
+ holder_contact?: IAsaasHolderContact;
236
+ /** feat-275 — dedup dos avisos de KYC. */
237
+ kyc_notifications?: IAsaasKycNotificationState;
238
+ /** feat-275 — estado da chave de API (nunca o valor). */
239
+ access_token_meta?: IAsaasAccessTokenMeta;
155
240
  subaccount_input?: IAsaasSubaccountInput;
156
241
  operational?: {
157
242
  rate_limit_max_per_minute?: number;
@@ -145,7 +145,17 @@ export type AsaasOnboardingSource =
145
145
  | "manual_refresh"
146
146
  | "webhook"
147
147
  | "provider_create"
148
- | "scheduled_refresh";
148
+ | "scheduled_refresh"
149
+ /** feat-275 — rebusca de documentos disparada por webhook ACCOUNT_STATUS_*. */
150
+ | "webhook_refetch"
151
+ /** feat-275 — refresh inline no gate de emissão (subconta sem snapshot). */
152
+ | "gate_refresh"
153
+ /** feat-275 — upload de documento pela nossa tela. */
154
+ | "document_upload"
155
+ /** feat-275 — atualização/confirmação dos dados comerciais pela nossa tela. */
156
+ | "commercial_info_update"
157
+ /** feat-275 — troca/registro de chave de API da subconta. */
158
+ | "key_rotation";
149
159
 
150
160
  /** Próxima ação que o dono da conta precisa executar para destravar a subconta. */
151
161
  export type AsaasOnboardingNextAction =
@@ -153,9 +163,16 @@ export type AsaasOnboardingNextAction =
153
163
  | "rejected"
154
164
  | "awaiting_analysis"
155
165
  | "open_onboarding_link"
166
+ /** Legado: permanece para snapshots antigos; o mapper da feat-275 deixa de emiti-lo. */
156
167
  | "send_documents_external"
157
168
  | "fix_commercial_info"
158
169
  | "pending_bank_account"
170
+ /** feat-275 — grupo sem onboarding_url: upload pela nossa tela. */
171
+ | "upload_documents"
172
+ /** feat-275 — confirmação anual dos dados comerciais (EXPIRING_SOON / EXPIRED). */
173
+ | "confirm_commercial_info"
174
+ /** feat-275 — subconta recém-criada; o Asaas ainda não gerou os documentos. */
175
+ | "awaiting_link"
159
176
  | "unknown";
160
177
 
161
178
  /** Snapshot de GET /v3/myAccount/status. Sobrescrito inteiro a cada leitura/evento. */
@@ -185,6 +202,10 @@ export interface IAsaasOnboardingDocumentGroup {
185
202
  onboarding_url?: string | null;
186
203
  responsible?: { name?: string | null; type?: string | null };
187
204
  documents?: Array<{ id?: string; status?: string }>;
205
+ /** feat-275 — quando fizemos o último upload deste grupo (metadado; nunca o arquivo). */
206
+ last_upload_at?: string | null;
207
+ /** feat-275 — userId de quem fez o último upload. */
208
+ last_upload_by?: string | null;
188
209
  }
189
210
 
190
211
  /** Snapshot de GET /v3/myAccount/documents + próxima ação derivada. */
@@ -195,6 +216,79 @@ export interface IAsaasOnboardingSnapshot {
195
216
  next_action: AsaasOnboardingNextAction;
196
217
  }
197
218
 
219
+ /**
220
+ * feat-275 — confirmação anual dos dados comerciais.
221
+ * Com `is_expired` o Asaas responde 403 em tudo, exceto GET/POST /myAccount/commercialInfo.
222
+ */
223
+ export interface IAsaasCommercialInfoExpiration {
224
+ is_expired: boolean;
225
+ /** YYYY-MM-DD (`additionalInfo.scheduledDate` do evento EXPIRING_SOON). */
226
+ scheduled_date?: string | null;
227
+ updated_at: string;
228
+ source:
229
+ | "provider_create"
230
+ | "webhook"
231
+ | "commercial_info_fetch"
232
+ | "commercial_info_update";
233
+ }
234
+
235
+ /** feat-275 — contato de negócio do titular da subconta (LGPD: só nome, e-mail e celular). */
236
+ export interface IAsaasHolderContact {
237
+ name?: string | null;
238
+ email?: string | null;
239
+ /** E.164 normalizado. */
240
+ mobile_phone?: string | null;
241
+ source: "provider_create" | "commercial_info";
242
+ updated_at: string;
243
+ }
244
+
245
+ /** feat-275 — gatilhos de aviso de KYC ao cliente. */
246
+ export type AsaasKycNotificationTrigger =
247
+ | "link_available"
248
+ | "link_renewed"
249
+ | "rejected"
250
+ | "commercial_info_expiring"
251
+ | "commercial_info_expired";
252
+
253
+ /** feat-275 — estado de dedup dos avisos de KYC. */
254
+ export interface IAsaasKycNotificationState {
255
+ /** chave = `${trigger}:${scope}` (ex.: `link_available:3f9a...`); valor = quando foi publicado. */
256
+ sent?: Record<string, { at: string; trigger: AsaasKycNotificationTrigger }>;
257
+ /** sha256(url).slice(0,16) — nunca a URL. */
258
+ last_link_hash?: string | null;
259
+ }
260
+
261
+ /** feat-275 — estado da chave de API da subconta. */
262
+ export type AsaasAccessTokenStatus =
263
+ | "active"
264
+ | "disabled"
265
+ | "expired"
266
+ | "deleted"
267
+ | "invalid"
268
+ | "unknown";
269
+
270
+ /**
271
+ * feat-275 — metadado da chave de API (nunca o valor). Alimentado por eventos ACCESS_TOKEN_*
272
+ * e pela checagem diária (`GET /myAccount/status` com a chave da subconta).
273
+ */
274
+ export interface IAsaasAccessTokenMeta {
275
+ asaas_access_token_id?: string | null;
276
+ name?: string | null;
277
+ status: AsaasAccessTokenStatus;
278
+ enabled?: boolean | null;
279
+ /** MANUAL | LACK_OF_USE */
280
+ disable_reason?: string | null;
281
+ expiration_date?: string | null;
282
+ /** A chave BaaS expira após 6 meses SEM USO; data projetada pelo Asaas. */
283
+ projected_expiration_by_lack_of_use?: string | null;
284
+ /** ACCESS_TOKEN_* */
285
+ last_event?: string | null;
286
+ last_event_at?: string | null;
287
+ rotated_at?: string | null;
288
+ /** loginId do staff. */
289
+ rotated_by?: string | null;
290
+ }
291
+
198
292
  export interface IAsaasEnvAuthConfig {
199
293
  enabled: boolean;
200
294
 
@@ -218,6 +312,18 @@ export interface IAsaasEnvAuthConfig {
218
312
  // Documentos pendentes e próxima ação de ativação.
219
313
  onboarding?: IAsaasOnboardingSnapshot;
220
314
 
315
+ /** feat-275 — confirmação anual dos dados comerciais. */
316
+ commercial_info_expiration?: IAsaasCommercialInfoExpiration;
317
+
318
+ /** feat-275 — contato do titular (fallback de destinatário dos avisos de KYC). */
319
+ holder_contact?: IAsaasHolderContact;
320
+
321
+ /** feat-275 — dedup dos avisos de KYC. */
322
+ kyc_notifications?: IAsaasKycNotificationState;
323
+
324
+ /** feat-275 — estado da chave de API (nunca o valor). */
325
+ access_token_meta?: IAsaasAccessTokenMeta;
326
+
221
327
  // Input data used only when creating subaccounts (not persisted).
222
328
  subaccount_input?: IAsaasSubaccountInput;
223
329
 
@@ -137,6 +137,25 @@ export interface INotificationAttachment {
137
137
  /** Conteúdo em base64. <= 64 KB já codificado. */
138
138
  content_base64: string;
139
139
  }
140
+ /** Campos compartilhados pelo conteúdo de email novo e de resposta. */
141
+ interface INotificationEmailContentBase {
142
+ /** Versões textuais do corpo livre. */
143
+ body_text?: string;
144
+ body_html?: string;
145
+ /** Identificador interno da conversa Hub-Omni. */
146
+ thread_id?: string;
147
+ }
148
+ /** Conteúdo de email humano. Replies podem reutilizar o assunto persistido. */
149
+ export type INotificationEmailContent = (INotificationEmailContentBase & {
150
+ /** Obrigatório ao iniciar uma conversa. */
151
+ subject: string;
152
+ reply_to_message_id?: never;
153
+ }) | (INotificationEmailContentBase & {
154
+ /** Opcional na resposta: o backend reutiliza o assunto da conversa. */
155
+ subject?: string;
156
+ /** ID interno Hub-Omni da mensagem respondida; headers derivam no backend. */
157
+ reply_to_message_id: string;
158
+ });
140
159
  export interface INotificationSendPayload {
141
160
  kind: "notification.send";
142
161
  classification?: string;
@@ -145,6 +164,8 @@ export interface INotificationSendPayload {
145
164
  channel: INotificationChannelRef;
146
165
  template?: INotificationTemplateRef;
147
166
  variables?: Record<string, unknown>;
167
+ /** Dados de email livre. Para payloads humanos, subject é obrigatório. */
168
+ email?: INotificationEmailContent;
148
169
  /**
149
170
  * WhatsApp (sessão): texto livre enviado via Hermes `type: text` (sem HSM).
150
171
  * Mutuamente exclusivo com `template.template_id` para `channel.type === 'whatsapp'`.
@@ -195,6 +216,8 @@ export interface INotificationMessage extends IFireDoc {
195
216
  template?: INotificationTemplateRef;
196
217
  /** Snapshot quando o envio foi texto de sessão WhatsApp (sem template). */
197
218
  body_text?: string;
219
+ /** Snapshot do assunto/HTML/threading de envios humanos por email. */
220
+ email?: INotificationEmailContent;
198
221
  recipient: INotificationRecipient;
199
222
  variables?: Record<string, unknown>;
200
223
  status: NotificationMessageStatus;
@@ -246,6 +269,8 @@ export interface IEmailSmtpConfig {
246
269
  * Formato: 'projects/{projectId}/secrets/{secretId}/versions/latest'
247
270
  */
248
271
  password_secret_ref: string;
272
+ /** Limite opcional do total de anexos por mensagem, em bytes. */
273
+ max_attachment_total_bytes?: number;
249
274
  }
250
275
  /**
251
276
  * Provider de transporte do canal de email.
@@ -222,6 +222,29 @@ export interface INotificationAttachment {
222
222
  content_base64: string;
223
223
  }
224
224
 
225
+ /** Campos compartilhados pelo conteúdo de email novo e de resposta. */
226
+ interface INotificationEmailContentBase {
227
+ /** Versões textuais do corpo livre. */
228
+ body_text?: string;
229
+ body_html?: string;
230
+ /** Identificador interno da conversa Hub-Omni. */
231
+ thread_id?: string;
232
+ }
233
+
234
+ /** Conteúdo de email humano. Replies podem reutilizar o assunto persistido. */
235
+ export type INotificationEmailContent =
236
+ | (INotificationEmailContentBase & {
237
+ /** Obrigatório ao iniciar uma conversa. */
238
+ subject: string;
239
+ reply_to_message_id?: never;
240
+ })
241
+ | (INotificationEmailContentBase & {
242
+ /** Opcional na resposta: o backend reutiliza o assunto da conversa. */
243
+ subject?: string;
244
+ /** ID interno Hub-Omni da mensagem respondida; headers derivam no backend. */
245
+ reply_to_message_id: string;
246
+ });
247
+
225
248
  export interface INotificationSendPayload {
226
249
  kind: "notification.send";
227
250
 
@@ -237,6 +260,9 @@ export interface INotificationSendPayload {
237
260
  template?: INotificationTemplateRef;
238
261
  variables?: Record<string, unknown>; // resolved upstream (Automation Hub / Task Runner)
239
262
 
263
+ /** Dados de email livre. Para payloads humanos, subject é obrigatório. */
264
+ email?: INotificationEmailContent;
265
+
240
266
  /**
241
267
  * WhatsApp (sessão): texto livre enviado via Hermes `type: text` (sem HSM).
242
268
  * Mutuamente exclusivo com `template.template_id` para `channel.type === 'whatsapp'`.
@@ -313,6 +339,8 @@ export interface INotificationMessage extends IFireDoc {
313
339
  template?: INotificationTemplateRef;
314
340
  /** Snapshot quando o envio foi texto de sessão WhatsApp (sem template). */
315
341
  body_text?: string;
342
+ /** Snapshot do assunto/HTML/threading de envios humanos por email. */
343
+ email?: INotificationEmailContent;
316
344
 
317
345
  // Recipient snapshot
318
346
  recipient: INotificationRecipient;
@@ -394,6 +422,8 @@ export interface IEmailSmtpConfig {
394
422
  * Formato: 'projects/{projectId}/secrets/{secretId}/versions/latest'
395
423
  */
396
424
  password_secret_ref: string;
425
+ /** Limite opcional do total de anexos por mensagem, em bytes. */
426
+ max_attachment_total_bytes?: number;
397
427
  }
398
428
 
399
429
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "evo360-types",
3
- "version": "1.3.697",
3
+ "version": "1.3.703",
4
4
  "description": "HREVO360 Shared Types",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",