add shared

This commit is contained in:
Litlyx
2024-06-01 15:27:21 +02:00
parent 9caec3b92b
commit 75f0787c3b
23 changed files with 866 additions and 0 deletions

4
shared/data/ADMINS.ts Normal file
View File

@@ -0,0 +1,4 @@
export const ADMIN_EMAILS = [
'laura.emily.lovi@gmail.com',
'mangaiomaster@gmail.com'
]

1
shared/data/LITLYX.ts Normal file
View File

@@ -0,0 +1 @@
export const LITLYX_PROJECT_ID = '6643cd08a1854e3b81722ab5';

View File

@@ -0,0 +1,46 @@
export const PREMIUM_PLANS = [
{ id: 0, tag: 'FREE', name: 'Free' },
{ id: 1, tag: 'PLAN_1', name: 'Premium 1' },
{ id: 2, tag: 'PLAN_2', name: 'Premium 2' },
{ id: 3, tag: 'PLAN_3', name: 'Premium 3' },
{ id: 99, tag: 'PLAN_99', name: 'Premium 99' },
] as const;
export function getPlanFromPremiumType(premium_type?: number) {
if (!premium_type) return PREMIUM_PLANS[0];
const plan = PREMIUM_PLANS.find(e => e.id === premium_type);
if (!plan) return PREMIUM_PLANS[0];
return plan;
}
export type PREMIUM_PLAN_TAG = typeof PREMIUM_PLANS[number]['tag'];
export type PROJECT_LIMIT = {
COUNT_LIMIT: number,
AI_MESSAGE_LIMIT: number,
}
export const PREMIUM_LIMITS: Record<PREMIUM_PLAN_TAG, PROJECT_LIMIT> = {
FREE: {
COUNT_LIMIT: 3_000,
AI_MESSAGE_LIMIT: 10
},
PLAN_1: {
COUNT_LIMIT: 150_000,
AI_MESSAGE_LIMIT: 100
},
PLAN_2: {
COUNT_LIMIT: 500_000,
AI_MESSAGE_LIMIT: 5_000
},
PLAN_3: {
COUNT_LIMIT: 2_000_000,
AI_MESSAGE_LIMIT: 10_000
},
PLAN_99: {
COUNT_LIMIT: 10_000_000,
AI_MESSAGE_LIMIT: 100_000
}
}

View File

@@ -0,0 +1,5 @@
export enum EventType {
VISIT = 1,
EVENT = 2
}

View File

@@ -0,0 +1,5 @@
// Default: 1.1
// ((events + visits) * VALUE) > limit
export const EVENT_LOG_LIMIT_PERCENT = 1.1;