Release / WEBJS - chrome - amd64 - chrome (push) Canceled after 0s
Release / WEBJS - chromium - amd64 - latest (push) Canceled after 0s
Release / WEBJS - chromium - linux/arm64 - arm (push) Canceled after 0s
Release / GOWS - none - amd64 - gows (push) Canceled after 0s
Release / GOWS - none - linux/arm64 - gows-arm (push) Canceled after 0s
Release / NOWEB - none - amd64 - noweb (push) Canceled after 0s
Release / NOWEB - none - linux/arm64 - noweb-arm (push) Canceled after 0s
43 lines
1.1 KiB
TypeScript
43 lines
1.1 KiB
TypeScript
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
import { getEngineName } from '@waha/config';
|
|
|
|
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 const VERSION: WAHAEnvironment = {
|
|
version: '2025.9.2',
|
|
engine: getEngineName(),
|
|
tier: getWAHAVersion(),
|
|
browser:
|
|
getEngineName() === WAHAEngine.WEBJS ? getBrowserExecutablePath() : null,
|
|
};
|
|
|
|
export const IsChrome = VERSION.browser?.includes('chrome');
|
|
|
|
export { getEngineName };
|