evo360-types 1.3.324 → 1.3.328
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 +755 -0
- package/dist/apps/evo-integrations/zod-schemas.js +117 -0
- package/dist/apps/evo-integrations/zod-schemas.ts +130 -0
- package/dist/apps/evo-med/calendar/zod-schemas.d.ts +792 -0
- package/dist/apps/evo-med/calendar/zod-schemas.js +2 -0
- package/dist/apps/evo-med/calendar/zod-schemas.ts +2 -0
- package/dist/apps/evo-task/zod-schemas.d.ts +68 -4
- package/dist/apps/evo-task/zod-schemas.js +12 -1
- package/dist/apps/evo-task/zod-schemas.ts +12 -0
- package/dist/apps/evo-task-runner/index.d.ts +1 -0
- package/dist/apps/evo-task-runner/index.js +17 -0
- package/dist/apps/evo-task-runner/index.ts +1 -0
- package/dist/apps/evo-task-runner/zod-schemas.d.ts +30 -0
- package/dist/apps/evo-task-runner/zod-schemas.js +15 -0
- package/dist/apps/evo-task-runner/zod-schemas.ts +15 -0
- package/dist/apps/evo-tenant/zod-schemas.d.ts +3 -3
- package/dist/apps/evo-tenant/zod-schemas.js +1 -1
- package/dist/apps/evo-tenant/zod-schemas.ts +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/index.ts +3 -0
- package/dist/types/evo-integrations/fb_collections.d.ts +5 -0
- package/dist/types/evo-integrations/fb_collections.js +14 -0
- package/dist/types/evo-integrations/fb_collections.ts +13 -0
- package/dist/types/evo-integrations/index.d.ts +133 -0
- package/dist/types/evo-integrations/index.js +71 -0
- package/dist/types/evo-integrations/index.ts +232 -0
- package/dist/types/evo-med/calendar/index.d.ts +2 -0
- package/dist/types/evo-med/calendar/index.ts +3 -0
- package/dist/types/evo-task/index.d.ts +9 -0
- package/dist/types/evo-task/index.js +1 -0
- package/dist/types/evo-task/index.ts +13 -0
- package/dist/types/evo-task-runner/fb_collections.d.ts +1 -0
- package/dist/types/evo-task-runner/fb_collections.js +8 -0
- package/dist/types/evo-task-runner/fb_collections.ts +5 -0
- package/dist/types/evo-task-runner/index.d.ts +4 -0
- package/dist/types/evo-task-runner/index.js +23 -1
- package/dist/types/evo-task-runner/index.ts +11 -0
- package/dist/types/evo-tenant/index.d.ts +1 -1
- package/dist/types/evo-tenant/index.ts +1 -1
- package/package.json +1 -1
|
@@ -4,6 +4,7 @@ exports.zMedCalendarSchema = 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("../people/zod-schemas");
|
|
7
|
+
const zod_schemas_3 = require("../../evo-integrations/zod-schemas");
|
|
7
8
|
exports.zMedCalendarSchema = zod_schemas_1.zFireDocSchema
|
|
8
9
|
.extend({
|
|
9
10
|
calendarId: zod_1.z.string().min(1).max(30),
|
|
@@ -42,5 +43,6 @@ exports.zMedCalendarSchema = zod_schemas_1.zFireDocSchema
|
|
|
42
43
|
.default([1, 2, 3, 4, 5])
|
|
43
44
|
.optional(),
|
|
44
45
|
available_for_hubia: zod_1.z.boolean().default(false).optional(),
|
|
46
|
+
integration: zod_schemas_3.zMedCalendarIntegrationSchema.optional(),
|
|
45
47
|
})
|
|
46
48
|
.passthrough();
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { zFireDocSchema, zTagSchema } from "../../shared/zod-schemas";
|
|
3
3
|
import { zAppointmentCountersSchema } from "../people/zod-schemas";
|
|
4
|
+
import { zMedCalendarIntegrationSchema } from "../../evo-integrations/zod-schemas";
|
|
4
5
|
|
|
5
6
|
export const zMedCalendarSchema = zFireDocSchema
|
|
6
7
|
.extend({
|
|
@@ -40,5 +41,6 @@ export const zMedCalendarSchema = zFireDocSchema
|
|
|
40
41
|
.default([1, 2, 3, 4, 5])
|
|
41
42
|
.optional(),
|
|
42
43
|
available_for_hubia: z.boolean().default(false).optional(),
|
|
44
|
+
integration: zMedCalendarIntegrationSchema.optional(),
|
|
43
45
|
})
|
|
44
46
|
.passthrough();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
export declare const zTaskActionSchema: z.ZodEnum<["CREATE_TASK", "DELETE_TASK", "UPDATE_TASK"]>;
|
|
3
|
-
export declare const zTaskStatusSchema: z.ZodEnum<["not_started", "in_progress", "completed", "failed", "cancelled", "on_hold", "suppressed"]>;
|
|
3
|
+
export declare const zTaskStatusSchema: z.ZodEnum<["not_started", "in_progress", "completed", "failed", "cancelled", "on_hold", "suppressed", "dead_letter"]>;
|
|
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"]>;
|
|
@@ -79,6 +79,22 @@ export declare const zTaskLockSchema: z.ZodObject<{
|
|
|
79
79
|
locked_by: z.ZodString;
|
|
80
80
|
lock_until: z.ZodDate;
|
|
81
81
|
}, z.ZodTypeAny, "passthrough">>;
|
|
82
|
+
export declare const zTaskRunnerStateSchema: z.ZodObject<{
|
|
83
|
+
reclaim_count: z.ZodOptional<z.ZodNumber>;
|
|
84
|
+
fallback_index: z.ZodOptional<z.ZodNumber>;
|
|
85
|
+
last_dispatch_at: z.ZodOptional<z.ZodDate>;
|
|
86
|
+
dispatched_attempts: z.ZodOptional<z.ZodNumber>;
|
|
87
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
88
|
+
reclaim_count: z.ZodOptional<z.ZodNumber>;
|
|
89
|
+
fallback_index: z.ZodOptional<z.ZodNumber>;
|
|
90
|
+
last_dispatch_at: z.ZodOptional<z.ZodDate>;
|
|
91
|
+
dispatched_attempts: z.ZodOptional<z.ZodNumber>;
|
|
92
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
93
|
+
reclaim_count: z.ZodOptional<z.ZodNumber>;
|
|
94
|
+
fallback_index: z.ZodOptional<z.ZodNumber>;
|
|
95
|
+
last_dispatch_at: z.ZodOptional<z.ZodDate>;
|
|
96
|
+
dispatched_attempts: z.ZodOptional<z.ZodNumber>;
|
|
97
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
82
98
|
export declare const zTaskRetryPolicySchema: z.ZodObject<{
|
|
83
99
|
max_attempts: z.ZodNumber;
|
|
84
100
|
attempt: z.ZodNumber;
|
|
@@ -422,7 +438,7 @@ export declare const zTaskSchema: z.ZodObject<{
|
|
|
422
438
|
} & {
|
|
423
439
|
title: z.ZodString;
|
|
424
440
|
description: z.ZodOptional<z.ZodString>;
|
|
425
|
-
status: z.ZodEnum<["not_started", "in_progress", "completed", "failed", "cancelled", "on_hold", "suppressed"]>;
|
|
441
|
+
status: z.ZodEnum<["not_started", "in_progress", "completed", "failed", "cancelled", "on_hold", "suppressed", "dead_letter"]>;
|
|
426
442
|
priority: z.ZodOptional<z.ZodEnum<["low", "medium", "high"]>>;
|
|
427
443
|
importance: z.ZodOptional<z.ZodNumber>;
|
|
428
444
|
source: z.ZodEnum<["user", "automation_hub", "system"]>;
|
|
@@ -814,6 +830,22 @@ export declare const zTaskSchema: z.ZodObject<{
|
|
|
814
830
|
payload: Record<string, unknown>;
|
|
815
831
|
}>, "many">>;
|
|
816
832
|
}, z.ZodTypeAny, "passthrough">>>;
|
|
833
|
+
runner_state: z.ZodOptional<z.ZodObject<{
|
|
834
|
+
reclaim_count: z.ZodOptional<z.ZodNumber>;
|
|
835
|
+
fallback_index: z.ZodOptional<z.ZodNumber>;
|
|
836
|
+
last_dispatch_at: z.ZodOptional<z.ZodDate>;
|
|
837
|
+
dispatched_attempts: z.ZodOptional<z.ZodNumber>;
|
|
838
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
839
|
+
reclaim_count: z.ZodOptional<z.ZodNumber>;
|
|
840
|
+
fallback_index: z.ZodOptional<z.ZodNumber>;
|
|
841
|
+
last_dispatch_at: z.ZodOptional<z.ZodDate>;
|
|
842
|
+
dispatched_attempts: z.ZodOptional<z.ZodNumber>;
|
|
843
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
844
|
+
reclaim_count: z.ZodOptional<z.ZodNumber>;
|
|
845
|
+
fallback_index: z.ZodOptional<z.ZodNumber>;
|
|
846
|
+
last_dispatch_at: z.ZodOptional<z.ZodDate>;
|
|
847
|
+
dispatched_attempts: z.ZodOptional<z.ZodNumber>;
|
|
848
|
+
}, z.ZodTypeAny, "passthrough">>>;
|
|
817
849
|
auto: z.ZodOptional<z.ZodObject<{
|
|
818
850
|
handler: z.ZodEnum<["notifications", "ai_agent", "invoices", "webhook", "custom"]>;
|
|
819
851
|
kind: z.ZodString;
|
|
@@ -844,7 +876,7 @@ export declare const zTaskSchema: z.ZodObject<{
|
|
|
844
876
|
} & {
|
|
845
877
|
title: z.ZodString;
|
|
846
878
|
description: z.ZodOptional<z.ZodString>;
|
|
847
|
-
status: z.ZodEnum<["not_started", "in_progress", "completed", "failed", "cancelled", "on_hold", "suppressed"]>;
|
|
879
|
+
status: z.ZodEnum<["not_started", "in_progress", "completed", "failed", "cancelled", "on_hold", "suppressed", "dead_letter"]>;
|
|
848
880
|
priority: z.ZodOptional<z.ZodEnum<["low", "medium", "high"]>>;
|
|
849
881
|
importance: z.ZodOptional<z.ZodNumber>;
|
|
850
882
|
source: z.ZodEnum<["user", "automation_hub", "system"]>;
|
|
@@ -1236,6 +1268,22 @@ export declare const zTaskSchema: z.ZodObject<{
|
|
|
1236
1268
|
payload: Record<string, unknown>;
|
|
1237
1269
|
}>, "many">>;
|
|
1238
1270
|
}, z.ZodTypeAny, "passthrough">>>;
|
|
1271
|
+
runner_state: z.ZodOptional<z.ZodObject<{
|
|
1272
|
+
reclaim_count: z.ZodOptional<z.ZodNumber>;
|
|
1273
|
+
fallback_index: z.ZodOptional<z.ZodNumber>;
|
|
1274
|
+
last_dispatch_at: z.ZodOptional<z.ZodDate>;
|
|
1275
|
+
dispatched_attempts: z.ZodOptional<z.ZodNumber>;
|
|
1276
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
1277
|
+
reclaim_count: z.ZodOptional<z.ZodNumber>;
|
|
1278
|
+
fallback_index: z.ZodOptional<z.ZodNumber>;
|
|
1279
|
+
last_dispatch_at: z.ZodOptional<z.ZodDate>;
|
|
1280
|
+
dispatched_attempts: z.ZodOptional<z.ZodNumber>;
|
|
1281
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
1282
|
+
reclaim_count: z.ZodOptional<z.ZodNumber>;
|
|
1283
|
+
fallback_index: z.ZodOptional<z.ZodNumber>;
|
|
1284
|
+
last_dispatch_at: z.ZodOptional<z.ZodDate>;
|
|
1285
|
+
dispatched_attempts: z.ZodOptional<z.ZodNumber>;
|
|
1286
|
+
}, z.ZodTypeAny, "passthrough">>>;
|
|
1239
1287
|
auto: z.ZodOptional<z.ZodObject<{
|
|
1240
1288
|
handler: z.ZodEnum<["notifications", "ai_agent", "invoices", "webhook", "custom"]>;
|
|
1241
1289
|
kind: z.ZodString;
|
|
@@ -1266,7 +1314,7 @@ export declare const zTaskSchema: z.ZodObject<{
|
|
|
1266
1314
|
} & {
|
|
1267
1315
|
title: z.ZodString;
|
|
1268
1316
|
description: z.ZodOptional<z.ZodString>;
|
|
1269
|
-
status: z.ZodEnum<["not_started", "in_progress", "completed", "failed", "cancelled", "on_hold", "suppressed"]>;
|
|
1317
|
+
status: z.ZodEnum<["not_started", "in_progress", "completed", "failed", "cancelled", "on_hold", "suppressed", "dead_letter"]>;
|
|
1270
1318
|
priority: z.ZodOptional<z.ZodEnum<["low", "medium", "high"]>>;
|
|
1271
1319
|
importance: z.ZodOptional<z.ZodNumber>;
|
|
1272
1320
|
source: z.ZodEnum<["user", "automation_hub", "system"]>;
|
|
@@ -1658,6 +1706,22 @@ export declare const zTaskSchema: z.ZodObject<{
|
|
|
1658
1706
|
payload: Record<string, unknown>;
|
|
1659
1707
|
}>, "many">>;
|
|
1660
1708
|
}, z.ZodTypeAny, "passthrough">>>;
|
|
1709
|
+
runner_state: z.ZodOptional<z.ZodObject<{
|
|
1710
|
+
reclaim_count: z.ZodOptional<z.ZodNumber>;
|
|
1711
|
+
fallback_index: z.ZodOptional<z.ZodNumber>;
|
|
1712
|
+
last_dispatch_at: z.ZodOptional<z.ZodDate>;
|
|
1713
|
+
dispatched_attempts: z.ZodOptional<z.ZodNumber>;
|
|
1714
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
1715
|
+
reclaim_count: z.ZodOptional<z.ZodNumber>;
|
|
1716
|
+
fallback_index: z.ZodOptional<z.ZodNumber>;
|
|
1717
|
+
last_dispatch_at: z.ZodOptional<z.ZodDate>;
|
|
1718
|
+
dispatched_attempts: z.ZodOptional<z.ZodNumber>;
|
|
1719
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
1720
|
+
reclaim_count: z.ZodOptional<z.ZodNumber>;
|
|
1721
|
+
fallback_index: z.ZodOptional<z.ZodNumber>;
|
|
1722
|
+
last_dispatch_at: z.ZodOptional<z.ZodDate>;
|
|
1723
|
+
dispatched_attempts: z.ZodOptional<z.ZodNumber>;
|
|
1724
|
+
}, z.ZodTypeAny, "passthrough">>>;
|
|
1661
1725
|
auto: z.ZodOptional<z.ZodObject<{
|
|
1662
1726
|
handler: z.ZodEnum<["notifications", "ai_agent", "invoices", "webhook", "custom"]>;
|
|
1663
1727
|
kind: z.ZodString;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.zTaskLogSchema = exports.zTaskExecutionSchema = exports.zTaskExecutionProviderSchema = exports.zTaskExecutionErrorSchema = exports.zTaskCommentSchema = exports.zTaskCommentAuthorSchema = exports.zTaskSchema = exports.zTaskCreatorSchema = exports.zTaskOnFailureSchema = exports.zTaskAutoSpecSchema = exports.zTaskDedupSchema = exports.zTaskRetryPolicySchema = exports.zTaskLockSchema = exports.zTaskUserAssigneeSchema = exports.zTaskScheduleSchema = exports.zTaskExternalLinkSchema = exports.zExternalLinkSchema = exports.zTaskExecutionStatusSchema = exports.zTaskExternalObjectTypeSchema = exports.zExternalObjectTypeSchema = exports.zTaskDedupWindowSchema = exports.zTaskDedupScopeSchema = exports.zTaskRetryStrategySchema = exports.zTaskAutoHandlerSchema = exports.zTaskModeSchema = exports.zTaskSourceSchema = exports.zTaskPrioritySchema = exports.zTaskStatusSchema = exports.zTaskActionSchema = void 0;
|
|
3
|
+
exports.zTaskLogSchema = exports.zTaskExecutionSchema = exports.zTaskExecutionProviderSchema = exports.zTaskExecutionErrorSchema = exports.zTaskCommentSchema = exports.zTaskCommentAuthorSchema = exports.zTaskSchema = exports.zTaskCreatorSchema = exports.zTaskOnFailureSchema = exports.zTaskAutoSpecSchema = exports.zTaskDedupSchema = exports.zTaskRetryPolicySchema = exports.zTaskRunnerStateSchema = exports.zTaskLockSchema = exports.zTaskUserAssigneeSchema = exports.zTaskScheduleSchema = exports.zTaskExternalLinkSchema = exports.zExternalLinkSchema = exports.zTaskExecutionStatusSchema = exports.zTaskExternalObjectTypeSchema = exports.zExternalObjectTypeSchema = exports.zTaskDedupWindowSchema = exports.zTaskDedupScopeSchema = exports.zTaskRetryStrategySchema = exports.zTaskAutoHandlerSchema = exports.zTaskModeSchema = exports.zTaskSourceSchema = exports.zTaskPrioritySchema = exports.zTaskStatusSchema = exports.zTaskActionSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const zod_schemas_1 = require("../shared/zod-schemas");
|
|
6
6
|
exports.zTaskActionSchema = zod_1.z.enum([
|
|
@@ -16,6 +16,7 @@ exports.zTaskStatusSchema = zod_1.z.enum([
|
|
|
16
16
|
"cancelled",
|
|
17
17
|
"on_hold",
|
|
18
18
|
"suppressed",
|
|
19
|
+
"dead_letter",
|
|
19
20
|
]);
|
|
20
21
|
exports.zTaskPrioritySchema = zod_1.z.enum(["low", "medium", "high"]);
|
|
21
22
|
exports.zTaskSourceSchema = zod_1.z.enum(["user", "automation_hub", "system"]);
|
|
@@ -83,6 +84,15 @@ exports.zTaskLockSchema = zod_1.z
|
|
|
83
84
|
lock_until: zod_1.z.coerce.date(),
|
|
84
85
|
})
|
|
85
86
|
.passthrough();
|
|
87
|
+
// Schema para ITaskRunnerState
|
|
88
|
+
exports.zTaskRunnerStateSchema = zod_1.z
|
|
89
|
+
.object({
|
|
90
|
+
reclaim_count: zod_1.z.number().optional(),
|
|
91
|
+
fallback_index: zod_1.z.number().optional(),
|
|
92
|
+
last_dispatch_at: zod_1.z.coerce.date().optional(),
|
|
93
|
+
dispatched_attempts: zod_1.z.number().optional(),
|
|
94
|
+
})
|
|
95
|
+
.passthrough();
|
|
86
96
|
// Schema para ITaskRetryPolicy
|
|
87
97
|
exports.zTaskRetryPolicySchema = zod_1.z
|
|
88
98
|
.object({
|
|
@@ -179,6 +189,7 @@ exports.zTaskSchema = zod_schemas_1.zFireDocSchema
|
|
|
179
189
|
lock: exports.zTaskLockSchema.optional(), // for auto tasks
|
|
180
190
|
retry: exports.zTaskRetryPolicySchema.optional(), // for auto tasks
|
|
181
191
|
on_failure: exports.zTaskOnFailureSchema.optional(), // for auto tasks
|
|
192
|
+
runner_state: exports.zTaskRunnerStateSchema.optional(), // for auto tasks (maintained by Task Runner)
|
|
182
193
|
auto: exports.zTaskAutoSpecSchema.optional(), // for auto tasks (required when mode=auto)
|
|
183
194
|
})
|
|
184
195
|
.passthrough();
|
|
@@ -15,6 +15,7 @@ export const zTaskStatusSchema = z.enum([
|
|
|
15
15
|
"cancelled",
|
|
16
16
|
"on_hold",
|
|
17
17
|
"suppressed",
|
|
18
|
+
"dead_letter",
|
|
18
19
|
]);
|
|
19
20
|
|
|
20
21
|
export const zTaskPrioritySchema = z.enum(["low", "medium", "high"]);
|
|
@@ -101,6 +102,16 @@ export const zTaskLockSchema = z
|
|
|
101
102
|
})
|
|
102
103
|
.passthrough();
|
|
103
104
|
|
|
105
|
+
// Schema para ITaskRunnerState
|
|
106
|
+
export const zTaskRunnerStateSchema = z
|
|
107
|
+
.object({
|
|
108
|
+
reclaim_count: z.number().optional(),
|
|
109
|
+
fallback_index: z.number().optional(),
|
|
110
|
+
last_dispatch_at: z.coerce.date().optional(),
|
|
111
|
+
dispatched_attempts: z.number().optional(),
|
|
112
|
+
})
|
|
113
|
+
.passthrough();
|
|
114
|
+
|
|
104
115
|
// Schema para ITaskRetryPolicy
|
|
105
116
|
export const zTaskRetryPolicySchema = z
|
|
106
117
|
.object({
|
|
@@ -204,6 +215,7 @@ export const zTaskSchema = zFireDocSchema
|
|
|
204
215
|
lock: zTaskLockSchema.optional(), // for auto tasks
|
|
205
216
|
retry: zTaskRetryPolicySchema.optional(), // for auto tasks
|
|
206
217
|
on_failure: zTaskOnFailureSchema.optional(), // for auto tasks
|
|
218
|
+
runner_state: zTaskRunnerStateSchema.optional(), // for auto tasks (maintained by Task Runner)
|
|
207
219
|
auto: zTaskAutoSpecSchema.optional(), // for auto tasks (required when mode=auto)
|
|
208
220
|
})
|
|
209
221
|
.passthrough();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./zod-schemas";
|
|
@@ -0,0 +1,17 @@
|
|
|
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
|
+
__exportStar(require("./zod-schemas"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./zod-schemas";
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const zTaskRunnerConfigSchema: z.ZodObject<{
|
|
3
|
+
active: z.ZodDefault<z.ZodBoolean>;
|
|
4
|
+
limits: z.ZodOptional<z.ZodObject<{
|
|
5
|
+
max_claims_per_tick: z.ZodOptional<z.ZodNumber>;
|
|
6
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
7
|
+
max_claims_per_tick: z.ZodOptional<z.ZodNumber>;
|
|
8
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
9
|
+
max_claims_per_tick: z.ZodOptional<z.ZodNumber>;
|
|
10
|
+
}, z.ZodTypeAny, "passthrough">>>;
|
|
11
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
12
|
+
active: z.ZodDefault<z.ZodBoolean>;
|
|
13
|
+
limits: z.ZodOptional<z.ZodObject<{
|
|
14
|
+
max_claims_per_tick: z.ZodOptional<z.ZodNumber>;
|
|
15
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
16
|
+
max_claims_per_tick: z.ZodOptional<z.ZodNumber>;
|
|
17
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
18
|
+
max_claims_per_tick: z.ZodOptional<z.ZodNumber>;
|
|
19
|
+
}, z.ZodTypeAny, "passthrough">>>;
|
|
20
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
21
|
+
active: z.ZodDefault<z.ZodBoolean>;
|
|
22
|
+
limits: z.ZodOptional<z.ZodObject<{
|
|
23
|
+
max_claims_per_tick: z.ZodOptional<z.ZodNumber>;
|
|
24
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
25
|
+
max_claims_per_tick: z.ZodOptional<z.ZodNumber>;
|
|
26
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
27
|
+
max_claims_per_tick: z.ZodOptional<z.ZodNumber>;
|
|
28
|
+
}, z.ZodTypeAny, "passthrough">>>;
|
|
29
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
30
|
+
export type ITaskRunnerConfig = z.infer<typeof zTaskRunnerConfigSchema>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.zTaskRunnerConfigSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.zTaskRunnerConfigSchema = zod_1.z
|
|
6
|
+
.object({
|
|
7
|
+
active: zod_1.z.boolean().default(false),
|
|
8
|
+
limits: zod_1.z
|
|
9
|
+
.object({
|
|
10
|
+
max_claims_per_tick: zod_1.z.number().optional(),
|
|
11
|
+
})
|
|
12
|
+
.passthrough()
|
|
13
|
+
.optional(),
|
|
14
|
+
})
|
|
15
|
+
.passthrough();
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
export const zTaskRunnerConfigSchema = z
|
|
4
|
+
.object({
|
|
5
|
+
active: z.boolean().default(false),
|
|
6
|
+
limits: z
|
|
7
|
+
.object({
|
|
8
|
+
max_claims_per_tick: z.number().optional(),
|
|
9
|
+
})
|
|
10
|
+
.passthrough()
|
|
11
|
+
.optional(),
|
|
12
|
+
})
|
|
13
|
+
.passthrough();
|
|
14
|
+
|
|
15
|
+
export type ITaskRunnerConfig = z.infer<typeof zTaskRunnerConfigSchema>;
|
|
@@ -13,7 +13,7 @@ export declare const zTenantSchema: z.ZodObject<{
|
|
|
13
13
|
} & {
|
|
14
14
|
name: z.ZodString;
|
|
15
15
|
url_alias: z.ZodString;
|
|
16
|
-
base_tenant: z.ZodOptional<z.ZodString
|
|
16
|
+
base_tenant: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
17
17
|
hidden: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
18
18
|
readonly: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
19
19
|
date_format: z.ZodOptional<z.ZodString>;
|
|
@@ -32,7 +32,7 @@ export declare const zTenantSchema: z.ZodObject<{
|
|
|
32
32
|
created_at?: Date | null | undefined;
|
|
33
33
|
updated_at?: Date | null | undefined;
|
|
34
34
|
deleted_at?: Date | null | undefined;
|
|
35
|
-
base_tenant?: string | undefined;
|
|
35
|
+
base_tenant?: string | null | undefined;
|
|
36
36
|
hidden?: boolean | undefined;
|
|
37
37
|
readonly?: boolean | undefined;
|
|
38
38
|
date_format?: string | undefined;
|
|
@@ -50,7 +50,7 @@ export declare const zTenantSchema: z.ZodObject<{
|
|
|
50
50
|
created_at?: Date | null | undefined;
|
|
51
51
|
updated_at?: Date | null | undefined;
|
|
52
52
|
deleted_at?: Date | null | undefined;
|
|
53
|
-
base_tenant?: string | undefined;
|
|
53
|
+
base_tenant?: string | null | undefined;
|
|
54
54
|
hidden?: boolean | undefined;
|
|
55
55
|
readonly?: boolean | undefined;
|
|
56
56
|
date_format?: string | undefined;
|
|
@@ -14,7 +14,7 @@ exports.zTenantSchema = zod_schemas_1.zFireDocSchema // Extend from FireDocSchem
|
|
|
14
14
|
.extend({
|
|
15
15
|
name: zod_1.z.string().min(1).max(255),
|
|
16
16
|
url_alias: zod_1.z.string().min(1).max(255),
|
|
17
|
-
base_tenant: zod_1.z.string().optional(),
|
|
17
|
+
base_tenant: zod_1.z.string().nullable().optional(),
|
|
18
18
|
hidden: zod_1.z.boolean().default(false).optional(),
|
|
19
19
|
readonly: zod_1.z.boolean().default(false).optional(),
|
|
20
20
|
date_format: zod_1.z.string().optional(),
|
|
@@ -15,7 +15,7 @@ export const zTenantSchema = zFireDocSchema // Extend from FireDocSchema
|
|
|
15
15
|
.extend({
|
|
16
16
|
name: z.string().min(1).max(255),
|
|
17
17
|
url_alias: z.string().min(1).max(255),
|
|
18
|
-
base_tenant: z.string().optional(),
|
|
18
|
+
base_tenant: z.string().nullable().optional(),
|
|
19
19
|
hidden: z.boolean().default(false).optional(),
|
|
20
20
|
readonly: z.boolean().default(false).optional(),
|
|
21
21
|
date_format: z.string().optional(),
|
package/dist/index.d.ts
CHANGED
|
@@ -22,6 +22,7 @@ export * from "./types/evo-finops";
|
|
|
22
22
|
export * from "./types/evo-notif-user";
|
|
23
23
|
export * from "./types/evo-notifications";
|
|
24
24
|
export * from "./types/evo-task-runner";
|
|
25
|
+
export * from "./types/evo-integrations";
|
|
25
26
|
export * from "./types/nex-customers";
|
|
26
27
|
export * from "./apps/shared/zod-schemas";
|
|
27
28
|
export * from "./apps/evo-core/zod-schemas";
|
|
@@ -55,3 +56,5 @@ export * from "./apps/evo-survey/zod-schemas";
|
|
|
55
56
|
export * from "./apps/evo-finops/zod-schemas";
|
|
56
57
|
export * from "./apps/evo-notif-user/zod-schemas";
|
|
57
58
|
export * from "./apps/evo-notifications/zod-schemas";
|
|
59
|
+
export * from "./apps/evo-task-runner/zod-schemas";
|
|
60
|
+
export * from "./apps/evo-integrations/zod-schemas";
|
package/dist/index.js
CHANGED
|
@@ -39,6 +39,7 @@ __exportStar(require("./types/evo-finops"), exports);
|
|
|
39
39
|
__exportStar(require("./types/evo-notif-user"), exports);
|
|
40
40
|
__exportStar(require("./types/evo-notifications"), exports);
|
|
41
41
|
__exportStar(require("./types/evo-task-runner"), exports);
|
|
42
|
+
__exportStar(require("./types/evo-integrations"), exports);
|
|
42
43
|
__exportStar(require("./types/nex-customers"), exports);
|
|
43
44
|
// zod schemas
|
|
44
45
|
__exportStar(require("./apps/shared/zod-schemas"), exports);
|
|
@@ -73,3 +74,5 @@ __exportStar(require("./apps/evo-survey/zod-schemas"), exports);
|
|
|
73
74
|
__exportStar(require("./apps/evo-finops/zod-schemas"), exports);
|
|
74
75
|
__exportStar(require("./apps/evo-notif-user/zod-schemas"), exports);
|
|
75
76
|
__exportStar(require("./apps/evo-notifications/zod-schemas"), exports);
|
|
77
|
+
__exportStar(require("./apps/evo-task-runner/zod-schemas"), exports);
|
|
78
|
+
__exportStar(require("./apps/evo-integrations/zod-schemas"), exports);
|
package/dist/index.ts
CHANGED
|
@@ -23,6 +23,7 @@ export * from "./types/evo-finops";
|
|
|
23
23
|
export * from "./types/evo-notif-user";
|
|
24
24
|
export * from "./types/evo-notifications";
|
|
25
25
|
export * from "./types/evo-task-runner";
|
|
26
|
+
export * from "./types/evo-integrations";
|
|
26
27
|
export * from "./types/nex-customers";
|
|
27
28
|
|
|
28
29
|
// zod schemas
|
|
@@ -58,3 +59,5 @@ export * from "./apps/evo-survey/zod-schemas";
|
|
|
58
59
|
export * from "./apps/evo-finops/zod-schemas";
|
|
59
60
|
export * from "./apps/evo-notif-user/zod-schemas";
|
|
60
61
|
export * from "./apps/evo-notifications/zod-schemas";
|
|
62
|
+
export * from "./apps/evo-task-runner/zod-schemas";
|
|
63
|
+
export * from "./apps/evo-integrations/zod-schemas";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const PLATFORM_COLLECTION = "platform";
|
|
2
|
+
export declare const EVO_INTEGRATIONS_PLATFORM_DOC = "evo-integrations";
|
|
3
|
+
export declare const ADAPTERS_COLLECTION = "adapters";
|
|
4
|
+
export declare const INTEGRATION_CREDENTIALS_COLLECTION = "integration-credentials";
|
|
5
|
+
export declare const SYNC_STATES_COLLECTION = "sync-states";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SYNC_STATES_COLLECTION = exports.INTEGRATION_CREDENTIALS_COLLECTION = exports.ADAPTERS_COLLECTION = exports.EVO_INTEGRATIONS_PLATFORM_DOC = exports.PLATFORM_COLLECTION = void 0;
|
|
4
|
+
// Platform-level (Nexus-managed, cross-tenant) adapter catalog
|
|
5
|
+
// Path: /platform/evo-integrations/adapters/{adapter_id}
|
|
6
|
+
exports.PLATFORM_COLLECTION = "platform";
|
|
7
|
+
exports.EVO_INTEGRATIONS_PLATFORM_DOC = "evo-integrations";
|
|
8
|
+
exports.ADAPTERS_COLLECTION = "adapters";
|
|
9
|
+
// Tenant-level (under apps/evo-med — integration config lives with the calendar it serves)
|
|
10
|
+
// Path: /tenants/{t}/apps/evo-med/integration-credentials/{cred_id}
|
|
11
|
+
exports.INTEGRATION_CREDENTIALS_COLLECTION = "integration-credentials";
|
|
12
|
+
// Per-calendar sync state (1 doc per calendar).
|
|
13
|
+
// Path: /tenants/{t}/apps/evo-med/sync-states/{calendar_id}
|
|
14
|
+
exports.SYNC_STATES_COLLECTION = "sync-states";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// Platform-level (Nexus-managed, cross-tenant) adapter catalog
|
|
2
|
+
// Path: /platform/evo-integrations/adapters/{adapter_id}
|
|
3
|
+
export const PLATFORM_COLLECTION = "platform";
|
|
4
|
+
export const EVO_INTEGRATIONS_PLATFORM_DOC = "evo-integrations";
|
|
5
|
+
export const ADAPTERS_COLLECTION = "adapters";
|
|
6
|
+
|
|
7
|
+
// Tenant-level (under apps/evo-med — integration config lives with the calendar it serves)
|
|
8
|
+
// Path: /tenants/{t}/apps/evo-med/integration-credentials/{cred_id}
|
|
9
|
+
export const INTEGRATION_CREDENTIALS_COLLECTION = "integration-credentials";
|
|
10
|
+
|
|
11
|
+
// Per-calendar sync state (1 doc per calendar).
|
|
12
|
+
// Path: /tenants/{t}/apps/evo-med/sync-states/{calendar_id}
|
|
13
|
+
export const SYNC_STATES_COLLECTION = "sync-states";
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
export * from "./fb_collections";
|
|
2
|
+
import type { IFireDoc } from "../shared";
|
|
3
|
+
export declare const EvoIntegrationsPermissions: {
|
|
4
|
+
readonly List: "evo_integrations_read";
|
|
5
|
+
readonly Get: "evo_integrations_read";
|
|
6
|
+
readonly Create: "evo_integrations_write";
|
|
7
|
+
readonly Update: "evo_integrations_write";
|
|
8
|
+
readonly Delete: "evo_integrations_write";
|
|
9
|
+
readonly InvokeAction: "evo_integrations_action_invoke";
|
|
10
|
+
};
|
|
11
|
+
export type EvoIntegrationsPermissions = (typeof EvoIntegrationsPermissions)[keyof typeof EvoIntegrationsPermissions];
|
|
12
|
+
export declare const SYNC_RUN_PUBSUB_TOPIC = "evo-integrations.sync_runs";
|
|
13
|
+
export declare const SYNC_RUN_HANDLER = "evo-integrations.sync-run";
|
|
14
|
+
export type CapabilityEntity = "appointment" | "patient" | "payment" | "sync";
|
|
15
|
+
export type CapabilityName = "appointment.get" | "appointment.list" | "appointment.create" | "appointment.update" | "appointment.cancel" | "appointment.confirm" | "appointment.reschedule" | "patient.get" | "patient.list" | "patient.create" | "patient.update" | "patient.document.upload" | "payment.update" | "sync.appointments";
|
|
16
|
+
/**
|
|
17
|
+
* Capabilities obrigatórias em qualquer adapter. Sem elas, o adapter
|
|
18
|
+
* não pode ser ativado. `appointment.get` é fundamental pra auto-deleção
|
|
19
|
+
* confiável via get-after-diff.
|
|
20
|
+
*/
|
|
21
|
+
export declare const OBLIGATORY_CAPABILITIES: readonly CapabilityName[];
|
|
22
|
+
/**
|
|
23
|
+
* Capabilities internas (não expostas via action dispatcher — apenas
|
|
24
|
+
* via sync engine / task-runner).
|
|
25
|
+
*/
|
|
26
|
+
export declare function isInternalCapability(name: CapabilityName): boolean;
|
|
27
|
+
export declare function splitCapabilityName(name: CapabilityName): {
|
|
28
|
+
entity: CapabilityEntity;
|
|
29
|
+
action: string;
|
|
30
|
+
};
|
|
31
|
+
export type AdapterCategory = "clinic-agenda" | "prontuario" | "misc";
|
|
32
|
+
export type AdapterStatus = "active" | "disabled" | "beta";
|
|
33
|
+
/**
|
|
34
|
+
* Doc Firestore global do adapter, gerenciado pela Nexus UI.
|
|
35
|
+
* Path: /platform/evo-integrations/adapters/{adapter_id}
|
|
36
|
+
*/
|
|
37
|
+
export interface IIntegrationsAdapterDoc extends IFireDoc {
|
|
38
|
+
name: string;
|
|
39
|
+
description?: string;
|
|
40
|
+
category: AdapterCategory;
|
|
41
|
+
status: AdapterStatus;
|
|
42
|
+
/** Semver string do código do adapter (distinto do `version` numérico do IFireDoc). */
|
|
43
|
+
adapter_version: string;
|
|
44
|
+
/**
|
|
45
|
+
* URLs default dos workflows n8n por capability.
|
|
46
|
+
* Precedência: calendar.integration.workflow_overrides → este doc → adapter code default.
|
|
47
|
+
*/
|
|
48
|
+
default_workflow_urls: Partial<Record<CapabilityName, string>>;
|
|
49
|
+
supported_capabilities: readonly CapabilityName[];
|
|
50
|
+
auth_schema_version?: number;
|
|
51
|
+
}
|
|
52
|
+
export type IntegrationCredentialStatus = "active" | "paused" | "revoked";
|
|
53
|
+
export interface IIntegrationsCredential extends IFireDoc {
|
|
54
|
+
adapter_id: string;
|
|
55
|
+
name: string;
|
|
56
|
+
/**
|
|
57
|
+
* Referência ao secret no Google Secret Manager.
|
|
58
|
+
* Formato: projects/hr-evo360/secrets/evo-integrations-{tenant}-{cred_id}
|
|
59
|
+
*/
|
|
60
|
+
secret_ref: string;
|
|
61
|
+
/** Config não-secreta (api_base, external_org_id, etc.). */
|
|
62
|
+
config?: Record<string, unknown>;
|
|
63
|
+
status: IntegrationCredentialStatus;
|
|
64
|
+
last_used_at?: Date | null;
|
|
65
|
+
}
|
|
66
|
+
export type SyncWindowType = "hot" | "warm" | "recent_reconcile" | "cold";
|
|
67
|
+
export interface ICoveredWindow {
|
|
68
|
+
start: Date;
|
|
69
|
+
end: Date;
|
|
70
|
+
}
|
|
71
|
+
export interface ISyncedHashes {
|
|
72
|
+
patients: Record<string, string>;
|
|
73
|
+
appointments: Record<string, string>;
|
|
74
|
+
}
|
|
75
|
+
export interface ISyncState extends IFireDoc {
|
|
76
|
+
calendar_id: string;
|
|
77
|
+
last_sync_at?: Date | null;
|
|
78
|
+
last_window_type?: SyncWindowType;
|
|
79
|
+
last_synced_hashes: ISyncedHashes;
|
|
80
|
+
last_coveredWindow?: ICoveredWindow | null;
|
|
81
|
+
}
|
|
82
|
+
export type SyncRunStatus = "success" | "partial" | "error";
|
|
83
|
+
export interface ISyncRunEventError {
|
|
84
|
+
code?: string;
|
|
85
|
+
message: string;
|
|
86
|
+
details?: Record<string, unknown>;
|
|
87
|
+
}
|
|
88
|
+
export interface ISyncRunEvent {
|
|
89
|
+
run_id: string;
|
|
90
|
+
tenant: string;
|
|
91
|
+
calendar_id: string;
|
|
92
|
+
adapter_id: string;
|
|
93
|
+
window_type: SyncWindowType;
|
|
94
|
+
started_at: Date;
|
|
95
|
+
finished_at: Date;
|
|
96
|
+
status: SyncRunStatus;
|
|
97
|
+
patients_upserted: number;
|
|
98
|
+
appointments_upserted: number;
|
|
99
|
+
appointments_skipped: number;
|
|
100
|
+
deletions_detected: number;
|
|
101
|
+
coveredWindow_start?: Date;
|
|
102
|
+
coveredWindow_end?: Date;
|
|
103
|
+
duration_ms: number;
|
|
104
|
+
firestore_reads: number;
|
|
105
|
+
firestore_writes: number;
|
|
106
|
+
n8n_calls: number;
|
|
107
|
+
errors?: ISyncRunEventError[];
|
|
108
|
+
}
|
|
109
|
+
export interface ISyncWindowConfig {
|
|
110
|
+
enabled: boolean;
|
|
111
|
+
/** Cadência em minutos. Ex.: hot=60, warm=360, cold=10080 (semanal). */
|
|
112
|
+
cadence_minutes: number;
|
|
113
|
+
/** Janela absoluta em dias a partir de "hoje". */
|
|
114
|
+
window_days: {
|
|
115
|
+
past: number;
|
|
116
|
+
future: number;
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
export interface ISyncConfig {
|
|
120
|
+
hot?: ISyncWindowConfig;
|
|
121
|
+
warm?: ISyncWindowConfig;
|
|
122
|
+
recent_reconcile?: ISyncWindowConfig;
|
|
123
|
+
cold?: ISyncWindowConfig;
|
|
124
|
+
}
|
|
125
|
+
export interface IMedCalendarIntegration {
|
|
126
|
+
adapter_id: string;
|
|
127
|
+
credentials_id: string;
|
|
128
|
+
/** Prefixo opcional pra namespacing de patient_id entre adapters/calendars. Default vazio. */
|
|
129
|
+
patient_prefix?: string;
|
|
130
|
+
sync_config: ISyncConfig;
|
|
131
|
+
/** Override por capability — precedência mais alta no resolver de URL. */
|
|
132
|
+
workflow_overrides?: Partial<Record<CapabilityName, string>>;
|
|
133
|
+
}
|