udp-schema 0.3.0 → 1.1.0
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/field-helpers.d.ts +18 -31
- package/dist/field-helpers.d.ts.map +1 -1
- package/dist/field-helpers.js +56 -51
- package/dist/field-helpers.js.map +1 -1
- package/dist/field-meta.d.ts +14 -34
- package/dist/field-meta.d.ts.map +1 -1
- package/dist/field-meta.js +13 -1991
- package/dist/field-meta.js.map +1 -1
- package/dist/index.d.ts +19 -18
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +30 -35
- package/dist/index.js.map +1 -1
- package/dist/onboarding-config.d.ts +44 -0
- package/dist/onboarding-config.d.ts.map +1 -0
- package/dist/onboarding-config.js +705 -0
- package/dist/onboarding-config.js.map +1 -0
- package/dist/profile-fields/01-profile.d.ts +264 -0
- package/dist/profile-fields/01-profile.d.ts.map +1 -0
- package/dist/profile-fields/01-profile.js +113 -0
- package/dist/profile-fields/01-profile.js.map +1 -0
- package/dist/profile-fields/02-political.d.ts +133 -0
- package/dist/profile-fields/02-political.d.ts.map +1 -0
- package/dist/profile-fields/02-political.js +42 -0
- package/dist/profile-fields/02-political.js.map +1 -0
- package/dist/profile-fields/03-electoral.d.ts +46 -0
- package/dist/profile-fields/03-electoral.d.ts.map +1 -0
- package/dist/profile-fields/03-electoral.js +21 -0
- package/dist/profile-fields/03-electoral.js.map +1 -0
- package/dist/profile-fields/04-leadership.d.ts +34 -0
- package/dist/profile-fields/04-leadership.d.ts.map +1 -0
- package/dist/profile-fields/04-leadership.js +22 -0
- package/dist/profile-fields/04-leadership.js.map +1 -0
- package/dist/profile-fields/05-psychological.d.ts +58 -0
- package/dist/profile-fields/05-psychological.d.ts.map +1 -0
- package/dist/profile-fields/05-psychological.js +20 -0
- package/dist/profile-fields/05-psychological.js.map +1 -0
- package/dist/profile-fields/06-education.d.ts +28 -0
- package/dist/profile-fields/06-education.d.ts.map +1 -0
- package/dist/profile-fields/06-education.js +23 -0
- package/dist/profile-fields/06-education.js.map +1 -0
- package/dist/profile-fields/07-employment.d.ts +75 -0
- package/dist/profile-fields/07-employment.d.ts.map +1 -0
- package/dist/profile-fields/07-employment.js +32 -0
- package/dist/profile-fields/07-employment.js.map +1 -0
- package/dist/profile-fields/08-neurodiversity.d.ts +100 -0
- package/dist/profile-fields/08-neurodiversity.d.ts.map +1 -0
- package/dist/profile-fields/08-neurodiversity.js +39 -0
- package/dist/profile-fields/08-neurodiversity.js.map +1 -0
- package/dist/profile-fields/09-health.d.ts +89 -0
- package/dist/profile-fields/09-health.d.ts.map +1 -0
- package/dist/profile-fields/09-health.js +38 -0
- package/dist/profile-fields/09-health.js.map +1 -0
- package/dist/profile-fields/10-worldview.d.ts +75 -0
- package/dist/profile-fields/10-worldview.d.ts.map +1 -0
- package/dist/profile-fields/10-worldview.js +41 -0
- package/dist/profile-fields/10-worldview.js.map +1 -0
- package/dist/profile-fields/11-residence.d.ts +3 -0
- package/dist/profile-fields/11-residence.d.ts.map +1 -0
- package/dist/profile-fields/11-residence.js +11 -0
- package/dist/profile-fields/11-residence.js.map +1 -0
- package/dist/profile-fields/12-household.d.ts +90 -0
- package/dist/profile-fields/12-household.d.ts.map +1 -0
- package/dist/profile-fields/12-household.js +37 -0
- package/dist/profile-fields/12-household.js.map +1 -0
- package/dist/profile-fields/index.d.ts +22 -0
- package/dist/profile-fields/index.d.ts.map +1 -0
- package/dist/profile-fields/index.js +47 -0
- package/dist/profile-fields/index.js.map +1 -0
- package/dist/profile-fields/types.d.ts +66 -0
- package/dist/profile-fields/types.d.ts.map +1 -0
- package/dist/profile-fields/types.js +8 -0
- package/dist/profile-fields/types.js.map +1 -0
- package/dist/progress-fields.d.ts +21 -3
- package/dist/progress-fields.d.ts.map +1 -1
- package/dist/progress-fields.js +97 -94
- package/dist/progress-fields.js.map +1 -1
- package/dist/step-01.schema.d.ts +84 -111
- package/dist/step-01.schema.d.ts.map +1 -1
- package/dist/step-01.schema.js +94 -101
- package/dist/step-01.schema.js.map +1 -1
- package/dist/step-02.schema.d.ts +31 -21
- package/dist/step-02.schema.d.ts.map +1 -1
- package/dist/step-02.schema.js +34 -27
- package/dist/step-02.schema.js.map +1 -1
- package/dist/step-03.schema.d.ts +24 -300
- package/dist/step-03.schema.d.ts.map +1 -1
- package/dist/step-03.schema.js +17 -60
- package/dist/step-03.schema.js.map +1 -1
- package/dist/step-04.schema.d.ts +56 -50
- package/dist/step-04.schema.d.ts.map +1 -1
- package/dist/step-04.schema.js +44 -43
- package/dist/step-04.schema.js.map +1 -1
- package/dist/step-05.schema.d.ts +13 -52
- package/dist/step-05.schema.d.ts.map +1 -1
- package/dist/step-05.schema.js +19 -40
- package/dist/step-05.schema.js.map +1 -1
- package/dist/step-06.schema.d.ts +101 -117
- package/dist/step-06.schema.d.ts.map +1 -1
- package/dist/step-06.schema.js +70 -75
- package/dist/step-06.schema.js.map +1 -1
- package/dist/step-07.schema.d.ts +44 -95
- package/dist/step-07.schema.d.ts.map +1 -1
- package/dist/step-07.schema.js +37 -78
- package/dist/step-07.schema.js.map +1 -1
- package/dist/step-08.schema.d.ts +31 -44
- package/dist/step-08.schema.d.ts.map +1 -1
- package/dist/step-08.schema.js +29 -48
- package/dist/step-08.schema.js.map +1 -1
- package/dist/step-09.schema.d.ts +48 -85
- package/dist/step-09.schema.d.ts.map +1 -1
- package/dist/step-09.schema.js +28 -120
- package/dist/step-09.schema.js.map +1 -1
- package/dist/step-10.schema.d.ts +32 -86
- package/dist/step-10.schema.d.ts.map +1 -1
- package/dist/step-10.schema.js +44 -120
- package/dist/step-10.schema.js.map +1 -1
- package/dist/step-11.schema.d.ts +36 -92
- package/dist/step-11.schema.d.ts.map +1 -1
- package/dist/step-11.schema.js +32 -111
- package/dist/step-11.schema.js.map +1 -1
- package/dist/step-12.schema.d.ts +56 -93
- package/dist/step-12.schema.d.ts.map +1 -1
- package/dist/step-12.schema.js +57 -133
- package/dist/step-12.schema.js.map +1 -1
- package/package.json +1 -1
package/dist/step-01.schema.d.ts
CHANGED
|
@@ -1,125 +1,98 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Step 01 — Profile
|
|
2
|
+
* Step 01 — Profile
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* Fields: firstName, middleName, lastName, gender, dateOfBirth,
|
|
5
|
+
* whatsappNumber, primaryLanguage, secondaryLanguages,
|
|
6
|
+
* familyReligion, personalReligion, reservationStatus, minorityStatus
|
|
6
7
|
*
|
|
7
8
|
* @module udp-schema/step-01
|
|
8
9
|
*/
|
|
9
10
|
import { z } from 'zod';
|
|
10
|
-
|
|
11
|
-
export declare const languageValueSchema: z.ZodObject<{
|
|
12
|
-
code: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodString>>;
|
|
13
|
-
nativeName: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodString>>;
|
|
14
|
-
englishName: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodString>>;
|
|
15
|
-
script: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodString>>;
|
|
16
|
-
}, z.core.$strip>;
|
|
17
|
-
/** One entry in the secondaryLanguages array. */
|
|
18
|
-
export declare const secondaryLanguageItemSchema: z.ZodObject<{
|
|
19
|
-
language: z.ZodObject<{
|
|
20
|
-
code: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodString>>;
|
|
21
|
-
nativeName: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodString>>;
|
|
22
|
-
englishName: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodString>>;
|
|
23
|
-
script: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodString>>;
|
|
24
|
-
}, z.core.$strip>;
|
|
25
|
-
fluency: z.ZodEnum<{
|
|
26
|
-
basic: "basic";
|
|
27
|
-
conversational: "conversational";
|
|
28
|
-
professional: "professional";
|
|
29
|
-
native: "native";
|
|
30
|
-
}>;
|
|
31
|
-
canSpeak: z.ZodOptional<z.ZodBoolean>;
|
|
32
|
-
canRead: z.ZodOptional<z.ZodBoolean>;
|
|
33
|
-
canWrite: z.ZodOptional<z.ZodBoolean>;
|
|
34
|
-
}, z.core.$strip>;
|
|
35
|
-
/**
|
|
36
|
-
* Profile photo — accepts either:
|
|
37
|
-
* • a plain URL string (returned by backend on prefill)
|
|
38
|
-
* • an upload-result object (sent after fresh upload)
|
|
39
|
-
* • a File-like object (frontend pre-upload state)
|
|
40
|
-
*/
|
|
41
|
-
export declare const profilePhotoSchema: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
42
|
-
name: z.ZodOptional<z.ZodString>;
|
|
43
|
-
type: z.ZodOptional<z.ZodString>;
|
|
44
|
-
size: z.ZodOptional<z.ZodNumber>;
|
|
45
|
-
lastModified: z.ZodOptional<z.ZodNumber>;
|
|
46
|
-
}, z.core.$strip>, z.ZodString, z.ZodObject<{
|
|
47
|
-
assetId: z.ZodOptional<z.ZodString>;
|
|
48
|
-
url: z.ZodOptional<z.ZodString>;
|
|
49
|
-
mimeType: z.ZodOptional<z.ZodString>;
|
|
50
|
-
sizeBytes: z.ZodOptional<z.ZodNumber>;
|
|
51
|
-
}, z.core.$strip>]>>;
|
|
52
|
-
/** Volunteer who assisted with the form. */
|
|
53
|
-
export declare const assistedByVolunteerSchema: z.ZodOptional<z.ZodObject<{
|
|
54
|
-
volunteerId: z.ZodOptional<z.ZodString>;
|
|
55
|
-
displayName: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodString>>;
|
|
56
|
-
source: z.ZodOptional<z.ZodEnum<{
|
|
57
|
-
selected: "selected";
|
|
58
|
-
manual: "manual";
|
|
59
|
-
}>>;
|
|
60
|
-
}, z.core.$strip>>;
|
|
61
|
-
export declare const step01OnboardingSchema: z.ZodObject<{
|
|
62
|
-
email: z.ZodString;
|
|
11
|
+
export declare const step01ProfileSchema: z.ZodObject<{
|
|
63
12
|
firstName: z.ZodString;
|
|
64
13
|
middleName: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodString>>;
|
|
65
|
-
lastName: z.
|
|
14
|
+
lastName: z.ZodString;
|
|
66
15
|
gender: z.ZodOptional<z.ZodEnum<{
|
|
67
|
-
|
|
68
|
-
|
|
16
|
+
man: "man";
|
|
17
|
+
woman: "woman";
|
|
18
|
+
non_binary: "non_binary";
|
|
19
|
+
transgender_man: "transgender_man";
|
|
20
|
+
transgender_woman: "transgender_woman";
|
|
21
|
+
genderqueer: "genderqueer";
|
|
22
|
+
genderfluid: "genderfluid";
|
|
23
|
+
agender: "agender";
|
|
24
|
+
two_spirit: "two_spirit";
|
|
69
25
|
other: "other";
|
|
70
|
-
|
|
26
|
+
prefer_not_to_say: "prefer_not_to_say";
|
|
71
27
|
}>>;
|
|
72
28
|
dateOfBirth: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodCoercedDate<unknown>>>;
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
29
|
+
whatsappNumber: z.ZodOptional<z.ZodString>;
|
|
30
|
+
primaryLanguage: z.ZodOptional<z.ZodString>;
|
|
31
|
+
secondaryLanguages: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
32
|
+
familyReligion: z.ZodOptional<z.ZodEnum<{
|
|
33
|
+
other: "other";
|
|
34
|
+
prefer_not_to_say: "prefer_not_to_say";
|
|
35
|
+
hindu: "hindu";
|
|
36
|
+
muslim_sunni: "muslim_sunni";
|
|
37
|
+
muslim_shia: "muslim_shia";
|
|
38
|
+
muslim_sufi: "muslim_sufi";
|
|
39
|
+
muslim_other: "muslim_other";
|
|
40
|
+
christian_catholic: "christian_catholic";
|
|
41
|
+
christian_protestant: "christian_protestant";
|
|
42
|
+
christian_other: "christian_other";
|
|
43
|
+
sikh: "sikh";
|
|
44
|
+
jain_digambar: "jain_digambar";
|
|
45
|
+
jain_shwetambar: "jain_shwetambar";
|
|
46
|
+
buddhist: "buddhist";
|
|
47
|
+
parsi_zoroastrian: "parsi_zoroastrian";
|
|
48
|
+
jewish: "jewish";
|
|
49
|
+
bahai: "bahai";
|
|
50
|
+
spiritual: "spiritual";
|
|
51
|
+
atheist: "atheist";
|
|
52
|
+
agnostic: "agnostic";
|
|
53
|
+
no_religion: "no_religion";
|
|
54
|
+
inter_religion: "inter_religion";
|
|
55
|
+
}>>;
|
|
56
|
+
personalReligion: z.ZodOptional<z.ZodEnum<{
|
|
57
|
+
other: "other";
|
|
58
|
+
prefer_not_to_say: "prefer_not_to_say";
|
|
59
|
+
hindu: "hindu";
|
|
60
|
+
muslim_sunni: "muslim_sunni";
|
|
61
|
+
muslim_shia: "muslim_shia";
|
|
62
|
+
muslim_sufi: "muslim_sufi";
|
|
63
|
+
muslim_other: "muslim_other";
|
|
64
|
+
christian_catholic: "christian_catholic";
|
|
65
|
+
christian_protestant: "christian_protestant";
|
|
66
|
+
christian_other: "christian_other";
|
|
67
|
+
sikh: "sikh";
|
|
68
|
+
jain_digambar: "jain_digambar";
|
|
69
|
+
jain_shwetambar: "jain_shwetambar";
|
|
70
|
+
buddhist: "buddhist";
|
|
71
|
+
parsi_zoroastrian: "parsi_zoroastrian";
|
|
72
|
+
jewish: "jewish";
|
|
73
|
+
bahai: "bahai";
|
|
74
|
+
spiritual: "spiritual";
|
|
75
|
+
atheist: "atheist";
|
|
76
|
+
agnostic: "agnostic";
|
|
77
|
+
no_religion: "no_religion";
|
|
78
|
+
inter_religion: "inter_religion";
|
|
79
|
+
}>>;
|
|
80
|
+
reservationStatus: z.ZodOptional<z.ZodEnum<{
|
|
81
|
+
SC: "SC";
|
|
82
|
+
ST: "ST";
|
|
83
|
+
OBC_NC: "OBC_NC";
|
|
84
|
+
OBC_C: "OBC_C";
|
|
85
|
+
EWS: "EWS";
|
|
86
|
+
GENERAL: "GENERAL";
|
|
87
|
+
DONT_KNOW: "DONT_KNOW";
|
|
88
|
+
PREFER_NOT_SAY: "PREFER_NOT_SAY";
|
|
89
|
+
}>>;
|
|
90
|
+
minorityStatus: z.ZodOptional<z.ZodEnum<{
|
|
91
|
+
NO: "NO";
|
|
92
|
+
RELIGIOUS: "RELIGIOUS";
|
|
93
|
+
LINGUISTIC: "LINGUISTIC";
|
|
94
|
+
NOT_SURE: "NOT_SURE";
|
|
95
|
+
}>>;
|
|
122
96
|
}, z.core.$strip>;
|
|
123
|
-
export type
|
|
124
|
-
export type Step01OnboardingFormInput = z.input<typeof step01OnboardingSchema>;
|
|
97
|
+
export type Step01ProfileInput = z.infer<typeof step01ProfileSchema>;
|
|
125
98
|
//# sourceMappingURL=step-01.schema.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step-01.schema.d.ts","sourceRoot":"","sources":["../src/step-01.schema.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"step-01.schema.d.ts","sourceRoot":"","sources":["../src/step-01.schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA2G9B,CAAC;AAIH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
|
package/dist/step-01.schema.js
CHANGED
|
@@ -1,117 +1,110 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Step 01 — Profile
|
|
2
|
+
* Step 01 — Profile
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* Fields: firstName, middleName, lastName, gender, dateOfBirth,
|
|
5
|
+
* whatsappNumber, primaryLanguage, secondaryLanguages,
|
|
6
|
+
* familyReligion, personalReligion, reservationStatus, minorityStatus
|
|
6
7
|
*
|
|
7
8
|
* @module udp-schema/step-01
|
|
8
9
|
*/
|
|
9
10
|
import { z } from 'zod';
|
|
10
|
-
import { emptyStringToUndefined, optionalTrimmedString } from './zod-helpers.js';
|
|
11
|
-
// ───
|
|
12
|
-
|
|
13
|
-
export const languageValueSchema = z
|
|
14
|
-
.object({
|
|
15
|
-
code: optionalTrimmedString,
|
|
16
|
-
nativeName: optionalTrimmedString,
|
|
17
|
-
englishName: optionalTrimmedString,
|
|
18
|
-
script: optionalTrimmedString,
|
|
19
|
-
})
|
|
20
|
-
.refine((v) => Boolean(v.code || v.nativeName || v.englishName), 'Language must include at least code, native name, or english name');
|
|
21
|
-
/** One entry in the secondaryLanguages array. */
|
|
22
|
-
export const secondaryLanguageItemSchema = z.object({
|
|
23
|
-
language: languageValueSchema,
|
|
24
|
-
fluency: z.enum(['basic', 'conversational', 'professional', 'native']),
|
|
25
|
-
canSpeak: z.boolean().optional(),
|
|
26
|
-
canRead: z.boolean().optional(),
|
|
27
|
-
canWrite: z.boolean().optional(),
|
|
28
|
-
});
|
|
29
|
-
/**
|
|
30
|
-
* Profile photo — accepts either:
|
|
31
|
-
* • a plain URL string (returned by backend on prefill)
|
|
32
|
-
* • an upload-result object (sent after fresh upload)
|
|
33
|
-
* • a File-like object (frontend pre-upload state)
|
|
34
|
-
*/
|
|
35
|
-
export const profilePhotoSchema = z
|
|
36
|
-
.union([
|
|
37
|
-
z.object({
|
|
38
|
-
name: z.string().optional(),
|
|
39
|
-
type: z.string().optional(),
|
|
40
|
-
size: z.number().min(0).optional(),
|
|
41
|
-
lastModified: z.number().min(0).optional(),
|
|
42
|
-
}),
|
|
43
|
-
z.string(),
|
|
44
|
-
z.object({
|
|
45
|
-
assetId: z.string().trim().optional(),
|
|
46
|
-
url: z.string().trim().optional(),
|
|
47
|
-
mimeType: z.string().trim().optional(),
|
|
48
|
-
sizeBytes: z.number().min(0).optional(),
|
|
49
|
-
}),
|
|
50
|
-
])
|
|
51
|
-
.optional();
|
|
52
|
-
/** Volunteer who assisted with the form. */
|
|
53
|
-
export const assistedByVolunteerSchema = z
|
|
54
|
-
.object({
|
|
55
|
-
volunteerId: z.string().optional(),
|
|
56
|
-
displayName: optionalTrimmedString,
|
|
57
|
-
source: z.enum(['selected', 'manual']).optional(),
|
|
58
|
-
})
|
|
59
|
-
.optional();
|
|
60
|
-
// ─── Main step-01 schema ────────────────────────────────
|
|
61
|
-
export const step01OnboardingSchema = z.object({
|
|
62
|
-
email: z.string().trim().toLowerCase().email('Enter a valid email address'),
|
|
11
|
+
import { emptyStringToUndefined, optionalPhoneSchema, optionalTrimmedString, } from './zod-helpers.js';
|
|
12
|
+
// ─── Main Step 01 Schema ────────────────────────────────────────────────────
|
|
13
|
+
export const step01ProfileSchema = z.object({
|
|
63
14
|
firstName: z
|
|
64
15
|
.string()
|
|
65
16
|
.trim()
|
|
66
17
|
.min(1, 'First name is required')
|
|
67
18
|
.max(50, 'First name must be at most 50 characters'),
|
|
68
19
|
middleName: optionalTrimmedString,
|
|
69
|
-
lastName:
|
|
70
|
-
gender: z.enum(['male', 'female', 'other', 'prefer_not']).optional(),
|
|
71
|
-
dateOfBirth: z.preprocess(emptyStringToUndefined, z.coerce.date().optional()),
|
|
72
|
-
aadhaarNumber: z.preprocess((value) => {
|
|
73
|
-
const normalized = emptyStringToUndefined(value);
|
|
74
|
-
if (typeof normalized === 'string') {
|
|
75
|
-
return normalized.replace(/\D/g, '');
|
|
76
|
-
}
|
|
77
|
-
return normalized;
|
|
78
|
-
}, z
|
|
20
|
+
lastName: z
|
|
79
21
|
.string()
|
|
80
|
-
.
|
|
81
|
-
.
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
22
|
+
.trim()
|
|
23
|
+
.min(1, 'Last name is required')
|
|
24
|
+
.max(50, 'Last name must be at most 50 characters'),
|
|
25
|
+
gender: z
|
|
26
|
+
.enum([
|
|
27
|
+
'man',
|
|
28
|
+
'woman',
|
|
29
|
+
'non_binary',
|
|
30
|
+
'transgender_man',
|
|
31
|
+
'transgender_woman',
|
|
32
|
+
'genderqueer',
|
|
33
|
+
'genderfluid',
|
|
34
|
+
'agender',
|
|
35
|
+
'two_spirit',
|
|
36
|
+
'other',
|
|
37
|
+
'prefer_not_to_say',
|
|
38
|
+
])
|
|
39
|
+
.optional(),
|
|
40
|
+
dateOfBirth: z.preprocess(emptyStringToUndefined, z.coerce.date().optional()),
|
|
41
|
+
whatsappNumber: optionalPhoneSchema,
|
|
42
|
+
/** Single language code string (e.g., "hindi", "english") — matches dating motherTongue options */
|
|
43
|
+
primaryLanguage: z.string().trim().optional(),
|
|
44
|
+
/** Array of language code strings */
|
|
45
|
+
secondaryLanguages: z.array(z.string().trim()).max(10).optional(),
|
|
46
|
+
/**
|
|
47
|
+
* Family religion — uses dating-schema religion option values.
|
|
48
|
+
* e.g., "hindu", "muslim_sunni", "christian_catholic", etc.
|
|
49
|
+
*/
|
|
50
|
+
familyReligion: z
|
|
51
|
+
.enum([
|
|
52
|
+
'hindu',
|
|
53
|
+
'muslim_sunni',
|
|
54
|
+
'muslim_shia',
|
|
55
|
+
'muslim_sufi',
|
|
56
|
+
'muslim_other',
|
|
57
|
+
'christian_catholic',
|
|
58
|
+
'christian_protestant',
|
|
59
|
+
'christian_other',
|
|
60
|
+
'sikh',
|
|
61
|
+
'jain_digambar',
|
|
62
|
+
'jain_shwetambar',
|
|
63
|
+
'buddhist',
|
|
64
|
+
'parsi_zoroastrian',
|
|
65
|
+
'jewish',
|
|
66
|
+
'bahai',
|
|
67
|
+
'spiritual',
|
|
68
|
+
'atheist',
|
|
69
|
+
'agnostic',
|
|
70
|
+
'no_religion',
|
|
71
|
+
'inter_religion',
|
|
72
|
+
'other',
|
|
73
|
+
'prefer_not_to_say',
|
|
74
|
+
])
|
|
75
|
+
.optional(),
|
|
76
|
+
/** Personal religion — same options as familyReligion */
|
|
77
|
+
personalReligion: z
|
|
78
|
+
.enum([
|
|
79
|
+
'hindu',
|
|
80
|
+
'muslim_sunni',
|
|
81
|
+
'muslim_shia',
|
|
82
|
+
'muslim_sufi',
|
|
83
|
+
'muslim_other',
|
|
84
|
+
'christian_catholic',
|
|
85
|
+
'christian_protestant',
|
|
86
|
+
'christian_other',
|
|
87
|
+
'sikh',
|
|
88
|
+
'jain_digambar',
|
|
89
|
+
'jain_shwetambar',
|
|
90
|
+
'buddhist',
|
|
91
|
+
'parsi_zoroastrian',
|
|
92
|
+
'jewish',
|
|
93
|
+
'bahai',
|
|
94
|
+
'spiritual',
|
|
95
|
+
'atheist',
|
|
96
|
+
'agnostic',
|
|
97
|
+
'no_religion',
|
|
98
|
+
'inter_religion',
|
|
99
|
+
'other',
|
|
100
|
+
'prefer_not_to_say',
|
|
101
|
+
])
|
|
102
|
+
.optional(),
|
|
103
|
+
/** Reservation / caste category */
|
|
104
|
+
reservationStatus: z
|
|
105
|
+
.enum(['SC', 'ST', 'OBC_NC', 'OBC_C', 'EWS', 'GENERAL', 'DONT_KNOW', 'PREFER_NOT_SAY'])
|
|
91
106
|
.optional(),
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
.array(secondaryLanguageItemSchema)
|
|
95
|
-
.max(5, 'You can add up to 5 secondary languages')
|
|
96
|
-
.optional()
|
|
97
|
-
.superRefine((items, context) => {
|
|
98
|
-
if (!items)
|
|
99
|
-
return;
|
|
100
|
-
const seenCodes = new Map();
|
|
101
|
-
items.forEach((item, index) => {
|
|
102
|
-
const code = item.language.code?.toLowerCase();
|
|
103
|
-
if (!code)
|
|
104
|
-
return;
|
|
105
|
-
if (seenCodes.has(code)) {
|
|
106
|
-
context.addIssue({
|
|
107
|
-
code: 'custom',
|
|
108
|
-
path: [index, 'language', 'code'],
|
|
109
|
-
message: 'Duplicate secondary language is not allowed',
|
|
110
|
-
});
|
|
111
|
-
return;
|
|
112
|
-
}
|
|
113
|
-
seenCodes.set(code, index);
|
|
114
|
-
});
|
|
115
|
-
}),
|
|
107
|
+
/** Minority community status */
|
|
108
|
+
minorityStatus: z.enum(['NO', 'RELIGIOUS', 'LINGUISTIC', 'NOT_SURE']).optional(),
|
|
116
109
|
});
|
|
117
110
|
//# sourceMappingURL=step-01.schema.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step-01.schema.js","sourceRoot":"","sources":["../src/step-01.schema.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"step-01.schema.js","sourceRoot":"","sources":["../src/step-01.schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,sBAAsB,EACtB,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,kBAAkB,CAAC;AAE1B,+EAA+E;AAE/E,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1C,SAAS,EAAE,CAAC;SACT,MAAM,EAAE;SACR,IAAI,EAAE;SACN,GAAG,CAAC,CAAC,EAAE,wBAAwB,CAAC;SAChC,GAAG,CAAC,EAAE,EAAE,0CAA0C,CAAC;IAEtD,UAAU,EAAE,qBAAqB;IAEjC,QAAQ,EAAE,CAAC;SACR,MAAM,EAAE;SACR,IAAI,EAAE;SACN,GAAG,CAAC,CAAC,EAAE,uBAAuB,CAAC;SAC/B,GAAG,CAAC,EAAE,EAAE,yCAAyC,CAAC;IAErD,MAAM,EAAE,CAAC;SACN,IAAI,CAAC;QACJ,KAAK;QACL,OAAO;QACP,YAAY;QACZ,iBAAiB;QACjB,mBAAmB;QACnB,aAAa;QACb,aAAa;QACb,SAAS;QACT,YAAY;QACZ,OAAO;QACP,mBAAmB;KACpB,CAAC;SACD,QAAQ,EAAE;IAEb,WAAW,EAAE,CAAC,CAAC,UAAU,CAAC,sBAAsB,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE,CAAC;IAE7E,cAAc,EAAE,mBAAmB;IAEnC,mGAAmG;IACnG,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE;IAE7C,qCAAqC;IACrC,kBAAkB,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE;IAEjE;;;OAGG;IACH,cAAc,EAAE,CAAC;SACd,IAAI,CAAC;QACJ,OAAO;QACP,cAAc;QACd,aAAa;QACb,aAAa;QACb,cAAc;QACd,oBAAoB;QACpB,sBAAsB;QACtB,iBAAiB;QACjB,MAAM;QACN,eAAe;QACf,iBAAiB;QACjB,UAAU;QACV,mBAAmB;QACnB,QAAQ;QACR,OAAO;QACP,WAAW;QACX,SAAS;QACT,UAAU;QACV,aAAa;QACb,gBAAgB;QAChB,OAAO;QACP,mBAAmB;KACpB,CAAC;SACD,QAAQ,EAAE;IAEb,yDAAyD;IACzD,gBAAgB,EAAE,CAAC;SAChB,IAAI,CAAC;QACJ,OAAO;QACP,cAAc;QACd,aAAa;QACb,aAAa;QACb,cAAc;QACd,oBAAoB;QACpB,sBAAsB;QACtB,iBAAiB;QACjB,MAAM;QACN,eAAe;QACf,iBAAiB;QACjB,UAAU;QACV,mBAAmB;QACnB,QAAQ;QACR,OAAO;QACP,WAAW;QACX,SAAS;QACT,UAAU;QACV,aAAa;QACb,gBAAgB;QAChB,OAAO;QACP,mBAAmB;KACpB,CAAC;SACD,QAAQ,EAAE;IAEb,mCAAmC;IACnC,iBAAiB,EAAE,CAAC;SACjB,IAAI,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,gBAAgB,CAAC,CAAC;SACtF,QAAQ,EAAE;IAEb,gCAAgC;IAChC,cAAc,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,CAAC,CAAC,CAAC,QAAQ,EAAE;CACjF,CAAC,CAAC","sourcesContent":["/**\n * Step 01 — Profile\n *\n * Fields: firstName, middleName, lastName, gender, dateOfBirth,\n * whatsappNumber, primaryLanguage, secondaryLanguages,\n * familyReligion, personalReligion, reservationStatus, minorityStatus\n *\n * @module udp-schema/step-01\n */\n\nimport { z } from 'zod';\nimport {\n emptyStringToUndefined,\n optionalPhoneSchema,\n optionalTrimmedString,\n} from './zod-helpers.js';\n\n// ─── Main Step 01 Schema ────────────────────────────────────────────────────\n\nexport const step01ProfileSchema = z.object({\n firstName: z\n .string()\n .trim()\n .min(1, 'First name is required')\n .max(50, 'First name must be at most 50 characters'),\n\n middleName: optionalTrimmedString,\n\n lastName: z\n .string()\n .trim()\n .min(1, 'Last name is required')\n .max(50, 'Last name must be at most 50 characters'),\n\n gender: z\n .enum([\n 'man',\n 'woman',\n 'non_binary',\n 'transgender_man',\n 'transgender_woman',\n 'genderqueer',\n 'genderfluid',\n 'agender',\n 'two_spirit',\n 'other',\n 'prefer_not_to_say',\n ])\n .optional(),\n\n dateOfBirth: z.preprocess(emptyStringToUndefined, z.coerce.date().optional()),\n\n whatsappNumber: optionalPhoneSchema,\n\n /** Single language code string (e.g., \"hindi\", \"english\") — matches dating motherTongue options */\n primaryLanguage: z.string().trim().optional(),\n\n /** Array of language code strings */\n secondaryLanguages: z.array(z.string().trim()).max(10).optional(),\n\n /**\n * Family religion — uses dating-schema religion option values.\n * e.g., \"hindu\", \"muslim_sunni\", \"christian_catholic\", etc.\n */\n familyReligion: z\n .enum([\n 'hindu',\n 'muslim_sunni',\n 'muslim_shia',\n 'muslim_sufi',\n 'muslim_other',\n 'christian_catholic',\n 'christian_protestant',\n 'christian_other',\n 'sikh',\n 'jain_digambar',\n 'jain_shwetambar',\n 'buddhist',\n 'parsi_zoroastrian',\n 'jewish',\n 'bahai',\n 'spiritual',\n 'atheist',\n 'agnostic',\n 'no_religion',\n 'inter_religion',\n 'other',\n 'prefer_not_to_say',\n ])\n .optional(),\n\n /** Personal religion — same options as familyReligion */\n personalReligion: z\n .enum([\n 'hindu',\n 'muslim_sunni',\n 'muslim_shia',\n 'muslim_sufi',\n 'muslim_other',\n 'christian_catholic',\n 'christian_protestant',\n 'christian_other',\n 'sikh',\n 'jain_digambar',\n 'jain_shwetambar',\n 'buddhist',\n 'parsi_zoroastrian',\n 'jewish',\n 'bahai',\n 'spiritual',\n 'atheist',\n 'agnostic',\n 'no_religion',\n 'inter_religion',\n 'other',\n 'prefer_not_to_say',\n ])\n .optional(),\n\n /** Reservation / caste category */\n reservationStatus: z\n .enum(['SC', 'ST', 'OBC_NC', 'OBC_C', 'EWS', 'GENERAL', 'DONT_KNOW', 'PREFER_NOT_SAY'])\n .optional(),\n\n /** Minority community status */\n minorityStatus: z.enum(['NO', 'RELIGIOUS', 'LINGUISTIC', 'NOT_SURE']).optional(),\n});\n\n// ─── Inferred types ─────────────────────────────────────────────────────────\n\nexport type Step01ProfileInput = z.infer<typeof step01ProfileSchema>;\n"]}
|
package/dist/step-02.schema.d.ts
CHANGED
|
@@ -1,29 +1,39 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Step 02 —
|
|
2
|
+
* Step 02 — Political Association & History
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Fields: politicalSpectrum, selfPartyAssociation, familyPartyAssociation,
|
|
5
|
+
* publicOfficeAndElections, networkAndCivicEngagement
|
|
5
6
|
*
|
|
6
7
|
* @module udp-schema/step-02
|
|
7
8
|
*/
|
|
8
9
|
import { z } from 'zod';
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
10
|
+
export declare const step02PoliticalSchema: z.ZodObject<{
|
|
11
|
+
politicalSpectrum: z.ZodOptional<z.ZodEnum<{
|
|
12
|
+
prefer_not_to_say: "prefer_not_to_say";
|
|
13
|
+
"1_tradition_faith": "1_tradition_faith";
|
|
14
|
+
"2_faith_curious": "2_faith_curious";
|
|
15
|
+
"3_multiplicity_open": "3_multiplicity_open";
|
|
16
|
+
"4_pragmatic_flexible": "4_pragmatic_flexible";
|
|
17
|
+
"5_evidence_reasoning": "5_evidence_reasoning";
|
|
18
|
+
"6_critical_reflective": "6_critical_reflective";
|
|
19
|
+
"7_skeptic_optimize": "7_skeptic_optimize";
|
|
20
|
+
}>>;
|
|
21
|
+
selfPartyAssociation: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodString>>;
|
|
22
|
+
familyPartyAssociation: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodString>>;
|
|
23
|
+
publicOfficeAndElections: z.ZodOptional<z.ZodObject<{
|
|
24
|
+
hasHeldOffice: z.ZodOptional<z.ZodEnum<{
|
|
25
|
+
prefer_not_to_say: "prefer_not_to_say";
|
|
26
|
+
yes: "yes";
|
|
27
|
+
no: "no";
|
|
28
|
+
}>>;
|
|
29
|
+
officeDetails: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodString>>;
|
|
30
|
+
electionContested: z.ZodOptional<z.ZodEnum<{
|
|
31
|
+
yes: "yes";
|
|
32
|
+
no: "no";
|
|
33
|
+
}>>;
|
|
34
|
+
electionDetails: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodString>>;
|
|
35
|
+
}, z.core.$strip>>;
|
|
36
|
+
networkAndCivicEngagement: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
27
37
|
}, z.core.$strip>;
|
|
28
|
-
export type
|
|
38
|
+
export type Step02PoliticalInput = z.infer<typeof step02PoliticalSchema>;
|
|
29
39
|
//# sourceMappingURL=step-02.schema.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step-02.schema.d.ts","sourceRoot":"","sources":["../src/step-02.schema.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"step-02.schema.d.ts","sourceRoot":"","sources":["../src/step-02.schema.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAiChC,CAAC;AAIH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
|
package/dist/step-02.schema.js
CHANGED
|
@@ -1,35 +1,42 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Step 02 —
|
|
2
|
+
* Step 02 — Political Association & History
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Fields: politicalSpectrum, selfPartyAssociation, familyPartyAssociation,
|
|
5
|
+
* publicOfficeAndElections, networkAndCivicEngagement
|
|
5
6
|
*
|
|
6
7
|
* @module udp-schema/step-02
|
|
7
8
|
*/
|
|
8
9
|
import { z } from 'zod';
|
|
9
|
-
import {
|
|
10
|
-
// ───
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
z
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
10
|
+
import { optionalTrimmedString } from './zod-helpers.js';
|
|
11
|
+
// ─── Main Step 02 Schema ────────────────────────────────────────────────────
|
|
12
|
+
export const step02PoliticalSchema = z.object({
|
|
13
|
+
/** Political spectrum — uses dating-schema cognitiveBand values */
|
|
14
|
+
politicalSpectrum: z
|
|
15
|
+
.enum([
|
|
16
|
+
'1_tradition_faith',
|
|
17
|
+
'2_faith_curious',
|
|
18
|
+
'3_multiplicity_open',
|
|
19
|
+
'4_pragmatic_flexible',
|
|
20
|
+
'5_evidence_reasoning',
|
|
21
|
+
'6_critical_reflective',
|
|
22
|
+
'7_skeptic_optimize',
|
|
23
|
+
'prefer_not_to_say',
|
|
24
|
+
])
|
|
25
|
+
.optional(),
|
|
26
|
+
/** Self party association */
|
|
27
|
+
selfPartyAssociation: optionalTrimmedString,
|
|
28
|
+
/** Family party association */
|
|
29
|
+
familyPartyAssociation: optionalTrimmedString,
|
|
30
|
+
/** Public office and elections history */
|
|
31
|
+
publicOfficeAndElections: z
|
|
32
|
+
.object({
|
|
33
|
+
hasHeldOffice: z.enum(['yes', 'no', 'prefer_not_to_say']).optional(),
|
|
34
|
+
officeDetails: optionalTrimmedString,
|
|
35
|
+
electionContested: z.enum(['yes', 'no']).optional(),
|
|
36
|
+
electionDetails: optionalTrimmedString,
|
|
37
|
+
})
|
|
38
|
+
.optional(),
|
|
39
|
+
/** Network and civic engagement (multi-select) */
|
|
40
|
+
networkAndCivicEngagement: z.array(z.string().trim()).optional(),
|
|
34
41
|
});
|
|
35
42
|
//# sourceMappingURL=step-02.schema.js.map
|