@plyaz/types 1.25.1 → 1.25.2
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/auth/index.cjs.map +1 -1
- package/dist/auth/index.js.map +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/payments/gateways/provider/fee/types.d.ts +56 -0
- package/dist/payments/gateways/provider/types.d.ts +87 -1
- package/dist/payments/provider/adapter/types.d.ts +3 -2
- package/dist/payments/provider/payment-provider/types.d.ts +3 -2
- package/dist/payments/transaction/types.d.ts +4 -0
- package/dist/storage/interfaces.d.ts +37 -0
- package/package.json +1 -1
package/dist/auth/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/auth/enums.ts","../../src/auth/schemas.ts"],"names":["AUTH_PROVIDER_TYPE","AUTH_PROVIDER","USER_ROLE_STATUS","TOKEN_TYPE","z"],"mappings":";;;;;;;AAgBO,IAAM,SAAA,GAAY;AAAA;AAAA,EAEvB,OAAA,EAAS,SAAA;AAAA;AAAA,EAGT,KAAA,EAAO,OAAA;AAAA;AAAA,EAGP,KAAA,EAAO,OAAA;AAAA;AAAA,EAGP,IAAA,EAAM,MAAA;AAAA;AAAA,EAGN,GAAA,EAAK,KAAA;AAAA;AAAA,EAGL,KAAA,EAAO,OAAA;AAAA;AAAA,EAGP,UAAA,EAAY;AACd;AAcO,IAAM,WAAA,GAAc;AAAA;AAAA,EAEzB,MAAA,EAAQ,QAAA;AAAA;AAAA,EAGR,QAAA,EAAU,UAAA;AAAA;AAAA,EAGV,OAAA,EAAS,SAAA;AAAA;AAAA,EAGT,SAAA,EAAW,WAAA;AAAA;AAAA,EAGX,MAAA,EAAQ;AACV;AAYO,IAAK,kBAAA,qBAAAA,mBAAAA,KAAL;AAEL,EAAAA,oBAAA,eAAA,CAAA,GAAgB,gBAAA;AAEhB,EAAAA,oBAAA,YAAA,CAAA,GAAa,aAAA;AAJ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AO,EAAE,KAAA,EAAO,4BAA4B,CAAA,CAAE,GAAA,CAAI,CAAA,EAAG,yBAAyB,CAAA;AAAA,EACtF,OAAOA,KAAA,CAAE,KAAA,CAAM,EAAE,KAAA,EAAO,4BAA4B,CAAA;AAAA,EACpD,QAAA,EAAUA,KAAA,CACP,MAAA,CAAO,EAAE,KAAA,EAAO,4BAA4B,CAAA,CAC5C,GAAA,CAAI,gBAAA,EAAkB,8BAA8B;AACzD,CAAC","file":"index.cjs","sourcesContent":["// ============================================\n// USER DEFINITION ENUMS\n// ============================================\n\n/**\n * Enum representing the different roles a user can have within the system.\n * @description Roles are used to determine access levels, permissions, and user-specific experiences.\n *\n * @example\n * ```typescript\n * import { USER_ROLE } from '@plyaz/types';\n *\n * const userRole = USER_ROLE.Athlete; // 'athlete'\n * const isAdmin = userRole === USER_ROLE.Admin || userRole === USER_ROLE.SuperAdmin;\n * ```\n */\nexport const USER_ROLE = {\n /** A user who is an athlete and participates in sports activities. */\n Athlete: 'athlete',\n\n /** A user who scouts and discovers talent. */\n Scout: 'scout',\n\n /** A user who acts as an agent representing athletes or clubs. */\n Agent: 'agent',\n\n /** A user representing a sports club or organization. */\n Club: 'club',\n\n /** A fan or supporter of athletes or clubs. */\n Fan: 'fan',\n\n /** A system administrator with access to management tools. */\n Admin: 'admin',\n\n /** A super admin with the highest level of access and control. */\n SuperAdmin: 'super.admin',\n} as const;\n\n/**\n * Enum representing the current status of a user account.\n * @description Statuses are used to determine login availability, visibility, and user flow.\n *\n * @example\n * ```typescript\n * import { USER_STATUS } from '@plyaz/types';\n *\n * const isAccessible = status === USER_STATUS.Active;\n * const needsReview = status === USER_STATUS.Pending;\n * ```\n */\nexport const USER_STATUS = {\n /** Active user with full access. */\n Active: 'active',\n\n /** Inactive user, typically not currently using the platform. */\n Inactive: 'inactive',\n\n /** User account is awaiting approval or completion of setup. */\n Pending: 'pending',\n\n /** User has been temporarily suspended due to policy violations or manual review. */\n Suspended: 'suspended',\n\n /** User has been permanently banned from the platform. */\n Banned: 'banned',\n} as const;\n\n// ============================================\n// AUTHENTICATION PROVIDER ENUMS\n// ============================================\n\n/**\n * Enum representing the primary authentication provider technology stack.\n * @description Defines the system used to manage user identities and issue tokens.\n *\n * @enum {string}\n */\nexport enum AUTH_PROVIDER_TYPE {\n /** Uses Clerk for external authentication and Supabase for internal RLS/DB sync. */\n ClerkSupabase = 'CLERK_SUPABASE',\n /** Uses an internal database for managing credentials (typically for B2B/Backoffice). */\n InternalDb = 'INTERNAL_DB',\n}\n\n/**\n * Authentication provider types.\n * @description Defines the specific login method or external identity provider used by the user.\n *\n * @enum {string}\n */\nexport enum AUTH_PROVIDER {\n /** Email/password authentication. */\n EMAIL = 'EMAIL',\n /** Clerk authentication. */\n CLERK = 'CLERK',\n /** Google OAuth. */\n GOOGLE = 'GOOGLE',\n /** Facebook OAuth. */\n FACEBOOK = 'FACEBOOK',\n /** Apple Sign In. */\n APPLE = 'APPLE',\n /** Web3 wallet authentication (e.g., MetaMask). */\n WEB3 = 'WEB3'
|
|
1
|
+
{"version":3,"sources":["../../src/auth/enums.ts","../../src/auth/schemas.ts"],"names":["AUTH_PROVIDER_TYPE","AUTH_PROVIDER","USER_ROLE_STATUS","TOKEN_TYPE","z"],"mappings":";;;;;;;AAgBO,IAAM,SAAA,GAAY;AAAA;AAAA,EAEvB,OAAA,EAAS,SAAA;AAAA;AAAA,EAGT,KAAA,EAAO,OAAA;AAAA;AAAA,EAGP,KAAA,EAAO,OAAA;AAAA;AAAA,EAGP,IAAA,EAAM,MAAA;AAAA;AAAA,EAGN,GAAA,EAAK,KAAA;AAAA;AAAA,EAGL,KAAA,EAAO,OAAA;AAAA;AAAA,EAGP,UAAA,EAAY;AACd;AAcO,IAAM,WAAA,GAAc;AAAA;AAAA,EAEzB,MAAA,EAAQ,QAAA;AAAA;AAAA,EAGR,QAAA,EAAU,UAAA;AAAA;AAAA,EAGV,OAAA,EAAS,SAAA;AAAA;AAAA,EAGT,SAAA,EAAW,WAAA;A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AAAA,EACtF,OAAOA,KAAA,CAAE,KAAA,CAAM,EAAE,KAAA,EAAO,4BAA4B;AACtD,CAAC;AAWM,IAAM,gBAAA,GAAmBA,MAAE,MAAA,CAAO;AAAA,EACvC,IAAA,EAAMA,KAAA,CAAE,MAAA,CAAO,EAAE,KAAA,EAAO,4BAA4B,CAAA,CAAE,GAAA,CAAI,CAAA,EAAG,yBAAyB,CAAA;AAAA,EACtF,OAAOA,KAAA,CAAE,KAAA,CAAM,EAAE,KAAA,EAAO,4BAA4B,CAAA;AAAA,EACpD,QAAA,EAAUA,KAAA,CACP,MAAA,CAAO,EAAE,KAAA,EAAO,4BAA4B,CAAA,CAC5C,GAAA,CAAI,gBAAA,EAAkB,8BAA8B;AACzD,CAAC","file":"index.cjs","sourcesContent":["// ============================================\n// USER DEFINITION ENUMS\n// ============================================\n\n/**\n * Enum representing the different roles a user can have within the system.\n * @description Roles are used to determine access levels, permissions, and user-specific experiences.\n *\n * @example\n * ```typescript\n * import { USER_ROLE } from '@plyaz/types';\n *\n * const userRole = USER_ROLE.Athlete; // 'athlete'\n * const isAdmin = userRole === USER_ROLE.Admin || userRole === USER_ROLE.SuperAdmin;\n * ```\n */\nexport const USER_ROLE = {\n /** A user who is an athlete and participates in sports activities. */\n Athlete: 'athlete',\n\n /** A user who scouts and discovers talent. */\n Scout: 'scout',\n\n /** A user who acts as an agent representing athletes or clubs. */\n Agent: 'agent',\n\n /** A user representing a sports club or organization. */\n Club: 'club',\n\n /** A fan or supporter of athletes or clubs. */\n Fan: 'fan',\n\n /** A system administrator with access to management tools. */\n Admin: 'admin',\n\n /** A super admin with the highest level of access and control. */\n SuperAdmin: 'super.admin',\n} as const;\n\n/**\n * Enum representing the current status of a user account.\n * @description Statuses are used to determine login availability, visibility, and user flow.\n *\n * @example\n * ```typescript\n * import { USER_STATUS } from '@plyaz/types';\n *\n * const isAccessible = status === USER_STATUS.Active;\n * const needsReview = status === USER_STATUS.Pending;\n * ```\n */\nexport const USER_STATUS = {\n /** Active user with full access. */\n Active: 'active',\n\n /** Inactive user, typically not currently using the platform. */\n Inactive: 'inactive',\n\n /** User account is awaiting approval or completion of setup. */\n Pending: 'pending',\n\n /** User has been temporarily suspended due to policy violations or manual review. */\n Suspended: 'suspended',\n\n /** User has been permanently banned from the platform. */\n Banned: 'banned',\n} as const;\n\n// ============================================\n// AUTHENTICATION PROVIDER ENUMS\n// ============================================\n\n/**\n * Enum representing the primary authentication provider technology stack.\n * @description Defines the system used to manage user identities and issue tokens.\n *\n * @enum {string}\n */\nexport enum AUTH_PROVIDER_TYPE {\n /** Uses Clerk for external authentication and Supabase for internal RLS/DB sync. */\n ClerkSupabase = 'CLERK_SUPABASE',\n /** Uses an internal database for managing credentials (typically for B2B/Backoffice). */\n InternalDb = 'INTERNAL_DB',\n}\n\n/**\n * Authentication provider types.\n * @description Defines the specific login method or external identity provider used by the user.\n *\n * @enum {string}\n */\nexport enum AUTH_PROVIDER {\n /** Email/password authentication. */\n EMAIL = 'EMAIL',\n /** Clerk authentication. */\n CLERK = 'CLERK',\n /** Google OAuth. */\n GOOGLE = 'GOOGLE',\n /** Facebook OAuth. */\n FACEBOOK = 'FACEBOOK',\n /** Apple Sign In. */\n APPLE = 'APPLE',\n /** Web3 wallet authentication (e.g., MetaMask). */\n WEB3 = 'WEB3',\n}\n\n// ============================================\n// ROLE & TOKEN ENUMS\n// ============================================\n\n/**\n * User role assignment status.\n * @description Defines the state of a user's relationship with a specific role.\n *\n * @enum {string}\n */\nexport enum USER_ROLE_STATUS {\n /** Role is active and grants associated permissions. */\n ACTIVE = 'ACTIVE',\n /** Role is inactive (temporarily disabled or superseded by a primary role). */\n INACTIVE = 'INACTIVE',\n /** Role is suspended (often due to user policy violation, preventing role-specific access). */\n SUSPENDED = 'SUSPENDED',\n}\n\n/**\n * Token type for authentication.\n * @description Defines the schema or standard used by the authentication token.\n *\n * @enum {string}\n */\nexport enum TOKEN_TYPE {\n /** Bearer token standard, commonly used for OAuth 2.0. */\n BEARER = 'Bearer',\n /** JSON Web Token standard. */\n JWT = 'JWT',\n}\n","import { z } from 'zod';\n\n/**\n * Password minimum character length\n */\nconst DEFAULT_PASSWORD = 8;\n\n/**\n * Contact Us Form Schema\n * Validates contact form submissions\n */\nexport const ContactUsFormSchema = z.object({\n name: z.string({ error: 'errors.form.missingField' }).min(1, 'errors.form.nameMissing'),\n email: z.email({ error: 'errors.form.emailInvalid' }),\n});\n\n/**\n * Contact Us Form Type\n */\nexport type ContactUsForm = z.infer<typeof ContactUsFormSchema>;\n\n/**\n * Signup Form Schema\n * Validates user registration form submissions\n */\nexport const SignupFormSchema = z.object({\n name: z.string({ error: 'errors.form.missingField' }).min(1, 'errors.form.nameMissing'),\n email: z.email({ error: 'errors.form.emailInvalid' }),\n password: z\n .string({ error: 'errors.form.missingField' })\n .min(DEFAULT_PASSWORD, 'errors.form.passwordTooShort'),\n});\n\n/**\n * Signup Form Type\n */\nexport type SignupForm = z.infer<typeof SignupFormSchema>;\n"]}
|
package/dist/auth/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/auth/enums.ts","../../src/auth/schemas.ts"],"names":["AUTH_PROVIDER_TYPE","AUTH_PROVIDER","USER_ROLE_STATUS","TOKEN_TYPE"],"mappings":";;;;;AAgBO,IAAM,SAAA,GAAY;AAAA;AAAA,EAEvB,OAAA,EAAS,SAAA;AAAA;AAAA,EAGT,KAAA,EAAO,OAAA;AAAA;AAAA,EAGP,KAAA,EAAO,OAAA;AAAA;AAAA,EAGP,IAAA,EAAM,MAAA;AAAA;AAAA,EAGN,GAAA,EAAK,KAAA;AAAA;AAAA,EAGL,KAAA,EAAO,OAAA;AAAA;AAAA,EAGP,UAAA,EAAY;AACd;AAcO,IAAM,WAAA,GAAc;AAAA;AAAA,EAEzB,MAAA,EAAQ,QAAA;AAAA;AAAA,EAGR,QAAA,EAAU,UAAA;AAAA;AAAA,EAGV,OAAA,EAAS,SAAA;AAAA;AAAA,EAGT,SAAA,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AyB,CAAA;AAAA,EACtF,OAAO,CAAA,CAAE,KAAA,CAAM,EAAE,KAAA,EAAO,4BAA4B;AACtD,CAAC;AAWM,IAAM,gBAAA,GAAmB,EAAE,MAAA,CAAO;AAAA,EACvC,IAAA,EAAM,CAAA,CAAE,MAAA,CAAO,EAAE,KAAA,EAAO,4BAA4B,CAAA,CAAE,GAAA,CAAI,CAAA,EAAG,yBAAyB,CAAA;AAAA,EACtF,OAAO,CAAA,CAAE,KAAA,CAAM,EAAE,KAAA,EAAO,4BAA4B,CAAA;AAAA,EACpD,QAAA,EAAU,CAAA,CACP,MAAA,CAAO,EAAE,KAAA,EAAO,4BAA4B,CAAA,CAC5C,GAAA,CAAI,gBAAA,EAAkB,8BAA8B;AACzD,CAAC","file":"index.js","sourcesContent":["// ============================================\n// USER DEFINITION ENUMS\n// ============================================\n\n/**\n * Enum representing the different roles a user can have within the system.\n * @description Roles are used to determine access levels, permissions, and user-specific experiences.\n *\n * @example\n * ```typescript\n * import { USER_ROLE } from '@plyaz/types';\n *\n * const userRole = USER_ROLE.Athlete; // 'athlete'\n * const isAdmin = userRole === USER_ROLE.Admin || userRole === USER_ROLE.SuperAdmin;\n * ```\n */\nexport const USER_ROLE = {\n /** A user who is an athlete and participates in sports activities. */\n Athlete: 'athlete',\n\n /** A user who scouts and discovers talent. */\n Scout: 'scout',\n\n /** A user who acts as an agent representing athletes or clubs. */\n Agent: 'agent',\n\n /** A user representing a sports club or organization. */\n Club: 'club',\n\n /** A fan or supporter of athletes or clubs. */\n Fan: 'fan',\n\n /** A system administrator with access to management tools. */\n Admin: 'admin',\n\n /** A super admin with the highest level of access and control. */\n SuperAdmin: 'super.admin',\n} as const;\n\n/**\n * Enum representing the current status of a user account.\n * @description Statuses are used to determine login availability, visibility, and user flow.\n *\n * @example\n * ```typescript\n * import { USER_STATUS } from '@plyaz/types';\n *\n * const isAccessible = status === USER_STATUS.Active;\n * const needsReview = status === USER_STATUS.Pending;\n * ```\n */\nexport const USER_STATUS = {\n /** Active user with full access. */\n Active: 'active',\n\n /** Inactive user, typically not currently using the platform. */\n Inactive: 'inactive',\n\n /** User account is awaiting approval or completion of setup. */\n Pending: 'pending',\n\n /** User has been temporarily suspended due to policy violations or manual review. */\n Suspended: 'suspended',\n\n /** User has been permanently banned from the platform. */\n Banned: 'banned',\n} as const;\n\n// ============================================\n// AUTHENTICATION PROVIDER ENUMS\n// ============================================\n\n/**\n * Enum representing the primary authentication provider technology stack.\n * @description Defines the system used to manage user identities and issue tokens.\n *\n * @enum {string}\n */\nexport enum AUTH_PROVIDER_TYPE {\n /** Uses Clerk for external authentication and Supabase for internal RLS/DB sync. */\n ClerkSupabase = 'CLERK_SUPABASE',\n /** Uses an internal database for managing credentials (typically for B2B/Backoffice). */\n InternalDb = 'INTERNAL_DB',\n}\n\n/**\n * Authentication provider types.\n * @description Defines the specific login method or external identity provider used by the user.\n *\n * @enum {string}\n */\nexport enum AUTH_PROVIDER {\n /** Email/password authentication. */\n EMAIL = 'EMAIL',\n /** Clerk authentication. */\n CLERK = 'CLERK',\n /** Google OAuth. */\n GOOGLE = 'GOOGLE',\n /** Facebook OAuth. */\n FACEBOOK = 'FACEBOOK',\n /** Apple Sign In. */\n APPLE = 'APPLE',\n /** Web3 wallet authentication (e.g., MetaMask). */\n WEB3 = 'WEB3'
|
|
1
|
+
{"version":3,"sources":["../../src/auth/enums.ts","../../src/auth/schemas.ts"],"names":["AUTH_PROVIDER_TYPE","AUTH_PROVIDER","USER_ROLE_STATUS","TOKEN_TYPE"],"mappings":";;;;;AAgBO,IAAM,SAAA,GAAY;AAAA;AAAA,EAEvB,OAAA,EAAS,SAAA;AAAA;AAAA,EAGT,KAAA,EAAO,OAAA;AAAA;AAAA,EAGP,KAAA,EAAO,OAAA;AAAA;AAAA,EAGP,IAAA,EAAM,MAAA;AAAA;AAAA,EAGN,GAAA,EAAK,KAAA;AAAA;AAAA,EAGL,KAAA,EAAO,OAAA;AAAA;AAAA,EAGP,UAAA,EAAY;AACd;A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lB,IAAM,mBAAA,GAAsB,EAAE,MAAA,CAAO;AAAA,EAC1C,IAAA,EAAM,CAAA,CAAE,MAAA,CAAO,EAAE,KAAA,EAAO,4BAA4B,CAAA,CAAE,GAAA,CAAI,CAAA,EAAG,yBAAyB,CAAA;AAAA,EACtF,OAAO,CAAA,CAAE,KAAA,CAAM,EAAE,KAAA,EAAO,4BAA4B;AACtD,CAAC;AAWM,IAAM,gBAAA,GAAmB,EAAE,MAAA,CAAO;AAAA,EACvC,IAAA,EAAM,CAAA,CAAE,MAAA,CAAO,EAAE,KAAA,EAAO,4BAA4B,CAAA,CAAE,GAAA,CAAI,CAAA,EAAG,yBAAyB,CAAA;AAAA,EACtF,OAAO,CAAA,CAAE,KAAA,CAAM,EAAE,KAAA,EAAO,4BAA4B,CAAA;AAAA,EACpD,QAAA,EAAU,CAAA,CACP,MAAA,CAAO,EAAE,KAAA,EAAO,4BAA4B,CAAA,CAC5C,GAAA,CAAI,gBAAA,EAAkB,8BAA8B;AACzD,CAAC","file":"index.js","sourcesContent":["// ============================================\n// USER DEFINITION ENUMS\n// ============================================\n\n/**\n * Enum representing the different roles a user can have within the system.\n * @description Roles are used to determine access levels, permissions, and user-specific experiences.\n *\n * @example\n * ```typescript\n * import { USER_ROLE } from '@plyaz/types';\n *\n * const userRole = USER_ROLE.Athlete; // 'athlete'\n * const isAdmin = userRole === USER_ROLE.Admin || userRole === USER_ROLE.SuperAdmin;\n * ```\n */\nexport const USER_ROLE = {\n /** A user who is an athlete and participates in sports activities. */\n Athlete: 'athlete',\n\n /** A user who scouts and discovers talent. */\n Scout: 'scout',\n\n /** A user who acts as an agent representing athletes or clubs. */\n Agent: 'agent',\n\n /** A user representing a sports club or organization. */\n Club: 'club',\n\n /** A fan or supporter of athletes or clubs. */\n Fan: 'fan',\n\n /** A system administrator with access to management tools. */\n Admin: 'admin',\n\n /** A super admin with the highest level of access and control. */\n SuperAdmin: 'super.admin',\n} as const;\n\n/**\n * Enum representing the current status of a user account.\n * @description Statuses are used to determine login availability, visibility, and user flow.\n *\n * @example\n * ```typescript\n * import { USER_STATUS } from '@plyaz/types';\n *\n * const isAccessible = status === USER_STATUS.Active;\n * const needsReview = status === USER_STATUS.Pending;\n * ```\n */\nexport const USER_STATUS = {\n /** Active user with full access. */\n Active: 'active',\n\n /** Inactive user, typically not currently using the platform. */\n Inactive: 'inactive',\n\n /** User account is awaiting approval or completion of setup. */\n Pending: 'pending',\n\n /** User has been temporarily suspended due to policy violations or manual review. */\n Suspended: 'suspended',\n\n /** User has been permanently banned from the platform. */\n Banned: 'banned',\n} as const;\n\n// ============================================\n// AUTHENTICATION PROVIDER ENUMS\n// ============================================\n\n/**\n * Enum representing the primary authentication provider technology stack.\n * @description Defines the system used to manage user identities and issue tokens.\n *\n * @enum {string}\n */\nexport enum AUTH_PROVIDER_TYPE {\n /** Uses Clerk for external authentication and Supabase for internal RLS/DB sync. */\n ClerkSupabase = 'CLERK_SUPABASE',\n /** Uses an internal database for managing credentials (typically for B2B/Backoffice). */\n InternalDb = 'INTERNAL_DB',\n}\n\n/**\n * Authentication provider types.\n * @description Defines the specific login method or external identity provider used by the user.\n *\n * @enum {string}\n */\nexport enum AUTH_PROVIDER {\n /** Email/password authentication. */\n EMAIL = 'EMAIL',\n /** Clerk authentication. */\n CLERK = 'CLERK',\n /** Google OAuth. */\n GOOGLE = 'GOOGLE',\n /** Facebook OAuth. */\n FACEBOOK = 'FACEBOOK',\n /** Apple Sign In. */\n APPLE = 'APPLE',\n /** Web3 wallet authentication (e.g., MetaMask). */\n WEB3 = 'WEB3',\n}\n\n// ============================================\n// ROLE & TOKEN ENUMS\n// ============================================\n\n/**\n * User role assignment status.\n * @description Defines the state of a user's relationship with a specific role.\n *\n * @enum {string}\n */\nexport enum USER_ROLE_STATUS {\n /** Role is active and grants associated permissions. */\n ACTIVE = 'ACTIVE',\n /** Role is inactive (temporarily disabled or superseded by a primary role). */\n INACTIVE = 'INACTIVE',\n /** Role is suspended (often due to user policy violation, preventing role-specific access). */\n SUSPENDED = 'SUSPENDED',\n}\n\n/**\n * Token type for authentication.\n * @description Defines the schema or standard used by the authentication token.\n *\n * @enum {string}\n */\nexport enum TOKEN_TYPE {\n /** Bearer token standard, commonly used for OAuth 2.0. */\n BEARER = 'Bearer',\n /** JSON Web Token standard. */\n JWT = 'JWT',\n}\n","import { z } from 'zod';\n\n/**\n * Password minimum character length\n */\nconst DEFAULT_PASSWORD = 8;\n\n/**\n * Contact Us Form Schema\n * Validates contact form submissions\n */\nexport const ContactUsFormSchema = z.object({\n name: z.string({ error: 'errors.form.missingField' }).min(1, 'errors.form.nameMissing'),\n email: z.email({ error: 'errors.form.emailInvalid' }),\n});\n\n/**\n * Contact Us Form Type\n */\nexport type ContactUsForm = z.infer<typeof ContactUsFormSchema>;\n\n/**\n * Signup Form Schema\n * Validates user registration form submissions\n */\nexport const SignupFormSchema = z.object({\n name: z.string({ error: 'errors.form.missingField' }).min(1, 'errors.form.nameMissing'),\n email: z.email({ error: 'errors.form.emailInvalid' }),\n password: z\n .string({ error: 'errors.form.missingField' })\n .min(DEFAULT_PASSWORD, 'errors.form.passwordTooShort'),\n});\n\n/**\n * Signup Form Type\n */\nexport type SignupForm = z.infer<typeof SignupFormSchema>;\n"]}
|