هذا الالتزام موجود في:
2026-01-16 23:09:27 +00:00
الأصل aeab1f5637
التزام 4f0f61817e

69
api.js
عرض الملف

@@ -1,69 +0,0 @@
// API Base URL من متغيرات البيئة
const API_BASE = import.meta.env.VITE_API_BASE ?? "";
// =========================
// Schemas
// =========================
async function getSchemas(type, payload) {
const r = await fetch(`${API_BASE}/api/get_schemas`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
type,
...payload
})
});
return r.json();
}
// =========================
// Tables
// =========================
async function getTables(type, payload) {
const r = await fetch(`${API_BASE}/api/get_tables`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
type,
...payload
})
});
return r.json();
}
// =========================
// Start Migration
// =========================
async function startMigration(type, payload) {
const r = await fetch(`${API_BASE}/api/migrate`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
type,
...payload
})
});
return r.json();
}
// =========================
// Progress
// =========================
async function getProgress(type) {
const r = await fetch(`${API_BASE}/api/progress/${type}`);
return r.json();
}
// =========================
// List Buckets
// =========================
async function listBuckets(payload) {
const r = await fetch(`${API_BASE}/api/list_buckets`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(payload)
});
return r.json();
}
export { getSchemas, getTables, startMigration, getProgress, listBuckets };