evo360-types 1.3.570 → 1.3.574

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 (44) hide show
  1. package/dist/apps/evo-crm/lead/zod-schemas.d.ts +9 -9
  2. package/dist/apps/evo-csq/zod-schemas.d.ts +12 -12
  3. package/dist/apps/evo-finops/zod-schemas.d.ts +18 -18
  4. package/dist/apps/evo-med/dic/zod-schemas.d.ts +2 -2
  5. package/dist/apps/evo-med/people/zod-schemas.d.ts +45 -45
  6. package/dist/apps/evo-notifications/quick-reply-action/zod-schemas.d.ts +3 -0
  7. package/dist/apps/evo-notifications/quick-reply-action/zod-schemas.js +3 -0
  8. package/dist/apps/evo-notifications/quick-reply-action/zod-schemas.ts +3 -0
  9. package/dist/apps/evo-notifications/zod-schemas.d.ts +69 -39
  10. package/dist/apps/evo-task/zod-schemas.d.ts +69 -69
  11. package/dist/apps/evo-task/zod-schemas.js +8 -0
  12. package/dist/apps/evo-task/zod-schemas.ts +8 -0
  13. package/dist/apps/evo-telemedicine/zod-schemas.d.ts +1445 -0
  14. package/dist/apps/evo-telemedicine/zod-schemas.js +641 -0
  15. package/dist/apps/evo-telemedicine/zod-schemas.ts +723 -0
  16. package/dist/apps/evo-tenant/zod-schemas.d.ts +94 -0
  17. package/dist/apps/evo-tenant/zod-schemas.js +29 -1
  18. package/dist/apps/evo-tenant/zod-schemas.ts +32 -1
  19. package/dist/apps/hub-automation/zod-schemas.d.ts +172 -172
  20. package/dist/index.d.ts +2 -0
  21. package/dist/index.js +2 -0
  22. package/dist/index.ts +2 -0
  23. package/dist/types/evo-med/calendar/index.d.ts +6 -0
  24. package/dist/types/evo-med/calendar/index.js +6 -0
  25. package/dist/types/evo-med/calendar/index.ts +6 -0
  26. package/dist/types/evo-notifications/index.d.ts +13 -0
  27. package/dist/types/evo-notifications/index.js +6 -0
  28. package/dist/types/evo-notifications/index.ts +13 -0
  29. package/dist/types/evo-task/index.d.ts +1 -0
  30. package/dist/types/evo-task/index.js +8 -0
  31. package/dist/types/evo-task/index.ts +8 -0
  32. package/dist/types/evo-telemedicine/fb_collections.d.ts +16 -0
  33. package/dist/types/evo-telemedicine/fb_collections.js +38 -0
  34. package/dist/types/evo-telemedicine/fb_collections.ts +37 -0
  35. package/dist/types/evo-telemedicine/index.d.ts +890 -0
  36. package/dist/types/evo-telemedicine/index.js +361 -0
  37. package/dist/types/evo-telemedicine/index.ts +1046 -0
  38. package/dist/types/evo-tenant/index.d.ts +45 -0
  39. package/dist/types/evo-tenant/index.js +20 -1
  40. package/dist/types/evo-tenant/index.ts +65 -0
  41. package/dist/types/shared/external-links.d.ts +6 -0
  42. package/dist/types/shared/external-links.js +6 -0
  43. package/dist/types/shared/external-links.ts +6 -0
  44. package/package.json +1 -1
@@ -0,0 +1,361 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.TelemedicineErrorCode = exports.EntitlementAuditActionEnum = exports.TranscriptionProviderEnum = exports.LegalTextStatusEnum = exports.WebhookEventStatusEnum = exports.TeleconsultationEventTypeEnum = exports.TeleconsultationEventSourceEnum = exports.TeleconsultationEventActorTypeEnum = exports.EndedByTypeEnum = exports.AccessSendChannelKindEnum = exports.AccessGrantStateEnum = exports.AccessGrantKindEnum = exports.ArtifactStatusEnum = exports.ArtifactTypeEnum = exports.ConsentActorTypeEnum = exports.ConsentDecisionEnum = exports.ConsentSubjectEnum = exports.TranscriptionStatusEnum = exports.RecordingStatusEnum = exports.IdentityLevelEnum = exports.PresenceStateEnum = exports.ParticipantStateEnum = exports.ParticipantRoleEnum = exports.TeleconsultationProviderEnum = exports.TeleconsultationModeEnum = exports.WaitingPolicyEnum = exports.TELECONSULTATION_TERMINAL_STATUSES = exports.TeleconsultationStatusEnum = exports.TELEMEDICINE_WINDOW_DEFAULTS = exports.TELEMEDICINE_JOIN_REMINDER_HANDLER = exports.TELEMEDICINE_JOIN_ACTION_TYPE = exports.EvoTelemedicinePermissions = void 0;
18
+ __exportStar(require("./fb_collections"), exports);
19
+ // ======================================================
20
+ // evo-telemedicine (feat-160 — Telemedicina integrada)
21
+ //
22
+ // Contratos compartilhados entre `functions-telemedicine`, `packages/model`,
23
+ // o web-app (painel) e o SPA `web-virtual-care`. Shapes seguem
24
+ // `hub-medica-docs/features/feat-160-telemedicine-platform-mvp/data-model.md`.
25
+ //
26
+ // Regras que os tipos carregam:
27
+ // - nada de PII do paciente (nome/telefone/e-mail/DOB), token do provider,
28
+ // capability `/qr`, cookie, URL assinada ou texto de transcrição nos docs;
29
+ // - segredos de grant existem só como hash/HMAC (`secret_hash`);
30
+ // - eventos são append-only e a `metadata` é allowlist sem PII/conteúdo médico;
31
+ // - o acesso exige entitlement do tenant AND rollout operacional AND permissão.
32
+ //
33
+ // Convenção de datas: docs Firestore usam `Date` (como o resto do repo — o zod
34
+ // converte Timestamp via `zFirestoreDateSchema`); DTOs HTTP usam ISO 8601 em
35
+ // `string` (JSON não transporta Date).
36
+ // ======================================================
37
+ // ----- Permissões (spec §9.3)
38
+ exports.EvoTelemedicinePermissions = {
39
+ /** Ver estado e dados operacionais básicos. */
40
+ Read: "evo_telemedicine_read",
41
+ /** Preparar, admitir, entrar como médico e encerrar. */
42
+ Host: "evo_telemedicine_host",
43
+ /** Solicitar/iniciar/parar gravação. */
44
+ Record: "evo_telemedicine_record",
45
+ /** Listar e baixar gravações/transcrições. */
46
+ ArtifactsRead: "evo_telemedicine_artifacts_read",
47
+ /** Alterar defaults permitidos do tenant; reatribuir host. */
48
+ Configure: "evo_telemedicine_configure",
49
+ /** Consultar trilha detalhada (events). */
50
+ AuditRead: "evo_telemedicine_audit_read",
51
+ };
52
+ // ----- Constantes de integração
53
+ /** `action_type` do quick-reply `/qr` que redireciona para `/api/public/v1/enter/{cap}` (redirect puro, reexecutável). */
54
+ exports.TELEMEDICINE_JOIN_ACTION_TYPE = "telemedicine_join";
55
+ /** Handler do lembrete/CTA de entrada — igual a `TaskAutoHandlerEnum.TelemedicineJoinReminder`. */
56
+ exports.TELEMEDICINE_JOIN_REMINDER_HANDLER = "telemedicine_join_reminder";
57
+ /**
58
+ * Defaults de janela do MVP (spec §8.2/§8.3/D23) — configuráveis só em nível de
59
+ * plataforma. Em minutos, salvo indicação.
60
+ */
61
+ exports.TELEMEDICINE_WINDOW_DEFAULTS = {
62
+ /** Médico prepara/entra desde N minutos antes do início previsto. */
63
+ doctor_access_before_minutes: 30,
64
+ /** Paciente abre o fluxo desde N minutos antes do início previsto. */
65
+ patient_access_before_minutes: 15,
66
+ /** Se nunca iniciou: expira N minutos após o fim previsto. */
67
+ unused_expires_after_end_minutes: 120,
68
+ /** Reconexão após última presença do médico. */
69
+ reconnect_grace_minutes: 10,
70
+ /** Code one-time de exchange (`launch_code`). */
71
+ launch_code_ttl_minutes: 5,
72
+ /** Access da sessão pública do browser (`browser_session`), renovável de forma rotativa. */
73
+ browser_session_ttl_minutes: 15,
74
+ /** Verificação de identidade: N falhas na janela bloqueiam o grant. */
75
+ identity_max_failures: 5,
76
+ identity_failure_window_minutes: 15,
77
+ identity_block_minutes: 30,
78
+ /** URL assinada de artefato. */
79
+ signed_url_max_minutes: 5,
80
+ /** Bits aleatórios mínimos de capability/code. */
81
+ secret_min_bits: 128,
82
+ };
83
+ // ----- Enums (espelhados à mão em apps/evo-telemedicine/zod-schemas.ts)
84
+ /** Estado clínico da teleconsulta (spec §10). Presença é separada (`ParticipantState`). */
85
+ exports.TeleconsultationStatusEnum = {
86
+ /** Vínculo criado, janela fechada. */
87
+ Scheduled: "scheduled",
88
+ /** Janela aberta, nenhum encontro ativo. */
89
+ Open: "open",
90
+ /** Ao menos uma sessão física ativa ou presença clínica em curso. */
91
+ Live: "live",
92
+ /** Consulta iniciada, médico sem presença dentro da tolerância. */
93
+ Reconnecting: "reconnecting",
94
+ /** Encerramento em andamento; novos joins proibidos. */
95
+ Ending: "ending",
96
+ Ended: "ended",
97
+ Cancelled: "cancelled",
98
+ Expired: "expired",
99
+ };
100
+ /** Terminais: nunca ressuscitam (webhook atrasado, reschedule, join). */
101
+ exports.TELECONSULTATION_TERMINAL_STATUSES = [
102
+ "ended",
103
+ "cancelled",
104
+ "expired",
105
+ ];
106
+ exports.WaitingPolicyEnum = {
107
+ /** Default. Médico admite manualmente. */
108
+ ManualAdmit: "manual_admit",
109
+ /** Entrada automática só com médico `connected` e `identity_level = strong`; nunca em sala vazia. */
110
+ AutoWhenDoctorPresent: "auto_when_doctor_present",
111
+ };
112
+ exports.TeleconsultationModeEnum = {
113
+ AudioVideo: "audio_video",
114
+ AudioOnlyAllowed: "audio_only_allowed",
115
+ };
116
+ exports.TeleconsultationProviderEnum = {
117
+ RealtimeKit: "realtimekit",
118
+ };
119
+ exports.ParticipantRoleEnum = {
120
+ Doctor: "doctor",
121
+ Patient: "patient",
122
+ };
123
+ /** Presença — separada do estado clínico da teleconsulta. */
124
+ exports.ParticipantStateEnum = {
125
+ Invited: "invited",
126
+ Verified: "verified",
127
+ Waiting: "waiting",
128
+ Connected: "connected",
129
+ Disconnected: "disconnected",
130
+ Left: "left",
131
+ };
132
+ /** Subconjunto de `ParticipantState` que o cliente pode reportar em `POST /presence`. */
133
+ exports.PresenceStateEnum = {
134
+ Waiting: "waiting",
135
+ Connected: "connected",
136
+ Disconnected: "disconnected",
137
+ Left: "left",
138
+ };
139
+ /**
140
+ * Nível de verificação da identidade do paciente (spec §8.3): `strong` = nome +
141
+ * DOB conferidos; `weak` = só nome (paciente sem DOB) — proíbe `auto_admit`.
142
+ */
143
+ exports.IdentityLevelEnum = {
144
+ None: "none",
145
+ Weak: "weak",
146
+ Strong: "strong",
147
+ };
148
+ exports.RecordingStatusEnum = {
149
+ Idle: "idle",
150
+ ConsentPending: "consent_pending",
151
+ Recording: "recording",
152
+ Stopping: "stopping",
153
+ Failed: "failed",
154
+ };
155
+ exports.TranscriptionStatusEnum = {
156
+ NotRequested: "not_requested",
157
+ Queued: "queued",
158
+ Processing: "processing",
159
+ Ready: "ready",
160
+ Failed: "failed",
161
+ Deleted: "deleted",
162
+ };
163
+ exports.ConsentSubjectEnum = {
164
+ Terms: "terms",
165
+ Privacy: "privacy",
166
+ Recording: "recording",
167
+ Transcription: "transcription",
168
+ };
169
+ exports.ConsentDecisionEnum = {
170
+ Accepted: "accepted",
171
+ Declined: "declined",
172
+ Withdrawn: "withdrawn",
173
+ };
174
+ exports.ConsentActorTypeEnum = {
175
+ Patient: "patient",
176
+ Doctor: "doctor",
177
+ };
178
+ exports.ArtifactTypeEnum = {
179
+ RecordingAudioVideo: "recording_audio_video",
180
+ RecordingAudio: "recording_audio",
181
+ Transcript: "transcript",
182
+ };
183
+ exports.ArtifactStatusEnum = {
184
+ Pending: "pending",
185
+ Processing: "processing",
186
+ Ready: "ready",
187
+ Failed: "failed",
188
+ Deleting: "deleting",
189
+ Deleted: "deleted",
190
+ };
191
+ exports.AccessGrantKindEnum = {
192
+ /** Capability de 128 bits no link `/qr`; reexecutável na janela da teleconsulta. */
193
+ QrCapability: "qr_capability",
194
+ /** Code one-time de exchange (5 min) — médico (`/launch`) ou filho do `/enter`. */
195
+ LaunchCode: "launch_code",
196
+ /** Sessão do browser (cookie `__session`), 15 min, rotativa. */
197
+ BrowserSession: "browser_session",
198
+ };
199
+ exports.AccessGrantStateEnum = {
200
+ Active: "active",
201
+ Consumed: "consumed",
202
+ Blocked: "blocked",
203
+ Revoked: "revoked",
204
+ Expired: "expired",
205
+ };
206
+ /** Canal pelo qual o CTA de acesso do paciente é (re)enviado. `manual` só devolve a URL mascarada (smoke). */
207
+ exports.AccessSendChannelKindEnum = {
208
+ WhatsApp: "whatsapp",
209
+ Email: "email",
210
+ Manual: "manual",
211
+ };
212
+ exports.EndedByTypeEnum = {
213
+ User: "user",
214
+ System: "system",
215
+ };
216
+ exports.TeleconsultationEventActorTypeEnum = {
217
+ User: "user",
218
+ Patient: "patient",
219
+ System: "system",
220
+ Provider: "provider",
221
+ };
222
+ exports.TeleconsultationEventSourceEnum = {
223
+ Api: "api",
224
+ Webhook: "webhook",
225
+ AppointmentReconciler: "appointment_reconciler",
226
+ RetentionJob: "retention_job",
227
+ /** `telemed_sweep`: expiração de não usadas, timeout de reconexão, outbox órfã. */
228
+ Sweep: "sweep",
229
+ };
230
+ /** Tipos de evento append-only (data-model §5 + acréscimos do plan). */
231
+ exports.TeleconsultationEventTypeEnum = {
232
+ TeleconsultationCreated: "teleconsultation.created",
233
+ TeleconsultationRescheduled: "teleconsultation.rescheduled",
234
+ TeleconsultationCancelled: "teleconsultation.cancelled",
235
+ TeleconsultationExpired: "teleconsultation.expired",
236
+ /** Alteração tardia na agenda com consulta já iniciada — tratamento operacional, não apaga o encontro. */
237
+ TeleconsultationDiverged: "teleconsultation.diverged",
238
+ AccessCreated: "access.created",
239
+ AccessRevoked: "access.revoked",
240
+ AccessExchanged: "access.exchanged",
241
+ AccessVerificationFailed: "access.verification_failed",
242
+ AccessBlocked: "access.blocked",
243
+ HostClaimed: "host.claimed",
244
+ HostReassigned: "host.reassigned",
245
+ WaitingPolicyChanged: "waiting_policy.changed",
246
+ DoctorPrepared: "doctor.prepared",
247
+ DoctorJoined: "doctor.joined",
248
+ DoctorDisconnected: "doctor.disconnected",
249
+ DoctorRejoined: "doctor.rejoined",
250
+ DoctorLeft: "doctor.left",
251
+ PatientVerified: "patient.verified",
252
+ PatientWaiting: "patient.waiting",
253
+ PatientAdmitted: "patient.admitted",
254
+ PatientRejected: "patient.rejected",
255
+ PatientJoined: "patient.joined",
256
+ PatientDisconnected: "patient.disconnected",
257
+ PatientRejoined: "patient.rejoined",
258
+ PatientLeft: "patient.left",
259
+ RecordingConsentRequested: "recording.consent_requested",
260
+ RecordingConsentAccepted: "recording.consent_accepted",
261
+ RecordingConsentDeclined: "recording.consent_declined",
262
+ RecordingConsentWithdrawn: "recording.consent_withdrawn",
263
+ RecordingStarted: "recording.started",
264
+ RecordingStopped: "recording.stopped",
265
+ RecordingFailed: "recording.failed",
266
+ TranscriptionQueued: "transcription.queued",
267
+ TranscriptionReady: "transcription.ready",
268
+ TranscriptionFailed: "transcription.failed",
269
+ TranscriptionDeleted: "transcription.deleted",
270
+ ConsultationStarted: "consultation.started",
271
+ ConsultationReconnecting: "consultation.reconnecting",
272
+ ConsultationEnded: "consultation.ended",
273
+ ArtifactAccessed: "artifact.accessed",
274
+ ArtifactDeleted: "artifact.deleted",
275
+ EntitlementDenied: "entitlement.denied",
276
+ RolloutDenied: "rollout.denied",
277
+ PermissionDenied: "permission.denied",
278
+ /** Evento do provider desconhecido/ignorado — registrado, não processado. */
279
+ WebhookObserved: "webhook.observed",
280
+ };
281
+ /** Outbox durável do webhook (data-model §6): claim/lease como o task-runner. */
282
+ exports.WebhookEventStatusEnum = {
283
+ Pending: "pending",
284
+ Claimed: "claimed",
285
+ Completed: "completed",
286
+ Failed: "failed",
287
+ };
288
+ exports.LegalTextStatusEnum = {
289
+ Draft: "draft",
290
+ Published: "published",
291
+ Retired: "retired",
292
+ };
293
+ exports.TranscriptionProviderEnum = {
294
+ None: "none",
295
+ RealtimeKit: "realtimekit",
296
+ };
297
+ // ======================================================
298
+ // Auditoria de entitlement (`.../entitlement-audit/{id}`, data-model §8)
299
+ // ======================================================
300
+ exports.EntitlementAuditActionEnum = {
301
+ Set: "set",
302
+ Override: "override",
303
+ Revoke: "revoke",
304
+ };
305
+ // ======================================================
306
+ // Códigos de erro (plan §4 — `{ ok: false, error: '<CODE>', message? }` com status estável)
307
+ // ======================================================
308
+ exports.TelemedicineErrorCode = {
309
+ /** 403 — entitlement ausente/inativo (sem bypass de super admin). */
310
+ TenantModuleDisabled: "TENANT_MODULE_DISABLED",
311
+ /** 403 — kill switch operacional (`create|join|recording|transcription`). */
312
+ RolloutDisabled: "ROLLOUT_DISABLED",
313
+ /** 403 — `emergency_kill` ligado. */
314
+ EmergencyKill: "EMERGENCY_KILL",
315
+ /** 403 — RBAC. */
316
+ PermissionDenied: "PERMISSION_DENIED",
317
+ /** 403 — capability do entitlement ausente/false (`recording`, `transcription`, `auto_admit`). */
318
+ CapabilityDisabled: "CAPABILITY_DISABLED",
319
+ /** 404 — teleconsulta/artefato/grant inexistente (ou genérico, em rota pública). */
320
+ NotFound: "NOT_FOUND",
321
+ /** 409 — fora da janela (antes de `*_access_from` ou após `unused_expires_at`). */
322
+ AccessWindowClosed: "ACCESS_WINDOW_CLOSED",
323
+ /** 409 — outro médico já fez o claim de host. */
324
+ HostClaimedByOther: "HOST_CLAIMED_BY_OTHER",
325
+ /** 409 — comando exige médico claimant presente (admit/end/recording). */
326
+ HostRequired: "HOST_REQUIRED",
327
+ /** 409 — termos/privacidade (ou gravação) não aceitos na versão vigente. */
328
+ ConsentRequired: "CONSENT_REQUIRED",
329
+ /** 409 — paciente ainda não verificou identidade. */
330
+ IdentityRequired: "IDENTITY_REQUIRED",
331
+ /** 401 — verificação de identidade falhou (erro neutro: não diz qual campo). */
332
+ IdentityVerificationFailed: "IDENTITY_VERIFICATION_FAILED",
333
+ /** 429 — grant bloqueado por excesso de falhas. */
334
+ GrantBlocked: "GRANT_BLOCKED",
335
+ /** 401 — grant/code inválido, consumido, expirado ou revogado (genérico por design). */
336
+ GrantInvalid: "GRANT_INVALID",
337
+ /** 401 — cookie `__session` ausente/inválido/expirado. */
338
+ SessionInvalid: "SESSION_INVALID",
339
+ /** 410 — estado terminal (`ended|cancelled|expired`). */
340
+ TeleconsultationTerminal: "TELECONSULTATION_TERMINAL",
341
+ /** 409 — transição de estado não permitida (spec §10). */
342
+ InvalidTransition: "INVALID_TRANSITION",
343
+ /** 409 — `expected_version` divergente. */
344
+ VersionConflict: "VERSION_CONFLICT",
345
+ /** 409 — política de espera só muda até o paciente entrar. */
346
+ WaitingPolicyLocked: "WAITING_POLICY_LOCKED",
347
+ /** 409 — já existe gravação ativa/pendente. */
348
+ RecordingActive: "RECORDING_ACTIVE",
349
+ /** 502 — provider falhou ao gravar (não derruba a consulta). */
350
+ RecordingFailed: "RECORDING_FAILED",
351
+ /** 403 — transcrição em produção sem gate aprovado (D12). */
352
+ TranscriptionGateClosed: "TRANSCRIPTION_GATE_CLOSED",
353
+ /** 409 — artefato não está `ready`. */
354
+ ArtifactNotReady: "ARTIFACT_NOT_READY",
355
+ /** 502 — erro do provider de mídia. */
356
+ ProviderError: "PROVIDER_ERROR",
357
+ /** 429 — rate limit por IP-hash/grant. */
358
+ RateLimited: "RATE_LIMITED",
359
+ /** 400 — body/params inválidos. */
360
+ ValidationError: "VALIDATION_ERROR",
361
+ };