feat(gateway): include production Telegram user gateway

Version the NestJS TDLib gateway with Docker deployment, migrations, automated tests and platform integration documentation while excluding all account sessions, credentials, runtime databases and backups.
This commit is contained in:
wmq
2026-08-01 18:38:20 +08:00
parent af49d22ca7
commit 06112602ec
142 changed files with 23107 additions and 7 deletions
+33
View File
@@ -0,0 +1,33 @@
import { DataSource } from 'typeorm';
import * as entities from '../src/database/entities';
import { InitialSchema1700000000000 } from '../src/database/migrations/1700000000000-InitialSchema';
describe('Initial database migration', () => {
it('creates the complete schema without synchronize', async () => {
const dataSource = new DataSource({
type: 'sqljs',
entities: Object.values(entities).filter(
(value) => typeof value === 'function',
) as Function[],
migrations: [InitialSchema1700000000000],
synchronize: false,
migrationsRun: true,
});
await dataSource.initialize();
try {
const tables = await dataSource.query(
"SELECT name FROM sqlite_master WHERE type='table'",
);
const names = new Set(tables.map((row: { name: string }) => row.name));
expect(names.has('tenants')).toBe(true);
expect(names.has('users')).toBe(true);
expect(names.has('tg_accounts')).toBe(true);
expect(names.has('tg_messages')).toBe(true);
expect(names.has('tg_webhook_deliveries')).toBe(true);
expect(names.has('tg_raw_updates')).toBe(true);
} finally {
await dataSource.destroy();
}
});
});