evo360-types 1.3.419 → 1.3.425
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.
- package/dist/apps/evo-campaigns/zod-schemas.d.ts +1680 -0
- package/dist/apps/evo-campaigns/zod-schemas.js +5 -0
- package/dist/apps/evo-campaigns/zod-schemas.ts +5 -0
- package/dist/apps/evo-finops/zod-schemas.d.ts +18 -18
- package/dist/apps/evo-med/people/zod-schemas.d.ts +36 -36
- package/dist/apps/evo-notifications/zod-schemas.d.ts +39 -39
- package/dist/apps/evo-task/zod-schemas.d.ts +17 -17
- package/dist/apps/evo-task/zod-schemas.js +8 -3
- package/dist/apps/evo-task/zod-schemas.ts +8 -3
- package/dist/apps/hub-automation/zod-schemas.d.ts +445 -8
- package/dist/apps/hub-automation/zod-schemas.js +27 -2
- package/dist/apps/hub-automation/zod-schemas.ts +28 -1
- package/dist/types/evo-campaigns/index.d.ts +16 -2
- package/dist/types/evo-campaigns/index.ts +16 -2
- package/dist/types/hub-automation/index.d.ts +26 -3
- package/dist/types/hub-automation/index.js +24 -1
- package/dist/types/hub-automation/index.ts +69 -3
- package/dist/types/shared/external-links.d.ts +2 -0
- package/dist/types/shared/external-links.js +2 -0
- package/dist/types/shared/external-links.ts +2 -0
- package/package.json +1 -1
|
@@ -95,8 +95,15 @@ export interface ICampaignCta {
|
|
|
95
95
|
label: string;
|
|
96
96
|
/** WhatsApp template button position (0,1,2...). */
|
|
97
97
|
button_index?: number;
|
|
98
|
-
/** Final destination for the /qr redirect.
|
|
98
|
+
/** Final destination for the /qr redirect. Optional on WhatsApp QUICK_REPLY
|
|
99
|
+
* buttons (the tap itself is tracked); required for email CTAs and URL buttons. */
|
|
99
100
|
target_url?: string;
|
|
101
|
+
/** Email CTA destination kind (feat-081 F2.5): external URL or a wa.me deep link. */
|
|
102
|
+
dest_type?: "external_url" | "whatsapp" | null;
|
|
103
|
+
/** WA channel whose number builds the wa.me link (dest_type='whatsapp'). */
|
|
104
|
+
wa_channel_id?: string | null;
|
|
105
|
+
/** Prefilled message for the wa.me link (dest_type='whatsapp'). */
|
|
106
|
+
wa_message?: string | null;
|
|
100
107
|
}
|
|
101
108
|
|
|
102
109
|
// ----- Pacing + ticket policy -----------------------------------------------
|
|
@@ -127,8 +134,12 @@ export interface ICampaignTicketPolicy {
|
|
|
127
134
|
export interface ICampaignMedia {
|
|
128
135
|
/** 'image' | 'video' | 'document' — WhatsApp header media type. */
|
|
129
136
|
type: string;
|
|
137
|
+
/** Full gs:// URI in WABA_MEDIA_BUCKET under tenants/<tenant>/ (feat-082/084 flow). */
|
|
130
138
|
gcs_path?: string;
|
|
131
139
|
url?: string;
|
|
140
|
+
/** Mime type of the uploaded media (drives the header component). */
|
|
141
|
+
mime_type?: string | null;
|
|
142
|
+
filename?: string | null;
|
|
132
143
|
}
|
|
133
144
|
|
|
134
145
|
// ----- Channel config -------------------------------------------------------
|
|
@@ -348,7 +359,10 @@ export type RecipientDispatchState =
|
|
|
348
359
|
| "pending"
|
|
349
360
|
| "dispatched"
|
|
350
361
|
| "done"
|
|
351
|
-
| "excluded"
|
|
362
|
+
| "excluded"
|
|
363
|
+
/** Campaign canceled with this recipient still pending (feat-081 F3 — formalizes
|
|
364
|
+
* what F2 stored as 'excluded'; readers must accept both on old docs). */
|
|
365
|
+
| "canceled";
|
|
352
366
|
|
|
353
367
|
/** Per-channel delivery status of a recipient (monotonic). */
|
|
354
368
|
export type RecipientChannelStatus =
|
|
@@ -43,7 +43,24 @@ export interface IAutomationAppointmentSelection {
|
|
|
43
43
|
payment_status_in?: string[];
|
|
44
44
|
};
|
|
45
45
|
}
|
|
46
|
-
export
|
|
46
|
+
export interface IAutomationLeadSelection {
|
|
47
|
+
target: "lead";
|
|
48
|
+
lead: {
|
|
49
|
+
status_in?: string[];
|
|
50
|
+
qualification_codes?: string[];
|
|
51
|
+
dist_channel_codes?: string[];
|
|
52
|
+
tag_names?: string[];
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
export interface IAutomationPatientSelection {
|
|
56
|
+
target: "patient";
|
|
57
|
+
patient: {
|
|
58
|
+
status_in?: string[];
|
|
59
|
+
source_codes?: string[];
|
|
60
|
+
tag_names?: string[];
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
export type IAutomationSelection = IAutomationAppointmentSelection | IAutomationLeadSelection | IAutomationPatientSelection;
|
|
47
64
|
export interface IAutomationFilterValues {
|
|
48
65
|
professionals: string[];
|
|
49
66
|
procedures: string[];
|
|
@@ -55,7 +72,11 @@ export interface IAutomationFilterValues {
|
|
|
55
72
|
}
|
|
56
73
|
export declare const AUTOMATION_APPOINTMENT_FACTS: readonly ["appointment.status", "appointment.status_base", "appointment.appointment_type", "appointment.appointment_base_type", "appointment.appointment_mode", "appointment.professional_id", "appointment.procedure_ids", "appointment.professional_name", "appointment.procedure_names", "appointment.insurance_name", "appointment.address_name", "appointment.payment_status", "appointment.calendar_id"];
|
|
57
74
|
export type AutomationAppointmentFact = (typeof AUTOMATION_APPOINTMENT_FACTS)[number];
|
|
58
|
-
export
|
|
75
|
+
export declare const AUTOMATION_LEAD_FACTS: readonly ["lead.status", "lead.qualification_code", "lead.qualification_name", "lead.qualification_funnel_level", "lead.dist_channel_code", "lead.dist_channel_name", "lead.tags"];
|
|
76
|
+
export type AutomationLeadFact = (typeof AUTOMATION_LEAD_FACTS)[number];
|
|
77
|
+
export declare const AUTOMATION_PATIENT_FACTS: readonly ["patient.status", "patient.source_code", "patient.source_name", "patient.tags"];
|
|
78
|
+
export type AutomationPatientFact = (typeof AUTOMATION_PATIENT_FACTS)[number];
|
|
79
|
+
export type AutomationFact = AutomationAppointmentFact | AutomationLeadFact | AutomationPatientFact;
|
|
59
80
|
export declare const AutomationOperatorEnum: {
|
|
60
81
|
readonly Eq: "eq";
|
|
61
82
|
readonly Neq: "neq";
|
|
@@ -190,7 +211,9 @@ export interface IAutomationRunBranchCounts {
|
|
|
190
211
|
already_existed: number;
|
|
191
212
|
}
|
|
192
213
|
export interface IAutomationRunSample {
|
|
193
|
-
appointment_id
|
|
214
|
+
appointment_id?: string;
|
|
215
|
+
target_kind?: "appointment" | "lead" | "patient";
|
|
216
|
+
target_id?: string;
|
|
194
217
|
branch_id?: string;
|
|
195
218
|
decision: string;
|
|
196
219
|
task_id?: string;
|
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.AutomationRunStatusEnum = exports.AutomationOutputTypeEnum = exports.AutomationOperatorEnum = exports.AUTOMATION_APPOINTMENT_FACTS = exports.HubAutomationPermissions = void 0;
|
|
17
|
+
exports.AutomationRunStatusEnum = exports.AutomationOutputTypeEnum = exports.AutomationOperatorEnum = exports.AUTOMATION_PATIENT_FACTS = exports.AUTOMATION_LEAD_FACTS = exports.AUTOMATION_APPOINTMENT_FACTS = exports.HubAutomationPermissions = void 0;
|
|
18
18
|
__exportStar(require("./fb_collections"), exports);
|
|
19
19
|
// ======================================================
|
|
20
20
|
// hub-automation
|
|
@@ -60,6 +60,29 @@ exports.AUTOMATION_APPOINTMENT_FACTS = [
|
|
|
60
60
|
"appointment.payment_status",
|
|
61
61
|
"appointment.calendar_id",
|
|
62
62
|
];
|
|
63
|
+
// feat-085 (F3): lead domain facts (derived from the fields ILead exposes;
|
|
64
|
+
// resolved from the event-preloaded lead). Mirror of the appointment catalog.
|
|
65
|
+
exports.AUTOMATION_LEAD_FACTS = [
|
|
66
|
+
// 'active' | 'inactive' | 'draft'
|
|
67
|
+
"lead.status",
|
|
68
|
+
// qualification is a {code,name,funnelLevel} ref — surface all three.
|
|
69
|
+
"lead.qualification_code",
|
|
70
|
+
"lead.qualification_name",
|
|
71
|
+
"lead.qualification_funnel_level",
|
|
72
|
+
// distChannel is a {code,name} ref.
|
|
73
|
+
"lead.dist_channel_code",
|
|
74
|
+
"lead.dist_channel_name",
|
|
75
|
+
// string[] of tag names — matches if ANY tag name matches.
|
|
76
|
+
"lead.tags",
|
|
77
|
+
];
|
|
78
|
+
// feat-085 (F3): patient domain facts (derived from IPatient).
|
|
79
|
+
exports.AUTOMATION_PATIENT_FACTS = [
|
|
80
|
+
"patient.status",
|
|
81
|
+
"patient.source_code",
|
|
82
|
+
"patient.source_name",
|
|
83
|
+
// string[] of tag names — matches if ANY tag name matches.
|
|
84
|
+
"patient.tags",
|
|
85
|
+
];
|
|
63
86
|
// ------------------------------------------------------
|
|
64
87
|
// Conditions (recursive AND/OR groups)
|
|
65
88
|
// ------------------------------------------------------
|
|
@@ -109,7 +109,36 @@ export interface IAutomationAppointmentSelection {
|
|
|
109
109
|
};
|
|
110
110
|
}
|
|
111
111
|
|
|
112
|
-
|
|
112
|
+
// feat-085 (F3): lead/patient selections. Cron selection is appointment-only;
|
|
113
|
+
// these targets only arrive via the domain-event trigger, where the consumer
|
|
114
|
+
// PRE-LOADS the single target from the event (the `lead`/`patient` filters below
|
|
115
|
+
// are therefore not enforced at event runtime — they exist so a routine can be
|
|
116
|
+
// authored/validated with a lead/patient target and, later, for a possible
|
|
117
|
+
// lead/patient sweep). Discriminated by `target`.
|
|
118
|
+
export interface IAutomationLeadSelection {
|
|
119
|
+
target: "lead";
|
|
120
|
+
lead: {
|
|
121
|
+
// Reserved narrowing filters (glob-aware like the appointment filters).
|
|
122
|
+
status_in?: string[];
|
|
123
|
+
qualification_codes?: string[];
|
|
124
|
+
dist_channel_codes?: string[];
|
|
125
|
+
tag_names?: string[];
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export interface IAutomationPatientSelection {
|
|
130
|
+
target: "patient";
|
|
131
|
+
patient: {
|
|
132
|
+
status_in?: string[];
|
|
133
|
+
source_codes?: string[];
|
|
134
|
+
tag_names?: string[];
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export type IAutomationSelection =
|
|
139
|
+
| IAutomationAppointmentSelection
|
|
140
|
+
| IAutomationLeadSelection
|
|
141
|
+
| IAutomationPatientSelection;
|
|
113
142
|
|
|
114
143
|
// Distinct filter values for a calendar, built from a limited window of local
|
|
115
144
|
// appointments (GET /routines/filter-values?calendar_id=). Feeds the GUI's
|
|
@@ -153,7 +182,39 @@ export const AUTOMATION_APPOINTMENT_FACTS = [
|
|
|
153
182
|
export type AutomationAppointmentFact =
|
|
154
183
|
(typeof AUTOMATION_APPOINTMENT_FACTS)[number];
|
|
155
184
|
|
|
156
|
-
|
|
185
|
+
// feat-085 (F3): lead domain facts (derived from the fields ILead exposes;
|
|
186
|
+
// resolved from the event-preloaded lead). Mirror of the appointment catalog.
|
|
187
|
+
export const AUTOMATION_LEAD_FACTS = [
|
|
188
|
+
// 'active' | 'inactive' | 'draft'
|
|
189
|
+
"lead.status",
|
|
190
|
+
// qualification is a {code,name,funnelLevel} ref — surface all three.
|
|
191
|
+
"lead.qualification_code",
|
|
192
|
+
"lead.qualification_name",
|
|
193
|
+
"lead.qualification_funnel_level",
|
|
194
|
+
// distChannel is a {code,name} ref.
|
|
195
|
+
"lead.dist_channel_code",
|
|
196
|
+
"lead.dist_channel_name",
|
|
197
|
+
// string[] of tag names — matches if ANY tag name matches.
|
|
198
|
+
"lead.tags",
|
|
199
|
+
] as const;
|
|
200
|
+
|
|
201
|
+
export type AutomationLeadFact = (typeof AUTOMATION_LEAD_FACTS)[number];
|
|
202
|
+
|
|
203
|
+
// feat-085 (F3): patient domain facts (derived from IPatient).
|
|
204
|
+
export const AUTOMATION_PATIENT_FACTS = [
|
|
205
|
+
"patient.status",
|
|
206
|
+
"patient.source_code",
|
|
207
|
+
"patient.source_name",
|
|
208
|
+
// string[] of tag names — matches if ANY tag name matches.
|
|
209
|
+
"patient.tags",
|
|
210
|
+
] as const;
|
|
211
|
+
|
|
212
|
+
export type AutomationPatientFact = (typeof AUTOMATION_PATIENT_FACTS)[number];
|
|
213
|
+
|
|
214
|
+
export type AutomationFact =
|
|
215
|
+
| AutomationAppointmentFact
|
|
216
|
+
| AutomationLeadFact
|
|
217
|
+
| AutomationPatientFact;
|
|
157
218
|
|
|
158
219
|
// ------------------------------------------------------
|
|
159
220
|
// Conditions (recursive AND/OR groups)
|
|
@@ -378,7 +439,12 @@ export interface IAutomationRunBranchCounts {
|
|
|
378
439
|
}
|
|
379
440
|
|
|
380
441
|
export interface IAutomationRunSample {
|
|
381
|
-
|
|
442
|
+
// feat-085 (F3): a run target may now be an appointment, a lead or a patient.
|
|
443
|
+
// `appointment_id` is kept (still set for appointment targets) for backward
|
|
444
|
+
// compatibility; `target_kind`/`target_id` are the domain-agnostic identity.
|
|
445
|
+
appointment_id?: string;
|
|
446
|
+
target_kind?: "appointment" | "lead" | "patient";
|
|
447
|
+
target_id?: string;
|
|
382
448
|
branch_id?: string;
|
|
383
449
|
// e.g. 'created' | 'already_existed' | 'not_matched' | 'suppressed_by_limit'
|
|
384
450
|
decision: string;
|
|
@@ -11,6 +11,8 @@ export declare const ExternalObjectTypeEnum: {
|
|
|
11
11
|
* desfecho do envio (sent/failed + os codes da feat-072).
|
|
12
12
|
*/
|
|
13
13
|
readonly EvoTask: "evo_task";
|
|
14
|
+
/** Campanha do hub-omni (feat-081) — liga mensagens/tickets à campanha que os originou. */
|
|
15
|
+
readonly Campaign: "campaign";
|
|
14
16
|
/** Nexus FinOps billing document */
|
|
15
17
|
readonly NexBilling: "nex_billing";
|
|
16
18
|
readonly NexContract: "nex_contract";
|
|
@@ -15,6 +15,8 @@ exports.ExternalObjectTypeEnum = {
|
|
|
15
15
|
* desfecho do envio (sent/failed + os codes da feat-072).
|
|
16
16
|
*/
|
|
17
17
|
EvoTask: "evo_task",
|
|
18
|
+
/** Campanha do hub-omni (feat-081) — liga mensagens/tickets à campanha que os originou. */
|
|
19
|
+
Campaign: "campaign",
|
|
18
20
|
/** Nexus FinOps billing document */
|
|
19
21
|
NexBilling: "nex_billing",
|
|
20
22
|
NexContract: "nex_contract",
|
|
@@ -15,6 +15,8 @@ export const ExternalObjectTypeEnum = {
|
|
|
15
15
|
* desfecho do envio (sent/failed + os codes da feat-072).
|
|
16
16
|
*/
|
|
17
17
|
EvoTask: "evo_task",
|
|
18
|
+
/** Campanha do hub-omni (feat-081) — liga mensagens/tickets à campanha que os originou. */
|
|
19
|
+
Campaign: "campaign",
|
|
18
20
|
/** Nexus FinOps billing document */
|
|
19
21
|
NexBilling: "nex_billing",
|
|
20
22
|
NexContract: "nex_contract",
|