@opencrvs/toolkit
Advanced tools
Comparing version 0.0.28 to 0.0.29-events-jr
@@ -25,4 +25,2 @@ import { z } from 'zod'; | ||
draft: boolean; | ||
createdAt: string; | ||
createdBy: string; | ||
data: Record<string, string | { | ||
@@ -33,7 +31,7 @@ type: string; | ||
} | null>; | ||
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; | ||
@@ -71,4 +71,2 @@ draft?: boolean | undefined; | ||
draft: boolean; | ||
createdAt: string; | ||
createdBy: string; | ||
data: Record<string, string | { | ||
@@ -79,7 +77,7 @@ type: string; | ||
} | null>; | ||
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; | ||
@@ -116,4 +116,2 @@ draft?: boolean | undefined; | ||
draft: boolean; | ||
createdAt: string; | ||
createdBy: string; | ||
data: Record<string, string | { | ||
@@ -124,7 +122,7 @@ type: string; | ||
} | null>; | ||
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; | ||
@@ -161,4 +161,2 @@ draft?: boolean | undefined; | ||
draft: boolean; | ||
createdAt: string; | ||
createdBy: string; | ||
data: Record<string, string | { | ||
@@ -169,7 +167,7 @@ type: string; | ||
} | null>; | ||
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; | ||
@@ -216,4 +216,2 @@ draft?: boolean | undefined; | ||
draft: boolean; | ||
createdAt: string; | ||
createdBy: string; | ||
data: Record<string, string | { | ||
@@ -224,2 +222,4 @@ type: string; | ||
} | null>; | ||
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; | ||
@@ -270,4 +270,2 @@ identifiers: { | ||
draft: boolean; | ||
createdAt: string; | ||
createdBy: string; | ||
data: Record<string, string | { | ||
@@ -278,7 +276,7 @@ type: string; | ||
} | null>; | ||
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; | ||
@@ -316,4 +316,2 @@ draft?: boolean | undefined; | ||
draft: boolean; | ||
createdAt: string; | ||
createdBy: string; | ||
data: Record<string, string | { | ||
@@ -324,2 +322,4 @@ type: string; | ||
} | null>; | ||
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; | ||
@@ -364,4 +364,2 @@ assignedTo: string; | ||
draft: boolean; | ||
createdAt: string; | ||
createdBy: string; | ||
data: Record<string, string | { | ||
@@ -372,7 +370,7 @@ type: string; | ||
} | null>; | ||
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; | ||
@@ -409,4 +409,2 @@ draft?: boolean | undefined; | ||
draft: boolean; | ||
createdAt: string; | ||
createdBy: string; | ||
data: Record<string, string | { | ||
@@ -417,7 +415,7 @@ type: string; | ||
} | null>; | ||
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; | ||
@@ -442,24 +442,24 @@ draft?: boolean | undefined; | ||
use: string; | ||
given: string[]; | ||
family: string; | ||
given: string[]; | ||
}, { | ||
use: string; | ||
given: string[]; | ||
family: string; | ||
given: string[]; | ||
}>, "many">; | ||
}, "strip", z.ZodTypeAny, { | ||
id: string; | ||
name: { | ||
use: string; | ||
given: string[]; | ||
family: string; | ||
given: string[]; | ||
}[]; | ||
id: string; | ||
systemRole: string; | ||
}, { | ||
id: string; | ||
name: { | ||
use: string; | ||
given: string[]; | ||
family: string; | ||
given: string[]; | ||
}[]; | ||
id: string; | ||
systemRole: string; | ||
@@ -466,0 +466,0 @@ }>; |
@@ -32,3 +32,2 @@ import { z } from 'zod'; | ||
}>, "strip", z.ZodTypeAny, { | ||
transactionId: string; | ||
type: "REGISTER"; | ||
@@ -41,2 +40,3 @@ draft: boolean; | ||
} | null>; | ||
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: { | ||
@@ -85,3 +85,2 @@ trackingId: string; | ||
}>, "strip", z.ZodTypeAny, { | ||
transactionId: string; | ||
type: "VALIDATE"; | ||
@@ -94,6 +93,6 @@ draft: boolean; | ||
} | null>; | ||
transactionId: string; | ||
eventId: string; | ||
duplicates: string[]; | ||
}, { | ||
transactionId: string; | ||
data: Record<string, string | { | ||
@@ -104,2 +103,3 @@ type: string; | ||
} | null>; | ||
transactionId: string; | ||
eventId: string; | ||
@@ -132,3 +132,2 @@ duplicates: string[]; | ||
}>, "strip", z.ZodTypeAny, { | ||
transactionId: string; | ||
type: "NOTIFY"; | ||
@@ -141,6 +140,6 @@ draft: boolean; | ||
} | null>; | ||
transactionId: string; | ||
createdAtLocation: string; | ||
eventId: string; | ||
}, { | ||
transactionId: string; | ||
data: Record<string, string | { | ||
@@ -151,2 +150,3 @@ type: string; | ||
} | null>; | ||
transactionId: string; | ||
createdAtLocation: string; | ||
@@ -178,3 +178,2 @@ eventId: string; | ||
}>, "strip", z.ZodTypeAny, { | ||
transactionId: string; | ||
type: "DECLARE"; | ||
@@ -187,5 +186,5 @@ draft: boolean; | ||
} | null>; | ||
transactionId: string; | ||
eventId: string; | ||
}, { | ||
transactionId: string; | ||
data: Record<string, string | { | ||
@@ -196,2 +195,3 @@ type: string; | ||
} | null>; | ||
transactionId: string; | ||
eventId: string; | ||
@@ -231,3 +231,2 @@ type?: "DECLARE" | undefined; | ||
}>, "strip", z.ZodTypeAny, { | ||
transactionId: string; | ||
type: "CREATE"; | ||
@@ -240,6 +239,6 @@ draft: boolean; | ||
} | null>; | ||
transactionId: string; | ||
createdAtLocation: string; | ||
eventId: string; | ||
}, { | ||
transactionId: string; | ||
data: Record<string, string | { | ||
@@ -250,2 +249,3 @@ type: string; | ||
} | null>; | ||
transactionId: string; | ||
createdAtLocation: string; | ||
@@ -276,3 +276,2 @@ eventId: string; | ||
}>, "strip", z.ZodTypeAny, { | ||
transactionId: string; | ||
type: "VALIDATE"; | ||
@@ -285,6 +284,6 @@ draft: boolean; | ||
} | null>; | ||
transactionId: string; | ||
eventId: string; | ||
duplicates: string[]; | ||
}, { | ||
transactionId: string; | ||
data: Record<string, string | { | ||
@@ -295,2 +294,3 @@ type: string; | ||
} | null>; | ||
transactionId: string; | ||
eventId: string; | ||
@@ -330,3 +330,2 @@ duplicates: string[]; | ||
}>, "strip", z.ZodTypeAny, { | ||
transactionId: string; | ||
type: "REGISTER"; | ||
@@ -339,2 +338,3 @@ draft: boolean; | ||
} | null>; | ||
transactionId: string; | ||
identifiers: { | ||
@@ -346,3 +346,2 @@ trackingId: string; | ||
}, { | ||
transactionId: string; | ||
data: Record<string, string | { | ||
@@ -353,2 +352,3 @@ type: string; | ||
} | null>; | ||
transactionId: string; | ||
identifiers: { | ||
@@ -382,3 +382,2 @@ trackingId: string; | ||
}>, "strip", z.ZodTypeAny, { | ||
transactionId: string; | ||
type: "NOTIFY"; | ||
@@ -391,6 +390,6 @@ draft: boolean; | ||
} | null>; | ||
transactionId: string; | ||
createdAtLocation: string; | ||
eventId: string; | ||
}, { | ||
transactionId: string; | ||
data: Record<string, string | { | ||
@@ -401,2 +400,3 @@ type: string; | ||
} | null>; | ||
transactionId: string; | ||
createdAtLocation: string; | ||
@@ -426,3 +426,2 @@ eventId: string; | ||
}>, "strip", z.ZodTypeAny, { | ||
transactionId: string; | ||
type: "DECLARE"; | ||
@@ -435,5 +434,5 @@ draft: boolean; | ||
} | null>; | ||
transactionId: string; | ||
eventId: string; | ||
}, { | ||
transactionId: string; | ||
data: Record<string, string | { | ||
@@ -444,2 +443,3 @@ type: string; | ||
} | null>; | ||
transactionId: string; | ||
eventId: string; | ||
@@ -469,3 +469,2 @@ type?: "DECLARE" | undefined; | ||
}>, "strip", z.ZodTypeAny, { | ||
transactionId: string; | ||
type: "ASSIGN"; | ||
@@ -478,6 +477,6 @@ draft: boolean; | ||
} | null>; | ||
transactionId: string; | ||
assignedTo: string; | ||
eventId: string; | ||
}, { | ||
transactionId: string; | ||
data: Record<string, string | { | ||
@@ -488,2 +487,3 @@ type: string; | ||
} | null>; | ||
transactionId: string; | ||
assignedTo: string; | ||
@@ -513,3 +513,2 @@ eventId: string; | ||
}>, "strip", z.ZodTypeAny, { | ||
transactionId: string; | ||
type: "UNASSIGN"; | ||
@@ -522,5 +521,5 @@ draft: boolean; | ||
} | null>; | ||
transactionId: string; | ||
eventId: string; | ||
}, { | ||
transactionId: string; | ||
data: Record<string, string | { | ||
@@ -531,2 +530,3 @@ type: string; | ||
} | null>; | ||
transactionId: string; | ||
eventId: string; | ||
@@ -533,0 +533,0 @@ type?: "UNASSIGN" | undefined; |
@@ -31,4 +31,2 @@ import { z } from 'zod'; | ||
draft: boolean; | ||
createdAt: string; | ||
createdBy: string; | ||
data: Record<string, string | { | ||
@@ -39,7 +37,7 @@ type: string; | ||
} | null>; | ||
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; | ||
@@ -76,4 +76,2 @@ draft?: boolean | undefined; | ||
draft: boolean; | ||
createdAt: string; | ||
createdBy: string; | ||
data: Record<string, string | { | ||
@@ -84,7 +82,7 @@ type: string; | ||
} | null>; | ||
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; | ||
@@ -121,4 +121,2 @@ draft?: boolean | undefined; | ||
draft: boolean; | ||
createdAt: string; | ||
createdBy: string; | ||
data: Record<string, string | { | ||
@@ -129,7 +127,7 @@ type: string; | ||
} | null>; | ||
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; | ||
@@ -176,4 +176,2 @@ draft?: boolean | undefined; | ||
draft: boolean; | ||
createdAt: string; | ||
createdBy: string; | ||
data: Record<string, string | { | ||
@@ -184,2 +182,4 @@ type: string; | ||
} | null>; | ||
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; | ||
@@ -230,4 +230,2 @@ identifiers: { | ||
draft: boolean; | ||
createdAt: string; | ||
createdBy: string; | ||
data: Record<string, string | { | ||
@@ -238,7 +236,7 @@ type: string; | ||
} | null>; | ||
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; | ||
@@ -276,4 +276,2 @@ draft?: boolean | undefined; | ||
draft: boolean; | ||
createdAt: string; | ||
createdBy: string; | ||
data: Record<string, string | { | ||
@@ -284,2 +282,4 @@ type: string; | ||
} | null>; | ||
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; | ||
@@ -324,4 +324,2 @@ assignedTo: string; | ||
draft: boolean; | ||
createdAt: string; | ||
createdBy: string; | ||
data: Record<string, string | { | ||
@@ -332,7 +330,7 @@ type: string; | ||
} | null>; | ||
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; | ||
@@ -369,4 +369,2 @@ draft?: boolean | undefined; | ||
draft: boolean; | ||
createdAt: string; | ||
createdBy: string; | ||
data: Record<string, string | { | ||
@@ -377,7 +375,7 @@ type: string; | ||
} | null>; | ||
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,5 +393,5 @@ draft?: boolean | undefined; | ||
}, "strip", z.ZodTypeAny, { | ||
transactionId: string; | ||
type: string; | ||
id: string; | ||
transactionId: string; | ||
createdAt: string; | ||
@@ -402,4 +402,2 @@ updatedAt: string; | ||
draft: boolean; | ||
createdAt: string; | ||
createdBy: string; | ||
data: Record<string, string | { | ||
@@ -410,2 +408,4 @@ type: string; | ||
} | null>; | ||
createdAt: string; | ||
createdBy: string; | ||
createdAtLocation: string; | ||
@@ -415,4 +415,2 @@ } | { | ||
draft: boolean; | ||
createdAt: string; | ||
createdBy: string; | ||
data: Record<string, string | { | ||
@@ -423,2 +421,4 @@ type: string; | ||
} | null>; | ||
createdAt: string; | ||
createdBy: string; | ||
createdAtLocation: string; | ||
@@ -428,4 +428,2 @@ } | { | ||
draft: boolean; | ||
createdAt: string; | ||
createdBy: string; | ||
data: Record<string, string | { | ||
@@ -436,2 +434,4 @@ type: string; | ||
} | null>; | ||
createdAt: string; | ||
createdBy: string; | ||
createdAtLocation: string; | ||
@@ -441,4 +441,2 @@ } | { | ||
draft: boolean; | ||
createdAt: string; | ||
createdBy: string; | ||
data: Record<string, string | { | ||
@@ -449,2 +447,4 @@ type: string; | ||
} | null>; | ||
createdAt: string; | ||
createdBy: string; | ||
createdAtLocation: string; | ||
@@ -458,4 +458,2 @@ identifiers: { | ||
draft: boolean; | ||
createdAt: string; | ||
createdBy: string; | ||
data: Record<string, string | { | ||
@@ -466,2 +464,4 @@ type: string; | ||
} | null>; | ||
createdAt: string; | ||
createdBy: string; | ||
createdAtLocation: string; | ||
@@ -471,4 +471,2 @@ } | { | ||
draft: boolean; | ||
createdAt: string; | ||
createdBy: string; | ||
data: Record<string, string | { | ||
@@ -479,2 +477,4 @@ type: string; | ||
} | null>; | ||
createdAt: string; | ||
createdBy: string; | ||
createdAtLocation: string; | ||
@@ -485,4 +485,2 @@ assignedTo: string; | ||
draft: boolean; | ||
createdAt: string; | ||
createdBy: string; | ||
data: Record<string, string | { | ||
@@ -493,2 +491,4 @@ type: string; | ||
} | null>; | ||
createdAt: string; | ||
createdBy: string; | ||
createdAtLocation: string; | ||
@@ -498,4 +498,2 @@ } | { | ||
draft: boolean; | ||
createdAt: string; | ||
createdBy: string; | ||
data: Record<string, string | { | ||
@@ -506,8 +504,10 @@ type: string; | ||
} | null>; | ||
createdAt: string; | ||
createdBy: string; | ||
createdAtLocation: string; | ||
})[]; | ||
}, { | ||
transactionId: string; | ||
type: string; | ||
id: string; | ||
transactionId: string; | ||
createdAt: string; | ||
@@ -517,4 +517,2 @@ updatedAt: string; | ||
type: "CREATE"; | ||
createdAt: string; | ||
createdBy: string; | ||
data: Record<string, string | { | ||
@@ -525,2 +523,4 @@ type: string; | ||
} | null>; | ||
createdAt: string; | ||
createdBy: string; | ||
createdAtLocation: string; | ||
@@ -530,4 +530,2 @@ draft?: boolean | undefined; | ||
type: "VALIDATE"; | ||
createdAt: string; | ||
createdBy: string; | ||
data: Record<string, string | { | ||
@@ -538,2 +536,4 @@ type: string; | ||
} | null>; | ||
createdAt: string; | ||
createdBy: string; | ||
createdAtLocation: string; | ||
@@ -543,4 +543,2 @@ draft?: boolean | undefined; | ||
type: "NOTIFY"; | ||
createdAt: string; | ||
createdBy: string; | ||
data: Record<string, string | { | ||
@@ -551,2 +549,4 @@ type: string; | ||
} | null>; | ||
createdAt: string; | ||
createdBy: string; | ||
createdAtLocation: string; | ||
@@ -556,4 +556,2 @@ draft?: boolean | undefined; | ||
type: "REGISTER"; | ||
createdAt: string; | ||
createdBy: string; | ||
data: Record<string, string | { | ||
@@ -564,2 +562,4 @@ type: string; | ||
} | null>; | ||
createdAt: string; | ||
createdBy: string; | ||
createdAtLocation: string; | ||
@@ -573,4 +573,2 @@ identifiers: { | ||
type: "DECLARE"; | ||
createdAt: string; | ||
createdBy: string; | ||
data: Record<string, string | { | ||
@@ -581,2 +579,4 @@ type: string; | ||
} | null>; | ||
createdAt: string; | ||
createdBy: string; | ||
createdAtLocation: string; | ||
@@ -586,4 +586,2 @@ draft?: boolean | undefined; | ||
type: "ASSIGN"; | ||
createdAt: string; | ||
createdBy: string; | ||
data: Record<string, string | { | ||
@@ -594,2 +592,4 @@ type: string; | ||
} | null>; | ||
createdAt: string; | ||
createdBy: string; | ||
createdAtLocation: string; | ||
@@ -600,4 +600,2 @@ assignedTo: string; | ||
type: "UNASSIGN"; | ||
createdAt: string; | ||
createdBy: string; | ||
data: Record<string, string | { | ||
@@ -608,2 +606,4 @@ type: string; | ||
} | null>; | ||
createdAt: string; | ||
createdBy: string; | ||
createdAtLocation: string; | ||
@@ -613,4 +613,2 @@ draft?: boolean | undefined; | ||
type: "CUSTOM"; | ||
createdAt: string; | ||
createdBy: string; | ||
data: Record<string, string | { | ||
@@ -621,2 +619,4 @@ type: string; | ||
} | null>; | ||
createdAt: string; | ||
createdBy: string; | ||
createdAtLocation: string; | ||
@@ -623,0 +623,0 @@ draft?: boolean | undefined; |
@@ -6,9 +6,9 @@ import { z } from 'zod'; | ||
}, "strip", z.ZodTypeAny, { | ||
type: string; | ||
transactionId: string; | ||
}, { | ||
type: string; | ||
}, { | ||
transactionId: string; | ||
type: string; | ||
}>; | ||
export type EventInput = z.infer<typeof EventInput>; | ||
//# sourceMappingURL=EventInput.d.ts.map |
@@ -11,8 +11,8 @@ import { z } from 'zod'; | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
description: string; | ||
}, { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
description: string; | ||
}>; | ||
@@ -25,8 +25,8 @@ emptyValueMessage: z.ZodOptional<z.ZodObject<{ | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
description: string; | ||
}, { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
description: string; | ||
}>>; | ||
@@ -37,9 +37,9 @@ }, "strip", z.ZodTypeAny, { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
description: string; | ||
}; | ||
emptyValueMessage?: { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
description: string; | ||
} | undefined; | ||
@@ -50,9 +50,9 @@ }, { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
description: string; | ||
}; | ||
emptyValueMessage?: { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
description: string; | ||
} | undefined; | ||
@@ -68,8 +68,8 @@ }>; | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
description: string; | ||
}, { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
description: string; | ||
}>; | ||
@@ -82,8 +82,8 @@ label: z.ZodObject<{ | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
description: string; | ||
}, { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
description: string; | ||
}>; | ||
@@ -96,8 +96,8 @@ emptyValueMessage: z.ZodOptional<z.ZodObject<{ | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
description: string; | ||
}, { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
description: string; | ||
}>>; | ||
@@ -108,14 +108,14 @@ }, "strip", z.ZodTypeAny, { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
description: string; | ||
}; | ||
label: { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
description: string; | ||
}; | ||
emptyValueMessage?: { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
description: string; | ||
} | undefined; | ||
@@ -126,14 +126,14 @@ }, { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
description: string; | ||
}; | ||
label: { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
description: string; | ||
}; | ||
emptyValueMessage?: { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
description: string; | ||
} | undefined; | ||
@@ -146,9 +146,9 @@ }>, "many">; | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
description: string; | ||
}; | ||
emptyValueMessage?: { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
description: string; | ||
} | undefined; | ||
@@ -160,14 +160,14 @@ }; | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
description: string; | ||
}; | ||
label: { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
description: string; | ||
}; | ||
emptyValueMessage?: { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
description: string; | ||
} | undefined; | ||
@@ -180,9 +180,9 @@ }[]; | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
description: string; | ||
}; | ||
emptyValueMessage?: { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
description: string; | ||
} | undefined; | ||
@@ -194,14 +194,14 @@ }; | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
description: string; | ||
}; | ||
label: { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
description: string; | ||
}; | ||
emptyValueMessage?: { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
description: string; | ||
} | undefined; | ||
@@ -208,0 +208,0 @@ }[]; |
import { TranslationConfig } from './TranslationConfig'; | ||
import { EventMetadataKeys } from './EventMetadata'; | ||
import { EventConfig, EventConfigInput } from './EventConfig'; | ||
import { WorkqueueConfigInput } from './WorkqueueConfig'; | ||
import { FieldConfig } from './FieldConfig'; | ||
import { WorkqueueConfig } from './WorkqueueConfig'; | ||
/** | ||
@@ -36,23 +36,2 @@ * @returns All the fields in the event configuration input. | ||
}[]; | ||
export declare const resolveFieldLabels: ({ config, pageFields }: { | ||
config: WorkqueueConfigInput; | ||
pageFields: { | ||
id: string; | ||
label: TranslationConfig; | ||
}[]; | ||
}) => { | ||
fields: { | ||
id: EventMetadataKeys | string; | ||
label?: TranslationConfig; | ||
}[]; | ||
id: string; | ||
title: { | ||
description: string; | ||
id: string; | ||
defaultMessage: string; | ||
}; | ||
filters: { | ||
status: ("DECLARED" | "VALIDATED" | "REGISTERED" | "CERTIFIED" | "CREATED" | "NOTIFIED")[]; | ||
}[]; | ||
}; | ||
export declare function getAllFields(configuration: EventConfig): ({ | ||
@@ -62,4 +41,4 @@ type: "TEXT"; | ||
label: { | ||
id: string; | ||
description: string; | ||
id: string; | ||
defaultMessage: string; | ||
@@ -73,4 +52,4 @@ }; | ||
message: { | ||
id: string; | ||
description: string; | ||
id: string; | ||
defaultMessage: string; | ||
@@ -80,3 +59,2 @@ }; | ||
}[] | undefined; | ||
disabled?: boolean | undefined; | ||
required?: boolean | undefined; | ||
@@ -98,6 +76,7 @@ conditionals?: ({ | ||
} | undefined; | ||
disabled?: boolean | undefined; | ||
hidden?: boolean | undefined; | ||
placeholder?: { | ||
id: string; | ||
description: string; | ||
id: string; | ||
defaultMessage: string; | ||
@@ -109,4 +88,4 @@ } | undefined; | ||
label: { | ||
id: string; | ||
description: string; | ||
id: string; | ||
defaultMessage: string; | ||
@@ -116,4 +95,4 @@ }; | ||
notice?: { | ||
id: string; | ||
description: string; | ||
id: string; | ||
defaultMessage: string; | ||
@@ -124,4 +103,4 @@ } | undefined; | ||
message: { | ||
id: string; | ||
description: string; | ||
id: string; | ||
defaultMessage: string; | ||
@@ -131,3 +110,2 @@ }; | ||
}[] | undefined; | ||
disabled?: boolean | undefined; | ||
required?: boolean | undefined; | ||
@@ -149,6 +127,7 @@ conditionals?: ({ | ||
} | undefined; | ||
disabled?: boolean | undefined; | ||
hidden?: boolean | undefined; | ||
placeholder?: { | ||
id: string; | ||
description: string; | ||
id: string; | ||
defaultMessage: string; | ||
@@ -158,9 +137,9 @@ } | undefined; | ||
type: "PARAGRAPH"; | ||
id: string; | ||
options: { | ||
fontVariant?: "reg12" | "reg14" | "reg16" | "reg18" | "h4" | "h3" | "h2" | "h1" | undefined; | ||
}; | ||
id: string; | ||
label: { | ||
id: string; | ||
description: string; | ||
id: string; | ||
defaultMessage: string; | ||
@@ -170,4 +149,4 @@ }; | ||
message: { | ||
id: string; | ||
description: string; | ||
id: string; | ||
defaultMessage: string; | ||
@@ -177,3 +156,2 @@ }; | ||
}[] | undefined; | ||
disabled?: boolean | undefined; | ||
required?: boolean | undefined; | ||
@@ -195,6 +173,7 @@ conditionals?: ({ | ||
} | undefined; | ||
disabled?: boolean | undefined; | ||
hidden?: boolean | undefined; | ||
placeholder?: { | ||
id: string; | ||
description: string; | ||
id: string; | ||
defaultMessage: string; | ||
@@ -206,4 +185,4 @@ } | undefined; | ||
label: { | ||
id: string; | ||
description: string; | ||
id: string; | ||
defaultMessage: string; | ||
@@ -213,4 +192,4 @@ }; | ||
message: { | ||
id: string; | ||
description: string; | ||
id: string; | ||
defaultMessage: string; | ||
@@ -220,3 +199,2 @@ }; | ||
}[] | undefined; | ||
disabled?: boolean | undefined; | ||
required?: boolean | undefined; | ||
@@ -238,6 +216,7 @@ conditionals?: ({ | ||
} | undefined; | ||
disabled?: boolean | undefined; | ||
hidden?: boolean | undefined; | ||
placeholder?: { | ||
id: string; | ||
description: string; | ||
id: string; | ||
defaultMessage: string; | ||
@@ -247,14 +226,14 @@ } | undefined; | ||
type: "RADIO_GROUP"; | ||
id: string; | ||
options: { | ||
value: string; | ||
label: { | ||
id: string; | ||
description: string; | ||
id: string; | ||
defaultMessage: string; | ||
}; | ||
}[]; | ||
id: string; | ||
label: { | ||
id: string; | ||
description: string; | ||
id: string; | ||
defaultMessage: string; | ||
@@ -264,4 +243,4 @@ }; | ||
message: { | ||
id: string; | ||
description: string; | ||
id: string; | ||
defaultMessage: string; | ||
@@ -271,3 +250,2 @@ }; | ||
}[] | undefined; | ||
disabled?: boolean | undefined; | ||
required?: boolean | undefined; | ||
@@ -289,6 +267,7 @@ conditionals?: ({ | ||
} | undefined; | ||
disabled?: boolean | undefined; | ||
hidden?: boolean | undefined; | ||
placeholder?: { | ||
id: string; | ||
description: string; | ||
id: string; | ||
defaultMessage: string; | ||
@@ -301,9 +280,9 @@ } | undefined; | ||
label: { | ||
id: string; | ||
description: string; | ||
id: string; | ||
defaultMessage: string; | ||
}; | ||
items: { | ||
id: string; | ||
description: string; | ||
id: string; | ||
defaultMessage: string; | ||
@@ -314,4 +293,4 @@ }[]; | ||
message: { | ||
id: string; | ||
description: string; | ||
id: string; | ||
defaultMessage: string; | ||
@@ -321,3 +300,2 @@ }; | ||
}[] | undefined; | ||
disabled?: boolean | undefined; | ||
required?: boolean | undefined; | ||
@@ -339,6 +317,7 @@ conditionals?: ({ | ||
} | undefined; | ||
disabled?: boolean | undefined; | ||
hidden?: boolean | undefined; | ||
placeholder?: { | ||
id: string; | ||
description: string; | ||
id: string; | ||
defaultMessage: string; | ||
@@ -348,14 +327,14 @@ } | undefined; | ||
type: "SELECT"; | ||
id: string; | ||
options: { | ||
value: string; | ||
label: { | ||
id: string; | ||
description: string; | ||
id: string; | ||
defaultMessage: string; | ||
}; | ||
}[]; | ||
id: string; | ||
label: { | ||
id: string; | ||
description: string; | ||
id: string; | ||
defaultMessage: string; | ||
@@ -365,4 +344,4 @@ }; | ||
message: { | ||
id: string; | ||
description: string; | ||
id: string; | ||
defaultMessage: string; | ||
@@ -372,3 +351,2 @@ }; | ||
}[] | undefined; | ||
disabled?: boolean | undefined; | ||
required?: boolean | undefined; | ||
@@ -390,6 +368,7 @@ conditionals?: ({ | ||
} | undefined; | ||
disabled?: boolean | undefined; | ||
hidden?: boolean | undefined; | ||
placeholder?: { | ||
id: string; | ||
description: string; | ||
id: string; | ||
defaultMessage: string; | ||
@@ -401,4 +380,4 @@ } | undefined; | ||
label: { | ||
id: string; | ||
description: string; | ||
id: string; | ||
defaultMessage: string; | ||
@@ -408,4 +387,4 @@ }; | ||
message: { | ||
id: string; | ||
description: string; | ||
id: string; | ||
defaultMessage: string; | ||
@@ -415,3 +394,2 @@ }; | ||
}[] | undefined; | ||
disabled?: boolean | undefined; | ||
required?: boolean | undefined; | ||
@@ -433,6 +411,7 @@ conditionals?: ({ | ||
} | undefined; | ||
disabled?: boolean | undefined; | ||
hidden?: boolean | undefined; | ||
placeholder?: { | ||
id: string; | ||
description: string; | ||
id: string; | ||
defaultMessage: string; | ||
@@ -444,4 +423,4 @@ } | undefined; | ||
label: { | ||
id: string; | ||
description: string; | ||
id: string; | ||
defaultMessage: string; | ||
@@ -451,4 +430,4 @@ }; | ||
message: { | ||
id: string; | ||
description: string; | ||
id: string; | ||
defaultMessage: string; | ||
@@ -458,3 +437,2 @@ }; | ||
}[] | undefined; | ||
disabled?: boolean | undefined; | ||
required?: boolean | undefined; | ||
@@ -476,6 +454,7 @@ conditionals?: ({ | ||
} | undefined; | ||
disabled?: boolean | undefined; | ||
hidden?: boolean | undefined; | ||
placeholder?: { | ||
id: string; | ||
description: string; | ||
id: string; | ||
defaultMessage: string; | ||
@@ -485,4 +464,5 @@ } | undefined; | ||
type: "LOCATION"; | ||
id: string; | ||
options: { | ||
type: "CRVS_OFFICE" | "HEALTH_FACILITY" | "ADMIN_STRUCTURE"; | ||
type: "ADMIN_STRUCTURE" | "HEALTH_FACILITY" | "CRVS_OFFICE"; | ||
partOf?: { | ||
@@ -492,6 +472,5 @@ $data: string; | ||
}; | ||
id: string; | ||
label: { | ||
id: string; | ||
description: string; | ||
id: string; | ||
defaultMessage: string; | ||
@@ -501,4 +480,4 @@ }; | ||
message: { | ||
id: string; | ||
description: string; | ||
id: string; | ||
defaultMessage: string; | ||
@@ -508,3 +487,2 @@ }; | ||
}[] | undefined; | ||
disabled?: boolean | undefined; | ||
required?: boolean | undefined; | ||
@@ -526,9 +504,11 @@ conditionals?: ({ | ||
} | undefined; | ||
disabled?: boolean | undefined; | ||
hidden?: boolean | undefined; | ||
placeholder?: { | ||
id: string; | ||
description: string; | ||
id: string; | ||
defaultMessage: string; | ||
} | undefined; | ||
})[]; | ||
export declare function validateWorkqueueConfig(workqueueConfigs: WorkqueueConfig[]): void; | ||
//# sourceMappingURL=utils.d.ts.map |
@@ -7,18 +7,5 @@ import { z } from 'zod'; | ||
id: z.ZodString; | ||
title: z.ZodObject<{ | ||
id: z.ZodString; | ||
defaultMessage: z.ZodString; | ||
description: z.ZodString; | ||
}, "strip", z.ZodTypeAny, { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
}, { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
}>; | ||
fields: z.ZodArray<z.ZodObject<{ | ||
id: z.ZodString; | ||
label: z.ZodOptional<z.ZodObject<{ | ||
column: z.ZodString; | ||
label: z.ZodObject<{ | ||
id: z.ZodString; | ||
@@ -35,17 +22,17 @@ defaultMessage: z.ZodString; | ||
defaultMessage: string; | ||
}>>; | ||
}>; | ||
}, "strip", z.ZodTypeAny, { | ||
id: string; | ||
label?: { | ||
label: { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
} | undefined; | ||
}; | ||
column: string; | ||
}, { | ||
id: string; | ||
label?: { | ||
label: { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
} | undefined; | ||
}; | ||
column: string; | ||
}>, "many">; | ||
@@ -68,14 +55,9 @@ filters: z.ZodArray<z.ZodObject<{ | ||
id: string; | ||
title: { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
}; | ||
fields: { | ||
id: string; | ||
label?: { | ||
label: { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
} | undefined; | ||
}; | ||
column: string; | ||
}[]; | ||
@@ -87,14 +69,9 @@ filters: { | ||
id: string; | ||
title: { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
}; | ||
fields: { | ||
id: string; | ||
label?: { | ||
label: { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
} | undefined; | ||
}; | ||
column: string; | ||
}[]; | ||
@@ -101,0 +78,0 @@ filters: { |
@@ -348,10 +348,7 @@ "use strict"; | ||
id: import_zod8.z.string().describe("Unique identifier for workqueue."), | ||
title: TranslationConfig.describe( | ||
"Title for workqueue, used in navigation and header." | ||
), | ||
fields: import_zod8.z.array( | ||
import_zod8.z.object({ | ||
// @TODO: Improve typing by enforcing EventMetadataKeys and form page fields as possible values | ||
id: import_zod8.z.string().describe("Id of a field defined under form pages or system field."), | ||
label: TranslationConfig.optional() | ||
column: import_zod8.z.string(), | ||
label: TranslationConfig | ||
}) | ||
@@ -640,2 +637,121 @@ ), | ||
// ../commons/src/workqueues/WorkqueueConfig.ts | ||
var import_zod18 = require("zod"); | ||
// ../commons/src/workqueues/defaultColumns.ts | ||
var import_zod17 = require("zod"); | ||
var WorkQueueColumnConfig = import_zod17.z.object({ | ||
id: import_zod17.z.string(), | ||
label: TranslationConfig | ||
}); | ||
var defaultColumns = { | ||
event: { | ||
id: "event", | ||
label: { | ||
defaultMessage: "Event", | ||
description: "This is the label for the workqueue column", | ||
id: "workqueue.default.column.event" | ||
} | ||
}, | ||
status: { | ||
id: "status", | ||
label: { | ||
defaultMessage: "Status", | ||
description: "This is the label for the workqueue column", | ||
id: "workqueue.default.column.status" | ||
} | ||
}, | ||
createdAt: { | ||
id: "createdAt", | ||
label: { | ||
defaultMessage: "Created", | ||
description: "This is the label for the workqueue column", | ||
id: "workqueue.default.column.createdAt" | ||
} | ||
}, | ||
modifiedAt: { | ||
id: "modifiedAt", | ||
label: { | ||
defaultMessage: "Modified", | ||
description: "This is the label for the workqueue column", | ||
id: "workqueue.default.column.modifiedAt" | ||
} | ||
} | ||
}; | ||
var DefaultColumnKeys = import_zod17.z.enum( | ||
Object.keys(defaultColumns) | ||
); | ||
// ../commons/src/workqueues/WorkqueueConfig.ts | ||
var rootWorkqueueConfig = import_zod18.z.object({ | ||
id: import_zod18.z.string(), | ||
title: TranslationConfig, | ||
columns: import_zod18.z.array(WorkQueueColumnConfig), | ||
defaultColumns: import_zod18.z.array(DefaultColumnKeys) | ||
}); | ||
var defineWorkqueue = (config) => rootWorkqueueConfig.parse(config); | ||
// ../commons/src/workqueues/all.ts | ||
var allWorkqueue = defineWorkqueue({ | ||
id: "all", | ||
title: { | ||
defaultMessage: "All events", | ||
description: "This is the label for the workqueue", | ||
id: "workqueue.all.label" | ||
}, | ||
columns: [ | ||
{ | ||
id: "title", | ||
label: { | ||
defaultMessage: "Title", | ||
description: "This is the label for the workqueue column", | ||
id: "workqueue.all.column.title" | ||
} | ||
} | ||
], | ||
defaultColumns: ["event", "status", "createdAt", "modifiedAt"] | ||
}); | ||
// ../commons/src/workqueues/readyForReview.ts | ||
var inReviewWorkqueue = defineWorkqueue({ | ||
id: "ready-for-review", | ||
title: { | ||
defaultMessage: "Ready for review", | ||
description: "Label for in review workqueue", | ||
id: "event.workqueue.in-review.label" | ||
}, | ||
columns: [ | ||
{ | ||
id: "title", | ||
label: { | ||
defaultMessage: "Title", | ||
description: "This is the label for the workqueue column", | ||
id: "workqueue.in-reveiw.column.title" | ||
} | ||
} | ||
], | ||
defaultColumns: ["event", "createdAt", "modifiedAt"] | ||
}); | ||
// ../commons/src/workqueues/readyToPrint.ts | ||
var registeredWorkqueue = defineWorkqueue({ | ||
id: "registered", | ||
title: { | ||
defaultMessage: "Ready to print", | ||
description: "Label for registered workqueue", | ||
id: "event.workqueue.registered.label" | ||
}, | ||
columns: [ | ||
{ | ||
id: "title", | ||
label: { | ||
defaultMessage: "Title", | ||
description: "This is the label for the workqueue column", | ||
id: "workqueue.registered.column.title" | ||
} | ||
} | ||
], | ||
defaultColumns: ["event", "createdAt", "modifiedAt"] | ||
}); | ||
// src/conditionals/deduplication.ts | ||
@@ -642,0 +758,0 @@ function and(clauses) { |
@@ -63,4 +63,4 @@ "use strict"; | ||
isUndeclaredDraft: () => isUndeclaredDraft, | ||
resolveFieldLabels: () => resolveFieldLabels, | ||
resolveLabelsFromKnownFields: () => resolveLabelsFromKnownFields | ||
resolveLabelsFromKnownFields: () => resolveLabelsFromKnownFields, | ||
validateWorkqueueConfig: () => validateWorkqueueConfig | ||
}); | ||
@@ -422,10 +422,7 @@ module.exports = __toCommonJS(events_exports); | ||
id: import_zod8.z.string().describe("Unique identifier for workqueue."), | ||
title: TranslationConfig.describe( | ||
"Title for workqueue, used in navigation and header." | ||
), | ||
fields: import_zod8.z.array( | ||
import_zod8.z.object({ | ||
// @TODO: Improve typing by enforcing EventMetadataKeys and form page fields as possible values | ||
id: import_zod8.z.string().describe("Id of a field defined under form pages or system field."), | ||
label: TranslationConfig.optional() | ||
column: import_zod8.z.string(), | ||
label: TranslationConfig | ||
}) | ||
@@ -782,2 +779,130 @@ ), | ||
var import_lodash = require("lodash"); | ||
// ../commons/src/workqueues/WorkqueueConfig.ts | ||
var import_zod18 = require("zod"); | ||
// ../commons/src/workqueues/defaultColumns.ts | ||
var import_zod17 = require("zod"); | ||
var WorkQueueColumnConfig = import_zod17.z.object({ | ||
id: import_zod17.z.string(), | ||
label: TranslationConfig | ||
}); | ||
var defaultColumns = { | ||
event: { | ||
id: "event", | ||
label: { | ||
defaultMessage: "Event", | ||
description: "This is the label for the workqueue column", | ||
id: "workqueue.default.column.event" | ||
} | ||
}, | ||
status: { | ||
id: "status", | ||
label: { | ||
defaultMessage: "Status", | ||
description: "This is the label for the workqueue column", | ||
id: "workqueue.default.column.status" | ||
} | ||
}, | ||
createdAt: { | ||
id: "createdAt", | ||
label: { | ||
defaultMessage: "Created", | ||
description: "This is the label for the workqueue column", | ||
id: "workqueue.default.column.createdAt" | ||
} | ||
}, | ||
modifiedAt: { | ||
id: "modifiedAt", | ||
label: { | ||
defaultMessage: "Modified", | ||
description: "This is the label for the workqueue column", | ||
id: "workqueue.default.column.modifiedAt" | ||
} | ||
} | ||
}; | ||
var DefaultColumnKeys = import_zod17.z.enum( | ||
Object.keys(defaultColumns) | ||
); | ||
// ../commons/src/workqueues/WorkqueueConfig.ts | ||
var rootWorkqueueConfig = import_zod18.z.object({ | ||
id: import_zod18.z.string(), | ||
title: TranslationConfig, | ||
columns: import_zod18.z.array(WorkQueueColumnConfig), | ||
defaultColumns: import_zod18.z.array(DefaultColumnKeys) | ||
}); | ||
var defineWorkqueue = (config) => rootWorkqueueConfig.parse(config); | ||
// ../commons/src/workqueues/all.ts | ||
var allWorkqueue = defineWorkqueue({ | ||
id: "all", | ||
title: { | ||
defaultMessage: "All events", | ||
description: "This is the label for the workqueue", | ||
id: "workqueue.all.label" | ||
}, | ||
columns: [ | ||
{ | ||
id: "title", | ||
label: { | ||
defaultMessage: "Title", | ||
description: "This is the label for the workqueue column", | ||
id: "workqueue.all.column.title" | ||
} | ||
} | ||
], | ||
defaultColumns: ["event", "status", "createdAt", "modifiedAt"] | ||
}); | ||
// ../commons/src/workqueues/readyForReview.ts | ||
var inReviewWorkqueue = defineWorkqueue({ | ||
id: "ready-for-review", | ||
title: { | ||
defaultMessage: "Ready for review", | ||
description: "Label for in review workqueue", | ||
id: "event.workqueue.in-review.label" | ||
}, | ||
columns: [ | ||
{ | ||
id: "title", | ||
label: { | ||
defaultMessage: "Title", | ||
description: "This is the label for the workqueue column", | ||
id: "workqueue.in-reveiw.column.title" | ||
} | ||
} | ||
], | ||
defaultColumns: ["event", "createdAt", "modifiedAt"] | ||
}); | ||
// ../commons/src/workqueues/readyToPrint.ts | ||
var registeredWorkqueue = defineWorkqueue({ | ||
id: "registered", | ||
title: { | ||
defaultMessage: "Ready to print", | ||
description: "Label for registered workqueue", | ||
id: "event.workqueue.registered.label" | ||
}, | ||
columns: [ | ||
{ | ||
id: "title", | ||
label: { | ||
defaultMessage: "Title", | ||
description: "This is the label for the workqueue column", | ||
id: "workqueue.registered.column.title" | ||
} | ||
} | ||
], | ||
defaultColumns: ["event", "createdAt", "modifiedAt"] | ||
}); | ||
// ../commons/src/workqueues/index.ts | ||
var workqueues = { | ||
all: allWorkqueue, | ||
registered: registeredWorkqueue, | ||
inReview: inReviewWorkqueue | ||
}; | ||
// ../commons/src/events/utils.ts | ||
var isMetadataField = (field) => field in eventMetadataLabelMap; | ||
@@ -826,20 +951,28 @@ var findInputPageFields = (config) => { | ||
}; | ||
var resolveFieldLabels = ({ | ||
config, | ||
pageFields | ||
}) => { | ||
return { | ||
...config, | ||
fields: resolveLabelsFromKnownFields({ | ||
pageFields, | ||
refFields: config.fields | ||
}) | ||
}; | ||
}; | ||
function getAllFields(configuration) { | ||
return configuration.actions.flatMap((action) => action.forms.filter((form) => form.active)).flatMap((form) => form.pages.flatMap((page) => page.fields)); | ||
} | ||
function validateWorkqueueConfig(workqueueConfigs) { | ||
workqueueConfigs.map((workqueue) => { | ||
const rootWorkqueue = Object.values(workqueues).find( | ||
(wq) => wq.id === workqueue.id | ||
); | ||
if (!rootWorkqueue) | ||
throw new Error( | ||
`Invalid workqueue configuration: workqueue not found with id: ${workqueue.id}` | ||
); | ||
const rootWorkqueueFields = rootWorkqueue.columns.map(({ id }) => id).sort(); | ||
const workqueueConfigFields = workqueue.fields.map(({ column }) => column).sort(); | ||
if (!(0, import_lodash.isEqual)(rootWorkqueueFields, workqueueConfigFields)) | ||
throw new Error( | ||
`Invalid workqueue configuration: [${rootWorkqueueFields.join( | ||
"," | ||
)}] does not match [${workqueueConfigFields.join(",")}]` | ||
); | ||
}); | ||
} | ||
// ../commons/src/events/defineConfig.ts | ||
var defineConfig = (config) => { | ||
validateWorkqueueConfig(config.workqueues); | ||
const input = EventConfig.parse(config); | ||
@@ -849,9 +982,4 @@ const pageFields = findInputPageFields(input); | ||
...input, | ||
workqueues: input.workqueues.map( | ||
(workqueue) => resolveFieldLabels({ | ||
config: workqueue, | ||
pageFields | ||
}) | ||
) | ||
pageFields | ||
}); | ||
}; |
{ | ||
"name": "@opencrvs/toolkit", | ||
"version": "0.0.28", | ||
"version": "0.0.29-events-jr", | ||
"description": "OpenCRVS toolkit for building country configurations", | ||
@@ -5,0 +5,0 @@ "license": "MPL-2.0", |
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
Sorry, the diff of this file is too big to display
3480101
91376