Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
495857ee41 | ||
|
|
e04e55c4c5 | ||
|
|
743e740860 | ||
|
|
65623ec1ea | ||
|
|
72a301c579 | ||
|
|
f35fd8d7c6 | ||
|
|
0594ca0709 | ||
|
|
4e5ebab97e |
No files matched your search
@@ -37,6 +37,10 @@ This guide summarizes how to explore, modify, and validate the WhatsApp HTTP API
|
||||
- **Utilities**: RxJS streams (`SwitchObservable`, `DefaultMap`) drive webhook
|
||||
event fan-out. Prefer existing helpers in `src/utils` and `src/core/utils`
|
||||
before adding bespoke logic.
|
||||
- **OS** - the project works on any OS inside the Docker container; the base
|
||||
image is defined in `Dockerfile`.
|
||||
- **CPU** - the image must run on both `x86_64` (including pre-v2 CPUs without
|
||||
SSE4.2) and `aarch64`.
|
||||
|
||||
## Repository Landmarks
|
||||
|
||||
|
||||
+15
@@ -28,6 +28,21 @@ ADD . /git
|
||||
RUN yarn install
|
||||
RUN yarn build && find ./dist -name "*.d.ts" -delete
|
||||
|
||||
# Rebuild sharp from source on x86-64 so it runs on pre-v2 CPUs (no SSE4.2 requirement).
|
||||
# The prebuilt @img/sharp-linux-x64 binary requires x86-64-v2; -march=x86-64 limits
|
||||
# code generation to baseline x86-64 (SSE2 only). ARM64 prebuilts have no such
|
||||
# constraint, so no rebuild is needed there.
|
||||
# We call sharp's own install/build.js (not npm rebuild) so it first generates config.gypi
|
||||
# with include/lib paths pointing to its bundled @img/sharp-libvips-linux-x64 package,
|
||||
# then invokes node-gyp with those paths. Without this step node-gyp cannot find vips headers.
|
||||
RUN if [ "$(uname -m)" = "x86_64" ]; then \
|
||||
LIBVIPS_DEV_VER=$(node -e "require('/git/node_modules/sharp/package.json').devDependencies['@img/sharp-libvips-dev']" | tr -d '^') && \
|
||||
npm install --prefix /tmp/sharp-dev --no-package-lock "@img/sharp-libvips-dev@${LIBVIPS_DEV_VER}" && \
|
||||
cp -r /tmp/sharp-dev/node_modules/@img/sharp-libvips-dev /git/node_modules/@img/ && \
|
||||
cd /git/node_modules/sharp && \
|
||||
PATH="/git/node_modules/.bin:$PATH" CFLAGS="-march=x86-64" CXXFLAGS="-march=x86-64" node install/build.js; \
|
||||
fi
|
||||
|
||||
#
|
||||
# Dashboard
|
||||
#
|
||||
|
||||
@@ -6,6 +6,7 @@ import {
|
||||
NoRetriesJobOptions,
|
||||
} from '@waha/apps/app_sdk/constants';
|
||||
import { MessageCleanupConsumer } from '@waha/apps/chatwoot/consumers/scheduled/message.cleanup';
|
||||
import { CheckTierConsumer } from '@waha/apps/chatwoot/consumers/scheduled/check.tier';
|
||||
import { ChatWootAppService } from '@waha/apps/chatwoot/services/ChatWootAppService';
|
||||
import * as lodash from 'lodash';
|
||||
|
||||
@@ -51,6 +52,10 @@ const IMPORTS = lodash.flatten([
|
||||
name: QueueName.SCHEDULED_CHECK_VERSION,
|
||||
defaultJobOptions: merge(NoRetriesJobOptions, JobRemoveOptions),
|
||||
}),
|
||||
RegisterAppQueue({
|
||||
name: QueueName.SCHEDULED_CHECK_TIER,
|
||||
defaultJobOptions: merge(NoRetriesJobOptions, JobRemoveOptions),
|
||||
}),
|
||||
RegisterAppQueue({
|
||||
name: QueueName.TASK_CONTACTS_PULL,
|
||||
defaultJobOptions: merge(ExponentialRetriesJobOptions, JobRemoveOptions),
|
||||
@@ -145,6 +150,7 @@ const PROVIDERS = [
|
||||
// Scheduled
|
||||
MessageCleanupConsumer,
|
||||
CheckVersionConsumer,
|
||||
CheckTierConsumer,
|
||||
// Services
|
||||
ChatWootWAHAQueueService,
|
||||
ChatWootQueueService,
|
||||
|
||||
@@ -20,8 +20,18 @@ export async function QueueStatus(ctx: QueueCommandContext, name: string) {
|
||||
for (const status of result) {
|
||||
status.name = QueueNameRepr(status.name);
|
||||
}
|
||||
// locked: true - last
|
||||
result = lodash.sortBy(result, [(x) => !!x.locked, 'name']);
|
||||
const categoryOrder = ['inbox', 'whatsapp', 'task', 'scheduled'];
|
||||
const categoryIndex = (name: string) => {
|
||||
const category = name.split(' | ')[0];
|
||||
const index = categoryOrder.indexOf(category);
|
||||
return index === -1 ? categoryOrder.length : index;
|
||||
};
|
||||
// locked: true - last, then by category (inbox/whatsapp/task/scheduled), then by name
|
||||
result = lodash.sortBy(result, [
|
||||
(x) => !!x.locked,
|
||||
(x) => categoryIndex(x.name),
|
||||
'name',
|
||||
]);
|
||||
const msg = ctx.l.r('cli.cmd.queue.status.result', {
|
||||
queues: result,
|
||||
});
|
||||
|
||||
@@ -17,6 +17,9 @@ export async function runText(
|
||||
.map((line) => line.trimStart()) // remove indentation
|
||||
.join(' ') // join with space
|
||||
.trim(); // final cleanup
|
||||
// Strip WhatsApp/markdown formatting characters so shell-quote doesn't
|
||||
// treat them as glob operators and return non-string tokens
|
||||
text = text.replace(/[*_~`]/g, '');
|
||||
const output = new BufferedOutput();
|
||||
const program = BuildProgram(commands, ctx, output);
|
||||
const argv = parse(text);
|
||||
|
||||
@@ -4,6 +4,7 @@ export enum QueueName {
|
||||
//
|
||||
SCHEDULED_MESSAGE_CLEANUP = 'chatwoot.scheduled | message.cleanup',
|
||||
SCHEDULED_CHECK_VERSION = 'chatwoot.scheduled | check.version',
|
||||
SCHEDULED_CHECK_TIER = 'chatwoot.scheduled | check.tier',
|
||||
|
||||
//
|
||||
// Task
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
import { Processor } from '@nestjs/bullmq';
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { JOB_CONCURRENCY } from '@waha/apps/app_sdk/constants';
|
||||
import { QueueName } from '@waha/apps/chatwoot/consumers/QueueName';
|
||||
import { DIContainer } from '@waha/apps/chatwoot/di/DIContainer';
|
||||
import { SessionManager } from '@waha/core/abc/manager.abc';
|
||||
import { SUPPORT_US_URL } from '@waha/core/constants';
|
||||
import { RMutexService } from '@waha/modules/rmutex/rmutex.service';
|
||||
import { VERSION, WAHAVersion } from '@waha/version';
|
||||
import { Job } from 'bullmq';
|
||||
import { PinoLogger } from 'nestjs-pino';
|
||||
|
||||
import { TKey } from '@waha/apps/chatwoot/i18n/templates';
|
||||
import { ChatWootScheduledConsumer } from './base';
|
||||
|
||||
@Processor(QueueName.SCHEDULED_CHECK_TIER, { concurrency: JOB_CONCURRENCY })
|
||||
export class CheckTierConsumer extends ChatWootScheduledConsumer {
|
||||
constructor(manager: SessionManager, log: PinoLogger, rmutex: RMutexService) {
|
||||
super(manager, log, rmutex, CheckTierConsumer.name);
|
||||
}
|
||||
|
||||
protected ErrorHeaderKey(): TKey {
|
||||
return TKey.JOB_SCHEDULED_ERROR_HEADER;
|
||||
}
|
||||
|
||||
protected async Process(container: DIContainer, job: Job): Promise<any> {
|
||||
const logger = container.Logger();
|
||||
const locale = container.Locale();
|
||||
const conversation = await container
|
||||
.ContactConversationService()
|
||||
.InboxNotifications();
|
||||
if (VERSION.tier !== WAHAVersion.CORE) {
|
||||
logger.info('WAHA is not using the CORE version');
|
||||
return;
|
||||
}
|
||||
logger.info('WAHA is using the CORE version');
|
||||
const supportMessage = locale.key(TKey.WAHA_CORE_VERSION_USED).render({
|
||||
supportUrl: SUPPORT_US_URL,
|
||||
});
|
||||
await conversation.incoming(supportMessage);
|
||||
}
|
||||
}
|
||||
@@ -1,24 +1,19 @@
|
||||
import { Processor } from '@nestjs/bullmq';
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { JOB_CONCURRENCY } from '@waha/apps/app_sdk/constants';
|
||||
import { ILogger } from '@waha/apps/app_sdk/ILogger';
|
||||
import { QueueName } from '@waha/apps/chatwoot/consumers/QueueName';
|
||||
import { DIContainer } from '@waha/apps/chatwoot/di/DIContainer';
|
||||
import { SessionManager } from '@waha/core/abc/manager.abc';
|
||||
import { CHANGELOG_URL, SUPPORT_US_URL } from '@waha/core/constants';
|
||||
import { CHANGELOG_URL } from '@waha/core/constants';
|
||||
import { RMutexService } from '@waha/modules/rmutex/rmutex.service';
|
||||
import { VERSION, WAHAVersion } from '@waha/version';
|
||||
import { VERSION } from '@waha/version';
|
||||
import axios from 'axios';
|
||||
import { Job } from 'bullmq';
|
||||
import { PinoLogger } from 'nestjs-pino';
|
||||
|
||||
import { ChatWootScheduledConsumer } from './base';
|
||||
import { TKey } from '@waha/apps/chatwoot/i18n/templates';
|
||||
import { ChatWootScheduledConsumer } from './base';
|
||||
|
||||
/**
|
||||
* Scheduled consumer for version checking
|
||||
* Periodically checks for new versions and notifies if updates are available
|
||||
*/
|
||||
@Processor(QueueName.SCHEDULED_CHECK_VERSION, { concurrency: JOB_CONCURRENCY })
|
||||
export class CheckVersionConsumer extends ChatWootScheduledConsumer {
|
||||
constructor(manager: SessionManager, log: PinoLogger, rmutex: RMutexService) {
|
||||
@@ -29,34 +24,7 @@ export class CheckVersionConsumer extends ChatWootScheduledConsumer {
|
||||
return TKey.JOB_SCHEDULED_ERROR_HEADER;
|
||||
}
|
||||
|
||||
/**
|
||||
* Process the version check job
|
||||
* Checks for new versions and notifies if updates are available
|
||||
*/
|
||||
protected async Process(container: DIContainer, job: Job): Promise<any> {
|
||||
await this.CheckWAHACoreVersion(container);
|
||||
await this.CheckNewVersionAvailable(container);
|
||||
}
|
||||
|
||||
private async CheckWAHACoreVersion(container: DIContainer) {
|
||||
const logger = container.Logger();
|
||||
const locale = container.Locale();
|
||||
const conversation = await container
|
||||
.ContactConversationService()
|
||||
.InboxNotifications();
|
||||
// If using the CORE version, send a message encouraging support
|
||||
if (VERSION.tier !== WAHAVersion.CORE) {
|
||||
logger.info('WAHA is not using the CORE version');
|
||||
return;
|
||||
}
|
||||
logger.info('WAHA is using the CORE version');
|
||||
const supportMessage = locale.key(TKey.WAHA_CORE_VERSION_USED).render({
|
||||
supportUrl: SUPPORT_US_URL,
|
||||
});
|
||||
await conversation.incoming(supportMessage);
|
||||
}
|
||||
|
||||
private async CheckNewVersionAvailable(container: DIContainer) {
|
||||
const logger = container.Logger();
|
||||
logger.info('Processing version check job');
|
||||
const currentVersion = VERSION.version;
|
||||
@@ -72,7 +40,6 @@ export class CheckVersionConsumer extends ChatWootScheduledConsumer {
|
||||
`New version available: ${latestVersion} (current: ${currentVersion})`,
|
||||
);
|
||||
|
||||
// Send a message to Chatwoot conversation about a new version
|
||||
const locale = container.Locale();
|
||||
const message = locale.key(TKey.WAHA_NEW_VERSION_AVAILABLE).render({
|
||||
currentVersion: currentVersion,
|
||||
|
||||
@@ -212,7 +212,11 @@ class MessagesPullHandler {
|
||||
|
||||
// Perform some actions before any job started
|
||||
if (options.pause) {
|
||||
await this.queueManager.pause();
|
||||
const queues = [
|
||||
...this.queueManager.resolve('inbox'),
|
||||
...this.queueManager.resolve('waha'),
|
||||
];
|
||||
await this.queueManager.pause(queues);
|
||||
await this.activity.queue(true);
|
||||
}
|
||||
}
|
||||
@@ -228,7 +232,11 @@ class MessagesPullHandler {
|
||||
|
||||
// Resume queues if paused
|
||||
if (options.pause) {
|
||||
await this.queueManager.resume();
|
||||
const queues = [
|
||||
...this.queueManager.resolve('inbox'),
|
||||
...this.queueManager.resolve('waha'),
|
||||
];
|
||||
await this.queueManager.resume(queues);
|
||||
await this.activity.queue(false);
|
||||
}
|
||||
// Progress summary
|
||||
|
||||
@@ -325,6 +325,8 @@ waha.new.version.available: |-
|
||||
|
||||
👉 تحقق مما هو جديد في [**🆕 سجل التغييرات**]({{{changelogUrl}}})
|
||||
|
||||
_لإيقاف هذه الإشعارات، أرسل_ `queue stop check.version`
|
||||
|
||||
waha.core.version.used: |-
|
||||
❤️ **ادعم WAHA!**
|
||||
|
||||
@@ -335,14 +337,12 @@ waha.core.version.used: |-
|
||||
[**🎁 ادعمنا**]({{{supportUrl}}})
|
||||
|
||||
chatwoot.to.whatsapp.message.text: |-
|
||||
{{#chatwoot.sender.name}}*{{{chatwoot.sender.name}}}*:
|
||||
{{/chatwoot.sender.name}}{{{ content }}}
|
||||
{{{ content }}}
|
||||
|
||||
chatwoot.to.whatsapp.message.media.caption: |-
|
||||
{{#singleAttachment}}
|
||||
{{#content}}
|
||||
{{#chatwoot.sender.name}}*{{{chatwoot.sender.name}}}*:
|
||||
{{/chatwoot.sender.name}}{{{ content }}}
|
||||
{{{ content }}}
|
||||
{{/content}}
|
||||
{{/singleAttachment}}
|
||||
|
||||
|
||||
@@ -325,6 +325,8 @@ waha.new.version.available: |-
|
||||
|
||||
👉 [**🆕 পরিবর্তন লগ**]({{{changelogUrl}}}) এ নতুন কি আছে তা দেখুন
|
||||
|
||||
_এই বিজ্ঞপ্তিগুলি অক্ষম করতে, পাঠান_ `queue stop check.version`
|
||||
|
||||
waha.core.version.used: |-
|
||||
❤️ **WAHA সমর্থন করুন!**
|
||||
|
||||
@@ -335,14 +337,12 @@ waha.core.version.used: |-
|
||||
[**🎁 আমাদের সমর্থন করুন**]({{{supportUrl}}})
|
||||
|
||||
chatwoot.to.whatsapp.message.text: |-
|
||||
{{#chatwoot.sender.name}}*{{{chatwoot.sender.name}}}*:
|
||||
{{/chatwoot.sender.name}}{{{ content }}}
|
||||
{{{ content }}}
|
||||
|
||||
chatwoot.to.whatsapp.message.media.caption: |-
|
||||
{{#singleAttachment}}
|
||||
{{#content}}
|
||||
{{#chatwoot.sender.name}}*{{{chatwoot.sender.name}}}*:
|
||||
{{/chatwoot.sender.name}}{{{ content }}}
|
||||
{{{ content }}}
|
||||
{{/content}}
|
||||
{{/singleAttachment}}
|
||||
|
||||
|
||||
@@ -328,6 +328,8 @@ waha.new.version.available: |-
|
||||
|
||||
👉 Sehen Sie, was neu ist im [**🆕 Änderungsprotokoll**]({{{changelogUrl}}})
|
||||
|
||||
_Um diese Benachrichtigungen zu deaktivieren, senden Sie_ `queue stop check.version`
|
||||
|
||||
waha.core.version.used: |-
|
||||
❤️ **Unterstützen Sie WAHA!**
|
||||
|
||||
@@ -338,14 +340,12 @@ waha.core.version.used: |-
|
||||
[**🎁 Unterstützen Sie uns**]({{{supportUrl}}})
|
||||
|
||||
chatwoot.to.whatsapp.message.text: |-
|
||||
{{#chatwoot.sender.name}}*{{{chatwoot.sender.name}}}*:
|
||||
{{/chatwoot.sender.name}}{{{ content }}}
|
||||
{{{ content }}}
|
||||
|
||||
chatwoot.to.whatsapp.message.media.caption: |-
|
||||
{{#singleAttachment}}
|
||||
{{#content}}
|
||||
{{#chatwoot.sender.name}}*{{{chatwoot.sender.name}}}*:
|
||||
{{/chatwoot.sender.name}}{{{ content }}}
|
||||
{{{ content }}}
|
||||
{{/content}}
|
||||
{{/singleAttachment}}
|
||||
|
||||
|
||||
@@ -116,14 +116,12 @@ whatsapp.contact.broadcast.suffix: 'Broadcast List'
|
||||
whatsapp.contact.status.name: 'Status'
|
||||
|
||||
chatwoot.to.whatsapp.message.text: |-
|
||||
{{#chatwoot.sender.name}}*{{{chatwoot.sender.name}}}*:
|
||||
{{/chatwoot.sender.name}}{{{ content }}}
|
||||
{{{ content }}}
|
||||
|
||||
chatwoot.to.whatsapp.message.media.caption: |-
|
||||
{{#singleAttachment}}
|
||||
{{#content}}
|
||||
{{#chatwoot.sender.name}}*{{{chatwoot.sender.name}}}*:
|
||||
{{/chatwoot.sender.name}}{{{ content }}}
|
||||
{{{ content }}}
|
||||
{{/content}}
|
||||
{{/singleAttachment}}
|
||||
|
||||
@@ -716,6 +714,8 @@ waha.new.version.available: |-
|
||||
|
||||
👉 Check out what's new in the [**🆕 Changelog**]({{{changelogUrl}}})
|
||||
|
||||
_To disable these notifications, send_ `queue stop check.version`
|
||||
|
||||
waha.core.version.used: |-
|
||||
❤️ **Support WAHA!**
|
||||
|
||||
|
||||
@@ -325,6 +325,8 @@ waha.new.version.available: |-
|
||||
|
||||
👉 Mira qué hay de nuevo en el [**🆕 Registro de Cambios**]({{{changelogUrl}}})
|
||||
|
||||
_Para desactivar estas notificaciones, envía_ `queue stop check.version`
|
||||
|
||||
waha.core.version.used: |-
|
||||
❤️ **¡Apoya a WAHA!**
|
||||
|
||||
@@ -335,14 +337,12 @@ waha.core.version.used: |-
|
||||
[**🎁 Apóyanos**]({{{supportUrl}}})
|
||||
|
||||
chatwoot.to.whatsapp.message.text: |-
|
||||
{{#chatwoot.sender.name}}*{{{chatwoot.sender.name}}}*:
|
||||
{{/chatwoot.sender.name}}{{{ content }}}
|
||||
{{{ content }}}
|
||||
|
||||
chatwoot.to.whatsapp.message.media.caption: |-
|
||||
{{#singleAttachment}}
|
||||
{{#content}}
|
||||
{{#chatwoot.sender.name}}*{{{chatwoot.sender.name}}}*:
|
||||
{{/chatwoot.sender.name}}{{{ content }}}
|
||||
{{{ content }}}
|
||||
{{/content}}
|
||||
{{/singleAttachment}}
|
||||
|
||||
|
||||
@@ -325,6 +325,8 @@ waha.new.version.available: |-
|
||||
|
||||
👉 موارد جدید را در [**🆕 تغییرات**]({{{changelogUrl}}}) مشاهده کنید
|
||||
|
||||
_برای غیرفعال کردن این اعلانها، ارسال کنید_ `queue stop check.version`
|
||||
|
||||
waha.core.version.used: |-
|
||||
❤️ **از WAHA پشتیبانی کنید!**
|
||||
|
||||
@@ -335,14 +337,12 @@ waha.core.version.used: |-
|
||||
[**🎁 از ما حمایت کنید**]({{{supportUrl}}})
|
||||
|
||||
chatwoot.to.whatsapp.message.text: |-
|
||||
{{#chatwoot.sender.name}}*{{{chatwoot.sender.name}}}*:
|
||||
{{/chatwoot.sender.name}}{{{ content }}}
|
||||
{{{ content }}}
|
||||
|
||||
chatwoot.to.whatsapp.message.media.caption: |-
|
||||
{{#singleAttachment}}
|
||||
{{#content}}
|
||||
{{#chatwoot.sender.name}}*{{{chatwoot.sender.name}}}*:
|
||||
{{/chatwoot.sender.name}}{{{ content }}}
|
||||
{{{ content }}}
|
||||
{{/content}}
|
||||
{{/singleAttachment}}
|
||||
|
||||
|
||||
@@ -325,6 +325,8 @@ waha.new.version.available: |-
|
||||
|
||||
👉 Découvrez les nouveautés dans le [**🆕 Journal des modifications**]({{{changelogUrl}}})
|
||||
|
||||
_Pour désactiver ces notifications, envoyez_ `queue stop check.version`
|
||||
|
||||
waha.core.version.used: |-
|
||||
❤️ **Soutenez WAHA !**
|
||||
|
||||
@@ -335,14 +337,12 @@ waha.core.version.used: |-
|
||||
[**🎁 Soutenez-nous**]({{{supportUrl}}})
|
||||
|
||||
chatwoot.to.whatsapp.message.text: |-
|
||||
{{#chatwoot.sender.name}}*{{{chatwoot.sender.name}}}*:
|
||||
{{/chatwoot.sender.name}}{{{ content }}}
|
||||
{{{ content }}}
|
||||
|
||||
chatwoot.to.whatsapp.message.media.caption: |-
|
||||
{{#singleAttachment}}
|
||||
{{#content}}
|
||||
{{#chatwoot.sender.name}}*{{{chatwoot.sender.name}}}*:
|
||||
{{/chatwoot.sender.name}}{{{ content }}}
|
||||
{{{ content }}}
|
||||
{{/content}}
|
||||
{{/singleAttachment}}
|
||||
|
||||
|
||||
@@ -325,6 +325,8 @@ waha.new.version.available: |-
|
||||
|
||||
👉 בדוק מה חדש ב[**🆕 יומן שינויים**]({{{changelogUrl}}})
|
||||
|
||||
_כדי לבטל התראות אלו, שלח_ `queue stop check.version`
|
||||
|
||||
waha.core.version.used: |-
|
||||
❤️ **תמוך ב-WAHA!**
|
||||
|
||||
@@ -335,14 +337,12 @@ waha.core.version.used: |-
|
||||
[**🎁 תמוך בנו**]({{{supportUrl}}})
|
||||
|
||||
chatwoot.to.whatsapp.message.text: |-
|
||||
{{#chatwoot.sender.name}}*{{{chatwoot.sender.name}}}*:
|
||||
{{/chatwoot.sender.name}}{{{ content }}}
|
||||
{{{ content }}}
|
||||
|
||||
chatwoot.to.whatsapp.message.media.caption: |-
|
||||
{{#singleAttachment}}
|
||||
{{#content}}
|
||||
{{#chatwoot.sender.name}}*{{{chatwoot.sender.name}}}*:
|
||||
{{/chatwoot.sender.name}}{{{ content }}}
|
||||
{{{ content }}}
|
||||
{{/content}}
|
||||
{{/singleAttachment}}
|
||||
|
||||
|
||||
@@ -325,6 +325,8 @@ waha.new.version.available: |-
|
||||
|
||||
👉 [**🆕 चेंजलॉग**]({{{changelogUrl}}}) में क्या नया है देखें
|
||||
|
||||
_इन सूचनाओं को अक्षम करने के लिए, भेजें_ `queue stop check.version`
|
||||
|
||||
waha.core.version.used: |-
|
||||
❤️ **WAHA का समर्थन करें!**
|
||||
|
||||
@@ -335,14 +337,12 @@ waha.core.version.used: |-
|
||||
[**🎁 हमें समर्थन दें**]({{{supportUrl}}})
|
||||
|
||||
chatwoot.to.whatsapp.message.text: |-
|
||||
{{#chatwoot.sender.name}}*{{{chatwoot.sender.name}}}*:
|
||||
{{/chatwoot.sender.name}}{{{ content }}}
|
||||
{{{ content }}}
|
||||
|
||||
chatwoot.to.whatsapp.message.media.caption: |-
|
||||
{{#singleAttachment}}
|
||||
{{#content}}
|
||||
{{#chatwoot.sender.name}}*{{{chatwoot.sender.name}}}*:
|
||||
{{/chatwoot.sender.name}}{{{ content }}}
|
||||
{{{ content }}}
|
||||
{{/content}}
|
||||
{{/singleAttachment}}
|
||||
|
||||
|
||||
@@ -325,6 +325,8 @@ waha.new.version.available: |-
|
||||
|
||||
👉 Lihat apa yang baru di [**🆕 Changelog**]({{{changelogUrl}}})
|
||||
|
||||
_Untuk menonaktifkan notifikasi ini, kirim_ `queue stop check.version`
|
||||
|
||||
waha.core.version.used: |-
|
||||
❤️ **Dukung WAHA!**
|
||||
|
||||
@@ -335,14 +337,12 @@ waha.core.version.used: |-
|
||||
[**🎁 Dukung Kami**]({{{supportUrl}}})
|
||||
|
||||
chatwoot.to.whatsapp.message.text: |-
|
||||
{{#chatwoot.sender.name}}*{{{chatwoot.sender.name}}}*:
|
||||
{{/chatwoot.sender.name}}{{{ content }}}
|
||||
{{{ content }}}
|
||||
|
||||
chatwoot.to.whatsapp.message.media.caption: |-
|
||||
{{#singleAttachment}}
|
||||
{{#content}}
|
||||
{{#chatwoot.sender.name}}*{{{chatwoot.sender.name}}}*:
|
||||
{{/chatwoot.sender.name}}{{{ content }}}
|
||||
{{{ content }}}
|
||||
{{/content}}
|
||||
{{/singleAttachment}}
|
||||
|
||||
|
||||
@@ -116,14 +116,12 @@ whatsapp.contact.broadcast.suffix: 'Lista Broadcast'
|
||||
whatsapp.contact.status.name: 'Stato'
|
||||
|
||||
chatwoot.to.whatsapp.message.text: |-
|
||||
{{#chatwoot.sender.name}}*{{{chatwoot.sender.name}}}*:
|
||||
{{/chatwoot.sender.name}}{{{ content }}}
|
||||
{{{ content }}}
|
||||
|
||||
chatwoot.to.whatsapp.message.media.caption: |-
|
||||
{{#singleAttachment}}
|
||||
{{#content}}
|
||||
{{#chatwoot.sender.name}}*{{{chatwoot.sender.name}}}*:
|
||||
{{/chatwoot.sender.name}}{{{ content }}}
|
||||
{{{ content }}}
|
||||
{{/content}}
|
||||
{{/singleAttachment}}
|
||||
|
||||
@@ -716,6 +714,8 @@ waha.new.version.available: |-
|
||||
|
||||
👉 Scopri le novità nel [**🆕 Changelog**]({{{changelogUrl}}})
|
||||
|
||||
_Per disattivare queste notifiche, invia_ `queue stop check.version`
|
||||
|
||||
waha.core.version.used: |-
|
||||
❤️ **Supporta WAHA!**
|
||||
|
||||
|
||||
@@ -325,6 +325,8 @@ waha.new.version.available: |-
|
||||
|
||||
👉 [**🆕 ਬਦਲਾਅ ਲੌਗ**]({{{changelogUrl}}}) ਵਿੱਚ ਨਵਾਂ ਕੀ ਹੈ ਦੇਖੋ
|
||||
|
||||
_ਇਹ ਸੂਚਨਾਵਾਂ ਬੰਦ ਕਰਨ ਲਈ, ਭੇਜੋ_ `queue stop check.version`
|
||||
|
||||
waha.core.version.used: |-
|
||||
❤️ **WAHA ਦਾ ਸਮਰਥਨ ਕਰੋ!**
|
||||
|
||||
@@ -335,14 +337,12 @@ waha.core.version.used: |-
|
||||
[**🎁 ਸਾਡਾ ਸਮਰਥਨ ਕਰੋ**]({{{supportUrl}}})
|
||||
|
||||
chatwoot.to.whatsapp.message.text: |-
|
||||
{{#chatwoot.sender.name}}*{{{chatwoot.sender.name}}}*:
|
||||
{{/chatwoot.sender.name}}{{{ content }}}
|
||||
{{{ content }}}
|
||||
|
||||
chatwoot.to.whatsapp.message.media.caption: |-
|
||||
{{#singleAttachment}}
|
||||
{{#content}}
|
||||
{{#chatwoot.sender.name}}*{{{chatwoot.sender.name}}}*:
|
||||
{{/chatwoot.sender.name}}{{{ content }}}
|
||||
{{{ content }}}
|
||||
{{/content}}
|
||||
{{/singleAttachment}}
|
||||
|
||||
|
||||
@@ -326,6 +326,8 @@ waha.new.version.available: |-
|
||||
|
||||
👉 Confira o que há de novo no [**🆕 Registro de Alterações**]({{{changelogUrl}}})
|
||||
|
||||
_Para desativar essas notificações, envie_ `queue stop check.version`
|
||||
|
||||
waha.core.version.used: |-
|
||||
❤️ **Apoie o WAHA!**
|
||||
|
||||
@@ -336,14 +338,12 @@ waha.core.version.used: |-
|
||||
[**🎁 Apoie-nos**]({{{supportUrl}}})
|
||||
|
||||
chatwoot.to.whatsapp.message.text: |-
|
||||
{{#chatwoot.sender.name}}*{{{chatwoot.sender.name}}}*:
|
||||
{{/chatwoot.sender.name}}{{{ content }}}
|
||||
{{{ content }}}
|
||||
|
||||
chatwoot.to.whatsapp.message.media.caption: |-
|
||||
{{#singleAttachment}}
|
||||
{{#content}}
|
||||
{{#chatwoot.sender.name}}*{{{chatwoot.sender.name}}}*:
|
||||
{{/chatwoot.sender.name}}{{{ content }}}
|
||||
{{{ content }}}
|
||||
{{/content}}
|
||||
{{/singleAttachment}}
|
||||
|
||||
|
||||
@@ -325,6 +325,8 @@ waha.new.version.available: |-
|
||||
|
||||
👉 Узнайте, что нового в [**🆕 Списке изменений**]({{{changelogUrl}}})
|
||||
|
||||
_Чтобы отключить эти уведомления, отправьте_ `queue stop check.version`
|
||||
|
||||
waha.core.version.used: |-
|
||||
❤️ **Поддержите WAHA!**
|
||||
|
||||
@@ -335,14 +337,12 @@ waha.core.version.used: |-
|
||||
[**🎁 Поддержать нас**]({{{supportUrl}}})
|
||||
|
||||
chatwoot.to.whatsapp.message.text: |-
|
||||
{{#chatwoot.sender.name}}*{{{chatwoot.sender.name}}}*:
|
||||
{{/chatwoot.sender.name}}{{{ content }}}
|
||||
{{{ content }}}
|
||||
|
||||
chatwoot.to.whatsapp.message.media.caption: |-
|
||||
{{#singleAttachment}}
|
||||
{{#content}}
|
||||
{{#chatwoot.sender.name}}*{{{chatwoot.sender.name}}}*:
|
||||
{{/chatwoot.sender.name}}{{{ content }}}
|
||||
{{{ content }}}
|
||||
{{/content}}
|
||||
{{/singleAttachment}}
|
||||
|
||||
|
||||
@@ -325,6 +325,8 @@ waha.new.version.available: |-
|
||||
|
||||
👉 [**🆕 Değişiklik Günlüğü**]({{{changelogUrl}}}) içinde yenilikleri kontrol edin
|
||||
|
||||
_Bu bildirimleri devre dışı bırakmak için gönderin_ `queue stop check.version`
|
||||
|
||||
waha.core.version.used: |-
|
||||
❤️ **WAHA'yı Destekleyin!**
|
||||
|
||||
@@ -335,14 +337,12 @@ waha.core.version.used: |-
|
||||
[**🎁 Bizi Destekleyin**]({{{supportUrl}}})
|
||||
|
||||
chatwoot.to.whatsapp.message.text: |-
|
||||
{{#chatwoot.sender.name}}*{{{chatwoot.sender.name}}}*:
|
||||
{{/chatwoot.sender.name}}{{{ content }}}
|
||||
{{{ content }}}
|
||||
|
||||
chatwoot.to.whatsapp.message.media.caption: |-
|
||||
{{#singleAttachment}}
|
||||
{{#content}}
|
||||
{{#chatwoot.sender.name}}*{{{chatwoot.sender.name}}}*:
|
||||
{{/chatwoot.sender.name}}{{{ content }}}
|
||||
{{{ content }}}
|
||||
{{/content}}
|
||||
{{/singleAttachment}}
|
||||
|
||||
|
||||
@@ -325,6 +325,8 @@ waha.new.version.available: |-
|
||||
|
||||
👉 Перевірте, що нового у [**🆕 Журналі змін**]({{{changelogUrl}}})
|
||||
|
||||
_Щоб вимкнути ці сповіщення, надішліть_ `queue stop check.version`
|
||||
|
||||
waha.core.version.used: |-
|
||||
❤️ **Підтримайте WAHA!**
|
||||
|
||||
@@ -335,14 +337,12 @@ waha.core.version.used: |-
|
||||
[**🎁 Підтримайте нас**]({{{supportUrl}}})
|
||||
|
||||
chatwoot.to.whatsapp.message.text: |-
|
||||
{{#chatwoot.sender.name}}*{{{chatwoot.sender.name}}}*:
|
||||
{{/chatwoot.sender.name}}{{{ content }}}
|
||||
{{{ content }}}
|
||||
|
||||
chatwoot.to.whatsapp.message.media.caption: |-
|
||||
{{#singleAttachment}}
|
||||
{{#content}}
|
||||
{{#chatwoot.sender.name}}*{{{chatwoot.sender.name}}}*:
|
||||
{{/chatwoot.sender.name}}{{{ content }}}
|
||||
{{{ content }}}
|
||||
{{/content}}
|
||||
{{/singleAttachment}}
|
||||
|
||||
|
||||
@@ -325,6 +325,8 @@ waha.new.version.available: |-
|
||||
|
||||
👉 [**🆕 تبدیلیوں کی فہرست**]({{{changelogUrl}}}) میں نیا کیا ہے دیکھیں
|
||||
|
||||
_ان اطلاعات کو بند کرنے کے لیے بھیجیں_ `queue stop check.version`
|
||||
|
||||
waha.core.version.used: |-
|
||||
❤️ **WAHA کی حمایت کریں!**
|
||||
|
||||
@@ -335,14 +337,12 @@ waha.core.version.used: |-
|
||||
[**🎁 ہماری حمایت کریں**]({{{supportUrl}}})
|
||||
|
||||
chatwoot.to.whatsapp.message.text: |-
|
||||
{{#chatwoot.sender.name}}*{{{chatwoot.sender.name}}}*:
|
||||
{{/chatwoot.sender.name}}{{{ content }}}
|
||||
{{{ content }}}
|
||||
|
||||
chatwoot.to.whatsapp.message.media.caption: |-
|
||||
{{#singleAttachment}}
|
||||
{{#content}}
|
||||
{{#chatwoot.sender.name}}*{{{chatwoot.sender.name}}}*:
|
||||
{{/chatwoot.sender.name}}{{{ content }}}
|
||||
{{{ content }}}
|
||||
{{/content}}
|
||||
{{/singleAttachment}}
|
||||
|
||||
|
||||
@@ -325,6 +325,8 @@ waha.new.version.available: |-
|
||||
|
||||
👉 查看[**🆕 更新日志**]({{{changelogUrl}}})
|
||||
|
||||
_要禁用这些通知,请发送_ `queue stop check.version`
|
||||
|
||||
waha.core.version.used: |-
|
||||
❤️ **支持 WAHA!**
|
||||
|
||||
@@ -335,14 +337,12 @@ waha.core.version.used: |-
|
||||
[**🎁 支持我们**]({{{supportUrl}}})
|
||||
|
||||
chatwoot.to.whatsapp.message.text: |-
|
||||
{{#chatwoot.sender.name}}*{{{chatwoot.sender.name}}}*:
|
||||
{{/chatwoot.sender.name}}{{{ content }}}
|
||||
{{{ content }}}
|
||||
|
||||
chatwoot.to.whatsapp.message.media.caption: |-
|
||||
{{#singleAttachment}}
|
||||
{{#content}}
|
||||
{{#chatwoot.sender.name}}*{{{chatwoot.sender.name}}}*:
|
||||
{{/chatwoot.sender.name}}{{{ content }}}
|
||||
{{{ content }}}
|
||||
{{/content}}
|
||||
{{/singleAttachment}}
|
||||
|
||||
|
||||
@@ -54,6 +54,21 @@ export class ChatWootScheduleService {
|
||||
},
|
||||
},
|
||||
);
|
||||
// Check the tier
|
||||
const checkTierQueue = this.queueRegistry.queue(
|
||||
QueueName.SCHEDULED_CHECK_TIER,
|
||||
);
|
||||
await checkTierQueue.upsertJobScheduler(
|
||||
this.JobId(QueueName.SCHEDULED_CHECK_TIER, appId),
|
||||
// Every Monday (1) at 14:00
|
||||
{ pattern: '0 0 14 * * 1' },
|
||||
{
|
||||
data: {
|
||||
app: appId,
|
||||
session: sessionName,
|
||||
},
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
async unschedule(appId: string, sessionName: string): Promise<void> {
|
||||
@@ -71,6 +86,13 @@ export class ChatWootScheduleService {
|
||||
await checkVersionQueue.removeJobScheduler(
|
||||
this.JobId(QueueName.SCHEDULED_CHECK_VERSION, appId),
|
||||
);
|
||||
// Check the tier
|
||||
const checkTierQueue = this.queueRegistry.queue(
|
||||
QueueName.SCHEDULED_CHECK_TIER,
|
||||
);
|
||||
await checkTierQueue.removeJobScheduler(
|
||||
this.JobId(QueueName.SCHEDULED_CHECK_TIER, appId),
|
||||
);
|
||||
|
||||
// contacts
|
||||
const contactsPullQueue = this.queueRegistry.queue(
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { QueueName } from '../consumers/QueueName';
|
||||
import { QueueRegistry } from '@waha/apps/chatwoot/services/QueueRegistry';
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { QueueNameRepr } from '@waha/apps/app_sdk/JobUtils';
|
||||
|
||||
const Managable = true;
|
||||
const Locked = false;
|
||||
@@ -18,7 +19,8 @@ export class QueueManager {
|
||||
constructor(private readonly registry: QueueRegistry) {
|
||||
this.queues = {
|
||||
[QueueName.SCHEDULED_MESSAGE_CLEANUP]: Locked,
|
||||
[QueueName.SCHEDULED_CHECK_VERSION]: Locked,
|
||||
[QueueName.SCHEDULED_CHECK_VERSION]: Managable,
|
||||
[QueueName.SCHEDULED_CHECK_TIER]: Locked,
|
||||
[QueueName.TASK_CONTACTS_PULL]: Locked,
|
||||
[QueueName.TASK_MESSAGES_PULL]: Locked,
|
||||
[QueueName.WAHA_SESSION_STATUS]: Locked,
|
||||
@@ -75,8 +77,19 @@ export class QueueManager {
|
||||
case undefined:
|
||||
return queues;
|
||||
|
||||
default:
|
||||
default: {
|
||||
const matches = queues.filter((q) => q.split(' | ')[1] === shortcut);
|
||||
if (matches.length === 1) {
|
||||
return [matches[0]];
|
||||
}
|
||||
if (matches.length > 1) {
|
||||
const names = matches.map(QueueNameRepr).join(', ');
|
||||
throw new Error(
|
||||
`Ambiguous queue name "${shortcut}", matches: ${names}`,
|
||||
);
|
||||
}
|
||||
return [shortcut as QueueName];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,6 +16,8 @@ export class QueueRegistry {
|
||||
private readonly scheduledMessageCleanupQueue: Queue,
|
||||
@InjectQueue(QueueName.SCHEDULED_CHECK_VERSION)
|
||||
private readonly scheduledCheckVersionQueue: Queue,
|
||||
@InjectQueue(QueueName.SCHEDULED_CHECK_TIER)
|
||||
private readonly scheduledCheckTierQueue: Queue,
|
||||
@InjectQueue(QueueName.TASK_CONTACTS_PULL)
|
||||
private readonly taskContactsPullQueue: Queue,
|
||||
@InjectQueue(QueueName.TASK_MESSAGES_PULL)
|
||||
@@ -55,6 +57,7 @@ export class QueueRegistry {
|
||||
this.queues = {
|
||||
[QueueName.SCHEDULED_MESSAGE_CLEANUP]: this.scheduledMessageCleanupQueue,
|
||||
[QueueName.SCHEDULED_CHECK_VERSION]: this.scheduledCheckVersionQueue,
|
||||
[QueueName.SCHEDULED_CHECK_TIER]: this.scheduledCheckTierQueue,
|
||||
[QueueName.TASK_CONTACTS_PULL]: this.taskContactsPullQueue,
|
||||
[QueueName.TASK_MESSAGES_PULL]: this.taskMessagesPullQueue,
|
||||
[QueueName.WAHA_SESSION_STATUS]: this.wahaSessionStatusQueue,
|
||||
|
||||
+1
-1
@@ -48,7 +48,7 @@ function getPlatform() {
|
||||
}
|
||||
|
||||
export const VERSION: WAHAEnvironment = {
|
||||
version: '2026.4.1',
|
||||
version: '2026.4.2',
|
||||
engine: getEngineName(),
|
||||
tier: getWAHAVersion(),
|
||||
browser: getBrowser(),
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@
|
||||
},
|
||||
"dashboard": {
|
||||
"repo": "devlikeapro/dashboard",
|
||||
"ref": "968c44f1f9a607bd04dc0133eb0a40db3a1a28ec"
|
||||
"ref": "9ea5668d6052cd0b1e68c6b6ba58b6f161b14907"
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user