@penlight/common-app 4.0.0 → 4.0.2
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 +2 -2
- package/dist/index.js +14 -6
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
@@ -26,7 +26,7 @@ export declare const signinInput: z.ZodObject<{
|
|
26
26
|
export type SigninInput = z.infer<typeof signinInput>;
|
27
27
|
export declare const createPostInput: z.ZodObject<{
|
28
28
|
title: z.ZodString;
|
29
|
-
content: z.ZodString
|
29
|
+
content: z.ZodEffects<z.ZodString, string, string>;
|
30
30
|
authorId: z.ZodString;
|
31
31
|
published: z.ZodDefault<z.ZodBoolean>;
|
32
32
|
}, "strip", z.ZodTypeAny, {
|
@@ -43,7 +43,7 @@ export declare const createPostInput: z.ZodObject<{
|
|
43
43
|
export type CreatePostInput = z.infer<typeof createPostInput>;
|
44
44
|
export declare const updatePostInput: z.ZodObject<{
|
45
45
|
title: z.ZodOptional<z.ZodString>;
|
46
|
-
content: z.ZodOptional<z.ZodString
|
46
|
+
content: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
47
47
|
published: z.ZodDefault<z.ZodBoolean>;
|
48
48
|
}, "strip", z.ZodTypeAny, {
|
49
49
|
published: boolean;
|
package/dist/index.js
CHANGED
@@ -4,21 +4,29 @@ exports.updatePostInput = exports.createPostInput = exports.signinInput = export
|
|
4
4
|
const zod_1 = require("zod");
|
5
5
|
exports.signupInput = zod_1.z.object({
|
6
6
|
email: zod_1.z.string().email(),
|
7
|
-
password: zod_1.z.string()
|
8
|
-
|
7
|
+
password: zod_1.z.string()
|
8
|
+
.min(8, "Password must have atleast 8 characters")
|
9
|
+
.regex(/[A-Z]/, "Password must contain at least one Uppercase character")
|
10
|
+
.regex(/[a-z]/, "Password must contain at least one lowercase character")
|
11
|
+
.regex(/[\W_]/, "Password must contain at least one special character"),
|
12
|
+
name: zod_1.z.string().min(3, "Username must consist of at least three characters")
|
9
13
|
});
|
10
14
|
exports.signinInput = zod_1.z.object({
|
11
15
|
email: zod_1.z.string().email(),
|
12
16
|
password: zod_1.z.string()
|
17
|
+
.min(8, "Password must have atleast 8 characters")
|
18
|
+
.regex(/[A-Z]/, "Password must contain at least one Uppercase character")
|
19
|
+
.regex(/[a-z]/, "Password must contain at least one lowercase character")
|
20
|
+
.regex(/[\W_]/, "Password must contain at least one special character")
|
13
21
|
});
|
14
22
|
exports.createPostInput = zod_1.z.object({
|
15
|
-
title: zod_1.z.string(),
|
16
|
-
content: zod_1.z.string(),
|
23
|
+
title: zod_1.z.string().min(1, "Cannot leave title field empty"),
|
24
|
+
content: zod_1.z.string().refine((text) => text.split(/\s+/).length >= 100, { message: "Content should consist at least 100 Words" }),
|
17
25
|
authorId: zod_1.z.string(),
|
18
26
|
published: zod_1.z.boolean().default(false)
|
19
27
|
});
|
20
28
|
exports.updatePostInput = zod_1.z.object({
|
21
|
-
title: zod_1.z.string().optional(),
|
22
|
-
content: zod_1.z.string().optional(),
|
29
|
+
title: zod_1.z.string().min(1, "Cannot leave title field empty").optional(),
|
30
|
+
content: zod_1.z.string().refine((text) => text.split(/\s+/).length >= 100, { message: "Content should consist at least 100 Words" }).optional(),
|
23
31
|
published: zod_1.z.boolean().default(false)
|
24
32
|
});
|