@divyam97/medium-common 1.0.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.
@@ -0,0 +1,29 @@
1
+ import * as z from "zod";
2
+ export declare const SignInSchema: z.ZodObject<{
3
+ email: z.ZodEmail;
4
+ password: z.ZodString;
5
+ }, z.core.$strip>;
6
+ export declare const SignUpSchema: z.ZodObject<{
7
+ email: z.ZodEmail;
8
+ password: z.ZodString;
9
+ name: z.ZodOptional<z.ZodString>;
10
+ }, z.core.$strip>;
11
+ export declare const BlogSchema: z.ZodObject<{
12
+ title: z.ZodString;
13
+ body: z.ZodString;
14
+ tags: z.ZodArray<z.ZodEnum<{
15
+ Technology: "Technology";
16
+ Programming: "Programming";
17
+ Startups: "Startups";
18
+ Productivity: "Productivity";
19
+ }>>;
20
+ published: z.ZodOptional<z.ZodBoolean>;
21
+ }, z.core.$strip>;
22
+ export declare const IdSchema: z.ZodObject<{
23
+ id: z.ZodCoercedNumber<unknown>;
24
+ }, z.core.$strip>;
25
+ export type SignInInput = z.infer<typeof SignInSchema>;
26
+ export type SignUpInput = z.infer<typeof SignUpSchema>;
27
+ export type BlogSchemaInput = z.infer<typeof BlogSchema>;
28
+ export type IdSchemaInput = z.infer<typeof IdSchema>;
29
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAOzB,eAAO,MAAM,YAAY;;;iBAAwB,CAAC;AAElD,eAAO,MAAM,YAAY;;;;iBAEvB,CAAC;AASH,eAAO,MAAM,UAAU;;;;;;;;;;iBAUrB,CAAC;AAEH,eAAO,MAAM,QAAQ;;iBAEnB,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AACvD,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AACvD,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AACzD,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,QAAQ,CAAC,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,30 @@
1
+ import * as z from "zod";
2
+ const AuthCredentialsSchema = z.object({
3
+ email: z.email(),
4
+ password: z.string().min(1),
5
+ });
6
+ export const SignInSchema = AuthCredentialsSchema;
7
+ export const SignUpSchema = AuthCredentialsSchema.extend({
8
+ name: z.string().min(1).optional(),
9
+ });
10
+ const CATEGORY_VALUES = [
11
+ "Technology",
12
+ "Programming",
13
+ "Startups",
14
+ "Productivity",
15
+ ];
16
+ export const BlogSchema = z.object({
17
+ title: z.string().min(1),
18
+ body: z.string().min(1),
19
+ tags: z
20
+ .array(z.enum(CATEGORY_VALUES))
21
+ .min(1)
22
+ .refine((tags) => new Set(tags).size === tags.length, {
23
+ message: "Tags must be unique",
24
+ }),
25
+ published: z.boolean().optional(),
26
+ });
27
+ export const IdSchema = z.object({
28
+ id: z.coerce.number().int().positive(),
29
+ });
30
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAEzB,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IACrC,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE;IAChB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;CAC5B,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,YAAY,GAAG,qBAAqB,CAAC;AAElD,MAAM,CAAC,MAAM,YAAY,GAAG,qBAAqB,CAAC,MAAM,CAAC;IACvD,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;CACnC,CAAC,CAAC;AAEH,MAAM,eAAe,GAAG;IACtB,YAAY;IACZ,aAAa;IACb,UAAU;IACV,cAAc;CACN,CAAC;AAEX,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC;IACjC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACxB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACvB,IAAI,EAAE,CAAC;SACJ,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;SAC9B,GAAG,CAAC,CAAC,CAAC;SACN,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,GAAG,CAAC,IAAI,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,MAAM,EAAE;QACpD,OAAO,EAAE,qBAAqB;KAC/B,CAAC;IACJ,SAAS,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;CAClC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/B,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;CACvC,CAAC,CAAC"}
package/package.json ADDED
@@ -0,0 +1,16 @@
1
+ {
2
+ "name": "@divyam97/medium-common",
3
+ "version": "1.0.0",
4
+ "type": "module",
5
+ "description": "",
6
+ "main": "dist/index.js",
7
+ "scripts": {
8
+ "test": "echo \"Error: no test specified\" && exit 1"
9
+ },
10
+ "keywords": [],
11
+ "author": "",
12
+ "license": "ISC",
13
+ "dependencies": {
14
+ "zod": "^4.3.6"
15
+ }
16
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,44 @@
1
+ {
2
+ // Visit https://aka.ms/tsconfig to read more about this file
3
+ "compilerOptions": {
4
+ // File Layout
5
+ "rootDir": "./src",
6
+ "outDir": "./dist",
7
+
8
+ // Environment Settings
9
+ // See also https://aka.ms/tsconfig/module
10
+ "module": "nodenext",
11
+ "target": "esnext",
12
+ "types": [],
13
+ // For nodejs:
14
+ // "lib": ["esnext"],
15
+ // "types": ["node"],
16
+ // and npm install -D @types/node
17
+
18
+ // Other Outputs
19
+ "sourceMap": true,
20
+ "declaration": true,
21
+ "declarationMap": true,
22
+
23
+ // Stricter Typechecking Options
24
+ "noUncheckedIndexedAccess": true,
25
+ "exactOptionalPropertyTypes": true,
26
+
27
+ // Style Options
28
+ // "noImplicitReturns": true,
29
+ // "noImplicitOverride": true,
30
+ // "noUnusedLocals": true,
31
+ // "noUnusedParameters": true,
32
+ // "noFallthroughCasesInSwitch": true,
33
+ // "noPropertyAccessFromIndexSignature": true,
34
+
35
+ // Recommended Options
36
+ "strict": true,
37
+ "jsx": "react-jsx",
38
+ "verbatimModuleSyntax": true,
39
+ "isolatedModules": true,
40
+ "noUncheckedSideEffectImports": true,
41
+ "moduleDetection": "force",
42
+ "skipLibCheck": true
43
+ }
44
+ }
@@ -0,0 +1 @@
1
+ {"root":["./src/index.ts"],"version":"5.9.3"}