Spaces:
Sleeping

File size: 3,868 Bytes
4e83772
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
export const USER_ERRORS = {
	NOT_FOUND: "User not found",
	ALREADY_EXISTS: "Email already exists",
	INVALID_CREDENTIALS: "Invalid email or password",
	UNAUTHORIZED: "Unauthorized access",
	ACCOUNT_LOCKED: "Account temporarily locked. Try again later",
	FORBIDDEN: "You do not have permission to perform this action",
	EMAIL_REQUIRED: "Email is required",
	EMAIL_NOT_VERIFIED: "Please verify your email before logging in",
	INVALID_TOKEN: "Invalid or expired token",
	NO_TOKEN: "Token not found",
	LOGIN_REQUIRED: "Login required",
	NOT_AUTHENTICATED: "User not authenticated",
	CALLBACK_ERROR: "Error during google callback",
	CREATION_ERROR: "Error on user sign up",
	REFRESH_TOKEN_EXPIRED: "Refresh token expired",
};

export const PROJECT_ERRORS = {
	INCOMPLETE_DATA: "Submitted data is incomplete",
	NOT_FOUND: "Project not found",
	CREATE_FAILED: "Failed to create project",
	UPDATE_FAILED: "Failed to update project",
	DELETE_FAILED: "Failed to delete project",
	LIMIT_REACHED: "Project limit reached for your account",
	IN_USE: "Cannot delete project while it has active deployments",
	PROJECT_IN_PROGRESS: "Project deployment in progress",
	SUBDOMAIN_NOT_AVAILABLE: "Subdomain not available",
	DISABLED: "Project disabled",
};

export const DEPLOYMENT_ERRORS = {
	NOT_FOUND: "Deployment not found",
	CREATE_FAILED: "Failed to create deployment",
	UPDATE_FAILED: "Failed to update deployment",
	DELETE_FAILED: "Failed to delete deployment",
	DEPLOY_FAILED: "Deployment process failed",
	NO_ACTIVE_DEPLOYMENT: "No active deployment found",
	CONCURRENT_LIMIT: "Maximum concurrent deployments for user reached",
	DAILY_DEPLOYMENT_LIMIT: "Daily deployment limit exceeded",
	BUSY_RUNNERS: "Busy Runners. Please try again later",
	ALREADY_ACTIVE: "Deployment already active",
	NOT_RELATED: "This deployment does not belong to the selected project",
	CANT_MAKE_ACTIVE: (status: string) => `Only successful deployments can be activated. Current status: ${status}.`,
};

export const PAYMENT_ERRORS = {
	NOT_FOUND: "Payment record not found",
	FAILED: "Payment processing failed",
	SUBSCRIPTION_CANCELLED: "Subscription has been cancelled",
	NO_ACTION_TAKEN: "No action taken",
};

export const OTP_ERRORS = {
	GENERATION_FAILED: "Failed to generate OTP",
	SEND_FAILED: "Failed to send OTP",
	INVALID_OTP: "Invalid OTP code",
	EXPIRED: "OTP has expired",
	NOT_FOUND: "OTP not found or expired",
	RESEND_LIMIT: "Too many OTP requests, please try again later",
	VERIFICATION_FAILED: "OTP verification failed",
	MAX_ATTEMPTS: (attempts: number) => `Maximum ${attempts} attempts exceeded`,
	COOLDOWN_ACTIVE: (seconds: number) => `Please wait ${seconds} seconds before requesting a new OTP`,
};

export const COMMON_ERRORS = {
	INTERNAL_SERVER: "Internal server error",
	SOMETHING_WENT_WRONG: "Error; Something went wrong",
	INVALID_ID: (id: string) => "Invalid ID === > " + id,
	VALIDATION_ERRORS: (messages: string, source: string) => `${source} validation error => ${messages}`,
	RATE_LIMIT_EXCEEDED: "Too many requests; please try again later",
	COOKIE_NOT_PROVIDED: "No auth cookie provided",
	TOKEN_VALIDATION: "Error during token valiadation",
	NOT_FOUND: "Not found",
};

export const WEBHOOK_ERRORS = {
	USER_NOT_FOUND: "Requested user not found ",
	INCOMPLETE_DATA: "Can't find user data from Github ",
	UNINSTALL_ERROR: "Error on uninstalling Github App due ",
	INCOMPLE_DATA: "Incomplete data for installation request ",
	SIGNATURE_INVALID: "Invalid Secret or Signature",
	SIGNATURE_DECODE_ERROR: "Error while parsing signature",
	SIGNATURE_NOT_FOUND: "Signature not found",
	ALREDY_CONNECTED: "Already connected to an account. Please remove it first",
	ACCESS_TOKEN_CREATE_ERROR: "Error while creating access token",
	REPO_FETCH: "Error fetching repositories",
	BRANCH_FETCH: "Error fetching repository branches",
	NOT_CONNECTED: "Github app not connected",
};