feat: add @polar-sh/sveltekit (#539)

* feat add @polar-sh/sveltekit

* remove all lemonsqueezy text
This commit is contained in:
Rotimi Best
2025-01-09 01:30:01 +01:00
committed by GitHub
parent 4d4b1f12e2
commit 13fb58176f
46 changed files with 12475 additions and 10197 deletions
@@ -63,17 +63,14 @@ loading.subscribe(async ($loading) => {
}
});
export async function handleLocaleChange(newLocale) {
export function handleLocaleChange(newLocale: string) {
if (!newLocale) {
return;
}
locale.set(newLocale);
await fetch('/api/i18n', {
body: JSON.stringify({ locale: newLocale }),
method: 'POST'
});
selectedLocale.set(newLocale);
}
export function lessonFallbackNote(
@@ -1,11 +0,0 @@
import { env } from '$env/dynamic/private';
import { lemonSqueezySetup } from '@lemonsqueezy/lemonsqueezy.js';
export function configureLemonSqueezy() {
return lemonSqueezySetup({
apiKey: env.LEMON_SQUEEZY_API_KEY,
onError: (error) => {
throw new Error(`Lemon Squeezy API error: ${error.message}`);
}
});
}
@@ -1,24 +0,0 @@
import axios from 'axios';
interface SubscriptionData {
productId: string;
email: string;
name: string;
triggeredBy: string;
orgId: string;
}
interface SubscriptionResponse {
success: boolean;
checkoutURL: string;
}
export async function subscribeToProduct(data: SubscriptionData): Promise<SubscriptionResponse> {
const response = await axios({
method: 'POST',
url: '/api/lmz/subscribe',
data
});
return response.data;
}
@@ -0,0 +1,20 @@
import { getServerSupabase } from '$lib/utils/functions/supabase.server';
const supabase = getServerSupabase();
export const validateUser = async (accessToken: string) => {
let user;
try {
const { data } = await supabase.auth.getUser(accessToken);
user = data.user;
} catch (error) {
console.error(error);
}
if (!user) {
throw new Error('Unauthenticated user');
}
return user;
};
@@ -0,0 +1 @@
export * from './authentication.server';
@@ -1,4 +0,0 @@
1. Welcome new user into classroomio
2. Sends teacher welcome to course
3. Notify teacher someone wants to buy course
4
@@ -77,7 +77,7 @@ export async function getOrganizations(userId: string, isOrgSite?: boolean, orgS
organization_plan(
plan_name,
is_active,
subscriptionId:payload->id
customerId:payload->customerId
)
)
`
@@ -1147,8 +1147,8 @@
"sub_title": "Rechnungsdetails",
"manage": "Verwalten Sie Ihre Abrechnung",
"active": "Sie haben keine aktive Abrechnung",
"lemonsqueezy": "Wir verwenden Lemonsqueezy, um Sie bei der Verwaltung Ihrer Abrechnung zu unterstützen",
"open_billing": "Abrechnung öffnen"
"open_billing": "Abrechnung öffnen",
"provider": "Wir verwenden Polar, um Ihre Abrechnung zu verwalten"
},
"integrations": {
"heading": "Telegramm",
@@ -242,7 +242,7 @@
"sub_title": "Billing details",
"manage": "Manage your billing",
"active": "You don't have any active billing",
"lemonsqueezy": "We use Lemonsqueezy to help manage your billing",
"provider": "We use Polar to help manage your billing",
"open_billing": "Open billing"
}
},
@@ -1147,8 +1147,8 @@
"sub_title": "Detalles de facturación",
"manage": "Gestiona tu facturación",
"active": "No tienes ninguna facturación activa",
"lemonsqueezy": "Usamos Lemonsqueezy para ayudarlo a administrar su facturación",
"open_billing": "Facturación abierta"
"open_billing": "Facturación abierta",
"provider": "Usamos Polar para ayudarte a gestionar tu facturación"
},
"integrations": {
"heading": "Telegrama",
@@ -1147,8 +1147,8 @@
"sub_title": "Détails de la facturation",
"manage": "Gérez votre facturation",
"active": "Vous n'avez aucune facturation active",
"lemonsqueezy": "Nous utilisons Lemonsqueezy pour vous aider à gérer votre facturation",
"open_billing": "Facturation ouverte"
"open_billing": "Facturation ouverte",
"provider": "Nous utilisons Polar pour vous aider à gérer votre facturation"
},
"integrations": {
"heading": "Télégramme",
@@ -1147,8 +1147,8 @@
"sub_title": "बिलिंग विवरण",
"manage": "अपनी बिलिंग प्रबंधित करें",
"active": "आपके पास कोई सक्रिय बिलिंग नहीं है",
"lemonsqueezy": "हम आपकी बिलिंग प्रबंधित करने में सहायता के लिए लेमनस्क्वीज़ी का उपयोग करते हैं",
"open_billing": "बिलिंग खोलें"
"open_billing": "बिलिंग खोलें",
"provider": "हम आपकी बिलिंग प्रबंधित करने में सहायता के लिए पोलर का उपयोग करते हैं"
},
"integrations": {
"heading": "तार",
@@ -1147,8 +1147,8 @@
"sub_title": "Detalhes de cobrança",
"manage": "Gerencie seu faturamento",
"active": "Você não tem nenhum faturamento ativo",
"lemonsqueezy": "Usamos Lemonsqueezy para ajudar a gerenciar seu faturamento",
"open_billing": "Faturamento aberto"
"open_billing": "Faturamento aberto",
"provider": "Usamos a Polar para ajudar a gerenciar seu faturamento"
},
"integrations": {
"heading": "Telegrama",
@@ -1147,8 +1147,8 @@
"sub_title": "Платежные реквизиты",
"manage": "Управляйте своим биллингом",
"active": "У вас нет активных платежных данных.",
"lemonsqueezy": "Мы используем Lemonsqueezy для управления вашими счетами.",
"open_billing": "Открыть биллинг"
"open_billing": "Открыть биллинг",
"provider": "Мы используем Polar, чтобы управлять вашими платежами."
},
"integrations": {
"heading": "Телеграмма",
@@ -1147,8 +1147,8 @@
"sub_title": "Chi tiết thanh toán",
"manage": "Quản lý thanh toán của bạn",
"active": "Bạn không có bất kỳ thanh toán nào đang hoạt động",
"lemonsqueezy": "Chúng tôi sử dụng Lemonsqueezy để giúp quản lý hóa đơn của bạn",
"open_billing": "Thanh toán mở"
"open_billing": "Thanh toán mở",
"provider": "Chúng tôi sử dụng Polar để giúp quản lý việc thanh toán của bạn"
},
"integrations": {
"heading": "điện tín",
+1 -1
View File
@@ -29,7 +29,7 @@ export interface CurrentOrg {
customization: OrgCustomization;
theme: string;
organization_plan: {
subscriptionId: string;
customerId: string;
plan_name: string;
is_active: boolean;
}[];