udp-schema 0.1.21 → 0.1.22

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/index.d.ts CHANGED
@@ -1,12 +1,12 @@
1
1
  /**
2
2
  * udp-schema — Shared Zod schemas for User Detailed Profile
3
3
  *
4
- * Single source of truth consumed by both survey-frontend and survey-backend.
4
+ * Single source of truth consumed by both reform frontends and reform-backend.
5
5
  *
6
6
  * @module udp-schema
7
7
  */
8
8
  export { emptyStringToUndefined, optionalPhoneSchema, optionalTrimmedString, optionalYearSchema, } from './helpers.js';
9
- export { assistedBySurveyorSchema, languageValueSchema, profilePhotoSchema, type Step01OnboardingFormInput, type Step01OnboardingInput, secondaryLanguageItemSchema, step01OnboardingSchema, } from './step-01.schema.js';
9
+ export { assistedByVolunteerSchema, languageValueSchema, profilePhotoSchema, type Step01OnboardingFormInput, type Step01OnboardingInput, secondaryLanguageItemSchema, step01OnboardingSchema, } from './step-01.schema.js';
10
10
  export { optionalUrlSchema, type Step02ContactDetailsInput, step02ContactDetailsSchema, } from './step-02.schema.js';
11
11
  export { type AddressInput, addressSchema, areaRefSchema, type Step03ResidenceInput, step03ResidenceSchema, } from './step-03.schema.js';
12
12
  export { type Step04IdentityInput, step04IdentitySchema, } from './step-04.schema.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EACL,sBAAsB,EACtB,mBAAmB,EACnB,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,cAAc,CAAC;AAGtB,OAAO,EACL,wBAAwB,EACxB,mBAAmB,EACnB,kBAAkB,EAClB,KAAK,yBAAyB,EAC9B,KAAK,qBAAqB,EAC1B,2BAA2B,EAC3B,sBAAsB,GACvB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EACL,iBAAiB,EACjB,KAAK,yBAAyB,EAC9B,0BAA0B,GAC3B,MAAM,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14 +1,14 @@
1
1
  /**
2
2
  * udp-schema — Shared Zod schemas for User Detailed Profile
3
3
  *
4
- * Single source of truth consumed by both survey-frontend and survey-backend.
4
+ * Single source of truth consumed by both reform frontends and reform-backend.
5
5
  *
6
6
  * @module udp-schema
7
7
  */
8
8
  // Helpers
9
9
  export { emptyStringToUndefined, optionalPhoneSchema, optionalTrimmedString, optionalYearSchema, } from './helpers.js';
10
10
  // Step 01 — Profile Onboarding
11
- export { assistedBySurveyorSchema, languageValueSchema, profilePhotoSchema, secondaryLanguageItemSchema, step01OnboardingSchema, } from './step-01.schema.js';
11
+ export { assistedByVolunteerSchema, languageValueSchema, profilePhotoSchema, secondaryLanguageItemSchema, step01OnboardingSchema, } from './step-01.schema.js';
12
12
  // Step 02 — Contact Details
13
13
  export { optionalUrlSchema, step02ContactDetailsSchema, } from './step-02.schema.js';
14
14
  // Step 03 — Residence / Address
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,UAAU;AACV,OAAO,EACL,sBAAsB,EACtB,mBAAmB,EACnB,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,cAAc,CAAC;AAEtB,+BAA+B;AAC/B,OAAO,EACL,wBAAwB,EACxB,mBAAmB,EACnB,kBAAkB,EAGlB,2BAA2B,EAC3B,sBAAsB,GACvB,MAAM,qBAAqB,CAAC;AAE7B,4BAA4B;AAC5B,OAAO,EACL,iBAAiB,EAEjB,0BAA0B,GAC3B,MAAM,qBAAqB,CAAC;AAE7B,gCAAgC;AAChC,OAAO,EAEL,aAAa,EACb,aAAa,EAEb,qBAAqB,GACtB,MAAM,qBAAqB,CAAC;AAE7B,sCAAsC;AACtC,OAAO,EAEL,oBAAoB,GACrB,MAAM,qBAAqB,CAAC;AAE7B,0DAA0D;AAC1D,OAAO,EAEL,sBAAsB,GACvB,MAAM,qBAAqB,CAAC;AAE7B,kDAAkD;AAClD,OAAO,EAEL,qBAAqB,GACtB,MAAM,qBAAqB,CAAC;AAE7B,8BAA8B;AAC9B,OAAO,EAEL,sBAAsB,EAEtB,iBAAiB,EAEjB,qBAAqB,GACtB,MAAM,qBAAqB,CAAC;AAE7B,oCAAoC;AACpC,OAAO,EAEL,sBAAsB,GACvB,MAAM,qBAAqB,CAAC;AAE7B,8CAA8C;AAC9C,OAAO,EAEL,0BAA0B,GAC3B,MAAM,qBAAqB,CAAC;AAE7B,sCAAsC;AACtC,OAAO,EAEL,yBAAyB,GAC1B,MAAM,qBAAqB,CAAC;AAE7B,4CAA4C;AAC5C,OAAO,EAEL,qBAAqB,GACtB,MAAM,qBAAqB,CAAC;AAE7B,8BAA8B;AAC9B,OAAO,EAEL,qBAAqB,GACtB,MAAM,qBAAqB,CAAC;AAE7B,+BAA+B;AAC/B,OAAO,EAEL,kBAAkB,GACnB,MAAM,qBAAqB,CAAC;AAE7B,2CAA2C;AAC3C,OAAO,EAEL,sBAAsB,GACvB,MAAM,qBAAqB,CAAC","sourcesContent":["/**\n * udp-schema — Shared Zod schemas for User Detailed Profile\n *\n * Single source of truth consumed by both survey-frontend and survey-backend.\n *\n * @module udp-schema\n */\n\n// Helpers\nexport {\n emptyStringToUndefined,\n optionalPhoneSchema,\n optionalTrimmedString,\n optionalYearSchema,\n} from './helpers.js';\n\n// Step 01 — Profile Onboarding\nexport {\n assistedBySurveyorSchema,\n languageValueSchema,\n profilePhotoSchema,\n type Step01OnboardingFormInput,\n type Step01OnboardingInput,\n secondaryLanguageItemSchema,\n step01OnboardingSchema,\n} from './step-01.schema.js';\n\n// Step 02 — Contact Details\nexport {\n optionalUrlSchema,\n type Step02ContactDetailsInput,\n step02ContactDetailsSchema,\n} from './step-02.schema.js';\n\n// Step 03 — Residence / Address\nexport {\n type AddressInput,\n addressSchema,\n areaRefSchema,\n type Step03ResidenceInput,\n step03ResidenceSchema,\n} from './step-03.schema.js';\n\n// Step 04 — Identity & Social Profile\nexport {\n type Step04IdentityInput,\n step04IdentitySchema,\n} from './step-04.schema.js';\n\n// Step 05 — Leadership, Contribution & Political Ambition\nexport {\n type Step05LeadershipInput,\n step05LeadershipSchema,\n} from './step-05.schema.js';\n\n// Step 06 — Household, Economic & Digital Profile\nexport {\n type Step06HouseholdInput,\n step06HouseholdSchema,\n} from './step-06.schema.js';\n\n// Step 07 — Education History\nexport {\n type CertificateEntryInput,\n certificateEntrySchema,\n type DegreeEntryInput,\n degreeEntrySchema,\n type Step07EducationInput,\n step07EducationSchema,\n} from './step-07.schema.js';\n\n// Step 08 — Employment & Occupation\nexport {\n type Step08EmploymentInput,\n step08EmploymentSchema,\n} from './step-08.schema.js';\n\n// Step 09 — Neurodiversity & Learning Profile\nexport {\n type Step09NeurodiversityInput,\n step09NeurodiversitySchema,\n} from './step-09.schema.js';\n\n// Step 10 — Psychological Assessments\nexport {\n type Step10PsychologicalInput,\n step10PsychologicalSchema,\n} from './step-10.schema.js';\n\n// Step 11 — Political Association & History\nexport {\n type Step11PoliticalInput,\n step11PoliticalSchema,\n} from './step-11.schema.js';\n\n// Step 12 — Electoral Details\nexport {\n type Step12ElectoralInput,\n step12ElectoralSchema,\n} from './step-12.schema.js';\n\n// Step 13 — Health & Lifestyle\nexport {\n type Step13HealthInput,\n step13HealthSchema,\n} from './step-13.schema.js';\n\n// Step 14 — Yearly Priorities & Life Goals\nexport {\n type Step14PrioritiesInput,\n step14PrioritiesSchema,\n} from './step-14.schema.js';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,UAAU;AACV,OAAO,EACL,sBAAsB,EACtB,mBAAmB,EACnB,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,cAAc,CAAC;AAEtB,+BAA+B;AAC/B,OAAO,EACL,yBAAyB,EACzB,mBAAmB,EACnB,kBAAkB,EAGlB,2BAA2B,EAC3B,sBAAsB,GACvB,MAAM,qBAAqB,CAAC;AAE7B,4BAA4B;AAC5B,OAAO,EACL,iBAAiB,EAEjB,0BAA0B,GAC3B,MAAM,qBAAqB,CAAC;AAE7B,gCAAgC;AAChC,OAAO,EAEL,aAAa,EACb,aAAa,EAEb,qBAAqB,GACtB,MAAM,qBAAqB,CAAC;AAE7B,sCAAsC;AACtC,OAAO,EAEL,oBAAoB,GACrB,MAAM,qBAAqB,CAAC;AAE7B,0DAA0D;AAC1D,OAAO,EAEL,sBAAsB,GACvB,MAAM,qBAAqB,CAAC;AAE7B,kDAAkD;AAClD,OAAO,EAEL,qBAAqB,GACtB,MAAM,qBAAqB,CAAC;AAE7B,8BAA8B;AAC9B,OAAO,EAEL,sBAAsB,EAEtB,iBAAiB,EAEjB,qBAAqB,GACtB,MAAM,qBAAqB,CAAC;AAE7B,oCAAoC;AACpC,OAAO,EAEL,sBAAsB,GACvB,MAAM,qBAAqB,CAAC;AAE7B,8CAA8C;AAC9C,OAAO,EAEL,0BAA0B,GAC3B,MAAM,qBAAqB,CAAC;AAE7B,sCAAsC;AACtC,OAAO,EAEL,yBAAyB,GAC1B,MAAM,qBAAqB,CAAC;AAE7B,4CAA4C;AAC5C,OAAO,EAEL,qBAAqB,GACtB,MAAM,qBAAqB,CAAC;AAE7B,8BAA8B;AAC9B,OAAO,EAEL,qBAAqB,GACtB,MAAM,qBAAqB,CAAC;AAE7B,+BAA+B;AAC/B,OAAO,EAEL,kBAAkB,GACnB,MAAM,qBAAqB,CAAC;AAE7B,2CAA2C;AAC3C,OAAO,EAEL,sBAAsB,GACvB,MAAM,qBAAqB,CAAC","sourcesContent":["/**\n * udp-schema — Shared Zod schemas for User Detailed Profile\n *\n * Single source of truth consumed by both reform frontends and reform-backend.\n *\n * @module udp-schema\n */\n\n// Helpers\nexport {\n emptyStringToUndefined,\n optionalPhoneSchema,\n optionalTrimmedString,\n optionalYearSchema,\n} from './helpers.js';\n\n// Step 01 — Profile Onboarding\nexport {\n assistedByVolunteerSchema,\n languageValueSchema,\n profilePhotoSchema,\n type Step01OnboardingFormInput,\n type Step01OnboardingInput,\n secondaryLanguageItemSchema,\n step01OnboardingSchema,\n} from './step-01.schema.js';\n\n// Step 02 — Contact Details\nexport {\n optionalUrlSchema,\n type Step02ContactDetailsInput,\n step02ContactDetailsSchema,\n} from './step-02.schema.js';\n\n// Step 03 — Residence / Address\nexport {\n type AddressInput,\n addressSchema,\n areaRefSchema,\n type Step03ResidenceInput,\n step03ResidenceSchema,\n} from './step-03.schema.js';\n\n// Step 04 — Identity & Social Profile\nexport {\n type Step04IdentityInput,\n step04IdentitySchema,\n} from './step-04.schema.js';\n\n// Step 05 — Leadership, Contribution & Political Ambition\nexport {\n type Step05LeadershipInput,\n step05LeadershipSchema,\n} from './step-05.schema.js';\n\n// Step 06 — Household, Economic & Digital Profile\nexport {\n type Step06HouseholdInput,\n step06HouseholdSchema,\n} from './step-06.schema.js';\n\n// Step 07 — Education History\nexport {\n type CertificateEntryInput,\n certificateEntrySchema,\n type DegreeEntryInput,\n degreeEntrySchema,\n type Step07EducationInput,\n step07EducationSchema,\n} from './step-07.schema.js';\n\n// Step 08 — Employment & Occupation\nexport {\n type Step08EmploymentInput,\n step08EmploymentSchema,\n} from './step-08.schema.js';\n\n// Step 09 — Neurodiversity & Learning Profile\nexport {\n type Step09NeurodiversityInput,\n step09NeurodiversitySchema,\n} from './step-09.schema.js';\n\n// Step 10 — Psychological Assessments\nexport {\n type Step10PsychologicalInput,\n step10PsychologicalSchema,\n} from './step-10.schema.js';\n\n// Step 11 — Political Association & History\nexport {\n type Step11PoliticalInput,\n step11PoliticalSchema,\n} from './step-11.schema.js';\n\n// Step 12 — Electoral Details\nexport {\n type Step12ElectoralInput,\n step12ElectoralSchema,\n} from './step-12.schema.js';\n\n// Step 13 — Health & Lifestyle\nexport {\n type Step13HealthInput,\n step13HealthSchema,\n} from './step-13.schema.js';\n\n// Step 14 — Yearly Priorities & Life Goals\nexport {\n type Step14PrioritiesInput,\n step14PrioritiesSchema,\n} from './step-14.schema.js';\n"]}
@@ -49,9 +49,9 @@ export declare const profilePhotoSchema: z.ZodOptional<z.ZodUnion<readonly [z.Zo
49
49
  mimeType: z.ZodOptional<z.ZodString>;
50
50
  sizeBytes: z.ZodOptional<z.ZodNumber>;
51
51
  }, z.core.$strip>]>>;
52
- /** Surveyor who assisted with the form. */
53
- export declare const assistedBySurveyorSchema: z.ZodOptional<z.ZodObject<{
54
- surveyorId: z.ZodOptional<z.ZodString>;
52
+ /** Volunteer who assisted with the form. */
53
+ export declare const assistedByVolunteerSchema: z.ZodOptional<z.ZodObject<{
54
+ volunteerId: z.ZodOptional<z.ZodString>;
55
55
  displayName: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodString>>;
56
56
  source: z.ZodOptional<z.ZodEnum<{
57
57
  selected: "selected";
@@ -82,8 +82,8 @@ export declare const step01OnboardingSchema: z.ZodObject<{
82
82
  mimeType: z.ZodOptional<z.ZodString>;
83
83
  sizeBytes: z.ZodOptional<z.ZodNumber>;
84
84
  }, z.core.$strip>]>>;
85
- assistedBySurveyor: z.ZodOptional<z.ZodObject<{
86
- surveyorId: z.ZodOptional<z.ZodString>;
85
+ assistedByVolunteer: z.ZodOptional<z.ZodObject<{
86
+ volunteerId: z.ZodOptional<z.ZodString>;
87
87
  displayName: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodString>>;
88
88
  source: z.ZodOptional<z.ZodEnum<{
89
89
  selected: "selected";
@@ -1 +1 @@
1
- {"version":3,"file":"step-01.schema.d.ts","sourceRoot":"","sources":["../src/step-01.schema.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,iEAAiE;AACjE,eAAO,MAAM,mBAAmB;;;;;iBAU7B,CAAC;AAEJ,iDAAiD;AACjD,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;iBAMtC,CAAC;AAEH;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;oBAgBlB,CAAC;AAEd,2CAA2C;AAC3C,eAAO,MAAM,wBAAwB;;;;;;;kBAMxB,CAAC;AAId,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAwDjC,CAAC;AAIH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAC3E,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
1
+ {"version":3,"file":"step-01.schema.d.ts","sourceRoot":"","sources":["../src/step-01.schema.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,iEAAiE;AACjE,eAAO,MAAM,mBAAmB;;;;;iBAU7B,CAAC;AAEJ,iDAAiD;AACjD,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;iBAMtC,CAAC;AAEH;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;oBAgBlB,CAAC;AAEd,4CAA4C;AAC5C,eAAO,MAAM,yBAAyB;;;;;;;kBAMzB,CAAC;AAId,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAwDjC,CAAC;AAIH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAC3E,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
@@ -49,10 +49,10 @@ export const profilePhotoSchema = z
49
49
  }),
50
50
  ])
51
51
  .optional();
52
- /** Surveyor who assisted with the form. */
53
- export const assistedBySurveyorSchema = z
52
+ /** Volunteer who assisted with the form. */
53
+ export const assistedByVolunteerSchema = z
54
54
  .object({
55
- surveyorId: z.string().optional(),
55
+ volunteerId: z.string().optional(),
56
56
  displayName: optionalTrimmedString,
57
57
  source: z.enum(['selected', 'manual']).optional(),
58
58
  })
@@ -80,7 +80,7 @@ export const step01OnboardingSchema = z.object({
80
80
  .regex(/^\d{12}$/, 'Aadhaar must be exactly 12 digits')
81
81
  .optional()),
82
82
  profilePhotoUrl: profilePhotoSchema,
83
- assistedBySurveyor: assistedBySurveyorSchema,
83
+ assistedByVolunteer: assistedByVolunteerSchema,
84
84
  formFilledLocation: z
85
85
  .object({
86
86
  latitude: z.number().min(-90).max(90),
@@ -1 +1 @@
1
- {"version":3,"file":"step-01.schema.js","sourceRoot":"","sources":["../src/step-01.schema.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAE7E,2DAA2D;AAE3D,iEAAiE;AACjE,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC;KACjC,MAAM,CAAC;IACN,IAAI,EAAE,qBAAqB;IAC3B,UAAU,EAAE,qBAAqB;IACjC,WAAW,EAAE,qBAAqB;IAClC,MAAM,EAAE,qBAAqB;CAC9B,CAAC;KACD,MAAM,CACL,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,UAAU,IAAI,CAAC,CAAC,WAAW,CAAC,EACvD,mEAAmE,CACpE,CAAC;AAEJ,iDAAiD;AACjD,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC,MAAM,CAAC;IAClD,QAAQ,EAAE,mBAAmB;IAC7B,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,QAAQ,CAAC,CAAC;IACtE,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAA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Schema\n *\n * Single source of truth used by both frontend and backend.\n * Field names match the MongoDB document keys exactly.\n *\n * @module udp-schema/step-01\n */\n\nimport { z } from 'zod';\nimport { emptyStringToUndefined, optionalTrimmedString } from './helpers.js';\n\n// ─── Sub-schemas ────────────────────────────────────────\n\n/** Language value (code / nativeName / englishName / script). */\nexport const languageValueSchema = z\n .object({\n code: optionalTrimmedString,\n nativeName: optionalTrimmedString,\n englishName: optionalTrimmedString,\n script: optionalTrimmedString,\n })\n .refine(\n (v) => Boolean(v.code || v.nativeName || v.englishName),\n 'Language must include at least code, native name, or english name',\n );\n\n/** One entry in the secondaryLanguages array. */\nexport const secondaryLanguageItemSchema = z.object({\n language: languageValueSchema,\n fluency: z.enum(['basic', 'conversational', 'professional', 'native']),\n canSpeak: z.boolean().optional(),\n canRead: z.boolean().optional(),\n canWrite: z.boolean().optional(),\n});\n\n/**\n * Profile photo — accepts either:\n * • a plain URL string (returned by backend on prefill)\n * • an upload-result object (sent after fresh upload)\n * • a File-like object (frontend pre-upload state)\n */\nexport const profilePhotoSchema = z\n .union([\n z.object({\n name: z.string().optional(),\n type: z.string().optional(),\n size: z.number().min(0).optional(),\n lastModified: z.number().min(0).optional(),\n }),\n z.string(),\n z.object({\n assetId: z.string().trim().optional(),\n url: z.string().trim().optional(),\n mimeType: z.string().trim().optional(),\n sizeBytes: z.number().min(0).optional(),\n }),\n ])\n .optional();\n\n/** Surveyor who assisted with the form. */\nexport const assistedBySurveyorSchema = z\n .object({\n surveyorId: z.string().optional(),\n displayName: optionalTrimmedString,\n source: z.enum(['selected', 'manual']).optional(),\n })\n .optional();\n\n// ─── Main step-01 schema ────────────────────────────────\n\nexport const step01OnboardingSchema = z.object({\n email: z.string().trim().toLowerCase().email('Enter a valid email address'),\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 middleName: optionalTrimmedString,\n lastName: optionalTrimmedString,\n gender: z.enum(['male', 'female', 'other', 'prefer_not']).optional(),\n dateOfBirth: z.preprocess(emptyStringToUndefined, z.coerce.date().optional()),\n aadhaarNumber: z.preprocess(\n (value) => {\n const normalized = emptyStringToUndefined(value);\n if (typeof normalized === 'string') {\n return normalized.replace(/\\D/g, '');\n }\n return normalized;\n },\n z\n .string()\n .regex(/^\\d{12}$/, 'Aadhaar must be exactly 12 digits')\n .optional(),\n ),\n profilePhotoUrl: profilePhotoSchema,\n assistedBySurveyor: assistedBySurveyorSchema,\n formFilledLocation: z\n .object({\n latitude: z.number().min(-90).max(90),\n longitude: z.number().min(-180).max(180),\n accuracy: z.number().optional(),\n capturedAt: z.coerce.date().optional(),\n })\n .optional(),\n primaryLanguage: languageValueSchema.optional(),\n secondaryLanguages: z\n .array(secondaryLanguageItemSchema)\n .max(5, 'You can add up to 5 secondary languages')\n .optional()\n .superRefine((items, context) => {\n if (!items) return;\n const seenCodes = new Map<string, number>();\n items.forEach((item, index) => {\n const code = item.language.code?.toLowerCase();\n if (!code) return;\n if (seenCodes.has(code)) {\n context.addIssue({\n code: 'custom',\n path: [index, 'language', 'code'],\n message: 'Duplicate secondary language is not allowed',\n });\n return;\n }\n seenCodes.set(code, index);\n });\n }),\n});\n\n// ─── Inferred types ─────────────────────────────────────\n\nexport type Step01OnboardingInput = z.infer<typeof step01OnboardingSchema>;\nexport type Step01OnboardingFormInput = z.input<typeof step01OnboardingSchema>;\n"]}
1
+ {"version":3,"file":"step-01.schema.js","sourceRoot":"","sources":["../src/step-01.schema.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAE7E,2DAA2D;AAE3D,iEAAiE;AACjE,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC;KACjC,MAAM,CAAC;IACN,IAAI,EAAE,qBAAqB;IAC3B,UAAU,EAAE,qBAAqB;IACjC,WAAW,EAAE,qBAAqB;IA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IAAI,EAAE,WAAW,EAAE,CAAC;YAC/C,IAAI,CAAC,IAAI;gBAAE,OAAO;YAClB,IAAI,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;gBACxB,OAAO,CAAC,QAAQ,CAAC;oBACf,IAAI,EAAE,QAAQ;oBACd,IAAI,EAAE,CAAC,KAAK,EAAE,UAAU,EAAE,MAAM,CAAC;oBACjC,OAAO,EAAE,6CAA6C;iBACvD,CAAC,CAAC;gBACH,OAAO;YACT,CAAC;YACD,SAAS,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QAC7B,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;CACL,CAAC,CAAC","sourcesContent":["/**\n * Step 01 — Profile Onboarding Schema\n *\n * Single source of truth used by both frontend and backend.\n * Field names match the MongoDB document keys exactly.\n *\n * @module udp-schema/step-01\n */\n\nimport { z } from 'zod';\nimport { emptyStringToUndefined, optionalTrimmedString } from './helpers.js';\n\n// ─── Sub-schemas ────────────────────────────────────────\n\n/** Language value (code / nativeName / englishName / script). */\nexport const languageValueSchema = z\n .object({\n code: optionalTrimmedString,\n nativeName: optionalTrimmedString,\n englishName: optionalTrimmedString,\n script: optionalTrimmedString,\n })\n .refine(\n (v) => Boolean(v.code || v.nativeName || v.englishName),\n 'Language must include at least code, native name, or english name',\n );\n\n/** One entry in the secondaryLanguages array. */\nexport const secondaryLanguageItemSchema = z.object({\n language: languageValueSchema,\n fluency: z.enum(['basic', 'conversational', 'professional', 'native']),\n canSpeak: z.boolean().optional(),\n canRead: z.boolean().optional(),\n canWrite: z.boolean().optional(),\n});\n\n/**\n * Profile photo — accepts either:\n * • a plain URL string (returned by backend on prefill)\n * • an upload-result object (sent after fresh upload)\n * • a File-like object (frontend pre-upload state)\n */\nexport const profilePhotoSchema = z\n .union([\n z.object({\n name: z.string().optional(),\n type: z.string().optional(),\n size: z.number().min(0).optional(),\n lastModified: z.number().min(0).optional(),\n }),\n z.string(),\n z.object({\n assetId: z.string().trim().optional(),\n url: z.string().trim().optional(),\n mimeType: z.string().trim().optional(),\n sizeBytes: z.number().min(0).optional(),\n }),\n ])\n .optional();\n\n/** Volunteer who assisted with the form. */\nexport const assistedByVolunteerSchema = z\n .object({\n volunteerId: z.string().optional(),\n displayName: optionalTrimmedString,\n source: z.enum(['selected', 'manual']).optional(),\n })\n .optional();\n\n// ─── Main step-01 schema ────────────────────────────────\n\nexport const step01OnboardingSchema = z.object({\n email: z.string().trim().toLowerCase().email('Enter a valid email address'),\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 middleName: optionalTrimmedString,\n lastName: optionalTrimmedString,\n gender: z.enum(['male', 'female', 'other', 'prefer_not']).optional(),\n dateOfBirth: z.preprocess(emptyStringToUndefined, z.coerce.date().optional()),\n aadhaarNumber: z.preprocess(\n (value) => {\n const normalized = emptyStringToUndefined(value);\n if (typeof normalized === 'string') {\n return normalized.replace(/\\D/g, '');\n }\n return normalized;\n },\n z\n .string()\n .regex(/^\\d{12}$/, 'Aadhaar must be exactly 12 digits')\n .optional(),\n ),\n profilePhotoUrl: profilePhotoSchema,\n assistedByVolunteer: assistedByVolunteerSchema,\n formFilledLocation: z\n .object({\n latitude: z.number().min(-90).max(90),\n longitude: z.number().min(-180).max(180),\n accuracy: z.number().optional(),\n capturedAt: z.coerce.date().optional(),\n })\n .optional(),\n primaryLanguage: languageValueSchema.optional(),\n secondaryLanguages: z\n .array(secondaryLanguageItemSchema)\n .max(5, 'You can add up to 5 secondary languages')\n .optional()\n .superRefine((items, context) => {\n if (!items) return;\n const seenCodes = new Map<string, number>();\n items.forEach((item, index) => {\n const code = item.language.code?.toLowerCase();\n if (!code) return;\n if (seenCodes.has(code)) {\n context.addIssue({\n code: 'custom',\n path: [index, 'language', 'code'],\n message: 'Duplicate secondary language is not allowed',\n });\n return;\n }\n seenCodes.set(code, index);\n });\n }),\n});\n\n// ─── Inferred types ─────────────────────────────────────\n\nexport type Step01OnboardingInput = z.infer<typeof step01OnboardingSchema>;\nexport type Step01OnboardingFormInput = z.input<typeof step01OnboardingSchema>;\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "udp-schema",
3
- "version": "0.1.21",
3
+ "version": "0.1.22",
4
4
  "description": "Shared Zod schemas for User Detailed Profile (frontend + backend).",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",