feat(week1): complete foundation - schema, migrations, enhanced SQL, sanitizer
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { query } from '../db';
|
||||
import { query, pool } from '../db';
|
||||
|
||||
export const MECHANIC_OPS = {
|
||||
// 1. DIAGNOSTICS (The Stethoscope)
|
||||
@@ -53,3 +53,65 @@ export const MECHANIC_OPS = {
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Kill stuck database locks/queries
|
||||
* Returns number of processes terminated
|
||||
*/
|
||||
export async function killLocks(): Promise<number> {
|
||||
const result = await query(`
|
||||
SELECT pg_terminate_backend(pid)
|
||||
FROM pg_stat_activity
|
||||
WHERE state = 'active'
|
||||
AND query_start < NOW() - INTERVAL '30 seconds'
|
||||
AND pid <> pg_backend_pid()
|
||||
`);
|
||||
|
||||
console.log(`🔧 [Mechanic] Killed ${result.rowCount} stuck processes`);
|
||||
return result.rowCount || 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Run VACUUM ANALYZE on a table or entire database
|
||||
* NOTE: Must be run outside of transaction
|
||||
*/
|
||||
export async function vacuumAnalyze(tableName?: string): Promise<void> {
|
||||
const client = await pool.connect();
|
||||
|
||||
try {
|
||||
const table = tableName || '';
|
||||
const sql = table ? `VACUUM ANALYZE ${table}` : 'VACUUM ANALYZE';
|
||||
|
||||
console.log(`🔧 [Mechanic] Running: ${sql}`);
|
||||
await client.query(sql);
|
||||
console.log(`✅ [Mechanic] Vacuum complete`);
|
||||
|
||||
} finally {
|
||||
client.release();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get table bloat statistics
|
||||
*/
|
||||
export async function getTableBloat(): Promise<any[]> {
|
||||
const result = await query(`
|
||||
SELECT
|
||||
schemaname,
|
||||
tablename,
|
||||
pg_size_pretty(pg_total_relation_size(schemaname||'.'||tablename)) as size,
|
||||
n_dead_tup as dead_rows,
|
||||
n_live_tup as live_rows,
|
||||
CASE
|
||||
WHEN n_live_tup > 0
|
||||
THEN round(100.0 * n_dead_tup / n_live_tup, 2)
|
||||
ELSE 0
|
||||
END as bloat_pct
|
||||
FROM pg_stat_user_tables
|
||||
WHERE n_dead_tup > 0
|
||||
ORDER BY n_dead_tup DESC
|
||||
LIMIT 20
|
||||
`);
|
||||
|
||||
return result.rows;
|
||||
}
|
||||
|
||||
100
src/lib/db/migrate.ts
Normal file
100
src/lib/db/migrate.ts
Normal file
@@ -0,0 +1,100 @@
|
||||
import { pool } from './db';
|
||||
|
||||
/**
|
||||
* Migration System for God Mode
|
||||
* Handles transactional execution of SQL migration files
|
||||
*/
|
||||
|
||||
export interface MigrationResult {
|
||||
success: boolean;
|
||||
migrationsRun: number;
|
||||
error?: string;
|
||||
rolledBack?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Run multiple SQL commands in a single transaction
|
||||
* Automatically rolls back if ANY command fails
|
||||
*/
|
||||
export async function runMigrations(sqlCommands: string[]): Promise<MigrationResult> {
|
||||
const client = await pool.connect();
|
||||
let migrationsRun = 0;
|
||||
|
||||
try {
|
||||
await client.query('BEGIN');
|
||||
console.log('🔱 [Migration] Starting transaction...');
|
||||
|
||||
for (const command of sqlCommands) {
|
||||
// Skip empty commands or comments
|
||||
const trimmed = command.trim();
|
||||
if (!trimmed || trimmed.startsWith('--')) {
|
||||
continue;
|
||||
}
|
||||
|
||||
console.log(`[Migration] Executing: ${trimmed.substring(0, 100)}...`);
|
||||
await client.query(trimmed);
|
||||
migrationsRun++;
|
||||
}
|
||||
|
||||
await client.query('COMMIT');
|
||||
console.log(`✅ [Migration] Successfully committed ${migrationsRun} migrations`);
|
||||
|
||||
return {
|
||||
success: true,
|
||||
migrationsRun
|
||||
};
|
||||
|
||||
} catch (error: any) {
|
||||
await client.query('ROLLBACK');
|
||||
console.error('❌ [Migration] Error - Rolling back all changes:', error.message);
|
||||
|
||||
return {
|
||||
success: false,
|
||||
migrationsRun,
|
||||
error: error.message,
|
||||
rolledBack: true
|
||||
};
|
||||
|
||||
} finally {
|
||||
client.release();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Run a single large SQL file (like migrations)
|
||||
* Splits by semicolon and runs each statement in transaction
|
||||
*/
|
||||
export async function runMigrationFile(sqlContent: string): Promise<MigrationResult> {
|
||||
// Split by semicolon, but be smart about it
|
||||
const statements = sqlContent
|
||||
.split(';')
|
||||
.map(s => s.trim())
|
||||
.filter(s => s.length > 0);
|
||||
|
||||
return runMigrations(statements);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if migrations have been run
|
||||
*/
|
||||
export async function getMigrationStatus(): Promise<{
|
||||
tables: string[];
|
||||
lastMigration?: Date;
|
||||
}> {
|
||||
try {
|
||||
const result = await pool.query(`
|
||||
SELECT table_name
|
||||
FROM information_schema.tables
|
||||
WHERE table_schema = 'public'
|
||||
ORDER BY table_name
|
||||
`);
|
||||
|
||||
return {
|
||||
tables: result.rows.map(r => r.table_name)
|
||||
};
|
||||
} catch (error) {
|
||||
return {
|
||||
tables: []
|
||||
};
|
||||
}
|
||||
}
|
||||
135
src/lib/db/sanitizer.ts
Normal file
135
src/lib/db/sanitizer.ts
Normal file
@@ -0,0 +1,135 @@
|
||||
/**
|
||||
* SQL Sanitizer - The Last Line of Defense
|
||||
* Validates raw SQL before execution to prevent catastrophic accidents
|
||||
*/
|
||||
|
||||
export interface SanitizationResult {
|
||||
safe: boolean;
|
||||
warnings: string[];
|
||||
blocked?: string;
|
||||
}
|
||||
|
||||
// Dangerous patterns that should NEVER be allowed
|
||||
const BLOCKED_PATTERNS = [
|
||||
/DROP\s+DATABASE/i,
|
||||
/DROP\s+SCHEMA/i,
|
||||
/ALTER\s+USER/i,
|
||||
/ALTER\s+ROLE/i,
|
||||
/CREATE\s+USER/i,
|
||||
/CREATE\s+ROLE/i,
|
||||
/GRANT\s+.*\s+TO/i,
|
||||
/REVOKE\s+.*\s+FROM/i,
|
||||
];
|
||||
|
||||
// Patterns that require special attention
|
||||
const WARNING_PATTERNS = [
|
||||
{ pattern: /TRUNCATE/i, message: 'TRUNCATE detected - use with caution' },
|
||||
{ pattern: /DROP\s+TABLE/i, message: 'DROP TABLE detected - irreversible' },
|
||||
{ pattern: /DELETE\s+FROM\s+\w+\s*;/i, message: 'DELETE without WHERE clause - will delete ALL rows' },
|
||||
{ pattern: /UPDATE\s+\w+\s+SET\s+.*\s*;/i, message: 'UPDATE without WHERE clause - will update ALL rows' },
|
||||
];
|
||||
|
||||
/**
|
||||
* Validate table name is safe (alphanumeric + underscores only)
|
||||
*/
|
||||
export function validateTableName(tableName: string): boolean {
|
||||
return /^[a-zA-Z0-9_]+$/.test(tableName);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sanitize raw SQL before execution
|
||||
*/
|
||||
export function sanitizeSQL(sql: string): SanitizationResult {
|
||||
const trimmed = sql.trim();
|
||||
const warnings: string[] = [];
|
||||
|
||||
// Check for blocked patterns
|
||||
for (const pattern of BLOCKED_PATTERNS) {
|
||||
if (pattern.test(trimmed)) {
|
||||
return {
|
||||
safe: false,
|
||||
warnings: [],
|
||||
blocked: `Blocked dangerous command: ${pattern.source}`
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
// Check for warning patterns
|
||||
for (const { pattern, message } of WARNING_PATTERNS) {
|
||||
if (pattern.test(trimmed)) {
|
||||
warnings.push(message);
|
||||
}
|
||||
}
|
||||
|
||||
// Validate table names in common operations
|
||||
const tableMatches = trimmed.match(/(?:FROM|INTO|UPDATE|TRUNCATE|DROP TABLE)\s+([a-zA-Z0-9_]+)/gi);
|
||||
if (tableMatches) {
|
||||
for (const match of tableMatches) {
|
||||
const tableName = match.split(/\s+/).pop() || '';
|
||||
if (!validateTableName(tableName)) {
|
||||
return {
|
||||
safe: false,
|
||||
warnings: [],
|
||||
blocked: `Invalid table name: ${tableName}`
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
safe: true,
|
||||
warnings
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Extract table names from SQL query
|
||||
*/
|
||||
export function extractTableNames(sql: string): string[] {
|
||||
const matches = sql.match(/(?:FROM|INTO|UPDATE|TRUNCATE|DROP TABLE)\s+([a-zA-Z0-9_]+)/gi);
|
||||
if (!matches) return [];
|
||||
|
||||
return matches.map(m => m.split(/\s+/).pop() || '').filter(Boolean);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if SQL contains WHERE clause
|
||||
*/
|
||||
export function hasWhereClause(sql: string): boolean {
|
||||
return /WHERE\s+/i.test(sql);
|
||||
}
|
||||
|
||||
/**
|
||||
* More permissive check for maintenance window
|
||||
* Used when run_mechanic flag is set
|
||||
*/
|
||||
export function sanitizeSQLForMaintenance(sql: string): SanitizationResult {
|
||||
const trimmed = sql.trim();
|
||||
const warnings: string[] = [];
|
||||
|
||||
// Still block the most dangerous commands
|
||||
const criticalPatterns = [
|
||||
/DROP\s+DATABASE/i,
|
||||
/DROP\s+SCHEMA/i,
|
||||
/ALTER\s+USER/i,
|
||||
/CREATE\s+USER/i,
|
||||
];
|
||||
|
||||
for (const pattern of criticalPatterns) {
|
||||
if (pattern.test(trimmed)) {
|
||||
return {
|
||||
safe: false,
|
||||
warnings: [],
|
||||
blocked: `Blocked critical command even in maintenance mode: ${pattern.source}`
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
// Allow TRUNCATE and DROP TABLE in maintenance mode
|
||||
warnings.push('Maintenance mode: dangerous operations allowed');
|
||||
|
||||
return {
|
||||
safe: true,
|
||||
warnings
|
||||
};
|
||||
}
|
||||
92
src/pages/api/god/schema/init.ts
Normal file
92
src/pages/api/god/schema/init.ts
Normal file
@@ -0,0 +1,92 @@
|
||||
import type { APIRoute } from 'astro';
|
||||
import { runMigrationFile, getMigrationStatus } from '@/lib/db/migrate';
|
||||
import { readFile } from 'fs/promises';
|
||||
import { join } from 'path';
|
||||
|
||||
/**
|
||||
* Schema Initialization Endpoint
|
||||
* Executes migration files with transactional safety
|
||||
*/
|
||||
|
||||
function validateGodToken(request: Request): boolean {
|
||||
const token = request.headers.get('X-God-Token') ||
|
||||
request.headers.get('Authorization')?.replace('Bearer ', '') ||
|
||||
new URL(request.url).searchParams.get('token');
|
||||
|
||||
const godToken = process.env.GOD_MODE_TOKEN || import.meta.env.GOD_MODE_TOKEN;
|
||||
if (!godToken) return true; // Dev mode
|
||||
return token === godToken;
|
||||
}
|
||||
|
||||
export const POST: APIRoute = async ({ request }) => {
|
||||
if (!validateGodToken(request)) {
|
||||
return new Response(JSON.stringify({ error: 'Unauthorized' }), {
|
||||
status: 401,
|
||||
headers: { 'Content-Type': 'application/json' }
|
||||
});
|
||||
}
|
||||
|
||||
try {
|
||||
// Read the main migration file
|
||||
const migrationPath = join(process.cwd(), 'migrations', '01_init_complete.sql');
|
||||
const sqlContent = await readFile(migrationPath, 'utf-8');
|
||||
|
||||
// Run migrations in transaction
|
||||
const result = await runMigrationFile(sqlContent);
|
||||
|
||||
if (!result.success) {
|
||||
return new Response(JSON.stringify({
|
||||
error: 'Migration failed',
|
||||
details: result.error,
|
||||
rolledBack: result.rolledBack,
|
||||
migrationsRun: result.migrationsRun
|
||||
}), {
|
||||
status: 500,
|
||||
headers: { 'Content-Type': 'application/json' }
|
||||
});
|
||||
}
|
||||
|
||||
// Get final status
|
||||
const status = await getMigrationStatus();
|
||||
|
||||
return new Response(JSON.stringify({
|
||||
success: true,
|
||||
message: '🔱 Database schema initialized successfully',
|
||||
migrationsRun: result.migrationsRun,
|
||||
tablesCreated: status.tables,
|
||||
timestamp: new Date().toISOString()
|
||||
}), {
|
||||
status: 200,
|
||||
headers: { 'Content-Type': 'application/json' }
|
||||
});
|
||||
|
||||
} catch (error: any) {
|
||||
return new Response(JSON.stringify({
|
||||
error: 'Failed to read or execute migration file',
|
||||
details: error.message
|
||||
}), {
|
||||
status: 500,
|
||||
headers: { 'Content-Type': 'application/json' }
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
export const GET: APIRoute = async ({ request }) => {
|
||||
if (!validateGodToken(request)) {
|
||||
return new Response(JSON.stringify({ error: 'Unauthorized' }), {
|
||||
status: 401,
|
||||
headers: { 'Content-Type': 'application/json' }
|
||||
});
|
||||
}
|
||||
|
||||
const status = await getMigrationStatus();
|
||||
|
||||
return new Response(JSON.stringify({
|
||||
tables: status.tables,
|
||||
tableCount: status.tables.length,
|
||||
initialized: status.tables.length > 0
|
||||
}), {
|
||||
status: 200,
|
||||
headers: { 'Content-Type': 'application/json' }
|
||||
});
|
||||
};
|
||||
236
src/pages/api/god/sql.ts
Normal file
236
src/pages/api/god/sql.ts
Normal file
@@ -0,0 +1,236 @@
|
||||
import type { APIRoute } from 'astro';
|
||||
import { pool } from '@/lib/db';
|
||||
import { sanitizeSQL, sanitizeSQLForMaintenance } from '@/lib/db/sanitizer';
|
||||
import { vacuumAnalyze, killLocks } from '@/lib/db/mechanic';
|
||||
import { queues } from '@/lib/queue/config';
|
||||
|
||||
/**
|
||||
* Enhanced SQL Endpoint - The Ultimate God Mode Feature
|
||||
*
|
||||
* Features:
|
||||
* 1. Multi-statement transactions (auto-rollback on failure)
|
||||
* 2. SQL sanitization (blocks dangerous commands)
|
||||
* 3. Mechanic integration (auto-cleanup after large ops)
|
||||
* 4. Queue injection (push results to BullMQ)
|
||||
*/
|
||||
|
||||
function validateGodToken(request: Request): boolean {
|
||||
const token = request.headers.get('X-God-Token') ||
|
||||
request.headers.get('Authorization')?.replace('Bearer ', '') ||
|
||||
new URL(request.url).searchParams.get('token');
|
||||
|
||||
const godToken = process.env.GOD_MODE_TOKEN || import.meta.env.GOD_MODE_TOKEN;
|
||||
if (!godToken) return true;
|
||||
return token === godToken;
|
||||
}
|
||||
|
||||
export const POST: APIRoute = async ({ request }) => {
|
||||
if (!validateGodToken(request)) {
|
||||
return new Response(JSON.stringify({ error: 'Unauthorized' }), {
|
||||
status: 401,
|
||||
headers: { 'Content-Type': 'application/json' }
|
||||
});
|
||||
}
|
||||
|
||||
try {
|
||||
const body = await request.json();
|
||||
const {
|
||||
query,
|
||||
run_mechanic, // 'vacuum' | 'kill-locks'
|
||||
push_to_queue, // 'publish_job' | 'generate_article'
|
||||
transaction = true // Auto-wrap in transaction if multiple statements
|
||||
} = body;
|
||||
|
||||
if (!query) {
|
||||
return new Response(JSON.stringify({ error: 'Missing query' }), {
|
||||
status: 400,
|
||||
headers: { 'Content-Type': 'application/json' }
|
||||
});
|
||||
}
|
||||
|
||||
// Step 1: SQL Sanitization
|
||||
const sanitizationMode = run_mechanic ? 'maintenance' : 'normal';
|
||||
const sanitizationResult = sanitizationMode === 'maintenance'
|
||||
? sanitizeSQLForMaintenance(query)
|
||||
: sanitizeSQL(query);
|
||||
|
||||
if (!sanitizationResult.safe) {
|
||||
return new Response(JSON.stringify({
|
||||
error: 'SQL blocked by safety check',
|
||||
reason: sanitizationResult.blocked,
|
||||
tip: 'Use run_mechanic flag for maintenance operations'
|
||||
}), {
|
||||
status: 403,
|
||||
headers: { 'Content-Type': 'application/json' }
|
||||
});
|
||||
}
|
||||
|
||||
// Step 2: Split into statements for transaction handling
|
||||
const statements = query.split(';').map((s: string) => s.trim()).filter(Boolean);
|
||||
const isMultiStatement = statements.length > 1;
|
||||
|
||||
// Step 3: Execute Query
|
||||
const client = await pool.connect();
|
||||
let result;
|
||||
let rowsAffected = 0;
|
||||
|
||||
try {
|
||||
if (isMultiStatement && transaction) {
|
||||
// Multi-statement transaction
|
||||
await client.query('BEGIN');
|
||||
console.log(`🔱 [SQL] Starting transaction with ${statements.length} statements`);
|
||||
|
||||
const results = [];
|
||||
for (const stmt of statements) {
|
||||
const r = await client.query(stmt);
|
||||
results.push(r);
|
||||
rowsAffected += r.rowCount || 0;
|
||||
}
|
||||
|
||||
await client.query('COMMIT');
|
||||
console.log(`✅ [SQL] Transaction committed - ${rowsAffected} rows affected`);
|
||||
|
||||
result = results[results.length - 1]; // Return last result
|
||||
|
||||
} else {
|
||||
// Single statement
|
||||
result = await client.query(query);
|
||||
rowsAffected = result.rowCount || 0;
|
||||
}
|
||||
|
||||
} catch (error: any) {
|
||||
if (isMultiStatement && transaction) {
|
||||
await client.query('ROLLBACK');
|
||||
console.error(`❌ [SQL] Transaction rolled back: ${error.message}`);
|
||||
}
|
||||
throw error;
|
||||
|
||||
} finally {
|
||||
client.release();
|
||||
}
|
||||
|
||||
// Step 4: Mechanic Integration
|
||||
let mechanicResult;
|
||||
if (run_mechanic) {
|
||||
console.log(`🔧 [Mechanic] Running ${run_mechanic}...`);
|
||||
|
||||
if (run_mechanic === 'vacuum') {
|
||||
await vacuumAnalyze();
|
||||
mechanicResult = { action: 'vacuum', status: 'completed' };
|
||||
} else if (run_mechanic === 'kill-locks') {
|
||||
const killed = await killLocks();
|
||||
mechanicResult = { action: 'kill-locks', killed };
|
||||
}
|
||||
}
|
||||
|
||||
// Step 5: Queue Injection
|
||||
let queueResult;
|
||||
if (push_to_queue && result.rows && result.rows.length > 0) {
|
||||
console.log(`📋 [Queue] Pushing ${result.rows.length} rows to ${push_to_queue}`);
|
||||
|
||||
const jobs = result.rows.map((row: any, index: number) => ({
|
||||
name: `${push_to_queue}-${index}`,
|
||||
data: row
|
||||
}));
|
||||
|
||||
// Use addBulk for efficiency
|
||||
const queue = queues.generation; // Default queue
|
||||
await queue.addBulk(jobs);
|
||||
|
||||
queueResult = {
|
||||
queue: push_to_queue,
|
||||
jobsAdded: jobs.length
|
||||
};
|
||||
}
|
||||
|
||||
// Step 6: Build Response
|
||||
const response: any = {
|
||||
success: true,
|
||||
rowCount: result.rowCount,
|
||||
rows: result.rows,
|
||||
command: result.command,
|
||||
timestamp: new Date().toISOString()
|
||||
};
|
||||
|
||||
if (sanitizationResult.warnings.length > 0) {
|
||||
response.warnings = sanitizationResult.warnings;
|
||||
}
|
||||
|
||||
if (isMultiStatement) {
|
||||
response.transaction = {
|
||||
statements: statements.length,
|
||||
committed: true,
|
||||
rowsAffected
|
||||
};
|
||||
}
|
||||
|
||||
if (mechanicResult) {
|
||||
response.mechanic = mechanicResult;
|
||||
}
|
||||
|
||||
if (queueResult) {
|
||||
response.queue = queueResult;
|
||||
}
|
||||
|
||||
return new Response(JSON.stringify(response), {
|
||||
status: 200,
|
||||
headers: { 'Content-Type': 'application/json' }
|
||||
});
|
||||
|
||||
} catch (error: any) {
|
||||
return new Response(JSON.stringify({
|
||||
error: error.message,
|
||||
code: error.code,
|
||||
detail: error.detail,
|
||||
hint: error.hint
|
||||
}), {
|
||||
status: 500,
|
||||
headers: { 'Content-Type': 'application/json' }
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
// GET for documentation
|
||||
export const GET: APIRoute = async ({ request }) => {
|
||||
if (!validateGodToken(request)) {
|
||||
return new Response(JSON.stringify({ error: 'Unauthorized' }), {
|
||||
status: 401,
|
||||
headers: { 'Content-Type': 'application/json' }
|
||||
});
|
||||
}
|
||||
|
||||
return new Response(JSON.stringify({
|
||||
endpoint: 'POST /api/god/sql',
|
||||
description: 'Execute raw SQL with enhanced features',
|
||||
features: {
|
||||
'1_transactions': 'Auto-wrap multiple statements in BEGIN/COMMIT',
|
||||
'2_sanitization': 'Blocks dangerous commands (DROP DATABASE, etc)',
|
||||
'3_mechanic': 'Auto-cleanup with run_mechanic flag',
|
||||
'4_queue_injection': 'Push results to BullMQ with push_to_queue flag'
|
||||
},
|
||||
usage: {
|
||||
basic: {
|
||||
query: 'SELECT * FROM sites LIMIT 10'
|
||||
},
|
||||
transaction: {
|
||||
query: 'INSERT INTO sites (domain, name) VALUES (\'example.com\', \'Example\'); UPDATE sites SET status=\'active\';',
|
||||
transaction: true
|
||||
},
|
||||
with_vacuum: {
|
||||
query: 'DELETE FROM posts WHERE status=\'draft\'',
|
||||
run_mechanic: 'vacuum'
|
||||
},
|
||||
queue_injection: {
|
||||
query: 'SELECT id, url FROM posts WHERE status=\'draft\'',
|
||||
push_to_queue: 'publish_job'
|
||||
}
|
||||
},
|
||||
safety: {
|
||||
blocked: ['DROP DATABASE', 'ALTER USER', 'DELETE without WHERE'],
|
||||
warnings: ['TRUNCATE', 'DROP TABLE', 'UPDATE without WHERE']
|
||||
}
|
||||
}, null, 2), {
|
||||
status: 200,
|
||||
headers: { 'Content-Type': 'application/json' }
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user