evo360-types 1.3.755 → 1.3.759
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-activity/zod-schemas.d.ts +6 -6
- package/dist/apps/evo-chat/contact/zod-schemas.d.ts +6 -6
- package/dist/apps/evo-chat/dic/ticket-close/zod-schemas.d.ts +12 -12
- package/dist/apps/evo-chat/message/zod-schemas.d.ts +6 -6
- package/dist/apps/evo-core/zod-schemas.d.ts +96 -49
- package/dist/apps/evo-core/zod-schemas.js +11 -5
- package/dist/apps/evo-core/zod-schemas.ts +10 -4
- package/dist/apps/evo-crm/dic/zod-schemas.d.ts +18 -18
- package/dist/apps/evo-crm/lead/zod-schemas.d.ts +42 -42
- package/dist/apps/evo-finops/zod-schemas.d.ts +72 -72
- package/dist/apps/evo-med/appointment/zod-schemas.d.ts +6 -6
- package/dist/apps/evo-med/calendar/zod-schemas.d.ts +6 -6
- package/dist/apps/evo-med/dic/zod-schemas.d.ts +6 -6
- package/dist/apps/evo-med/insurance/zod-schemas.d.ts +6 -6
- package/dist/apps/evo-med/people/zod-schemas.d.ts +192 -192
- package/dist/apps/evo-med/procedure/zod-schemas.d.ts +12 -12
- package/dist/apps/evo-notifications/zod-schemas.d.ts +156 -156
- package/dist/apps/evo-people/zod-schemas.d.ts +24 -24
- package/dist/apps/evo-survey/zod-schemas.d.ts +58 -58
- package/dist/apps/evo-task/zod-schemas.d.ts +219 -117
- package/dist/apps/evo-task/zod-schemas.js +36 -5
- package/dist/apps/evo-task/zod-schemas.ts +38 -4
- package/dist/apps/hub-automation/zod-schemas.d.ts +184 -184
- package/dist/apps/shared/zod-schemas.d.ts +2 -2
- package/dist/types/evo-core/index.d.ts +13 -5
- package/dist/types/evo-core/index.ts +14 -5
- package/dist/types/shared/external-links.d.ts +27 -0
- package/dist/types/shared/external-links.js +12 -0
- package/dist/types/shared/external-links.ts +28 -0
- package/package.json +1 -1
|
@@ -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.zTaskRunnerStateSchema = exports.zTaskLockSchema = exports.zTaskUserAssigneeSchema = exports.zTaskScheduleSchema = exports.zTaskExternalLinkSchema = exports.zExternalLinkSchema = exports.zExternalLinkRelationSchema = exports.zLinkRelationRoleSchema = exports.zLinkRelationPairSchema = exports.zExternalLinkSourceSchema = exports.zExternalLinkStatusSchema = exports.zExternalLinkKindSchema = exports.zExternalOwnerSystemSchema = exports.zTaskOutcomeSchema = exports.zTaskOutcomeClassSchema = 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.zExternalLinkStrictSchema = exports.zExternalLinkSchema = exports.zExternalLinkRelationSchema = exports.zLinkRelationRoleSchema = exports.zLinkRelationPairSchema = exports.zExternalLinkSourceSchema = exports.zExternalLinkStatusSchema = exports.zExternalLinkKindSchema = exports.zExternalOwnerSystemSchema = exports.zTaskOutcomeSchema = exports.zTaskOutcomeClassSchema = 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([
|
|
@@ -111,6 +111,9 @@ exports.zExternalObjectTypeSchema = zod_1.z.enum([
|
|
|
111
111
|
// `ExternalObjectTypeEnum.Teleconsultation` — as duas listas são à mão; sem
|
|
112
112
|
// este valor o notification.send do lembrete de teleconsulta toma 400.
|
|
113
113
|
"teleconsultation",
|
|
114
|
+
// Agenda do evo-med no externalLinks do paciente. Espelha
|
|
115
|
+
// `ExternalObjectTypeEnum.MedCalendar`.
|
|
116
|
+
"med_calendar",
|
|
114
117
|
]);
|
|
115
118
|
// Backward compatibility alias
|
|
116
119
|
exports.zTaskExternalObjectTypeSchema = exports.zExternalObjectTypeSchema;
|
|
@@ -157,6 +160,7 @@ exports.zExternalLinkSourceSchema = zod_1.z.enum([
|
|
|
157
160
|
"family_discovery",
|
|
158
161
|
"name_rule",
|
|
159
162
|
"hubia",
|
|
163
|
+
"appointment_replication",
|
|
160
164
|
]);
|
|
161
165
|
exports.zLinkRelationPairSchema = zod_1.z.enum([
|
|
162
166
|
"parent_child",
|
|
@@ -184,9 +188,26 @@ exports.zExternalLinkRelationSchema = zod_1.z.object({
|
|
|
184
188
|
pair: exports.zLinkRelationPairSchema,
|
|
185
189
|
other_role: exports.zLinkRelationRoleSchema,
|
|
186
190
|
});
|
|
191
|
+
/**
|
|
192
|
+
* Valor de enum na LEITURA de `externalLinks`: aceita qualquer string não vazia e
|
|
193
|
+
* mantém o tipo TS do enum (consumidor de UI já trata tipo desconhecido com
|
|
194
|
+
* fallback — ver `IExternalLink.owner`).
|
|
195
|
+
*
|
|
196
|
+
* Por quê: `zExternalLinkSchema` está embutido no schema de paciente, lead, task,
|
|
197
|
+
* notificação e finops. Com o enum fechado, um valor novo gravado por um codebase
|
|
198
|
+
* já atualizado derrubava com ZodError a leitura do doc INTEIRO em todo codebase
|
|
199
|
+
* (e no front) ainda com o evo-types antigo — incidente de 21/10
|
|
200
|
+
* (`created_source: 'hubia'` no lead). Tolerante, tipo/source novo de link vira
|
|
201
|
+
* deploy comum, sem ordem. Quem grava e quer barrar valor desconhecido usa
|
|
202
|
+
* `zExternalLinkStrictSchema`.
|
|
203
|
+
*/
|
|
204
|
+
const zTolerantEnumValue = (known) => zod_1.z.custom((v) => typeof v === "string" && v.trim() !== "", {
|
|
205
|
+
message: `Expected a non-empty string (known: ${known.options.join(" | ")})`,
|
|
206
|
+
});
|
|
207
|
+
/** Schema de LEITURA (docs gravados): tolerante a `type`/source desconhecido. */
|
|
187
208
|
exports.zExternalLinkSchema = zod_1.z
|
|
188
209
|
.object({
|
|
189
|
-
type: exports.zExternalObjectTypeSchema,
|
|
210
|
+
type: zTolerantEnumValue(exports.zExternalObjectTypeSchema),
|
|
190
211
|
id: zod_1.z.string(),
|
|
191
212
|
label: zod_1.z.string().optional(),
|
|
192
213
|
ref: zod_1.z.any().optional(), // FirestoreDocumentReference
|
|
@@ -203,12 +224,12 @@ exports.zExternalLinkSchema = zod_1.z
|
|
|
203
224
|
relation: exports.zExternalLinkRelationSchema.nullable().optional(),
|
|
204
225
|
status: exports.zExternalLinkStatusSchema.optional(),
|
|
205
226
|
evidence_fingerprint: zod_1.z.string().nullable().optional(),
|
|
206
|
-
created_source: exports.zExternalLinkSourceSchema.optional(),
|
|
227
|
+
created_source: zTolerantEnumValue(exports.zExternalLinkSourceSchema).optional(),
|
|
207
228
|
created_by: zod_1.z.any().nullable().optional(), // FirestoreDocumentReference
|
|
208
229
|
created_at: zod_1.z.coerce.date().nullable().optional(),
|
|
209
|
-
last_observed_source: exports.zExternalLinkSourceSchema.nullable().optional(),
|
|
230
|
+
last_observed_source: zTolerantEnumValue(exports.zExternalLinkSourceSchema).nullable().optional(),
|
|
210
231
|
last_observed_at: zod_1.z.coerce.date().nullable().optional(),
|
|
211
|
-
confirmed_source: exports.zExternalLinkSourceSchema.nullable().optional(),
|
|
232
|
+
confirmed_source: zTolerantEnumValue(exports.zExternalLinkSourceSchema).nullable().optional(),
|
|
212
233
|
confirmed_by: zod_1.z.any().nullable().optional(), // FirestoreDocumentReference
|
|
213
234
|
confirmed_at: zod_1.z.coerce.date().nullable().optional(),
|
|
214
235
|
rejected_by: zod_1.z.any().nullable().optional(), // FirestoreDocumentReference
|
|
@@ -217,6 +238,16 @@ exports.zExternalLinkSchema = zod_1.z
|
|
|
217
238
|
evidence_summary: zod_1.z.string().max(300).nullable().optional(),
|
|
218
239
|
})
|
|
219
240
|
.passthrough();
|
|
241
|
+
/**
|
|
242
|
+
* Schema de ESCRITA (opcional): mesmos campos com `type`/source restritos aos
|
|
243
|
+
* enums conhecidos — para quem grava um link novo e quer barrar valor inválido.
|
|
244
|
+
*/
|
|
245
|
+
exports.zExternalLinkStrictSchema = exports.zExternalLinkSchema.extend({
|
|
246
|
+
type: exports.zExternalObjectTypeSchema,
|
|
247
|
+
created_source: exports.zExternalLinkSourceSchema.optional(),
|
|
248
|
+
last_observed_source: exports.zExternalLinkSourceSchema.nullable().optional(),
|
|
249
|
+
confirmed_source: exports.zExternalLinkSourceSchema.nullable().optional(),
|
|
250
|
+
});
|
|
220
251
|
// Backward compatibility alias
|
|
221
252
|
exports.zTaskExternalLinkSchema = exports.zExternalLinkSchema;
|
|
222
253
|
// Schema para ITaskSchedule
|
|
@@ -118,6 +118,9 @@ export const zExternalObjectTypeSchema = z.enum([
|
|
|
118
118
|
// `ExternalObjectTypeEnum.Teleconsultation` — as duas listas são à mão; sem
|
|
119
119
|
// este valor o notification.send do lembrete de teleconsulta toma 400.
|
|
120
120
|
"teleconsultation",
|
|
121
|
+
// Agenda do evo-med no externalLinks do paciente. Espelha
|
|
122
|
+
// `ExternalObjectTypeEnum.MedCalendar`.
|
|
123
|
+
"med_calendar",
|
|
121
124
|
]);
|
|
122
125
|
|
|
123
126
|
// Backward compatibility alias
|
|
@@ -172,6 +175,7 @@ export const zExternalLinkSourceSchema = z.enum([
|
|
|
172
175
|
"family_discovery",
|
|
173
176
|
"name_rule",
|
|
174
177
|
"hubia",
|
|
178
|
+
"appointment_replication",
|
|
175
179
|
]);
|
|
176
180
|
|
|
177
181
|
export const zLinkRelationPairSchema = z.enum([
|
|
@@ -203,9 +207,28 @@ export const zExternalLinkRelationSchema = z.object({
|
|
|
203
207
|
other_role: zLinkRelationRoleSchema,
|
|
204
208
|
});
|
|
205
209
|
|
|
210
|
+
/**
|
|
211
|
+
* Valor de enum na LEITURA de `externalLinks`: aceita qualquer string não vazia e
|
|
212
|
+
* mantém o tipo TS do enum (consumidor de UI já trata tipo desconhecido com
|
|
213
|
+
* fallback — ver `IExternalLink.owner`).
|
|
214
|
+
*
|
|
215
|
+
* Por quê: `zExternalLinkSchema` está embutido no schema de paciente, lead, task,
|
|
216
|
+
* notificação e finops. Com o enum fechado, um valor novo gravado por um codebase
|
|
217
|
+
* já atualizado derrubava com ZodError a leitura do doc INTEIRO em todo codebase
|
|
218
|
+
* (e no front) ainda com o evo-types antigo — incidente de 21/10
|
|
219
|
+
* (`created_source: 'hubia'` no lead). Tolerante, tipo/source novo de link vira
|
|
220
|
+
* deploy comum, sem ordem. Quem grava e quer barrar valor desconhecido usa
|
|
221
|
+
* `zExternalLinkStrictSchema`.
|
|
222
|
+
*/
|
|
223
|
+
const zTolerantEnumValue = <T extends [string, ...string[]]>(known: z.ZodEnum<T>) =>
|
|
224
|
+
z.custom<z.infer<z.ZodEnum<T>>>((v) => typeof v === "string" && v.trim() !== "", {
|
|
225
|
+
message: `Expected a non-empty string (known: ${known.options.join(" | ")})`,
|
|
226
|
+
});
|
|
227
|
+
|
|
228
|
+
/** Schema de LEITURA (docs gravados): tolerante a `type`/source desconhecido. */
|
|
206
229
|
export const zExternalLinkSchema = z
|
|
207
230
|
.object({
|
|
208
|
-
type: zExternalObjectTypeSchema,
|
|
231
|
+
type: zTolerantEnumValue(zExternalObjectTypeSchema),
|
|
209
232
|
id: z.string(),
|
|
210
233
|
label: z.string().optional(),
|
|
211
234
|
ref: z.any().optional(), // FirestoreDocumentReference
|
|
@@ -222,12 +245,12 @@ export const zExternalLinkSchema = z
|
|
|
222
245
|
relation: zExternalLinkRelationSchema.nullable().optional(),
|
|
223
246
|
status: zExternalLinkStatusSchema.optional(),
|
|
224
247
|
evidence_fingerprint: z.string().nullable().optional(),
|
|
225
|
-
created_source: zExternalLinkSourceSchema.optional(),
|
|
248
|
+
created_source: zTolerantEnumValue(zExternalLinkSourceSchema).optional(),
|
|
226
249
|
created_by: z.any().nullable().optional(), // FirestoreDocumentReference
|
|
227
250
|
created_at: z.coerce.date().nullable().optional(),
|
|
228
|
-
last_observed_source: zExternalLinkSourceSchema.nullable().optional(),
|
|
251
|
+
last_observed_source: zTolerantEnumValue(zExternalLinkSourceSchema).nullable().optional(),
|
|
229
252
|
last_observed_at: z.coerce.date().nullable().optional(),
|
|
230
|
-
confirmed_source: zExternalLinkSourceSchema.nullable().optional(),
|
|
253
|
+
confirmed_source: zTolerantEnumValue(zExternalLinkSourceSchema).nullable().optional(),
|
|
231
254
|
confirmed_by: z.any().nullable().optional(), // FirestoreDocumentReference
|
|
232
255
|
confirmed_at: z.coerce.date().nullable().optional(),
|
|
233
256
|
rejected_by: z.any().nullable().optional(), // FirestoreDocumentReference
|
|
@@ -237,6 +260,17 @@ export const zExternalLinkSchema = z
|
|
|
237
260
|
})
|
|
238
261
|
.passthrough();
|
|
239
262
|
|
|
263
|
+
/**
|
|
264
|
+
* Schema de ESCRITA (opcional): mesmos campos com `type`/source restritos aos
|
|
265
|
+
* enums conhecidos — para quem grava um link novo e quer barrar valor inválido.
|
|
266
|
+
*/
|
|
267
|
+
export const zExternalLinkStrictSchema = zExternalLinkSchema.extend({
|
|
268
|
+
type: zExternalObjectTypeSchema,
|
|
269
|
+
created_source: zExternalLinkSourceSchema.optional(),
|
|
270
|
+
last_observed_source: zExternalLinkSourceSchema.nullable().optional(),
|
|
271
|
+
confirmed_source: zExternalLinkSourceSchema.nullable().optional(),
|
|
272
|
+
});
|
|
273
|
+
|
|
240
274
|
// Backward compatibility alias
|
|
241
275
|
export const zTaskExternalLinkSchema = zExternalLinkSchema;
|
|
242
276
|
|