Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
bed7799
Fixstatus@broadcast
ViperTecCorporation Sep 20, 2025
80b782f
dockerpublishOnGit
ViperTecCorporation Sep 20, 2025
ab0c187
FixStatusToSockect
ViperTecCorporation Sep 20, 2025
3681554
JidListInclude
ViperTecCorporation Sep 20, 2025
74d6eda
AjusteSocketSentStatusMsg
ViperTecCorporation Sep 20, 2025
d02d4e5
statusJidListNormalizeJid
ViperTecCorporation Sep 20, 2025
9a39057
fix
ViperTecCorporation Sep 21, 2025
4f98ba9
preflight Controller
ViperTecCorporation Sep 21, 2025
4c25229
Whaileys 6.2.1
ViperTecCorporation Sep 21, 2025
1deb403
chore: checkpoint before merging upstream v2.5.0-alpha-33 (status bro…
Sep 21, 2025
10f4a31
merge: upstream v2.5.0-alpha-33; resolve contacts() to use exists(raw…
Sep 21, 2025
a82d9ce
Fix9Digito
Sep 21, 2025
46f2acf
fixValidContact
Sep 21, 2025
7b17766
GarantirJid
Sep 21, 2025
304d942
STATUS_ALLOW_LID
Sep 21, 2025
5fe1314
rollbackbaileys
Sep 21, 2025
7019456
Baileys 7 Migration
Sep 21, 2025
e32d4c0
chore(baileys-v7): migrate to @whiskeysockets/baileys v7 RC; drop voi…
Sep 21, 2025
4b2c952
ci(sync-upstream): use Node 24 + Yarn classic; remove corepack; yarn …
Sep 21, 2025
77f0743
Update README.md SendStatus
ViperTecCorporation Sep 22, 2025
d6efc87
fix(ui): serve socket.io client via require.resolve and add socket.io…
Sep 22, 2025
d8c0a29
feat(voice): vendor voice-calls-baileys (v7-compatible), wire back in…
Sep 22, 2025
8427103
chore(clean): remove unpacked voice-calls-baileys (package/) and tarb…
Sep 22, 2025
d466918
FixSocketIo
Sep 22, 2025
7667700
vendorFix
Sep 22, 2025
1f9804b
FallBackSocketIo
Sep 22, 2025
b9d406d
Cdn Socket.io
Sep 22, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ on:
pull_request:
branches: [ main develop ]

# Required to push images to GHCR
permissions:
contents: read
packages: write

jobs:
test:
runs-on: ubuntu-latest
Expand All @@ -35,7 +40,7 @@ jobs:
uses: docker/metadata-action@v5
with:
images: |
${{ github.repository }}
ghcr.io/${{ github.repository }}
tags: |
type=schedule
type=ref,event=branch
Expand All @@ -48,12 +53,13 @@ jobs:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Login to Docker Hub
- name: Login to GHCR
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
Expand All @@ -67,9 +73,3 @@ jobs:
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

- name: Docker Hub Description
uses: peter-evans/dockerhub-description@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
76 changes: 76 additions & 0 deletions .github/workflows/sync-upstream.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: Sync Upstream + Test

on:
workflow_dispatch:
inputs:
upstream_repo:
description: "Upstream repo (owner/name)"
required: true
default: "clairton/unoapi-cloud"
tag:
description: "Tag to merge (e.g., v2.5.0-alpha-33)"
required: true
base_branch:
description: "Base branch to merge into"
required: false
default: "fixStatusBroadcast"

jobs:
sync:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout base branch
uses: actions/checkout@v4
with:
ref: ${{ inputs.base_branch }}

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '24'
cache: yarn

- name: Configure Git
run: |
git config user.email "actions@github.com"
git config user.name "GitHub Actions"

- name: Add upstream and fetch tags
run: |
git remote add upstream https://github.com/${{ inputs.upstream_repo }}.git
git fetch upstream --tags --prune

- name: Create merge branch and merge tag
run: |
BRANCH="merge/${{ inputs.tag }}"
git checkout -b "$BRANCH"
git merge --no-ff -m "merge: upstream ${{ inputs.tag }}" "tags/${{ inputs.tag }}"

- name: Install Yarn (classic) and dependencies
run: |
npm i -g yarn@1.22.22
yarn install

- name: Build
run: yarn build

- name: Test
run: yarn test --coverage

- name: Push branch
run: |
git push -u origin "merge/${{ inputs.tag }}"

- name: Open Pull Request
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
base: ${{ inputs.base_branch }}
branch: merge/${{ inputs.tag }}
title: "Merge upstream ${{ inputs.tag }} into ${{ inputs.base_branch }}"
body: |
Automated upstream merge from ${{ inputs.upstream_repo }} tag ${{ inputs.tag }}.
CI built and tested this branch before opening the PR.
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ WORKDIR /app

ADD ./package.json ./package.json
ADD ./yarn.lock ./yarn.lock
ADD ./vendor ./vendor
RUN yarn

ADD ./src ./src
Expand Down Expand Up @@ -35,6 +36,7 @@ COPY --from=builder /app/dist ./dist
COPY --from=builder /app/public ./public
COPY --from=builder /app/package.json ./package.json
COPY --from=builder /app/yarn.lock ./yarn.lock
COPY --from=builder /app/vendor ./vendor


RUN apk --update --no-cache add git ffmpeg
Expand Down
139 changes: 138 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,145 @@ http://localhost:9876/v15.0/554931978550/messages \
}
}'
```
To Send a Status
Requisitos:
to = 'status@broadcast'
type is content (ex.: image, video ou text)
statusJidList = ['5511999999999, ...] with at least 1 JID valid

Image sample
```sh
curl -i -X POST \
http://localhost:9876/v15.0/5549988290955/messages \
--header 'Content-Type: application/json' \
--header 'Authorization: ••••••' \
--data-raw '
{
"messaging_product":
"whatsapp",
"recipient_type":
"individual",
"to":
"status@broadcast",
"context":
{
"message_id":
"8e401d25-89e8-4b9d-aa10-373e2ee1a5555"
},
"type":
"image",
"image":
{
"link":
"https://r2.vipertec.net/6YLUsdJFWE1SRdTcuGpi.png",
"caption":
"wificam"
},
"statusJidList":
[
"5566996269251",
"5566997195718",
"5566996222471"
]
}
```
Video sample
```sh
curl -i -X POST \
http://localhost:9876/v15.0/5549988290955/messages \
--header 'Content-Type: application/json' \
--header 'Authorization: ••••••' \
--data-raw '
{
"messaging_product":
"whatsapp",
"recipient_type":
"individual",
"to":
"status@broadcast",
"context":
{
"message_id":
"8e401d25-89e8-4b9d-aa10-373e2ee1a5555"
},
"type":
"video",
"video":
{
"link":
"https://r2.vipertec.net/fyHiN0XTnKtnDXbUwX9A.mp4",
"caption":
"AutoMonitoramento"
},
"statusJidList":
[
"5566996269251",
"5566997195718",
"5566996222471"
]
}
```
Text sample
```sh
curl -i -X POST \
http://localhost:9876/v15.0/5549988290955/messages \
--header 'Content-Type: application/json' \
--header 'Authorization: ••••••' \
--data-raw '
{
"messaging_product":
"whatsapp",
"recipient_type":
"individual",
"to":
"status@broadcast",
"context":
{
"message_id":
"8e401d25-89e8-4b9d-aa10-373e2ee1a5555"
},
"type": "text",
"text": {
"body": "hello"
},
"statusJidList":
[
"5566996269251",
"5566997195718",
"5566996222471"
],
"backgroundColor":
"#000000",
"font":
1
}
```
Note:
Your number's WhatsApp status privacy must allow delivery to the provided JIDs.
If you provide an empty JIDList, the status will not be delivered.
To send a contact
![Imagem do WhatsApp de 2025-09-21 à(s) 20 03 33_a199430a](https://github.com/user-attachments/assets/c498de41-b8dc-4368-98b0-737b2fee4735)

New endpoint Preflight

How to use for diagnostics

Call preflight and check:
session.online = true (session connected)
counts.valid == counts.normalized (all counts exist in WhatsApp)
ready = true (prerequisites met)
If "ready" is false:
session.online = false → reconnect the session.
There are invalid numbers → the number doesn't have WhatsApp (correct or remove from the list).
Even with ready=true, Status may not appear due to privacy/saved contacts (not something the API can confirm).

```sh
curl --location 'http://localhost:9876/v15.0/v15.0/5566996222471/preflight/status' \
--header 'Content-Type: application/json' \
--header 'Authorization: ••••••' \
--data '{ "statusJidList": ["5566996269251","5566997195718","5566996222471"] }
'
```

```sh
curl -i -X POST \
Expand Down Expand Up @@ -703,4 +840,4 @@ Mail to sales@unoapi.cloud
- Connect with pairing code: https://github.com/WhiskeySockets/Baileys#starting-socket-with-pairing-code
- Counting connection retry attempts even when restarting to prevent looping messages
- Message delete endpoint
- Send reply message with please to send again, when any error and message enqueue in .dead
- Send reply message with please to send again, when any error and message enqueue in .dead
2 changes: 1 addition & 1 deletion __tests__/services/client_baileys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
logout,
} from '../../src/services/socket'
import { mock, mockFn } from 'jest-mock-extended'
import { proto } from 'baileys'
import { proto } from '@whiskeysockets/baileys'
import { DataStore } from '../../src/services/data_store'
import { Incoming } from '../../src/services/incoming'
import { dataStores } from '../../src/services/data_store'
Expand Down
2 changes: 1 addition & 1 deletion __tests__/services/message_filter.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { WAMessageKey } from 'baileys'
import { WAMessageKey } from '@whiskeysockets/baileys'
import { Config, defaultConfig } from '../../src/services/config'
import { MessageFilter } from '../../src/services/message_filter'

Expand Down
23 changes: 21 additions & 2 deletions __tests__/services/socket.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,25 @@
jest.mock('baileys')
jest.mock('@whiskeysockets/baileys', () => {
const fn = jest.fn()
return {
__esModule: true,
default: fn,
makeWASocket: fn,
Browsers: { ubuntu: (_: string) => ['Unoapi', 'Chrome', 'Linux'] },
fetchLatestBaileysVersion: jest.fn(async () => ({ version: [2, 2, 2] })),
DisconnectReason: { loggedOut: 401, connectionReplaced: 440, restartRequired: 515, badSession: 500 },
delay: jest.fn(async () => {}),
proto: {},
}
})
jest.mock('@whiskeysockets/baileys/lib/Utils/logger', () => {
const mockLogger = {
level: 'info',
child: () => ({ level: 'info' }),
}
return { __esModule: true, default: mockLogger }
})
import { OnDisconnected, OnQrCode, OnReconnect, OnNotification, connect } from '../../src/services/socket'
import makeWASocket, { WASocket, WAVersion } from 'baileys'
import makeWASocket, { WASocket, WAVersion } from '@whiskeysockets/baileys'
import { mock } from 'jest-mock-extended'
import { Store } from '../../src/services/store'
import { defaultConfig } from '../../src/services/config'
Expand Down
2 changes: 1 addition & 1 deletion __tests__/services/transformer.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { WAMessage, proto } from 'baileys'
import { WAMessage, proto } from '@whiskeysockets/baileys'
import {
phoneNumberToJid,
getMessageType,
Expand Down
6 changes: 5 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,8 @@
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
};
moduleNameMapper: {
'^@whiskeysockets/baileys$': '<rootDir>/test-setup/baileys.mock.ts',
'^@whiskeysockets/baileys/lib/Utils/logger$': '<rootDir>/test-setup/baileys-logger.mock.ts',
},
};
Loading