@jlandis1/guessphrase-shared 1.0.21 → 1.0.22

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 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';
@@ -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;
@@ -1,7 +1,11 @@
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.string().min(1, 'Phrase is required').max(255, 'Phrase cannot be more than 255 characters');
4
+ const phrase = z
5
+ .string()
6
+ .min(1, 'Phrase is required')
7
+ .max(255, 'Phrase cannot be more than 255 characters')
8
+ .transform((val) => val.toLowerCase());
5
9
  const hint = z.string().max(255, 'Hint cannot be more than 255 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'
@@ -1 +1 @@
1
- {"root":["../index.ts","../src/auth.ts","../src/date.ts","../src/phrase.ts"],"version":"5.9.2"}
1
+ {"root":["../index.ts","../src/auth.ts","../src/phrase.ts"],"version":"5.9.2"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jlandis1/guessphrase-shared",
3
- "version": "1.0.21",
3
+ "version": "1.0.22",
4
4
  "type": "module",
5
5
  "description": "Shared library between Frontend and Backend for GuessPhrase",
6
6
  "main": "dist/index.js",
@@ -1,4 +0,0 @@
1
- export type TDateData = {
2
- date: string;
3
- status: 'SOLVED' | 'ATTEMPTED';
4
- };
package/dist/src/date.js DELETED
@@ -1 +0,0 @@
1
- export {};