indycheck 0.0.0-stage → 0.2.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/zod.d.ts ADDED
@@ -0,0 +1,41 @@
1
+ /**
2
+ * indycheck — Zod schemas.
3
+ *
4
+ * Optional integration: `zod` is a peer dependency (optional). Importing
5
+ * this module requires zod to be installed; the main entry point
6
+ * (`index.ts`) never imports zod.
7
+ *
8
+ * Every schema validates with the same validators as the core, and its
9
+ * error message carries both the English and Hindi reason:
10
+ * "<reason_en> / <reason_hi>".
11
+ */
12
+ import { z } from "zod";
13
+ export declare const mobileSchema: z.ZodEffects<z.ZodString, string, string>;
14
+ export declare const panSchema: z.ZodEffects<z.ZodString, string, string>;
15
+ export declare const aadhaarSchema: z.ZodEffects<z.ZodString, string, string>;
16
+ export declare const gstinSchema: z.ZodEffects<z.ZodString, string, string>;
17
+ export declare const ifscSchema: z.ZodEffects<z.ZodString, string, string>;
18
+ export declare const upiSchema: z.ZodEffects<z.ZodString, string, string>;
19
+ export declare const pincodeSchema: z.ZodEffects<z.ZodString, string, string>;
20
+ export declare const tanSchema: z.ZodEffects<z.ZodString, string, string>;
21
+ export declare const cinSchema: z.ZodEffects<z.ZodString, string, string>;
22
+ export declare const llpinSchema: z.ZodEffects<z.ZodString, string, string>;
23
+ export declare const voterSchema: z.ZodEffects<z.ZodString, string, string>;
24
+ /** Alias: EPIC is the name printed on the voter ID card. */
25
+ export declare const epicSchema: z.ZodEffects<z.ZodString, string, string>;
26
+ export declare const vehicleSchema: z.ZodEffects<z.ZodString, string, string>;
27
+ /** Alias for `vehicleSchema`. */
28
+ export declare const vehicleRegistrationSchema: z.ZodEffects<z.ZodString, string, string>;
29
+ export type Mobile = z.infer<typeof mobileSchema>;
30
+ export type Pan = z.infer<typeof panSchema>;
31
+ export type Aadhaar = z.infer<typeof aadhaarSchema>;
32
+ export type Gstin = z.infer<typeof gstinSchema>;
33
+ export type Ifsc = z.infer<typeof ifscSchema>;
34
+ export type Upi = z.infer<typeof upiSchema>;
35
+ export type Pincode = z.infer<typeof pincodeSchema>;
36
+ export type Tan = z.infer<typeof tanSchema>;
37
+ export type Cin = z.infer<typeof cinSchema>;
38
+ export type Llpin = z.infer<typeof llpinSchema>;
39
+ export type Voter = z.infer<typeof voterSchema>;
40
+ export type Epic = z.infer<typeof epicSchema>;
41
+ export type Vehicle = z.infer<typeof vehicleSchema>;
package/dist/zod.js ADDED
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.vehicleRegistrationSchema = exports.vehicleSchema = exports.epicSchema = exports.voterSchema = exports.llpinSchema = exports.cinSchema = exports.tanSchema = exports.pincodeSchema = exports.upiSchema = exports.ifscSchema = exports.gstinSchema = exports.aadhaarSchema = exports.panSchema = exports.mobileSchema = void 0;
4
+ /**
5
+ * indycheck — Zod schemas.
6
+ *
7
+ * Optional integration: `zod` is a peer dependency (optional). Importing
8
+ * this module requires zod to be installed; the main entry point
9
+ * (`index.ts`) never imports zod.
10
+ *
11
+ * Every schema validates with the same validators as the core, and its
12
+ * error message carries both the English and Hindi reason:
13
+ * "<reason_en> / <reason_hi>".
14
+ */
15
+ const zod_1 = require("zod");
16
+ const index_1 = require("./index");
17
+ function refineWith(validator) {
18
+ return (value, ctx) => {
19
+ const result = validator(value);
20
+ if (!result.valid) {
21
+ ctx.addIssue({
22
+ code: zod_1.z.ZodIssueCode.custom,
23
+ message: `${result.reason_en} / ${result.reason_hi}`,
24
+ });
25
+ }
26
+ };
27
+ }
28
+ exports.mobileSchema = zod_1.z.string().superRefine(refineWith(index_1.validateMobile));
29
+ exports.panSchema = zod_1.z.string().superRefine(refineWith(index_1.validatePan));
30
+ exports.aadhaarSchema = zod_1.z.string().superRefine(refineWith(index_1.validateAadhaar));
31
+ exports.gstinSchema = zod_1.z.string().superRefine(refineWith(index_1.validateGstin));
32
+ exports.ifscSchema = zod_1.z.string().superRefine(refineWith(index_1.validateIfsc));
33
+ exports.upiSchema = zod_1.z.string().superRefine(refineWith(index_1.validateUpi));
34
+ exports.pincodeSchema = zod_1.z.string().superRefine(refineWith(index_1.validatePincode));
35
+ exports.tanSchema = zod_1.z.string().superRefine(refineWith(index_1.validateTan));
36
+ exports.cinSchema = zod_1.z.string().superRefine(refineWith(index_1.validateCin));
37
+ exports.llpinSchema = zod_1.z.string().superRefine(refineWith(index_1.validateLlpin));
38
+ exports.voterSchema = zod_1.z.string().superRefine(refineWith(index_1.validateEpic));
39
+ /** Alias: EPIC is the name printed on the voter ID card. */
40
+ exports.epicSchema = exports.voterSchema;
41
+ exports.vehicleSchema = zod_1.z.string().superRefine(refineWith(index_1.validateVehicle));
42
+ /** Alias for `vehicleSchema`. */
43
+ exports.vehicleRegistrationSchema = exports.vehicleSchema;
package/package.json CHANGED
@@ -1,6 +1,41 @@
1
1
  {
2
+ "author": "dusmamud",
3
+ "description": "Offline Indian ID validator \u2014 mobile, PAN, Aadhaar, GSTIN, IFSC, UPI and PIN code. Format + checksum only, no network, no government database.",
4
+ "devDependencies": {
5
+ "@types/node": "^26.6.6",
6
+ "typescript": "^5.6.3",
7
+ "vitest": "^2.1.8",
8
+ "zod": "^3.23.8"
9
+ },
10
+ "exports": {
11
+ ".": {
12
+ "default": "./dist/index.js",
13
+ "types": "./dist/index.d.ts"
14
+ },
15
+ "./zod": {
16
+ "default": "./dist/zod.js",
17
+ "types": "./dist/zod.d.ts"
18
+ }
19
+ },
20
+ "files": [
21
+ "dist"
22
+ ],
23
+ "license": "MIT",
24
+ "main": "dist/index.js",
2
25
  "name": "indycheck",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
26
+ "peerDependencies": {
27
+ "zod": "^3.23.0"
28
+ },
29
+ "peerDependenciesMeta": {
30
+ "zod": {
31
+ "optional": true
32
+ }
33
+ },
34
+ "scripts": {
35
+ "build": "tsc -p tsconfig.build.json",
36
+ "test": "vitest run",
37
+ "typecheck": "tsc --noEmit"
38
+ },
39
+ "types": "dist/index.d.ts",
40
+ "version": "0.2.0"
6
41
  }