mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-12-24 14:17:47 -06:00
Path mapping & deps fix & bundler changed to tsup
This commit is contained in:
@@ -1,9 +1,8 @@
|
||||
import { ConfigService, Language } from '@config/env.config';
|
||||
import fs from 'fs';
|
||||
import i18next from 'i18next';
|
||||
import path from 'path';
|
||||
|
||||
import { ConfigService, Language } from '../config/env.config';
|
||||
|
||||
const languages = ['en', 'pt-BR', 'es'];
|
||||
const translationsPath = path.join(__dirname, 'translations');
|
||||
const configService: ConfigService = new ConfigService();
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
import { configService, SslConf } from '@config/env.config';
|
||||
import { Express } from 'express';
|
||||
import { readFileSync } from 'fs';
|
||||
import * as http from 'http';
|
||||
import * as https from 'https';
|
||||
|
||||
import { configService, SslConf } from '../config/env.config';
|
||||
|
||||
export class ServerUP {
|
||||
static #app: Express;
|
||||
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
import { CacheService } from '@api/services/cache.service';
|
||||
import { INSTANCE_DIR } from '@config/path.config';
|
||||
import { prismaServer } from '@libs/prisma.connect';
|
||||
import { AuthenticationState, BufferJSON, initAuthCreds, WAProto as proto } from 'baileys';
|
||||
import fs from 'fs/promises';
|
||||
import path from 'path';
|
||||
|
||||
import { CacheService } from '../api/services/cache.service';
|
||||
import { INSTANCE_DIR } from '../config/path.config';
|
||||
import { prismaServer } from '../libs/prisma.connect';
|
||||
|
||||
const prisma = prismaServer;
|
||||
|
||||
// const fixFileName = (file: string): string | undefined => {
|
||||
|
||||
@@ -34,18 +34,17 @@
|
||||
* └──────────────────────────────────────────────────────────────────────────────┘
|
||||
*/
|
||||
|
||||
import { ProviderFiles } from '@api/provider/sessions';
|
||||
import { Logger } from '@config/logger.config';
|
||||
import { AuthenticationCreds, AuthenticationState, BufferJSON, initAuthCreds, proto, SignalDataTypeMap } from 'baileys';
|
||||
import { isNotEmpty } from 'class-validator';
|
||||
|
||||
import { ProviderFiles } from '../api/provider/sessions';
|
||||
import { Logger } from '../config/logger.config';
|
||||
|
||||
export type AuthState = { state: AuthenticationState; saveCreds: () => Promise<void> };
|
||||
|
||||
export class AuthStateProvider {
|
||||
constructor(private readonly providerFiles: ProviderFiles) {}
|
||||
|
||||
private readonly logger = new Logger(AuthStateProvider.name);
|
||||
private readonly logger = new Logger('AuthStateProvider');
|
||||
|
||||
public async authStateProvider(instance: string): Promise<AuthState> {
|
||||
const [, error] = await this.providerFiles.create(instance);
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { CacheService } from '@api/services/cache.service';
|
||||
import { Logger } from '@config/logger.config';
|
||||
import { AuthenticationCreds, AuthenticationState, initAuthCreds, proto, SignalDataTypeMap } from 'baileys';
|
||||
|
||||
import { CacheService } from '../api/services/cache.service';
|
||||
import { Logger } from '../config/logger.config';
|
||||
|
||||
export async function useMultiFileAuthStateRedisDb(
|
||||
instanceName: string,
|
||||
cache: CacheService,
|
||||
@@ -10,7 +9,7 @@ export async function useMultiFileAuthStateRedisDb(
|
||||
state: AuthenticationState;
|
||||
saveCreds: () => Promise<void>;
|
||||
}> {
|
||||
const logger = new Logger(useMultiFileAuthStateRedisDb.name);
|
||||
const logger = new Logger('useMultiFileAuthStateRedisDb');
|
||||
|
||||
const writeData = async (data: any, key: string): Promise<any> => {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user