evo360-types 1.3.405 → 1.3.407
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-integrations/zod-schemas.d.ts +589 -320
- package/dist/apps/evo-integrations/zod-schemas.js +32 -15
- package/dist/apps/evo-integrations/zod-schemas.ts +33 -16
- package/dist/apps/evo-med/calendar/zod-schemas.d.ts +336 -336
- package/dist/apps/evo-task/zod-schemas.d.ts +52 -52
- package/dist/apps/evo-task/zod-schemas.js +5 -0
- package/dist/apps/evo-task/zod-schemas.ts +5 -0
- package/dist/types/evo-integrations/index.d.ts +45 -4
- package/dist/types/evo-integrations/index.ts +45 -4
- package/dist/types/evo-task/index.d.ts +1 -0
- package/dist/types/evo-task/index.js +7 -0
- package/dist/types/evo-task/index.ts +7 -0
- package/package.json +1 -1
|
@@ -4,7 +4,7 @@ export declare const zTaskStatusSchema: z.ZodEnum<["not_started", "in_progress",
|
|
|
4
4
|
export declare const zTaskPrioritySchema: z.ZodEnum<["low", "medium", "high"]>;
|
|
5
5
|
export declare const zTaskSourceSchema: z.ZodEnum<["user", "automation_hub", "system"]>;
|
|
6
6
|
export declare const zTaskModeSchema: z.ZodEnum<["human", "auto"]>;
|
|
7
|
-
export declare const zTaskAutoHandlerSchema: z.ZodEnum<["notifications", "ai_agent", "invoices", "webhook", "custom", "lead_reactivation", "appointment_action", "appointment_reminder"]>;
|
|
7
|
+
export declare const zTaskAutoHandlerSchema: z.ZodEnum<["notifications", "ai_agent", "invoices", "webhook", "custom", "lead_reactivation", "appointment_action", "appointment_reminder", "evo-integrations.sync-run"]>;
|
|
8
8
|
export declare const zTaskRetryStrategySchema: z.ZodEnum<["fixed", "exponential"]>;
|
|
9
9
|
export declare const zTaskDedupScopeSchema: z.ZodEnum<["per_recipient", "per_recipient_and_object", "custom"]>;
|
|
10
10
|
export declare const zTaskDedupWindowSchema: z.ZodEnum<["same_day", "n_hours", "custom"]>;
|
|
@@ -188,19 +188,19 @@ export declare const zTaskDedupSchema: z.ZodObject<{
|
|
|
188
188
|
importance: z.ZodOptional<z.ZodNumber>;
|
|
189
189
|
}, z.ZodTypeAny, "passthrough">>;
|
|
190
190
|
export declare const zTaskAutoSpecSchema: z.ZodObject<{
|
|
191
|
-
handler: z.ZodEnum<["notifications", "ai_agent", "invoices", "webhook", "custom", "lead_reactivation", "appointment_action", "appointment_reminder"]>;
|
|
191
|
+
handler: z.ZodEnum<["notifications", "ai_agent", "invoices", "webhook", "custom", "lead_reactivation", "appointment_action", "appointment_reminder", "evo-integrations.sync-run"]>;
|
|
192
192
|
kind: z.ZodString;
|
|
193
193
|
version: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
194
194
|
payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
195
195
|
idempotency_key: z.ZodOptional<z.ZodString>;
|
|
196
196
|
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
197
|
-
handler: z.ZodEnum<["notifications", "ai_agent", "invoices", "webhook", "custom", "lead_reactivation", "appointment_action", "appointment_reminder"]>;
|
|
197
|
+
handler: z.ZodEnum<["notifications", "ai_agent", "invoices", "webhook", "custom", "lead_reactivation", "appointment_action", "appointment_reminder", "evo-integrations.sync-run"]>;
|
|
198
198
|
kind: z.ZodString;
|
|
199
199
|
version: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
200
200
|
payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
201
201
|
idempotency_key: z.ZodOptional<z.ZodString>;
|
|
202
202
|
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
203
|
-
handler: z.ZodEnum<["notifications", "ai_agent", "invoices", "webhook", "custom", "lead_reactivation", "appointment_action", "appointment_reminder"]>;
|
|
203
|
+
handler: z.ZodEnum<["notifications", "ai_agent", "invoices", "webhook", "custom", "lead_reactivation", "appointment_action", "appointment_reminder", "evo-integrations.sync-run"]>;
|
|
204
204
|
kind: z.ZodString;
|
|
205
205
|
version: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
206
206
|
payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
@@ -264,16 +264,16 @@ export declare const zTaskOnFailureSchema: z.ZodObject<{
|
|
|
264
264
|
priority?: "low" | "medium" | "high" | undefined;
|
|
265
265
|
}>>;
|
|
266
266
|
auto_fallbacks: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
267
|
-
handler: z.ZodEnum<["notifications", "ai_agent", "invoices", "webhook", "custom", "lead_reactivation", "appointment_action", "appointment_reminder"]>;
|
|
267
|
+
handler: z.ZodEnum<["notifications", "ai_agent", "invoices", "webhook", "custom", "lead_reactivation", "appointment_action", "appointment_reminder", "evo-integrations.sync-run"]>;
|
|
268
268
|
kind: z.ZodString;
|
|
269
269
|
payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
270
270
|
}, "strip", z.ZodTypeAny, {
|
|
271
271
|
kind: string;
|
|
272
|
-
handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder";
|
|
272
|
+
handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
|
|
273
273
|
payload: Record<string, unknown>;
|
|
274
274
|
}, {
|
|
275
275
|
kind: string;
|
|
276
|
-
handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder";
|
|
276
|
+
handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
|
|
277
277
|
payload: Record<string, unknown>;
|
|
278
278
|
}>, "many">>;
|
|
279
279
|
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
@@ -334,16 +334,16 @@ export declare const zTaskOnFailureSchema: z.ZodObject<{
|
|
|
334
334
|
priority?: "low" | "medium" | "high" | undefined;
|
|
335
335
|
}>>;
|
|
336
336
|
auto_fallbacks: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
337
|
-
handler: z.ZodEnum<["notifications", "ai_agent", "invoices", "webhook", "custom", "lead_reactivation", "appointment_action", "appointment_reminder"]>;
|
|
337
|
+
handler: z.ZodEnum<["notifications", "ai_agent", "invoices", "webhook", "custom", "lead_reactivation", "appointment_action", "appointment_reminder", "evo-integrations.sync-run"]>;
|
|
338
338
|
kind: z.ZodString;
|
|
339
339
|
payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
340
340
|
}, "strip", z.ZodTypeAny, {
|
|
341
341
|
kind: string;
|
|
342
|
-
handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder";
|
|
342
|
+
handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
|
|
343
343
|
payload: Record<string, unknown>;
|
|
344
344
|
}, {
|
|
345
345
|
kind: string;
|
|
346
|
-
handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder";
|
|
346
|
+
handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
|
|
347
347
|
payload: Record<string, unknown>;
|
|
348
348
|
}>, "many">>;
|
|
349
349
|
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
@@ -404,16 +404,16 @@ export declare const zTaskOnFailureSchema: z.ZodObject<{
|
|
|
404
404
|
priority?: "low" | "medium" | "high" | undefined;
|
|
405
405
|
}>>;
|
|
406
406
|
auto_fallbacks: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
407
|
-
handler: z.ZodEnum<["notifications", "ai_agent", "invoices", "webhook", "custom", "lead_reactivation", "appointment_action", "appointment_reminder"]>;
|
|
407
|
+
handler: z.ZodEnum<["notifications", "ai_agent", "invoices", "webhook", "custom", "lead_reactivation", "appointment_action", "appointment_reminder", "evo-integrations.sync-run"]>;
|
|
408
408
|
kind: z.ZodString;
|
|
409
409
|
payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
410
410
|
}, "strip", z.ZodTypeAny, {
|
|
411
411
|
kind: string;
|
|
412
|
-
handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder";
|
|
412
|
+
handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
|
|
413
413
|
payload: Record<string, unknown>;
|
|
414
414
|
}, {
|
|
415
415
|
kind: string;
|
|
416
|
-
handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder";
|
|
416
|
+
handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
|
|
417
417
|
payload: Record<string, unknown>;
|
|
418
418
|
}>, "many">>;
|
|
419
419
|
}, z.ZodTypeAny, "passthrough">>;
|
|
@@ -677,16 +677,16 @@ export declare const zTaskSchema: z.ZodObject<{
|
|
|
677
677
|
priority?: "low" | "medium" | "high" | undefined;
|
|
678
678
|
}>>;
|
|
679
679
|
auto_fallbacks: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
680
|
-
handler: z.ZodEnum<["notifications", "ai_agent", "invoices", "webhook", "custom", "lead_reactivation", "appointment_action", "appointment_reminder"]>;
|
|
680
|
+
handler: z.ZodEnum<["notifications", "ai_agent", "invoices", "webhook", "custom", "lead_reactivation", "appointment_action", "appointment_reminder", "evo-integrations.sync-run"]>;
|
|
681
681
|
kind: z.ZodString;
|
|
682
682
|
payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
683
683
|
}, "strip", z.ZodTypeAny, {
|
|
684
684
|
kind: string;
|
|
685
|
-
handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder";
|
|
685
|
+
handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
|
|
686
686
|
payload: Record<string, unknown>;
|
|
687
687
|
}, {
|
|
688
688
|
kind: string;
|
|
689
|
-
handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder";
|
|
689
|
+
handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
|
|
690
690
|
payload: Record<string, unknown>;
|
|
691
691
|
}>, "many">>;
|
|
692
692
|
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
@@ -747,16 +747,16 @@ export declare const zTaskSchema: z.ZodObject<{
|
|
|
747
747
|
priority?: "low" | "medium" | "high" | undefined;
|
|
748
748
|
}>>;
|
|
749
749
|
auto_fallbacks: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
750
|
-
handler: z.ZodEnum<["notifications", "ai_agent", "invoices", "webhook", "custom", "lead_reactivation", "appointment_action", "appointment_reminder"]>;
|
|
750
|
+
handler: z.ZodEnum<["notifications", "ai_agent", "invoices", "webhook", "custom", "lead_reactivation", "appointment_action", "appointment_reminder", "evo-integrations.sync-run"]>;
|
|
751
751
|
kind: z.ZodString;
|
|
752
752
|
payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
753
753
|
}, "strip", z.ZodTypeAny, {
|
|
754
754
|
kind: string;
|
|
755
|
-
handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder";
|
|
755
|
+
handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
|
|
756
756
|
payload: Record<string, unknown>;
|
|
757
757
|
}, {
|
|
758
758
|
kind: string;
|
|
759
|
-
handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder";
|
|
759
|
+
handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
|
|
760
760
|
payload: Record<string, unknown>;
|
|
761
761
|
}>, "many">>;
|
|
762
762
|
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
@@ -817,16 +817,16 @@ export declare const zTaskSchema: z.ZodObject<{
|
|
|
817
817
|
priority?: "low" | "medium" | "high" | undefined;
|
|
818
818
|
}>>;
|
|
819
819
|
auto_fallbacks: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
820
|
-
handler: z.ZodEnum<["notifications", "ai_agent", "invoices", "webhook", "custom", "lead_reactivation", "appointment_action", "appointment_reminder"]>;
|
|
820
|
+
handler: z.ZodEnum<["notifications", "ai_agent", "invoices", "webhook", "custom", "lead_reactivation", "appointment_action", "appointment_reminder", "evo-integrations.sync-run"]>;
|
|
821
821
|
kind: z.ZodString;
|
|
822
822
|
payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
823
823
|
}, "strip", z.ZodTypeAny, {
|
|
824
824
|
kind: string;
|
|
825
|
-
handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder";
|
|
825
|
+
handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
|
|
826
826
|
payload: Record<string, unknown>;
|
|
827
827
|
}, {
|
|
828
828
|
kind: string;
|
|
829
|
-
handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder";
|
|
829
|
+
handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
|
|
830
830
|
payload: Record<string, unknown>;
|
|
831
831
|
}>, "many">>;
|
|
832
832
|
}, z.ZodTypeAny, "passthrough">>>;
|
|
@@ -847,19 +847,19 @@ export declare const zTaskSchema: z.ZodObject<{
|
|
|
847
847
|
dispatched_attempts: z.ZodOptional<z.ZodNumber>;
|
|
848
848
|
}, z.ZodTypeAny, "passthrough">>>;
|
|
849
849
|
auto: z.ZodOptional<z.ZodObject<{
|
|
850
|
-
handler: z.ZodEnum<["notifications", "ai_agent", "invoices", "webhook", "custom", "lead_reactivation", "appointment_action", "appointment_reminder"]>;
|
|
850
|
+
handler: z.ZodEnum<["notifications", "ai_agent", "invoices", "webhook", "custom", "lead_reactivation", "appointment_action", "appointment_reminder", "evo-integrations.sync-run"]>;
|
|
851
851
|
kind: z.ZodString;
|
|
852
852
|
version: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
853
853
|
payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
854
854
|
idempotency_key: z.ZodOptional<z.ZodString>;
|
|
855
855
|
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
856
|
-
handler: z.ZodEnum<["notifications", "ai_agent", "invoices", "webhook", "custom", "lead_reactivation", "appointment_action", "appointment_reminder"]>;
|
|
856
|
+
handler: z.ZodEnum<["notifications", "ai_agent", "invoices", "webhook", "custom", "lead_reactivation", "appointment_action", "appointment_reminder", "evo-integrations.sync-run"]>;
|
|
857
857
|
kind: z.ZodString;
|
|
858
858
|
version: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
859
859
|
payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
860
860
|
idempotency_key: z.ZodOptional<z.ZodString>;
|
|
861
861
|
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
862
|
-
handler: z.ZodEnum<["notifications", "ai_agent", "invoices", "webhook", "custom", "lead_reactivation", "appointment_action", "appointment_reminder"]>;
|
|
862
|
+
handler: z.ZodEnum<["notifications", "ai_agent", "invoices", "webhook", "custom", "lead_reactivation", "appointment_action", "appointment_reminder", "evo-integrations.sync-run"]>;
|
|
863
863
|
kind: z.ZodString;
|
|
864
864
|
version: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
865
865
|
payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
@@ -1115,16 +1115,16 @@ export declare const zTaskSchema: z.ZodObject<{
|
|
|
1115
1115
|
priority?: "low" | "medium" | "high" | undefined;
|
|
1116
1116
|
}>>;
|
|
1117
1117
|
auto_fallbacks: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1118
|
-
handler: z.ZodEnum<["notifications", "ai_agent", "invoices", "webhook", "custom", "lead_reactivation", "appointment_action", "appointment_reminder"]>;
|
|
1118
|
+
handler: z.ZodEnum<["notifications", "ai_agent", "invoices", "webhook", "custom", "lead_reactivation", "appointment_action", "appointment_reminder", "evo-integrations.sync-run"]>;
|
|
1119
1119
|
kind: z.ZodString;
|
|
1120
1120
|
payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
1121
1121
|
}, "strip", z.ZodTypeAny, {
|
|
1122
1122
|
kind: string;
|
|
1123
|
-
handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder";
|
|
1123
|
+
handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
|
|
1124
1124
|
payload: Record<string, unknown>;
|
|
1125
1125
|
}, {
|
|
1126
1126
|
kind: string;
|
|
1127
|
-
handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder";
|
|
1127
|
+
handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
|
|
1128
1128
|
payload: Record<string, unknown>;
|
|
1129
1129
|
}>, "many">>;
|
|
1130
1130
|
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
@@ -1185,16 +1185,16 @@ export declare const zTaskSchema: z.ZodObject<{
|
|
|
1185
1185
|
priority?: "low" | "medium" | "high" | undefined;
|
|
1186
1186
|
}>>;
|
|
1187
1187
|
auto_fallbacks: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1188
|
-
handler: z.ZodEnum<["notifications", "ai_agent", "invoices", "webhook", "custom", "lead_reactivation", "appointment_action", "appointment_reminder"]>;
|
|
1188
|
+
handler: z.ZodEnum<["notifications", "ai_agent", "invoices", "webhook", "custom", "lead_reactivation", "appointment_action", "appointment_reminder", "evo-integrations.sync-run"]>;
|
|
1189
1189
|
kind: z.ZodString;
|
|
1190
1190
|
payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
1191
1191
|
}, "strip", z.ZodTypeAny, {
|
|
1192
1192
|
kind: string;
|
|
1193
|
-
handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder";
|
|
1193
|
+
handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
|
|
1194
1194
|
payload: Record<string, unknown>;
|
|
1195
1195
|
}, {
|
|
1196
1196
|
kind: string;
|
|
1197
|
-
handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder";
|
|
1197
|
+
handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
|
|
1198
1198
|
payload: Record<string, unknown>;
|
|
1199
1199
|
}>, "many">>;
|
|
1200
1200
|
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
@@ -1255,16 +1255,16 @@ export declare const zTaskSchema: z.ZodObject<{
|
|
|
1255
1255
|
priority?: "low" | "medium" | "high" | undefined;
|
|
1256
1256
|
}>>;
|
|
1257
1257
|
auto_fallbacks: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1258
|
-
handler: z.ZodEnum<["notifications", "ai_agent", "invoices", "webhook", "custom", "lead_reactivation", "appointment_action", "appointment_reminder"]>;
|
|
1258
|
+
handler: z.ZodEnum<["notifications", "ai_agent", "invoices", "webhook", "custom", "lead_reactivation", "appointment_action", "appointment_reminder", "evo-integrations.sync-run"]>;
|
|
1259
1259
|
kind: z.ZodString;
|
|
1260
1260
|
payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
1261
1261
|
}, "strip", z.ZodTypeAny, {
|
|
1262
1262
|
kind: string;
|
|
1263
|
-
handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder";
|
|
1263
|
+
handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
|
|
1264
1264
|
payload: Record<string, unknown>;
|
|
1265
1265
|
}, {
|
|
1266
1266
|
kind: string;
|
|
1267
|
-
handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder";
|
|
1267
|
+
handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
|
|
1268
1268
|
payload: Record<string, unknown>;
|
|
1269
1269
|
}>, "many">>;
|
|
1270
1270
|
}, z.ZodTypeAny, "passthrough">>>;
|
|
@@ -1285,19 +1285,19 @@ export declare const zTaskSchema: z.ZodObject<{
|
|
|
1285
1285
|
dispatched_attempts: z.ZodOptional<z.ZodNumber>;
|
|
1286
1286
|
}, z.ZodTypeAny, "passthrough">>>;
|
|
1287
1287
|
auto: z.ZodOptional<z.ZodObject<{
|
|
1288
|
-
handler: z.ZodEnum<["notifications", "ai_agent", "invoices", "webhook", "custom", "lead_reactivation", "appointment_action", "appointment_reminder"]>;
|
|
1288
|
+
handler: z.ZodEnum<["notifications", "ai_agent", "invoices", "webhook", "custom", "lead_reactivation", "appointment_action", "appointment_reminder", "evo-integrations.sync-run"]>;
|
|
1289
1289
|
kind: z.ZodString;
|
|
1290
1290
|
version: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
1291
1291
|
payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
1292
1292
|
idempotency_key: z.ZodOptional<z.ZodString>;
|
|
1293
1293
|
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
1294
|
-
handler: z.ZodEnum<["notifications", "ai_agent", "invoices", "webhook", "custom", "lead_reactivation", "appointment_action", "appointment_reminder"]>;
|
|
1294
|
+
handler: z.ZodEnum<["notifications", "ai_agent", "invoices", "webhook", "custom", "lead_reactivation", "appointment_action", "appointment_reminder", "evo-integrations.sync-run"]>;
|
|
1295
1295
|
kind: z.ZodString;
|
|
1296
1296
|
version: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
1297
1297
|
payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
1298
1298
|
idempotency_key: z.ZodOptional<z.ZodString>;
|
|
1299
1299
|
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
1300
|
-
handler: z.ZodEnum<["notifications", "ai_agent", "invoices", "webhook", "custom", "lead_reactivation", "appointment_action", "appointment_reminder"]>;
|
|
1300
|
+
handler: z.ZodEnum<["notifications", "ai_agent", "invoices", "webhook", "custom", "lead_reactivation", "appointment_action", "appointment_reminder", "evo-integrations.sync-run"]>;
|
|
1301
1301
|
kind: z.ZodString;
|
|
1302
1302
|
version: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
1303
1303
|
payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
@@ -1553,16 +1553,16 @@ export declare const zTaskSchema: z.ZodObject<{
|
|
|
1553
1553
|
priority?: "low" | "medium" | "high" | undefined;
|
|
1554
1554
|
}>>;
|
|
1555
1555
|
auto_fallbacks: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1556
|
-
handler: z.ZodEnum<["notifications", "ai_agent", "invoices", "webhook", "custom", "lead_reactivation", "appointment_action", "appointment_reminder"]>;
|
|
1556
|
+
handler: z.ZodEnum<["notifications", "ai_agent", "invoices", "webhook", "custom", "lead_reactivation", "appointment_action", "appointment_reminder", "evo-integrations.sync-run"]>;
|
|
1557
1557
|
kind: z.ZodString;
|
|
1558
1558
|
payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
1559
1559
|
}, "strip", z.ZodTypeAny, {
|
|
1560
1560
|
kind: string;
|
|
1561
|
-
handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder";
|
|
1561
|
+
handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
|
|
1562
1562
|
payload: Record<string, unknown>;
|
|
1563
1563
|
}, {
|
|
1564
1564
|
kind: string;
|
|
1565
|
-
handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder";
|
|
1565
|
+
handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
|
|
1566
1566
|
payload: Record<string, unknown>;
|
|
1567
1567
|
}>, "many">>;
|
|
1568
1568
|
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
@@ -1623,16 +1623,16 @@ export declare const zTaskSchema: z.ZodObject<{
|
|
|
1623
1623
|
priority?: "low" | "medium" | "high" | undefined;
|
|
1624
1624
|
}>>;
|
|
1625
1625
|
auto_fallbacks: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1626
|
-
handler: z.ZodEnum<["notifications", "ai_agent", "invoices", "webhook", "custom", "lead_reactivation", "appointment_action", "appointment_reminder"]>;
|
|
1626
|
+
handler: z.ZodEnum<["notifications", "ai_agent", "invoices", "webhook", "custom", "lead_reactivation", "appointment_action", "appointment_reminder", "evo-integrations.sync-run"]>;
|
|
1627
1627
|
kind: z.ZodString;
|
|
1628
1628
|
payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
1629
1629
|
}, "strip", z.ZodTypeAny, {
|
|
1630
1630
|
kind: string;
|
|
1631
|
-
handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder";
|
|
1631
|
+
handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
|
|
1632
1632
|
payload: Record<string, unknown>;
|
|
1633
1633
|
}, {
|
|
1634
1634
|
kind: string;
|
|
1635
|
-
handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder";
|
|
1635
|
+
handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
|
|
1636
1636
|
payload: Record<string, unknown>;
|
|
1637
1637
|
}>, "many">>;
|
|
1638
1638
|
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
@@ -1693,16 +1693,16 @@ export declare const zTaskSchema: z.ZodObject<{
|
|
|
1693
1693
|
priority?: "low" | "medium" | "high" | undefined;
|
|
1694
1694
|
}>>;
|
|
1695
1695
|
auto_fallbacks: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1696
|
-
handler: z.ZodEnum<["notifications", "ai_agent", "invoices", "webhook", "custom", "lead_reactivation", "appointment_action", "appointment_reminder"]>;
|
|
1696
|
+
handler: z.ZodEnum<["notifications", "ai_agent", "invoices", "webhook", "custom", "lead_reactivation", "appointment_action", "appointment_reminder", "evo-integrations.sync-run"]>;
|
|
1697
1697
|
kind: z.ZodString;
|
|
1698
1698
|
payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
1699
1699
|
}, "strip", z.ZodTypeAny, {
|
|
1700
1700
|
kind: string;
|
|
1701
|
-
handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder";
|
|
1701
|
+
handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
|
|
1702
1702
|
payload: Record<string, unknown>;
|
|
1703
1703
|
}, {
|
|
1704
1704
|
kind: string;
|
|
1705
|
-
handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder";
|
|
1705
|
+
handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
|
|
1706
1706
|
payload: Record<string, unknown>;
|
|
1707
1707
|
}>, "many">>;
|
|
1708
1708
|
}, z.ZodTypeAny, "passthrough">>>;
|
|
@@ -1723,19 +1723,19 @@ export declare const zTaskSchema: z.ZodObject<{
|
|
|
1723
1723
|
dispatched_attempts: z.ZodOptional<z.ZodNumber>;
|
|
1724
1724
|
}, z.ZodTypeAny, "passthrough">>>;
|
|
1725
1725
|
auto: z.ZodOptional<z.ZodObject<{
|
|
1726
|
-
handler: z.ZodEnum<["notifications", "ai_agent", "invoices", "webhook", "custom", "lead_reactivation", "appointment_action", "appointment_reminder"]>;
|
|
1726
|
+
handler: z.ZodEnum<["notifications", "ai_agent", "invoices", "webhook", "custom", "lead_reactivation", "appointment_action", "appointment_reminder", "evo-integrations.sync-run"]>;
|
|
1727
1727
|
kind: z.ZodString;
|
|
1728
1728
|
version: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
1729
1729
|
payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
1730
1730
|
idempotency_key: z.ZodOptional<z.ZodString>;
|
|
1731
1731
|
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
1732
|
-
handler: z.ZodEnum<["notifications", "ai_agent", "invoices", "webhook", "custom", "lead_reactivation", "appointment_action", "appointment_reminder"]>;
|
|
1732
|
+
handler: z.ZodEnum<["notifications", "ai_agent", "invoices", "webhook", "custom", "lead_reactivation", "appointment_action", "appointment_reminder", "evo-integrations.sync-run"]>;
|
|
1733
1733
|
kind: z.ZodString;
|
|
1734
1734
|
version: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
1735
1735
|
payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
1736
1736
|
idempotency_key: z.ZodOptional<z.ZodString>;
|
|
1737
1737
|
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
1738
|
-
handler: z.ZodEnum<["notifications", "ai_agent", "invoices", "webhook", "custom", "lead_reactivation", "appointment_action", "appointment_reminder"]>;
|
|
1738
|
+
handler: z.ZodEnum<["notifications", "ai_agent", "invoices", "webhook", "custom", "lead_reactivation", "appointment_action", "appointment_reminder", "evo-integrations.sync-run"]>;
|
|
1739
1739
|
kind: z.ZodString;
|
|
1740
1740
|
version: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
1741
1741
|
payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
@@ -1855,7 +1855,7 @@ export declare const zTaskExecutionSchema: z.ZodObject<{
|
|
|
1855
1855
|
deleted_at: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
1856
1856
|
} & {
|
|
1857
1857
|
taskId: z.ZodString;
|
|
1858
|
-
handler: z.ZodEnum<["notifications", "ai_agent", "invoices", "webhook", "custom", "lead_reactivation", "appointment_action", "appointment_reminder"]>;
|
|
1858
|
+
handler: z.ZodEnum<["notifications", "ai_agent", "invoices", "webhook", "custom", "lead_reactivation", "appointment_action", "appointment_reminder", "evo-integrations.sync-run"]>;
|
|
1859
1859
|
kind: z.ZodString;
|
|
1860
1860
|
status: z.ZodEnum<["success", "error", "retry"]>;
|
|
1861
1861
|
attempt: z.ZodNumber;
|
|
@@ -1895,7 +1895,7 @@ export declare const zTaskExecutionSchema: z.ZodObject<{
|
|
|
1895
1895
|
deleted_at: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
1896
1896
|
} & {
|
|
1897
1897
|
taskId: z.ZodString;
|
|
1898
|
-
handler: z.ZodEnum<["notifications", "ai_agent", "invoices", "webhook", "custom", "lead_reactivation", "appointment_action", "appointment_reminder"]>;
|
|
1898
|
+
handler: z.ZodEnum<["notifications", "ai_agent", "invoices", "webhook", "custom", "lead_reactivation", "appointment_action", "appointment_reminder", "evo-integrations.sync-run"]>;
|
|
1899
1899
|
kind: z.ZodString;
|
|
1900
1900
|
status: z.ZodEnum<["success", "error", "retry"]>;
|
|
1901
1901
|
attempt: z.ZodNumber;
|
|
@@ -1935,7 +1935,7 @@ export declare const zTaskExecutionSchema: z.ZodObject<{
|
|
|
1935
1935
|
deleted_at: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
1936
1936
|
} & {
|
|
1937
1937
|
taskId: z.ZodString;
|
|
1938
|
-
handler: z.ZodEnum<["notifications", "ai_agent", "invoices", "webhook", "custom", "lead_reactivation", "appointment_action", "appointment_reminder"]>;
|
|
1938
|
+
handler: z.ZodEnum<["notifications", "ai_agent", "invoices", "webhook", "custom", "lead_reactivation", "appointment_action", "appointment_reminder", "evo-integrations.sync-run"]>;
|
|
1939
1939
|
kind: z.ZodString;
|
|
1940
1940
|
status: z.ZodEnum<["success", "error", "retry"]>;
|
|
1941
1941
|
attempt: z.ZodNumber;
|
|
@@ -36,6 +36,11 @@ exports.zTaskAutoHandlerSchema = zod_1.z.enum([
|
|
|
36
36
|
// feat-048: handler do lembrete de consulta (fan-out multi-canal via
|
|
37
37
|
// `notification_config` da agenda → N tasks `notifications.send`).
|
|
38
38
|
"appointment_reminder",
|
|
39
|
+
// feat-078: sync de agenda do evo-integrations. O ponto no nome é proposital:
|
|
40
|
+
// `resolveHandlerTopic` faz `${handler}.execute_requests` e a CF já escuta
|
|
41
|
+
// `evo-integrations.sync-run.execute_requests`. Sem isso, criar a task de sync
|
|
42
|
+
// via TaskModel.setProperties estoura ZodError.
|
|
43
|
+
"evo-integrations.sync-run",
|
|
39
44
|
]);
|
|
40
45
|
exports.zTaskRetryStrategySchema = zod_1.z.enum(["fixed", "exponential"]);
|
|
41
46
|
exports.zTaskDedupScopeSchema = zod_1.z.enum([
|
|
@@ -39,6 +39,11 @@ export const zTaskAutoHandlerSchema = z.enum([
|
|
|
39
39
|
// feat-048: handler do lembrete de consulta (fan-out multi-canal via
|
|
40
40
|
// `notification_config` da agenda → N tasks `notifications.send`).
|
|
41
41
|
"appointment_reminder",
|
|
42
|
+
// feat-078: sync de agenda do evo-integrations. O ponto no nome é proposital:
|
|
43
|
+
// `resolveHandlerTopic` faz `${handler}.execute_requests` e a CF já escuta
|
|
44
|
+
// `evo-integrations.sync-run.execute_requests`. Sem isso, criar a task de sync
|
|
45
|
+
// via TaskModel.setProperties estoura ZodError.
|
|
46
|
+
"evo-integrations.sync-run",
|
|
42
47
|
]);
|
|
43
48
|
|
|
44
49
|
export const zTaskRetryStrategySchema = z.enum(["fixed", "exponential"]);
|
|
@@ -46,6 +46,13 @@ export interface IIntegrationsAdapterDoc extends IFireDoc {
|
|
|
46
46
|
* Precedência: calendar.integration.workflow_overrides → este doc → adapter code default.
|
|
47
47
|
*/
|
|
48
48
|
default_workflow_urls: Partial<Record<CapabilityName, string>>;
|
|
49
|
+
/**
|
|
50
|
+
* Config de janelas default do adapter — largura/cadência que valem pra
|
|
51
|
+
* qualquer calendar que não sobrescreva.
|
|
52
|
+
* Precedência: calendar.integration.sync_config → este doc → default do código.
|
|
53
|
+
* Merge é campo-a-campo (ver ISyncWindowConfig), não substituição de bloco.
|
|
54
|
+
*/
|
|
55
|
+
default_sync_config?: ISyncConfig | null;
|
|
49
56
|
supported_capabilities: readonly CapabilityName[];
|
|
50
57
|
auth_schema_version?: number;
|
|
51
58
|
}
|
|
@@ -74,9 +81,32 @@ export interface ISyncedHashes {
|
|
|
74
81
|
}
|
|
75
82
|
export interface ISyncState extends IFireDoc {
|
|
76
83
|
calendar_id: string;
|
|
84
|
+
/**
|
|
85
|
+
* Escalar: última run de QUALQUER janela. Não distingue qual janela rodou,
|
|
86
|
+
* então um `cold` de 5 min atrás faz o `hot` parecer fresco. Use
|
|
87
|
+
* `last_run_by_window` pra decidir cadência/frescor por janela.
|
|
88
|
+
*/
|
|
77
89
|
last_sync_at?: Date | null;
|
|
78
90
|
last_window_type?: SyncWindowType;
|
|
91
|
+
/**
|
|
92
|
+
* Timestamp da última run POR janela. Sucessor de `last_sync_at` pra
|
|
93
|
+
* qualquer decisão de cadência ou de freshness gate.
|
|
94
|
+
*/
|
|
95
|
+
last_run_by_window?: Partial<Record<SyncWindowType, Date>>;
|
|
96
|
+
/**
|
|
97
|
+
* Sobrescrito INTEIRO a cada run (o engine grava o snapshot da janela que
|
|
98
|
+
* acabou de rodar). Janelas disjuntas — ex.: `hot` -7/+14 vs
|
|
99
|
+
* `recent_reconcile` -30/-8 — destroem o cache uma da outra, e a run seguinte
|
|
100
|
+
* re-processa 100% da janela. Sucedido por `hashes_by_bucket`; mantido por
|
|
101
|
+
* compat durante a migração.
|
|
102
|
+
*/
|
|
79
103
|
last_synced_hashes: ISyncedHashes;
|
|
104
|
+
/**
|
|
105
|
+
* Hashes particionados por bucket, pra que cada janela preserve o próprio
|
|
106
|
+
* cache. Chave do bucket = window_type (ex.: `hot`) ou, em janelas longas
|
|
107
|
+
* chunkadas, o chunk (ex.: `warm:2026-08`).
|
|
108
|
+
*/
|
|
109
|
+
hashes_by_bucket?: Record<string, ISyncedHashes>;
|
|
80
110
|
last_coveredWindow?: ICoveredWindow | null;
|
|
81
111
|
}
|
|
82
112
|
export type SyncRunStatus = "success" | "partial" | "error";
|
|
@@ -106,12 +136,23 @@ export interface ISyncRunEvent {
|
|
|
106
136
|
n8n_calls: number;
|
|
107
137
|
errors?: ISyncRunEventError[];
|
|
108
138
|
}
|
|
139
|
+
/**
|
|
140
|
+
* Todos os campos são opcionais: a config resolvida é um merge campo-a-campo de
|
|
141
|
+
* calendar.integration.sync_config → adapter.default_sync_config → default do
|
|
142
|
+
* código. Um calendar que só quer ajustar `window_days` omite o resto e herda.
|
|
143
|
+
*
|
|
144
|
+
* `window_days` é indivisível de propósito: `past` sem `future` não descreve
|
|
145
|
+
* janela nenhuma, e o resolver (`buildRequestedWindow`) consome o par.
|
|
146
|
+
*/
|
|
109
147
|
export interface ISyncWindowConfig {
|
|
110
|
-
enabled
|
|
148
|
+
enabled?: boolean;
|
|
111
149
|
/** Cadência em minutos. Ex.: hot=60, warm=360, cold=10080 (semanal). */
|
|
112
|
-
cadence_minutes
|
|
113
|
-
/**
|
|
114
|
-
|
|
150
|
+
cadence_minutes?: number;
|
|
151
|
+
/**
|
|
152
|
+
* Janela absoluta em dias a partir de "hoje". `future` pode ser negativo —
|
|
153
|
+
* janela que termina no passado (ex.: recent_reconcile: past=30, future=-8).
|
|
154
|
+
*/
|
|
155
|
+
window_days?: {
|
|
115
156
|
past: number;
|
|
116
157
|
future: number;
|
|
117
158
|
};
|
|
@@ -114,6 +114,13 @@ export interface IIntegrationsAdapterDoc extends IFireDoc {
|
|
|
114
114
|
* Precedência: calendar.integration.workflow_overrides → este doc → adapter code default.
|
|
115
115
|
*/
|
|
116
116
|
default_workflow_urls: Partial<Record<CapabilityName, string>>;
|
|
117
|
+
/**
|
|
118
|
+
* Config de janelas default do adapter — largura/cadência que valem pra
|
|
119
|
+
* qualquer calendar que não sobrescreva.
|
|
120
|
+
* Precedência: calendar.integration.sync_config → este doc → default do código.
|
|
121
|
+
* Merge é campo-a-campo (ver ISyncWindowConfig), não substituição de bloco.
|
|
122
|
+
*/
|
|
123
|
+
default_sync_config?: ISyncConfig | null;
|
|
117
124
|
supported_capabilities: readonly CapabilityName[];
|
|
118
125
|
auth_schema_version?: number;
|
|
119
126
|
}
|
|
@@ -158,9 +165,32 @@ export interface ISyncedHashes {
|
|
|
158
165
|
|
|
159
166
|
export interface ISyncState extends IFireDoc {
|
|
160
167
|
calendar_id: string;
|
|
168
|
+
/**
|
|
169
|
+
* Escalar: última run de QUALQUER janela. Não distingue qual janela rodou,
|
|
170
|
+
* então um `cold` de 5 min atrás faz o `hot` parecer fresco. Use
|
|
171
|
+
* `last_run_by_window` pra decidir cadência/frescor por janela.
|
|
172
|
+
*/
|
|
161
173
|
last_sync_at?: Date | null;
|
|
162
174
|
last_window_type?: SyncWindowType;
|
|
175
|
+
/**
|
|
176
|
+
* Timestamp da última run POR janela. Sucessor de `last_sync_at` pra
|
|
177
|
+
* qualquer decisão de cadência ou de freshness gate.
|
|
178
|
+
*/
|
|
179
|
+
last_run_by_window?: Partial<Record<SyncWindowType, Date>>;
|
|
180
|
+
/**
|
|
181
|
+
* Sobrescrito INTEIRO a cada run (o engine grava o snapshot da janela que
|
|
182
|
+
* acabou de rodar). Janelas disjuntas — ex.: `hot` -7/+14 vs
|
|
183
|
+
* `recent_reconcile` -30/-8 — destroem o cache uma da outra, e a run seguinte
|
|
184
|
+
* re-processa 100% da janela. Sucedido por `hashes_by_bucket`; mantido por
|
|
185
|
+
* compat durante a migração.
|
|
186
|
+
*/
|
|
163
187
|
last_synced_hashes: ISyncedHashes;
|
|
188
|
+
/**
|
|
189
|
+
* Hashes particionados por bucket, pra que cada janela preserve o próprio
|
|
190
|
+
* cache. Chave do bucket = window_type (ex.: `hot`) ou, em janelas longas
|
|
191
|
+
* chunkadas, o chunk (ex.: `warm:2026-08`).
|
|
192
|
+
*/
|
|
193
|
+
hashes_by_bucket?: Record<string, ISyncedHashes>;
|
|
164
194
|
last_coveredWindow?: ICoveredWindow | null;
|
|
165
195
|
}
|
|
166
196
|
|
|
@@ -204,12 +234,23 @@ export interface ISyncRunEvent {
|
|
|
204
234
|
// Ver IMedCalendar em evo-types/src/types/evo-med/calendar.
|
|
205
235
|
// ======================================================
|
|
206
236
|
|
|
237
|
+
/**
|
|
238
|
+
* Todos os campos são opcionais: a config resolvida é um merge campo-a-campo de
|
|
239
|
+
* calendar.integration.sync_config → adapter.default_sync_config → default do
|
|
240
|
+
* código. Um calendar que só quer ajustar `window_days` omite o resto e herda.
|
|
241
|
+
*
|
|
242
|
+
* `window_days` é indivisível de propósito: `past` sem `future` não descreve
|
|
243
|
+
* janela nenhuma, e o resolver (`buildRequestedWindow`) consome o par.
|
|
244
|
+
*/
|
|
207
245
|
export interface ISyncWindowConfig {
|
|
208
|
-
enabled
|
|
246
|
+
enabled?: boolean;
|
|
209
247
|
/** Cadência em minutos. Ex.: hot=60, warm=360, cold=10080 (semanal). */
|
|
210
|
-
cadence_minutes
|
|
211
|
-
/**
|
|
212
|
-
|
|
248
|
+
cadence_minutes?: number;
|
|
249
|
+
/**
|
|
250
|
+
* Janela absoluta em dias a partir de "hoje". `future` pode ser negativo —
|
|
251
|
+
* janela que termina no passado (ex.: recent_reconcile: past=30, future=-8).
|
|
252
|
+
*/
|
|
253
|
+
window_days?: {
|
|
213
254
|
past: number;
|
|
214
255
|
future: number;
|
|
215
256
|
};
|
|
@@ -55,6 +55,7 @@ export declare const TaskAutoHandlerEnum: {
|
|
|
55
55
|
readonly LeadReactivation: "lead_reactivation";
|
|
56
56
|
readonly AppointmentAction: "appointment_action";
|
|
57
57
|
readonly AppointmentReminder: "appointment_reminder";
|
|
58
|
+
readonly IntegrationsSyncRun: "evo-integrations.sync-run";
|
|
58
59
|
};
|
|
59
60
|
export type TaskAutoHandler = (typeof TaskAutoHandlerEnum)[keyof typeof TaskAutoHandlerEnum];
|
|
60
61
|
export declare const TaskRetryStrategyEnum: {
|
|
@@ -98,6 +98,13 @@ exports.TaskAutoHandlerEnum = {
|
|
|
98
98
|
// por canal habilitado (WhatsApp/e-mail), com quick-reply de confirmar/remarcar.
|
|
99
99
|
// Tópico PubSub do executor: `appointment_reminder.execute_requests`.
|
|
100
100
|
AppointmentReminder: "appointment_reminder",
|
|
101
|
+
// feat-078: handler que roda um sync de agenda do evo-integrations. O valor
|
|
102
|
+
// é o nome do handler COM ponto de propósito — `resolveHandlerTopic` faz
|
|
103
|
+
// `${handler}.execute_requests`, e a CF `integrations_sync` já escuta
|
|
104
|
+
// `evo-integrations.sync-run.execute_requests` (= SYNC_RUN_HANDLER em
|
|
105
|
+
// types/evo-integrations). Permite que o `/force` roteie pelo task-runner e
|
|
106
|
+
// herde retry/backoff/DLQ, em vez de montar a mensagem PubSub na mão.
|
|
107
|
+
IntegrationsSyncRun: "evo-integrations.sync-run",
|
|
101
108
|
};
|
|
102
109
|
// ----- Retry policy
|
|
103
110
|
exports.TaskRetryStrategyEnum = {
|
|
@@ -109,6 +109,13 @@ export const TaskAutoHandlerEnum = {
|
|
|
109
109
|
// por canal habilitado (WhatsApp/e-mail), com quick-reply de confirmar/remarcar.
|
|
110
110
|
// Tópico PubSub do executor: `appointment_reminder.execute_requests`.
|
|
111
111
|
AppointmentReminder: "appointment_reminder",
|
|
112
|
+
// feat-078: handler que roda um sync de agenda do evo-integrations. O valor
|
|
113
|
+
// é o nome do handler COM ponto de propósito — `resolveHandlerTopic` faz
|
|
114
|
+
// `${handler}.execute_requests`, e a CF `integrations_sync` já escuta
|
|
115
|
+
// `evo-integrations.sync-run.execute_requests` (= SYNC_RUN_HANDLER em
|
|
116
|
+
// types/evo-integrations). Permite que o `/force` roteie pelo task-runner e
|
|
117
|
+
// herde retry/backoff/DLQ, em vez de montar a mensagem PubSub na mão.
|
|
118
|
+
IntegrationsSyncRun: "evo-integrations.sync-run",
|
|
112
119
|
} as const;
|
|
113
120
|
|
|
114
121
|
export type TaskAutoHandler =
|