initial setup, its a mess
This commit is contained in:
parent
811fc86c92
commit
f9c2860ff4
8 changed files with 723 additions and 622 deletions
42
apps/data-service/src/providers/proxy.provider.ts
Normal file
42
apps/data-service/src/providers/proxy.provider.ts
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
import { ProviderConfig } from '../services/provider-registry.service';
|
||||
|
||||
export const proxyProvider: ProviderConfig = {
|
||||
name: 'proxy-service',
|
||||
service: 'proxy',
|
||||
operations: {
|
||||
'fetch-and-check': async (payload: { sources?: string[] }) => {
|
||||
const { proxyService } = await import('../services/proxy.service');
|
||||
return await proxyService.fetchProxiesFromSources();
|
||||
},
|
||||
|
||||
// 'check-specific': async (payload: { proxies: any[] }) => {
|
||||
// const { proxyService } = await import('../services/proxy.service');
|
||||
// return await proxyService.checkProxies(payload.proxies);
|
||||
// },
|
||||
|
||||
// 'get-stats': async (payload: { includeDetails?: boolean }) => {
|
||||
// const { proxyService } = await import('../services/proxy.service');
|
||||
// return await proxyService.getProxyStats(payload.includeDetails);
|
||||
// },
|
||||
|
||||
// 'cleanup-old-data': async (payload: { daysToKeep?: number }) => {
|
||||
// const { proxyService } = await import('../services/proxy.service');
|
||||
// return await proxyService.cleanupOldData(payload.daysToKeep || 7);
|
||||
// },
|
||||
|
||||
// 'get-working-proxy': async (payload: { protocol?: string; country?: string; timeout?: number }) => {
|
||||
// const { proxyService } = await import('../services/proxy.service');
|
||||
// return await proxyService.getWorkingProxy(payload);
|
||||
// },
|
||||
|
||||
// 'validate-proxy': async (payload: { proxy: any; testUrl?: string }) => {
|
||||
// const { proxyService } = await import('../services/proxy.service');
|
||||
// return await proxyService.validateProxy(payload.proxy, payload.testUrl);
|
||||
// },
|
||||
|
||||
// 'rotate-proxies': async (payload: { count?: number }) => {
|
||||
// const { proxyService } = await import('../services/proxy.service');
|
||||
// return await proxyService.rotateProxies(payload.count || 5);
|
||||
// }
|
||||
}
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue