@jlandis1/guessphrase-shared 1.0.8 → 1.0.10
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 +3 -1
- package/dist/src/phrase.d.ts +24 -0
- package/dist/src/phrase.js +11 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import { ZodTypeAny } from 'zod';
|
|
2
|
-
|
|
2
|
+
import { TRegisterSchema, TLoginSchema } from './src/auth.js';
|
|
3
|
+
export { registerSchema, loginSchema } from './src/auth.js';
|
|
3
4
|
export type { ZodTypeAny };
|
|
5
|
+
export type { TRegisterSchema, TLoginSchema };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const phraseSchema: z.ZodObject<{
|
|
3
|
+
phrase_id: z.ZodNumber;
|
|
4
|
+
phrase: z.ZodString;
|
|
5
|
+
hint: z.ZodNullable<z.ZodString>;
|
|
6
|
+
date: z.ZodString;
|
|
7
|
+
from_user: z.ZodNullable<z.ZodString>;
|
|
8
|
+
to_user: z.ZodNullable<z.ZodString>;
|
|
9
|
+
}, "strip", z.ZodTypeAny, {
|
|
10
|
+
phrase_id: number;
|
|
11
|
+
phrase: string;
|
|
12
|
+
hint: string | null;
|
|
13
|
+
date: string;
|
|
14
|
+
from_user: string | null;
|
|
15
|
+
to_user: string | null;
|
|
16
|
+
}, {
|
|
17
|
+
phrase_id: number;
|
|
18
|
+
phrase: string;
|
|
19
|
+
hint: string | null;
|
|
20
|
+
date: string;
|
|
21
|
+
from_user: string | null;
|
|
22
|
+
to_user: string | null;
|
|
23
|
+
}>;
|
|
24
|
+
export type TPhraseObject = z.infer<typeof phraseSchema>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const phraseSchema = z.object({
|
|
3
|
+
phrase_id: z.number(),
|
|
4
|
+
phrase: z.string().min(1, 'Phrase is required').max(255, 'Phrase cannot be more than 255 characters'),
|
|
5
|
+
hint: z.string().max(255, 'Hint cannot be more than 255 characters').nullable(),
|
|
6
|
+
date: z.string().regex(/^([1-9]|1[0-2])-([1-9]|[12]\d|3[01])-\d{4}$/, {
|
|
7
|
+
message: "Date must be in format m-d-yyyy",
|
|
8
|
+
}),
|
|
9
|
+
from_user: z.string().nullable(),
|
|
10
|
+
to_user: z.string().nullable(),
|
|
11
|
+
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"root":["../index.ts","../src/auth.ts"],"version":"5.9.2"}
|
|
1
|
+
{"root":["../index.ts","../src/auth.ts","../src/phrase.ts"],"version":"5.9.2"}
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jlandis1/guessphrase-shared",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "Shared library between Frontend and Backend for GuessPhrase",
|
|
3
|
+
"version": "1.0.10",
|
|
5
4
|
"type": "module",
|
|
5
|
+
"description": "Shared library between Frontend and Backend for GuessPhrase",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
8
8
|
"files": [
|