@nira-opencrvs/toolkit 1.9.11-rc.39d8d68 → 1.9.11-rc.80fe86a
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commons/api/router.d.ts +2 -0
- package/dist/commons/conditionals/conditionals.d.ts +6 -0
- package/dist/commons/events/FieldConfig.d.ts +38 -3
- package/dist/commons/events/TemplateConfig.d.ts +1 -0
- package/dist/conditionals/index.js +13 -1
- package/dist/events/index.js +19 -3
- package/dist/notification/index.js +19 -3
- package/package.json +1 -1
|
@@ -3667,6 +3667,7 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
3667
3667
|
primaryOfficeId: string & import("zod").BRAND<"UUID">;
|
|
3668
3668
|
signature?: string | undefined;
|
|
3669
3669
|
device?: string | undefined;
|
|
3670
|
+
data?: Record<string, string> | undefined;
|
|
3670
3671
|
fullHonorificName?: string | undefined;
|
|
3671
3672
|
avatar?: string | undefined;
|
|
3672
3673
|
} | {
|
|
@@ -3695,6 +3696,7 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
3695
3696
|
primaryOfficeId: string & import("zod").BRAND<"UUID">;
|
|
3696
3697
|
signature?: string | undefined;
|
|
3697
3698
|
device?: string | undefined;
|
|
3699
|
+
data?: Record<string, string> | undefined;
|
|
3698
3700
|
fullHonorificName?: string | undefined;
|
|
3699
3701
|
avatar?: string | undefined;
|
|
3700
3702
|
} | {
|
|
@@ -79,6 +79,12 @@ export declare const user: typeof userSerializer & {
|
|
|
79
79
|
$location: string;
|
|
80
80
|
};
|
|
81
81
|
};
|
|
82
|
+
data: (fieldName: string) => {
|
|
83
|
+
$userDataField: string;
|
|
84
|
+
toJSON(): {
|
|
85
|
+
$userDataField: string;
|
|
86
|
+
};
|
|
87
|
+
};
|
|
82
88
|
};
|
|
83
89
|
export declare function isFieldReference(value: unknown): value is FieldReference;
|
|
84
90
|
export declare function isEventFieldReference(value: unknown): value is FieldReference;
|
|
@@ -546,6 +546,12 @@ export declare const TextField: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
546
546
|
}, {
|
|
547
547
|
$userField: "id" | "name" | "device" | "district" | "firstname" | "surname" | "middlename" | "role" | "fullHonorificName" | "province" | "primaryOfficeId";
|
|
548
548
|
$location?: string | undefined;
|
|
549
|
+
}>, z.ZodObject<{
|
|
550
|
+
$userDataField: z.ZodString;
|
|
551
|
+
}, "strip", z.ZodTypeAny, {
|
|
552
|
+
$userDataField: string;
|
|
553
|
+
}, {
|
|
554
|
+
$userDataField: string;
|
|
549
555
|
}>]>>;
|
|
550
556
|
configuration: z.ZodOptional<z.ZodDefault<z.ZodObject<{
|
|
551
557
|
maxLength: z.ZodOptional<z.ZodNumber>;
|
|
@@ -623,6 +629,8 @@ export declare const TextField: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
623
629
|
defaultValue?: string | {
|
|
624
630
|
$userField: "id" | "name" | "device" | "district" | "firstname" | "surname" | "middlename" | "role" | "fullHonorificName" | "province" | "primaryOfficeId";
|
|
625
631
|
$location?: string | undefined;
|
|
632
|
+
} | {
|
|
633
|
+
$userDataField: string;
|
|
626
634
|
} | undefined;
|
|
627
635
|
configuration?: {
|
|
628
636
|
type?: "text" | "password" | undefined;
|
|
@@ -694,6 +702,8 @@ export declare const TextField: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
694
702
|
defaultValue?: string | {
|
|
695
703
|
$userField: "id" | "name" | "device" | "district" | "firstname" | "surname" | "middlename" | "role" | "fullHonorificName" | "province" | "primaryOfficeId";
|
|
696
704
|
$location?: string | undefined;
|
|
705
|
+
} | {
|
|
706
|
+
$userDataField: string;
|
|
697
707
|
} | undefined;
|
|
698
708
|
configuration?: {
|
|
699
709
|
type?: "text" | "password" | undefined;
|
|
@@ -7273,11 +7283,32 @@ declare const Facility: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
7273
7283
|
analytics: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
7274
7284
|
}, {
|
|
7275
7285
|
type: z.ZodLiteral<"FACILITY">;
|
|
7276
|
-
defaultValue: z.
|
|
7286
|
+
defaultValue: z.ZodUnion<[z.ZodString, z.ZodObject<{
|
|
7287
|
+
$userField: z.ZodEnum<["id", "name", "role", "fullHonorificName", "device", "firstname", "middlename", "surname", "district", "province", "primaryOfficeId"]>;
|
|
7288
|
+
$location: z.ZodOptional<z.ZodString>;
|
|
7289
|
+
}, "strip", z.ZodTypeAny, {
|
|
7290
|
+
$userField: "id" | "name" | "device" | "district" | "firstname" | "surname" | "middlename" | "role" | "fullHonorificName" | "province" | "primaryOfficeId";
|
|
7291
|
+
$location?: string | undefined;
|
|
7292
|
+
}, {
|
|
7293
|
+
$userField: "id" | "name" | "device" | "district" | "firstname" | "surname" | "middlename" | "role" | "fullHonorificName" | "province" | "primaryOfficeId";
|
|
7294
|
+
$location?: string | undefined;
|
|
7295
|
+
}>, z.ZodObject<{
|
|
7296
|
+
$userDataField: z.ZodString;
|
|
7297
|
+
}, "strip", z.ZodTypeAny, {
|
|
7298
|
+
$userDataField: string;
|
|
7299
|
+
}, {
|
|
7300
|
+
$userDataField: string;
|
|
7301
|
+
}>]>;
|
|
7277
7302
|
}>, "strip", z.ZodTypeAny, {
|
|
7278
7303
|
type: "FACILITY";
|
|
7279
7304
|
id: string;
|
|
7280
7305
|
label: TranslationConfig;
|
|
7306
|
+
defaultValue: string | {
|
|
7307
|
+
$userField: "id" | "name" | "device" | "district" | "firstname" | "surname" | "middlename" | "role" | "fullHonorificName" | "province" | "primaryOfficeId";
|
|
7308
|
+
$location?: string | undefined;
|
|
7309
|
+
} | {
|
|
7310
|
+
$userDataField: string;
|
|
7311
|
+
};
|
|
7281
7312
|
parent?: {
|
|
7282
7313
|
$$field: string;
|
|
7283
7314
|
$$subfield: string[];
|
|
@@ -7315,7 +7346,6 @@ declare const Facility: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
7315
7346
|
hideLabel?: boolean | undefined;
|
|
7316
7347
|
uncorrectable?: boolean | undefined;
|
|
7317
7348
|
analytics?: boolean | undefined;
|
|
7318
|
-
defaultValue?: string | undefined;
|
|
7319
7349
|
}, {
|
|
7320
7350
|
type: "FACILITY";
|
|
7321
7351
|
id: string;
|
|
@@ -7324,6 +7354,12 @@ declare const Facility: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
7324
7354
|
description: string;
|
|
7325
7355
|
defaultMessage: string;
|
|
7326
7356
|
};
|
|
7357
|
+
defaultValue: string | {
|
|
7358
|
+
$userField: "id" | "name" | "device" | "district" | "firstname" | "surname" | "middlename" | "role" | "fullHonorificName" | "province" | "primaryOfficeId";
|
|
7359
|
+
$location?: string | undefined;
|
|
7360
|
+
} | {
|
|
7361
|
+
$userDataField: string;
|
|
7362
|
+
};
|
|
7327
7363
|
parent?: {
|
|
7328
7364
|
$$field: string;
|
|
7329
7365
|
$$subfield?: string[] | undefined;
|
|
@@ -7377,7 +7413,6 @@ declare const Facility: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
7377
7413
|
hideLabel?: boolean | undefined;
|
|
7378
7414
|
uncorrectable?: boolean | undefined;
|
|
7379
7415
|
analytics?: boolean | undefined;
|
|
7380
|
-
defaultValue?: string | undefined;
|
|
7381
7416
|
}>;
|
|
7382
7417
|
export type Facility = z.infer<typeof Facility>;
|
|
7383
7418
|
declare const Office: z.ZodObject<z.objectUtil.extendShape<{
|
|
@@ -82,6 +82,17 @@ function userSerializer(userField) {
|
|
|
82
82
|
}
|
|
83
83
|
};
|
|
84
84
|
}
|
|
85
|
+
var SerializedUserDataField = import_zod.z.object({
|
|
86
|
+
$userDataField: import_zod.z.string()
|
|
87
|
+
});
|
|
88
|
+
function userDataSerializer(key) {
|
|
89
|
+
return {
|
|
90
|
+
$userDataField: key,
|
|
91
|
+
toJSON() {
|
|
92
|
+
return { $userDataField: key };
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
}
|
|
85
96
|
|
|
86
97
|
// ../commons/src/utils.ts
|
|
87
98
|
var z2 = __toESM(require("zod"));
|
|
@@ -242,7 +253,8 @@ var user = Object.assign(userSerializer, {
|
|
|
242
253
|
$user: {
|
|
243
254
|
$location: adminLevelId
|
|
244
255
|
}
|
|
245
|
-
})
|
|
256
|
+
}),
|
|
257
|
+
data: (fieldName) => userDataSerializer(fieldName)
|
|
246
258
|
});
|
|
247
259
|
function isFieldReference(value) {
|
|
248
260
|
return typeof value === "object" && value !== null && "$$field" in value;
|
package/dist/events/index.js
CHANGED
|
@@ -922,6 +922,17 @@ function userSerializer(userField) {
|
|
|
922
922
|
}
|
|
923
923
|
};
|
|
924
924
|
}
|
|
925
|
+
var SerializedUserDataField = import_zod10.z.object({
|
|
926
|
+
$userDataField: import_zod10.z.string()
|
|
927
|
+
});
|
|
928
|
+
function userDataSerializer(key) {
|
|
929
|
+
return {
|
|
930
|
+
$userDataField: key,
|
|
931
|
+
toJSON() {
|
|
932
|
+
return { $userDataField: key };
|
|
933
|
+
}
|
|
934
|
+
};
|
|
935
|
+
}
|
|
925
936
|
|
|
926
937
|
// ../commons/src/events/EventIndex.ts
|
|
927
938
|
var import_zod15 = require("zod");
|
|
@@ -2019,7 +2030,7 @@ var Divider = BaseField.extend({
|
|
|
2019
2030
|
});
|
|
2020
2031
|
var TextField = BaseField.extend({
|
|
2021
2032
|
type: import_zod17.z.literal(FieldType.TEXT),
|
|
2022
|
-
defaultValue: import_zod17.z.union([NonEmptyTextValue, SerializedUserField]).optional(),
|
|
2033
|
+
defaultValue: import_zod17.z.union([NonEmptyTextValue, SerializedUserField, SerializedUserDataField]).optional(),
|
|
2023
2034
|
configuration: import_zod17.z.object({
|
|
2024
2035
|
maxLength: import_zod17.z.number().optional().describe("Maximum length of the text"),
|
|
2025
2036
|
type: import_zod17.z.enum(["text", "password"]).optional(),
|
|
@@ -2314,7 +2325,11 @@ var FileUploadWithOptions = BaseField.extend({
|
|
|
2314
2325
|
});
|
|
2315
2326
|
var Facility = BaseField.extend({
|
|
2316
2327
|
type: import_zod17.z.literal(FieldType.FACILITY),
|
|
2317
|
-
defaultValue:
|
|
2328
|
+
defaultValue: import_zod17.z.union([
|
|
2329
|
+
NonEmptyTextValue,
|
|
2330
|
+
SerializedUserField,
|
|
2331
|
+
SerializedUserDataField
|
|
2332
|
+
])
|
|
2318
2333
|
}).describe("Input field for a facility");
|
|
2319
2334
|
var Office = BaseField.extend({
|
|
2320
2335
|
type: import_zod17.z.literal(FieldType.OFFICE),
|
|
@@ -4157,7 +4172,8 @@ var user = Object.assign(userSerializer, {
|
|
|
4157
4172
|
$user: {
|
|
4158
4173
|
$location: adminLevelId
|
|
4159
4174
|
}
|
|
4160
|
-
})
|
|
4175
|
+
}),
|
|
4176
|
+
data: (fieldName) => userDataSerializer(fieldName)
|
|
4161
4177
|
});
|
|
4162
4178
|
function isFieldReference(value) {
|
|
4163
4179
|
return typeof value === "object" && value !== null && "$$field" in value;
|
|
@@ -569,6 +569,17 @@ function userSerializer(userField) {
|
|
|
569
569
|
}
|
|
570
570
|
};
|
|
571
571
|
}
|
|
572
|
+
var SerializedUserDataField = import_zod10.z.object({
|
|
573
|
+
$userDataField: import_zod10.z.string()
|
|
574
|
+
});
|
|
575
|
+
function userDataSerializer(key) {
|
|
576
|
+
return {
|
|
577
|
+
$userDataField: key,
|
|
578
|
+
toJSON() {
|
|
579
|
+
return { $userDataField: key };
|
|
580
|
+
}
|
|
581
|
+
};
|
|
582
|
+
}
|
|
572
583
|
|
|
573
584
|
// ../commons/src/events/EventIndex.ts
|
|
574
585
|
var import_zod15 = require("zod");
|
|
@@ -1531,7 +1542,7 @@ var Divider = BaseField.extend({
|
|
|
1531
1542
|
});
|
|
1532
1543
|
var TextField = BaseField.extend({
|
|
1533
1544
|
type: import_zod17.z.literal(FieldType.TEXT),
|
|
1534
|
-
defaultValue: import_zod17.z.union([NonEmptyTextValue, SerializedUserField]).optional(),
|
|
1545
|
+
defaultValue: import_zod17.z.union([NonEmptyTextValue, SerializedUserField, SerializedUserDataField]).optional(),
|
|
1535
1546
|
configuration: import_zod17.z.object({
|
|
1536
1547
|
maxLength: import_zod17.z.number().optional().describe("Maximum length of the text"),
|
|
1537
1548
|
type: import_zod17.z.enum(["text", "password"]).optional(),
|
|
@@ -1826,7 +1837,11 @@ var FileUploadWithOptions = BaseField.extend({
|
|
|
1826
1837
|
});
|
|
1827
1838
|
var Facility = BaseField.extend({
|
|
1828
1839
|
type: import_zod17.z.literal(FieldType.FACILITY),
|
|
1829
|
-
defaultValue:
|
|
1840
|
+
defaultValue: import_zod17.z.union([
|
|
1841
|
+
NonEmptyTextValue,
|
|
1842
|
+
SerializedUserField,
|
|
1843
|
+
SerializedUserDataField
|
|
1844
|
+
])
|
|
1830
1845
|
}).describe("Input field for a facility");
|
|
1831
1846
|
var Office = BaseField.extend({
|
|
1832
1847
|
type: import_zod17.z.literal(FieldType.OFFICE),
|
|
@@ -2764,7 +2779,8 @@ var user = Object.assign(userSerializer, {
|
|
|
2764
2779
|
$user: {
|
|
2765
2780
|
$location: adminLevelId
|
|
2766
2781
|
}
|
|
2767
|
-
})
|
|
2782
|
+
}),
|
|
2783
|
+
data: (fieldName) => userDataSerializer(fieldName)
|
|
2768
2784
|
});
|
|
2769
2785
|
function isFieldReference(value) {
|
|
2770
2786
|
return typeof value === "object" && value !== null && "$$field" in value;
|