@morpheus.live/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,30 @@
1
+ import * as z from "zod";
2
+ export declare const signupInput: z.ZodObject<{
3
+ username: z.ZodString;
4
+ useremail: z.ZodEmail;
5
+ password: z.ZodString;
6
+ }, z.core.$strip>;
7
+ export declare const signinInput: z.ZodObject<{
8
+ username: z.ZodString;
9
+ useremail: z.ZodEmail;
10
+ password: z.ZodString;
11
+ }, z.core.$strip>;
12
+ export declare const createBlogInput: z.ZodObject<{
13
+ title: z.ZodString;
14
+ content: z.ZodString;
15
+ }, z.core.$strip>;
16
+ export declare const uploadBlogInput: z.ZodObject<{
17
+ title: z.ZodString;
18
+ content: z.ZodString;
19
+ id: z.ZodString;
20
+ }, z.core.$strip>;
21
+ export declare const postSchema: z.ZodObject<{
22
+ title: z.ZodString;
23
+ content: z.ZodString;
24
+ published: z.ZodOptional<z.ZodBoolean>;
25
+ }, z.core.$strip>;
26
+ export type SigninInput = z.infer<typeof signinInput>;
27
+ export type CreateBlogInput = z.infer<typeof createBlogInput>;
28
+ export type SignupInput = z.infer<typeof signupInput>;
29
+ export type UploadBlogInput = z.infer<typeof uploadBlogInput>;
30
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAM,CAAC,MAAM,KAAK,CAAC;AAC1B,eAAO,MAAM,WAAW;;;;iBAItB,CAAA;AAEF,eAAO,MAAM,WAAW;;;;iBAItB,CAAA;AACF,eAAO,MAAM,eAAe;;;iBAG1B,CAAA;AAEF,eAAO,MAAM,eAAe;;;;iBAI1B,CAAA;AAEF,eAAO,MAAM,UAAU;;;;iBAKrB,CAAA;AAGF,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAA;AACrD,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAA;AAC7D,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAA;AACrD,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAA"}
package/dist/index.js ADDED
@@ -0,0 +1,27 @@
1
+ // zod validation schemas and types are here
2
+ import * as z from "zod";
3
+ export const signupInput = z.object({
4
+ username: z.string().trim(),
5
+ useremail: z.email(),
6
+ password: z.string().trim().min(6, "Password must contains 6 characters.")
7
+ });
8
+ export const signinInput = z.object({
9
+ username: z.string().trim(),
10
+ useremail: z.email(),
11
+ password: z.string().trim().min(6, "Password must contains 6 characters.")
12
+ });
13
+ export const createBlogInput = z.object({
14
+ title: z.string(),
15
+ content: z.string()
16
+ });
17
+ export const uploadBlogInput = z.object({
18
+ title: z.string(),
19
+ content: z.string(),
20
+ id: z.string()
21
+ });
22
+ export const postSchema = z.object({
23
+ title: z.string(),
24
+ content: z.string(),
25
+ published: z.boolean().optional()
26
+ });
27
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,OAAO,KAAM,CAAC,MAAM,KAAK,CAAC;AAC1B,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;IAChC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE;IAC3B,SAAS,EAAE,CAAC,CAAC,KAAK,EAAE;IACpB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,sCAAsC,CAAC;CAC7E,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;IAChC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE;IAC3B,SAAS,EAAE,CAAC,CAAC,KAAK,EAAE;IACpB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,sCAAsC,CAAC;CAC7E,CAAC,CAAA;AACF,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC;IACpC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;CACtB,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC;IACpC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;CACjB,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/B,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,SAAS,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;CAEpC,CAAC,CAAA"}
package/package.json ADDED
@@ -0,0 +1,16 @@
1
+ {
2
+ "name": "@morpheus.live/medium-common",
3
+ "version": "1.0.0",
4
+ "description": "",
5
+ "main": "dist/index.js",
6
+ "type": "module",
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/src/index.ts ADDED
@@ -0,0 +1,36 @@
1
+ // zod validation schemas and types are here
2
+ import * as z from "zod";
3
+ export const signupInput = z.object({
4
+ username: z.string().trim(),
5
+ useremail: z.email(),
6
+ password: z.string().trim().min(6, "Password must contains 6 characters.")
7
+ })
8
+
9
+ export const signinInput = z.object({
10
+ username: z.string().trim(),
11
+ useremail: z.email(),
12
+ password: z.string().trim().min(6, "Password must contains 6 characters.")
13
+ })
14
+ export const createBlogInput = z.object({
15
+ title: z.string(),
16
+ content: z.string()
17
+ })
18
+
19
+ export const uploadBlogInput = z.object({
20
+ title: z.string(),
21
+ content: z.string(),
22
+ id: z.string()
23
+ })
24
+
25
+ export const postSchema = z.object({
26
+ title: z.string(),
27
+ content: z.string(),
28
+ published: z.boolean().optional()
29
+
30
+ })
31
+
32
+ // zod infer -> used in our frontend
33
+ export type SigninInput = z.infer<typeof signinInput>
34
+ export type CreateBlogInput = z.infer<typeof createBlogInput>
35
+ export type SignupInput = z.infer<typeof signupInput>
36
+ export type UploadBlogInput = z.infer<typeof uploadBlogInput>
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.2"}