- Remove validation wrapper functions from common/validation.ts (use Zod schemas directly) - Delete duplicate CheckoutItem/CheckoutTotals/CheckoutCart/OrderCreateResponse from orders/contract.ts - Delete empty orders/checkout.ts - Remove unused MIGRATION_STEPS/MIGRATION_TRANSFER_ITEMS UI constants from auth/forms.ts - Standardize checkout/contract.ts to not re-export schema types - Fix customer/providers/index.ts to not re-export contract types through providers barrel
126 lines
3.0 KiB
TypeScript
126 lines
3.0 KiB
TypeScript
/**
|
|
* Auth Domain
|
|
*
|
|
* Contains ONLY authentication mechanisms:
|
|
* - Login, Signup, Password Management
|
|
* - Token Management (JWT)
|
|
* - MFA, SSO
|
|
*
|
|
* User entity types are in customer domain (@customer-portal/domain/customer)
|
|
*/
|
|
|
|
// ============================================================================
|
|
// Constants & Contract Types
|
|
// ============================================================================
|
|
|
|
export {
|
|
AUTH_ERROR_CODE,
|
|
TOKEN_TYPE,
|
|
GENDER,
|
|
PASSWORD_RESET_CONFIG,
|
|
OTP_CONFIG,
|
|
type AuthErrorCode,
|
|
type TokenTypeValue,
|
|
type GenderValue,
|
|
} from "./contract.js";
|
|
|
|
export type {
|
|
// Request types
|
|
LoginRequest,
|
|
SignupRequest,
|
|
PasswordResetRequest,
|
|
ResetPasswordRequest,
|
|
SetPasswordRequest,
|
|
ChangePasswordRequest,
|
|
LinkWhmcsRequest,
|
|
ValidateSignupRequest,
|
|
UpdateCustomerProfileRequest,
|
|
AccountStatusRequest,
|
|
SsoLinkRequest,
|
|
CheckPasswordNeededRequest,
|
|
RefreshTokenRequest,
|
|
LoginVerifyOtpRequest,
|
|
// Token types
|
|
AuthTokens,
|
|
AuthSession,
|
|
PasswordResetTokenPayload,
|
|
// Response types
|
|
AuthResponse,
|
|
SignupResult,
|
|
PasswordChangeResult,
|
|
SsoLinkResponse,
|
|
CheckPasswordNeededResponse,
|
|
LinkWhmcsResponse,
|
|
LoginOtpRequiredResponse,
|
|
LoginResponse,
|
|
// Error types
|
|
AuthError,
|
|
} from "./contract.js";
|
|
|
|
// ============================================================================
|
|
// Schemas (for validation)
|
|
// ============================================================================
|
|
|
|
export {
|
|
// Request schemas
|
|
loginRequestSchema,
|
|
signupInputSchema,
|
|
signupRequestSchema,
|
|
passwordResetRequestSchema,
|
|
passwordResetSchema,
|
|
setPasswordRequestSchema,
|
|
changePasswordRequestSchema,
|
|
linkWhmcsRequestSchema,
|
|
validateSignupRequestSchema,
|
|
updateCustomerProfileRequestSchema,
|
|
updateProfileRequestSchema,
|
|
updateAddressRequestSchema,
|
|
accountStatusRequestSchema,
|
|
ssoLinkRequestSchema,
|
|
checkPasswordNeededRequestSchema,
|
|
refreshTokenRequestSchema,
|
|
loginVerifyOtpRequestSchema,
|
|
|
|
// Token schemas
|
|
authTokensSchema,
|
|
authSessionSchema,
|
|
passwordResetTokenPayloadSchema,
|
|
|
|
// Response schemas
|
|
authResponseSchema,
|
|
signupResultSchema,
|
|
passwordChangeResultSchema,
|
|
ssoLinkResponseSchema,
|
|
checkPasswordNeededResponseSchema,
|
|
linkWhmcsResponseSchema,
|
|
loginOtpRequiredResponseSchema,
|
|
loginResponseSchema,
|
|
} from "./schema.js";
|
|
|
|
export { buildSignupRequest } from "./helpers.js";
|
|
|
|
// ============================================================================
|
|
// Password Utilities
|
|
// ============================================================================
|
|
|
|
export {
|
|
PASSWORD_REQUIREMENTS,
|
|
checkPasswordStrength,
|
|
getPasswordStrengthDisplay,
|
|
type PasswordRequirementKey,
|
|
} from "./forms.js";
|
|
|
|
// ============================================================================
|
|
// RBAC Permissions
|
|
// ============================================================================
|
|
|
|
export {
|
|
PERMISSIONS,
|
|
ROLE_PERMISSIONS,
|
|
hasPermission,
|
|
hasAnyPermission,
|
|
hasAllPermissions,
|
|
getPermissionsForRole,
|
|
type Permission,
|
|
} from "./permissions.js";
|