@plyaz/types 1.24.0 → 1.25.1

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.
@@ -51,24 +51,60 @@ export declare const USER_STATUS: {
51
51
  readonly Banned: "banned";
52
52
  };
53
53
  /**
54
- * Enum representing the supported authentication providers for user login.
55
- * @description Auth Providers allowed such as Email, Wallet, etc.
54
+ * Enum representing the primary authentication provider technology stack.
55
+ * @description Defines the system used to manage user identities and issue tokens.
56
56
  *
57
- * @example
58
- * ```typescript
59
- * import { AUTH_PROVIDER } from '@plyaz/types';
60
- *
61
- * const provider = AUTH_PROVIDER.Wallet; // 'wallet'
62
- * const isWeb3Auth = provider === AUTH_PROVIDER.Wallet;
63
- * ```
57
+ * @enum {string}
64
58
  */
65
- export declare const AUTH_PROVIDER: {
66
- /** Authentication via email and password. */
67
- readonly Email: "email";
68
- /** Authentication via connected blockchain wallet. */
69
- readonly Wallet: "wallet";
70
- };
71
59
  export declare enum AUTH_PROVIDER_TYPE {
60
+ /** Uses Clerk for external authentication and Supabase for internal RLS/DB sync. */
72
61
  ClerkSupabase = "CLERK_SUPABASE",
62
+ /** Uses an internal database for managing credentials (typically for B2B/Backoffice). */
73
63
  InternalDb = "INTERNAL_DB"
74
64
  }
65
+ /**
66
+ * Authentication provider types.
67
+ * @description Defines the specific login method or external identity provider used by the user.
68
+ *
69
+ * @enum {string}
70
+ */
71
+ export declare enum AUTH_PROVIDER {
72
+ /** Email/password authentication. */
73
+ EMAIL = "EMAIL",
74
+ /** Clerk authentication. */
75
+ CLERK = "CLERK",
76
+ /** Google OAuth. */
77
+ GOOGLE = "GOOGLE",
78
+ /** Facebook OAuth. */
79
+ FACEBOOK = "FACEBOOK",
80
+ /** Apple Sign In. */
81
+ APPLE = "APPLE",
82
+ /** Web3 wallet authentication (e.g., MetaMask). */
83
+ WEB3 = "WEB3"
84
+ }
85
+ /**
86
+ * User role assignment status.
87
+ * @description Defines the state of a user's relationship with a specific role.
88
+ *
89
+ * @enum {string}
90
+ */
91
+ export declare enum USER_ROLE_STATUS {
92
+ /** Role is active and grants associated permissions. */
93
+ ACTIVE = "ACTIVE",
94
+ /** Role is inactive (temporarily disabled or superseded by a primary role). */
95
+ INACTIVE = "INACTIVE",
96
+ /** Role is suspended (often due to user policy violation, preventing role-specific access). */
97
+ SUSPENDED = "SUSPENDED"
98
+ }
99
+ /**
100
+ * Token type for authentication.
101
+ * @description Defines the schema or standard used by the authentication token.
102
+ *
103
+ * @enum {string}
104
+ */
105
+ export declare enum TOKEN_TYPE {
106
+ /** Bearer token standard, commonly used for OAuth 2.0. */
107
+ BEARER = "Bearer",
108
+ /** JSON Web Token standard. */
109
+ JWT = "JWT"
110
+ }
@@ -33,17 +33,31 @@ var USER_STATUS = {
33
33
  /** User has been permanently banned from the platform. */
34
34
  Banned: "banned"
35
35
  };
36
- var AUTH_PROVIDER = {
37
- /** Authentication via email and password. */
38
- Email: "email",
39
- /** Authentication via connected blockchain wallet. */
40
- Wallet: "wallet"
41
- };
42
36
  var AUTH_PROVIDER_TYPE = /* @__PURE__ */ ((AUTH_PROVIDER_TYPE2) => {
43
37
  AUTH_PROVIDER_TYPE2["ClerkSupabase"] = "CLERK_SUPABASE";
44
38
  AUTH_PROVIDER_TYPE2["InternalDb"] = "INTERNAL_DB";
45
39
  return AUTH_PROVIDER_TYPE2;
46
40
  })(AUTH_PROVIDER_TYPE || {});
41
+ var AUTH_PROVIDER = /* @__PURE__ */ ((AUTH_PROVIDER2) => {
42
+ AUTH_PROVIDER2["EMAIL"] = "EMAIL";
43
+ AUTH_PROVIDER2["CLERK"] = "CLERK";
44
+ AUTH_PROVIDER2["GOOGLE"] = "GOOGLE";
45
+ AUTH_PROVIDER2["FACEBOOK"] = "FACEBOOK";
46
+ AUTH_PROVIDER2["APPLE"] = "APPLE";
47
+ AUTH_PROVIDER2["WEB3"] = "WEB3";
48
+ return AUTH_PROVIDER2;
49
+ })(AUTH_PROVIDER || {});
50
+ var USER_ROLE_STATUS = /* @__PURE__ */ ((USER_ROLE_STATUS2) => {
51
+ USER_ROLE_STATUS2["ACTIVE"] = "ACTIVE";
52
+ USER_ROLE_STATUS2["INACTIVE"] = "INACTIVE";
53
+ USER_ROLE_STATUS2["SUSPENDED"] = "SUSPENDED";
54
+ return USER_ROLE_STATUS2;
55
+ })(USER_ROLE_STATUS || {});
56
+ var TOKEN_TYPE = /* @__PURE__ */ ((TOKEN_TYPE2) => {
57
+ TOKEN_TYPE2["BEARER"] = "Bearer";
58
+ TOKEN_TYPE2["JWT"] = "JWT";
59
+ return TOKEN_TYPE2;
60
+ })(TOKEN_TYPE || {});
47
61
  var DEFAULT_PASSWORD = 8;
48
62
  var ContactUsFormSchema = zod.z.object({
49
63
  name: zod.z.string({ error: "errors.form.missingField" }).min(1, "errors.form.nameMissing"),
@@ -59,7 +73,9 @@ exports.AUTH_PROVIDER = AUTH_PROVIDER;
59
73
  exports.AUTH_PROVIDER_TYPE = AUTH_PROVIDER_TYPE;
60
74
  exports.ContactUsFormSchema = ContactUsFormSchema;
61
75
  exports.SignupFormSchema = SignupFormSchema;
76
+ exports.TOKEN_TYPE = TOKEN_TYPE;
62
77
  exports.USER_ROLE = USER_ROLE;
78
+ exports.USER_ROLE_STATUS = USER_ROLE_STATUS;
63
79
  exports.USER_STATUS = USER_STATUS;
64
80
  //# sourceMappingURL=index.cjs.map
65
81
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/auth/enums.ts","../../src/auth/schemas.ts"],"names":["AUTH_PROVIDER_TYPE","z"],"mappings":";;;;;;;AAYO,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;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/**\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 * Enum representing the supported authentication providers for user login.\n * @description Auth Providers allowed such as Email, Wallet, etc.\n *\n * @example\n * ```typescript\n * import { AUTH_PROVIDER } from '@plyaz/types';\n *\n * const provider = AUTH_PROVIDER.Wallet; // 'wallet'\n * const isWeb3Auth = provider === AUTH_PROVIDER.Wallet;\n * ```\n */\nexport const AUTH_PROVIDER = {\n /** Authentication via email and password. */\n Email: 'email',\n\n /** Authentication via connected blockchain wallet. */\n Wallet: 'wallet',\n} as const;\n\nexport enum AUTH_PROVIDER_TYPE {\n ClerkSupabase = 'CLERK_SUPABASE',\n InternalDb = 'INTERNAL_DB',\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"]}
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;AA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ACtF,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}","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"]}
@@ -31,17 +31,31 @@ var USER_STATUS = {
31
31
  /** User has been permanently banned from the platform. */
32
32
  Banned: "banned"
33
33
  };
34
- var AUTH_PROVIDER = {
35
- /** Authentication via email and password. */
36
- Email: "email",
37
- /** Authentication via connected blockchain wallet. */
38
- Wallet: "wallet"
39
- };
40
34
  var AUTH_PROVIDER_TYPE = /* @__PURE__ */ ((AUTH_PROVIDER_TYPE2) => {
41
35
  AUTH_PROVIDER_TYPE2["ClerkSupabase"] = "CLERK_SUPABASE";
42
36
  AUTH_PROVIDER_TYPE2["InternalDb"] = "INTERNAL_DB";
43
37
  return AUTH_PROVIDER_TYPE2;
44
38
  })(AUTH_PROVIDER_TYPE || {});
39
+ var AUTH_PROVIDER = /* @__PURE__ */ ((AUTH_PROVIDER2) => {
40
+ AUTH_PROVIDER2["EMAIL"] = "EMAIL";
41
+ AUTH_PROVIDER2["CLERK"] = "CLERK";
42
+ AUTH_PROVIDER2["GOOGLE"] = "GOOGLE";
43
+ AUTH_PROVIDER2["FACEBOOK"] = "FACEBOOK";
44
+ AUTH_PROVIDER2["APPLE"] = "APPLE";
45
+ AUTH_PROVIDER2["WEB3"] = "WEB3";
46
+ return AUTH_PROVIDER2;
47
+ })(AUTH_PROVIDER || {});
48
+ var USER_ROLE_STATUS = /* @__PURE__ */ ((USER_ROLE_STATUS2) => {
49
+ USER_ROLE_STATUS2["ACTIVE"] = "ACTIVE";
50
+ USER_ROLE_STATUS2["INACTIVE"] = "INACTIVE";
51
+ USER_ROLE_STATUS2["SUSPENDED"] = "SUSPENDED";
52
+ return USER_ROLE_STATUS2;
53
+ })(USER_ROLE_STATUS || {});
54
+ var TOKEN_TYPE = /* @__PURE__ */ ((TOKEN_TYPE2) => {
55
+ TOKEN_TYPE2["BEARER"] = "Bearer";
56
+ TOKEN_TYPE2["JWT"] = "JWT";
57
+ return TOKEN_TYPE2;
58
+ })(TOKEN_TYPE || {});
45
59
  var DEFAULT_PASSWORD = 8;
46
60
  var ContactUsFormSchema = z.object({
47
61
  name: z.string({ error: "errors.form.missingField" }).min(1, "errors.form.nameMissing"),
@@ -53,6 +67,6 @@ var SignupFormSchema = z.object({
53
67
  password: z.string({ error: "errors.form.missingField" }).min(DEFAULT_PASSWORD, "errors.form.passwordTooShort")
54
68
  });
55
69
 
56
- export { AUTH_PROVIDER, AUTH_PROVIDER_TYPE, ContactUsFormSchema, SignupFormSchema, USER_ROLE, USER_STATUS };
70
+ export { AUTH_PROVIDER, AUTH_PROVIDER_TYPE, ContactUsFormSchema, SignupFormSchema, TOKEN_TYPE, USER_ROLE, USER_ROLE_STATUS, USER_STATUS };
57
71
  //# sourceMappingURL=index.js.map
58
72
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/auth/enums.ts","../../src/auth/schemas.ts"],"names":["AUTH_PROVIDER_TYPE"],"mappings":";;;;;AAYO,IAAM,SAAA,GAAY;AAAA;AAAA,EAEvB,OAAA,EAAS,SAAA;AAAA;AAAA,EAGT,KAAA,EAAO,OAAA;AA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AU,CAAA,CACP,MAAA,CAAO,EAAE,KAAA,EAAO,4BAA4B,CAAA,CAC5C,GAAA,CAAI,gBAAA,EAAkB,8BAA8B;AACzD,CAAC","file":"index.js","sourcesContent":["/**\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 * Enum representing the supported authentication providers for user login.\n * @description Auth Providers allowed such as Email, Wallet, etc.\n *\n * @example\n * ```typescript\n * import { AUTH_PROVIDER } from '@plyaz/types';\n *\n * const provider = AUTH_PROVIDER.Wallet; // 'wallet'\n * const isWeb3Auth = provider === AUTH_PROVIDER.Wallet;\n * ```\n */\nexport const AUTH_PROVIDER = {\n /** Authentication via email and password. */\n Email: 'email',\n\n /** Authentication via connected blockchain wallet. */\n Wallet: 'wallet',\n} as const;\n\nexport enum AUTH_PROVIDER_TYPE {\n ClerkSupabase = 'CLERK_SUPABASE',\n InternalDb = 'INTERNAL_DB',\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"]}
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,EAA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1C,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}","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"]}