@jlandis1/guessphrase-shared 1.0.21 → 1.0.23
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 +0 -1
- package/dist/src/auth.js +1 -1
- package/dist/src/phrase.d.ts +5 -5
- package/dist/src/phrase.js +7 -5
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/dist/src/date.d.ts +0 -4
- package/dist/src/date.js +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export type { ZodTypeAny } from 'zod';
|
|
2
2
|
export { usernameSchema, registerSchema, loginSchema, tokenSchema, emailSchema, resetPasswordSchema } from './src/auth.js';
|
|
3
3
|
export type { TUsernameSchema, TRegisterSchema, TLoginSchema, TTokenSchema, TEmailSchema, TResetPasswordSchema } from './src/auth.js';
|
|
4
|
-
export type { TDateData } from './src/date.js';
|
|
5
4
|
export { dateSchema, dateUserSchema, phraseIdSchema, submitPhraseAttemptSchema, createPhraseSchema, updatePhraseSchema, globalPhraseSchema, userPhraseSchema, wordsSchema } from './src/phrase.js';
|
|
6
5
|
export type { TDateSchema, TDateUserSchema, TPhraseIdSchema, TSubmitPhraseAttemptSchema, TCreatePhraseSchema, TUpdatePhraseSchema, TGlobalPhraseSchema, TUserPhraseSchema, TWordsSchema } from './src/phrase.js';
|
package/dist/src/auth.js
CHANGED
|
@@ -3,7 +3,7 @@ export const username = z.string().min(1, 'Username is required').max(30, 'Usern
|
|
|
3
3
|
const email = z
|
|
4
4
|
.string()
|
|
5
5
|
.email('Email is invalid')
|
|
6
|
-
.max(
|
|
6
|
+
.max(254, 'Email cannot be more than 254 characters')
|
|
7
7
|
.transform((val) => val.toLowerCase());
|
|
8
8
|
const password = z
|
|
9
9
|
.string()
|
package/dist/src/phrase.d.ts
CHANGED
|
@@ -28,7 +28,7 @@ export declare const phraseIdSchema: z.ZodObject<{
|
|
|
28
28
|
export type TPhraseIdSchema = z.infer<typeof phraseIdSchema>;
|
|
29
29
|
export declare const submitPhraseAttemptSchema: z.ZodObject<{
|
|
30
30
|
phrase_id: z.ZodNumber;
|
|
31
|
-
phrase: z.ZodString
|
|
31
|
+
phrase: z.ZodEffects<z.ZodString, string, string>;
|
|
32
32
|
}, "strip", z.ZodTypeAny, {
|
|
33
33
|
phrase_id: number;
|
|
34
34
|
phrase: string;
|
|
@@ -38,7 +38,7 @@ export declare const submitPhraseAttemptSchema: z.ZodObject<{
|
|
|
38
38
|
}>;
|
|
39
39
|
export type TSubmitPhraseAttemptSchema = z.infer<typeof submitPhraseAttemptSchema>;
|
|
40
40
|
export declare const createPhraseSchema: z.ZodObject<{
|
|
41
|
-
phrase: z.ZodString
|
|
41
|
+
phrase: z.ZodEffects<z.ZodString, string, string>;
|
|
42
42
|
hint: z.ZodNullable<z.ZodString>;
|
|
43
43
|
date: z.ZodString;
|
|
44
44
|
to_user: z.ZodString;
|
|
@@ -56,7 +56,7 @@ export declare const createPhraseSchema: z.ZodObject<{
|
|
|
56
56
|
export type TCreatePhraseSchema = z.infer<typeof createPhraseSchema>;
|
|
57
57
|
export declare const updatePhraseSchema: z.ZodObject<{
|
|
58
58
|
phrase_id: z.ZodNumber;
|
|
59
|
-
phrase: z.ZodString
|
|
59
|
+
phrase: z.ZodEffects<z.ZodString, string, string>;
|
|
60
60
|
hint: z.ZodNullable<z.ZodString>;
|
|
61
61
|
}, "strip", z.ZodTypeAny, {
|
|
62
62
|
phrase_id: number;
|
|
@@ -70,7 +70,7 @@ export declare const updatePhraseSchema: z.ZodObject<{
|
|
|
70
70
|
export type TUpdatePhraseSchema = z.infer<typeof updatePhraseSchema>;
|
|
71
71
|
export declare const globalPhraseSchema: z.ZodObject<{
|
|
72
72
|
phrase_id: z.ZodNumber;
|
|
73
|
-
phrase: z.ZodString
|
|
73
|
+
phrase: z.ZodEffects<z.ZodString, string, string>;
|
|
74
74
|
hint: z.ZodNullable<z.ZodString>;
|
|
75
75
|
date: z.ZodString;
|
|
76
76
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -87,7 +87,7 @@ export declare const globalPhraseSchema: z.ZodObject<{
|
|
|
87
87
|
export type TGlobalPhraseSchema = z.infer<typeof globalPhraseSchema>;
|
|
88
88
|
export declare const userPhraseSchema: z.ZodObject<{
|
|
89
89
|
phrase_id: z.ZodNumber;
|
|
90
|
-
phrase: z.ZodString
|
|
90
|
+
phrase: z.ZodEffects<z.ZodString, string, string>;
|
|
91
91
|
hint: z.ZodNullable<z.ZodString>;
|
|
92
92
|
date: z.ZodString;
|
|
93
93
|
from_user: z.ZodString;
|
package/dist/src/phrase.js
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { username } from './auth.js';
|
|
3
3
|
const phrase_id = z.coerce.number();
|
|
4
|
-
const phrase = z
|
|
5
|
-
|
|
4
|
+
const phrase = z
|
|
5
|
+
.string()
|
|
6
|
+
.min(1, 'Phrase is required')
|
|
7
|
+
.max(150, 'Phrase cannot be more than 150 characters')
|
|
8
|
+
.transform((val) => val.toLowerCase());
|
|
9
|
+
const hint = z.string().max(50, 'Hint cannot be more than 50 characters').nullable();
|
|
6
10
|
const date = z.string().regex(/^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/, {
|
|
7
11
|
message: 'Date must be in format YYYY-MM-DD'
|
|
8
12
|
});
|
|
9
|
-
const words = z
|
|
10
|
-
.array(z.string().min(1, 'Word cannot be empty').max(31, 'Word cannot be more than 31 characters'))
|
|
11
|
-
.min(1, 'At least one word is required');
|
|
13
|
+
const words = z.array(z.string().min(1, 'Word cannot be empty')).min(1, 'At least one word is required');
|
|
12
14
|
// ----------------------------------------------------------------------
|
|
13
15
|
export const dateSchema = z.object({
|
|
14
16
|
date: date
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"root":["../index.ts","../src/auth.ts","../src/
|
|
1
|
+
{"root":["../index.ts","../src/auth.ts","../src/phrase.ts"],"version":"5.9.2"}
|
package/package.json
CHANGED
package/dist/src/date.d.ts
DELETED
package/dist/src/date.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|