Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
faf3c77508 | ||
|
|
e6fdfb88ca | ||
|
|
99746df626 | ||
|
|
43aeeb55e8 | ||
|
|
4f89f49d44 | ||
|
|
be583e7e40 | ||
|
|
e8c8f89733 | ||
|
|
13b6d3ddf7 | ||
|
|
5e97fb74b1 | ||
|
|
cc47321cad | ||
|
|
607dff8f7a | ||
|
|
0a74f8dbcd | ||
|
|
796befcf87 | ||
|
|
2c5610dd01 | ||
|
|
43d110fa31 | ||
|
|
bf52dd4874 | ||
|
|
f8268180bf | ||
|
|
04cf9bc8c0 | ||
|
|
ff38cf7660 | ||
|
|
4c0b44c4b5 | ||
|
|
e75c29d57f | ||
|
|
f8329c29b1 | ||
|
|
52222a6b98 | ||
|
|
99a0a19d8c | ||
|
|
48ed33bc94 | ||
|
|
b234e134bf | ||
|
|
f6004fd294 | ||
|
|
91d541387b | ||
|
|
9dbd45da6e | ||
|
|
adc1c3960c | ||
|
|
ff742d2e84 | ||
|
|
10bd4d6271 | ||
|
|
874cafe114 | ||
|
|
0ce2c4b9fa | ||
|
|
a8a7988bfa | ||
|
|
2940d93b81 | ||
|
|
88707cf72b |
No files matched your search
@@ -15,7 +15,7 @@ jobs:
|
||||
matrix:
|
||||
include:
|
||||
# Chromium - x86
|
||||
- runner: 'buildjet-4vcpu-ubuntu-2204'
|
||||
- runner: 'ubuntu-latest'
|
||||
tag: 'latest'
|
||||
platform: 'amd64'
|
||||
browser: 'chromium'
|
||||
@@ -23,7 +23,7 @@ jobs:
|
||||
goss: 'goss-linux-amd64'
|
||||
|
||||
# Chromium - ARM
|
||||
- runner: 'buildjet-4vcpu-ubuntu-2204-arm'
|
||||
- runner: 'ubuntu-24.04-arm'
|
||||
tag: 'arm'
|
||||
platform: 'linux/arm64'
|
||||
browser: 'chromium'
|
||||
@@ -31,7 +31,7 @@ jobs:
|
||||
goss: 'goss-linux-arm'
|
||||
|
||||
# Chrome - x86
|
||||
- runner: 'buildjet-4vcpu-ubuntu-2204'
|
||||
- runner: 'ubuntu-latest'
|
||||
tag: 'chrome'
|
||||
platform: 'amd64'
|
||||
browser: 'chrome'
|
||||
@@ -39,14 +39,14 @@ jobs:
|
||||
goss: 'goss-linux-amd64'
|
||||
|
||||
# Chrome - ARM (Chrome is not available for ARM)
|
||||
#- runner: "buildjet-4vcpu-ubuntu-2204-arm"
|
||||
#- runner: "ubuntu-24.04-arm"
|
||||
# tag: "chrome-arm"
|
||||
# platform: "linux/arm64"
|
||||
# browser: "chrome"
|
||||
# goss: 'goss-linux-arm'
|
||||
|
||||
# NOWEB - x86
|
||||
- runner: 'buildjet-4vcpu-ubuntu-2204'
|
||||
- runner: 'ubuntu-latest'
|
||||
tag: 'noweb'
|
||||
platform: 'amd64'
|
||||
browser: 'none'
|
||||
@@ -54,7 +54,7 @@ jobs:
|
||||
goss: 'goss-linux-amd64'
|
||||
|
||||
# NOWEB - ARM
|
||||
- runner: 'buildjet-4vcpu-ubuntu-2204-arm'
|
||||
- runner: 'ubuntu-24.04-arm'
|
||||
tag: 'noweb-arm'
|
||||
platform: 'linux/arm64'
|
||||
browser: 'none'
|
||||
@@ -62,7 +62,7 @@ jobs:
|
||||
goss: 'goss-linux-arm'
|
||||
|
||||
# GOWS - x86
|
||||
- runner: 'buildjet-4vcpu-ubuntu-2204'
|
||||
- runner: 'ubuntu-latest'
|
||||
tag: 'gows'
|
||||
platform: 'amd64'
|
||||
browser: 'none'
|
||||
@@ -70,7 +70,7 @@ jobs:
|
||||
goss: 'goss-linux-amd64'
|
||||
|
||||
# No browser - ARM
|
||||
- runner: 'buildjet-4vcpu-ubuntu-2204-arm'
|
||||
- runner: 'ubuntu-24.04-arm'
|
||||
tag: 'gows-arm'
|
||||
platform: 'linux/arm64'
|
||||
browser: 'none'
|
||||
|
||||
+31
-31
@@ -6,37 +6,37 @@ on:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
unit-tests:
|
||||
if: github.repository == 'devlikeapro/waha-plus'
|
||||
runs-on: ubuntu-22.04
|
||||
name: Unit tests
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Set up Node
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 22
|
||||
|
||||
- name: Enable Corepack
|
||||
run: |
|
||||
corepack enable
|
||||
corepack prepare yarn@4.9.2 --activate
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
unset GIT_CONFIG_PARAMETERS
|
||||
yarn install --immutable
|
||||
|
||||
- name: Run unit tests
|
||||
run: yarn test:unit
|
||||
# unit-tests:
|
||||
# if: github.repository == 'devlikeapro/waha-plus'
|
||||
# runs-on: ubuntu-22.04
|
||||
# name: Unit tests
|
||||
# steps:
|
||||
# - name: Checkout
|
||||
# uses: actions/checkout@v4
|
||||
# with:
|
||||
# fetch-depth: 0
|
||||
#
|
||||
# - name: Set up Node
|
||||
# uses: actions/setup-node@v4
|
||||
# with:
|
||||
# node-version: 22
|
||||
#
|
||||
# - name: Enable Corepack
|
||||
# run: |
|
||||
# corepack enable
|
||||
# corepack prepare yarn@4.9.2 --activate
|
||||
#
|
||||
# - name: Install dependencies
|
||||
# run: |
|
||||
# unset GIT_CONFIG_PARAMETERS
|
||||
# yarn install --immutable
|
||||
#
|
||||
# - name: Run unit tests
|
||||
# run: yarn test:unit
|
||||
|
||||
docker-build:
|
||||
if: github.repository == 'devlikeapro/waha-plus'
|
||||
needs: unit-tests
|
||||
# needs: unit-tests
|
||||
runs-on: ${{ matrix.runner }}
|
||||
name:
|
||||
${{ matrix.engine }} - ${{ matrix.browser }} - ${{ matrix.platform }} -
|
||||
@@ -45,7 +45,7 @@ jobs:
|
||||
matrix:
|
||||
include:
|
||||
# Chromium - x86
|
||||
- runner: 'buildjet-4vcpu-ubuntu-2204'
|
||||
- runner: 'ubuntu-latest'
|
||||
tag: 'dev'
|
||||
platform: 'amd64'
|
||||
browser: 'chromium'
|
||||
@@ -53,7 +53,7 @@ jobs:
|
||||
goss: 'goss-linux-amd64'
|
||||
|
||||
# Chrome - x86
|
||||
- runner: 'buildjet-4vcpu-ubuntu-2204'
|
||||
- runner: 'ubuntu-latest'
|
||||
tag: 'dev-chrome'
|
||||
platform: 'amd64'
|
||||
browser: 'chrome'
|
||||
@@ -61,7 +61,7 @@ jobs:
|
||||
goss: 'goss-linux-amd64'
|
||||
|
||||
# Chromium - ARM
|
||||
- runner: 'buildjet-4vcpu-ubuntu-2204-arm'
|
||||
- runner: 'ubuntu-24.04-arm'
|
||||
tag: 'dev-arm'
|
||||
platform: 'linux/arm64'
|
||||
browser: 'chromium'
|
||||
|
||||
@@ -132,7 +132,9 @@ You can find related source code in the following paths:
|
||||
|
||||
- WEBJS: `../whatsapp-web.js`
|
||||
- NOWEB: `../WhiskeySockets-Baileys`
|
||||
- GOWS: `../gows` + `../whatsmeow`
|
||||
- whatsapp-rust-bridge - `../whatsapp-rust-bridge`
|
||||
- GOWS: `../gows`
|
||||
- whatsmeow - `../whatsmeow`
|
||||
- ChatWoot: `../chatwoot`
|
||||
|
||||
Following this playbook keeps contributions aligned with WAHA’s structure,
|
||||
|
||||
+20
-1
@@ -6,9 +6,28 @@ ARG GOLANG_IMAGE_TAG=1.24-bookworm
|
||||
#
|
||||
FROM node:${NODE_IMAGE_TAG} AS build
|
||||
ENV PUPPETEER_SKIP_DOWNLOAD=True
|
||||
ENV RUST_BUN_VERSION=1.3.9
|
||||
ENV RUSTUP_TOOLCHAIN=nightly-2026-01-30
|
||||
ENV RUST_WASM_PACK_VERSION=0.14.0
|
||||
ENV RUST_BUN_INSTALL=/root/.bun
|
||||
ENV PATH=${RUST_BUN_INSTALL}/bin:/root/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
||||
|
||||
# git + build toolchain for git deps
|
||||
RUN apt-get update && apt-get install -y git python3 build-essential && rm -rf /var/lib/apt/lists/*
|
||||
RUN apt-get update && \
|
||||
apt-get install -y --no-install-recommends git python3 build-essential curl ca-certificates unzip && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# bun + rust toolchains for whatsapp-rust-bridge prepare scripts
|
||||
RUN set -eux; \
|
||||
mkdir -p "${RUST_BUN_INSTALL}"; \
|
||||
curl -fsSL https://bun.sh/install | bash -s -- bun-v${RUST_BUN_VERSION}; \
|
||||
curl -fsSL https://sh.rustup.rs | bash -s -- -y --default-toolchain ${RUSTUP_TOOLCHAIN}; \
|
||||
/root/.cargo/bin/rustup target add wasm32-unknown-unknown; \
|
||||
/root/.cargo/bin/cargo install wasm-pack --vers ${RUST_WASM_PACK_VERSION} --locked; \
|
||||
"${RUST_BUN_INSTALL}/bin/bun" --version; \
|
||||
/root/.cargo/bin/cargo --version; \
|
||||
/root/.cargo/bin/rustc --version; \
|
||||
/root/.cargo/bin/wasm-pack --version
|
||||
|
||||
# npm packages
|
||||
WORKDIR /git
|
||||
|
||||
@@ -32,16 +32,19 @@ push:
|
||||
docker push devlikeapro/waha
|
||||
|
||||
for-swagger:
|
||||
WHATSAPP_SWAGGER_CONFIG_ADVANCED=true WHATSAPP_SWAGGER_PASSWORD=666 nvm exec yarn start
|
||||
export WHATSAPP_SWAGGER_CONFIG_ADVANCED=true && export WHATSAPP_SWAGGER_PASSWORD=666 && yarn start
|
||||
|
||||
up-noweb:
|
||||
yarn up @adiwajshing/baileys@github:devlikeapro/Baileys#fork-master-2026-01-25
|
||||
yarn up @adiwajshing/baileys@github:devlikeapro/Baileys#fork-master-2026-02-11
|
||||
|
||||
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-12-17
|
||||
yarn up whatsapp-web.js@github:devlikeapro/whatsapp-web.js#fork-main-2026-02-01
|
||||
|
||||
up-rust-bridge:
|
||||
yarn up -R whatsapp-rust-bridge
|
||||
|
||||
start-proxy:
|
||||
docker run --rm -d --name squid-container -e TZ=UTC -p 3128:3128 ubuntu/squid:5.2-22.04_beta
|
||||
@@ -57,4 +60,3 @@ gows:
|
||||
copy-dashboard:
|
||||
cd ../waha-hub/ui && \
|
||||
make copy-waha
|
||||
|
||||
@@ -147,7 +147,18 @@ curl -d "{\"chatId\": \"${PHONE}@c.us\", \"text\": \"Hello from WhatsApp HTTP AP
|
||||
## Start the project
|
||||
1. Clone the repository
|
||||
2. Make sure you're using node>=22 (check [.nvmrc](/.nvmrc) to get the version)
|
||||
3. Run the following commands:
|
||||
3. Install the **whatsapp-rust-bridge prerequisites**:
|
||||
```bash
|
||||
# Bun runtime used by whatsapp-rust-bridge prepare scripts
|
||||
curl -fsSL https://bun.sh/install | bash -s -- bun-v1.3.9
|
||||
|
||||
# Rust nightly toolchain used for whatsapp-rust-bridge
|
||||
curl -fsSL https://sh.rustup.rs | bash -s -- -y --default-toolchain nightly-2026-01-30
|
||||
rustup target add wasm32-unknown-unknown
|
||||
cargo install wasm-pack --vers 0.14.0 --locked
|
||||
```
|
||||
|
||||
4. Run the following commands:
|
||||
```bash
|
||||
# Install dependencies
|
||||
yarn install
|
||||
|
||||
+4
-3
@@ -29,7 +29,7 @@
|
||||
"gows:proto": "yarn gows:proto:fetch && yarn gows:proto:build"
|
||||
},
|
||||
"dependencies": {
|
||||
"@adiwajshing/baileys": "github:devlikeapro/Baileys#fork-master-2026-01-25",
|
||||
"@adiwajshing/baileys": "github:devlikeapro/Baileys#fork-master-2026-02-11",
|
||||
"@adiwajshing/keyed-db": "^0.2.4",
|
||||
"@aws-sdk/client-s3": "^3.633.0",
|
||||
"@aws-sdk/s3-request-presigner": "^3.633.0",
|
||||
@@ -111,7 +111,7 @@
|
||||
"ulid": "^2.3.0",
|
||||
"undici": "^7.16.0",
|
||||
"uniqid": "^5.4.0",
|
||||
"whatsapp-web.js": "github:devlikeapro/whatsapp-web.js#fork-main-2025-12-17",
|
||||
"whatsapp-web.js": "github:devlikeapro/whatsapp-web.js#fork-main-2026-02-01",
|
||||
"write-file-atomic": "^6.0.0",
|
||||
"yaml": "^2.7.1"
|
||||
},
|
||||
@@ -124,7 +124,8 @@
|
||||
"ws": "^8.18.0",
|
||||
"puppeteer": "^24.31.0",
|
||||
"whatwg-url": "13.0.0",
|
||||
"axios": "^1.9.0"
|
||||
"axios": "^1.9.0",
|
||||
"whatsapp-rust-bridge": "github:devlikeapro/whatsapp-rust-bridge.git#fork-master-2026-02-04"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@grpc/grpc-js": "^1.14.1",
|
||||
|
||||
+17
-3
@@ -76,17 +76,31 @@ const updatedContent = exampleContent
|
||||
|
||||
fs.writeFileSync(targetPath, updatedContent, { encoding: 'utf8' });
|
||||
|
||||
const generatedEnvValues = [
|
||||
`WAHA_API_KEY=${apiKey}`,
|
||||
`WAHA_API_KEY_PLAIN=${apiKey}`,
|
||||
'WAHA_DASHBOARD_USERNAME=admin',
|
||||
`WAHA_DASHBOARD_PASSWORD=${adminPassword}`,
|
||||
'WHATSAPP_SWAGGER_USERNAME=admin',
|
||||
`WHATSAPP_SWAGGER_PASSWORD=${adminPassword}`,
|
||||
];
|
||||
|
||||
const lines = [
|
||||
'Credentials generated.',
|
||||
'',
|
||||
'Dashboard and Swagger:',
|
||||
'Generated env values:',
|
||||
...generatedEnvValues.map((line) => ` - ${line}`),
|
||||
'',
|
||||
'Use these credentials to login in Dashboard or Swagger:',
|
||||
' - Username: admin',
|
||||
` - Password: ${adminPassword}`,
|
||||
'',
|
||||
'API key: ',
|
||||
'Use this API key in the x-api-key header:',
|
||||
` - ${apiKey}`,
|
||||
'',
|
||||
'Use it in the Dashboard connection flow: https://waha.devlike.pro/docs/how-to/dashboard/#api-key',
|
||||
'Read more:',
|
||||
' - https://waha.devlike.pro/docs/how-to/dashboard/#api-key',
|
||||
' - https://waha.devlike.pro/docs/how-to/security/',
|
||||
];
|
||||
|
||||
console.log(lines.join('\n'));
|
||||
@@ -93,6 +93,7 @@ export class WebsocketGatewayCore
|
||||
|
||||
if (!ability.can(Action.Use, new SessionName(session))) {
|
||||
socket.close(WebSocketCloseCode.POLICY_VIOLATION, 'Forbidden');
|
||||
return;
|
||||
}
|
||||
|
||||
this.logger.debug(`New client connected: ${request.url} - ${socket.id}`);
|
||||
|
||||
@@ -15,6 +15,14 @@ describe('MarkdownToWhatsApp', () => {
|
||||
expect(MarkdownToWhatsApp(input)).toBe(expected);
|
||||
});
|
||||
|
||||
// ChatWoot v4.10.1+ escapes newlines with trailing backslash
|
||||
it('strips trailing backslash before newlines', () => {
|
||||
const input = 'Hi \\\ntext message \\\nwith line \\\nbreak';
|
||||
expect(MarkdownToWhatsApp(input)).toBe(
|
||||
'Hi \ntext message \nwith line \nbreak',
|
||||
);
|
||||
});
|
||||
|
||||
// Tests for URL protection
|
||||
it('preserves URLs with multiple underscores', () => {
|
||||
const input = 'https://example.com/page__name__test';
|
||||
|
||||
@@ -4,6 +4,8 @@ export function MarkdownToWhatsApp(text: string): string {
|
||||
}
|
||||
return (
|
||||
text
|
||||
// Remove trailing backslash before newlines (ChatWoot v4.10.1+ escaping)
|
||||
.replace(/\\\n/g, '\n')
|
||||
// Triple-backtick blocks → WhatsApp monospace blocks (same syntax)
|
||||
.replace(/```([\s\S]*?)```/g, '```$1```')
|
||||
// Italic **first**, but only single‐star or single‐underscore
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import {
|
||||
Injectable,
|
||||
InternalServerErrorException,
|
||||
NestMiddleware,
|
||||
UnauthorizedException,
|
||||
} from '@nestjs/common';
|
||||
@@ -16,7 +15,7 @@ export class ApiKeyAuthMiddleware implements NestMiddleware {
|
||||
const exception =
|
||||
err instanceof UnauthorizedException
|
||||
? err
|
||||
: new InternalServerErrorException();
|
||||
: new UnauthorizedException();
|
||||
res.status(exception.getStatus()).json(exception.getResponse());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -26,6 +26,10 @@ export class PoliciesGuard implements CanActivate {
|
||||
context.getClass(),
|
||||
]) || [];
|
||||
|
||||
if (handlers.length === 0) {
|
||||
throw new ForbiddenException();
|
||||
}
|
||||
|
||||
const req = context.switchToHttp().getRequest();
|
||||
const user = req.user;
|
||||
const ability = this.caslAbilityFactory.createForUser(user);
|
||||
|
||||
@@ -1,24 +1,22 @@
|
||||
import * as grpc from '@grpc/grpc-js';
|
||||
import { messages } from '@waha/core/engines/gows/grpc/gows';
|
||||
|
||||
export const GetMessageServiceClient = (
|
||||
session: string,
|
||||
export function BuildMessageServiceClient(
|
||||
address: string,
|
||||
credentials: grpc.ChannelCredentials,
|
||||
): messages.MessageServiceClient => {
|
||||
): messages.MessageServiceClient {
|
||||
return new messages.MessageServiceClient(address, credentials, {
|
||||
'grpc.max_send_message_length': 128 * 1024 * 1024,
|
||||
'grpc.max_receive_message_length': 128 * 1024 * 1024,
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
export const GetEventStreamClient = (
|
||||
session: string,
|
||||
export function BuildEventStreamClient(
|
||||
address: string,
|
||||
credentials: grpc.ChannelCredentials,
|
||||
): messages.EventStreamClient => {
|
||||
): messages.EventStreamClient {
|
||||
return new messages.EventStreamClient(address, credentials, {
|
||||
'grpc.max_send_message_length': 128 * 1024 * 1024,
|
||||
'grpc.max_receive_message_length': 128 * 1024 * 1024,
|
||||
});
|
||||
};
|
||||
}
|
||||
@@ -879,6 +879,99 @@ export namespace messages {
|
||||
return EventJson.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
export class StreamEventsRequest extends pb_1.Message {
|
||||
#one_of_decls: number[][] = [];
|
||||
constructor(data?: any[] | {
|
||||
session?: Session;
|
||||
exclude?: string[];
|
||||
}) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2], this.#one_of_decls);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("session" in data && data.session != undefined) {
|
||||
this.session = data.session;
|
||||
}
|
||||
if ("exclude" in data && data.exclude != undefined) {
|
||||
this.exclude = data.exclude;
|
||||
}
|
||||
}
|
||||
}
|
||||
get session() {
|
||||
return pb_1.Message.getWrapperField(this, Session, 1) as Session;
|
||||
}
|
||||
set session(value: Session) {
|
||||
pb_1.Message.setWrapperField(this, 1, value);
|
||||
}
|
||||
get has_session() {
|
||||
return pb_1.Message.getField(this, 1) != null;
|
||||
}
|
||||
get exclude() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 2, []) as string[];
|
||||
}
|
||||
set exclude(value: string[]) {
|
||||
pb_1.Message.setField(this, 2, value);
|
||||
}
|
||||
static fromObject(data: {
|
||||
session?: ReturnType<typeof Session.prototype.toObject>;
|
||||
exclude?: string[];
|
||||
}): StreamEventsRequest {
|
||||
const message = new StreamEventsRequest({});
|
||||
if (data.session != null) {
|
||||
message.session = Session.fromObject(data.session);
|
||||
}
|
||||
if (data.exclude != null) {
|
||||
message.exclude = data.exclude;
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data: {
|
||||
session?: ReturnType<typeof Session.prototype.toObject>;
|
||||
exclude?: string[];
|
||||
} = {};
|
||||
if (this.session != null) {
|
||||
data.session = this.session.toObject();
|
||||
}
|
||||
if (this.exclude != null) {
|
||||
data.exclude = this.exclude;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (this.has_session)
|
||||
writer.writeMessage(1, this.session, () => this.session.serialize(writer));
|
||||
if (this.exclude.length)
|
||||
writer.writeRepeatedString(2, this.exclude);
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): StreamEventsRequest {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new StreamEventsRequest();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
reader.readMessage(message.session, () => message.session = Session.deserialize(reader));
|
||||
break;
|
||||
case 2:
|
||||
pb_1.Message.addToRepeatedField(message, 2, reader.readString());
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary(): Uint8Array {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes: Uint8Array): StreamEventsRequest {
|
||||
return StreamEventsRequest.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
export class PairCodeRequest extends pb_1.Message {
|
||||
#one_of_decls: number[][] = [];
|
||||
constructor(data?: any[] | {
|
||||
@@ -1236,6 +1329,193 @@ export namespace messages {
|
||||
return SessionStoreConfig.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
export class SessionStorageConfig extends pb_1.Message {
|
||||
#one_of_decls: number[][] = [[1], [2], [3], [4]];
|
||||
constructor(data?: any[] | ({} & (({
|
||||
messages?: boolean;
|
||||
}) | ({
|
||||
groups?: boolean;
|
||||
}) | ({
|
||||
chats?: boolean;
|
||||
}) | ({
|
||||
labels?: boolean;
|
||||
})))) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("messages" in data && data.messages != undefined) {
|
||||
this.messages = data.messages;
|
||||
}
|
||||
if ("groups" in data && data.groups != undefined) {
|
||||
this.groups = data.groups;
|
||||
}
|
||||
if ("chats" in data && data.chats != undefined) {
|
||||
this.chats = data.chats;
|
||||
}
|
||||
if ("labels" in data && data.labels != undefined) {
|
||||
this.labels = data.labels;
|
||||
}
|
||||
}
|
||||
}
|
||||
get messages() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 1, false) as boolean;
|
||||
}
|
||||
set messages(value: boolean) {
|
||||
pb_1.Message.setOneofField(this, 1, this.#one_of_decls[0], value);
|
||||
}
|
||||
get has_messages() {
|
||||
return pb_1.Message.getField(this, 1) != null;
|
||||
}
|
||||
get groups() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 2, false) as boolean;
|
||||
}
|
||||
set groups(value: boolean) {
|
||||
pb_1.Message.setOneofField(this, 2, this.#one_of_decls[1], value);
|
||||
}
|
||||
get has_groups() {
|
||||
return pb_1.Message.getField(this, 2) != null;
|
||||
}
|
||||
get chats() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 3, false) as boolean;
|
||||
}
|
||||
set chats(value: boolean) {
|
||||
pb_1.Message.setOneofField(this, 3, this.#one_of_decls[2], value);
|
||||
}
|
||||
get has_chats() {
|
||||
return pb_1.Message.getField(this, 3) != null;
|
||||
}
|
||||
get labels() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 4, false) as boolean;
|
||||
}
|
||||
set labels(value: boolean) {
|
||||
pb_1.Message.setOneofField(this, 4, this.#one_of_decls[3], value);
|
||||
}
|
||||
get has_labels() {
|
||||
return pb_1.Message.getField(this, 4) != null;
|
||||
}
|
||||
get _messages() {
|
||||
const cases: {
|
||||
[index: number]: "none" | "messages";
|
||||
} = {
|
||||
0: "none",
|
||||
1: "messages"
|
||||
};
|
||||
return cases[pb_1.Message.computeOneofCase(this, [1])];
|
||||
}
|
||||
get _groups() {
|
||||
const cases: {
|
||||
[index: number]: "none" | "groups";
|
||||
} = {
|
||||
0: "none",
|
||||
2: "groups"
|
||||
};
|
||||
return cases[pb_1.Message.computeOneofCase(this, [2])];
|
||||
}
|
||||
get _chats() {
|
||||
const cases: {
|
||||
[index: number]: "none" | "chats";
|
||||
} = {
|
||||
0: "none",
|
||||
3: "chats"
|
||||
};
|
||||
return cases[pb_1.Message.computeOneofCase(this, [3])];
|
||||
}
|
||||
get _labels() {
|
||||
const cases: {
|
||||
[index: number]: "none" | "labels";
|
||||
} = {
|
||||
0: "none",
|
||||
4: "labels"
|
||||
};
|
||||
return cases[pb_1.Message.computeOneofCase(this, [4])];
|
||||
}
|
||||
static fromObject(data: {
|
||||
messages?: boolean;
|
||||
groups?: boolean;
|
||||
chats?: boolean;
|
||||
labels?: boolean;
|
||||
}): SessionStorageConfig {
|
||||
const message = new SessionStorageConfig({});
|
||||
if (data.messages != null) {
|
||||
message.messages = data.messages;
|
||||
}
|
||||
if (data.groups != null) {
|
||||
message.groups = data.groups;
|
||||
}
|
||||
if (data.chats != null) {
|
||||
message.chats = data.chats;
|
||||
}
|
||||
if (data.labels != null) {
|
||||
message.labels = data.labels;
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data: {
|
||||
messages?: boolean;
|
||||
groups?: boolean;
|
||||
chats?: boolean;
|
||||
labels?: boolean;
|
||||
} = {};
|
||||
if (this.messages != null) {
|
||||
data.messages = this.messages;
|
||||
}
|
||||
if (this.groups != null) {
|
||||
data.groups = this.groups;
|
||||
}
|
||||
if (this.chats != null) {
|
||||
data.chats = this.chats;
|
||||
}
|
||||
if (this.labels != null) {
|
||||
data.labels = this.labels;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (this.has_messages)
|
||||
writer.writeBool(1, this.messages);
|
||||
if (this.has_groups)
|
||||
writer.writeBool(2, this.groups);
|
||||
if (this.has_chats)
|
||||
writer.writeBool(3, this.chats);
|
||||
if (this.has_labels)
|
||||
writer.writeBool(4, this.labels);
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): SessionStorageConfig {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new SessionStorageConfig();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
message.messages = reader.readBool();
|
||||
break;
|
||||
case 2:
|
||||
message.groups = reader.readBool();
|
||||
break;
|
||||
case 3:
|
||||
message.chats = reader.readBool();
|
||||
break;
|
||||
case 4:
|
||||
message.labels = reader.readBool();
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary(): Uint8Array {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes: Uint8Array): SessionStorageConfig {
|
||||
return SessionStorageConfig.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
export class SessionProxyConfig extends pb_1.Message {
|
||||
#one_of_decls: number[][] = [];
|
||||
constructor(data?: any[] | {
|
||||
@@ -1440,13 +1720,15 @@ export namespace messages {
|
||||
}
|
||||
}
|
||||
export class SessionConfig extends pb_1.Message {
|
||||
#one_of_decls: number[][] = [[4]];
|
||||
#one_of_decls: number[][] = [[4], [5]];
|
||||
constructor(data?: any[] | ({
|
||||
store?: SessionStoreConfig;
|
||||
log?: SessionLogConfig;
|
||||
proxy?: SessionProxyConfig;
|
||||
} & (({
|
||||
ignore?: SessionIgnoreJidsConfig;
|
||||
}) | ({
|
||||
storage?: SessionStorageConfig;
|
||||
})))) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
|
||||
@@ -1463,6 +1745,9 @@ export namespace messages {
|
||||
if ("ignore" in data && data.ignore != undefined) {
|
||||
this.ignore = data.ignore;
|
||||
}
|
||||
if ("storage" in data && data.storage != undefined) {
|
||||
this.storage = data.storage;
|
||||
}
|
||||
}
|
||||
}
|
||||
get store() {
|
||||
@@ -1501,6 +1786,15 @@ export namespace messages {
|
||||
get has_ignore() {
|
||||
return pb_1.Message.getField(this, 4) != null;
|
||||
}
|
||||
get storage() {
|
||||
return pb_1.Message.getWrapperField(this, SessionStorageConfig, 5) as SessionStorageConfig;
|
||||
}
|
||||
set storage(value: SessionStorageConfig) {
|
||||
pb_1.Message.setOneofWrapperField(this, 5, this.#one_of_decls[1], value);
|
||||
}
|
||||
get has_storage() {
|
||||
return pb_1.Message.getField(this, 5) != null;
|
||||
}
|
||||
get _ignore() {
|
||||
const cases: {
|
||||
[index: number]: "none" | "ignore";
|
||||
@@ -1510,11 +1804,21 @@ export namespace messages {
|
||||
};
|
||||
return cases[pb_1.Message.computeOneofCase(this, [4])];
|
||||
}
|
||||
get _storage() {
|
||||
const cases: {
|
||||
[index: number]: "none" | "storage";
|
||||
} = {
|
||||
0: "none",
|
||||
5: "storage"
|
||||
};
|
||||
return cases[pb_1.Message.computeOneofCase(this, [5])];
|
||||
}
|
||||
static fromObject(data: {
|
||||
store?: ReturnType<typeof SessionStoreConfig.prototype.toObject>;
|
||||
log?: ReturnType<typeof SessionLogConfig.prototype.toObject>;
|
||||
proxy?: ReturnType<typeof SessionProxyConfig.prototype.toObject>;
|
||||
ignore?: ReturnType<typeof SessionIgnoreJidsConfig.prototype.toObject>;
|
||||
storage?: ReturnType<typeof SessionStorageConfig.prototype.toObject>;
|
||||
}): SessionConfig {
|
||||
const message = new SessionConfig({});
|
||||
if (data.store != null) {
|
||||
@@ -1529,6 +1833,9 @@ export namespace messages {
|
||||
if (data.ignore != null) {
|
||||
message.ignore = SessionIgnoreJidsConfig.fromObject(data.ignore);
|
||||
}
|
||||
if (data.storage != null) {
|
||||
message.storage = SessionStorageConfig.fromObject(data.storage);
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
@@ -1537,6 +1844,7 @@ export namespace messages {
|
||||
log?: ReturnType<typeof SessionLogConfig.prototype.toObject>;
|
||||
proxy?: ReturnType<typeof SessionProxyConfig.prototype.toObject>;
|
||||
ignore?: ReturnType<typeof SessionIgnoreJidsConfig.prototype.toObject>;
|
||||
storage?: ReturnType<typeof SessionStorageConfig.prototype.toObject>;
|
||||
} = {};
|
||||
if (this.store != null) {
|
||||
data.store = this.store.toObject();
|
||||
@@ -1550,6 +1858,9 @@ export namespace messages {
|
||||
if (this.ignore != null) {
|
||||
data.ignore = this.ignore.toObject();
|
||||
}
|
||||
if (this.storage != null) {
|
||||
data.storage = this.storage.toObject();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(): Uint8Array;
|
||||
@@ -1564,6 +1875,8 @@ export namespace messages {
|
||||
writer.writeMessage(3, this.proxy, () => this.proxy.serialize(writer));
|
||||
if (this.has_ignore)
|
||||
writer.writeMessage(4, this.ignore, () => this.ignore.serialize(writer));
|
||||
if (this.has_storage)
|
||||
writer.writeMessage(5, this.storage, () => this.storage.serialize(writer));
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
@@ -1585,6 +1898,9 @@ export namespace messages {
|
||||
case 4:
|
||||
reader.readMessage(message.ignore, () => message.ignore = SessionIgnoreJidsConfig.deserialize(reader));
|
||||
break;
|
||||
case 5:
|
||||
reader.readMessage(message.storage, () => message.storage = SessionStorageConfig.deserialize(reader));
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
@@ -2680,6 +2996,73 @@ export namespace messages {
|
||||
return AudioInfo.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
export class VideoInfo extends pb_1.Message {
|
||||
#one_of_decls: number[][] = [];
|
||||
constructor(data?: any[] | {
|
||||
duration?: number;
|
||||
}) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("duration" in data && data.duration != undefined) {
|
||||
this.duration = data.duration;
|
||||
}
|
||||
}
|
||||
}
|
||||
get duration() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 1, 0) as number;
|
||||
}
|
||||
set duration(value: number) {
|
||||
pb_1.Message.setField(this, 1, value);
|
||||
}
|
||||
static fromObject(data: {
|
||||
duration?: number;
|
||||
}): VideoInfo {
|
||||
const message = new VideoInfo({});
|
||||
if (data.duration != null) {
|
||||
message.duration = data.duration;
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data: {
|
||||
duration?: number;
|
||||
} = {};
|
||||
if (this.duration != null) {
|
||||
data.duration = this.duration;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (this.duration != 0)
|
||||
writer.writeFloat(1, this.duration);
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): VideoInfo {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new VideoInfo();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
message.duration = reader.readFloat();
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary(): Uint8Array {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes: Uint8Array): VideoInfo {
|
||||
return VideoInfo.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
export class Media extends pb_1.Message {
|
||||
#one_of_decls: number[][] = [];
|
||||
constructor(data?: any[] | {
|
||||
@@ -2689,6 +3072,7 @@ export namespace messages {
|
||||
audio?: AudioInfo;
|
||||
filename?: string;
|
||||
contentPath?: string;
|
||||
video?: VideoInfo;
|
||||
}) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
|
||||
@@ -2711,6 +3095,9 @@ export namespace messages {
|
||||
if ("contentPath" in data && data.contentPath != undefined) {
|
||||
this.contentPath = data.contentPath;
|
||||
}
|
||||
if ("video" in data && data.video != undefined) {
|
||||
this.video = data.video;
|
||||
}
|
||||
}
|
||||
}
|
||||
get content() {
|
||||
@@ -2752,6 +3139,15 @@ export namespace messages {
|
||||
set contentPath(value: string) {
|
||||
pb_1.Message.setField(this, 6, value);
|
||||
}
|
||||
get video() {
|
||||
return pb_1.Message.getWrapperField(this, VideoInfo, 7) as VideoInfo;
|
||||
}
|
||||
set video(value: VideoInfo) {
|
||||
pb_1.Message.setWrapperField(this, 7, value);
|
||||
}
|
||||
get has_video() {
|
||||
return pb_1.Message.getField(this, 7) != null;
|
||||
}
|
||||
static fromObject(data: {
|
||||
content?: Uint8Array;
|
||||
type?: MediaType;
|
||||
@@ -2759,6 +3155,7 @@ export namespace messages {
|
||||
audio?: ReturnType<typeof AudioInfo.prototype.toObject>;
|
||||
filename?: string;
|
||||
contentPath?: string;
|
||||
video?: ReturnType<typeof VideoInfo.prototype.toObject>;
|
||||
}): Media {
|
||||
const message = new Media({});
|
||||
if (data.content != null) {
|
||||
@@ -2779,6 +3176,9 @@ export namespace messages {
|
||||
if (data.contentPath != null) {
|
||||
message.contentPath = data.contentPath;
|
||||
}
|
||||
if (data.video != null) {
|
||||
message.video = VideoInfo.fromObject(data.video);
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
@@ -2789,6 +3189,7 @@ export namespace messages {
|
||||
audio?: ReturnType<typeof AudioInfo.prototype.toObject>;
|
||||
filename?: string;
|
||||
contentPath?: string;
|
||||
video?: ReturnType<typeof VideoInfo.prototype.toObject>;
|
||||
} = {};
|
||||
if (this.content != null) {
|
||||
data.content = this.content;
|
||||
@@ -2808,6 +3209,9 @@ export namespace messages {
|
||||
if (this.contentPath != null) {
|
||||
data.contentPath = this.contentPath;
|
||||
}
|
||||
if (this.video != null) {
|
||||
data.video = this.video.toObject();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(): Uint8Array;
|
||||
@@ -2826,6 +3230,8 @@ export namespace messages {
|
||||
writer.writeString(5, this.filename);
|
||||
if (this.contentPath.length)
|
||||
writer.writeString(6, this.contentPath);
|
||||
if (this.has_video)
|
||||
writer.writeMessage(7, this.video, () => this.video.serialize(writer));
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
@@ -2853,6 +3259,9 @@ export namespace messages {
|
||||
case 6:
|
||||
message.contentPath = reader.readString();
|
||||
break;
|
||||
case 7:
|
||||
reader.readMessage(message.video, () => message.video = VideoInfo.deserialize(reader));
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
@@ -10491,20 +10900,20 @@ export namespace messages {
|
||||
path: "/messages.EventStream/StreamEvents",
|
||||
requestStream: false,
|
||||
responseStream: true,
|
||||
requestSerialize: (message: Session) => Buffer.from(message.serialize()),
|
||||
requestDeserialize: (bytes: Buffer) => Session.deserialize(new Uint8Array(bytes)),
|
||||
requestSerialize: (message: StreamEventsRequest) => Buffer.from(message.serialize()),
|
||||
requestDeserialize: (bytes: Buffer) => StreamEventsRequest.deserialize(new Uint8Array(bytes)),
|
||||
responseSerialize: (message: EventJson) => Buffer.from(message.serialize()),
|
||||
responseDeserialize: (bytes: Buffer) => EventJson.deserialize(new Uint8Array(bytes))
|
||||
}
|
||||
};
|
||||
[method: string]: grpc_1.UntypedHandleCall;
|
||||
abstract StreamEvents(call: grpc_1.ServerWritableStream<Session, EventJson>): void;
|
||||
abstract StreamEvents(call: grpc_1.ServerWritableStream<StreamEventsRequest, EventJson>): void;
|
||||
}
|
||||
export class EventStreamClient extends grpc_1.makeGenericClientConstructor(UnimplementedEventStreamService.definition, "EventStream", {}) {
|
||||
constructor(address: string, credentials: grpc_1.ChannelCredentials, options?: Partial<grpc_1.ChannelOptions>) {
|
||||
super(address, credentials, options);
|
||||
}
|
||||
StreamEvents: GrpcStreamServiceInterface<Session, EventJson> = (message: Session, metadata?: grpc_1.Metadata | grpc_1.CallOptions, options?: grpc_1.CallOptions): grpc_1.ClientReadableStream<EventJson> => {
|
||||
StreamEvents: GrpcStreamServiceInterface<StreamEventsRequest, EventJson> = (message: StreamEventsRequest, metadata?: grpc_1.Metadata | grpc_1.CallOptions, options?: grpc_1.CallOptions): grpc_1.ClientReadableStream<EventJson> => {
|
||||
return super.StreamEvents(message, metadata, options);
|
||||
};
|
||||
}
|
||||
|
||||
@@ -642,6 +642,17 @@ function deserialize_messages_StartSessionRequest(buffer_arg) {
|
||||
return gows_pb.StartSessionRequest.deserializeBinary(new Uint8Array(buffer_arg));
|
||||
}
|
||||
|
||||
function serialize_messages_StreamEventsRequest(arg) {
|
||||
if (!(arg instanceof gows_pb.StreamEventsRequest)) {
|
||||
throw new Error('Expected argument of type messages.StreamEventsRequest');
|
||||
}
|
||||
return Buffer.from(arg.serializeBinary());
|
||||
}
|
||||
|
||||
function deserialize_messages_StreamEventsRequest(buffer_arg) {
|
||||
return gows_pb.StreamEventsRequest.deserializeBinary(new Uint8Array(buffer_arg));
|
||||
}
|
||||
|
||||
function serialize_messages_SubscribePresenceRequest(arg) {
|
||||
if (!(arg instanceof gows_pb.SubscribePresenceRequest)) {
|
||||
throw new Error('Expected argument of type messages.SubscribePresenceRequest');
|
||||
@@ -695,10 +706,10 @@ var EventStreamService = exports.EventStreamService = {
|
||||
path: '/messages.EventStream/StreamEvents',
|
||||
requestStream: false,
|
||||
responseStream: true,
|
||||
requestType: gows_pb.Session,
|
||||
requestType: gows_pb.StreamEventsRequest,
|
||||
responseType: gows_pb.EventJson,
|
||||
requestSerialize: serialize_messages_Session,
|
||||
requestDeserialize: deserialize_messages_Session,
|
||||
requestSerialize: serialize_messages_StreamEventsRequest,
|
||||
requestDeserialize: deserialize_messages_StreamEventsRequest,
|
||||
responseSerialize: serialize_messages_EventJson,
|
||||
responseDeserialize: deserialize_messages_EventJson,
|
||||
},
|
||||
|
||||
@@ -108,16 +108,19 @@ goog.exportSymbol('proto.messages.SessionIgnoreJidsConfig', null, global);
|
||||
goog.exportSymbol('proto.messages.SessionLogConfig', null, global);
|
||||
goog.exportSymbol('proto.messages.SessionProxyConfig', null, global);
|
||||
goog.exportSymbol('proto.messages.SessionStateResponse', null, global);
|
||||
goog.exportSymbol('proto.messages.SessionStorageConfig', null, global);
|
||||
goog.exportSymbol('proto.messages.SessionStoreConfig', null, global);
|
||||
goog.exportSymbol('proto.messages.SetPictureRequest', null, global);
|
||||
goog.exportSymbol('proto.messages.SetProfilePictureRequest', null, global);
|
||||
goog.exportSymbol('proto.messages.SortBy', null, global);
|
||||
goog.exportSymbol('proto.messages.SortBy.Order', null, global);
|
||||
goog.exportSymbol('proto.messages.StartSessionRequest', null, global);
|
||||
goog.exportSymbol('proto.messages.StreamEventsRequest', null, global);
|
||||
goog.exportSymbol('proto.messages.SubscribePresenceRequest', null, global);
|
||||
goog.exportSymbol('proto.messages.UpdateContactRequest', null, global);
|
||||
goog.exportSymbol('proto.messages.UpdateParticipantsRequest', null, global);
|
||||
goog.exportSymbol('proto.messages.UpsertLabelRequest', null, global);
|
||||
goog.exportSymbol('proto.messages.VideoInfo', null, global);
|
||||
goog.exportSymbol('proto.messages.vCardContact', null, global);
|
||||
/**
|
||||
* Generated by JsPbCodeGenerator.
|
||||
@@ -329,6 +332,27 @@ if (goog.DEBUG && !COMPILED) {
|
||||
*/
|
||||
proto.messages.EventJson.displayName = 'proto.messages.EventJson';
|
||||
}
|
||||
/**
|
||||
* Generated by JsPbCodeGenerator.
|
||||
* @param {Array=} opt_data Optional initial data array, typically from a
|
||||
* server response, or constructed directly in Javascript. The array is used
|
||||
* in place and becomes part of the constructed object. It is not cloned.
|
||||
* If no data is provided, the constructed object will be empty, but still
|
||||
* valid.
|
||||
* @extends {jspb.Message}
|
||||
* @constructor
|
||||
*/
|
||||
proto.messages.StreamEventsRequest = function(opt_data) {
|
||||
jspb.Message.initialize(this, opt_data, 0, -1, proto.messages.StreamEventsRequest.repeatedFields_, null);
|
||||
};
|
||||
goog.inherits(proto.messages.StreamEventsRequest, jspb.Message);
|
||||
if (goog.DEBUG && !COMPILED) {
|
||||
/**
|
||||
* @public
|
||||
* @override
|
||||
*/
|
||||
proto.messages.StreamEventsRequest.displayName = 'proto.messages.StreamEventsRequest';
|
||||
}
|
||||
/**
|
||||
* Generated by JsPbCodeGenerator.
|
||||
* @param {Array=} opt_data Optional initial data array, typically from a
|
||||
@@ -434,6 +458,27 @@ if (goog.DEBUG && !COMPILED) {
|
||||
*/
|
||||
proto.messages.SessionStoreConfig.displayName = 'proto.messages.SessionStoreConfig';
|
||||
}
|
||||
/**
|
||||
* Generated by JsPbCodeGenerator.
|
||||
* @param {Array=} opt_data Optional initial data array, typically from a
|
||||
* server response, or constructed directly in Javascript. The array is used
|
||||
* in place and becomes part of the constructed object. It is not cloned.
|
||||
* If no data is provided, the constructed object will be empty, but still
|
||||
* valid.
|
||||
* @extends {jspb.Message}
|
||||
* @constructor
|
||||
*/
|
||||
proto.messages.SessionStorageConfig = function(opt_data) {
|
||||
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
|
||||
};
|
||||
goog.inherits(proto.messages.SessionStorageConfig, jspb.Message);
|
||||
if (goog.DEBUG && !COMPILED) {
|
||||
/**
|
||||
* @public
|
||||
* @override
|
||||
*/
|
||||
proto.messages.SessionStorageConfig.displayName = 'proto.messages.SessionStorageConfig';
|
||||
}
|
||||
/**
|
||||
* Generated by JsPbCodeGenerator.
|
||||
* @param {Array=} opt_data Optional initial data array, typically from a
|
||||
@@ -728,6 +773,27 @@ if (goog.DEBUG && !COMPILED) {
|
||||
*/
|
||||
proto.messages.AudioInfo.displayName = 'proto.messages.AudioInfo';
|
||||
}
|
||||
/**
|
||||
* Generated by JsPbCodeGenerator.
|
||||
* @param {Array=} opt_data Optional initial data array, typically from a
|
||||
* server response, or constructed directly in Javascript. The array is used
|
||||
* in place and becomes part of the constructed object. It is not cloned.
|
||||
* If no data is provided, the constructed object will be empty, but still
|
||||
* valid.
|
||||
* @extends {jspb.Message}
|
||||
* @constructor
|
||||
*/
|
||||
proto.messages.VideoInfo = function(opt_data) {
|
||||
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
|
||||
};
|
||||
goog.inherits(proto.messages.VideoInfo, jspb.Message);
|
||||
if (goog.DEBUG && !COMPILED) {
|
||||
/**
|
||||
* @public
|
||||
* @override
|
||||
*/
|
||||
proto.messages.VideoInfo.displayName = 'proto.messages.VideoInfo';
|
||||
}
|
||||
/**
|
||||
* Generated by JsPbCodeGenerator.
|
||||
* @param {Array=} opt_data Optional initial data array, typically from a
|
||||
@@ -3604,6 +3670,213 @@ proto.messages.EventJson.prototype.setData = function(value) {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* List of repeated fields within this message type.
|
||||
* @private {!Array<number>}
|
||||
* @const
|
||||
*/
|
||||
proto.messages.StreamEventsRequest.repeatedFields_ = [2];
|
||||
|
||||
|
||||
|
||||
if (jspb.Message.GENERATE_TO_OBJECT) {
|
||||
/**
|
||||
* Creates an object representation of this proto.
|
||||
* Field names that are reserved in JavaScript and will be renamed to pb_name.
|
||||
* Optional fields that are not set will be set to undefined.
|
||||
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
|
||||
* For the list of reserved names please see:
|
||||
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
|
||||
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
|
||||
* JSPB instance for transitional soy proto support:
|
||||
* http://goto/soy-param-migration
|
||||
* @return {!Object}
|
||||
*/
|
||||
proto.messages.StreamEventsRequest.prototype.toObject = function(opt_includeInstance) {
|
||||
return proto.messages.StreamEventsRequest.toObject(opt_includeInstance, this);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Static version of the {@see toObject} method.
|
||||
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
|
||||
* the JSPB instance for transitional soy proto support:
|
||||
* http://goto/soy-param-migration
|
||||
* @param {!proto.messages.StreamEventsRequest} msg The msg instance to transform.
|
||||
* @return {!Object}
|
||||
* @suppress {unusedLocalVariables} f is only used for nested messages
|
||||
*/
|
||||
proto.messages.StreamEventsRequest.toObject = function(includeInstance, msg) {
|
||||
var f, obj = {
|
||||
session: (f = msg.getSession()) && proto.messages.Session.toObject(includeInstance, f),
|
||||
excludeList: (f = jspb.Message.getRepeatedField(msg, 2)) == null ? undefined : f
|
||||
};
|
||||
|
||||
if (includeInstance) {
|
||||
obj.$jspbMessageInstance = msg;
|
||||
}
|
||||
return obj;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Deserializes binary data (in protobuf wire format).
|
||||
* @param {jspb.ByteSource} bytes The bytes to deserialize.
|
||||
* @return {!proto.messages.StreamEventsRequest}
|
||||
*/
|
||||
proto.messages.StreamEventsRequest.deserializeBinary = function(bytes) {
|
||||
var reader = new jspb.BinaryReader(bytes);
|
||||
var msg = new proto.messages.StreamEventsRequest;
|
||||
return proto.messages.StreamEventsRequest.deserializeBinaryFromReader(msg, reader);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Deserializes binary data (in protobuf wire format) from the
|
||||
* given reader into the given message object.
|
||||
* @param {!proto.messages.StreamEventsRequest} msg The message object to deserialize into.
|
||||
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
|
||||
* @return {!proto.messages.StreamEventsRequest}
|
||||
*/
|
||||
proto.messages.StreamEventsRequest.deserializeBinaryFromReader = function(msg, reader) {
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup()) {
|
||||
break;
|
||||
}
|
||||
var field = reader.getFieldNumber();
|
||||
switch (field) {
|
||||
case 1:
|
||||
var value = new proto.messages.Session;
|
||||
reader.readMessage(value,proto.messages.Session.deserializeBinaryFromReader);
|
||||
msg.setSession(value);
|
||||
break;
|
||||
case 2:
|
||||
var value = /** @type {string} */ (reader.readString());
|
||||
msg.addExclude(value);
|
||||
break;
|
||||
default:
|
||||
reader.skipField();
|
||||
break;
|
||||
}
|
||||
}
|
||||
return msg;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Serializes the message to binary data (in protobuf wire format).
|
||||
* @return {!Uint8Array}
|
||||
*/
|
||||
proto.messages.StreamEventsRequest.prototype.serializeBinary = function() {
|
||||
var writer = new jspb.BinaryWriter();
|
||||
proto.messages.StreamEventsRequest.serializeBinaryToWriter(this, writer);
|
||||
return writer.getResultBuffer();
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Serializes the given message to binary data (in protobuf wire
|
||||
* format), writing to the given BinaryWriter.
|
||||
* @param {!proto.messages.StreamEventsRequest} message
|
||||
* @param {!jspb.BinaryWriter} writer
|
||||
* @suppress {unusedLocalVariables} f is only used for nested messages
|
||||
*/
|
||||
proto.messages.StreamEventsRequest.serializeBinaryToWriter = function(message, writer) {
|
||||
var f = undefined;
|
||||
f = message.getSession();
|
||||
if (f != null) {
|
||||
writer.writeMessage(
|
||||
1,
|
||||
f,
|
||||
proto.messages.Session.serializeBinaryToWriter
|
||||
);
|
||||
}
|
||||
f = message.getExcludeList();
|
||||
if (f.length > 0) {
|
||||
writer.writeRepeatedString(
|
||||
2,
|
||||
f
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional Session session = 1;
|
||||
* @return {?proto.messages.Session}
|
||||
*/
|
||||
proto.messages.StreamEventsRequest.prototype.getSession = function() {
|
||||
return /** @type{?proto.messages.Session} */ (
|
||||
jspb.Message.getWrapperField(this, proto.messages.Session, 1));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {?proto.messages.Session|undefined} value
|
||||
* @return {!proto.messages.StreamEventsRequest} returns this
|
||||
*/
|
||||
proto.messages.StreamEventsRequest.prototype.setSession = function(value) {
|
||||
return jspb.Message.setWrapperField(this, 1, value);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Clears the message field making it undefined.
|
||||
* @return {!proto.messages.StreamEventsRequest} returns this
|
||||
*/
|
||||
proto.messages.StreamEventsRequest.prototype.clearSession = function() {
|
||||
return this.setSession(undefined);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Returns whether this field is set.
|
||||
* @return {boolean}
|
||||
*/
|
||||
proto.messages.StreamEventsRequest.prototype.hasSession = function() {
|
||||
return jspb.Message.getField(this, 1) != null;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* repeated string exclude = 2;
|
||||
* @return {!Array<string>}
|
||||
*/
|
||||
proto.messages.StreamEventsRequest.prototype.getExcludeList = function() {
|
||||
return /** @type {!Array<string>} */ (jspb.Message.getRepeatedField(this, 2));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {!Array<string>} value
|
||||
* @return {!proto.messages.StreamEventsRequest} returns this
|
||||
*/
|
||||
proto.messages.StreamEventsRequest.prototype.setExcludeList = function(value) {
|
||||
return jspb.Message.setField(this, 2, value || []);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {string} value
|
||||
* @param {number=} opt_index
|
||||
* @return {!proto.messages.StreamEventsRequest} returns this
|
||||
*/
|
||||
proto.messages.StreamEventsRequest.prototype.addExclude = function(value, opt_index) {
|
||||
return jspb.Message.addToRepeatedField(this, 2, value, opt_index);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Clears the list making it empty but non-null.
|
||||
* @return {!proto.messages.StreamEventsRequest} returns this
|
||||
*/
|
||||
proto.messages.StreamEventsRequest.prototype.clearExcludeList = function() {
|
||||
return this.setExcludeList([]);
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if (jspb.Message.GENERATE_TO_OBJECT) {
|
||||
@@ -4308,6 +4581,298 @@ proto.messages.SessionStoreConfig.prototype.setAddress = function(value) {
|
||||
|
||||
|
||||
|
||||
if (jspb.Message.GENERATE_TO_OBJECT) {
|
||||
/**
|
||||
* Creates an object representation of this proto.
|
||||
* Field names that are reserved in JavaScript and will be renamed to pb_name.
|
||||
* Optional fields that are not set will be set to undefined.
|
||||
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
|
||||
* For the list of reserved names please see:
|
||||
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
|
||||
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
|
||||
* JSPB instance for transitional soy proto support:
|
||||
* http://goto/soy-param-migration
|
||||
* @return {!Object}
|
||||
*/
|
||||
proto.messages.SessionStorageConfig.prototype.toObject = function(opt_includeInstance) {
|
||||
return proto.messages.SessionStorageConfig.toObject(opt_includeInstance, this);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Static version of the {@see toObject} method.
|
||||
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
|
||||
* the JSPB instance for transitional soy proto support:
|
||||
* http://goto/soy-param-migration
|
||||
* @param {!proto.messages.SessionStorageConfig} msg The msg instance to transform.
|
||||
* @return {!Object}
|
||||
* @suppress {unusedLocalVariables} f is only used for nested messages
|
||||
*/
|
||||
proto.messages.SessionStorageConfig.toObject = function(includeInstance, msg) {
|
||||
var f, obj = {
|
||||
messages: jspb.Message.getBooleanFieldWithDefault(msg, 1, false),
|
||||
groups: jspb.Message.getBooleanFieldWithDefault(msg, 2, false),
|
||||
chats: jspb.Message.getBooleanFieldWithDefault(msg, 3, false),
|
||||
labels: jspb.Message.getBooleanFieldWithDefault(msg, 4, false)
|
||||
};
|
||||
|
||||
if (includeInstance) {
|
||||
obj.$jspbMessageInstance = msg;
|
||||
}
|
||||
return obj;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Deserializes binary data (in protobuf wire format).
|
||||
* @param {jspb.ByteSource} bytes The bytes to deserialize.
|
||||
* @return {!proto.messages.SessionStorageConfig}
|
||||
*/
|
||||
proto.messages.SessionStorageConfig.deserializeBinary = function(bytes) {
|
||||
var reader = new jspb.BinaryReader(bytes);
|
||||
var msg = new proto.messages.SessionStorageConfig;
|
||||
return proto.messages.SessionStorageConfig.deserializeBinaryFromReader(msg, reader);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Deserializes binary data (in protobuf wire format) from the
|
||||
* given reader into the given message object.
|
||||
* @param {!proto.messages.SessionStorageConfig} msg The message object to deserialize into.
|
||||
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
|
||||
* @return {!proto.messages.SessionStorageConfig}
|
||||
*/
|
||||
proto.messages.SessionStorageConfig.deserializeBinaryFromReader = function(msg, reader) {
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup()) {
|
||||
break;
|
||||
}
|
||||
var field = reader.getFieldNumber();
|
||||
switch (field) {
|
||||
case 1:
|
||||
var value = /** @type {boolean} */ (reader.readBool());
|
||||
msg.setMessages(value);
|
||||
break;
|
||||
case 2:
|
||||
var value = /** @type {boolean} */ (reader.readBool());
|
||||
msg.setGroups(value);
|
||||
break;
|
||||
case 3:
|
||||
var value = /** @type {boolean} */ (reader.readBool());
|
||||
msg.setChats(value);
|
||||
break;
|
||||
case 4:
|
||||
var value = /** @type {boolean} */ (reader.readBool());
|
||||
msg.setLabels(value);
|
||||
break;
|
||||
default:
|
||||
reader.skipField();
|
||||
break;
|
||||
}
|
||||
}
|
||||
return msg;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Serializes the message to binary data (in protobuf wire format).
|
||||
* @return {!Uint8Array}
|
||||
*/
|
||||
proto.messages.SessionStorageConfig.prototype.serializeBinary = function() {
|
||||
var writer = new jspb.BinaryWriter();
|
||||
proto.messages.SessionStorageConfig.serializeBinaryToWriter(this, writer);
|
||||
return writer.getResultBuffer();
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Serializes the given message to binary data (in protobuf wire
|
||||
* format), writing to the given BinaryWriter.
|
||||
* @param {!proto.messages.SessionStorageConfig} message
|
||||
* @param {!jspb.BinaryWriter} writer
|
||||
* @suppress {unusedLocalVariables} f is only used for nested messages
|
||||
*/
|
||||
proto.messages.SessionStorageConfig.serializeBinaryToWriter = function(message, writer) {
|
||||
var f = undefined;
|
||||
f = /** @type {boolean} */ (jspb.Message.getField(message, 1));
|
||||
if (f != null) {
|
||||
writer.writeBool(
|
||||
1,
|
||||
f
|
||||
);
|
||||
}
|
||||
f = /** @type {boolean} */ (jspb.Message.getField(message, 2));
|
||||
if (f != null) {
|
||||
writer.writeBool(
|
||||
2,
|
||||
f
|
||||
);
|
||||
}
|
||||
f = /** @type {boolean} */ (jspb.Message.getField(message, 3));
|
||||
if (f != null) {
|
||||
writer.writeBool(
|
||||
3,
|
||||
f
|
||||
);
|
||||
}
|
||||
f = /** @type {boolean} */ (jspb.Message.getField(message, 4));
|
||||
if (f != null) {
|
||||
writer.writeBool(
|
||||
4,
|
||||
f
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional bool messages = 1;
|
||||
* @return {boolean}
|
||||
*/
|
||||
proto.messages.SessionStorageConfig.prototype.getMessages = function() {
|
||||
return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 1, false));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {boolean} value
|
||||
* @return {!proto.messages.SessionStorageConfig} returns this
|
||||
*/
|
||||
proto.messages.SessionStorageConfig.prototype.setMessages = function(value) {
|
||||
return jspb.Message.setField(this, 1, value);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Clears the field making it undefined.
|
||||
* @return {!proto.messages.SessionStorageConfig} returns this
|
||||
*/
|
||||
proto.messages.SessionStorageConfig.prototype.clearMessages = function() {
|
||||
return jspb.Message.setField(this, 1, undefined);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Returns whether this field is set.
|
||||
* @return {boolean}
|
||||
*/
|
||||
proto.messages.SessionStorageConfig.prototype.hasMessages = function() {
|
||||
return jspb.Message.getField(this, 1) != null;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional bool groups = 2;
|
||||
* @return {boolean}
|
||||
*/
|
||||
proto.messages.SessionStorageConfig.prototype.getGroups = function() {
|
||||
return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 2, false));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {boolean} value
|
||||
* @return {!proto.messages.SessionStorageConfig} returns this
|
||||
*/
|
||||
proto.messages.SessionStorageConfig.prototype.setGroups = function(value) {
|
||||
return jspb.Message.setField(this, 2, value);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Clears the field making it undefined.
|
||||
* @return {!proto.messages.SessionStorageConfig} returns this
|
||||
*/
|
||||
proto.messages.SessionStorageConfig.prototype.clearGroups = function() {
|
||||
return jspb.Message.setField(this, 2, undefined);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Returns whether this field is set.
|
||||
* @return {boolean}
|
||||
*/
|
||||
proto.messages.SessionStorageConfig.prototype.hasGroups = function() {
|
||||
return jspb.Message.getField(this, 2) != null;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional bool chats = 3;
|
||||
* @return {boolean}
|
||||
*/
|
||||
proto.messages.SessionStorageConfig.prototype.getChats = function() {
|
||||
return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 3, false));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {boolean} value
|
||||
* @return {!proto.messages.SessionStorageConfig} returns this
|
||||
*/
|
||||
proto.messages.SessionStorageConfig.prototype.setChats = function(value) {
|
||||
return jspb.Message.setField(this, 3, value);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Clears the field making it undefined.
|
||||
* @return {!proto.messages.SessionStorageConfig} returns this
|
||||
*/
|
||||
proto.messages.SessionStorageConfig.prototype.clearChats = function() {
|
||||
return jspb.Message.setField(this, 3, undefined);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Returns whether this field is set.
|
||||
* @return {boolean}
|
||||
*/
|
||||
proto.messages.SessionStorageConfig.prototype.hasChats = function() {
|
||||
return jspb.Message.getField(this, 3) != null;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional bool labels = 4;
|
||||
* @return {boolean}
|
||||
*/
|
||||
proto.messages.SessionStorageConfig.prototype.getLabels = function() {
|
||||
return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 4, false));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {boolean} value
|
||||
* @return {!proto.messages.SessionStorageConfig} returns this
|
||||
*/
|
||||
proto.messages.SessionStorageConfig.prototype.setLabels = function(value) {
|
||||
return jspb.Message.setField(this, 4, value);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Clears the field making it undefined.
|
||||
* @return {!proto.messages.SessionStorageConfig} returns this
|
||||
*/
|
||||
proto.messages.SessionStorageConfig.prototype.clearLabels = function() {
|
||||
return jspb.Message.setField(this, 4, undefined);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Returns whether this field is set.
|
||||
* @return {boolean}
|
||||
*/
|
||||
proto.messages.SessionStorageConfig.prototype.hasLabels = function() {
|
||||
return jspb.Message.getField(this, 4) != null;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if (jspb.Message.GENERATE_TO_OBJECT) {
|
||||
/**
|
||||
* Creates an object representation of this proto.
|
||||
@@ -4690,7 +5255,8 @@ proto.messages.SessionConfig.toObject = function(includeInstance, msg) {
|
||||
store: (f = msg.getStore()) && proto.messages.SessionStoreConfig.toObject(includeInstance, f),
|
||||
log: (f = msg.getLog()) && proto.messages.SessionLogConfig.toObject(includeInstance, f),
|
||||
proxy: (f = msg.getProxy()) && proto.messages.SessionProxyConfig.toObject(includeInstance, f),
|
||||
ignore: (f = msg.getIgnore()) && proto.messages.SessionIgnoreJidsConfig.toObject(includeInstance, f)
|
||||
ignore: (f = msg.getIgnore()) && proto.messages.SessionIgnoreJidsConfig.toObject(includeInstance, f),
|
||||
storage: (f = msg.getStorage()) && proto.messages.SessionStorageConfig.toObject(includeInstance, f)
|
||||
};
|
||||
|
||||
if (includeInstance) {
|
||||
@@ -4747,6 +5313,11 @@ proto.messages.SessionConfig.deserializeBinaryFromReader = function(msg, reader)
|
||||
reader.readMessage(value,proto.messages.SessionIgnoreJidsConfig.deserializeBinaryFromReader);
|
||||
msg.setIgnore(value);
|
||||
break;
|
||||
case 5:
|
||||
var value = new proto.messages.SessionStorageConfig;
|
||||
reader.readMessage(value,proto.messages.SessionStorageConfig.deserializeBinaryFromReader);
|
||||
msg.setStorage(value);
|
||||
break;
|
||||
default:
|
||||
reader.skipField();
|
||||
break;
|
||||
@@ -4808,6 +5379,14 @@ proto.messages.SessionConfig.serializeBinaryToWriter = function(message, writer)
|
||||
proto.messages.SessionIgnoreJidsConfig.serializeBinaryToWriter
|
||||
);
|
||||
}
|
||||
f = message.getStorage();
|
||||
if (f != null) {
|
||||
writer.writeMessage(
|
||||
5,
|
||||
f,
|
||||
proto.messages.SessionStorageConfig.serializeBinaryToWriter
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -4959,6 +5538,43 @@ proto.messages.SessionConfig.prototype.hasIgnore = function() {
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional SessionStorageConfig storage = 5;
|
||||
* @return {?proto.messages.SessionStorageConfig}
|
||||
*/
|
||||
proto.messages.SessionConfig.prototype.getStorage = function() {
|
||||
return /** @type{?proto.messages.SessionStorageConfig} */ (
|
||||
jspb.Message.getWrapperField(this, proto.messages.SessionStorageConfig, 5));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {?proto.messages.SessionStorageConfig|undefined} value
|
||||
* @return {!proto.messages.SessionConfig} returns this
|
||||
*/
|
||||
proto.messages.SessionConfig.prototype.setStorage = function(value) {
|
||||
return jspb.Message.setWrapperField(this, 5, value);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Clears the message field making it undefined.
|
||||
* @return {!proto.messages.SessionConfig} returns this
|
||||
*/
|
||||
proto.messages.SessionConfig.prototype.clearStorage = function() {
|
||||
return this.setStorage(undefined);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Returns whether this field is set.
|
||||
* @return {boolean}
|
||||
*/
|
||||
proto.messages.SessionConfig.prototype.hasStorage = function() {
|
||||
return jspb.Message.getField(this, 5) != null;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -7104,6 +7720,136 @@ proto.messages.AudioInfo.prototype.setWaveform = function(value) {
|
||||
|
||||
|
||||
|
||||
if (jspb.Message.GENERATE_TO_OBJECT) {
|
||||
/**
|
||||
* Creates an object representation of this proto.
|
||||
* Field names that are reserved in JavaScript and will be renamed to pb_name.
|
||||
* Optional fields that are not set will be set to undefined.
|
||||
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
|
||||
* For the list of reserved names please see:
|
||||
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
|
||||
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
|
||||
* JSPB instance for transitional soy proto support:
|
||||
* http://goto/soy-param-migration
|
||||
* @return {!Object}
|
||||
*/
|
||||
proto.messages.VideoInfo.prototype.toObject = function(opt_includeInstance) {
|
||||
return proto.messages.VideoInfo.toObject(opt_includeInstance, this);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Static version of the {@see toObject} method.
|
||||
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
|
||||
* the JSPB instance for transitional soy proto support:
|
||||
* http://goto/soy-param-migration
|
||||
* @param {!proto.messages.VideoInfo} msg The msg instance to transform.
|
||||
* @return {!Object}
|
||||
* @suppress {unusedLocalVariables} f is only used for nested messages
|
||||
*/
|
||||
proto.messages.VideoInfo.toObject = function(includeInstance, msg) {
|
||||
var f, obj = {
|
||||
duration: jspb.Message.getFloatingPointFieldWithDefault(msg, 1, 0.0)
|
||||
};
|
||||
|
||||
if (includeInstance) {
|
||||
obj.$jspbMessageInstance = msg;
|
||||
}
|
||||
return obj;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Deserializes binary data (in protobuf wire format).
|
||||
* @param {jspb.ByteSource} bytes The bytes to deserialize.
|
||||
* @return {!proto.messages.VideoInfo}
|
||||
*/
|
||||
proto.messages.VideoInfo.deserializeBinary = function(bytes) {
|
||||
var reader = new jspb.BinaryReader(bytes);
|
||||
var msg = new proto.messages.VideoInfo;
|
||||
return proto.messages.VideoInfo.deserializeBinaryFromReader(msg, reader);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Deserializes binary data (in protobuf wire format) from the
|
||||
* given reader into the given message object.
|
||||
* @param {!proto.messages.VideoInfo} msg The message object to deserialize into.
|
||||
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
|
||||
* @return {!proto.messages.VideoInfo}
|
||||
*/
|
||||
proto.messages.VideoInfo.deserializeBinaryFromReader = function(msg, reader) {
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup()) {
|
||||
break;
|
||||
}
|
||||
var field = reader.getFieldNumber();
|
||||
switch (field) {
|
||||
case 1:
|
||||
var value = /** @type {number} */ (reader.readFloat());
|
||||
msg.setDuration(value);
|
||||
break;
|
||||
default:
|
||||
reader.skipField();
|
||||
break;
|
||||
}
|
||||
}
|
||||
return msg;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Serializes the message to binary data (in protobuf wire format).
|
||||
* @return {!Uint8Array}
|
||||
*/
|
||||
proto.messages.VideoInfo.prototype.serializeBinary = function() {
|
||||
var writer = new jspb.BinaryWriter();
|
||||
proto.messages.VideoInfo.serializeBinaryToWriter(this, writer);
|
||||
return writer.getResultBuffer();
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Serializes the given message to binary data (in protobuf wire
|
||||
* format), writing to the given BinaryWriter.
|
||||
* @param {!proto.messages.VideoInfo} message
|
||||
* @param {!jspb.BinaryWriter} writer
|
||||
* @suppress {unusedLocalVariables} f is only used for nested messages
|
||||
*/
|
||||
proto.messages.VideoInfo.serializeBinaryToWriter = function(message, writer) {
|
||||
var f = undefined;
|
||||
f = message.getDuration();
|
||||
if (f !== 0.0) {
|
||||
writer.writeFloat(
|
||||
1,
|
||||
f
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional float duration = 1;
|
||||
* @return {number}
|
||||
*/
|
||||
proto.messages.VideoInfo.prototype.getDuration = function() {
|
||||
return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 1, 0.0));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {number} value
|
||||
* @return {!proto.messages.VideoInfo} returns this
|
||||
*/
|
||||
proto.messages.VideoInfo.prototype.setDuration = function(value) {
|
||||
return jspb.Message.setProto3FloatField(this, 1, value);
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if (jspb.Message.GENERATE_TO_OBJECT) {
|
||||
/**
|
||||
* Creates an object representation of this proto.
|
||||
@@ -7138,7 +7884,8 @@ proto.messages.Media.toObject = function(includeInstance, msg) {
|
||||
mimetype: jspb.Message.getFieldWithDefault(msg, 3, ""),
|
||||
audio: (f = msg.getAudio()) && proto.messages.AudioInfo.toObject(includeInstance, f),
|
||||
filename: jspb.Message.getFieldWithDefault(msg, 5, ""),
|
||||
contentpath: jspb.Message.getFieldWithDefault(msg, 6, "")
|
||||
contentpath: jspb.Message.getFieldWithDefault(msg, 6, ""),
|
||||
video: (f = msg.getVideo()) && proto.messages.VideoInfo.toObject(includeInstance, f)
|
||||
};
|
||||
|
||||
if (includeInstance) {
|
||||
@@ -7200,6 +7947,11 @@ proto.messages.Media.deserializeBinaryFromReader = function(msg, reader) {
|
||||
var value = /** @type {string} */ (reader.readString());
|
||||
msg.setContentpath(value);
|
||||
break;
|
||||
case 7:
|
||||
var value = new proto.messages.VideoInfo;
|
||||
reader.readMessage(value,proto.messages.VideoInfo.deserializeBinaryFromReader);
|
||||
msg.setVideo(value);
|
||||
break;
|
||||
default:
|
||||
reader.skipField();
|
||||
break;
|
||||
@@ -7272,6 +8024,14 @@ proto.messages.Media.serializeBinaryToWriter = function(message, writer) {
|
||||
f
|
||||
);
|
||||
}
|
||||
f = message.getVideo();
|
||||
if (f != null) {
|
||||
writer.writeMessage(
|
||||
7,
|
||||
f,
|
||||
proto.messages.VideoInfo.serializeBinaryToWriter
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -7426,6 +8186,43 @@ proto.messages.Media.prototype.setContentpath = function(value) {
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional VideoInfo video = 7;
|
||||
* @return {?proto.messages.VideoInfo}
|
||||
*/
|
||||
proto.messages.Media.prototype.getVideo = function() {
|
||||
return /** @type{?proto.messages.VideoInfo} */ (
|
||||
jspb.Message.getWrapperField(this, proto.messages.VideoInfo, 7));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {?proto.messages.VideoInfo|undefined} value
|
||||
* @return {!proto.messages.Media} returns this
|
||||
*/
|
||||
proto.messages.Media.prototype.setVideo = function(value) {
|
||||
return jspb.Message.setWrapperField(this, 7, value);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Clears the message field making it undefined.
|
||||
* @return {!proto.messages.Media} returns this
|
||||
*/
|
||||
proto.messages.Media.prototype.clearVideo = function() {
|
||||
return this.setVideo(undefined);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Returns whether this field is set.
|
||||
* @return {boolean}
|
||||
*/
|
||||
proto.messages.Media.prototype.hasVideo = function() {
|
||||
return jspb.Message.getField(this, 7) != null;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -124,7 +124,11 @@ import {
|
||||
WAMessageReaction,
|
||||
} from '@waha/structures/responses.dto';
|
||||
import { CallData } from '@waha/structures/calls.dto';
|
||||
import { MeInfo, ProxyConfig } from '@waha/structures/sessions.dto';
|
||||
import {
|
||||
MeInfo,
|
||||
ProxyConfig,
|
||||
SessionConfig,
|
||||
} from '@waha/structures/sessions.dto';
|
||||
import {
|
||||
BROADCAST_ID,
|
||||
DeleteStatusRequest,
|
||||
@@ -174,8 +178,8 @@ import {
|
||||
isLabelUpsertEvent,
|
||||
} from './labels.gows';
|
||||
import {
|
||||
GetEventStreamClient,
|
||||
GetMessageServiceClient,
|
||||
BuildEventStreamClient,
|
||||
BuildMessageServiceClient,
|
||||
} from '@waha/core/engines/gows/clients';
|
||||
import esm from '@waha/vendor/esm';
|
||||
import { IsEditedMessage } from '@waha/core/utils/pwa';
|
||||
@@ -188,6 +192,19 @@ import * as path from 'path';
|
||||
import MessageServiceClient = messages.MessageServiceClient;
|
||||
import * as fsp from 'fs/promises';
|
||||
|
||||
function getGowsStorageConfig(
|
||||
sessionConfig?: SessionConfig,
|
||||
): messages.SessionStorageConfig {
|
||||
const storeConfig = sessionConfig?.gows?.storage;
|
||||
return new messages.SessionStorageConfig({
|
||||
// Only explicit false disables; undefined/null defaults to enabled.
|
||||
messages: storeConfig?.messages !== false,
|
||||
groups: storeConfig?.groups !== false,
|
||||
chats: storeConfig?.chats !== false,
|
||||
labels: storeConfig?.labels !== false,
|
||||
});
|
||||
}
|
||||
|
||||
enum WhatsMeowEvent {
|
||||
CONNECTED = 'gows.ConnectedEventData',
|
||||
DISCONNECTED = 'events.Disconnected',
|
||||
@@ -216,6 +233,12 @@ enum WhatsMeowEvent {
|
||||
CALL_REJECT = 'events.CallReject',
|
||||
CALL_TERMINATE = 'events.CallTerminate',
|
||||
CALL_OFFER_NOTICE = 'events.CallOfferNotice',
|
||||
// Other
|
||||
AppState = 'events.AppState',
|
||||
AppStateSyncComplete = 'AppStateSyncComplete',
|
||||
AppStateSyncError = 'AppStateSyncError',
|
||||
HistorySync = 'events.HistorySync',
|
||||
Contact = 'events.Contact',
|
||||
}
|
||||
|
||||
export interface GowsConfig {
|
||||
@@ -267,6 +290,7 @@ export class WhatsappSessionGoWSCore extends WhatsappSession {
|
||||
address: auth.address(),
|
||||
dialect: auth.dialect(),
|
||||
}),
|
||||
storage: getGowsStorageConfig(this.sessionConfig),
|
||||
log: new messages.SessionLogConfig({
|
||||
level: level ?? messages.LogLevel.INFO,
|
||||
}),
|
||||
@@ -282,8 +306,7 @@ export class WhatsappSessionGoWSCore extends WhatsappSession {
|
||||
}),
|
||||
});
|
||||
|
||||
this.client = GetMessageServiceClient(
|
||||
this.name,
|
||||
this.client = BuildMessageServiceClient(
|
||||
this.engineConfig.connection,
|
||||
grpc.credentials.createInsecure(),
|
||||
);
|
||||
@@ -310,12 +333,25 @@ export class WhatsappSessionGoWSCore extends WhatsappSession {
|
||||
this.stream$ = new GowsEventStreamObservable(
|
||||
this.loggerBuilder.child({ grpc: 'stream' }),
|
||||
() => {
|
||||
const client = GetEventStreamClient(
|
||||
this.name,
|
||||
const client = BuildEventStreamClient(
|
||||
this.engineConfig.connection,
|
||||
grpc.credentials.createInsecure(),
|
||||
);
|
||||
const stream = client.StreamEvents(this.session);
|
||||
// Avoid having a lot of events after pairing the device
|
||||
// https://github.com/devlikeapro/waha/issues/1826
|
||||
// TODO: we need to make it more dynamic
|
||||
const exclude = [
|
||||
WhatsMeowEvent.AppState,
|
||||
WhatsMeowEvent.AppStateSyncComplete,
|
||||
WhatsMeowEvent.AppStateSyncError,
|
||||
WhatsMeowEvent.HistorySync,
|
||||
WhatsMeowEvent.Contact,
|
||||
];
|
||||
const request = new messages.StreamEventsRequest({
|
||||
session: this.session,
|
||||
exclude: exclude,
|
||||
});
|
||||
const stream = client.StreamEvents(request);
|
||||
return { client, stream };
|
||||
},
|
||||
);
|
||||
|
||||
@@ -64,10 +64,19 @@ export function ToGroupParticipant(
|
||||
interface GroupParticipantUpdate {
|
||||
id: string;
|
||||
author: string;
|
||||
participants: string[];
|
||||
participants: Array<string | NOWEBGroupParticipant>;
|
||||
action: ParticipantAction;
|
||||
}
|
||||
|
||||
function getParticipantId(
|
||||
participant: string | NOWEBGroupParticipant,
|
||||
): string | undefined {
|
||||
if (typeof participant === 'string') {
|
||||
return participant;
|
||||
}
|
||||
return participant?.id;
|
||||
}
|
||||
|
||||
export function ToGroupV2Participants(
|
||||
update: GroupParticipantUpdate,
|
||||
): GroupV2ParticipantsEvent {
|
||||
@@ -92,7 +101,8 @@ export function ToGroupV2Participants(
|
||||
break;
|
||||
}
|
||||
|
||||
const participants: GroupParticipant[] = update.participants.map((id) => {
|
||||
const participants: GroupParticipant[] = update.participants.map((item) => {
|
||||
const id = getParticipantId(item);
|
||||
return {
|
||||
id: toCusFormat(id),
|
||||
role: role,
|
||||
@@ -131,7 +141,11 @@ export function ToGroupV2LeaveEvent(
|
||||
return null;
|
||||
}
|
||||
const meId = esm.b.jidNormalizedUser(me.id);
|
||||
if (!update.participants.includes(meId)) {
|
||||
const includesMe = update.participants.some((participant) => {
|
||||
const id = getParticipantId(participant);
|
||||
return id === meId;
|
||||
});
|
||||
if (!includesMe) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -355,10 +355,8 @@ export class WhatsappSessionNoWebCore extends WhatsappSession {
|
||||
}
|
||||
return {
|
||||
agent: agents?.socket,
|
||||
// Baileys types still expect a Node https.Agent here,
|
||||
// but 'undici' fetch requires a Dispatcher.
|
||||
// Cast keeps the compiler satisfied while we pass the ProxyAgent at runtime.
|
||||
fetchAgent: agents?.fetch as unknown as Agent,
|
||||
// Baileys media upload uses Node https.request in Node runtime.
|
||||
fetchAgent: agents?.fetch as Agent,
|
||||
auth: state,
|
||||
printQRInTerminal: false,
|
||||
browser: browser,
|
||||
@@ -956,24 +954,63 @@ export class WhatsappSessionNoWebCore extends WhatsappSession {
|
||||
}
|
||||
|
||||
@Activity()
|
||||
public editMessage(
|
||||
public async editMessage(
|
||||
chatId: string,
|
||||
messageId: string,
|
||||
request: EditMessageRequest,
|
||||
) {
|
||||
const jid = toJID(this.ensureSuffix(chatId));
|
||||
const key = parseMessageIdSerialized(messageId);
|
||||
const message = {
|
||||
const stored = await this.store
|
||||
?.loadMessage(key.remoteJid, key.id)
|
||||
.catch(() => null);
|
||||
const content = extractMessageContent(stored?.message);
|
||||
let editedMessage = undefined;
|
||||
if (content?.imageMessage) {
|
||||
editedMessage = {
|
||||
imageMessage: {
|
||||
caption: request.text,
|
||||
},
|
||||
};
|
||||
} else if (content?.videoMessage) {
|
||||
editedMessage = {
|
||||
videoMessage: {
|
||||
caption: request.text,
|
||||
},
|
||||
};
|
||||
} else if (content?.documentMessage) {
|
||||
editedMessage = {
|
||||
documentMessage: {
|
||||
caption: request.text,
|
||||
},
|
||||
};
|
||||
} else if (content?.documentWithCaptionMessage?.message?.documentMessage) {
|
||||
editedMessage = {
|
||||
documentWithCaptionMessage: {
|
||||
message: {
|
||||
documentMessage: {
|
||||
caption: request.text,
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
let message: any = {
|
||||
text: request.text,
|
||||
mentions: request.mentions?.map(toJID),
|
||||
edit: key,
|
||||
editedMessage: editedMessage,
|
||||
linkPreview: this.getLinkPreview(request),
|
||||
linkPreviewHighQuality: request.linkPreviewHighQuality,
|
||||
};
|
||||
const options = {
|
||||
messageId: this.generateMessageID(),
|
||||
};
|
||||
return this.sock.sendMessage(jid, message, options);
|
||||
if (isJidNewsletter(jid)) {
|
||||
// Newsletter edits reuse the original message ID
|
||||
options.messageId = key.id;
|
||||
}
|
||||
return await this.sock.sendMessage(jid, message, options);
|
||||
}
|
||||
|
||||
@Activity()
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { Agent } from 'https';
|
||||
import type { Dispatcher } from 'undici';
|
||||
|
||||
export interface Agents {
|
||||
socket: Agent;
|
||||
fetch: Dispatcher;
|
||||
fetch: Agent;
|
||||
}
|
||||
@@ -11,7 +11,12 @@ export function extractMediaContent(
|
||||
content?.videoMessage ||
|
||||
content?.audioMessage ||
|
||||
content?.ptvMessage ||
|
||||
content?.stickerMessage;
|
||||
content?.stickerMessage ||
|
||||
content?.templateMessage?.hydratedTemplate?.imageMessage ||
|
||||
content?.templateMessage?.hydratedTemplate?.videoMessage ||
|
||||
content?.templateMessage?.interactiveMessageTemplate?.header
|
||||
?.imageMessage ||
|
||||
content?.templateMessage?.interactiveMessageTemplate?.header?.videoMessage;
|
||||
if (mediaContent) {
|
||||
return mediaContent;
|
||||
}
|
||||
|
||||
@@ -99,6 +99,19 @@ export class WPage extends EventEmitter {
|
||||
}
|
||||
}
|
||||
|
||||
// removeExposedFunction
|
||||
async removeExposedFunction(name: string) {
|
||||
try {
|
||||
return await this.page.removeExposedFunction(name);
|
||||
} catch (err) {
|
||||
this.emit(PAGE_CALL_ERROR_EVENT, {
|
||||
method: 'removeExposedFunction',
|
||||
error: err,
|
||||
});
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
|
||||
async reload(options?: any): Promise<any> {
|
||||
try {
|
||||
return await this.page.reload(options);
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { HttpsProxyAgent } from 'https-proxy-agent';
|
||||
import { URL } from 'url';
|
||||
import { ProxyAgent } from 'undici';
|
||||
|
||||
import { WhatsappConfigService } from '../config.service';
|
||||
import { ProxyConfig } from '../structures/sessions.dto';
|
||||
@@ -72,7 +71,9 @@ export function createAgentProxy(proxyConfig: ProxyConfig): Agents | undefined {
|
||||
);
|
||||
|
||||
const socketAgent = new HttpsProxyAgent(url);
|
||||
const fetchAgent = new ProxyAgent({ uri: url });
|
||||
// Baileys media upload uses Node.js https.request in Node runtime,
|
||||
// so fetchAgent must be a Node https.Agent (ProxyAgent from undici won't work).
|
||||
const fetchAgent = new HttpsProxyAgent(url);
|
||||
|
||||
return { socket: socketAgent, fetch: fetchAgent };
|
||||
}
|
||||
@@ -227,7 +227,8 @@ export class LinkPreviewData {
|
||||
example: {
|
||||
url:
|
||||
process.env.WHATSAPP_SWAGGER_JPG_EXAMPLE_URL ||
|
||||
'https://github.com/devlikeapro/waha/raw/core/examples/waha.jpg',
|
||||
'https://picsum.photos/1024',
|
||||
// 'https://github.com/devlikeapro/waha/raw/core/examples/waha.jpg',
|
||||
},
|
||||
})
|
||||
image?: FileType;
|
||||
|
||||
@@ -22,7 +22,8 @@ export class RemoteFile {
|
||||
@ApiProperty({
|
||||
example:
|
||||
process.env.WHATSAPP_SWAGGER_JPG_EXAMPLE_URL ||
|
||||
'https://github.com/devlikeapro/waha/raw/core/examples/waha.jpg',
|
||||
'https://picsum.photos/1024',
|
||||
// 'https://github.com/devlikeapro/waha/raw/core/examples/waha.jpg',
|
||||
})
|
||||
url: string;
|
||||
}
|
||||
@@ -130,7 +131,8 @@ export class FileURL {
|
||||
@ApiProperty({
|
||||
example:
|
||||
process.env.WHATSAPP_SWAGGER_JPG_EXAMPLE_URL ||
|
||||
'https://github.com/devlikeapro/waha/raw/core/examples/waha.jpg',
|
||||
'https://picsum.photos/1024',
|
||||
// 'https://github.com/devlikeapro/waha/raw/core/examples/waha.jpg',
|
||||
})
|
||||
url?: string;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
||||
|
||||
import { WAHAPresenceStatus } from './enums.dto';
|
||||
|
||||
@@ -28,9 +28,10 @@ export class WAHAChatPresences {
|
||||
export class WAHASessionPresence {
|
||||
presence: WAHAPresenceStatus;
|
||||
|
||||
@ApiProperty({
|
||||
description: 'Chat ID - either group id or contact id',
|
||||
@ApiPropertyOptional({
|
||||
description:
|
||||
'Chat ID - either group id or contact id. Required for chat-related presence statuses; omit for ONLINE/OFFLINE.',
|
||||
example: '11111111111@c.us',
|
||||
})
|
||||
chatId: string;
|
||||
chatId?: string;
|
||||
}
|
||||
@@ -113,6 +113,55 @@ export class NowebConfig {
|
||||
markOnline: boolean = true;
|
||||
}
|
||||
|
||||
export class GowsStorageConfig {
|
||||
@ApiProperty({
|
||||
description:
|
||||
'Store messages locally. Set to false to disable; omit or null to keep enabled.',
|
||||
required: false,
|
||||
example: true,
|
||||
})
|
||||
@IsBoolean()
|
||||
@IsOptional()
|
||||
messages?: boolean | null;
|
||||
|
||||
@ApiProperty({
|
||||
description:
|
||||
'Store groups locally. Set to false to disable; omit or null to keep enabled.',
|
||||
required: false,
|
||||
example: true,
|
||||
})
|
||||
@IsBoolean()
|
||||
@IsOptional()
|
||||
groups?: boolean | null;
|
||||
|
||||
@ApiProperty({
|
||||
description:
|
||||
'Store chats locally. Set to false to disable; omit or null to keep enabled.',
|
||||
required: false,
|
||||
example: true,
|
||||
})
|
||||
@IsBoolean()
|
||||
@IsOptional()
|
||||
chats?: boolean | null;
|
||||
|
||||
@ApiProperty({
|
||||
description:
|
||||
'Store labels locally. Set to false to disable; omit or null to keep enabled.',
|
||||
required: false,
|
||||
example: true,
|
||||
})
|
||||
@IsBoolean()
|
||||
@IsOptional()
|
||||
labels?: boolean | null;
|
||||
}
|
||||
|
||||
export class GowsConfig {
|
||||
@ValidateNested()
|
||||
@Type(() => GowsStorageConfig)
|
||||
@IsOptional()
|
||||
storage?: GowsStorageConfig;
|
||||
}
|
||||
|
||||
export class WebjsConfig {
|
||||
@ApiProperty({
|
||||
description:
|
||||
@@ -241,6 +290,21 @@ export class SessionConfig {
|
||||
@IsOptional()
|
||||
noweb?: NowebConfig;
|
||||
|
||||
@ApiProperty({
|
||||
example: {
|
||||
storage: {
|
||||
messages: true,
|
||||
groups: true,
|
||||
chats: true,
|
||||
labels: true,
|
||||
},
|
||||
},
|
||||
})
|
||||
@ValidateNested()
|
||||
@Type(() => GowsConfig)
|
||||
@IsOptional()
|
||||
gows?: GowsConfig;
|
||||
|
||||
@ApiProperty({
|
||||
description: 'WebJS-specific settings.',
|
||||
required: false,
|
||||
|
||||
+1
-1
@@ -44,7 +44,7 @@ function getPlatform() {
|
||||
}
|
||||
|
||||
export const VERSION: WAHAEnvironment = {
|
||||
version: '2026.1.4',
|
||||
version: '2026.2.2',
|
||||
engine: getEngineName(),
|
||||
tier: getWAHAVersion(),
|
||||
browser: getBrowser(),
|
||||
|
||||
+2
-2
@@ -2,11 +2,11 @@
|
||||
"waha": {
|
||||
"gows": {
|
||||
"repo": "devlikeapro/gows",
|
||||
"ref": "v1.0.31"
|
||||
"ref": "v1.0.33"
|
||||
},
|
||||
"dashboard": {
|
||||
"repo": "devlikeapro/dashboard",
|
||||
"ref": "6923320467747d7abc4e8e336852bc8ef3f992e9"
|
||||
"ref": "9c3f343aad6a211524a0cebf1ba3dcc3fa094840"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,9 +5,9 @@ __metadata:
|
||||
version: 8
|
||||
cacheKey: 10
|
||||
|
||||
"@adiwajshing/baileys@github:devlikeapro/Baileys#fork-master-2026-01-25":
|
||||
"@adiwajshing/baileys@github:devlikeapro/Baileys#fork-master-2026-02-11":
|
||||
version: 7.0.0-rc.9
|
||||
resolution: "@adiwajshing/baileys@https://github.com/devlikeapro/Baileys.git#commit=7a9463729776e6fb19ccfb9ce8312515db92b94a"
|
||||
resolution: "@adiwajshing/baileys@https://github.com/devlikeapro/Baileys.git#commit=b00582cdfd9cef50a7f1a0e2faa28dbf7baef407"
|
||||
dependencies:
|
||||
"@cacheable/node-cache": "npm:^1.4.0"
|
||||
"@hapi/boom": "npm:^9.1.3"
|
||||
@@ -18,6 +18,7 @@ __metadata:
|
||||
p-queue: "npm:^9.0.0"
|
||||
pino: "npm:^9.6"
|
||||
protobufjs: "npm:^7.2.4"
|
||||
whatsapp-rust-bridge: "npm:0.5.2"
|
||||
ws: "npm:^8.13.0"
|
||||
peerDependencies:
|
||||
audio-decode: ^2.1.3
|
||||
@@ -31,7 +32,7 @@ __metadata:
|
||||
optional: true
|
||||
link-preview-js:
|
||||
optional: true
|
||||
checksum: 10/69fce0f910203bc1bf4c1c677110e2d887fb5d00e5ea4759da8506afa36606baf70dc19e5396b24997cb204c86b48cda5d88a1e7d333282f7499b52b356c3b00
|
||||
checksum: 10/7229ea82f4849f3397201ae16ab202f57f9788d61ce80b37cc42b77e01808ad53c470443e4fef44297681c5c6211829095210aeff5fb717fd8c083d9d6c4e22f
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@@ -12593,7 +12594,7 @@ __metadata:
|
||||
version: 0.0.0-use.local
|
||||
resolution: "waha@workspace:."
|
||||
dependencies:
|
||||
"@adiwajshing/baileys": "github:devlikeapro/Baileys#fork-master-2026-01-25"
|
||||
"@adiwajshing/baileys": "github:devlikeapro/Baileys#fork-master-2026-02-11"
|
||||
"@adiwajshing/keyed-db": "npm:^0.2.4"
|
||||
"@aws-sdk/client-s3": "npm:^3.633.0"
|
||||
"@aws-sdk/s3-request-presigner": "npm:^3.633.0"
|
||||
@@ -12699,7 +12700,7 @@ __metadata:
|
||||
ulid: "npm:^2.3.0"
|
||||
undici: "npm:^7.16.0"
|
||||
uniqid: "npm:^5.4.0"
|
||||
whatsapp-web.js: "github:devlikeapro/whatsapp-web.js#fork-main-2025-12-17"
|
||||
whatsapp-web.js: "github:devlikeapro/whatsapp-web.js#fork-main-2026-02-01"
|
||||
write-file-atomic: "npm:^6.0.0"
|
||||
yaml: "npm:^2.7.1"
|
||||
dependenciesMeta:
|
||||
@@ -12800,9 +12801,16 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"whatsapp-web.js@github:devlikeapro/whatsapp-web.js#fork-main-2025-12-17":
|
||||
version: 1.34.3
|
||||
resolution: "whatsapp-web.js@https://github.com/devlikeapro/whatsapp-web.js.git#commit=47347ab0a148e01daf271a9e8c39b50dbc5c3cb2"
|
||||
"whatsapp-rust-bridge@github:devlikeapro/whatsapp-rust-bridge.git#fork-master-2026-02-04":
|
||||
version: 0.5.2
|
||||
resolution: "whatsapp-rust-bridge@https://github.com/devlikeapro/whatsapp-rust-bridge.git#commit=9fb931fbb991f5ff01142f72de41c21b39ed3a8f"
|
||||
checksum: 10/b96e5efaf70f975eb3e51513c65c1f73f45f88946196c8f4c7c5c940a3975b2fb3b696bddc5378798e80e242f21fe7cdf4141a81dd405b85ef44272a28d6e76f
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"whatsapp-web.js@github:devlikeapro/whatsapp-web.js#fork-main-2026-02-01":
|
||||
version: 1.34.6
|
||||
resolution: "whatsapp-web.js@https://github.com/devlikeapro/whatsapp-web.js.git#commit=3602e0801d8ba3bd2549068e79536282b3028a0e"
|
||||
dependencies:
|
||||
"@pedroslopez/moduleraid": "npm:^5.0.2"
|
||||
archiver: "npm:^5.3.1"
|
||||
@@ -12820,7 +12828,7 @@ __metadata:
|
||||
optional: true
|
||||
unzipper:
|
||||
optional: true
|
||||
checksum: 10/fb3bf88719634f1061823d3b3d548007355886d2394f8dbe8bcf1570c70dc09849034cfbe488bdfc3f20807933373ed632e8b2c550198ec41ee1c03a5bdfbe29
|
||||
checksum: 10/a7a177079c271c27675ca49e76d31f283c5472bcc478cc5e78c4d2ad5a6ed120346fd9a176791d28cc69f42c540d3430eb3809e9d1641f2dc1183e0d82d8df81
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
|
||||
Reference in new issue
Block a user