Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 2 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ jobs:
lint:
timeout-minutes: 10
name: lint
runs-on: ${{ github.repository == 'stainless-sdks/beeper-desktop-api-php' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v6
Expand All @@ -35,8 +34,7 @@ jobs:
test:
timeout-minutes: 10
name: test
runs-on: ${{ github.repository == 'stainless-sdks/beeper-desktop-api-php' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6

Expand Down
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.0.1"
".": "6.0.0"
}
5 changes: 1 addition & 4 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
configured_endpoints: 23
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/beeper%2Fbeeper-desktop-api-774bb08472b6bb14c280fe5b767925675516b5c8ccc0b89b5abd7ac7bc30fe5a.yml
openapi_spec_hash: ddd1ce1f334b45206ac008b0f5296842
config_hash: b5ac0c1579dfe6257bcdb84cfd1002fc
configured_endpoints: 60
102 changes: 102 additions & 0 deletions .stdy.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
Steady - Beeper Client API v5.0.0

warning[E1017]: 304 response on GET /v1/assets/serve has no Location header. HTTP redirects require Location per RFC 9110
--> #/paths/~1v1~1assets~1serve/get/responses/304
= Add a Location header with an example value, e.g. headers: { Location: { schema: { type: string }, example: '/resource/123' } }. Without one, Steady redirects to /_x-steady/redirected.

info[E1015]: exclusiveMinimum is a boolean but OpenAPI 3.1.0 expects a number
--> #/paths/~1v1~1messages~1search/get/parameters/10/schema
= Steady handles this, but other tools may not. In 3.1.x, use exclusiveMinimum: <number> as a standalone bound
For details, try: steady explain E1017 E1015

Loaded: 60/60 endpoints (49ms) (1 warning, 1 info)
Ready to accept requests on http://127.0.0.1:4010 (reject-on-sdk-error)

[8:12:21 PM] GET /v1/accounts/accountID/contacts/list?limit=50 → 200 OK (5ms) [91 bytes]
[8:12:21 PM] GET /v1/accounts/accountID/contacts?query=x → 200 OK (1ms) [28 bytes]
[8:12:21 PM] GET /v1/accounts/accountID/contacts?query=x → 200 OK (0ms) [28 bytes]
[8:12:21 PM] GET /v1/accounts/accountID → 200 OK (1ms) [140 bytes]
[8:12:21 PM] GET /v1/accounts → 200 OK (0ms) [1198 bytes]
[8:12:21 PM] POST /v1/app/setup/verification/recovery-key/reset → 200 OK (1ms) [324 bytes]
[8:12:21 PM] POST /v1/app/setup/verification/recovery-key/reset/confirm → 200 OK (1ms) [310 bytes]
[8:12:21 PM] POST /v1/app/setup/verification/recovery-key/reset/confirm → 200 OK (1ms) [310 bytes]
[8:12:21 PM] POST /v1/app/setup/verification/recovery-key → 200 OK (1ms) [310 bytes]
[8:12:21 PM] POST /v1/app/setup/verification/recovery-key → 200 OK (1ms) [310 bytes]
[8:12:21 PM] POST /v1/app/setup/verifications/x/qr/confirm-scanned → 200 OK (0ms) [310 bytes]
[8:12:21 PM] POST /v1/app/setup/verifications/qr/scan → 200 OK (0ms) [310 bytes]
[8:12:21 PM] POST /v1/app/setup/verifications/qr/scan → 200 OK (0ms) [310 bytes]
[8:12:21 PM] POST /v1/app/setup/verifications/x/sas/confirm → 200 OK (0ms) [310 bytes]
[8:12:21 PM] POST /v1/app/setup/verifications/x/sas/start → 200 OK (0ms) [310 bytes]
[8:12:21 PM] POST /v1/app/setup/verifications → 200 OK (1ms) [310 bytes]
[8:12:21 PM] GET /v1/app/setup/verifications/x → 200 OK (0ms) [310 bytes]
[8:12:21 PM] GET /v1/app/setup/verifications → 200 OK (0ms) [141 bytes]
[8:12:21 PM] POST /v1/app/setup/verifications/x/accept → 200 OK (0ms) [310 bytes]
[8:12:21 PM] POST /v1/app/setup/verifications/x/cancel → 200 OK (0ms) [310 bytes]
[8:12:21 PM] GET /v1/app/setup → 200 OK (0ms) [298 bytes]
[8:12:21 PM] POST /v1/app/setup/email → 204 No Content (0ms) [4 bytes]
[8:12:21 PM] POST /v1/app/setup/email → 204 No Content (0ms) [4 bytes]
[8:12:21 PM] POST /v1/app/setup/register → 200 OK (0ms) [401 bytes]
[8:12:21 PM] POST /v1/app/setup/register → 200 OK (0ms) [401 bytes]
[8:12:21 PM] POST /v1/app/setup/response → 200 OK (0ms) [401 bytes]
[8:12:21 PM] POST /v1/app/setup/response → 200 OK (0ms) [401 bytes]
[8:12:21 PM] POST /v1/app/setup/start → 200 OK (0ms) [48 bytes]
[8:12:21 PM] POST /v1/assets/download → 200 OK (0ms) [2 bytes]
[8:12:21 PM] POST /v1/assets/download → 200 OK (0ms) [2 bytes]
[8:12:21 PM] GET /v1/assets/serve?url=x → 200 OK (0ms) [4 bytes]
[8:12:21 PM] GET /v1/assets/serve?url=x → 200 OK (0ms) [4 bytes]
[8:12:21 PM] POST /v1/assets/upload → 200 OK (2ms) [2 bytes]
[8:12:21 PM] POST /v1/assets/upload → 200 OK (1ms) [2 bytes]
[8:12:21 PM] POST /v1/assets/upload/base64 → 200 OK (0ms) [2 bytes]
[8:12:21 PM] POST /v1/assets/upload/base64 → 200 OK (0ms) [2 bytes]
[8:12:21 PM] POST /v1/focus → 200 OK (0ms) [17 bytes]
[8:12:21 PM] GET /v1/search?query=x → 200 OK (0ms) [3677 bytes]
[8:12:21 PM] GET /v1/search?query=x → 200 OK (0ms) [3677 bytes]
[8:12:21 PM] GET /v1/bridges/local-whatsapp/login-flows → 200 OK (0ms) [28 bytes]
[8:12:21 PM] POST /v1/bridges/local-whatsapp/login-sessions/123/steps/x → 200 OK (1ms) [78 bytes]
[8:12:21 PM] POST /v1/bridges/local-whatsapp/login-sessions/123/steps/x → 200 OK (0ms) [78 bytes]
[8:12:21 PM] POST /v1/bridges/local-whatsapp/login-sessions → 200 OK (0ms) [78 bytes]
[8:12:21 PM] GET /v1/bridges/local-whatsapp/login-sessions/123 → 200 OK (0ms) [78 bytes]
[8:12:21 PM] GET /v1/bridges/local-whatsapp/login-sessions/123 → 200 OK (0ms) [78 bytes]
[8:12:21 PM] DELETE /v1/bridges/local-whatsapp/login-sessions/123 → 200 OK (0ms) [68 bytes]
[8:12:21 PM] DELETE /v1/bridges/local-whatsapp/login-sessions/123 → 200 OK (0ms) [68 bytes]
[8:12:21 PM] GET /v1/bridges/local-whatsapp/logins/ba_EvYDBBsZbRQAy3UOSWqG0LuTVkc → 200 OK (0ms) [93 bytes]
[8:12:21 PM] GET /v1/bridges/local-whatsapp/logins/ba_EvYDBBsZbRQAy3UOSWqG0LuTVkc → 200 OK (0ms) [93 bytes]
[8:12:21 PM] GET /v1/bridges/local-whatsapp/logins → 200 OK (0ms) [109 bytes]
[8:12:21 PM] POST /v1/bridges/local-whatsapp/logins/ba_EvYDBBsZbRQAy3UOSWqG0LuTVkc/remove → 200 OK (0ms) [81 bytes]
[8:12:21 PM] POST /v1/bridges/local-whatsapp/logins/ba_EvYDBBsZbRQAy3UOSWqG0LuTVkc/remove → 200 OK (0ms) [81 bytes]
[8:12:21 PM] GET /v1/bridges/local-whatsapp → 200 OK (0ms) [292 bytes]
[8:12:21 PM] GET /v1/bridges → 200 OK (0ms) [302 bytes]
[8:12:21 PM] GET /v1/bridges/local-whatsapp/capabilities → 200 OK (0ms) [178 bytes]
[8:12:21 PM] DELETE /v1/chats/%21NCdzlIaMjZUmvmvyHU%3Abeeper.com/messages/1343993/reactions/x → 200 OK (0ms) [150 bytes]
[8:12:21 PM] DELETE /v1/chats/%21NCdzlIaMjZUmvmvyHU%3Abeeper.com/messages/1343993/reactions/x → 200 OK (0ms) [150 bytes]
[8:12:21 PM] POST /v1/chats/%21NCdzlIaMjZUmvmvyHU%3Abeeper.com/messages/1343993/reactions → 200 OK (0ms) [185 bytes]
[8:12:21 PM] POST /v1/chats/%21NCdzlIaMjZUmvmvyHU%3Abeeper.com/messages/1343993/reactions → 200 OK (0ms) [185 bytes]
[8:12:21 PM] POST /v1/chats/%21NCdzlIaMjZUmvmvyHU%3Abeeper.com/reminders → 204 No Content (0ms) [4 bytes]
[8:12:21 PM] POST /v1/chats/%21NCdzlIaMjZUmvmvyHU%3Abeeper.com/reminders → 204 No Content (0ms) [4 bytes]
[8:12:21 PM] DELETE /v1/chats/%21NCdzlIaMjZUmvmvyHU%3Abeeper.com/reminders → 204 No Content (0ms) [4 bytes]
[8:12:21 PM] POST /v1/chats → 200 OK (0ms) [937 bytes]
[8:12:21 PM] POST /v1/chats → 200 OK (0ms) [937 bytes]
[8:12:21 PM] GET /v1/chats/%21NCdzlIaMjZUmvmvyHU%3Abeeper.com?maxParticipantCount=100 → 200 OK (0ms) [717 bytes]
[8:12:21 PM] PATCH /v1/chats/%21NCdzlIaMjZUmvmvyHU%3Abeeper.com → 200 OK (0ms) [717 bytes]
[8:12:21 PM] GET /v1/chats?limit=25 → 200 OK (0ms) [806 bytes]
[8:12:21 PM] POST /v1/chats/%21NCdzlIaMjZUmvmvyHU%3Abeeper.com/archive → 204 No Content (0ms) [4 bytes]
[8:12:21 PM] POST /v1/chats/%21NCdzlIaMjZUmvmvyHU%3Abeeper.com/read → 200 OK (0ms) [717 bytes]
[8:12:21 PM] POST /v1/chats/%21NCdzlIaMjZUmvmvyHU%3Abeeper.com/unread → 200 OK (0ms) [717 bytes]
[8:12:21 PM] POST /v1/chats/%21NCdzlIaMjZUmvmvyHU%3Abeeper.com/notify-anyway → 200 OK (0ms) [717 bytes]
[8:12:21 PM] GET /v1/chats/search?includeMuted=true&limit=50&scope=titles&type=any → 200 OK (0ms) [2236 bytes]
[8:12:21 PM] POST /v1/chats/start → 200 OK (0ms) [937 bytes]
[8:12:21 PM] POST /v1/chats/start → 200 OK (0ms) [937 bytes]
[8:12:21 PM] GET /v1/info → 200 OK (0ms) [470 bytes]
[8:12:21 PM] GET /v1/labels → 200 OK (0ms) [35 bytes]
[8:12:21 PM] GET /v1/chats/%21NCdzlIaMjZUmvmvyHU%3Abeeper.com/messages/1343993 → 200 OK (0ms) [424 bytes]
[8:12:21 PM] GET /v1/chats/%21NCdzlIaMjZUmvmvyHU%3Abeeper.com/messages/1343993 → 200 OK (0ms) [424 bytes]
[8:12:21 PM] PUT /v1/chats/%21NCdzlIaMjZUmvmvyHU%3Abeeper.com/messages/1343993 → 200 OK (0ms) [423 bytes]
[8:12:21 PM] PUT /v1/chats/%21NCdzlIaMjZUmvmvyHU%3Abeeper.com/messages/1343993 → 200 OK (0ms) [423 bytes]
[8:12:21 PM] GET /v1/chats/%21NCdzlIaMjZUmvmvyHU%3Abeeper.com/messages → 200 OK (0ms) [499 bytes]
[8:12:21 PM] DELETE /v1/chats/%21NCdzlIaMjZUmvmvyHU%3Abeeper.com/messages/1343993?forEveryone=true → 204 No Content (0ms) [4 bytes]
[8:12:21 PM] DELETE /v1/chats/%21NCdzlIaMjZUmvmvyHU%3Abeeper.com/messages/1343993?forEveryone=true → 204 No Content (0ms) [4 bytes]
[8:12:21 PM] GET /v1/messages/search?excludeLowPriority=true&includeMuted=true&limit=20 → 200 OK (0ms) [2192 bytes]
[8:12:21 PM] POST /v1/chats/%21NCdzlIaMjZUmvmvyHU%3Abeeper.com/messages → 200 OK (0ms) [129 bytes]

Session: 85 requests (100% structurally valid)
Coverage: 60/60 endpoints (100%)
47 changes: 42 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ To use this package, install via Composer by adding the following to your applic
"repositories": [
{
"type": "vcs",
"url": "git@github.com:beeper/desktop-api-php.git"
"url": "https://github.com/beeper/desktop-api-php.git"
}
],
"require": {
"beeper/desktop-api-php": "dev-main"
"beeper/desktop-api-php": "^6.0"
}
}
```
Expand All @@ -42,7 +42,14 @@ $client = new Client(
accessToken: getenv('BEEPER_ACCESS_TOKEN') ?: 'My Access Token'
);

$page = $client->chats->search(includeMuted: true, limit: 3, type: 'single');
$page = $client->chats->search(
accountIDs: [
'matrix', 'discordgo', 'local-whatsapp_ba_EvYDBBsZbRQAy3UOSWqG0LuTVkc'
],
includeMuted: true,
limit: 3,
type: 'single',
);

var_dump($page->id);
```
Expand Down Expand Up @@ -70,9 +77,9 @@ $client = new Client(
);

$page = $client->messages->search(
accountIDs: ['local-telegram_ba_QFrb5lrLPhO3OT5MFBeTWv0x4BI'],
accountIDs: ['discordgo', 'local-whatsapp_ba_EvYDBBsZbRQAy3UOSWqG0LuTVkc'],
limit: 10,
query: 'deployment',
query: 'oauth',
);

var_dump($page);
Expand Down Expand Up @@ -147,6 +154,36 @@ $client = new Client(requestOptions: ['maxRetries' => 0]);
$result = $client->accounts->list(requestOptions: ['maxRetries' => 5]);
```

### File uploads

Request parameters that correspond to file uploads can be passed as a resource returned by `fopen()`, a string of file contents, or a `FileParam` instance.

```php
<?php

use BeeperDesktop\Core\FileParam;

// Pass a string with filename and content type:
$contents = file_get_contents('/path/to/file');
// Pass a string with filename and content type:
$response = $client->assets->upload(
file: FileParam::fromString($contents, filename: '/path/to/file', contentType: '…'),
);

// Pass in only a string (where applicable)
$response = $client->assets->upload(file: '…');

// Pass an open resource:
$fd = fopen('/path/to/file', 'r');
try {
$response = $client->assets->upload(
file: FileParam::fromResource($fd, filename: '/path/to/file', contentType: '…'),
);
} finally {
fclose($fd);
}
```

## Advanced concepts

### Making custom or undocumented requests
Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3",
"guzzlehttp/guzzle": "^7",
"nyholm/psr7": "^1",
"pestphp/pest": "^3",
"php-http/mock-client": "^1",
Expand Down
Loading
Loading