@plyaz/types 1.37.1 → 1.37.3

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.
@@ -24,3 +24,16 @@ export declare const SignupFormSchema: z.ZodObject<{
24
24
  * Signup Form Type
25
25
  */
26
26
  export type SignupForm = z.infer<typeof SignupFormSchema>;
27
+ /**
28
+ * Auth Form Schema
29
+ * Validates authentication form submissions (sign-in/sign-up)
30
+ */
31
+ export declare const AuthFormSchema: z.ZodObject<{
32
+ email: z.ZodString;
33
+ password: z.ZodString;
34
+ keepLoggedIn: z.ZodOptional<z.ZodBoolean>;
35
+ }, z.core.$strip>;
36
+ /**
37
+ * Auth Form Type
38
+ */
39
+ export type AuthForm = z.infer<typeof AuthFormSchema>;
@@ -1,6 +1,7 @@
1
1
  import type { WithExpiration, WithAuthTokens } from '../common/types';
2
2
  import type { BaseErrorContext } from '../errors';
3
3
  import type { AUTH_ERROR_DEFINITIONS, USER_ROLE_STATUS } from './enums';
4
+ import type { AuthForm } from './schemas';
4
5
  /**
5
6
  * AuthToken Interface.
6
7
  * @description Represents an authentication token set returned after a successful login or refresh.
@@ -1165,3 +1166,18 @@ export interface SessionStoreConfig {
1165
1166
  /** Key prefix for storage */
1166
1167
  keyPrefix: string;
1167
1168
  }
1169
+ /**
1170
+ * Authentication form type discriminator
1171
+ */
1172
+ export type FormType = 'sign-in' | 'sign-up';
1173
+ /**
1174
+ * Props for authentication form card component
1175
+ */
1176
+ export interface AuthFormCardProps {
1177
+ title: string;
1178
+ description: string;
1179
+ linkText: string;
1180
+ authType: FormType;
1181
+ onSubmit: (data: AuthForm) => void | Promise<void>;
1182
+ passwordPlaceholder?: string;
1183
+ }
@@ -14,8 +14,8 @@ export type FrameworkType = 'nextjs' | 'express' | 'nestjs';
14
14
  * Base configuration for framework adapters
15
15
  */
16
16
  export interface FrameworkAdapterConfig {
17
- /** Adapter name for logging */
18
- name: string;
17
+ /** Adapter name for logging (defaults to class name) */
18
+ name?: string;
19
19
  /** Whether adapter is enabled */
20
20
  enabled?: boolean;
21
21
  }
package/dist/index.cjs CHANGED
@@ -6277,6 +6277,11 @@ var SignupFormSchema = zod.z.object({
6277
6277
  email: zod.z.email({ error: "errors.form.emailInvalid" }),
6278
6278
  password: zod.z.string({ error: "errors.form.missingField" }).min(DEFAULT_PASSWORD, "errors.form.passwordTooShort")
6279
6279
  });
6280
+ var AuthFormSchema = zod.z.object({
6281
+ email: zod.z.string().email({ message: "auth.errors.emailInvalid" }),
6282
+ password: zod.z.string().min(DEFAULT_PASSWORD, { message: "auth.errors.passwordTooShort" }),
6283
+ keepLoggedIn: zod.z.boolean().optional()
6284
+ });
6280
6285
 
6281
6286
  // src/auth/types.ts
6282
6287
  var AUTH_ERROR_CODES = {
@@ -9693,6 +9698,7 @@ exports.AUTH_PROVIDER = AUTH_PROVIDER;
9693
9698
  exports.AUTH_PROVIDER_TYPE = AUTH_PROVIDER_TYPE;
9694
9699
  exports.ApiEventAction = ApiEventAction;
9695
9700
  exports.AuthEventAction = AuthEventAction;
9701
+ exports.AuthFormSchema = AuthFormSchema;
9696
9702
  exports.BACKEND_RUNTIMES = BACKEND_RUNTIMES;
9697
9703
  exports.BASIC_PROFILE_ERRORS = BASIC_PROFILE_ERRORS;
9698
9704
  exports.BUCKET_PURPOSE = BUCKET_PURPOSE;