evo360-types 1.3.578 → 1.3.581

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.
Files changed (33) hide show
  1. package/dist/apps/evo-chat/channel/zod-schemas.d.ts +273 -0
  2. package/dist/apps/evo-chat/channel/zod-schemas.js +17 -1
  3. package/dist/apps/evo-chat/channel/zod-schemas.ts +19 -0
  4. package/dist/apps/evo-chat/thread-message/zod-schemas.d.ts +24 -0
  5. package/dist/apps/evo-chat/thread-message/zod-schemas.js +2 -0
  6. package/dist/apps/evo-chat/thread-message/zod-schemas.ts +2 -0
  7. package/dist/apps/evo-chat/waba-template/zod-schemas.d.ts +6 -0
  8. package/dist/apps/evo-chat/waba-template/zod-schemas.js +2 -0
  9. package/dist/apps/evo-chat/waba-template/zod-schemas.ts +2 -0
  10. package/dist/apps/evo-med/calendar/zod-schemas.d.ts +3996 -1572
  11. package/dist/apps/evo-med/calendar/zod-schemas.js +9 -0
  12. package/dist/apps/evo-med/calendar/zod-schemas.ts +9 -0
  13. package/dist/apps/evo-notifications/zod-schemas.d.ts +110 -0
  14. package/dist/apps/evo-notifications/zod-schemas.js +8 -1
  15. package/dist/apps/evo-notifications/zod-schemas.ts +9 -0
  16. package/dist/apps/evo-telemedicine/zod-schemas.d.ts +30 -4
  17. package/dist/apps/evo-telemedicine/zod-schemas.js +25 -2
  18. package/dist/apps/evo-telemedicine/zod-schemas.ts +25 -0
  19. package/dist/types/evo-chat/channel/index.d.ts +19 -0
  20. package/dist/types/evo-chat/channel/index.ts +24 -0
  21. package/dist/types/evo-chat/thread-message/index.d.ts +4 -0
  22. package/dist/types/evo-chat/thread-message/index.ts +4 -0
  23. package/dist/types/evo-chat/waba-template/index.d.ts +6 -0
  24. package/dist/types/evo-chat/waba-template/index.js +3 -1
  25. package/dist/types/evo-chat/waba-template/index.ts +7 -0
  26. package/dist/types/evo-med/calendar/index.d.ts +26 -1
  27. package/dist/types/evo-med/calendar/index.ts +27 -1
  28. package/dist/types/evo-notifications/index.d.ts +11 -0
  29. package/dist/types/evo-notifications/index.ts +13 -0
  30. package/dist/types/evo-telemedicine/index.d.ts +168 -0
  31. package/dist/types/evo-telemedicine/index.js +43 -1
  32. package/dist/types/evo-telemedicine/index.ts +196 -1
  33. package/package.json +1 -1
@@ -56,6 +56,7 @@ const zNotificationChannelEntrySchema = zod_1.z
56
56
  department_id: zod_1.z.string().min(1).max(60).nullable().optional(),
57
57
  template_id: zod_1.z.string().min(1).max(120).nullable().optional(),
58
58
  template_type: zod_1.z.string().min(1).max(40).nullable().optional(),
59
+ direct_send_text: zod_1.z.string().max(1024).nullable().optional(),
59
60
  ctas: zod_1.z.array(zNotificationCtaSchema).nullable().optional(),
60
61
  })
61
62
  .passthrough();
@@ -83,6 +84,14 @@ exports.zMedCalendarNotificationConfigSchema = zod_1.z
83
84
  .record(zod_1.z.string(), zNotificationEntrySchema)
84
85
  .nullable()
85
86
  .optional(),
87
+ // feat-160 (§10.2): override por MODALIDADE. Mesma forma, mesmo `| null` do
88
+ // bloco `configs` (o editor grava null no "não escolhido") — a herança
89
+ // (chave ausente ⇒ cai em `configs`) é semântica do LEITOR, não do schema:
90
+ // um `.default({})` aqui apagaria a diferença entre "herdar" e "vazio".
91
+ telemedicine_configs: zod_1.z
92
+ .record(zod_1.z.string(), zNotificationEntrySchema)
93
+ .nullable()
94
+ .optional(),
86
95
  })
87
96
  .passthrough();
88
97
  // ----- Virtual Care (feat-160 F16) — espelho de `IMedCalendarVirtualCareConfig`.
@@ -57,6 +57,7 @@ const zNotificationChannelEntrySchema = z
57
57
  department_id: z.string().min(1).max(60).nullable().optional(),
58
58
  template_id: z.string().min(1).max(120).nullable().optional(),
59
59
  template_type: z.string().min(1).max(40).nullable().optional(),
60
+ direct_send_text: z.string().max(1024).nullable().optional(),
60
61
  ctas: z.array(zNotificationCtaSchema).nullable().optional(),
61
62
  })
62
63
  .passthrough();
@@ -86,6 +87,14 @@ export const zMedCalendarNotificationConfigSchema = z
86
87
  .record(z.string(), zNotificationEntrySchema)
87
88
  .nullable()
88
89
  .optional(),
90
+ // feat-160 (§10.2): override por MODALIDADE. Mesma forma, mesmo `| null` do
91
+ // bloco `configs` (o editor grava null no "não escolhido") — a herança
92
+ // (chave ausente ⇒ cai em `configs`) é semântica do LEITOR, não do schema:
93
+ // um `.default({})` aqui apagaria a diferença entre "herdar" e "vazio".
94
+ telemedicine_configs: z
95
+ .record(z.string(), zNotificationEntrySchema)
96
+ .nullable()
97
+ .optional(),
89
98
  })
90
99
  .passthrough();
91
100
 
@@ -624,6 +624,16 @@ export declare const zNotificationLogSchema: z.ZodObject<{
624
624
  data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
625
625
  at: z.ZodDate;
626
626
  }, z.ZodTypeAny, "passthrough">>;
627
+ export declare const zNotificationDirectSendSchema: z.ZodObject<{
628
+ category: z.ZodLiteral<"utility">;
629
+ ttl_seconds: z.ZodOptional<z.ZodNumber>;
630
+ }, "strip", z.ZodTypeAny, {
631
+ category: "utility";
632
+ ttl_seconds?: number | undefined;
633
+ }, {
634
+ category: "utility";
635
+ ttl_seconds?: number | undefined;
636
+ }>;
627
637
  export declare const zDirectSendPayloadSchema: z.ZodEffects<z.ZodObject<{
628
638
  tenant: z.ZodString;
629
639
  kind: z.ZodLiteral<"notification.send">;
@@ -676,6 +686,16 @@ export declare const zDirectSendPayloadSchema: z.ZodEffects<z.ZodObject<{
676
686
  }, z.ZodTypeAny, "passthrough">>>;
677
687
  /** WhatsApp session text (no HSM). Max length per Meta. */
678
688
  body_text: z.ZodOptional<z.ZodString>;
689
+ direct_send: z.ZodOptional<z.ZodObject<{
690
+ category: z.ZodLiteral<"utility">;
691
+ ttl_seconds: z.ZodOptional<z.ZodNumber>;
692
+ }, "strip", z.ZodTypeAny, {
693
+ category: "utility";
694
+ ttl_seconds?: number | undefined;
695
+ }, {
696
+ category: "utility";
697
+ ttl_seconds?: number | undefined;
698
+ }>>;
679
699
  variables: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
680
700
  routine: z.ZodOptional<z.ZodObject<{
681
701
  id: z.ZodString;
@@ -784,6 +804,16 @@ export declare const zDirectSendPayloadSchema: z.ZodEffects<z.ZodObject<{
784
804
  }, z.ZodTypeAny, "passthrough">>>;
785
805
  /** WhatsApp session text (no HSM). Max length per Meta. */
786
806
  body_text: z.ZodOptional<z.ZodString>;
807
+ direct_send: z.ZodOptional<z.ZodObject<{
808
+ category: z.ZodLiteral<"utility">;
809
+ ttl_seconds: z.ZodOptional<z.ZodNumber>;
810
+ }, "strip", z.ZodTypeAny, {
811
+ category: "utility";
812
+ ttl_seconds?: number | undefined;
813
+ }, {
814
+ category: "utility";
815
+ ttl_seconds?: number | undefined;
816
+ }>>;
787
817
  variables: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
788
818
  routine: z.ZodOptional<z.ZodObject<{
789
819
  id: z.ZodString;
@@ -892,6 +922,16 @@ export declare const zDirectSendPayloadSchema: z.ZodEffects<z.ZodObject<{
892
922
  }, z.ZodTypeAny, "passthrough">>>;
893
923
  /** WhatsApp session text (no HSM). Max length per Meta. */
894
924
  body_text: z.ZodOptional<z.ZodString>;
925
+ direct_send: z.ZodOptional<z.ZodObject<{
926
+ category: z.ZodLiteral<"utility">;
927
+ ttl_seconds: z.ZodOptional<z.ZodNumber>;
928
+ }, "strip", z.ZodTypeAny, {
929
+ category: "utility";
930
+ ttl_seconds?: number | undefined;
931
+ }, {
932
+ category: "utility";
933
+ ttl_seconds?: number | undefined;
934
+ }>>;
895
935
  variables: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
896
936
  routine: z.ZodOptional<z.ZodObject<{
897
937
  id: z.ZodString;
@@ -1000,6 +1040,16 @@ export declare const zDirectSendPayloadSchema: z.ZodEffects<z.ZodObject<{
1000
1040
  }, z.ZodTypeAny, "passthrough">>>;
1001
1041
  /** WhatsApp session text (no HSM). Max length per Meta. */
1002
1042
  body_text: z.ZodOptional<z.ZodString>;
1043
+ direct_send: z.ZodOptional<z.ZodObject<{
1044
+ category: z.ZodLiteral<"utility">;
1045
+ ttl_seconds: z.ZodOptional<z.ZodNumber>;
1046
+ }, "strip", z.ZodTypeAny, {
1047
+ category: "utility";
1048
+ ttl_seconds?: number | undefined;
1049
+ }, {
1050
+ category: "utility";
1051
+ ttl_seconds?: number | undefined;
1052
+ }>>;
1003
1053
  variables: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1004
1054
  routine: z.ZodOptional<z.ZodObject<{
1005
1055
  id: z.ZodString;
@@ -1108,6 +1158,16 @@ export declare const zDirectSendPayloadSchema: z.ZodEffects<z.ZodObject<{
1108
1158
  }, z.ZodTypeAny, "passthrough">>>;
1109
1159
  /** WhatsApp session text (no HSM). Max length per Meta. */
1110
1160
  body_text: z.ZodOptional<z.ZodString>;
1161
+ direct_send: z.ZodOptional<z.ZodObject<{
1162
+ category: z.ZodLiteral<"utility">;
1163
+ ttl_seconds: z.ZodOptional<z.ZodNumber>;
1164
+ }, "strip", z.ZodTypeAny, {
1165
+ category: "utility";
1166
+ ttl_seconds?: number | undefined;
1167
+ }, {
1168
+ category: "utility";
1169
+ ttl_seconds?: number | undefined;
1170
+ }>>;
1111
1171
  variables: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1112
1172
  routine: z.ZodOptional<z.ZodObject<{
1113
1173
  id: z.ZodString;
@@ -1215,6 +1275,16 @@ export declare const zNexusDirectSendPayloadSchema: z.ZodEffects<z.ZodObject<{
1215
1275
  version: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
1216
1276
  }, z.ZodTypeAny, "passthrough">>>;
1217
1277
  body_text: z.ZodOptional<z.ZodString>;
1278
+ direct_send: z.ZodOptional<z.ZodObject<{
1279
+ category: z.ZodLiteral<"utility">;
1280
+ ttl_seconds: z.ZodOptional<z.ZodNumber>;
1281
+ }, "strip", z.ZodTypeAny, {
1282
+ category: "utility";
1283
+ ttl_seconds?: number | undefined;
1284
+ }, {
1285
+ category: "utility";
1286
+ ttl_seconds?: number | undefined;
1287
+ }>>;
1218
1288
  variables: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1219
1289
  routine: z.ZodOptional<z.ZodObject<{
1220
1290
  id: z.ZodString;
@@ -1321,6 +1391,16 @@ export declare const zNexusDirectSendPayloadSchema: z.ZodEffects<z.ZodObject<{
1321
1391
  version: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
1322
1392
  }, z.ZodTypeAny, "passthrough">>>;
1323
1393
  body_text: z.ZodOptional<z.ZodString>;
1394
+ direct_send: z.ZodOptional<z.ZodObject<{
1395
+ category: z.ZodLiteral<"utility">;
1396
+ ttl_seconds: z.ZodOptional<z.ZodNumber>;
1397
+ }, "strip", z.ZodTypeAny, {
1398
+ category: "utility";
1399
+ ttl_seconds?: number | undefined;
1400
+ }, {
1401
+ category: "utility";
1402
+ ttl_seconds?: number | undefined;
1403
+ }>>;
1324
1404
  variables: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1325
1405
  routine: z.ZodOptional<z.ZodObject<{
1326
1406
  id: z.ZodString;
@@ -1427,6 +1507,16 @@ export declare const zNexusDirectSendPayloadSchema: z.ZodEffects<z.ZodObject<{
1427
1507
  version: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
1428
1508
  }, z.ZodTypeAny, "passthrough">>>;
1429
1509
  body_text: z.ZodOptional<z.ZodString>;
1510
+ direct_send: z.ZodOptional<z.ZodObject<{
1511
+ category: z.ZodLiteral<"utility">;
1512
+ ttl_seconds: z.ZodOptional<z.ZodNumber>;
1513
+ }, "strip", z.ZodTypeAny, {
1514
+ category: "utility";
1515
+ ttl_seconds?: number | undefined;
1516
+ }, {
1517
+ category: "utility";
1518
+ ttl_seconds?: number | undefined;
1519
+ }>>;
1430
1520
  variables: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1431
1521
  routine: z.ZodOptional<z.ZodObject<{
1432
1522
  id: z.ZodString;
@@ -1533,6 +1623,16 @@ export declare const zNexusDirectSendPayloadSchema: z.ZodEffects<z.ZodObject<{
1533
1623
  version: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
1534
1624
  }, z.ZodTypeAny, "passthrough">>>;
1535
1625
  body_text: z.ZodOptional<z.ZodString>;
1626
+ direct_send: z.ZodOptional<z.ZodObject<{
1627
+ category: z.ZodLiteral<"utility">;
1628
+ ttl_seconds: z.ZodOptional<z.ZodNumber>;
1629
+ }, "strip", z.ZodTypeAny, {
1630
+ category: "utility";
1631
+ ttl_seconds?: number | undefined;
1632
+ }, {
1633
+ category: "utility";
1634
+ ttl_seconds?: number | undefined;
1635
+ }>>;
1536
1636
  variables: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1537
1637
  routine: z.ZodOptional<z.ZodObject<{
1538
1638
  id: z.ZodString;
@@ -1639,6 +1739,16 @@ export declare const zNexusDirectSendPayloadSchema: z.ZodEffects<z.ZodObject<{
1639
1739
  version: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
1640
1740
  }, z.ZodTypeAny, "passthrough">>>;
1641
1741
  body_text: z.ZodOptional<z.ZodString>;
1742
+ direct_send: z.ZodOptional<z.ZodObject<{
1743
+ category: z.ZodLiteral<"utility">;
1744
+ ttl_seconds: z.ZodOptional<z.ZodNumber>;
1745
+ }, "strip", z.ZodTypeAny, {
1746
+ category: "utility";
1747
+ ttl_seconds?: number | undefined;
1748
+ }, {
1749
+ category: "utility";
1750
+ ttl_seconds?: number | undefined;
1751
+ }>>;
1642
1752
  variables: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1643
1753
  routine: z.ZodOptional<z.ZodObject<{
1644
1754
  id: z.ZodString;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.zNexusDirectSendPayloadSchema = exports.zDirectSendPayloadSchema = 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.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;
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");
@@ -132,6 +132,11 @@ exports.zNotificationLogSchema = zod_schemas_1.zFireDocSchema
132
132
  at: zod_1.z.coerce.date(),
133
133
  })
134
134
  .passthrough();
135
+ // ---- feat-165: Meta Direct Send intent (INotificationDirectSend) ----
136
+ exports.zNotificationDirectSendSchema = zod_1.z.object({
137
+ category: zod_1.z.literal("utility"),
138
+ ttl_seconds: zod_1.z.number().int().min(30).max(43200).optional(),
139
+ });
135
140
  // ---- HTTP direct send (INotificationSendPayload + tenant + externalLinks) ----
136
141
  exports.zDirectSendPayloadSchema = zod_1.z
137
142
  .object({
@@ -144,6 +149,7 @@ exports.zDirectSendPayloadSchema = zod_1.z
144
149
  template: exports.zNotificationTemplateRefSchema.optional(),
145
150
  /** WhatsApp session text (no HSM). Max length per Meta. */
146
151
  body_text: zod_1.z.string().max(4096).optional(),
152
+ direct_send: exports.zNotificationDirectSendSchema.optional(),
147
153
  variables: zod_1.z.record(zod_1.z.unknown()).optional(),
148
154
  routine: zod_1.z
149
155
  .object({
@@ -198,6 +204,7 @@ exports.zNexusDirectSendPayloadSchema = zod_1.z
198
204
  channel: exports.zNotificationChannelRefSchema,
199
205
  template: exports.zNotificationTemplateRefSchema.optional(),
200
206
  body_text: zod_1.z.string().max(4096).optional(),
207
+ direct_send: exports.zNotificationDirectSendSchema.optional(),
201
208
  variables: zod_1.z.record(zod_1.z.unknown()).optional(),
202
209
  routine: zod_1.z
203
210
  .object({
@@ -146,6 +146,13 @@ export const zNotificationLogSchema = zFireDocSchema
146
146
  })
147
147
  .passthrough();
148
148
 
149
+ // ---- feat-165: Meta Direct Send intent (INotificationDirectSend) ----
150
+
151
+ export const zNotificationDirectSendSchema = z.object({
152
+ category: z.literal("utility"),
153
+ ttl_seconds: z.number().int().min(30).max(43200).optional(),
154
+ });
155
+
149
156
  // ---- HTTP direct send (INotificationSendPayload + tenant + externalLinks) ----
150
157
 
151
158
  export const zDirectSendPayloadSchema = z
@@ -159,6 +166,7 @@ export const zDirectSendPayloadSchema = z
159
166
  template: zNotificationTemplateRefSchema.optional(),
160
167
  /** WhatsApp session text (no HSM). Max length per Meta. */
161
168
  body_text: z.string().max(4096).optional(),
169
+ direct_send: zNotificationDirectSendSchema.optional(),
162
170
  variables: z.record(z.unknown()).optional(),
163
171
  routine: z
164
172
  .object({
@@ -219,6 +227,7 @@ export const zNexusDirectSendPayloadSchema = z
219
227
  channel: zNotificationChannelRefSchema,
220
228
  template: zNotificationTemplateRefSchema.optional(),
221
229
  body_text: z.string().max(4096).optional(),
230
+ direct_send: zNotificationDirectSendSchema.optional(),
222
231
  variables: z.record(z.unknown()).optional(),
223
232
  routine: z
224
233
  .object({
@@ -27,6 +27,8 @@ export declare const zConsentDecisionSchema: z.ZodEnum<["accepted", "declined",
27
27
  export declare const zConsentActorTypeSchema: z.ZodEnum<["patient", "doctor"]>;
28
28
  /** Espelha `ArtifactTypeEnum`. */
29
29
  export declare const zArtifactTypeSchema: z.ZodEnum<["recording_audio_video", "recording_audio", "transcript"]>;
30
+ /** Espelha `ArtifactDispositionEnum` (feat-160 F21). */
31
+ export declare const zArtifactDispositionSchema: z.ZodEnum<["inline", "attachment"]>;
30
32
  /** Espelha `ArtifactStatusEnum`. */
31
33
  export declare const zArtifactStatusSchema: z.ZodEnum<["pending", "processing", "ready", "failed", "deleting", "deleted"]>;
32
34
  /** Espelha `AccessGrantKindEnum`. */
@@ -42,7 +44,7 @@ export declare const zTeleconsultationEventActorTypeSchema: z.ZodEnum<["user", "
42
44
  /** Espelha `TeleconsultationEventSourceEnum`. */
43
45
  export declare const zTeleconsultationEventSourceSchema: z.ZodEnum<["api", "webhook", "appointment_reconciler", "retention_job", "sweep"]>;
44
46
  /** Espelha `TeleconsultationEventTypeEnum`. ADITIVO: eventos já gravados dependem desta lista. */
45
- export declare const zTeleconsultationEventTypeSchema: z.ZodEnum<["teleconsultation.created", "teleconsultation.rescheduled", "teleconsultation.cancelled", "teleconsultation.expired", "teleconsultation.diverged", "access.created", "access.link_revealed", "access.revoked", "access.exchanged", "access.verification_failed", "access.blocked", "host.claimed", "host.reassigned", "waiting_policy.changed", "doctor.prepared", "doctor.joined", "doctor.disconnected", "doctor.rejoined", "doctor.left", "patient.verified", "patient.waiting", "patient.admitted", "patient.rejected", "patient.joined", "patient.disconnected", "patient.rejoined", "patient.left", "recording.consent_requested", "recording.consent_accepted", "recording.consent_declined", "recording.consent_withdrawn", "recording.started", "recording.stopped", "recording.failed", "transcription.queued", "transcription.ready", "transcription.failed", "transcription.deleted", "consultation.started", "consultation.reconnecting", "consultation.ended", "artifact.accessed", "artifact.deleted", "entitlement.denied", "rollout.denied", "permission.denied", "webhook.observed"]>;
47
+ export declare const zTeleconsultationEventTypeSchema: z.ZodEnum<["teleconsultation.created", "teleconsultation.rescheduled", "teleconsultation.cancelled", "teleconsultation.expired", "teleconsultation.diverged", "access.created", "access.link_revealed", "access.revoked", "access.exchanged", "access.verification_failed", "access.blocked", "host.claimed", "host.reassigned", "waiting_policy.changed", "doctor.prepared", "doctor.joined", "doctor.disconnected", "doctor.rejoined", "doctor.left", "patient.verified", "patient.waiting", "patient.admitted", "patient.rejected", "patient.joined", "patient.disconnected", "patient.rejoined", "patient.left", "recording.consent_requested", "recording.consent_accepted", "recording.consent_declined", "recording.consent_declined_pre_join", "recording.consent_withdrawn", "recording.started", "recording.auto_started", "recording.stopped", "recording.failed", "transcription.queued", "transcription.ready", "transcription.failed", "transcription.deleted", "consultation.started", "consultation.reconnecting", "consultation.ended", "teleconsultation.usage_skipped", "artifact.accessed", "artifact.deleted", "entitlement.denied", "rollout.denied", "permission.denied", "webhook.observed"]>;
46
48
  /** Espelha `WebhookEventStatusEnum`. */
47
49
  export declare const zWebhookEventStatusSchema: z.ZodEnum<["pending", "claimed", "completed", "failed"]>;
48
50
  /** Espelha `LegalTextStatusEnum`. */
@@ -601,7 +603,7 @@ export declare const zTeleconsultationEventSchema: z.ZodObject<{
601
603
  deleted_at: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
602
604
  } & {
603
605
  teleconsultation_id: z.ZodString;
604
- type: z.ZodEnum<["teleconsultation.created", "teleconsultation.rescheduled", "teleconsultation.cancelled", "teleconsultation.expired", "teleconsultation.diverged", "access.created", "access.link_revealed", "access.revoked", "access.exchanged", "access.verification_failed", "access.blocked", "host.claimed", "host.reassigned", "waiting_policy.changed", "doctor.prepared", "doctor.joined", "doctor.disconnected", "doctor.rejoined", "doctor.left", "patient.verified", "patient.waiting", "patient.admitted", "patient.rejected", "patient.joined", "patient.disconnected", "patient.rejoined", "patient.left", "recording.consent_requested", "recording.consent_accepted", "recording.consent_declined", "recording.consent_withdrawn", "recording.started", "recording.stopped", "recording.failed", "transcription.queued", "transcription.ready", "transcription.failed", "transcription.deleted", "consultation.started", "consultation.reconnecting", "consultation.ended", "artifact.accessed", "artifact.deleted", "entitlement.denied", "rollout.denied", "permission.denied", "webhook.observed"]>;
606
+ type: z.ZodEnum<["teleconsultation.created", "teleconsultation.rescheduled", "teleconsultation.cancelled", "teleconsultation.expired", "teleconsultation.diverged", "access.created", "access.link_revealed", "access.revoked", "access.exchanged", "access.verification_failed", "access.blocked", "host.claimed", "host.reassigned", "waiting_policy.changed", "doctor.prepared", "doctor.joined", "doctor.disconnected", "doctor.rejoined", "doctor.left", "patient.verified", "patient.waiting", "patient.admitted", "patient.rejected", "patient.joined", "patient.disconnected", "patient.rejoined", "patient.left", "recording.consent_requested", "recording.consent_accepted", "recording.consent_declined", "recording.consent_declined_pre_join", "recording.consent_withdrawn", "recording.started", "recording.auto_started", "recording.stopped", "recording.failed", "transcription.queued", "transcription.ready", "transcription.failed", "transcription.deleted", "consultation.started", "consultation.reconnecting", "consultation.ended", "teleconsultation.usage_skipped", "artifact.accessed", "artifact.deleted", "entitlement.denied", "rollout.denied", "permission.denied", "webhook.observed"]>;
605
607
  occurred_at: z.ZodEffects<z.ZodDate, Date, unknown>;
606
608
  actor: z.ZodObject<{
607
609
  type: z.ZodEnum<["user", "patient", "system", "provider"]>;
@@ -630,7 +632,7 @@ export declare const zTeleconsultationEventSchema: z.ZodObject<{
630
632
  deleted_at: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
631
633
  } & {
632
634
  teleconsultation_id: z.ZodString;
633
- type: z.ZodEnum<["teleconsultation.created", "teleconsultation.rescheduled", "teleconsultation.cancelled", "teleconsultation.expired", "teleconsultation.diverged", "access.created", "access.link_revealed", "access.revoked", "access.exchanged", "access.verification_failed", "access.blocked", "host.claimed", "host.reassigned", "waiting_policy.changed", "doctor.prepared", "doctor.joined", "doctor.disconnected", "doctor.rejoined", "doctor.left", "patient.verified", "patient.waiting", "patient.admitted", "patient.rejected", "patient.joined", "patient.disconnected", "patient.rejoined", "patient.left", "recording.consent_requested", "recording.consent_accepted", "recording.consent_declined", "recording.consent_withdrawn", "recording.started", "recording.stopped", "recording.failed", "transcription.queued", "transcription.ready", "transcription.failed", "transcription.deleted", "consultation.started", "consultation.reconnecting", "consultation.ended", "artifact.accessed", "artifact.deleted", "entitlement.denied", "rollout.denied", "permission.denied", "webhook.observed"]>;
635
+ type: z.ZodEnum<["teleconsultation.created", "teleconsultation.rescheduled", "teleconsultation.cancelled", "teleconsultation.expired", "teleconsultation.diverged", "access.created", "access.link_revealed", "access.revoked", "access.exchanged", "access.verification_failed", "access.blocked", "host.claimed", "host.reassigned", "waiting_policy.changed", "doctor.prepared", "doctor.joined", "doctor.disconnected", "doctor.rejoined", "doctor.left", "patient.verified", "patient.waiting", "patient.admitted", "patient.rejected", "patient.joined", "patient.disconnected", "patient.rejoined", "patient.left", "recording.consent_requested", "recording.consent_accepted", "recording.consent_declined", "recording.consent_declined_pre_join", "recording.consent_withdrawn", "recording.started", "recording.auto_started", "recording.stopped", "recording.failed", "transcription.queued", "transcription.ready", "transcription.failed", "transcription.deleted", "consultation.started", "consultation.reconnecting", "consultation.ended", "teleconsultation.usage_skipped", "artifact.accessed", "artifact.deleted", "entitlement.denied", "rollout.denied", "permission.denied", "webhook.observed"]>;
634
636
  occurred_at: z.ZodEffects<z.ZodDate, Date, unknown>;
635
637
  actor: z.ZodObject<{
636
638
  type: z.ZodEnum<["user", "patient", "system", "provider"]>;
@@ -659,7 +661,7 @@ export declare const zTeleconsultationEventSchema: z.ZodObject<{
659
661
  deleted_at: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
660
662
  } & {
661
663
  teleconsultation_id: z.ZodString;
662
- type: z.ZodEnum<["teleconsultation.created", "teleconsultation.rescheduled", "teleconsultation.cancelled", "teleconsultation.expired", "teleconsultation.diverged", "access.created", "access.link_revealed", "access.revoked", "access.exchanged", "access.verification_failed", "access.blocked", "host.claimed", "host.reassigned", "waiting_policy.changed", "doctor.prepared", "doctor.joined", "doctor.disconnected", "doctor.rejoined", "doctor.left", "patient.verified", "patient.waiting", "patient.admitted", "patient.rejected", "patient.joined", "patient.disconnected", "patient.rejoined", "patient.left", "recording.consent_requested", "recording.consent_accepted", "recording.consent_declined", "recording.consent_withdrawn", "recording.started", "recording.stopped", "recording.failed", "transcription.queued", "transcription.ready", "transcription.failed", "transcription.deleted", "consultation.started", "consultation.reconnecting", "consultation.ended", "artifact.accessed", "artifact.deleted", "entitlement.denied", "rollout.denied", "permission.denied", "webhook.observed"]>;
664
+ type: z.ZodEnum<["teleconsultation.created", "teleconsultation.rescheduled", "teleconsultation.cancelled", "teleconsultation.expired", "teleconsultation.diverged", "access.created", "access.link_revealed", "access.revoked", "access.exchanged", "access.verification_failed", "access.blocked", "host.claimed", "host.reassigned", "waiting_policy.changed", "doctor.prepared", "doctor.joined", "doctor.disconnected", "doctor.rejoined", "doctor.left", "patient.verified", "patient.waiting", "patient.admitted", "patient.rejected", "patient.joined", "patient.disconnected", "patient.rejoined", "patient.left", "recording.consent_requested", "recording.consent_accepted", "recording.consent_declined", "recording.consent_declined_pre_join", "recording.consent_withdrawn", "recording.started", "recording.auto_started", "recording.stopped", "recording.failed", "transcription.queued", "transcription.ready", "transcription.failed", "transcription.deleted", "consultation.started", "consultation.reconnecting", "consultation.ended", "teleconsultation.usage_skipped", "artifact.accessed", "artifact.deleted", "entitlement.denied", "rollout.denied", "permission.denied", "webhook.observed"]>;
663
665
  occurred_at: z.ZodEffects<z.ZodDate, Date, unknown>;
664
666
  actor: z.ZodObject<{
665
667
  type: z.ZodEnum<["user", "patient", "system", "provider"]>;
@@ -1565,3 +1567,27 @@ export declare const zTelemetryCommandSchema: z.ZodObject<{
1565
1567
  attrs?: Record<string, string | number | boolean> | undefined;
1566
1568
  }[];
1567
1569
  }>;
1570
+ /**
1571
+ * `POST /v1/teleconsultations/:id/artifacts/:artifactId/signed-url` (feat-160
1572
+ * F21) — espelha `IArtifactSignedUrlCommand`.
1573
+ *
1574
+ * `.strict()` de propósito: chave desconhecida aqui é erro de contrato —
1575
+ * `ttlSeconds` em camelCase passaria em silêncio como "sem TTL pedido" e o bug
1576
+ * apareceria como "o teto não respeita o que eu mandei". 30 s é o piso do use
1577
+ * case e 900 s (`ARTIFACT_INLINE_SIGNED_URL_MAX_SECONDS`) o teto do modo mais
1578
+ * generoso; o teto REAL por modo é aplicado pelo use case e de novo pelo
1579
+ * adapter — este schema só recusa forma.
1580
+ */
1581
+ export declare const zArtifactSignedUrlCommandSchema: z.ZodObject<{
1582
+ disposition: z.ZodOptional<z.ZodEnum<["inline", "attachment"]>>;
1583
+ ttl_seconds: z.ZodOptional<z.ZodNumber>;
1584
+ refresh: z.ZodOptional<z.ZodBoolean>;
1585
+ }, "strict", z.ZodTypeAny, {
1586
+ ttl_seconds?: number | undefined;
1587
+ disposition?: "inline" | "attachment" | undefined;
1588
+ refresh?: boolean | undefined;
1589
+ }, {
1590
+ ttl_seconds?: number | undefined;
1591
+ disposition?: "inline" | "attachment" | undefined;
1592
+ refresh?: boolean | undefined;
1593
+ }>;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.zAccessRevokeCommandSchema = exports.zAccessSendCommandSchema = exports.zReassignHostCommandSchema = exports.zWaitingPolicyCommandSchema = exports.zTelemedicineGrantIndexSchema = exports.zTelemedicineTranscriptionConfigSchema = exports.zTelemedicineRolloutSchema = exports.zTelemedicineLegalTextSchema = exports.zTelemedicineEntitlementAuditSchema = exports.zTelemedicineAppointmentIndexSchema = exports.zTeleconsultationAccessGrantSchema = exports.zTeleconsultationWebhookEventSchema = exports.zTeleconsultationEventSchema = exports.zTeleconsultationArtifactSchema = exports.zTeleconsultationConsentSchema = exports.zTeleconsultationConsentEvidenceSchema = exports.zTeleconsultationParticipantSchema = exports.zTeleconsultationPrivateProviderSchema = exports.zTeleconsultationSchema = exports.zTeleconsultationEventActorSchema = exports.zTeleconsultationEntitlementSnapshotSchema = exports.zTeleconsultationEndedBySchema = exports.zTeleconsultationEventMetadataSchema = exports.zTelemedicineErrorCodeSchema = exports.zEntitlementAuditActionSchema = exports.zTranscriptionProviderSchema = exports.zLegalTextStatusSchema = exports.zWebhookEventStatusSchema = exports.zTeleconsultationEventTypeSchema = exports.zTeleconsultationEventSourceSchema = exports.zTeleconsultationEventActorTypeSchema = exports.zEndedByTypeSchema = exports.zAccessSendChannelKindSchema = exports.zAccessGrantStateSchema = exports.zAccessGrantKindSchema = exports.zArtifactStatusSchema = exports.zArtifactTypeSchema = exports.zConsentActorTypeSchema = exports.zConsentDecisionSchema = exports.zConsentSubjectSchema = exports.zTranscriptionStatusSchema = exports.zRecordingStatusSchema = exports.zIdentityLevelSchema = exports.zPresenceStateSchema = exports.zParticipantStateSchema = exports.zParticipantRoleSchema = exports.zTeleconsultationProviderSchema = exports.zTeleconsultationModeSchema = exports.zWaitingPolicySchema = exports.zTeleconsultationStatusSchema = void 0;
4
- exports.zTelemetryCommandSchema = exports.zRecordingStopCommandSchema = exports.zRecordingConsentCommandSchema = exports.zRecordingRequestCommandSchema = exports.zRejectCommandSchema = exports.zAdmitCommandSchema = exports.zPresenceCommandSchema = exports.zLeaveCommandSchema = exports.zJoinCommandSchema = exports.zConsentCommandSchema = exports.zIdentityVerifyCommandSchema = exports.zExchangeCommandSchema = exports.zEndCommandSchema = void 0;
3
+ exports.zAccessSendCommandSchema = exports.zReassignHostCommandSchema = exports.zWaitingPolicyCommandSchema = exports.zTelemedicineGrantIndexSchema = exports.zTelemedicineTranscriptionConfigSchema = exports.zTelemedicineRolloutSchema = exports.zTelemedicineLegalTextSchema = exports.zTelemedicineEntitlementAuditSchema = exports.zTelemedicineAppointmentIndexSchema = exports.zTeleconsultationAccessGrantSchema = exports.zTeleconsultationWebhookEventSchema = exports.zTeleconsultationEventSchema = exports.zTeleconsultationArtifactSchema = exports.zTeleconsultationConsentSchema = exports.zTeleconsultationConsentEvidenceSchema = exports.zTeleconsultationParticipantSchema = exports.zTeleconsultationPrivateProviderSchema = exports.zTeleconsultationSchema = exports.zTeleconsultationEventActorSchema = exports.zTeleconsultationEntitlementSnapshotSchema = exports.zTeleconsultationEndedBySchema = exports.zTeleconsultationEventMetadataSchema = exports.zTelemedicineErrorCodeSchema = exports.zEntitlementAuditActionSchema = exports.zTranscriptionProviderSchema = exports.zLegalTextStatusSchema = exports.zWebhookEventStatusSchema = exports.zTeleconsultationEventTypeSchema = exports.zTeleconsultationEventSourceSchema = exports.zTeleconsultationEventActorTypeSchema = exports.zEndedByTypeSchema = exports.zAccessSendChannelKindSchema = exports.zAccessGrantStateSchema = exports.zAccessGrantKindSchema = exports.zArtifactStatusSchema = exports.zArtifactDispositionSchema = exports.zArtifactTypeSchema = exports.zConsentActorTypeSchema = exports.zConsentDecisionSchema = exports.zConsentSubjectSchema = exports.zTranscriptionStatusSchema = exports.zRecordingStatusSchema = exports.zIdentityLevelSchema = exports.zPresenceStateSchema = exports.zParticipantStateSchema = exports.zParticipantRoleSchema = exports.zTeleconsultationProviderSchema = exports.zTeleconsultationModeSchema = exports.zWaitingPolicySchema = exports.zTeleconsultationStatusSchema = void 0;
4
+ exports.zArtifactSignedUrlCommandSchema = exports.zTelemetryCommandSchema = exports.zRecordingStopCommandSchema = exports.zRecordingConsentCommandSchema = exports.zRecordingRequestCommandSchema = exports.zRejectCommandSchema = exports.zAdmitCommandSchema = exports.zPresenceCommandSchema = exports.zLeaveCommandSchema = exports.zJoinCommandSchema = exports.zConsentCommandSchema = exports.zIdentityVerifyCommandSchema = exports.zExchangeCommandSchema = exports.zEndCommandSchema = exports.zAccessRevokeCommandSchema = void 0;
5
5
  const zod_1 = require("zod");
6
6
  const zod_schemas_1 = require("../shared/zod-schemas");
7
7
  const zod_schemas_2 = require("../evo-tenant/zod-schemas");
@@ -96,6 +96,8 @@ exports.zArtifactTypeSchema = zod_1.z.enum([
96
96
  "recording_audio",
97
97
  "transcript",
98
98
  ]);
99
+ /** Espelha `ArtifactDispositionEnum` (feat-160 F21). */
100
+ exports.zArtifactDispositionSchema = zod_1.z.enum(["inline", "attachment"]);
99
101
  /** Espelha `ArtifactStatusEnum`. */
100
102
  exports.zArtifactStatusSchema = zod_1.z.enum([
101
103
  "pending",
@@ -176,8 +178,10 @@ exports.zTeleconsultationEventTypeSchema = zod_1.z.enum([
176
178
  "recording.consent_requested",
177
179
  "recording.consent_accepted",
178
180
  "recording.consent_declined",
181
+ "recording.consent_declined_pre_join",
179
182
  "recording.consent_withdrawn",
180
183
  "recording.started",
184
+ "recording.auto_started",
181
185
  "recording.stopped",
182
186
  "recording.failed",
183
187
  "transcription.queued",
@@ -187,6 +191,7 @@ exports.zTeleconsultationEventTypeSchema = zod_1.z.enum([
187
191
  "consultation.started",
188
192
  "consultation.reconnecting",
189
193
  "consultation.ended",
194
+ "teleconsultation.usage_skipped",
190
195
  "artifact.accessed",
191
196
  "artifact.deleted",
192
197
  "entitlement.denied",
@@ -707,3 +712,21 @@ exports.zTelemetryCommandSchema = zod_1.z
707
712
  .max(50),
708
713
  })
709
714
  .strict();
715
+ /**
716
+ * `POST /v1/teleconsultations/:id/artifacts/:artifactId/signed-url` (feat-160
717
+ * F21) — espelha `IArtifactSignedUrlCommand`.
718
+ *
719
+ * `.strict()` de propósito: chave desconhecida aqui é erro de contrato —
720
+ * `ttlSeconds` em camelCase passaria em silêncio como "sem TTL pedido" e o bug
721
+ * apareceria como "o teto não respeita o que eu mandei". 30 s é o piso do use
722
+ * case e 900 s (`ARTIFACT_INLINE_SIGNED_URL_MAX_SECONDS`) o teto do modo mais
723
+ * generoso; o teto REAL por modo é aplicado pelo use case e de novo pelo
724
+ * adapter — este schema só recusa forma.
725
+ */
726
+ exports.zArtifactSignedUrlCommandSchema = zod_1.z
727
+ .object({
728
+ disposition: exports.zArtifactDispositionSchema.optional(),
729
+ ttl_seconds: zod_1.z.number().int().min(30).max(900).optional(),
730
+ refresh: zod_1.z.boolean().optional(),
731
+ })
732
+ .strict();
@@ -112,6 +112,9 @@ export const zArtifactTypeSchema = z.enum([
112
112
  "transcript",
113
113
  ]);
114
114
 
115
+ /** Espelha `ArtifactDispositionEnum` (feat-160 F21). */
116
+ export const zArtifactDispositionSchema = z.enum(["inline", "attachment"]);
117
+
115
118
  /** Espelha `ArtifactStatusEnum`. */
116
119
  export const zArtifactStatusSchema = z.enum([
117
120
  "pending",
@@ -199,8 +202,10 @@ export const zTeleconsultationEventTypeSchema = z.enum([
199
202
  "recording.consent_requested",
200
203
  "recording.consent_accepted",
201
204
  "recording.consent_declined",
205
+ "recording.consent_declined_pre_join",
202
206
  "recording.consent_withdrawn",
203
207
  "recording.started",
208
+ "recording.auto_started",
204
209
  "recording.stopped",
205
210
  "recording.failed",
206
211
  "transcription.queued",
@@ -210,6 +215,7 @@ export const zTeleconsultationEventTypeSchema = z.enum([
210
215
  "consultation.started",
211
216
  "consultation.reconnecting",
212
217
  "consultation.ended",
218
+ "teleconsultation.usage_skipped",
213
219
  "artifact.accessed",
214
220
  "artifact.deleted",
215
221
  "entitlement.denied",
@@ -792,3 +798,22 @@ export const zTelemetryCommandSchema = z
792
798
  .max(50),
793
799
  })
794
800
  .strict();
801
+
802
+ /**
803
+ * `POST /v1/teleconsultations/:id/artifacts/:artifactId/signed-url` (feat-160
804
+ * F21) — espelha `IArtifactSignedUrlCommand`.
805
+ *
806
+ * `.strict()` de propósito: chave desconhecida aqui é erro de contrato —
807
+ * `ttlSeconds` em camelCase passaria em silêncio como "sem TTL pedido" e o bug
808
+ * apareceria como "o teto não respeita o que eu mandei". 30 s é o piso do use
809
+ * case e 900 s (`ARTIFACT_INLINE_SIGNED_URL_MAX_SECONDS`) o teto do modo mais
810
+ * generoso; o teto REAL por modo é aplicado pelo use case e de novo pelo
811
+ * adapter — este schema só recusa forma.
812
+ */
813
+ export const zArtifactSignedUrlCommandSchema = z
814
+ .object({
815
+ disposition: zArtifactDispositionSchema.optional(),
816
+ ttl_seconds: z.number().int().min(30).max(900).optional(),
817
+ refresh: z.boolean().optional(),
818
+ })
819
+ .strict();
@@ -49,6 +49,23 @@ export interface ICallsChannelConfig {
49
49
  inbound_voice_enabled?: boolean;
50
50
  outbound_permission?: ICallOutboundPermissionConfig;
51
51
  }
52
+ export type WabaDirectSendCategory = 'utility' | 'authentication';
53
+ /** Restricao aplicada pela Meta ao Direct Send do WABA (webhook `account_update` / ACCOUNT_RESTRICTION). */
54
+ export interface IChannelDirectSendRestriction {
55
+ violation_type: string;
56
+ restriction_type?: string | null;
57
+ expiration?: Date | null;
58
+ received_at: Date;
59
+ }
60
+ /** Meta Direct Send (beta): envio iniciado pela empresa sem template previo. Desligado por padrao. */
61
+ export interface IChannelDirectSendConfig {
62
+ enabled: boolean;
63
+ categories?: WabaDirectSendCategory[];
64
+ default_ttl_seconds?: number | null;
65
+ /** Enquanto no futuro, o Direct Send do canal fica suspenso. */
66
+ restricted_until?: Date | null;
67
+ restriction?: IChannelDirectSendRestriction | null;
68
+ }
52
69
  export interface IChannel extends IFireDoc {
53
70
  model_ver: number;
54
71
  provider: ChannelProvider | string;
@@ -61,6 +78,8 @@ export interface IChannel extends IFireDoc {
61
78
  provider_ref: IChannelProviderRef;
62
79
  hub_ia?: IHubIAConfig;
63
80
  calls?: ICallsChannelConfig;
81
+ /** feat-165 — Meta Direct Send (beta). */
82
+ direct_send?: IChannelDirectSendConfig;
64
83
  /** feat-142 — rollup da recepção do histórico de coexistência (WABA). */
65
84
  history_import?: IChannelHistoryImport;
66
85
  [key: string]: unknown;
@@ -71,6 +71,28 @@ export interface ICallsChannelConfig {
71
71
  outbound_permission?: ICallOutboundPermissionConfig;
72
72
  }
73
73
 
74
+ // ── Direct Send config (feat-165) ──
75
+
76
+ export type WabaDirectSendCategory = 'utility' | 'authentication';
77
+
78
+ /** Restricao aplicada pela Meta ao Direct Send do WABA (webhook `account_update` / ACCOUNT_RESTRICTION). */
79
+ export interface IChannelDirectSendRestriction {
80
+ violation_type: string;
81
+ restriction_type?: string | null;
82
+ expiration?: Date | null;
83
+ received_at: Date;
84
+ }
85
+
86
+ /** Meta Direct Send (beta): envio iniciado pela empresa sem template previo. Desligado por padrao. */
87
+ export interface IChannelDirectSendConfig {
88
+ enabled: boolean;
89
+ categories?: WabaDirectSendCategory[];
90
+ default_ttl_seconds?: number | null;
91
+ /** Enquanto no futuro, o Direct Send do canal fica suspenso. */
92
+ restricted_until?: Date | null;
93
+ restriction?: IChannelDirectSendRestriction | null;
94
+ }
95
+
74
96
  // ── Channel (evo-chat v3) ──
75
97
 
76
98
  export interface IChannel extends IFireDoc {
@@ -85,6 +107,8 @@ export interface IChannel extends IFireDoc {
85
107
  provider_ref: IChannelProviderRef;
86
108
  hub_ia?: IHubIAConfig;
87
109
  calls?: ICallsChannelConfig;
110
+ /** feat-165 — Meta Direct Send (beta). */
111
+ direct_send?: IChannelDirectSendConfig;
88
112
  /** feat-142 — rollup da recepção do histórico de coexistência (WABA). */
89
113
  history_import?: IChannelHistoryImport;
90
114
  [key: string]: unknown;
@@ -13,6 +13,8 @@ export interface IMessageStatus {
13
13
  }>;
14
14
  error_code?: string;
15
15
  error_message?: string;
16
+ /** feat-165 — id do template (inclusive o auto-gerado do Direct Send) informado no webhook de status. */
17
+ template_id?: string | null;
16
18
  }
17
19
  export interface IMessageMedia {
18
20
  gcs_uri?: string;
@@ -68,6 +70,8 @@ export interface IMessageCreatedBy {
68
70
  export interface IMessagePricing {
69
71
  category?: 'service' | 'utility' | 'authentication' | 'marketing';
70
72
  billable?: boolean;
73
+ /** feat-165 — `pricing.pricing_model` do webhook de status (ex.: PMP). */
74
+ pricing_model?: string | null;
71
75
  }
72
76
  export interface IRenderedTemplateButton {
73
77
  type?: string;
@@ -22,6 +22,8 @@ export interface IMessageStatus {
22
22
  errors?: Array<{ code: number; title: string }>;
23
23
  error_code?: string;
24
24
  error_message?: string;
25
+ /** feat-165 — id do template (inclusive o auto-gerado do Direct Send) informado no webhook de status. */
26
+ template_id?: string | null;
25
27
  }
26
28
 
27
29
  // ── Message media ──
@@ -97,6 +99,8 @@ export interface IMessageCreatedBy {
97
99
  export interface IMessagePricing {
98
100
  category?: 'service' | 'utility' | 'authentication' | 'marketing';
99
101
  billable?: boolean;
102
+ /** feat-165 — `pricing.pricing_model` do webhook de status (ex.: PMP). */
103
+ pricing_model?: string | null;
100
104
  }
101
105
 
102
106
  // ── Mensagem de template compilada (feat-114) ──
@@ -40,6 +40,8 @@ export declare const WabaTemplateParameterFormatEnum: {
40
40
  readonly Positional: "POSITIONAL";
41
41
  };
42
42
  export type WabaTemplateParameterFormat = (typeof WabaTemplateParameterFormatEnum)[keyof typeof WabaTemplateParameterFormatEnum];
43
+ /** Valor de `source` dos templates criados pela Meta para mensagens Direct Send (nao editaveis/deletaveis). */
44
+ export declare const WABA_TEMPLATE_SOURCE_AUTO_GENERATED = "AUTO_GENERATED";
43
45
  export interface IWabaTemplateButton {
44
46
  type: WabaTemplateButtonType;
45
47
  text: string;
@@ -83,6 +85,10 @@ export interface IWabaTemplate extends IFireDoc {
83
85
  synced_at?: Date | null;
84
86
  is_draft: boolean;
85
87
  draft_source?: IWabaTemplateDraftSource;
88
+ /** Origem na Meta; `AUTO_GENERATED` = gerado pelo Direct Send. */
89
+ source?: string | null;
90
+ /** Categoria corrigida pela Meta (`template_correct_category_detection`). */
91
+ correct_category?: string | null;
86
92
  }
87
93
  export interface IWabaTemplateCreateRequest {
88
94
  name: string;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.WabaTemplateParameterFormatEnum = exports.WabaTemplateButtonTypeEnum = exports.WabaTemplateHeaderFormatEnum = exports.WabaTemplateComponentTypeEnum = exports.WabaTemplateCategoryEnum = exports.WabaTemplateStatusEnum = void 0;
3
+ exports.WABA_TEMPLATE_SOURCE_AUTO_GENERATED = exports.WabaTemplateParameterFormatEnum = exports.WabaTemplateButtonTypeEnum = exports.WabaTemplateHeaderFormatEnum = exports.WabaTemplateComponentTypeEnum = exports.WabaTemplateCategoryEnum = exports.WabaTemplateStatusEnum = void 0;
4
4
  // ── Enums ──
5
5
  exports.WabaTemplateStatusEnum = {
6
6
  Draft: 'DRAFT',
@@ -37,3 +37,5 @@ exports.WabaTemplateParameterFormatEnum = {
37
37
  Named: 'NAMED',
38
38
  Positional: 'POSITIONAL',
39
39
  };
40
+ /** Valor de `source` dos templates criados pela Meta para mensagens Direct Send (nao editaveis/deletaveis). */
41
+ exports.WABA_TEMPLATE_SOURCE_AUTO_GENERATED = 'AUTO_GENERATED';