Release / amd64 - chrome - chrome (push) Waiting to run
Release / amd64 - chromium - latest (push) Waiting to run
Release / linux/arm64 - chromium - arm (push) Waiting to run
Release / amd64 - none - noweb (push) Waiting to run
Release / linux/arm64 - none - noweb-arm (push) Waiting to run
41 lines
1.2 KiB
TypeScript
41 lines
1.2 KiB
TypeScript
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
import { getBrowserExecutablePath } from './core/abc/session.abc';
|
|
import { WAHAEngine } from './structures/enums.dto';
|
|
import { WAHAEnvironment } from './structures/environment.dto';
|
|
|
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
const fs = require('fs');
|
|
|
|
export enum WAHAVersion {
|
|
PLUS = 'PLUS',
|
|
CORE = 'CORE',
|
|
}
|
|
|
|
export function getWAHAVersion(): WAHAVersion {
|
|
// force core version if env variables set
|
|
const waha_version = process.env.WAHA_VERSION;
|
|
if (waha_version && waha_version === WAHAVersion.CORE) {
|
|
return WAHAVersion.CORE;
|
|
}
|
|
|
|
// Check the plus directory exists
|
|
const plusExists = fs.existsSync(`${__dirname}/plus`);
|
|
if (plusExists) {
|
|
return WAHAVersion.PLUS;
|
|
}
|
|
|
|
return WAHAVersion.CORE;
|
|
}
|
|
export function getEngineName(): string {
|
|
// Load engine name from WHATSAPP_DEFAULT_ENGINE environment variable
|
|
// If not set - use WEBJS
|
|
return process.env.WHATSAPP_DEFAULT_ENGINE || WAHAEngine.WEBJS;
|
|
}
|
|
|
|
export const VERSION: WAHAEnvironment = {
|
|
version: '2024.10.3',
|
|
engine: getEngineName(),
|
|
tier: getWAHAVersion(),
|
|
browser: getBrowserExecutablePath(),
|
|
};
|