@opencrvs/toolkit
Advanced tools
Comparing version 0.0.13-events to 0.0.14-events
@@ -82,3 +82,100 @@ import { JSONSchema } from '@opencrvs/commons/conditionals'; | ||
}; | ||
isEqualTo: (value: string) => { | ||
type: string; | ||
properties: { | ||
$form: { | ||
type: string; | ||
properties: { | ||
[x: string]: { | ||
const: string; | ||
}; | ||
}; | ||
required: string[]; | ||
}; | ||
}; | ||
required: string[]; | ||
}; | ||
isInArray: (values: string[]) => { | ||
type: string; | ||
properties: { | ||
$form: { | ||
type: string; | ||
properties: { | ||
[x: string]: { | ||
enum: string[]; | ||
}; | ||
}; | ||
required: string[]; | ||
}; | ||
}; | ||
required: string[]; | ||
}; | ||
isNotInArray: (values: string[]) => { | ||
type: string; | ||
properties: { | ||
$form: { | ||
type: string; | ||
properties: { | ||
[x: string]: { | ||
not: { | ||
enum: string[]; | ||
}; | ||
}; | ||
}; | ||
required: string[]; | ||
}; | ||
}; | ||
required: string[]; | ||
}; | ||
isUndefinedOrInArray: (values: string[]) => { | ||
type: string; | ||
properties: { | ||
$form: { | ||
type: string; | ||
anyOf: ({ | ||
required: string[]; | ||
properties: { | ||
[x: string]: { | ||
enum: string[]; | ||
}; | ||
}; | ||
not?: undefined; | ||
} | { | ||
not: { | ||
required: string[]; | ||
}; | ||
required?: undefined; | ||
properties?: undefined; | ||
})[]; | ||
}; | ||
}; | ||
required: string[]; | ||
}; | ||
isUndefinedOrNotInArray: (values: string[]) => { | ||
type: string; | ||
properties: { | ||
$form: { | ||
type: string; | ||
anyOf: ({ | ||
required: string[]; | ||
properties: { | ||
[x: string]: { | ||
not: { | ||
enum: string[]; | ||
}; | ||
}; | ||
}; | ||
not?: undefined; | ||
} | { | ||
not: { | ||
required: string[]; | ||
}; | ||
required?: undefined; | ||
properties?: undefined; | ||
})[]; | ||
}; | ||
}; | ||
required: string[]; | ||
}; | ||
}; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -190,4 +190,93 @@ "use strict"; | ||
required: ["$form", "$now"] | ||
}), | ||
isEqualTo: (value) => ({ | ||
type: "object", | ||
properties: { | ||
$form: { | ||
type: "object", | ||
properties: { | ||
[fieldId]: { | ||
const: value | ||
} | ||
}, | ||
required: [fieldId] | ||
} | ||
}, | ||
required: ["$form"] | ||
}), | ||
isInArray: (values) => ({ | ||
type: "object", | ||
properties: { | ||
$form: { | ||
type: "object", | ||
properties: { | ||
[fieldId]: { | ||
enum: values | ||
} | ||
}, | ||
required: [fieldId] | ||
} | ||
}, | ||
required: ["$form"] | ||
}), | ||
isNotInArray: (values) => ({ | ||
type: "object", | ||
properties: { | ||
$form: { | ||
type: "object", | ||
properties: { | ||
[fieldId]: { | ||
not: { | ||
enum: values | ||
} | ||
} | ||
}, | ||
required: [fieldId] | ||
} | ||
}, | ||
required: ["$form"] | ||
}), | ||
isUndefinedOrInArray: (values) => ({ | ||
type: "object", | ||
properties: { | ||
$form: { | ||
type: "object", | ||
anyOf: [ | ||
{ | ||
required: [fieldId], | ||
properties: { | ||
[fieldId]: { | ||
enum: values | ||
} | ||
} | ||
}, | ||
{ not: { required: [fieldId] } } | ||
] | ||
} | ||
}, | ||
required: ["$form"] | ||
}), | ||
isUndefinedOrNotInArray: (values) => ({ | ||
type: "object", | ||
properties: { | ||
$form: { | ||
type: "object", | ||
anyOf: [ | ||
{ | ||
required: [fieldId], | ||
properties: { | ||
[fieldId]: { | ||
not: { | ||
enum: values | ||
} | ||
} | ||
} | ||
}, | ||
{ not: { required: [fieldId] } } | ||
] | ||
} | ||
}, | ||
required: ["$form"] | ||
}) | ||
}; | ||
} |
@@ -24,4 +24,3 @@ import { z } from 'zod'; | ||
type: "CREATE"; | ||
createdAt: string; | ||
createdBy: string; | ||
draft: boolean; | ||
data: Record<string, string | { | ||
@@ -32,8 +31,7 @@ type: string; | ||
} | null>; | ||
draft: boolean; | ||
createdAt: string; | ||
createdBy: string; | ||
createdAtLocation: string; | ||
}, { | ||
type: "CREATE"; | ||
createdAt: string; | ||
createdBy: string; | ||
data: Record<string, string | { | ||
@@ -44,2 +42,4 @@ type: string; | ||
} | null>; | ||
createdAt: string; | ||
createdBy: string; | ||
createdAtLocation: string; | ||
@@ -70,4 +70,3 @@ draft?: boolean | undefined; | ||
type: "CREATE"; | ||
createdAt: string; | ||
createdBy: string; | ||
draft: boolean; | ||
data: Record<string, string | { | ||
@@ -78,8 +77,7 @@ type: string; | ||
} | null>; | ||
draft: boolean; | ||
createdAt: string; | ||
createdBy: string; | ||
createdAtLocation: string; | ||
}, { | ||
type: "CREATE"; | ||
createdAt: string; | ||
createdBy: string; | ||
data: Record<string, string | { | ||
@@ -90,2 +88,4 @@ type: string; | ||
} | null>; | ||
createdAt: string; | ||
createdBy: string; | ||
createdAtLocation: string; | ||
@@ -115,4 +115,3 @@ draft?: boolean | undefined; | ||
type: "VALIDATE"; | ||
createdAt: string; | ||
createdBy: string; | ||
draft: boolean; | ||
data: Record<string, string | { | ||
@@ -123,8 +122,7 @@ type: string; | ||
} | null>; | ||
draft: boolean; | ||
createdAt: string; | ||
createdBy: string; | ||
createdAtLocation: string; | ||
}, { | ||
type: "VALIDATE"; | ||
createdAt: string; | ||
createdBy: string; | ||
data: Record<string, string | { | ||
@@ -135,2 +133,4 @@ type: string; | ||
} | null>; | ||
createdAt: string; | ||
createdBy: string; | ||
createdAtLocation: string; | ||
@@ -160,4 +160,3 @@ draft?: boolean | undefined; | ||
type: "NOTIFY"; | ||
createdAt: string; | ||
createdBy: string; | ||
draft: boolean; | ||
data: Record<string, string | { | ||
@@ -168,8 +167,7 @@ type: string; | ||
} | null>; | ||
draft: boolean; | ||
createdAt: string; | ||
createdBy: string; | ||
createdAtLocation: string; | ||
}, { | ||
type: "NOTIFY"; | ||
createdAt: string; | ||
createdBy: string; | ||
data: Record<string, string | { | ||
@@ -180,2 +178,4 @@ type: string; | ||
} | null>; | ||
createdAt: string; | ||
createdBy: string; | ||
createdAtLocation: string; | ||
@@ -215,4 +215,3 @@ draft?: boolean | undefined; | ||
type: "REGISTER"; | ||
createdAt: string; | ||
createdBy: string; | ||
draft: boolean; | ||
data: Record<string, string | { | ||
@@ -223,3 +222,4 @@ type: string; | ||
} | null>; | ||
draft: boolean; | ||
createdAt: string; | ||
createdBy: string; | ||
createdAtLocation: string; | ||
@@ -232,4 +232,2 @@ identifiers: { | ||
type: "REGISTER"; | ||
createdAt: string; | ||
createdBy: string; | ||
data: Record<string, string | { | ||
@@ -240,2 +238,4 @@ type: string; | ||
} | null>; | ||
createdAt: string; | ||
createdBy: string; | ||
createdAtLocation: string; | ||
@@ -269,4 +269,3 @@ identifiers: { | ||
type: "DECLARE"; | ||
createdAt: string; | ||
createdBy: string; | ||
draft: boolean; | ||
data: Record<string, string | { | ||
@@ -277,8 +276,7 @@ type: string; | ||
} | null>; | ||
draft: boolean; | ||
createdAt: string; | ||
createdBy: string; | ||
createdAtLocation: string; | ||
}, { | ||
type: "DECLARE"; | ||
createdAt: string; | ||
createdBy: string; | ||
data: Record<string, string | { | ||
@@ -289,2 +287,4 @@ type: string; | ||
} | null>; | ||
createdAt: string; | ||
createdBy: string; | ||
createdAtLocation: string; | ||
@@ -315,4 +315,3 @@ draft?: boolean | undefined; | ||
type: "ASSIGN"; | ||
createdAt: string; | ||
createdBy: string; | ||
draft: boolean; | ||
data: Record<string, string | { | ||
@@ -323,3 +322,4 @@ type: string; | ||
} | null>; | ||
draft: boolean; | ||
createdAt: string; | ||
createdBy: string; | ||
createdAtLocation: string; | ||
@@ -329,4 +329,2 @@ assignedTo: string; | ||
type: "ASSIGN"; | ||
createdAt: string; | ||
createdBy: string; | ||
data: Record<string, string | { | ||
@@ -337,2 +335,4 @@ type: string; | ||
} | null>; | ||
createdAt: string; | ||
createdBy: string; | ||
createdAtLocation: string; | ||
@@ -363,4 +363,3 @@ assignedTo: string; | ||
type: "UNASSIGN"; | ||
createdAt: string; | ||
createdBy: string; | ||
draft: boolean; | ||
data: Record<string, string | { | ||
@@ -371,8 +370,7 @@ type: string; | ||
} | null>; | ||
draft: boolean; | ||
createdAt: string; | ||
createdBy: string; | ||
createdAtLocation: string; | ||
}, { | ||
type: "UNASSIGN"; | ||
createdAt: string; | ||
createdBy: string; | ||
data: Record<string, string | { | ||
@@ -383,2 +381,4 @@ type: string; | ||
} | null>; | ||
createdAt: string; | ||
createdBy: string; | ||
createdAtLocation: string; | ||
@@ -408,4 +408,3 @@ draft?: boolean | undefined; | ||
type: "CUSTOM"; | ||
createdAt: string; | ||
createdBy: string; | ||
draft: boolean; | ||
data: Record<string, string | { | ||
@@ -416,8 +415,7 @@ type: string; | ||
} | null>; | ||
draft: boolean; | ||
createdAt: string; | ||
createdBy: string; | ||
createdAtLocation: string; | ||
}, { | ||
type: "CUSTOM"; | ||
createdAt: string; | ||
createdBy: string; | ||
data: Record<string, string | { | ||
@@ -428,2 +426,4 @@ type: string; | ||
} | null>; | ||
createdAt: string; | ||
createdBy: string; | ||
createdAtLocation: string; | ||
@@ -433,2 +433,36 @@ draft?: boolean | undefined; | ||
export type ActionDocument = z.infer<typeof ActionDocument>; | ||
export declare const ResolvedUser: z.ZodObject<{ | ||
id: z.ZodString; | ||
systemRole: z.ZodString; | ||
name: z.ZodArray<z.ZodObject<{ | ||
use: z.ZodString; | ||
given: z.ZodArray<z.ZodString, "many">; | ||
family: z.ZodString; | ||
}, "strip", z.ZodTypeAny, { | ||
use: string; | ||
given: string[]; | ||
family: string; | ||
}, { | ||
use: string; | ||
given: string[]; | ||
family: string; | ||
}>, "many">; | ||
}, "strip", z.ZodTypeAny, { | ||
id: string; | ||
name: { | ||
use: string; | ||
given: string[]; | ||
family: string; | ||
}[]; | ||
systemRole: string; | ||
}, { | ||
id: string; | ||
name: { | ||
use: string; | ||
given: string[]; | ||
family: string; | ||
}[]; | ||
systemRole: string; | ||
}>; | ||
export type ResolvedUser = z.infer<typeof ResolvedUser>; | ||
export type CreatedAction = z.infer<typeof CreatedAction>; | ||
@@ -435,0 +469,0 @@ export type ActionFormData = ActionDocument['data']; |
@@ -33,3 +33,3 @@ import { z } from 'zod'; | ||
type: "REGISTER"; | ||
transactionId: string; | ||
draft: boolean; | ||
data: Record<string, string | { | ||
@@ -40,3 +40,3 @@ type: string; | ||
} | null>; | ||
draft: boolean; | ||
transactionId: string; | ||
identifiers: { | ||
@@ -48,3 +48,2 @@ trackingId: string; | ||
}, { | ||
transactionId: string; | ||
data: Record<string, string | { | ||
@@ -55,2 +54,3 @@ type: string; | ||
} | null>; | ||
transactionId: string; | ||
identifiers: { | ||
@@ -86,3 +86,3 @@ trackingId: string; | ||
type: "VALIDATE"; | ||
transactionId: string; | ||
draft: boolean; | ||
data: Record<string, string | { | ||
@@ -93,7 +93,6 @@ type: string; | ||
} | null>; | ||
draft: boolean; | ||
transactionId: string; | ||
eventId: string; | ||
duplicates: string[]; | ||
}, { | ||
transactionId: string; | ||
data: Record<string, string | { | ||
@@ -104,2 +103,3 @@ type: string; | ||
} | null>; | ||
transactionId: string; | ||
eventId: string; | ||
@@ -110,2 +110,3 @@ duplicates: string[]; | ||
}>; | ||
export type ValidateActionInput = z.infer<typeof ValidateActionInput>; | ||
export declare const NotifyActionInput: z.ZodObject<z.objectUtil.extendShape<{ | ||
@@ -133,3 +134,3 @@ eventId: z.ZodString; | ||
type: "NOTIFY"; | ||
transactionId: string; | ||
draft: boolean; | ||
data: Record<string, string | { | ||
@@ -140,7 +141,6 @@ type: string; | ||
} | null>; | ||
draft: boolean; | ||
transactionId: string; | ||
createdAtLocation: string; | ||
eventId: string; | ||
}, { | ||
transactionId: string; | ||
data: Record<string, string | { | ||
@@ -151,2 +151,3 @@ type: string; | ||
} | null>; | ||
transactionId: string; | ||
createdAtLocation: string; | ||
@@ -157,2 +158,3 @@ eventId: string; | ||
}>; | ||
export type NotifyActionInput = z.infer<typeof NotifyActionInput>; | ||
export declare const DeclareActionInput: z.ZodObject<z.objectUtil.extendShape<{ | ||
@@ -179,3 +181,3 @@ eventId: z.ZodString; | ||
type: "DECLARE"; | ||
transactionId: string; | ||
draft: boolean; | ||
data: Record<string, string | { | ||
@@ -186,6 +188,5 @@ type: string; | ||
} | null>; | ||
draft: boolean; | ||
transactionId: string; | ||
eventId: string; | ||
}, { | ||
transactionId: string; | ||
data: Record<string, string | { | ||
@@ -196,2 +197,3 @@ type: string; | ||
} | null>; | ||
transactionId: string; | ||
eventId: string; | ||
@@ -232,3 +234,3 @@ type?: "DECLARE" | undefined; | ||
type: "CREATE"; | ||
transactionId: string; | ||
draft: boolean; | ||
data: Record<string, string | { | ||
@@ -239,7 +241,6 @@ type: string; | ||
} | null>; | ||
draft: boolean; | ||
transactionId: string; | ||
createdAtLocation: string; | ||
eventId: string; | ||
}, { | ||
transactionId: string; | ||
data: Record<string, string | { | ||
@@ -250,2 +251,3 @@ type: string; | ||
} | null>; | ||
transactionId: string; | ||
createdAtLocation: string; | ||
@@ -277,3 +279,3 @@ eventId: string; | ||
type: "VALIDATE"; | ||
transactionId: string; | ||
draft: boolean; | ||
data: Record<string, string | { | ||
@@ -284,7 +286,6 @@ type: string; | ||
} | null>; | ||
draft: boolean; | ||
transactionId: string; | ||
eventId: string; | ||
duplicates: string[]; | ||
}, { | ||
transactionId: string; | ||
data: Record<string, string | { | ||
@@ -295,2 +296,3 @@ type: string; | ||
} | null>; | ||
transactionId: string; | ||
eventId: string; | ||
@@ -331,3 +333,3 @@ duplicates: string[]; | ||
type: "REGISTER"; | ||
transactionId: string; | ||
draft: boolean; | ||
data: Record<string, string | { | ||
@@ -338,3 +340,3 @@ type: string; | ||
} | null>; | ||
draft: boolean; | ||
transactionId: string; | ||
identifiers: { | ||
@@ -346,3 +348,2 @@ trackingId: string; | ||
}, { | ||
transactionId: string; | ||
data: Record<string, string | { | ||
@@ -353,2 +354,3 @@ type: string; | ||
} | null>; | ||
transactionId: string; | ||
identifiers: { | ||
@@ -383,3 +385,3 @@ trackingId: string; | ||
type: "NOTIFY"; | ||
transactionId: string; | ||
draft: boolean; | ||
data: Record<string, string | { | ||
@@ -390,7 +392,6 @@ type: string; | ||
} | null>; | ||
draft: boolean; | ||
transactionId: string; | ||
createdAtLocation: string; | ||
eventId: string; | ||
}, { | ||
transactionId: string; | ||
data: Record<string, string | { | ||
@@ -401,2 +402,3 @@ type: string; | ||
} | null>; | ||
transactionId: string; | ||
createdAtLocation: string; | ||
@@ -427,3 +429,3 @@ eventId: string; | ||
type: "DECLARE"; | ||
transactionId: string; | ||
draft: boolean; | ||
data: Record<string, string | { | ||
@@ -434,6 +436,5 @@ type: string; | ||
} | null>; | ||
draft: boolean; | ||
transactionId: string; | ||
eventId: string; | ||
}, { | ||
transactionId: string; | ||
data: Record<string, string | { | ||
@@ -444,2 +445,3 @@ type: string; | ||
} | null>; | ||
transactionId: string; | ||
eventId: string; | ||
@@ -470,3 +472,3 @@ type?: "DECLARE" | undefined; | ||
type: "ASSIGN"; | ||
transactionId: string; | ||
draft: boolean; | ||
data: Record<string, string | { | ||
@@ -477,7 +479,6 @@ type: string; | ||
} | null>; | ||
draft: boolean; | ||
transactionId: string; | ||
assignedTo: string; | ||
eventId: string; | ||
}, { | ||
transactionId: string; | ||
data: Record<string, string | { | ||
@@ -488,2 +489,3 @@ type: string; | ||
} | null>; | ||
transactionId: string; | ||
assignedTo: string; | ||
@@ -514,3 +516,3 @@ eventId: string; | ||
type: "UNASSIGN"; | ||
transactionId: string; | ||
draft: boolean; | ||
data: Record<string, string | { | ||
@@ -521,6 +523,5 @@ type: string; | ||
} | null>; | ||
draft: boolean; | ||
transactionId: string; | ||
eventId: string; | ||
}, { | ||
transactionId: string; | ||
data: Record<string, string | { | ||
@@ -531,2 +532,3 @@ type: string; | ||
} | null>; | ||
transactionId: string; | ||
eventId: string; | ||
@@ -533,0 +535,0 @@ type?: "UNASSIGN" | undefined; |
@@ -14,2 +14,7 @@ import { z } from 'zod'; | ||
options: z.ZodDefault<z.ZodOptional<z.ZodObject<{ | ||
/** | ||
* Names of length 3 or less characters = 0 edits allowed | ||
* Names of length 4 - 6 characters = 1 edit allowed | ||
* Names of length >7 characters = 2 edits allowed | ||
*/ | ||
fuzziness: z.ZodDefault<z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>>; | ||
@@ -26,3 +31,2 @@ boost: z.ZodDefault<z.ZodOptional<z.ZodNumber>>; | ||
type: "fuzzy"; | ||
fieldId: string; | ||
options: { | ||
@@ -32,2 +36,3 @@ boost: number; | ||
}; | ||
fieldId: string; | ||
}, { | ||
@@ -61,6 +66,6 @@ type: "fuzzy"; | ||
type: "strict"; | ||
fieldId: string; | ||
options: { | ||
boost: number; | ||
}; | ||
fieldId: string; | ||
}, { | ||
@@ -99,3 +104,2 @@ type: "strict"; | ||
type: "dateRange"; | ||
fieldId: string; | ||
options: { | ||
@@ -106,5 +110,5 @@ boost: number; | ||
}; | ||
fieldId: string; | ||
}, { | ||
type: "dateRange"; | ||
fieldId: string; | ||
options: { | ||
@@ -115,2 +119,3 @@ days: number; | ||
}; | ||
fieldId: string; | ||
}>; | ||
@@ -138,2 +143,7 @@ export type And = { | ||
options: z.ZodDefault<z.ZodOptional<z.ZodObject<{ | ||
/** | ||
* Names of length 3 or less characters = 0 edits allowed | ||
* Names of length 4 - 6 characters = 1 edit allowed | ||
* Names of length >7 characters = 2 edits allowed | ||
*/ | ||
fuzziness: z.ZodDefault<z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>>; | ||
@@ -150,3 +160,2 @@ boost: z.ZodDefault<z.ZodOptional<z.ZodNumber>>; | ||
type: "fuzzy"; | ||
fieldId: string; | ||
options: { | ||
@@ -156,2 +165,3 @@ boost: number; | ||
}; | ||
fieldId: string; | ||
}, { | ||
@@ -184,6 +194,6 @@ type: "fuzzy"; | ||
type: "strict"; | ||
fieldId: string; | ||
options: { | ||
boost: number; | ||
}; | ||
fieldId: string; | ||
}, { | ||
@@ -221,3 +231,2 @@ type: "strict"; | ||
type: "dateRange"; | ||
fieldId: string; | ||
options: { | ||
@@ -228,5 +237,5 @@ boost: number; | ||
}; | ||
fieldId: string; | ||
}, { | ||
type: "dateRange"; | ||
fieldId: string; | ||
options: { | ||
@@ -237,2 +246,3 @@ days: number; | ||
}; | ||
fieldId: string; | ||
}>, z.ZodObject<z.objectUtil.extendShape<{ | ||
@@ -264,3 +274,2 @@ fieldId: z.ZodString; | ||
type: "dateDistance"; | ||
fieldId: string; | ||
options: { | ||
@@ -271,5 +280,5 @@ boost: number; | ||
}; | ||
fieldId: string; | ||
}, { | ||
type: "dateDistance"; | ||
fieldId: string; | ||
options: { | ||
@@ -280,2 +289,3 @@ days: number; | ||
}; | ||
fieldId: string; | ||
}>]>; | ||
@@ -309,2 +319,7 @@ export declare const DeduplicationConfig: z.ZodObject<{ | ||
options: z.ZodDefault<z.ZodOptional<z.ZodObject<{ | ||
/** | ||
* Names of length 3 or less characters = 0 edits allowed | ||
* Names of length 4 - 6 characters = 1 edit allowed | ||
* Names of length >7 characters = 2 edits allowed | ||
*/ | ||
fuzziness: z.ZodDefault<z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>>; | ||
@@ -321,3 +336,2 @@ boost: z.ZodDefault<z.ZodOptional<z.ZodNumber>>; | ||
type: "fuzzy"; | ||
fieldId: string; | ||
options: { | ||
@@ -327,2 +341,3 @@ boost: number; | ||
}; | ||
fieldId: string; | ||
}, { | ||
@@ -355,6 +370,6 @@ type: "fuzzy"; | ||
type: "strict"; | ||
fieldId: string; | ||
options: { | ||
boost: number; | ||
}; | ||
fieldId: string; | ||
}, { | ||
@@ -392,3 +407,2 @@ type: "strict"; | ||
type: "dateRange"; | ||
fieldId: string; | ||
options: { | ||
@@ -399,5 +413,5 @@ boost: number; | ||
}; | ||
fieldId: string; | ||
}, { | ||
type: "dateRange"; | ||
fieldId: string; | ||
options: { | ||
@@ -408,2 +422,3 @@ days: number; | ||
}; | ||
fieldId: string; | ||
}>, z.ZodObject<z.objectUtil.extendShape<{ | ||
@@ -435,3 +450,2 @@ fieldId: z.ZodString; | ||
type: "dateDistance"; | ||
fieldId: string; | ||
options: { | ||
@@ -442,5 +456,5 @@ boost: number; | ||
}; | ||
fieldId: string; | ||
}, { | ||
type: "dateDistance"; | ||
fieldId: string; | ||
options: { | ||
@@ -451,2 +465,3 @@ days: number; | ||
}; | ||
fieldId: string; | ||
}>]>; | ||
@@ -460,5 +475,4 @@ }, "strip", z.ZodTypeAny, { | ||
}; | ||
query: And | Or | { | ||
query: { | ||
type: "fuzzy"; | ||
fieldId: string; | ||
options: { | ||
@@ -468,11 +482,11 @@ boost: number; | ||
}; | ||
fieldId: string; | ||
} | { | ||
type: "strict"; | ||
fieldId: string; | ||
options: { | ||
boost: number; | ||
}; | ||
fieldId: string; | ||
} | { | ||
type: "dateRange"; | ||
fieldId: string; | ||
options: { | ||
@@ -483,5 +497,5 @@ boost: number; | ||
}; | ||
fieldId: string; | ||
} | { | ||
type: "dateDistance"; | ||
fieldId: string; | ||
options: { | ||
@@ -492,3 +506,4 @@ boost: number; | ||
}; | ||
}; | ||
fieldId: string; | ||
} | And | Or; | ||
}, { | ||
@@ -501,3 +516,3 @@ id: string; | ||
}; | ||
query: And | Or | { | ||
query: { | ||
type: "fuzzy"; | ||
@@ -517,3 +532,2 @@ fieldId: string; | ||
type: "dateRange"; | ||
fieldId: string; | ||
options: { | ||
@@ -524,5 +538,5 @@ days: number; | ||
}; | ||
fieldId: string; | ||
} | { | ||
type: "dateDistance"; | ||
fieldId: string; | ||
options: { | ||
@@ -533,3 +547,4 @@ days: number; | ||
}; | ||
}; | ||
fieldId: string; | ||
} | And | Or; | ||
}>; | ||
@@ -536,0 +551,0 @@ export type DeduplicationConfig = z.infer<typeof DeduplicationConfig>; |
@@ -30,4 +30,3 @@ import { z } from 'zod'; | ||
type: "CREATE"; | ||
createdAt: string; | ||
createdBy: string; | ||
draft: boolean; | ||
data: Record<string, string | { | ||
@@ -38,8 +37,7 @@ type: string; | ||
} | null>; | ||
draft: boolean; | ||
createdAt: string; | ||
createdBy: string; | ||
createdAtLocation: string; | ||
}, { | ||
type: "CREATE"; | ||
createdAt: string; | ||
createdBy: string; | ||
data: Record<string, string | { | ||
@@ -50,2 +48,4 @@ type: string; | ||
} | null>; | ||
createdAt: string; | ||
createdBy: string; | ||
createdAtLocation: string; | ||
@@ -75,4 +75,3 @@ draft?: boolean | undefined; | ||
type: "VALIDATE"; | ||
createdAt: string; | ||
createdBy: string; | ||
draft: boolean; | ||
data: Record<string, string | { | ||
@@ -83,8 +82,7 @@ type: string; | ||
} | null>; | ||
draft: boolean; | ||
createdAt: string; | ||
createdBy: string; | ||
createdAtLocation: string; | ||
}, { | ||
type: "VALIDATE"; | ||
createdAt: string; | ||
createdBy: string; | ||
data: Record<string, string | { | ||
@@ -95,2 +93,4 @@ type: string; | ||
} | null>; | ||
createdAt: string; | ||
createdBy: string; | ||
createdAtLocation: string; | ||
@@ -120,4 +120,3 @@ draft?: boolean | undefined; | ||
type: "NOTIFY"; | ||
createdAt: string; | ||
createdBy: string; | ||
draft: boolean; | ||
data: Record<string, string | { | ||
@@ -128,8 +127,7 @@ type: string; | ||
} | null>; | ||
draft: boolean; | ||
createdAt: string; | ||
createdBy: string; | ||
createdAtLocation: string; | ||
}, { | ||
type: "NOTIFY"; | ||
createdAt: string; | ||
createdBy: string; | ||
data: Record<string, string | { | ||
@@ -140,2 +138,4 @@ type: string; | ||
} | null>; | ||
createdAt: string; | ||
createdBy: string; | ||
createdAtLocation: string; | ||
@@ -175,4 +175,3 @@ draft?: boolean | undefined; | ||
type: "REGISTER"; | ||
createdAt: string; | ||
createdBy: string; | ||
draft: boolean; | ||
data: Record<string, string | { | ||
@@ -183,3 +182,4 @@ type: string; | ||
} | null>; | ||
draft: boolean; | ||
createdAt: string; | ||
createdBy: string; | ||
createdAtLocation: string; | ||
@@ -192,4 +192,2 @@ identifiers: { | ||
type: "REGISTER"; | ||
createdAt: string; | ||
createdBy: string; | ||
data: Record<string, string | { | ||
@@ -200,2 +198,4 @@ type: string; | ||
} | null>; | ||
createdAt: string; | ||
createdBy: string; | ||
createdAtLocation: string; | ||
@@ -229,4 +229,3 @@ identifiers: { | ||
type: "DECLARE"; | ||
createdAt: string; | ||
createdBy: string; | ||
draft: boolean; | ||
data: Record<string, string | { | ||
@@ -237,8 +236,7 @@ type: string; | ||
} | null>; | ||
draft: boolean; | ||
createdAt: string; | ||
createdBy: string; | ||
createdAtLocation: string; | ||
}, { | ||
type: "DECLARE"; | ||
createdAt: string; | ||
createdBy: string; | ||
data: Record<string, string | { | ||
@@ -249,2 +247,4 @@ type: string; | ||
} | null>; | ||
createdAt: string; | ||
createdBy: string; | ||
createdAtLocation: string; | ||
@@ -275,4 +275,3 @@ draft?: boolean | undefined; | ||
type: "ASSIGN"; | ||
createdAt: string; | ||
createdBy: string; | ||
draft: boolean; | ||
data: Record<string, string | { | ||
@@ -283,3 +282,4 @@ type: string; | ||
} | null>; | ||
draft: boolean; | ||
createdAt: string; | ||
createdBy: string; | ||
createdAtLocation: string; | ||
@@ -289,4 +289,2 @@ assignedTo: string; | ||
type: "ASSIGN"; | ||
createdAt: string; | ||
createdBy: string; | ||
data: Record<string, string | { | ||
@@ -297,2 +295,4 @@ type: string; | ||
} | null>; | ||
createdAt: string; | ||
createdBy: string; | ||
createdAtLocation: string; | ||
@@ -323,4 +323,3 @@ assignedTo: string; | ||
type: "UNASSIGN"; | ||
createdAt: string; | ||
createdBy: string; | ||
draft: boolean; | ||
data: Record<string, string | { | ||
@@ -331,8 +330,7 @@ type: string; | ||
} | null>; | ||
draft: boolean; | ||
createdAt: string; | ||
createdBy: string; | ||
createdAtLocation: string; | ||
}, { | ||
type: "UNASSIGN"; | ||
createdAt: string; | ||
createdBy: string; | ||
data: Record<string, string | { | ||
@@ -343,2 +341,4 @@ type: string; | ||
} | null>; | ||
createdAt: string; | ||
createdBy: string; | ||
createdAtLocation: string; | ||
@@ -368,4 +368,3 @@ draft?: boolean | undefined; | ||
type: "CUSTOM"; | ||
createdAt: string; | ||
createdBy: string; | ||
draft: boolean; | ||
data: Record<string, string | { | ||
@@ -376,8 +375,7 @@ type: string; | ||
} | null>; | ||
draft: boolean; | ||
createdAt: string; | ||
createdBy: string; | ||
createdAtLocation: string; | ||
}, { | ||
type: "CUSTOM"; | ||
createdAt: string; | ||
createdBy: string; | ||
data: Record<string, string | { | ||
@@ -388,2 +386,4 @@ type: string; | ||
} | null>; | ||
createdAt: string; | ||
createdBy: string; | ||
createdAtLocation: string; | ||
@@ -393,8 +393,10 @@ draft?: boolean | undefined; | ||
}, "strip", z.ZodTypeAny, { | ||
type: string; | ||
id: string; | ||
type: string; | ||
transactionId: string; | ||
createdAt: string; | ||
updatedAt: string; | ||
actions: ({ | ||
type: "CREATE"; | ||
createdAt: string; | ||
createdBy: string; | ||
draft: boolean; | ||
data: Record<string, string | { | ||
@@ -405,8 +407,8 @@ type: string; | ||
} | null>; | ||
draft: boolean; | ||
createdAt: string; | ||
createdBy: string; | ||
createdAtLocation: string; | ||
} | { | ||
type: "VALIDATE"; | ||
createdAt: string; | ||
createdBy: string; | ||
draft: boolean; | ||
data: Record<string, string | { | ||
@@ -417,8 +419,8 @@ type: string; | ||
} | null>; | ||
draft: boolean; | ||
createdAt: string; | ||
createdBy: string; | ||
createdAtLocation: string; | ||
} | { | ||
type: "NOTIFY"; | ||
createdAt: string; | ||
createdBy: string; | ||
draft: boolean; | ||
data: Record<string, string | { | ||
@@ -429,8 +431,8 @@ type: string; | ||
} | null>; | ||
draft: boolean; | ||
createdAt: string; | ||
createdBy: string; | ||
createdAtLocation: string; | ||
} | { | ||
type: "REGISTER"; | ||
createdAt: string; | ||
createdBy: string; | ||
draft: boolean; | ||
data: Record<string, string | { | ||
@@ -441,3 +443,4 @@ type: string; | ||
} | null>; | ||
draft: boolean; | ||
createdAt: string; | ||
createdBy: string; | ||
createdAtLocation: string; | ||
@@ -450,4 +453,3 @@ identifiers: { | ||
type: "DECLARE"; | ||
createdAt: string; | ||
createdBy: string; | ||
draft: boolean; | ||
data: Record<string, string | { | ||
@@ -458,8 +460,8 @@ type: string; | ||
} | null>; | ||
draft: boolean; | ||
createdAt: string; | ||
createdBy: string; | ||
createdAtLocation: string; | ||
} | { | ||
type: "ASSIGN"; | ||
createdAt: string; | ||
createdBy: string; | ||
draft: boolean; | ||
data: Record<string, string | { | ||
@@ -470,3 +472,4 @@ type: string; | ||
} | null>; | ||
draft: boolean; | ||
createdAt: string; | ||
createdBy: string; | ||
createdAtLocation: string; | ||
@@ -476,4 +479,3 @@ assignedTo: string; | ||
type: "UNASSIGN"; | ||
createdAt: string; | ||
createdBy: string; | ||
draft: boolean; | ||
data: Record<string, string | { | ||
@@ -484,8 +486,8 @@ type: string; | ||
} | null>; | ||
draft: boolean; | ||
createdAt: string; | ||
createdBy: string; | ||
createdAtLocation: string; | ||
} | { | ||
type: "CUSTOM"; | ||
createdAt: string; | ||
createdBy: string; | ||
draft: boolean; | ||
data: Record<string, string | { | ||
@@ -496,15 +498,14 @@ type: string; | ||
} | null>; | ||
draft: boolean; | ||
createdAt: string; | ||
createdBy: string; | ||
createdAtLocation: string; | ||
})[]; | ||
}, { | ||
type: string; | ||
id: string; | ||
transactionId: string; | ||
createdAt: string; | ||
updatedAt: string; | ||
}, { | ||
id: string; | ||
type: string; | ||
actions: ({ | ||
type: "CREATE"; | ||
createdAt: string; | ||
createdBy: string; | ||
data: Record<string, string | { | ||
@@ -515,2 +516,4 @@ type: string; | ||
} | null>; | ||
createdAt: string; | ||
createdBy: string; | ||
createdAtLocation: string; | ||
@@ -520,4 +523,2 @@ draft?: boolean | undefined; | ||
type: "VALIDATE"; | ||
createdAt: string; | ||
createdBy: string; | ||
data: Record<string, string | { | ||
@@ -528,2 +529,4 @@ type: string; | ||
} | null>; | ||
createdAt: string; | ||
createdBy: string; | ||
createdAtLocation: string; | ||
@@ -533,4 +536,2 @@ draft?: boolean | undefined; | ||
type: "NOTIFY"; | ||
createdAt: string; | ||
createdBy: string; | ||
data: Record<string, string | { | ||
@@ -541,2 +542,4 @@ type: string; | ||
} | null>; | ||
createdAt: string; | ||
createdBy: string; | ||
createdAtLocation: string; | ||
@@ -546,4 +549,2 @@ draft?: boolean | undefined; | ||
type: "REGISTER"; | ||
createdAt: string; | ||
createdBy: string; | ||
data: Record<string, string | { | ||
@@ -554,2 +555,4 @@ type: string; | ||
} | null>; | ||
createdAt: string; | ||
createdBy: string; | ||
createdAtLocation: string; | ||
@@ -563,4 +566,2 @@ identifiers: { | ||
type: "DECLARE"; | ||
createdAt: string; | ||
createdBy: string; | ||
data: Record<string, string | { | ||
@@ -571,2 +572,4 @@ type: string; | ||
} | null>; | ||
createdAt: string; | ||
createdBy: string; | ||
createdAtLocation: string; | ||
@@ -576,4 +579,2 @@ draft?: boolean | undefined; | ||
type: "ASSIGN"; | ||
createdAt: string; | ||
createdBy: string; | ||
data: Record<string, string | { | ||
@@ -584,2 +585,4 @@ type: string; | ||
} | null>; | ||
createdAt: string; | ||
createdBy: string; | ||
createdAtLocation: string; | ||
@@ -590,4 +593,2 @@ assignedTo: string; | ||
type: "UNASSIGN"; | ||
createdAt: string; | ||
createdBy: string; | ||
data: Record<string, string | { | ||
@@ -598,2 +599,4 @@ type: string; | ||
} | null>; | ||
createdAt: string; | ||
createdBy: string; | ||
createdAtLocation: string; | ||
@@ -603,4 +606,2 @@ draft?: boolean | undefined; | ||
type: "CUSTOM"; | ||
createdAt: string; | ||
createdBy: string; | ||
data: Record<string, string | { | ||
@@ -611,10 +612,9 @@ type: string; | ||
} | null>; | ||
createdAt: string; | ||
createdBy: string; | ||
createdAtLocation: string; | ||
draft?: boolean | undefined; | ||
})[]; | ||
transactionId: string; | ||
createdAt: string; | ||
updatedAt: string; | ||
}>; | ||
export type EventDocument = z.infer<typeof EventDocument>; | ||
//# sourceMappingURL=EventDocument.d.ts.map |
@@ -22,6 +22,6 @@ import { z } from 'zod'; | ||
}>, "strip", z.ZodTypeAny, { | ||
type: string; | ||
id: string; | ||
status: "CERTIFIED" | "DECLARED" | "REGISTERED" | "VALIDATED" | "CREATED" | "NOTIFIED"; | ||
data: Record<string, any>; | ||
id: string; | ||
type: string; | ||
status: "DECLARED" | "VALIDATED" | "REGISTERED" | "CERTIFIED" | "CREATED" | "NOTIFIED"; | ||
createdAt: string; | ||
@@ -34,6 +34,6 @@ createdBy: string; | ||
}, { | ||
type: string; | ||
id: string; | ||
status: "CERTIFIED" | "DECLARED" | "REGISTERED" | "VALIDATED" | "CREATED" | "NOTIFIED"; | ||
data: Record<string, any>; | ||
id: string; | ||
type: string; | ||
status: "DECLARED" | "VALIDATED" | "REGISTERED" | "CERTIFIED" | "CREATED" | "NOTIFIED"; | ||
createdAt: string; | ||
@@ -40,0 +40,0 @@ createdBy: string; |
@@ -15,3 +15,3 @@ import { z } from 'zod'; | ||
export type EventStatus = (typeof EventStatus)[keyof typeof EventStatus]; | ||
export declare const eventStatuses: ("DECLARED" | "VALIDATED" | "REGISTERED" | "CERTIFIED" | "CREATED" | "NOTIFIED")[]; | ||
export declare const eventStatuses: ("CERTIFIED" | "DECLARED" | "REGISTERED" | "VALIDATED" | "CREATED" | "NOTIFIED")[]; | ||
export declare const EventStatuses: z.ZodNativeEnum<{ | ||
@@ -48,5 +48,5 @@ readonly CREATED: "CREATED"; | ||
}, "strip", z.ZodTypeAny, { | ||
type: string; | ||
id: string; | ||
type: string; | ||
status: "DECLARED" | "VALIDATED" | "REGISTERED" | "CERTIFIED" | "CREATED" | "NOTIFIED"; | ||
status: "CERTIFIED" | "DECLARED" | "REGISTERED" | "VALIDATED" | "CREATED" | "NOTIFIED"; | ||
createdAt: string; | ||
@@ -59,5 +59,5 @@ createdBy: string; | ||
}, { | ||
type: string; | ||
id: string; | ||
type: string; | ||
status: "DECLARED" | "VALIDATED" | "REGISTERED" | "CERTIFIED" | "CREATED" | "NOTIFIED"; | ||
status: "CERTIFIED" | "DECLARED" | "REGISTERED" | "VALIDATED" | "CREATED" | "NOTIFIED"; | ||
createdAt: string; | ||
@@ -64,0 +64,0 @@ createdBy: string; |
@@ -45,4 +45,6 @@ "use strict"; | ||
FormConfig: () => FormConfig, | ||
FormPage: () => FormPage, | ||
NotifyActionInput: () => NotifyActionInput, | ||
RegisterActionInput: () => RegisterActionInput, | ||
ResolvedUser: () => ResolvedUser, | ||
SummaryConfig: () => SummaryConfig, | ||
@@ -55,2 +57,3 @@ SummaryConfigInput: () => SummaryConfigInput, | ||
defineForm: () => defineForm, | ||
defineFormPage: () => defineFormPage, | ||
eventMetadataLabelMap: () => eventMetadataLabelMap, | ||
@@ -60,2 +63,3 @@ eventStatuses: () => eventStatuses, | ||
findPageFields: () => findPageFields, | ||
getAllFields: () => getAllFields, | ||
getCurrentEventState: () => getCurrentEventState, | ||
@@ -98,2 +102,3 @@ isUndeclaredDraft: () => isUndeclaredDraft, | ||
SHOW: "SHOW", | ||
HIDE: "HIDE", | ||
ENABLE: "ENABLE" | ||
@@ -106,2 +111,6 @@ }; | ||
}); | ||
var HideConditional = import_zod3.z.object({ | ||
type: import_zod3.z.literal(ConditionalTypes.HIDE), | ||
conditional: Conditional() | ||
}); | ||
var EnableConditional = import_zod3.z.object({ | ||
@@ -113,2 +122,3 @@ type: import_zod3.z.literal(ConditionalTypes.ENABLE), | ||
ShowConditional, | ||
HideConditional, | ||
EnableConditional | ||
@@ -118,3 +128,3 @@ ]); | ||
id: FieldId, | ||
conditionals: import_zod3.z.array(FieldConditional).optional().default([]), | ||
conditionals: import_zod3.z.array(FieldConditional).default([]).optional(), | ||
initialValue: import_zod3.z.union([ | ||
@@ -146,3 +156,7 @@ import_zod3.z.string(), | ||
FILE: "FILE", | ||
HIDDEN: "HIDDEN" | ||
HIDDEN: "HIDDEN", | ||
BULLET_LIST: "BULLET_LIST", | ||
CHECKBOX: "CHECKBOX", | ||
SELECT: "SELECT", | ||
COUNTRY: "COUNTRY" | ||
}; | ||
@@ -153,4 +167,5 @@ var fieldTypes = Object.values(FieldType); | ||
options: import_zod3.z.object({ | ||
maxLength: import_zod3.z.number().optional().describe("Maximum length of the text") | ||
}).default({}).optional() | ||
maxLength: import_zod3.z.number().optional().describe("Maximum length of the text"), | ||
type: import_zod3.z.enum(["text", "email", "password", "number"]).optional() | ||
}).default({ type: "text" }).optional() | ||
}).describe("Text input"); | ||
@@ -165,6 +180,16 @@ var DateField = BaseField.extend({ | ||
}).describe("A single date input (dd-mm-YYYY)"); | ||
var HTMLFontVariant = import_zod3.z.enum([ | ||
"reg12", | ||
"reg14", | ||
"reg16", | ||
"reg18", | ||
"h4", | ||
"h3", | ||
"h2", | ||
"h1" | ||
]); | ||
var Paragraph = BaseField.extend({ | ||
type: import_zod3.z.literal(FieldType.PARAGRAPH), | ||
options: import_zod3.z.object({ | ||
fontVariant: import_zod3.z.literal("reg16").optional() | ||
fontVariant: HTMLFontVariant.optional() | ||
}).default({}) | ||
@@ -184,2 +209,21 @@ }).describe("A read-only HTML <p> paragraph"); | ||
}).describe("Grouped radio options"); | ||
var BulletList = BaseField.extend({ | ||
type: import_zod3.z.literal(FieldType.BULLET_LIST), | ||
items: import_zod3.z.array(TranslationConfig).describe("A list of items"), | ||
font: HTMLFontVariant.optional() | ||
}).describe("A list of bullet points"); | ||
var SelectOption = import_zod3.z.object({ | ||
value: import_zod3.z.string().describe("The value of the option"), | ||
label: TranslationConfig.describe("The label of the option") | ||
}); | ||
var Select = BaseField.extend({ | ||
type: import_zod3.z.literal(FieldType.SELECT), | ||
options: import_zod3.z.array(SelectOption).describe("A list of options") | ||
}).describe("Select input"); | ||
var Checkbox = BaseField.extend({ | ||
type: import_zod3.z.literal(FieldType.CHECKBOX) | ||
}).describe("Check Box"); | ||
var Country = BaseField.extend({ | ||
type: import_zod3.z.literal(FieldType.COUNTRY) | ||
}).describe("Country select field"); | ||
var FieldConfig = import_zod3.z.discriminatedUnion("type", [ | ||
@@ -190,3 +234,7 @@ TextField, | ||
RadioGroup, | ||
File | ||
BulletList, | ||
Select, | ||
Checkbox, | ||
File, | ||
Country | ||
]); | ||
@@ -406,5 +454,7 @@ | ||
options: import_zod9.z.object({ | ||
// Names of length of 3 or less characters = 0 edits allowed | ||
// Names of length of 4 - 6 characters = 1 edit allowed | ||
// Names of length of >7 characters = 2 edits allowed | ||
/** | ||
* Names of length 3 or less characters = 0 edits allowed | ||
* Names of length 4 - 6 characters = 1 edit allowed | ||
* Names of length >7 characters = 2 edits allowed | ||
*/ | ||
fuzziness: import_zod9.z.union([import_zod9.z.string(), import_zod9.z.number()]).optional().default("AUTO:4,7"), | ||
@@ -473,2 +523,3 @@ boost: import_zod9.z.number().optional().default(1) | ||
var defineForm = (form) => FormConfig.parse(form); | ||
var defineFormPage = (formPage) => FormPage.parse(formPage); | ||
@@ -570,2 +621,13 @@ // ../commons/src/events/EventInput.ts | ||
]); | ||
var ResolvedUser = import_zod13.z.object({ | ||
id: import_zod13.z.string(), | ||
systemRole: import_zod13.z.string(), | ||
name: import_zod13.z.array( | ||
import_zod13.z.object({ | ||
use: import_zod13.z.string(), | ||
given: import_zod13.z.array(import_zod13.z.string()), | ||
family: import_zod13.z.string() | ||
}) | ||
) | ||
}); | ||
@@ -671,3 +733,3 @@ // ../commons/src/events/EventDocument.ts | ||
function getAssignedUserFromActions(actions) { | ||
return actions.reduce((status, action) => { | ||
return actions.reduce((user, action) => { | ||
if (action.type === ActionType.ASSIGN) { | ||
@@ -679,3 +741,3 @@ return action.assignedTo; | ||
} | ||
return status; | ||
return user; | ||
}, null); | ||
@@ -772,2 +834,5 @@ } | ||
}; | ||
function getAllFields(configuration) { | ||
return configuration.actions.flatMap((action) => action.forms.filter((form) => form.active)).flatMap((form) => form.pages.flatMap((page) => page.fields)); | ||
} | ||
@@ -774,0 +839,0 @@ // ../commons/src/events/defineConfig.ts |
@@ -8,10 +8,10 @@ import { z } from 'zod'; | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
description: string; | ||
}, { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
description: string; | ||
}>; | ||
export type TranslationConfig = z.infer<typeof TranslationConfig>; | ||
//# sourceMappingURL=TranslationConfig.d.ts.map |
import { TranslationConfig } from './TranslationConfig'; | ||
import { EventMetadataKeys } from './EventMetadata'; | ||
import { EventConfigInput } from './EventConfig'; | ||
import { EventConfig, EventConfigInput } from './EventConfig'; | ||
import { SummaryConfigInput } from './SummaryConfig'; | ||
@@ -45,11 +45,7 @@ import { WorkqueueConfigInput } from './WorkqueueConfig'; | ||
}[]; | ||
id: string; | ||
title: { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
description: string; | ||
}; | ||
filters: { | ||
status: ("CREATED" | "NOTIFIED" | "DECLARED" | "VALIDATED" | "REGISTERED" | "CERTIFIED")[]; | ||
}[]; | ||
} | { | ||
@@ -60,8 +56,396 @@ fields: { | ||
}[]; | ||
id: string; | ||
title: { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
}; | ||
filters: { | ||
status: ("CERTIFIED" | "DECLARED" | "REGISTERED" | "VALIDATED" | "CREATED" | "NOTIFIED")[]; | ||
}[]; | ||
}; | ||
export declare function getAllFields(configuration: EventConfig): ({ | ||
type: "TEXT"; | ||
id: string; | ||
label: { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
}; | ||
}; | ||
options?: { | ||
type?: "number" | "text" | "email" | "password" | undefined; | ||
maxLength?: number | undefined; | ||
} | undefined; | ||
validation?: { | ||
message: { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
}; | ||
validator: import("../client").JSONSchema; | ||
}[] | undefined; | ||
required?: boolean | undefined; | ||
conditionals?: ({ | ||
type: "SHOW"; | ||
conditional: import("../client").JSONSchema; | ||
} | { | ||
type: "HIDE"; | ||
conditional: import("../client").JSONSchema; | ||
} | { | ||
type: "ENABLE"; | ||
conditional: import("../client").JSONSchema; | ||
})[] | undefined; | ||
dependsOn?: string[] | undefined; | ||
initialValue?: string | { | ||
dependsOn: string[]; | ||
expression: string; | ||
} | undefined; | ||
disabled?: boolean | undefined; | ||
hidden?: boolean | undefined; | ||
placeholder?: { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
} | undefined; | ||
} | { | ||
type: "DATE"; | ||
id: string; | ||
label: { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
}; | ||
options?: { | ||
notice?: { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
} | undefined; | ||
} | undefined; | ||
validation?: { | ||
message: { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
}; | ||
validator: import("../client").JSONSchema; | ||
}[] | undefined; | ||
required?: boolean | undefined; | ||
conditionals?: ({ | ||
type: "SHOW"; | ||
conditional: import("../client").JSONSchema; | ||
} | { | ||
type: "HIDE"; | ||
conditional: import("../client").JSONSchema; | ||
} | { | ||
type: "ENABLE"; | ||
conditional: import("../client").JSONSchema; | ||
})[] | undefined; | ||
dependsOn?: string[] | undefined; | ||
initialValue?: string | { | ||
dependsOn: string[]; | ||
expression: string; | ||
} | undefined; | ||
disabled?: boolean | undefined; | ||
hidden?: boolean | undefined; | ||
placeholder?: { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
} | undefined; | ||
} | { | ||
type: "PARAGRAPH"; | ||
id: string; | ||
options: { | ||
fontVariant?: "reg12" | "reg14" | "reg16" | "reg18" | "h4" | "h3" | "h2" | "h1" | undefined; | ||
}; | ||
label: { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
}; | ||
validation?: { | ||
message: { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
}; | ||
validator: import("../client").JSONSchema; | ||
}[] | undefined; | ||
required?: boolean | undefined; | ||
conditionals?: ({ | ||
type: "SHOW"; | ||
conditional: import("../client").JSONSchema; | ||
} | { | ||
type: "HIDE"; | ||
conditional: import("../client").JSONSchema; | ||
} | { | ||
type: "ENABLE"; | ||
conditional: import("../client").JSONSchema; | ||
})[] | undefined; | ||
dependsOn?: string[] | undefined; | ||
initialValue?: string | { | ||
dependsOn: string[]; | ||
expression: string; | ||
} | undefined; | ||
disabled?: boolean | undefined; | ||
hidden?: boolean | undefined; | ||
placeholder?: { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
} | undefined; | ||
} | { | ||
type: "FILE"; | ||
id: string; | ||
label: { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
}; | ||
validation?: { | ||
message: { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
}; | ||
validator: import("../client").JSONSchema; | ||
}[] | undefined; | ||
required?: boolean | undefined; | ||
conditionals?: ({ | ||
type: "SHOW"; | ||
conditional: import("../client").JSONSchema; | ||
} | { | ||
type: "HIDE"; | ||
conditional: import("../client").JSONSchema; | ||
} | { | ||
type: "ENABLE"; | ||
conditional: import("../client").JSONSchema; | ||
})[] | undefined; | ||
dependsOn?: string[] | undefined; | ||
initialValue?: string | { | ||
dependsOn: string[]; | ||
expression: string; | ||
} | undefined; | ||
disabled?: boolean | undefined; | ||
hidden?: boolean | undefined; | ||
placeholder?: { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
} | undefined; | ||
} | { | ||
type: "RADIO_GROUP"; | ||
id: string; | ||
options: { | ||
value: string; | ||
label: string; | ||
}[]; | ||
label: { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
}; | ||
validation?: { | ||
message: { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
}; | ||
validator: import("../client").JSONSchema; | ||
}[] | undefined; | ||
required?: boolean | undefined; | ||
conditionals?: ({ | ||
type: "SHOW"; | ||
conditional: import("../client").JSONSchema; | ||
} | { | ||
type: "HIDE"; | ||
conditional: import("../client").JSONSchema; | ||
} | { | ||
type: "ENABLE"; | ||
conditional: import("../client").JSONSchema; | ||
})[] | undefined; | ||
dependsOn?: string[] | undefined; | ||
initialValue?: string | { | ||
dependsOn: string[]; | ||
expression: string; | ||
} | undefined; | ||
disabled?: boolean | undefined; | ||
hidden?: boolean | undefined; | ||
placeholder?: { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
} | undefined; | ||
} | { | ||
type: "BULLET_LIST"; | ||
id: string; | ||
label: { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
}; | ||
items: { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
}[]; | ||
validation?: { | ||
message: { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
}; | ||
validator: import("../client").JSONSchema; | ||
}[] | undefined; | ||
required?: boolean | undefined; | ||
conditionals?: ({ | ||
type: "SHOW"; | ||
conditional: import("../client").JSONSchema; | ||
} | { | ||
type: "HIDE"; | ||
conditional: import("../client").JSONSchema; | ||
} | { | ||
type: "ENABLE"; | ||
conditional: import("../client").JSONSchema; | ||
})[] | undefined; | ||
dependsOn?: string[] | undefined; | ||
initialValue?: string | { | ||
dependsOn: string[]; | ||
expression: string; | ||
} | undefined; | ||
disabled?: boolean | undefined; | ||
hidden?: boolean | undefined; | ||
placeholder?: { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
} | undefined; | ||
font?: "reg12" | "reg14" | "reg16" | "reg18" | "h4" | "h3" | "h2" | "h1" | undefined; | ||
} | { | ||
type: "SELECT"; | ||
id: string; | ||
options: { | ||
value: string; | ||
label: { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
}; | ||
}[]; | ||
label: { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
}; | ||
validation?: { | ||
message: { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
}; | ||
validator: import("../client").JSONSchema; | ||
}[] | undefined; | ||
required?: boolean | undefined; | ||
conditionals?: ({ | ||
type: "SHOW"; | ||
conditional: import("../client").JSONSchema; | ||
} | { | ||
type: "HIDE"; | ||
conditional: import("../client").JSONSchema; | ||
} | { | ||
type: "ENABLE"; | ||
conditional: import("../client").JSONSchema; | ||
})[] | undefined; | ||
dependsOn?: string[] | undefined; | ||
initialValue?: string | { | ||
dependsOn: string[]; | ||
expression: string; | ||
} | undefined; | ||
disabled?: boolean | undefined; | ||
hidden?: boolean | undefined; | ||
placeholder?: { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
} | undefined; | ||
} | { | ||
type: "CHECKBOX"; | ||
id: string; | ||
label: { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
}; | ||
validation?: { | ||
message: { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
}; | ||
validator: import("../client").JSONSchema; | ||
}[] | undefined; | ||
required?: boolean | undefined; | ||
conditionals?: ({ | ||
type: "SHOW"; | ||
conditional: import("../client").JSONSchema; | ||
} | { | ||
type: "HIDE"; | ||
conditional: import("../client").JSONSchema; | ||
} | { | ||
type: "ENABLE"; | ||
conditional: import("../client").JSONSchema; | ||
})[] | undefined; | ||
dependsOn?: string[] | undefined; | ||
initialValue?: string | { | ||
dependsOn: string[]; | ||
expression: string; | ||
} | undefined; | ||
disabled?: boolean | undefined; | ||
hidden?: boolean | undefined; | ||
placeholder?: { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
} | undefined; | ||
} | { | ||
type: "COUNTRY"; | ||
id: string; | ||
label: { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
}; | ||
validation?: { | ||
message: { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
}; | ||
validator: import("../client").JSONSchema; | ||
}[] | undefined; | ||
required?: boolean | undefined; | ||
conditionals?: ({ | ||
type: "SHOW"; | ||
conditional: import("../client").JSONSchema; | ||
} | { | ||
type: "HIDE"; | ||
conditional: import("../client").JSONSchema; | ||
} | { | ||
type: "ENABLE"; | ||
conditional: import("../client").JSONSchema; | ||
})[] | undefined; | ||
dependsOn?: string[] | undefined; | ||
initialValue?: string | { | ||
dependsOn: string[]; | ||
expression: string; | ||
} | undefined; | ||
disabled?: boolean | undefined; | ||
hidden?: boolean | undefined; | ||
placeholder?: { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
} | undefined; | ||
})[]; | ||
//# sourceMappingURL=utils.d.ts.map |
@@ -60,5 +60,5 @@ import { z } from 'zod'; | ||
}, "strip", z.ZodTypeAny, { | ||
status: ("DECLARED" | "VALIDATED" | "REGISTERED" | "CERTIFIED" | "CREATED" | "NOTIFIED")[]; | ||
status: ("CERTIFIED" | "DECLARED" | "REGISTERED" | "VALIDATED" | "CREATED" | "NOTIFIED")[]; | ||
}, { | ||
status: ("DECLARED" | "VALIDATED" | "REGISTERED" | "CERTIFIED" | "CREATED" | "NOTIFIED")[]; | ||
status: ("CERTIFIED" | "DECLARED" | "REGISTERED" | "VALIDATED" | "CREATED" | "NOTIFIED")[]; | ||
}>, "many">; | ||
@@ -81,3 +81,3 @@ }, "strip", z.ZodTypeAny, { | ||
filters: { | ||
status: ("DECLARED" | "VALIDATED" | "REGISTERED" | "CERTIFIED" | "CREATED" | "NOTIFIED")[]; | ||
status: ("CERTIFIED" | "DECLARED" | "REGISTERED" | "VALIDATED" | "CREATED" | "NOTIFIED")[]; | ||
}[]; | ||
@@ -100,3 +100,3 @@ }, { | ||
filters: { | ||
status: ("DECLARED" | "VALIDATED" | "REGISTERED" | "CERTIFIED" | "CREATED" | "NOTIFIED")[]; | ||
status: ("CERTIFIED" | "DECLARED" | "REGISTERED" | "VALIDATED" | "CREATED" | "NOTIFIED")[]; | ||
}[]; | ||
@@ -103,0 +103,0 @@ }>; |
{ | ||
"name": "@opencrvs/toolkit", | ||
"version": "0.0.13-events", | ||
"version": "0.0.14-events", | ||
"description": "OpenCRVS toolkit for building country configurations", | ||
@@ -5,0 +5,0 @@ "license": "MPL-2.0", |
@@ -120,4 +120,93 @@ /* | ||
required: ['$form', '$now'] | ||
}), | ||
isEqualTo: (value: string) => ({ | ||
type: 'object', | ||
properties: { | ||
$form: { | ||
type: 'object', | ||
properties: { | ||
[fieldId]: { | ||
const: value | ||
} | ||
}, | ||
required: [fieldId] | ||
} | ||
}, | ||
required: ['$form'] | ||
}), | ||
isInArray: (values: string[]) => ({ | ||
type: 'object', | ||
properties: { | ||
$form: { | ||
type: 'object', | ||
properties: { | ||
[fieldId]: { | ||
enum: values | ||
} | ||
}, | ||
required: [fieldId] | ||
} | ||
}, | ||
required: ['$form'] | ||
}), | ||
isNotInArray: (values: string[]) => ({ | ||
type: 'object', | ||
properties: { | ||
$form: { | ||
type: 'object', | ||
properties: { | ||
[fieldId]: { | ||
not: { | ||
enum: values | ||
} | ||
} | ||
}, | ||
required: [fieldId] | ||
} | ||
}, | ||
required: ['$form'] | ||
}), | ||
isUndefinedOrInArray: (values: string[]) => ({ | ||
type: 'object', | ||
properties: { | ||
$form: { | ||
type: 'object', | ||
anyOf: [ | ||
{ | ||
required: [fieldId], | ||
properties: { | ||
[fieldId]: { | ||
enum: values | ||
} | ||
} | ||
}, | ||
{ not: { required: [fieldId] } } | ||
] | ||
} | ||
}, | ||
required: ['$form'] | ||
}), | ||
isUndefinedOrNotInArray: (values: string[]) => ({ | ||
type: 'object', | ||
properties: { | ||
$form: { | ||
type: 'object', | ||
anyOf: [ | ||
{ | ||
required: [fieldId], | ||
properties: { | ||
[fieldId]: { | ||
not: { | ||
enum: values | ||
} | ||
} | ||
} | ||
}, | ||
{ not: { required: [fieldId] } } | ||
] | ||
} | ||
}, | ||
required: ['$form'] | ||
}) | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
4532747
109786
34