Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4fdfce3944 | ||
|
|
1e12a83cdf | ||
|
|
1c41b8be65 | ||
|
|
f72ee7c1f8 | ||
|
|
e75912435b | ||
|
|
da294a58a6 | ||
|
|
7689199e11 | ||
|
|
324ab11f09 | ||
|
|
b1f2e17e3d | ||
|
|
90822cd582 | ||
|
|
9eec72b641 | ||
|
|
050c652480 |
No files matched your search
@@ -10,6 +10,8 @@ docs
|
||||
examples
|
||||
.github
|
||||
.git
|
||||
.envs/*
|
||||
.env
|
||||
|
||||
# compiled output
|
||||
/dist
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
src/core/engines/gows/proto
|
||||
.env
|
||||
.envs/*
|
||||
*.heapsnapshot
|
||||
.yarn
|
||||
example.ts
|
||||
|
||||
@@ -35,13 +35,13 @@ for-swagger:
|
||||
WHATSAPP_SWAGGER_CONFIG_ADVANCED=true . ${NVM_DIR}/nvm.sh && nvm exec yarn start
|
||||
|
||||
up-noweb:
|
||||
yarn up @adiwajshing/baileys@github:devlikeapro/Baileys#fork-master-2025-10-19
|
||||
yarn up @adiwajshing/baileys@github:devlikeapro/Baileys#fork-master-2025-11-07
|
||||
|
||||
up-noweb-libsignal:
|
||||
yarn up libsignal@github:devlikeapro/libsignal-node#fork-master
|
||||
|
||||
up-webjs:
|
||||
yarn up whatsapp-web.js@github:devlikeapro/whatsapp-web.js#fork-main-2025-09-10
|
||||
yarn up whatsapp-web.js@github:devlikeapro/whatsapp-web.js#fork-main-2025-11-05
|
||||
|
||||
start-proxy:
|
||||
docker run --rm -d --name squid-container -e TZ=UTC -p 3128:3128 ubuntu/squid:5.2-22.04_beta
|
||||
|
||||
+3
-2
@@ -26,7 +26,7 @@
|
||||
"gows:proto": "yarn gows:proto:fetch && yarn gows:proto:build"
|
||||
},
|
||||
"dependencies": {
|
||||
"@adiwajshing/baileys": "github:devlikeapro/Baileys#fork-master-2025-10-19",
|
||||
"@adiwajshing/baileys": "github:devlikeapro/Baileys#fork-master-2025-11-07",
|
||||
"@adiwajshing/keyed-db": "^0.2.4",
|
||||
"@aws-sdk/client-s3": "^3.633.0",
|
||||
"@aws-sdk/s3-request-presigner": "^3.633.0",
|
||||
@@ -106,7 +106,7 @@
|
||||
"swagger-ui-express": "^4.1.4",
|
||||
"ulid": "^2.3.0",
|
||||
"undici": "^7.16.0",
|
||||
"whatsapp-web.js": "github:devlikeapro/whatsapp-web.js#fork-main-2025-09-10",
|
||||
"whatsapp-web.js": "github:devlikeapro/whatsapp-web.js#fork-main-2025-11-05",
|
||||
"write-file-atomic": "^6.0.0",
|
||||
"yaml": "^2.7.1"
|
||||
},
|
||||
@@ -132,6 +132,7 @@
|
||||
"@types/node-fetch": "^2.6.13",
|
||||
"@types/semver": "^7.7.0",
|
||||
"@types/supertest": "^2.0.8",
|
||||
"dotenv": "^17.2.3",
|
||||
"grpc-tools": "^1.13.0",
|
||||
"jest": "^29.7.0",
|
||||
"oxlint": "^1.13.0",
|
||||
|
||||
@@ -122,6 +122,9 @@ class ChatsController {
|
||||
@WorkingSessionParam session: WhatsappSession,
|
||||
@Param('chatId') chatId: string,
|
||||
) {
|
||||
if (query.sortBy == MessageSortField.MESSAGE_TIMESTAMP) {
|
||||
query.sortBy = MessageSortField.TIMESTAMP;
|
||||
}
|
||||
query.sortBy = query.sortBy || MessageSortField.TIMESTAMP;
|
||||
query.sortOrder = query.sortOrder || SortOrder.DESC;
|
||||
filter = transformAck(filter);
|
||||
|
||||
@@ -5,6 +5,7 @@ import {
|
||||
Post,
|
||||
Put,
|
||||
Query,
|
||||
UnprocessableEntityException,
|
||||
UsePipes,
|
||||
ValidationPipe,
|
||||
} from '@nestjs/common';
|
||||
@@ -44,6 +45,20 @@ import {
|
||||
WANumberExistResult,
|
||||
} from '../structures/chatting.dto';
|
||||
import { WAMessage } from '../structures/responses.dto';
|
||||
import { isJidGroup } from '@waha/core/utils/jids';
|
||||
|
||||
function validateRequestMentions(request: MessageTextRequest) {
|
||||
if (!isJidGroup(request.chatId)) {
|
||||
throw new UnprocessableEntityException(
|
||||
`"mentions":["all"] can be used only in group chats, not in '${request.chatId}'`,
|
||||
);
|
||||
}
|
||||
if (request.mentions.length > 1) {
|
||||
throw new UnprocessableEntityException(
|
||||
`"mentions":["all"] cannot be used with other mentions`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ApiSecurity('api_key')
|
||||
@Controller('api')
|
||||
@@ -55,6 +70,15 @@ export class ChattingController {
|
||||
@ApiOperation({ summary: 'Send a text message' })
|
||||
async sendText(@Body() request: MessageTextRequest): Promise<WAMessage> {
|
||||
const whatsapp = await this.manager.getWorkingSession(request.session);
|
||||
if (request.mentions && request.mentions.includes('all')) {
|
||||
validateRequestMentions(request);
|
||||
const participants = await whatsapp.getGroupParticipants(request.chatId);
|
||||
let mentions = participants.map((p) => p.id);
|
||||
// Exclude my ids
|
||||
const me = whatsapp.getSessionMeInfo();
|
||||
mentions = mentions.filter((id) => id !== me.id && id !== me.lid);
|
||||
request.mentions = mentions;
|
||||
}
|
||||
return whatsapp.sendText(request);
|
||||
}
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@ import {
|
||||
CreateGroupRequest,
|
||||
DescriptionRequest,
|
||||
GroupField,
|
||||
GroupParticipant,
|
||||
GroupsListFields,
|
||||
GroupsPaginationParams,
|
||||
JoinGroupRequest,
|
||||
@@ -320,6 +321,17 @@ export class GroupsController {
|
||||
return session.getParticipants(id);
|
||||
}
|
||||
|
||||
@Get(':id/participants/v2')
|
||||
@GroupIdApiParam
|
||||
@SessionApiParam
|
||||
@ApiOperation({ summary: 'Get group participants.' })
|
||||
getGroupParticipants(
|
||||
@WorkingSessionParam session: WhatsappSession,
|
||||
@Param('id') id: string,
|
||||
): Promise<GroupParticipant[]> {
|
||||
return session.getGroupParticipants(id);
|
||||
}
|
||||
|
||||
@Post(':id/participants/add')
|
||||
@HttpCode(HttpStatus.OK)
|
||||
@SessionApiParam
|
||||
|
||||
@@ -2,7 +2,6 @@ import { Controller, Get } from '@nestjs/common';
|
||||
import { ApiOperation, ApiSecurity, ApiTags } from '@nestjs/swagger';
|
||||
import { PingResponse } from '@waha/structures/ping.dto';
|
||||
|
||||
@ApiSecurity('api_key')
|
||||
@Controller('ping')
|
||||
@ApiTags('🔍 Observability')
|
||||
export class PingController {
|
||||
|
||||
@@ -51,6 +51,17 @@ export function HasBeenRetried(job: Job): boolean {
|
||||
return attemptsMade > 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Hide chatwoot and waha from queue name for user faced messages
|
||||
*/
|
||||
export function QueueNameRepr(name: string): string {
|
||||
// No "chatwoot" in the name always (it start with chatwoot)
|
||||
name = name.replace('chatwoot.', '');
|
||||
// Replace "waha" with "whatsapp"
|
||||
name = name.replace('waha |', 'whatsapp |');
|
||||
return name;
|
||||
}
|
||||
|
||||
let base =
|
||||
process.env.WAHA_PUBLIC_URL ||
|
||||
process.env.WAHA_BASE_URL ||
|
||||
@@ -59,7 +70,10 @@ let base =
|
||||
base = base.replace(/\/+$/, '');
|
||||
|
||||
export function JobLink(job: Job): { text: string; url: string } {
|
||||
const text = `${job.queueName} => ${job.id}`;
|
||||
// Use repr name for text
|
||||
const name = QueueNameRepr(job.queueName);
|
||||
const text = `${name} => ${job.id}`;
|
||||
// Use original queue name in the URL
|
||||
const queue = encodeURIComponent(job.queueName);
|
||||
const id = encodeURIComponent(job.id);
|
||||
const url = `${base}/jobs/queue/${queue}/${id}`;
|
||||
|
||||
@@ -3,14 +3,7 @@ import { QueueManager } from '@waha/apps/chatwoot/services/QueueManager';
|
||||
import { Locale } from '@waha/apps/chatwoot/i18n/locale';
|
||||
import { Conversation } from '@waha/apps/chatwoot/client/Conversation';
|
||||
import { QueueRegistry } from '@waha/apps/chatwoot/services/QueueRegistry';
|
||||
|
||||
function repr(name: string): string {
|
||||
// No chatwoot in the name always (it start with chatwoot)
|
||||
name = name.replace('chatwoot.', '');
|
||||
// No waha in the name
|
||||
name = name.replace('waha |', 'whatsapp |');
|
||||
return name;
|
||||
}
|
||||
import { QueueNameRepr } from '@waha/apps/app_sdk/JobUtils';
|
||||
|
||||
export interface QueueCommandContext {
|
||||
queues: {
|
||||
@@ -25,7 +18,7 @@ export async function QueueStatus(ctx: QueueCommandContext, name: string) {
|
||||
const names = manager.resolve(name);
|
||||
let result = await manager.status(names);
|
||||
for (const status of result) {
|
||||
status.name = repr(status.name);
|
||||
status.name = QueueNameRepr(status.name);
|
||||
}
|
||||
// locked: true - last
|
||||
result = lodash.sortBy(result, [(x) => !!x.locked, 'name']);
|
||||
|
||||
@@ -148,7 +148,12 @@ export class WhatsappConfigService implements OnApplicationBootstrap {
|
||||
if (!value) {
|
||||
return [];
|
||||
}
|
||||
return value.split(',');
|
||||
return value.split(',').filter(Boolean);
|
||||
}
|
||||
|
||||
getExcludedFullPaths(): string[] {
|
||||
const paths = this.getExcludedPaths();
|
||||
return paths.map((path) => (path.startsWith('/') ? path : `/${path}`));
|
||||
}
|
||||
|
||||
getHealthMediaFilesThreshold(): number {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { INestApplication } from '@nestjs/common';
|
||||
import * as lodash from 'lodash';
|
||||
import { DocumentBuilder, OpenAPIObject, SwaggerModule } from '@nestjs/swagger';
|
||||
import { DECORATORS } from '@nestjs/swagger/dist/constants';
|
||||
import { BasicAuthFunction } from '@waha/core/auth/basicAuth';
|
||||
@@ -185,13 +186,17 @@ export class SwaggerConfiguratorCore {
|
||||
setUpAuth(credentials: [string, string]): void {
|
||||
const [username, password] = credentials;
|
||||
const dashboardConfig = this.app.get(DashboardConfigServiceCore);
|
||||
const exclude = [
|
||||
const config = this.app.get(WhatsappConfigService);
|
||||
const exclude = lodash.uniq([
|
||||
'/api/',
|
||||
dashboardConfig.dashboardUri,
|
||||
'/health',
|
||||
'/ping',
|
||||
'/ws',
|
||||
'/webhooks/',
|
||||
];
|
||||
...config.getExcludedFullPaths(),
|
||||
]);
|
||||
|
||||
const authFunction = BasicAuthFunction(username, password, exclude);
|
||||
this.app.use(authFunction);
|
||||
}
|
||||
|
||||
@@ -101,6 +101,7 @@ import { EventMessageRequest } from '../../structures/events.dto';
|
||||
import {
|
||||
CreateGroupRequest,
|
||||
GroupField,
|
||||
GroupParticipant,
|
||||
GroupsListFields,
|
||||
ParticipantsRequest,
|
||||
SettingsSecurityChangeInfo,
|
||||
@@ -821,6 +822,10 @@ export abstract class WhatsappSession {
|
||||
throw new NotImplementedByEngineError();
|
||||
}
|
||||
|
||||
public getGroupParticipants(id: string): Promise<GroupParticipant[]> {
|
||||
throw new NotImplementedByEngineError();
|
||||
}
|
||||
|
||||
public getInfoAdminsOnly(id): Promise<SettingsSecurityChangeInfo> {
|
||||
throw new NotImplementedByEngineError();
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ import {
|
||||
GroupInfoFull,
|
||||
JoinedGroupEvent,
|
||||
} from '@waha/core/engines/gows/types.group';
|
||||
import { toJID } from '@waha/core/utils/jids';
|
||||
import { toCusFormat, toJID } from '@waha/core/utils/jids';
|
||||
import {
|
||||
GroupId,
|
||||
GroupInfo,
|
||||
@@ -116,7 +116,7 @@ function getParticipants(jids: string[] | null, type: GroupParticipantType) {
|
||||
const participants: GroupParticipant[] = [];
|
||||
for (const jid of jids) {
|
||||
participants.push({
|
||||
id: jid,
|
||||
id: toCusFormat(jid),
|
||||
role: role,
|
||||
});
|
||||
}
|
||||
@@ -124,7 +124,7 @@ function getParticipants(jids: string[] | null, type: GroupParticipantType) {
|
||||
}
|
||||
|
||||
function ToGroupInfo(group: GroupInfoFull): GroupInfo {
|
||||
const participants: GroupParticipant[] = extractParticipants(
|
||||
const participants: GroupParticipant[] = ToGroupParticipants(
|
||||
group.Participants,
|
||||
);
|
||||
return {
|
||||
@@ -169,7 +169,7 @@ function ToGroupInfoPartial(group: GroupInfoEvent): GroupInfo | null {
|
||||
return null;
|
||||
}
|
||||
|
||||
function extractParticipants(
|
||||
export function ToGroupParticipants(
|
||||
participants: GOWSGroupParticipant[],
|
||||
): GroupParticipant[] {
|
||||
const result: GroupParticipant[] = [];
|
||||
@@ -183,7 +183,8 @@ function extractParticipants(
|
||||
role = GroupParticipantRole.PARTICIPANT;
|
||||
}
|
||||
result.push({
|
||||
id: participant.JID,
|
||||
id: toCusFormat(participant.JID),
|
||||
pn: toCusFormat(participant.PhoneNumber),
|
||||
role: role,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -3564,9 +3564,10 @@ export namespace messages {
|
||||
list?: ListMessage;
|
||||
location?: Location;
|
||||
pollVote?: PollVoteMessage;
|
||||
mentions?: string[];
|
||||
}) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [11, 13], this.#one_of_decls);
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [11, 13, 19], this.#one_of_decls);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("session" in data && data.session != undefined) {
|
||||
this.session = data.session;
|
||||
@@ -3622,6 +3623,9 @@ export namespace messages {
|
||||
if ("pollVote" in data && data.pollVote != undefined) {
|
||||
this.pollVote = data.pollVote;
|
||||
}
|
||||
if ("mentions" in data && data.mentions != undefined) {
|
||||
this.mentions = data.mentions;
|
||||
}
|
||||
}
|
||||
}
|
||||
get session() {
|
||||
@@ -3762,6 +3766,12 @@ export namespace messages {
|
||||
get has_pollVote() {
|
||||
return pb_1.Message.getField(this, 18) != null;
|
||||
}
|
||||
get mentions() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 19, []) as string[];
|
||||
}
|
||||
set mentions(value: string[]) {
|
||||
pb_1.Message.setField(this, 19, value);
|
||||
}
|
||||
static fromObject(data: {
|
||||
session?: ReturnType<typeof Session.prototype.toObject>;
|
||||
jid?: string;
|
||||
@@ -3781,6 +3791,7 @@ export namespace messages {
|
||||
list?: ReturnType<typeof ListMessage.prototype.toObject>;
|
||||
location?: ReturnType<typeof Location.prototype.toObject>;
|
||||
pollVote?: ReturnType<typeof PollVoteMessage.prototype.toObject>;
|
||||
mentions?: string[];
|
||||
}): MessageRequest {
|
||||
const message = new MessageRequest({});
|
||||
if (data.session != null) {
|
||||
@@ -3837,6 +3848,9 @@ export namespace messages {
|
||||
if (data.pollVote != null) {
|
||||
message.pollVote = PollVoteMessage.fromObject(data.pollVote);
|
||||
}
|
||||
if (data.mentions != null) {
|
||||
message.mentions = data.mentions;
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
@@ -3859,6 +3873,7 @@ export namespace messages {
|
||||
list?: ReturnType<typeof ListMessage.prototype.toObject>;
|
||||
location?: ReturnType<typeof Location.prototype.toObject>;
|
||||
pollVote?: ReturnType<typeof PollVoteMessage.prototype.toObject>;
|
||||
mentions?: string[];
|
||||
} = {};
|
||||
if (this.session != null) {
|
||||
data.session = this.session.toObject();
|
||||
@@ -3914,6 +3929,9 @@ export namespace messages {
|
||||
if (this.pollVote != null) {
|
||||
data.pollVote = this.pollVote.toObject();
|
||||
}
|
||||
if (this.mentions != null) {
|
||||
data.mentions = this.mentions;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(): Uint8Array;
|
||||
@@ -3956,6 +3974,8 @@ export namespace messages {
|
||||
writer.writeMessage(17, this.location, () => this.location.serialize(writer));
|
||||
if (this.has_pollVote)
|
||||
writer.writeMessage(18, this.pollVote, () => this.pollVote.serialize(writer));
|
||||
if (this.mentions.length)
|
||||
writer.writeRepeatedString(19, this.mentions);
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
@@ -4019,6 +4039,9 @@ export namespace messages {
|
||||
case 18:
|
||||
reader.readMessage(message.pollVote, () => message.pollVote = PollVoteMessage.deserialize(reader));
|
||||
break;
|
||||
case 19:
|
||||
pb_1.Message.addToRepeatedField(message, 19, reader.readString());
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8555,7 +8555,7 @@ proto.messages.EventMessage.prototype.hasLocation = function() {
|
||||
* @private {!Array<number>}
|
||||
* @const
|
||||
*/
|
||||
proto.messages.MessageRequest.repeatedFields_ = [11,13];
|
||||
proto.messages.MessageRequest.repeatedFields_ = [11,13,19];
|
||||
|
||||
|
||||
|
||||
@@ -8606,7 +8606,8 @@ proto.messages.MessageRequest.toObject = function(includeInstance, msg) {
|
||||
poll: (f = msg.getPoll()) && proto.messages.PollMessage.toObject(includeInstance, f),
|
||||
list: (f = msg.getList()) && proto.messages.ListMessage.toObject(includeInstance, f),
|
||||
location: (f = msg.getLocation()) && proto.messages.Location.toObject(includeInstance, f),
|
||||
pollvote: (f = msg.getPollvote()) && proto.messages.PollVoteMessage.toObject(includeInstance, f)
|
||||
pollvote: (f = msg.getPollvote()) && proto.messages.PollVoteMessage.toObject(includeInstance, f),
|
||||
mentionsList: (f = jspb.Message.getRepeatedField(msg, 19)) == null ? undefined : f
|
||||
};
|
||||
|
||||
if (includeInstance) {
|
||||
@@ -8726,6 +8727,10 @@ proto.messages.MessageRequest.deserializeBinaryFromReader = function(msg, reader
|
||||
reader.readMessage(value,proto.messages.PollVoteMessage.deserializeBinaryFromReader);
|
||||
msg.setPollvote(value);
|
||||
break;
|
||||
case 19:
|
||||
var value = /** @type {string} */ (reader.readString());
|
||||
msg.addMentions(value);
|
||||
break;
|
||||
default:
|
||||
reader.skipField();
|
||||
break;
|
||||
@@ -8892,6 +8897,13 @@ proto.messages.MessageRequest.serializeBinaryToWriter = function(message, writer
|
||||
proto.messages.PollVoteMessage.serializeBinaryToWriter
|
||||
);
|
||||
}
|
||||
f = message.getMentionsList();
|
||||
if (f.length > 0) {
|
||||
writer.writeRepeatedString(
|
||||
19,
|
||||
f
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -9448,6 +9460,43 @@ proto.messages.MessageRequest.prototype.hasPollvote = function() {
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* repeated string mentions = 19;
|
||||
* @return {!Array<string>}
|
||||
*/
|
||||
proto.messages.MessageRequest.prototype.getMentionsList = function() {
|
||||
return /** @type {!Array<string>} */ (jspb.Message.getRepeatedField(this, 19));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {!Array<string>} value
|
||||
* @return {!proto.messages.MessageRequest} returns this
|
||||
*/
|
||||
proto.messages.MessageRequest.prototype.setMentionsList = function(value) {
|
||||
return jspb.Message.setField(this, 19, value || []);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {string} value
|
||||
* @param {number=} opt_index
|
||||
* @return {!proto.messages.MessageRequest} returns this
|
||||
*/
|
||||
proto.messages.MessageRequest.prototype.addMentions = function(value, opt_index) {
|
||||
return jspb.Message.addToRepeatedField(this, 19, value, opt_index);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Clears the list making it empty but non-null.
|
||||
* @return {!proto.messages.MessageRequest} returns this
|
||||
*/
|
||||
proto.messages.MessageRequest.prototype.clearMentionsList = function() {
|
||||
return this.setMentionsList([]);
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@ import { Jid } from '@waha/core/engines/const';
|
||||
import { EventsFromObservable } from '@waha/core/engines/gows/EventsFromObservable';
|
||||
import { GowsEventStreamObservable } from '@waha/core/engines/gows/GowsEventStreamObservable';
|
||||
import {
|
||||
ToGroupParticipants,
|
||||
ToGroupV2JoinEvent,
|
||||
ToGroupV2LeaveEvent,
|
||||
ToGroupV2ParticipantsEvents,
|
||||
@@ -105,6 +106,7 @@ import {
|
||||
import { BinaryFile, RemoteFile } from '@waha/structures/files.dto';
|
||||
import {
|
||||
CreateGroupRequest,
|
||||
GroupParticipant,
|
||||
GroupSortField,
|
||||
Participant,
|
||||
ParticipantsRequest,
|
||||
@@ -198,8 +200,8 @@ enum WhatsMeowEvent {
|
||||
}
|
||||
|
||||
const gRPCClientConfig = {
|
||||
'grpc.max_send_message_length': 128 * 1024 * 1024,
|
||||
'grpc.max_receive_message_length': 128 * 1024 * 1024,
|
||||
'grpc.max_send_message_length': 512 * 1024 * 1024,
|
||||
'grpc.max_receive_message_length': 512 * 1024 * 1024,
|
||||
};
|
||||
|
||||
export interface GowsConfig {
|
||||
@@ -804,6 +806,7 @@ export class WhatsappSessionGoWSCore extends WhatsappSession {
|
||||
linkPreview: request.linkPreview ?? true,
|
||||
linkPreviewHighQuality: request.linkPreviewHighQuality,
|
||||
replyTo: getMessageIdFromSerialized(request.reply_to),
|
||||
mentions: request.mentions?.map((mention) => toJID(mention)),
|
||||
});
|
||||
const response = await promisify(this.client.SendMessage)(message);
|
||||
const data = response.toObject();
|
||||
@@ -999,7 +1002,7 @@ export class WhatsappSessionGoWSCore extends WhatsappSession {
|
||||
}
|
||||
|
||||
reply(request: MessageReplyRequest) {
|
||||
throw new Error('Method not implemented.');
|
||||
return this.sendText(request);
|
||||
}
|
||||
|
||||
async sendSeen(request: SendSeenRequest) {
|
||||
@@ -1102,6 +1105,14 @@ export class WhatsappSessionGoWSCore extends WhatsappSession {
|
||||
return data;
|
||||
}
|
||||
|
||||
public async getGroupParticipants(id: string): Promise<GroupParticipant[]> {
|
||||
const group = await this.getGroup(id);
|
||||
if (!group?.Participants?.length) {
|
||||
return [];
|
||||
}
|
||||
return ToGroupParticipants(group.Participants);
|
||||
}
|
||||
|
||||
public async getInfoAdminsOnly(id): Promise<SettingsSecurityChangeInfo> {
|
||||
const group = await this.getGroup(id);
|
||||
return {
|
||||
|
||||
@@ -86,6 +86,7 @@ export interface GroupInfoEvent {
|
||||
|
||||
export interface GOWSGroupParticipant {
|
||||
JID: JID;
|
||||
PhoneNumber: JID;
|
||||
IsAdmin: boolean;
|
||||
IsSuperAdmin: boolean;
|
||||
}
|
||||
|
||||
@@ -56,6 +56,7 @@ export function ToGroupParticipant(
|
||||
}
|
||||
return {
|
||||
id: toCusFormat(participant.id),
|
||||
pn: toCusFormat(participant.phoneNumber),
|
||||
role: role,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -50,6 +50,7 @@ import {
|
||||
WhatsappSession,
|
||||
} from '@waha/core/abc/session.abc';
|
||||
import {
|
||||
ToGroupParticipant,
|
||||
ToGroupV2JoinEvent,
|
||||
ToGroupV2LeaveEvent,
|
||||
ToGroupV2Participants,
|
||||
@@ -140,6 +141,7 @@ import {
|
||||
import { BinaryFile, RemoteFile } from '@waha/structures/files.dto';
|
||||
import {
|
||||
CreateGroupRequest,
|
||||
GroupParticipant,
|
||||
ParticipantsRequest,
|
||||
SettingsSecurityChangeInfo,
|
||||
} from '@waha/structures/groups.dto';
|
||||
@@ -1482,6 +1484,14 @@ export class WhatsappSessionNoWebCore extends WhatsappSession {
|
||||
return group;
|
||||
}
|
||||
|
||||
public async getGroupParticipants(id: string): Promise<GroupParticipant[]> {
|
||||
const group = (await this.getGroup(id)) as GroupMetadata;
|
||||
if (!group?.participants?.length) {
|
||||
return [];
|
||||
}
|
||||
return group.participants.map(ToGroupParticipant);
|
||||
}
|
||||
|
||||
public async deleteGroup(id) {
|
||||
throw new NotImplementedByEngineError();
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ import {
|
||||
GroupNotificationTypes,
|
||||
GroupParticipant as WEBJSGroupParticipant,
|
||||
} from 'whatsapp-web.js';
|
||||
import { isPnUser } from '@waha/core/utils/jids';
|
||||
|
||||
function ToGroupInfo(
|
||||
group: GroupChat,
|
||||
@@ -60,7 +61,7 @@ export async function ToGroupV2JoinEvent(
|
||||
};
|
||||
}
|
||||
|
||||
function getParticipants(
|
||||
export function getParticipants(
|
||||
participants: WEBJSGroupParticipant[],
|
||||
): GroupParticipant[] {
|
||||
return participants.map((participant) => {
|
||||
@@ -73,6 +74,9 @@ function getParticipants(
|
||||
|
||||
return {
|
||||
id: participant.id._serialized,
|
||||
pn: isPnUser(participant.id._serialized)
|
||||
? participant.id._serialized
|
||||
: null,
|
||||
role: role,
|
||||
};
|
||||
});
|
||||
|
||||
@@ -9,6 +9,7 @@ import {
|
||||
TagReceiptNodeToReceiptEvent,
|
||||
} from '@waha/core/engines/webjs/ack.webjs';
|
||||
import {
|
||||
getParticipants,
|
||||
ToGroupV2JoinEvent,
|
||||
ToGroupV2LeaveEvent,
|
||||
ToGroupV2ParticipantsEvent,
|
||||
@@ -95,6 +96,7 @@ import {
|
||||
import { BinaryFile, RemoteFile } from '@waha/structures/files.dto';
|
||||
import {
|
||||
CreateGroupRequest,
|
||||
GroupParticipant,
|
||||
GroupSortField,
|
||||
ParticipantsRequest,
|
||||
SettingsSecurityChangeInfo,
|
||||
@@ -1155,6 +1157,11 @@ export class WhatsappSessionWebJSCore extends WhatsappSession {
|
||||
return this.whatsapp.getChatById(id);
|
||||
}
|
||||
|
||||
public async getGroupParticipants(id: string): Promise<GroupParticipant[]> {
|
||||
const group = (await this.whatsapp.getChatById(id)) as GroupChat;
|
||||
return getParticipants(group.participants);
|
||||
}
|
||||
|
||||
public async deleteGroup(id) {
|
||||
const groupChat = (await this.whatsapp.getChatById(id)) as GroupChat;
|
||||
return groupChat.delete();
|
||||
|
||||
@@ -94,6 +94,7 @@ export class ChatPictureResponse {
|
||||
|
||||
export enum MessageSortField {
|
||||
TIMESTAMP = 'timestamp',
|
||||
MESSAGE_TIMESTAMP = 'messageTimestamp',
|
||||
}
|
||||
|
||||
export class GetChatMessagesQuery extends PaginationParams {
|
||||
|
||||
@@ -115,10 +115,17 @@ export enum GroupParticipantRole {
|
||||
|
||||
export class GroupParticipant {
|
||||
@ApiProperty({
|
||||
example: '123456789@c.us',
|
||||
description: 'Member ID in @c.us or @lid format',
|
||||
example: '123456789@lid',
|
||||
})
|
||||
id: string;
|
||||
|
||||
@ApiProperty({
|
||||
description: 'Member ID in @c.us format',
|
||||
example: '123456789@c.us',
|
||||
})
|
||||
pn?: string;
|
||||
|
||||
@ApiProperty({
|
||||
example: GroupParticipantRole.PARTICIPANT,
|
||||
})
|
||||
|
||||
+1
-1
@@ -30,7 +30,7 @@ export function getWAHAVersion(): WAHAVersion {
|
||||
}
|
||||
|
||||
export const VERSION: WAHAEnvironment = {
|
||||
version: '2025.10.5',
|
||||
version: '2025.11.1',
|
||||
engine: getEngineName(),
|
||||
tier: getWAHAVersion(),
|
||||
browser:
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
"waha": {
|
||||
"gows": {
|
||||
"repo": "devlikeapro/gows",
|
||||
"ref": "v1.0.19"
|
||||
"ref": "v1.0.20"
|
||||
},
|
||||
"dashboard": {
|
||||
"repo": "devlikeapro/dashboard",
|
||||
|
||||
@@ -5,9 +5,9 @@ __metadata:
|
||||
version: 6
|
||||
cacheKey: 8
|
||||
|
||||
"@adiwajshing/baileys@github:devlikeapro/Baileys#fork-master-2025-10-19":
|
||||
version: 7.0.0-rc.5
|
||||
resolution: "@adiwajshing/baileys@https://github.com/devlikeapro/Baileys.git#commit=df07435e41a5b6062c51a4a74393558cecf8fc50"
|
||||
"@adiwajshing/baileys@github:devlikeapro/Baileys#fork-master-2025-11-07":
|
||||
version: 7.0.0-rc.6
|
||||
resolution: "@adiwajshing/baileys@https://github.com/devlikeapro/Baileys.git#commit=e828866d7936785b054e16f360c32115f118f291"
|
||||
dependencies:
|
||||
"@cacheable/node-cache": ^1.4.0
|
||||
"@hapi/boom": ^9.1.3
|
||||
@@ -31,7 +31,7 @@ __metadata:
|
||||
optional: true
|
||||
link-preview-js:
|
||||
optional: true
|
||||
checksum: 065a0a3e086e307ef805321355914c97282d279e7cbe2350118562373c0d36aaf877b0789d7e339f45f9c24e31a425f699b2f905411500522d0dc95a31c8986a
|
||||
checksum: 0a02bc71fe13e998047f10e205126cca978ffde85a50fabc8ccf25c79a3ff6baecc857a395956e6c37b10abbeb9e390e4fcbc870ea11e3a22224cbc8c562c41e
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@@ -6174,6 +6174,13 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"dotenv@npm:^17.2.3":
|
||||
version: 17.2.3
|
||||
resolution: "dotenv@npm:17.2.3"
|
||||
checksum: fde23eb88649041ec7a0f6a47bbe59cac3c454fc2007cf2e40b9c984aaf0636347218c56cfbbf067034b0a73f530a2698a19b4058695787eb650ec69fe234624
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"dunder-proto@npm:^1.0.1":
|
||||
version: 1.0.1
|
||||
resolution: "dunder-proto@npm:1.0.1"
|
||||
@@ -12525,7 +12532,7 @@ __metadata:
|
||||
version: 0.0.0-use.local
|
||||
resolution: "waha@workspace:."
|
||||
dependencies:
|
||||
"@adiwajshing/baileys": "github:devlikeapro/Baileys#fork-master-2025-10-19"
|
||||
"@adiwajshing/baileys": "github:devlikeapro/Baileys#fork-master-2025-11-07"
|
||||
"@adiwajshing/keyed-db": ^0.2.4
|
||||
"@aws-sdk/client-s3": ^3.633.0
|
||||
"@aws-sdk/s3-request-presigner": ^3.633.0
|
||||
@@ -12578,6 +12585,7 @@ __metadata:
|
||||
class-validator: 0.14.0
|
||||
commander: ^14.0.1
|
||||
del: ^8.0.0
|
||||
dotenv: ^17.2.3
|
||||
express-basic-auth: ^1.2.1
|
||||
file-type: 16.5.4
|
||||
fs-extra: ^11.2.0
|
||||
@@ -12628,7 +12636,7 @@ __metadata:
|
||||
typescript: 5.9.2
|
||||
ulid: ^2.3.0
|
||||
undici: ^7.16.0
|
||||
whatsapp-web.js: "github:devlikeapro/whatsapp-web.js#fork-main-2025-09-10"
|
||||
whatsapp-web.js: "github:devlikeapro/whatsapp-web.js#fork-main-2025-11-05"
|
||||
write-file-atomic: ^6.0.0
|
||||
yaml: ^2.7.1
|
||||
dependenciesMeta:
|
||||
@@ -12729,9 +12737,9 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"whatsapp-web.js@github:devlikeapro/whatsapp-web.js#fork-main-2025-09-10":
|
||||
version: 1.34.1
|
||||
resolution: "whatsapp-web.js@https://github.com/devlikeapro/whatsapp-web.js.git#commit=130dbdb5608d9d6add1fe8712dc9e8be6a4bab34"
|
||||
"whatsapp-web.js@github:devlikeapro/whatsapp-web.js#fork-main-2025-11-05":
|
||||
version: 1.34.2
|
||||
resolution: "whatsapp-web.js@https://github.com/devlikeapro/whatsapp-web.js.git#commit=c84b4af4dfd01f326d37f4de6acd7bebc06496d0"
|
||||
dependencies:
|
||||
"@pedroslopez/moduleraid": ^5.0.2
|
||||
archiver: ^5.3.1
|
||||
@@ -12749,7 +12757,7 @@ __metadata:
|
||||
optional: true
|
||||
unzipper:
|
||||
optional: true
|
||||
checksum: fd1fa94beab523b7b0becec27bd626e350805e1cdcefe81b4648e4a1c865fab8eeee9ab5a7c2d72d83969647c108df446ee2ffa2a475a0024acb75007fd96a53
|
||||
checksum: d9d615d29ba14f6113080a19d8f7e1396ea7dde3cbe4983db04e8df512483198c3f73236e9e8c366afb035ee700bd5718d72bc18ee01caeb7cd86bcadfdbb056
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
|
||||
Reference in new issue
Block a user