diff --git a/.github/workflows/detect-breaking-changes.yml b/.github/workflows/detect-breaking-changes.yml
new file mode 100644
index 00000000..133981a0
--- /dev/null
+++ b/.github/workflows/detect-breaking-changes.yml
@@ -0,0 +1,36 @@
+name: CI
+on:
+ pull_request:
+ branches:
+ - main
+ - next
+
+jobs:
+ detect_breaking_changes:
+ runs-on: 'ubuntu-latest'
+ name: detect-breaking-changes
+ if: github.repository == 'beeper/desktop-api-js'
+ steps:
+ - name: Calculate fetch-depth
+ run: |
+ echo "FETCH_DEPTH=$(expr ${{ github.event.pull_request.commits }} + 1)" >> $GITHUB_ENV
+
+ - uses: actions/checkout@v6
+ with:
+ # Ensure we can check out the pull request base in the script below.
+ fetch-depth: ${{ env.FETCH_DEPTH }}
+
+ - name: Set up Node
+ uses: actions/setup-node@v3
+ with:
+ node-version: '20'
+ - name: Install dependencies
+ run: |
+ yarn install
+
+ - name: Detect breaking changes
+ run: |
+ # Try to check out previous versions of the breaking change detection script. This ensures that
+ # we still detect breaking changes when entire files and their tests are removed.
+ git checkout "${{ github.event.pull_request.base.sha }}" -- ./scripts/detect-breaking-changes 2>/dev/null || true
+ ./scripts/detect-breaking-changes ${{ github.event.pull_request.base.sha }}
diff --git a/.github/workflows/publish-npm.yml b/.github/workflows/publish-npm.yml
index 18985a7b..3b8e2b0b 100644
--- a/.github/workflows/publish-npm.yml
+++ b/.github/workflows/publish-npm.yml
@@ -18,7 +18,6 @@ jobs:
runs-on: ubuntu-latest
permissions:
contents: write
- id-token: write
steps:
- uses: actions/checkout@v6
@@ -42,6 +41,7 @@ jobs:
yarn tsn scripts/publish-packages.ts "{ \"paths_released\": \"$PATHS_RELEASED\" }"
env:
INPUT_PATH: ${{ github.event.inputs.path }}
+ NPM_TOKEN: ${{ secrets.BEEPER_NPM_TOKEN || secrets.NPM_TOKEN }}
- name: Upload MCP Server DXT GitHub release asset
run: |
diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml
index e289d4de..0e12ec56 100644
--- a/.github/workflows/release-doctor.yml
+++ b/.github/workflows/release-doctor.yml
@@ -17,4 +17,5 @@ jobs:
- name: Check release environment
run: |
bash ./bin/check-release-environment
-
+ env:
+ NPM_TOKEN: ${{ secrets.BEEPER_NPM_TOKEN || secrets.NPM_TOKEN }}
diff --git a/.gitignore b/.gitignore
index ae4aa20e..b7d4f6b9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -11,4 +11,3 @@ dist-deno
.eslintcache
dist-bundle
*.mcpb
-oidc
diff --git a/.prettierignore b/.prettierignore
index 7cc13dd1..36afd3b3 100644
--- a/.prettierignore
+++ b/.prettierignore
@@ -2,6 +2,7 @@ CHANGELOG.md
/ecosystem-tests/*/**
/node_modules
/deno
+/packages/mcp-server/manifest.json
# don't format tsc output, will break source maps
dist
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index d839ae39..1ed3fbdc 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "4.7.1"
+ ".": "4.8.0"
}
diff --git a/.stats.yml b/.stats.yml
index 2c479249..ec755712 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 23
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/beeper%2Fbeeper-desktop-api-5a8ac7b545c48dc892e5c680303e305254921554dabee848e40a808659dbcf1e.yml
-openapi_spec_hash: 0103975601aac1445d3a4ef418c5d17a
-config_hash: 7d85c0b454fc78a59db6474c5c4d73c6
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/beeper/beeper-desktop-api-356444646dafe352d3ef7c2e01aedf030197a5519b41cf2c3fd8be2571456b43.yml
+openapi_spec_hash: 4840f003552e8b48eb8e689b59a819ef
+config_hash: 05ebdec072113f63395372504da98192
diff --git a/CHANGELOG.md b/CHANGELOG.md
index ae63368a..10169ccf 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,33 @@
# Changelog
+## 4.8.0 (2026-05-01)
+
+Full Changelog: [v4.7.1...v4.8.0](https://github.com/beeper/desktop-api-js/compare/v4.7.1...v4.8.0)
+
+### Features
+
+* **api:** add network, bridge fields to accounts ([507d953](https://github.com/beeper/desktop-api-js/commit/507d953e15f708e0f36ca97a79d5e6798637cd46))
+* **api:** api update ([1c56a90](https://github.com/beeper/desktop-api-js/commit/1c56a9053dc7820674402e01b24f1bc3a861161f))
+* support setting headers via env ([a96c11f](https://github.com/beeper/desktop-api-js/commit/a96c11fb55f79609589a4bd379dfc9c57bff21d2))
+
+
+### Chores
+
+* avoid formatting file that gets changed during releases ([e2fd540](https://github.com/beeper/desktop-api-js/commit/e2fd5403928af893d513ce240a866d642a5141f7))
+* fix example snippet imports ([36526d0](https://github.com/beeper/desktop-api-js/commit/36526d0f6fe13881ad2e4fa5c9c0831572085b82))
+* **format:** run eslint and prettier separately ([8f4d8a2](https://github.com/beeper/desktop-api-js/commit/8f4d8a2eba5770354a49ba9d27343a796fa025d0))
+* **formatter:** run prettier and eslint separately ([fc858b4](https://github.com/beeper/desktop-api-js/commit/fc858b42ae0659e27b67ebb18abaebeeadc01054))
+* **internal:** codegen related update ([ebb38e3](https://github.com/beeper/desktop-api-js/commit/ebb38e3bebbba830772a5c3d452af10982fbc9a8))
+* **internal:** codegen related update ([99692bb](https://github.com/beeper/desktop-api-js/commit/99692bba99c8770456ed096a82858eec38fa8335))
+* **internal:** codegen related update ([921d01a](https://github.com/beeper/desktop-api-js/commit/921d01ab656e36350fc92a8317193dfa29fae869))
+* **internal:** more robust bootstrap script ([0045519](https://github.com/beeper/desktop-api-js/commit/0045519b594198a09f6c2140a5bfc15c02d26109))
+* **internal:** show error causes in MCP servers when running in local mode ([dfa8c13](https://github.com/beeper/desktop-api-js/commit/dfa8c13e0b706a5e22c38f55885d19297b9739c4))
+* **internal:** update docs ordering ([9ee1296](https://github.com/beeper/desktop-api-js/commit/9ee12965940572490d58bfa37779b9135f71c50f))
+* **mcp-server:** increase local docs search result count from 5 to 10 ([5efa76a](https://github.com/beeper/desktop-api-js/commit/5efa76aabeb9df310452af4f6ca19a04236fec9c))
+* restructure docs search code ([d148d8a](https://github.com/beeper/desktop-api-js/commit/d148d8a24c4a8ee5e154d86c00a7ceb8b477444f))
+* **tests:** bump steady to v0.22.1 ([cca9635](https://github.com/beeper/desktop-api-js/commit/cca96356d0a240903cdf02a608bbc61ecb02cdf3))
+* update CLI documentation ([9925dba](https://github.com/beeper/desktop-api-js/commit/9925dbadd7f5fc61bab398ab44b92b90df7dffe7))
+
## 4.7.1 (2026-04-07)
Full Changelog: [v4.7.0...v4.7.1](https://github.com/beeper/desktop-api-js/compare/v4.7.0...v4.7.1)
diff --git a/README.md b/README.md
index 2cc8ddf7..538d0074 100644
--- a/README.md
+++ b/README.md
@@ -6,8 +6,6 @@ This library provides convenient access to the Beeper Desktop REST API from serv
The REST API documentation can be found on [developers.beeper.com](https://developers.beeper.com/desktop-api/). The full API of this library can be found in [api.md](api.md).
-It is generated with [Stainless](https://www.stainless.com/).
-
## MCP Server
Use the Beeper Desktop MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.
@@ -31,7 +29,9 @@ The full API of this library can be found in [api.md](api.md).
```js
import BeeperDesktop from '@beeper/desktop-api';
-const client = new BeeperDesktop();
+const client = new BeeperDesktop({
+ accessToken: process.env['BEEPER_ACCESS_TOKEN'], // This is the default and can be omitted
+});
const page = await client.chats.search({
includeMuted: true,
@@ -51,7 +51,9 @@ This library includes TypeScript definitions for all request params and response
```ts
import BeeperDesktop from '@beeper/desktop-api';
-const client = new BeeperDesktop();
+const client = new BeeperDesktop({
+ accessToken: process.env['BEEPER_ACCESS_TOKEN'], // This is the default and can be omitted
+});
const accounts: BeeperDesktop.AccountListResponse = await client.accounts.list();
```
@@ -202,6 +204,57 @@ while (page.hasNextPage()) {
## Advanced Usage
+### Tree shaking
+
+This library supports tree shaking to reduce bundle size. Instead of importing the full client, you can create a client only including the API resources you need:
+
+```ts
+import { createClient } from '@beeper/desktop-api/tree-shakable';
+import { Accounts } from '@beeper/desktop-api/resources/accounts/accounts';
+import { BaseChats } from '@beeper/desktop-api/resources/chats/chats';
+
+const client = createClient({
+ // Specify the resources you'd like to use ...
+ resources: [Accounts, BaseChats],
+});
+
+// ... then make API calls as usual.
+const accounts = await client.accounts.list();
+const chat = await client.chats.create({ accountID: 'accountID' });
+```
+
+Each API resource has two versions, the full resource (e.g., `Accounts`) which includes all subresources, and the base resource (e.g., `BaseAccounts`) which does not.
+
+The tree-shaken client is fully typed, so TypeScript will provide accurate autocomplete and prevent access to resources not included in your configuration.
+The `createClient` function automatically infers the correct type, but you can also use the `PartialBeeperDesktop` type explicitly:
+
+```ts
+import BeeperDesktop from '@beeper/desktop-api';
+import { createClient, type PartialBeeperDesktop } from '@beeper/desktop-api/tree-shakable';
+import { BaseAccounts } from '@beeper/desktop-api/resources/accounts/accounts';
+
+// Explicit variable type
+const client: PartialBeeperDesktop<{ accounts: BaseAccounts }> = createClient({
+ resources: [BaseAccounts],
+ /* ... */
+});
+
+// Function parameter type
+async function main(client: PartialBeeperDesktop<{ accounts: BaseAccounts }>) {
+ const accounts = await client.accounts.list();
+}
+
+// Works with any client that has the accounts resource
+const treeShakableClient = createClient({
+ resources: [BaseAccounts],
+ /* ... */
+});
+const fullClient = new BeeperDesktop(/* ... */);
+
+main(treeShakableClient); // Works
+main(fullClient); // Also works
+```
+
### Accessing raw Response data (e.g., headers)
The "raw" `Response` returned by `fetch()` can be accessed through the `.asResponse()` method on the `APIPromise` type that all methods return.
@@ -233,7 +286,7 @@ console.log(accounts);
The log level can be configured in two ways:
-1. Via the `BEEPER_DESKTOP_LOG` environment variable
+1. Via the `BEEPER_LOG` environment variable
2. Using the `logLevel` client option (overrides the environment variable if set)
```ts
diff --git a/api.md b/api.md
index d8a0a1f6..4cdfd4f7 100644
--- a/api.md
+++ b/api.md
@@ -89,7 +89,7 @@ Types:
Methods:
- client.messages.update(messageID, { ...params }) -> MessageUpdateResponse
-- client.messages.list(chatID, { ...params }) -> MessagesCursorSortKey
+- client.messages.list(chatID, { ...params }) -> MessagesCursorNoLimit
- client.messages.search({ ...params }) -> MessagesCursorSearch
- client.messages.send(chatID, { ...params }) -> MessageSendResponse
@@ -104,7 +104,7 @@ Types:
Methods:
- client.assets.download({ ...params }) -> AssetDownloadResponse
-- client.assets.serve({ ...params }) -> void
+- client.assets.serve({ ...params }) -> Response
- client.assets.upload({ ...params }) -> AssetUploadResponse
- client.assets.uploadBase64({ ...params }) -> AssetUploadBase64Response
diff --git a/bin/check-release-environment b/bin/check-release-environment
index 6b43775a..e4b6d58e 100644
--- a/bin/check-release-environment
+++ b/bin/check-release-environment
@@ -2,6 +2,10 @@
errors=()
+if [ -z "${NPM_TOKEN}" ]; then
+ errors+=("The NPM_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets")
+fi
+
lenErrors=${#errors[@]}
if [[ lenErrors -gt 0 ]]; then
diff --git a/bin/publish-npm b/bin/publish-npm
index 3d05c0bd..45e8aa80 100644
--- a/bin/publish-npm
+++ b/bin/publish-npm
@@ -2,12 +2,7 @@
set -eux
-if [[ ${NPM_TOKEN:-} ]]; then
- npm config set '//registry.npmjs.org/:_authToken' "$NPM_TOKEN"
-elif [[ ! ${ACTIONS_ID_TOKEN_REQUEST_TOKEN:-} ]]; then
- echo "ERROR: NPM_TOKEN must be set if not running in a Github Action with id-token permission"
- exit 1
-fi
+npm config set '//registry.npmjs.org/:_authToken' "$NPM_TOKEN"
yarn build
cd dist
@@ -62,9 +57,5 @@ else
TAG="latest"
fi
-# Install OIDC compatible npm version
-npm install --prefix ../oidc/ npm@11.6.2
-
# Publish with the appropriate tag
-export npm_config_registry='https://registry.npmjs.org'
-../oidc/node_modules/.bin/npm publish --tag "$TAG"
+yarn publish --tag "$TAG"
diff --git a/eslint.config.mjs b/eslint.config.mjs
index 5074a97c..8448f8db 100644
--- a/eslint.config.mjs
+++ b/eslint.config.mjs
@@ -1,7 +1,6 @@
// @ts-check
import tseslint from 'typescript-eslint';
import unusedImports from 'eslint-plugin-unused-imports';
-import prettier from 'eslint-plugin-prettier';
export default tseslint.config(
{
@@ -14,11 +13,9 @@ export default tseslint.config(
plugins: {
'@typescript-eslint': tseslint.plugin,
'unused-imports': unusedImports,
- prettier,
},
rules: {
'no-unused-vars': 'off',
- 'prettier/prettier': 'error',
'unused-imports/no-unused-imports': 'error',
'no-restricted-imports': [
'error',
diff --git a/package.json b/package.json
index b3f11a7c..d1a952d9 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "@beeper/desktop-api",
- "version": "4.7.1",
+ "version": "4.8.0",
"description": "The official TypeScript library for the Beeper Desktop API",
"author": "Beeper Desktop ",
"types": "dist/index.d.ts",
@@ -36,7 +36,6 @@
"@typescript-eslint/eslint-plugin": "8.31.1",
"@typescript-eslint/parser": "8.31.1",
"eslint": "^9.39.1",
- "eslint-plugin-prettier": "^5.4.1",
"eslint-plugin-unused-imports": "^4.1.4",
"iconv-lite": "^0.6.3",
"jest": "^29.4.0",
diff --git a/packages/mcp-server/README.md b/packages/mcp-server/README.md
index 2c91753e..65348de7 100644
--- a/packages/mcp-server/README.md
+++ b/packages/mcp-server/README.md
@@ -1,7 +1,5 @@
# TypeScript SDK for Beeper Desktop MCP Server
-It is generated with [Stainless](https://www.stainless.com/).
-
## Installation
### Direct invocation
diff --git a/packages/mcp-server/manifest.json b/packages/mcp-server/manifest.json
index 6039c146..da7ba56b 100644
--- a/packages/mcp-server/manifest.json
+++ b/packages/mcp-server/manifest.json
@@ -1,7 +1,7 @@
{
"dxt_version": "0.2",
"name": "@beeper/desktop-mcp",
- "version": "4.7.1",
+ "version": "4.8.0",
"description": "The official MCP Server for the Beeper Desktop API",
"author": {
"name": "Beeper Desktop",
diff --git a/packages/mcp-server/package.json b/packages/mcp-server/package.json
index 004c951a..2f3b8f5b 100644
--- a/packages/mcp-server/package.json
+++ b/packages/mcp-server/package.json
@@ -1,6 +1,6 @@
{
"name": "@beeper/desktop-mcp",
- "version": "4.7.1",
+ "version": "4.8.0",
"description": "The official MCP Server for the Beeper Desktop API",
"author": "Beeper Desktop ",
"types": "dist/index.d.ts",
diff --git a/packages/mcp-server/src/code-tool-worker.ts b/packages/mcp-server/src/code-tool-worker.ts
index 4faaff3f..cf27caeb 100644
--- a/packages/mcp-server/src/code-tool-worker.ts
+++ b/packages/mcp-server/src/code-tool-worker.ts
@@ -207,7 +207,8 @@ function makeSdkProxy(obj: T, { path, isBelievedBad = false }:
function parseError(code: string, error: unknown): string | undefined {
if (!(error instanceof Error)) return;
- const message = error.name ? `${error.name}: ${error.message}` : error.message;
+ const cause = error.cause instanceof Error ? `: ${error.cause.message}` : '';
+ const message = error.name ? `${error.name}: ${error.message}${cause}` : `${error.message}${cause}`;
try {
// Deno uses V8; the first ":LINE:COLUMN" is the top of stack.
const lineNumber = error.stack?.match(/:([0-9]+):[0-9]+/)?.[1];
diff --git a/packages/mcp-server/src/code-tool.ts b/packages/mcp-server/src/code-tool.ts
index c24ff96a..ea89629f 100644
--- a/packages/mcp-server/src/code-tool.ts
+++ b/packages/mcp-server/src/code-tool.ts
@@ -154,7 +154,7 @@ const remoteStainlessHandler = async ({
readEnv('BEEPER_ACCESS_TOKEN') ?? client.accessToken,
'set BEEPER_ACCESS_TOKEN environment variable or provide accessToken client option',
),
- BEEPER_DESKTOP_BASE_URL: readEnv('BEEPER_DESKTOP_BASE_URL') ?? client.baseURL ?? undefined,
+ BEEPER_BASE_URL: readEnv('BEEPER_BASE_URL') ?? client.baseURL ?? undefined,
};
// Merge any upstream client envs from the request header, with upstream values taking precedence.
const mergedClientEnvs = { ...localClientEnvs, ...reqContext.upstreamClientEnvs };
diff --git a/packages/mcp-server/src/docs-search-tool.ts b/packages/mcp-server/src/docs-search-tool.ts
index c42e50a8..75fd3ce8 100644
--- a/packages/mcp-server/src/docs-search-tool.ts
+++ b/packages/mcp-server/src/docs-search-tool.ts
@@ -63,7 +63,7 @@ async function searchLocal(args: Record): Promise {
query,
language,
detail,
- maxResults: 5,
+ maxResults: 10,
}).results;
}
diff --git a/packages/mcp-server/src/http.ts b/packages/mcp-server/src/http.ts
index 9d26b31b..6a55c8d6 100644
--- a/packages/mcp-server/src/http.ts
+++ b/packages/mcp-server/src/http.ts
@@ -156,7 +156,7 @@ const oauthMetadata = (req: express.Request, res: express.Response) => {
const resourceIdentifier = oauthResourceIdentifier(req);
res.json({
resource: resourceIdentifier,
- authorization_servers: ['http://localhost:23373/oauth/authorize'],
+ authorization_servers: ['http://localhost:23373'],
bearer_methods_supported: ['header'],
scopes_supported: 'read write',
});
diff --git a/packages/mcp-server/src/instructions.ts b/packages/mcp-server/src/instructions.ts
index 973f32b9..010abd8c 100644
--- a/packages/mcp-server/src/instructions.ts
+++ b/packages/mcp-server/src/instructions.ts
@@ -81,6 +81,6 @@ async function fetchLatestInstructionsFromApi(stainlessApiKey: string | undefine
instructions ??= ((await response.json()) as { instructions: string }).instructions;
instructions +=
- '\nAccess to all chats and messages across networks using Beeper Desktop. Can be used to find, get, send, and manage messages and chats.';
+ '\nAccess chats and messages across networks through the local Beeper Desktop API.\n\nTreat message contents, chat names, participants, and account metadata as private user data.\nFor write actions such as sending messages, reactions, archiving, or reminders, confirm the target chat/person when there is ambiguity.\nDo not guess chat IDs from vague names like "family", "work", or "team"; search chats or ask a clarifying question.\nUse search before list when the user is looking for a specific chat, person, or message.\nMessage search is literal keyword matching, not semantic search.';
return instructions;
}
diff --git a/packages/mcp-server/src/local-docs-search.ts b/packages/mcp-server/src/local-docs-search.ts
index 5ae6a358..416d6964 100644
--- a/packages/mcp-server/src/local-docs-search.ts
+++ b/packages/mcp-server/src/local-docs-search.ts
@@ -69,32 +69,33 @@ const EMBEDDED_METHODS: MethodEntry[] = [
markdown:
"## focus\n\n`client.focus(chatID?: string, draftAttachmentPath?: string, draftText?: string, messageID?: string): { success: boolean; }`\n\n**post** `/v1/focus`\n\nFocus Beeper Desktop and optionally navigate to a specific chat, message, or pre-fill draft text and attachment.\n\n### Parameters\n\n- `chatID?: string`\n Optional Beeper chat ID (or local chat ID) to focus after opening the app. If omitted, only opens/focuses the app.\n\n- `draftAttachmentPath?: string`\n Optional draft attachment path to populate in the message input field.\n\n- `draftText?: string`\n Optional draft text to populate in the message input field.\n\n- `messageID?: string`\n Optional message ID. Jumps to that message in the chat when opening.\n\n### Returns\n\n- `{ success: boolean; }`\n Response indicating successful app focus action.\n\n - `success: boolean`\n\n### Example\n\n```typescript\nimport BeeperDesktop from '@beeper/desktop-api';\n\nconst client = new BeeperDesktop();\n\nconst response = await client.focus();\n\nconsole.log(response);\n```",
perLanguage: {
- cli: {
- method: '$client focus',
- example: 'beeper-desktop-cli focus',
+ typescript: {
+ method: 'client.focus',
+ example:
+ "import BeeperDesktop from '@beeper/desktop-api';\n\nconst client = new BeeperDesktop({\n accessToken: process.env['BEEPER_ACCESS_TOKEN'], // This is the default and can be omitted\n});\n\nconst response = await client.focus();\n\nconsole.log(response.success);",
+ },
+ python: {
+ method: 'focus',
+ example:
+ 'import os\nfrom beeper_desktop_api import BeeperDesktop\n\nclient = BeeperDesktop(\n access_token=os.environ.get("BEEPER_ACCESS_TOKEN"), # This is the default and can be omitted\n)\nresponse = client.focus()\nprint(response.success)',
},
go: {
method: 'client.Focus',
example:
- 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/beeper/desktop-api-go"\n)\n\nfunc main() {\n\tclient := beeperdesktopapi.NewClient()\n\tresponse, err := client.Focus(context.TODO(), beeperdesktopapi.FocusParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.Success)\n}\n',
+ 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/beeper/desktop-api-go"\n\t"github.com/beeper/desktop-api-go/option"\n)\n\nfunc main() {\n\tclient := beeperdesktopapi.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tresponse, err := client.Focus(context.TODO(), beeperdesktopapi.FocusParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.Success)\n}\n',
},
- http: {
- example: 'curl http://localhost:23373/v1/focus \\\n -X POST',
+ cli: {
+ method: '$client focus',
+ example: "beeper-desktop-cli focus \\\n --access-token 'My Access Token'",
},
php: {
method: 'focus',
example:
- "focus(\n chatID: '!NCdzlIaMjZUmvmvyHU:beeper.com',\n draftAttachmentPath: 'draftAttachmentPath',\n draftText: 'draftText',\n messageID: 'messageID',\n);\n\nvar_dump($response);",
+ "focus(\n chatID: '!NCdzlIaMjZUmvmvyHU:beeper.com',\n draftAttachmentPath: 'draftAttachmentPath',\n draftText: 'draftText',\n messageID: 'messageID',\n);\n\nvar_dump($response);",
},
- python: {
- method: 'focus',
- example:
- 'from beeper_desktop_api import BeeperDesktop\n\nclient = BeeperDesktop()\nresponse = client.focus()\nprint(response.success)',
- },
- typescript: {
- method: 'client.focus',
+ http: {
example:
- "import BeeperDesktop from '@beeper/desktop-api';\n\nconst client = new BeeperDesktop();\n\nconst response = await client.focus();\n\nconsole.log(response.success);",
+ 'curl http://localhost:23373/v1/focus \\\n -X POST \\\n -H "Authorization: Bearer $BEEPER_ACCESS_TOKEN"',
},
},
},
@@ -113,32 +114,33 @@ const EMBEDDED_METHODS: MethodEntry[] = [
markdown:
"## search\n\n`client.search(query: string): { results: object; }`\n\n**get** `/v1/search`\n\nReturns matching chats, participant name matches in groups, and the first page of messages in one call. Paginate messages via search-messages. Paginate chats via search-chats.\n\n### Parameters\n\n- `query: string`\n User-typed search text. Literal word matching (non-semantic).\n\n### Returns\n\n- `{ results: { chats: object[]; in_groups: object[]; messages: { chats: object; hasMore: boolean; items: message[]; newestCursor: string; oldestCursor: string; }; }; }`\n\n - `results: { chats: { id: string; accountID: string; participants: { hasMore: boolean; items: user[]; total: number; }; title: string; type: 'single' | 'group'; unreadCount: number; isArchived?: boolean; isMuted?: boolean; isPinned?: boolean; lastActivity?: string; lastReadMessageSortKey?: string; localChatID?: string; }[]; in_groups: { id: string; accountID: string; participants: { hasMore: boolean; items: user[]; total: number; }; title: string; type: 'single' | 'group'; unreadCount: number; isArchived?: boolean; isMuted?: boolean; isPinned?: boolean; lastActivity?: string; lastReadMessageSortKey?: string; localChatID?: string; }[]; messages: { chats: object; hasMore: boolean; items: { id: string; accountID: string; chatID: string; senderID: string; sortKey: string; timestamp: string; attachments?: attachment[]; isSender?: boolean; isUnread?: boolean; linkedMessageID?: string; reactions?: reaction[]; senderName?: string; text?: string; type?: string; }[]; newestCursor: string; oldestCursor: string; }; }`\n\n### Example\n\n```typescript\nimport BeeperDesktop from '@beeper/desktop-api';\n\nconst client = new BeeperDesktop();\n\nconst response = await client.search({ query: 'x' });\n\nconsole.log(response);\n```",
perLanguage: {
- cli: {
- method: '$client search',
- example: 'beeper-desktop-cli search \\\n --query x',
+ typescript: {
+ method: 'client.search',
+ example:
+ "import BeeperDesktop from '@beeper/desktop-api';\n\nconst client = new BeeperDesktop({\n accessToken: process.env['BEEPER_ACCESS_TOKEN'], // This is the default and can be omitted\n});\n\nconst response = await client.search({ query: 'x' });\n\nconsole.log(response.results);",
+ },
+ python: {
+ method: 'search',
+ example:
+ 'import os\nfrom beeper_desktop_api import BeeperDesktop\n\nclient = BeeperDesktop(\n access_token=os.environ.get("BEEPER_ACCESS_TOKEN"), # This is the default and can be omitted\n)\nresponse = client.search(\n query="x",\n)\nprint(response.results)',
},
go: {
method: 'client.Search',
example:
- 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/beeper/desktop-api-go"\n)\n\nfunc main() {\n\tclient := beeperdesktopapi.NewClient()\n\tresponse, err := client.Search(context.TODO(), beeperdesktopapi.SearchParams{\n\t\tQuery: "x",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.Results)\n}\n',
+ 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/beeper/desktop-api-go"\n\t"github.com/beeper/desktop-api-go/option"\n)\n\nfunc main() {\n\tclient := beeperdesktopapi.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tresponse, err := client.Search(context.TODO(), beeperdesktopapi.SearchParams{\n\t\tQuery: "x",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.Results)\n}\n',
},
- http: {
- example: 'curl http://localhost:23373/v1/search',
+ cli: {
+ method: '$client search',
+ example: "beeper-desktop-cli search \\\n --access-token 'My Access Token' \\\n --query x",
},
php: {
method: 'search',
example:
- "search(query: 'x');\n\nvar_dump($response);",
- },
- python: {
- method: 'search',
- example:
- 'from beeper_desktop_api import BeeperDesktop\n\nclient = BeeperDesktop()\nresponse = client.search(\n query="x",\n)\nprint(response.results)',
+ "search(query: 'x');\n\nvar_dump($response);",
},
- typescript: {
- method: 'client.search',
+ http: {
example:
- "import BeeperDesktop from '@beeper/desktop-api';\n\nconst client = new BeeperDesktop();\n\nconst response = await client.search({ query: 'x' });\n\nconsole.log(response.results);",
+ 'curl http://localhost:23373/v1/search \\\n -H "Authorization: Bearer $BEEPER_ACCESS_TOKEN"',
},
},
},
@@ -151,36 +153,38 @@ const EMBEDDED_METHODS: MethodEntry[] = [
'Lists chat accounts across networks (WhatsApp, Telegram, Twitter/X, etc.) actively connected to this Beeper Desktop instance',
stainlessPath: '(resource) accounts > (method) list',
qualified: 'client.accounts.list',
- response: '{ accountID: string; user: object; }[]',
+ response:
+ "{ accountID: string; bridge: { id: string; provider: 'cloud' | 'self-hosted' | 'local' | 'platform-sdk'; type: string; }; user: object; network?: string; }[]",
markdown:
- "## list\n\n`client.accounts.list(): object[]`\n\n**get** `/v1/accounts`\n\nLists chat accounts across networks (WhatsApp, Telegram, Twitter/X, etc.) actively connected to this Beeper Desktop instance\n\n### Returns\n\n- `{ accountID: string; user: object; }[]`\n Connected accounts the user can act through. Includes accountID and user identity.\n\n### Example\n\n```typescript\nimport BeeperDesktop from '@beeper/desktop-api';\n\nconst client = new BeeperDesktop();\n\nconst accounts = await client.accounts.list();\n\nconsole.log(accounts);\n```",
+ "## list\n\n`client.accounts.list(): object[]`\n\n**get** `/v1/accounts`\n\nLists chat accounts across networks (WhatsApp, Telegram, Twitter/X, etc.) actively connected to this Beeper Desktop instance\n\n### Returns\n\n- `{ accountID: string; bridge: { id: string; provider: 'cloud' | 'self-hosted' | 'local' | 'platform-sdk'; type: string; }; user: object; network?: string; }[]`\n Accounts configured on this device. Includes accountID, bridge metadata, optional network name, and user identity.\n\n### Example\n\n```typescript\nimport BeeperDesktop from '@beeper/desktop-api';\n\nconst client = new BeeperDesktop();\n\nconst accounts = await client.accounts.list();\n\nconsole.log(accounts);\n```",
perLanguage: {
- cli: {
- method: 'accounts list',
- example: 'beeper-desktop-cli accounts list',
+ typescript: {
+ method: 'client.accounts.list',
+ example:
+ "import BeeperDesktop from '@beeper/desktop-api';\n\nconst client = new BeeperDesktop({\n accessToken: process.env['BEEPER_ACCESS_TOKEN'], // This is the default and can be omitted\n});\n\nconst accounts = await client.accounts.list();\n\nconsole.log(accounts);",
+ },
+ python: {
+ method: 'accounts.list',
+ example:
+ 'import os\nfrom beeper_desktop_api import BeeperDesktop\n\nclient = BeeperDesktop(\n access_token=os.environ.get("BEEPER_ACCESS_TOKEN"), # This is the default and can be omitted\n)\naccounts = client.accounts.list()\nprint(accounts)',
},
go: {
method: 'client.Accounts.List',
example:
- 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/beeper/desktop-api-go"\n)\n\nfunc main() {\n\tclient := beeperdesktopapi.NewClient()\n\taccounts, err := client.Accounts.List(context.TODO())\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", accounts)\n}\n',
+ 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/beeper/desktop-api-go"\n\t"github.com/beeper/desktop-api-go/option"\n)\n\nfunc main() {\n\tclient := beeperdesktopapi.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\taccounts, err := client.Accounts.List(context.TODO())\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", accounts)\n}\n',
},
- http: {
- example: 'curl http://localhost:23373/v1/accounts',
+ cli: {
+ method: 'accounts list',
+ example: "beeper-desktop-cli accounts list \\\n --access-token 'My Access Token'",
},
php: {
method: 'accounts->list',
example:
- "accounts->list();\n\nvar_dump($accounts);",
+ "accounts->list();\n\nvar_dump($accounts);",
},
- python: {
- method: 'accounts.list',
- example:
- 'from beeper_desktop_api import BeeperDesktop\n\nclient = BeeperDesktop()\naccounts = client.accounts.list()\nprint(accounts)',
- },
- typescript: {
- method: 'client.accounts.list',
+ http: {
example:
- "import BeeperDesktop from '@beeper/desktop-api';\n\nconst client = new BeeperDesktop();\n\nconst accounts = await client.accounts.list();\n\nconsole.log(accounts);",
+ 'curl http://localhost:23373/v1/accounts \\\n -H "Authorization: Bearer $BEEPER_ACCESS_TOKEN"',
},
},
},
@@ -199,32 +203,34 @@ const EMBEDDED_METHODS: MethodEntry[] = [
markdown:
"## search\n\n`client.accounts.contacts.search(accountID: string, query: string): { items: user[]; }`\n\n**get** `/v1/accounts/{accountID}/contacts`\n\nSearch contacts on a specific account using merged account contacts, network search, and exact identifier lookup.\n\n### Parameters\n\n- `accountID: string`\n Account ID this resource belongs to.\n\n- `query: string`\n Text to search users by. Network-specific behavior.\n\n### Returns\n\n- `{ items: { id: string; cannotMessage?: boolean; email?: string; fullName?: string; imgURL?: string; isSelf?: boolean; phoneNumber?: string; username?: string; }[]; }`\n\n - `items: { id: string; cannotMessage?: boolean; email?: string; fullName?: string; imgURL?: string; isSelf?: boolean; phoneNumber?: string; username?: string; }[]`\n\n### Example\n\n```typescript\nimport BeeperDesktop from '@beeper/desktop-api';\n\nconst client = new BeeperDesktop();\n\nconst response = await client.accounts.contacts.search('accountID', { query: 'x' });\n\nconsole.log(response);\n```",
perLanguage: {
- cli: {
- method: 'contacts search',
- example: 'beeper-desktop-cli accounts:contacts search \\\n --account-id accountID \\\n --query x',
+ typescript: {
+ method: 'client.accounts.contacts.search',
+ example:
+ "import BeeperDesktop from '@beeper/desktop-api';\n\nconst client = new BeeperDesktop({\n accessToken: process.env['BEEPER_ACCESS_TOKEN'], // This is the default and can be omitted\n});\n\nconst response = await client.accounts.contacts.search('accountID', { query: 'x' });\n\nconsole.log(response.items);",
+ },
+ python: {
+ method: 'accounts.contacts.search',
+ example:
+ 'import os\nfrom beeper_desktop_api import BeeperDesktop\n\nclient = BeeperDesktop(\n access_token=os.environ.get("BEEPER_ACCESS_TOKEN"), # This is the default and can be omitted\n)\nresponse = client.accounts.contacts.search(\n account_id="accountID",\n query="x",\n)\nprint(response.items)',
},
go: {
method: 'client.Accounts.Contacts.Search',
example:
- 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/beeper/desktop-api-go"\n)\n\nfunc main() {\n\tclient := beeperdesktopapi.NewClient()\n\tresponse, err := client.Accounts.Contacts.Search(\n\t\tcontext.TODO(),\n\t\t"accountID",\n\t\tbeeperdesktopapi.AccountContactSearchParams{\n\t\t\tQuery: "x",\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.Items)\n}\n',
+ 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/beeper/desktop-api-go"\n\t"github.com/beeper/desktop-api-go/option"\n)\n\nfunc main() {\n\tclient := beeperdesktopapi.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tresponse, err := client.Accounts.Contacts.Search(\n\t\tcontext.TODO(),\n\t\t"accountID",\n\t\tbeeperdesktopapi.AccountContactSearchParams{\n\t\t\tQuery: "x",\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.Items)\n}\n',
},
- http: {
- example: 'curl http://localhost:23373/v1/accounts/$ACCOUNT_ID/contacts',
+ cli: {
+ method: 'contacts search',
+ example:
+ "beeper-desktop-cli accounts:contacts search \\\n --access-token 'My Access Token' \\\n --account-id accountID \\\n --query x",
},
php: {
method: 'accounts->contacts->search',
example:
- "accounts->contacts->search('accountID', query: 'x');\n\nvar_dump($response);",
+ "accounts->contacts->search('accountID', query: 'x');\n\nvar_dump($response);",
},
- python: {
- method: 'accounts.contacts.search',
- example:
- 'from beeper_desktop_api import BeeperDesktop\n\nclient = BeeperDesktop()\nresponse = client.accounts.contacts.search(\n account_id="accountID",\n query="x",\n)\nprint(response.items)',
- },
- typescript: {
- method: 'client.accounts.contacts.search',
+ http: {
example:
- "import BeeperDesktop from '@beeper/desktop-api';\n\nconst client = new BeeperDesktop();\n\nconst response = await client.accounts.contacts.search('accountID', { query: 'x' });\n\nconsole.log(response.items);",
+ 'curl http://localhost:23373/v1/accounts/$ACCOUNT_ID/contacts \\\n -H "Authorization: Bearer $BEEPER_ACCESS_TOKEN"',
},
},
},
@@ -248,32 +254,34 @@ const EMBEDDED_METHODS: MethodEntry[] = [
markdown:
"## list\n\n`client.accounts.contacts.list(accountID: string, cursor?: string, direction?: 'after' | 'before', limit?: number, query?: string): { id: string; cannotMessage?: boolean; email?: string; fullName?: string; imgURL?: string; isSelf?: boolean; phoneNumber?: string; username?: string; }`\n\n**get** `/v1/accounts/{accountID}/contacts/list`\n\nList merged contacts for a specific account with cursor-based pagination.\n\n### Parameters\n\n- `accountID: string`\n Account ID this resource belongs to.\n\n- `cursor?: string`\n Opaque pagination cursor; do not inspect. Use together with 'direction'.\n\n- `direction?: 'after' | 'before'`\n Pagination direction used with 'cursor': 'before' fetches older results, 'after' fetches newer results. Defaults to 'before' when only 'cursor' is provided.\n\n- `limit?: number`\n Maximum contacts to return per page.\n\n- `query?: string`\n Optional search query for blended contact lookup.\n\n### Returns\n\n- `{ id: string; cannotMessage?: boolean; email?: string; fullName?: string; imgURL?: string; isSelf?: boolean; phoneNumber?: string; username?: string; }`\n User the account belongs to.\n\n - `id: string`\n - `cannotMessage?: boolean`\n - `email?: string`\n - `fullName?: string`\n - `imgURL?: string`\n - `isSelf?: boolean`\n - `phoneNumber?: string`\n - `username?: string`\n\n### Example\n\n```typescript\nimport BeeperDesktop from '@beeper/desktop-api';\n\nconst client = new BeeperDesktop();\n\n// Automatically fetches more pages as needed.\nfor await (const user of client.accounts.contacts.list('accountID')) {\n console.log(user);\n}\n```",
perLanguage: {
- cli: {
- method: 'contacts list',
- example: 'beeper-desktop-cli accounts:contacts list \\\n --account-id accountID',
+ typescript: {
+ method: 'client.accounts.contacts.list',
+ example:
+ "import BeeperDesktop from '@beeper/desktop-api';\n\nconst client = new BeeperDesktop({\n accessToken: process.env['BEEPER_ACCESS_TOKEN'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const user of client.accounts.contacts.list('accountID')) {\n console.log(user.id);\n}",
+ },
+ python: {
+ method: 'accounts.contacts.list',
+ example:
+ 'import os\nfrom beeper_desktop_api import BeeperDesktop\n\nclient = BeeperDesktop(\n access_token=os.environ.get("BEEPER_ACCESS_TOKEN"), # This is the default and can be omitted\n)\npage = client.accounts.contacts.list(\n account_id="accountID",\n)\npage = page.items[0]\nprint(page.id)',
},
go: {
method: 'client.Accounts.Contacts.List',
example:
- 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/beeper/desktop-api-go"\n)\n\nfunc main() {\n\tclient := beeperdesktopapi.NewClient()\n\tpage, err := client.Accounts.Contacts.List(\n\t\tcontext.TODO(),\n\t\t"accountID",\n\t\tbeeperdesktopapi.AccountContactListParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n',
+ 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/beeper/desktop-api-go"\n\t"github.com/beeper/desktop-api-go/option"\n)\n\nfunc main() {\n\tclient := beeperdesktopapi.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tpage, err := client.Accounts.Contacts.List(\n\t\tcontext.TODO(),\n\t\t"accountID",\n\t\tbeeperdesktopapi.AccountContactListParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n',
},
- http: {
- example: 'curl http://localhost:23373/v1/accounts/$ACCOUNT_ID/contacts/list',
+ cli: {
+ method: 'contacts list',
+ example:
+ "beeper-desktop-cli accounts:contacts list \\\n --access-token 'My Access Token' \\\n --account-id accountID",
},
php: {
method: 'accounts->contacts->list',
example:
- "accounts->contacts->list(\n 'accountID',\n cursor: '1725489123456|c29tZUltc2dQYWdl',\n direction: 'before',\n limit: 1,\n query: 'x',\n);\n\nvar_dump($page);",
- },
- python: {
- method: 'accounts.contacts.list',
- example:
- 'from beeper_desktop_api import BeeperDesktop\n\nclient = BeeperDesktop()\npage = client.accounts.contacts.list(\n account_id="accountID",\n)\npage = page.items[0]\nprint(page.id)',
+ "accounts->contacts->list(\n 'accountID',\n cursor: '1725489123456|c29tZUltc2dQYWdl',\n direction: 'before',\n limit: 1,\n query: 'x',\n);\n\nvar_dump($page);",
},
- typescript: {
- method: 'client.accounts.contacts.list',
+ http: {
example:
- "import BeeperDesktop from '@beeper/desktop-api';\n\nconst client = new BeeperDesktop();\n\n// Automatically fetches more pages as needed.\nfor await (const user of client.accounts.contacts.list('accountID')) {\n console.log(user.id);\n}",
+ 'curl http://localhost:23373/v1/accounts/$ACCOUNT_ID/contacts/list \\\n -H "Authorization: Bearer $BEEPER_ACCESS_TOKEN"',
},
},
},
@@ -291,32 +299,34 @@ const EMBEDDED_METHODS: MethodEntry[] = [
markdown:
"## retrieve\n\n`client.chats.retrieve(chatID: string, maxParticipantCount?: number): { id: string; accountID: string; participants: object; title: string; type: 'single' | 'group'; unreadCount: number; isArchived?: boolean; isMuted?: boolean; isPinned?: boolean; lastActivity?: string; lastReadMessageSortKey?: string; localChatID?: string; }`\n\n**get** `/v1/chats/{chatID}`\n\nRetrieve chat details including metadata, participants, and latest message\n\n### Parameters\n\n- `chatID: string`\n Unique identifier of the chat.\n\n- `maxParticipantCount?: number`\n Maximum number of participants to return. Use -1 for all; otherwise 0–500. Defaults to all (-1).\n\n### Returns\n\n- `{ id: string; accountID: string; participants: { hasMore: boolean; items: object[]; total: number; }; title: string; type: 'single' | 'group'; unreadCount: number; isArchived?: boolean; isMuted?: boolean; isPinned?: boolean; lastActivity?: string; lastReadMessageSortKey?: string; localChatID?: string; }`\n\n - `id: string`\n - `accountID: string`\n - `participants: { hasMore: boolean; items: { id: string; cannotMessage?: boolean; email?: string; fullName?: string; imgURL?: string; isSelf?: boolean; phoneNumber?: string; username?: string; }[]; total: number; }`\n - `title: string`\n - `type: 'single' | 'group'`\n - `unreadCount: number`\n - `isArchived?: boolean`\n - `isMuted?: boolean`\n - `isPinned?: boolean`\n - `lastActivity?: string`\n - `lastReadMessageSortKey?: string`\n - `localChatID?: string`\n\n### Example\n\n```typescript\nimport BeeperDesktop from '@beeper/desktop-api';\n\nconst client = new BeeperDesktop();\n\nconst chat = await client.chats.retrieve('!NCdzlIaMjZUmvmvyHU:beeper.com');\n\nconsole.log(chat);\n```",
perLanguage: {
- cli: {
- method: 'chats retrieve',
- example: "beeper-desktop-cli chats retrieve \\\n --chat-id '!NCdzlIaMjZUmvmvyHU:beeper.com'",
+ typescript: {
+ method: 'client.chats.retrieve',
+ example:
+ "import BeeperDesktop from '@beeper/desktop-api';\n\nconst client = new BeeperDesktop({\n accessToken: process.env['BEEPER_ACCESS_TOKEN'], // This is the default and can be omitted\n});\n\nconst chat = await client.chats.retrieve('!NCdzlIaMjZUmvmvyHU:beeper.com');\n\nconsole.log(chat.id);",
+ },
+ python: {
+ method: 'chats.retrieve',
+ example:
+ 'import os\nfrom beeper_desktop_api import BeeperDesktop\n\nclient = BeeperDesktop(\n access_token=os.environ.get("BEEPER_ACCESS_TOKEN"), # This is the default and can be omitted\n)\nchat = client.chats.retrieve(\n chat_id="!NCdzlIaMjZUmvmvyHU:beeper.com",\n)\nprint(chat.id)',
},
go: {
method: 'client.Chats.Get',
example:
- 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/beeper/desktop-api-go"\n)\n\nfunc main() {\n\tclient := beeperdesktopapi.NewClient()\n\tchat, err := client.Chats.Get(\n\t\tcontext.TODO(),\n\t\t"!NCdzlIaMjZUmvmvyHU:beeper.com",\n\t\tbeeperdesktopapi.ChatGetParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", chat.ID)\n}\n',
+ 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/beeper/desktop-api-go"\n\t"github.com/beeper/desktop-api-go/option"\n)\n\nfunc main() {\n\tclient := beeperdesktopapi.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tchat, err := client.Chats.Get(\n\t\tcontext.TODO(),\n\t\t"!NCdzlIaMjZUmvmvyHU:beeper.com",\n\t\tbeeperdesktopapi.ChatGetParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", chat.ID)\n}\n',
},
- http: {
- example: 'curl http://localhost:23373/v1/chats/$CHAT_ID',
+ cli: {
+ method: 'chats retrieve',
+ example:
+ "beeper-desktop-cli chats retrieve \\\n --access-token 'My Access Token' \\\n --chat-id '!NCdzlIaMjZUmvmvyHU:beeper.com'",
},
php: {
method: 'chats->retrieve',
example:
- "chats->retrieve(\n '!NCdzlIaMjZUmvmvyHU:beeper.com', maxParticipantCount: 50\n);\n\nvar_dump($chat);",
- },
- python: {
- method: 'chats.retrieve',
- example:
- 'from beeper_desktop_api import BeeperDesktop\n\nclient = BeeperDesktop()\nchat = client.chats.retrieve(\n chat_id="!NCdzlIaMjZUmvmvyHU:beeper.com",\n)\nprint(chat.id)',
+ "chats->retrieve(\n '!NCdzlIaMjZUmvmvyHU:beeper.com', maxParticipantCount: 50\n);\n\nvar_dump($chat);",
},
- typescript: {
- method: 'client.chats.retrieve',
+ http: {
example:
- "import BeeperDesktop from '@beeper/desktop-api';\n\nconst client = new BeeperDesktop();\n\nconst chat = await client.chats.retrieve('!NCdzlIaMjZUmvmvyHU:beeper.com');\n\nconsole.log(chat.id);",
+ 'curl http://localhost:23373/v1/chats/$CHAT_ID \\\n -H "Authorization: Bearer $BEEPER_ACCESS_TOKEN"',
},
},
},
@@ -326,14 +336,14 @@ const EMBEDDED_METHODS: MethodEntry[] = [
httpMethod: 'post',
summary: 'Create or start a chat',
description:
- "Create a single/group chat (mode='create') or start a direct chat from merged user data (mode='start').",
+ 'Create a direct or group chat with mode="create", or use mode="start" to resolve a contact and open a direct chat.',
stainlessPath: '(resource) chats > (method) create',
qualified: 'client.chats.create',
params: [
'accountID: string;',
'allowInvite?: boolean;',
'messageText?: string;',
- "mode?: 'create' | 'start';",
+ "mode?: 'start' | 'create';",
'participantIDs?: string[];',
'title?: string;',
"type?: 'single' | 'group';",
@@ -341,35 +351,36 @@ const EMBEDDED_METHODS: MethodEntry[] = [
],
response: "{ chatID: string; status?: 'existing' | 'created'; }",
markdown:
- "## create\n\n`client.chats.create(accountID: string, allowInvite?: boolean, messageText?: string, mode?: 'create' | 'start', participantIDs?: string[], title?: string, type?: 'single' | 'group', user?: { id?: string; email?: string; fullName?: string; phoneNumber?: string; username?: string; }): { chatID: string; status?: 'existing' | 'created'; }`\n\n**post** `/v1/chats`\n\nCreate a single/group chat (mode='create') or start a direct chat from merged user data (mode='start').\n\n### Parameters\n\n- `accountID: string`\n Account to create or start the chat on.\n\n- `allowInvite?: boolean`\n Whether invite-based DM creation is allowed when required by the platform. Used for mode='start'.\n\n- `messageText?: string`\n Optional first message content if the platform requires it to create the chat.\n\n- `mode?: 'create' | 'start'`\n Operation mode. Defaults to 'create' when omitted.\n\n- `participantIDs?: string[]`\n Required when mode='create'. User IDs to include in the new chat.\n\n- `title?: string`\n Optional title for group chats when mode='create'; ignored for single chats on most platforms.\n\n- `type?: 'single' | 'group'`\n Required when mode='create'. 'single' requires exactly one participantID; 'group' supports multiple participants and optional title.\n\n- `user?: { id?: string; email?: string; fullName?: string; phoneNumber?: string; username?: string; }`\n Required when mode='start'. Merged user-like contact payload used to resolve the best identifier.\n - `id?: string`\n Known user ID when available.\n - `email?: string`\n Email candidate.\n - `fullName?: string`\n Display name hint used for ranking only.\n - `phoneNumber?: string`\n Phone number candidate (E.164 preferred).\n - `username?: string`\n Username/handle candidate.\n\n### Returns\n\n- `{ chatID: string; status?: 'existing' | 'created'; }`\n\n - `chatID: string`\n - `status?: 'existing' | 'created'`\n\n### Example\n\n```typescript\nimport BeeperDesktop from '@beeper/desktop-api';\n\nconst client = new BeeperDesktop();\n\nconst chat = await client.chats.create({ accountID: 'accountID' });\n\nconsole.log(chat);\n```",
+ "## create\n\n`client.chats.create(accountID: string, allowInvite?: boolean, messageText?: string, mode?: 'start' | 'create', participantIDs?: string[], title?: string, type?: 'single' | 'group', user?: { id?: string; email?: string; fullName?: string; phoneNumber?: string; username?: string; }): { chatID: string; status?: 'existing' | 'created'; }`\n\n**post** `/v1/chats`\n\nCreate a direct or group chat with mode=\"create\", or use mode=\"start\" to resolve a contact and open a direct chat.\n\n### Parameters\n\n- `accountID: string`\n Account to create or start the chat on.\n\n- `allowInvite?: boolean`\n Only used for mode='start'. Whether invite-based DM creation is allowed when required by the platform.\n\n- `messageText?: string`\n Optional first message content if the platform requires it to create the chat.\n\n- `mode?: 'start' | 'create'`\n Operation mode. Use 'start' to resolve a user/contact and start a direct chat. Omit or set 'create' to create a chat directly.\n\n- `participantIDs?: string[]`\n Required for create mode. Provide exactly one user ID for 'single' chats and one or more for 'group' chats.\n\n- `title?: string`\n Optional title for group chats; ignored for single chats on most networks.\n\n- `type?: 'single' | 'group'`\n Required for create mode. 'single' creates a direct message chat; 'group' creates a group chat.\n\n- `user?: { id?: string; email?: string; fullName?: string; phoneNumber?: string; username?: string; }`\n Required for mode='start'. Merged user-like contact payload used to resolve the best identifier.\n - `id?: string`\n Known user ID when available.\n - `email?: string`\n Email candidate.\n - `fullName?: string`\n Display name hint used for ranking only.\n - `phoneNumber?: string`\n Phone number candidate (E.164 preferred).\n - `username?: string`\n Username/handle candidate.\n\n### Returns\n\n- `{ chatID: string; status?: 'existing' | 'created'; }`\n\n - `chatID: string`\n - `status?: 'existing' | 'created'`\n\n### Example\n\n```typescript\nimport BeeperDesktop from '@beeper/desktop-api';\n\nconst client = new BeeperDesktop();\n\nconst chat = await client.chats.create({ accountID: 'accountID' });\n\nconsole.log(chat);\n```",
perLanguage: {
- cli: {
- method: 'chats create',
- example: 'beeper-desktop-cli chats create \\\n --account-id accountID',
+ typescript: {
+ method: 'client.chats.create',
+ example:
+ "import BeeperDesktop from '@beeper/desktop-api';\n\nconst client = new BeeperDesktop({\n accessToken: process.env['BEEPER_ACCESS_TOKEN'], // This is the default and can be omitted\n});\n\nconst chat = await client.chats.create({ accountID: 'accountID' });\n\nconsole.log(chat.chatID);",
+ },
+ python: {
+ method: 'chats.create',
+ example:
+ 'import os\nfrom beeper_desktop_api import BeeperDesktop\n\nclient = BeeperDesktop(\n access_token=os.environ.get("BEEPER_ACCESS_TOKEN"), # This is the default and can be omitted\n)\nchat = client.chats.create(\n account_id="accountID",\n)\nprint(chat.chat_id)',
},
go: {
method: 'client.Chats.New',
example:
- 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/beeper/desktop-api-go"\n)\n\nfunc main() {\n\tclient := beeperdesktopapi.NewClient()\n\tchat, err := client.Chats.New(context.TODO(), beeperdesktopapi.ChatNewParams{\n\t\tAccountID: "accountID",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", chat.ChatID)\n}\n',
+ 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/beeper/desktop-api-go"\n\t"github.com/beeper/desktop-api-go/option"\n)\n\nfunc main() {\n\tclient := beeperdesktopapi.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tchat, err := client.Chats.New(context.TODO(), beeperdesktopapi.ChatNewParams{\n\t\tAccountID: "accountID",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", chat.ChatID)\n}\n',
},
- http: {
+ cli: {
+ method: 'chats create',
example:
- 'curl http://localhost:23373/v1/chats \\\n -H \'Content-Type: application/json\' \\\n -d \'{\n "accountID": "accountID"\n }\'',
+ "beeper-desktop-cli chats create \\\n --access-token 'My Access Token' \\\n --account-id accountID",
},
php: {
method: 'chats->create',
example:
- "chats->create(\n accountID: 'accountID',\n allowInvite: true,\n messageText: 'messageText',\n mode: 'create',\n participantIDs: ['string'],\n title: 'title',\n type: 'single',\n user: [\n 'id' => 'id',\n 'email' => 'email',\n 'fullName' => 'fullName',\n 'phoneNumber' => 'phoneNumber',\n 'username' => 'username',\n ],\n);\n\nvar_dump($chat);",
+ "chats->create(\n accountID: 'accountID',\n allowInvite: true,\n messageText: 'messageText',\n mode: 'start',\n participantIDs: ['string'],\n title: 'title',\n type: 'single',\n user: [\n 'id' => 'id',\n 'email' => 'email',\n 'fullName' => 'fullName',\n 'phoneNumber' => 'phoneNumber',\n 'username' => 'username',\n ],\n);\n\nvar_dump($chat);",
},
- python: {
- method: 'chats.create',
- example:
- 'from beeper_desktop_api import BeeperDesktop\n\nclient = BeeperDesktop()\nchat = client.chats.create(\n account_id="accountID",\n)\nprint(chat.chat_id)',
- },
- typescript: {
- method: 'client.chats.create',
+ http: {
example:
- "import BeeperDesktop from '@beeper/desktop-api';\n\nconst client = new BeeperDesktop();\n\nconst chat = await client.chats.create({ accountID: 'accountID' });\n\nconsole.log(chat.chatID);",
+ 'curl http://localhost:23373/v1/chats \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $BEEPER_ACCESS_TOKEN" \\\n -d \'{\n "accountID": "accountID"\n }\'',
},
},
},
@@ -388,32 +399,33 @@ const EMBEDDED_METHODS: MethodEntry[] = [
markdown:
"## list\n\n`client.chats.list(accountIDs?: string[], cursor?: string, direction?: 'after' | 'before'): object`\n\n**get** `/v1/chats`\n\nList all chats sorted by last activity (most recent first). Combines all accounts into a single paginated list.\n\n### Parameters\n\n- `accountIDs?: string[]`\n Limit to specific account IDs. If omitted, fetches from all accounts.\n\n- `cursor?: string`\n Opaque pagination cursor; do not inspect. Use together with 'direction'.\n\n- `direction?: 'after' | 'before'`\n Pagination direction used with 'cursor': 'before' fetches older results, 'after' fetches newer results. Defaults to 'before' when only 'cursor' is provided.\n\n### Returns\n\n- `{ id: string; accountID: string; participants: { hasMore: boolean; items: user[]; total: number; }; title: string; type: 'single' | 'group'; unreadCount: number; isArchived?: boolean; isMuted?: boolean; isPinned?: boolean; lastActivity?: string; lastReadMessageSortKey?: string; localChatID?: string; }`\n\n### Example\n\n```typescript\nimport BeeperDesktop from '@beeper/desktop-api';\n\nconst client = new BeeperDesktop();\n\n// Automatically fetches more pages as needed.\nfor await (const chatListResponse of client.chats.list()) {\n console.log(chatListResponse);\n}\n```",
perLanguage: {
- cli: {
- method: 'chats list',
- example: 'beeper-desktop-cli chats list',
+ typescript: {
+ method: 'client.chats.list',
+ example:
+ "import BeeperDesktop from '@beeper/desktop-api';\n\nconst client = new BeeperDesktop({\n accessToken: process.env['BEEPER_ACCESS_TOKEN'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const chatListResponse of client.chats.list()) {\n console.log(chatListResponse);\n}",
+ },
+ python: {
+ method: 'chats.list',
+ example:
+ 'import os\nfrom beeper_desktop_api import BeeperDesktop\n\nclient = BeeperDesktop(\n access_token=os.environ.get("BEEPER_ACCESS_TOKEN"), # This is the default and can be omitted\n)\npage = client.chats.list()\npage = page.items[0]\nprint(page)',
},
go: {
method: 'client.Chats.List',
example:
- 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/beeper/desktop-api-go"\n)\n\nfunc main() {\n\tclient := beeperdesktopapi.NewClient()\n\tpage, err := client.Chats.List(context.TODO(), beeperdesktopapi.ChatListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n',
+ 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/beeper/desktop-api-go"\n\t"github.com/beeper/desktop-api-go/option"\n)\n\nfunc main() {\n\tclient := beeperdesktopapi.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tpage, err := client.Chats.List(context.TODO(), beeperdesktopapi.ChatListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n',
},
- http: {
- example: 'curl http://localhost:23373/v1/chats',
+ cli: {
+ method: 'chats list',
+ example: "beeper-desktop-cli chats list \\\n --access-token 'My Access Token'",
},
php: {
method: 'chats->list',
example:
- "chats->list(\n accountIDs: [\n 'local-whatsapp_ba_EvYDBBsZbRQAy3UOSWqG0LuTVkc',\n 'local-instagram_ba_eRfQMmnSNy_p7Ih7HL7RduRpKFU',\n ],\n cursor: '1725489123456|c29tZUltc2dQYWdl',\n direction: 'before',\n);\n\nvar_dump($page);",
- },
- python: {
- method: 'chats.list',
- example:
- 'from beeper_desktop_api import BeeperDesktop\n\nclient = BeeperDesktop()\npage = client.chats.list()\npage = page.items[0]\nprint(page)',
+ "chats->list(\n accountIDs: [\n 'local-whatsapp_ba_EvYDBBsZbRQAy3UOSWqG0LuTVkc',\n 'local-instagram_ba_eRfQMmnSNy_p7Ih7HL7RduRpKFU',\n ],\n cursor: '1725489123456|c29tZUltc2dQYWdl',\n direction: 'before',\n);\n\nvar_dump($page);",
},
- typescript: {
- method: 'client.chats.list',
+ http: {
example:
- "import BeeperDesktop from '@beeper/desktop-api';\n\nconst client = new BeeperDesktop();\n\n// Automatically fetches more pages as needed.\nfor await (const chatListResponse of client.chats.list()) {\n console.log(chatListResponse);\n}",
+ 'curl http://localhost:23373/v1/chats \\\n -H "Authorization: Bearer $BEEPER_ACCESS_TOKEN"',
},
},
},
@@ -422,7 +434,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
endpoint: '/v1/chats/search',
httpMethod: 'get',
summary: 'Search chats',
- description: "Search chats by title/network or participants using Beeper Desktop's renderer algorithm.",
+ description: 'Search chats by title, network, or participant names.',
stainlessPath: '(resource) chats > (method) search',
qualified: 'client.chats.search',
params: [
@@ -442,34 +454,35 @@ const EMBEDDED_METHODS: MethodEntry[] = [
response:
"{ id: string; accountID: string; participants: { hasMore: boolean; items: object[]; total: number; }; title: string; type: 'single' | 'group'; unreadCount: number; isArchived?: boolean; isMuted?: boolean; isPinned?: boolean; lastActivity?: string; lastReadMessageSortKey?: string; localChatID?: string; }",
markdown:
- "## search\n\n`client.chats.search(accountIDs?: string[], cursor?: string, direction?: 'after' | 'before', inbox?: 'primary' | 'low-priority' | 'archive', includeMuted?: boolean, lastActivityAfter?: string, lastActivityBefore?: string, limit?: number, query?: string, scope?: 'titles' | 'participants', type?: 'single' | 'group' | 'any', unreadOnly?: boolean): { id: string; accountID: string; participants: object; title: string; type: 'single' | 'group'; unreadCount: number; isArchived?: boolean; isMuted?: boolean; isPinned?: boolean; lastActivity?: string; lastReadMessageSortKey?: string; localChatID?: string; }`\n\n**get** `/v1/chats/search`\n\nSearch chats by title/network or participants using Beeper Desktop's renderer algorithm.\n\n### Parameters\n\n- `accountIDs?: string[]`\n Provide an array of account IDs to filter chats from specific messaging accounts only\n\n- `cursor?: string`\n Opaque pagination cursor; do not inspect. Use together with 'direction'.\n\n- `direction?: 'after' | 'before'`\n Pagination direction used with 'cursor': 'before' fetches older results, 'after' fetches newer results. Defaults to 'before' when only 'cursor' is provided.\n\n- `inbox?: 'primary' | 'low-priority' | 'archive'`\n Filter by inbox type: \"primary\" (non-archived, non-low-priority), \"low-priority\", or \"archive\". If not specified, shows all chats.\n\n- `includeMuted?: boolean`\n Include chats marked as Muted by the user, which are usually less important. Default: true. Set to false if the user wants a more refined search.\n\n- `lastActivityAfter?: string`\n Provide an ISO datetime string to only retrieve chats with last activity after this time\n\n- `lastActivityBefore?: string`\n Provide an ISO datetime string to only retrieve chats with last activity before this time\n\n- `limit?: number`\n Set the maximum number of chats to retrieve. Valid range: 1-200, default is 50\n\n- `query?: string`\n Literal token search (non-semantic). Use single words users type (e.g., \"dinner\"). When multiple words provided, ALL must match. Case-insensitive.\n\n- `scope?: 'titles' | 'participants'`\n Search scope: 'titles' matches title + network; 'participants' matches participant names.\n\n- `type?: 'single' | 'group' | 'any'`\n Specify the type of chats to retrieve: use \"single\" for direct messages, \"group\" for group chats, or \"any\" to get all types\n\n- `unreadOnly?: boolean`\n Set to true to only retrieve chats that have unread messages\n\n### Returns\n\n- `{ id: string; accountID: string; participants: { hasMore: boolean; items: object[]; total: number; }; title: string; type: 'single' | 'group'; unreadCount: number; isArchived?: boolean; isMuted?: boolean; isPinned?: boolean; lastActivity?: string; lastReadMessageSortKey?: string; localChatID?: string; }`\n\n - `id: string`\n - `accountID: string`\n - `participants: { hasMore: boolean; items: { id: string; cannotMessage?: boolean; email?: string; fullName?: string; imgURL?: string; isSelf?: boolean; phoneNumber?: string; username?: string; }[]; total: number; }`\n - `title: string`\n - `type: 'single' | 'group'`\n - `unreadCount: number`\n - `isArchived?: boolean`\n - `isMuted?: boolean`\n - `isPinned?: boolean`\n - `lastActivity?: string`\n - `lastReadMessageSortKey?: string`\n - `localChatID?: string`\n\n### Example\n\n```typescript\nimport BeeperDesktop from '@beeper/desktop-api';\n\nconst client = new BeeperDesktop();\n\n// Automatically fetches more pages as needed.\nfor await (const chat of client.chats.search()) {\n console.log(chat);\n}\n```",
+ "## search\n\n`client.chats.search(accountIDs?: string[], cursor?: string, direction?: 'after' | 'before', inbox?: 'primary' | 'low-priority' | 'archive', includeMuted?: boolean, lastActivityAfter?: string, lastActivityBefore?: string, limit?: number, query?: string, scope?: 'titles' | 'participants', type?: 'single' | 'group' | 'any', unreadOnly?: boolean): { id: string; accountID: string; participants: object; title: string; type: 'single' | 'group'; unreadCount: number; isArchived?: boolean; isMuted?: boolean; isPinned?: boolean; lastActivity?: string; lastReadMessageSortKey?: string; localChatID?: string; }`\n\n**get** `/v1/chats/search`\n\nSearch chats by title, network, or participant names.\n\n### Parameters\n\n- `accountIDs?: string[]`\n Provide an array of account IDs to filter chats from specific messaging accounts only\n\n- `cursor?: string`\n Opaque pagination cursor; do not inspect. Use together with 'direction'.\n\n- `direction?: 'after' | 'before'`\n Pagination direction used with 'cursor': 'before' fetches older results, 'after' fetches newer results. Defaults to 'before' when only 'cursor' is provided.\n\n- `inbox?: 'primary' | 'low-priority' | 'archive'`\n Filter by inbox type: \"primary\" (non-archived, non-low-priority), \"low-priority\", or \"archive\". If not specified, shows all chats.\n\n- `includeMuted?: boolean`\n Include chats marked as Muted by the user, which are usually less important. Default: true. Set to false if the user wants a more refined search.\n\n- `lastActivityAfter?: string`\n Provide an ISO datetime string to only retrieve chats with last activity after this time\n\n- `lastActivityBefore?: string`\n Provide an ISO datetime string to only retrieve chats with last activity before this time\n\n- `limit?: number`\n Set the maximum number of chats to retrieve. Valid range: 1-200, default is 50\n\n- `query?: string`\n Literal token search (non-semantic). Use single words users type (e.g., \"dinner\"). When multiple words provided, ALL must match. Case-insensitive.\n\n- `scope?: 'titles' | 'participants'`\n Search scope: 'titles' matches title + network; 'participants' matches participant names.\n\n- `type?: 'single' | 'group' | 'any'`\n Specify the type of chats to retrieve: use \"single\" for direct messages, \"group\" for group chats, or \"any\" to get all types\n\n- `unreadOnly?: boolean`\n Set to true to only retrieve chats that have unread messages\n\n### Returns\n\n- `{ id: string; accountID: string; participants: { hasMore: boolean; items: object[]; total: number; }; title: string; type: 'single' | 'group'; unreadCount: number; isArchived?: boolean; isMuted?: boolean; isPinned?: boolean; lastActivity?: string; lastReadMessageSortKey?: string; localChatID?: string; }`\n\n - `id: string`\n - `accountID: string`\n - `participants: { hasMore: boolean; items: { id: string; cannotMessage?: boolean; email?: string; fullName?: string; imgURL?: string; isSelf?: boolean; phoneNumber?: string; username?: string; }[]; total: number; }`\n - `title: string`\n - `type: 'single' | 'group'`\n - `unreadCount: number`\n - `isArchived?: boolean`\n - `isMuted?: boolean`\n - `isPinned?: boolean`\n - `lastActivity?: string`\n - `lastReadMessageSortKey?: string`\n - `localChatID?: string`\n\n### Example\n\n```typescript\nimport BeeperDesktop from '@beeper/desktop-api';\n\nconst client = new BeeperDesktop();\n\n// Automatically fetches more pages as needed.\nfor await (const chat of client.chats.search()) {\n console.log(chat);\n}\n```",
perLanguage: {
- cli: {
- method: 'chats search',
- example: 'beeper-desktop-cli chats search',
+ typescript: {
+ method: 'client.chats.search',
+ example:
+ "import BeeperDesktop from '@beeper/desktop-api';\n\nconst client = new BeeperDesktop({\n accessToken: process.env['BEEPER_ACCESS_TOKEN'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const chat of client.chats.search()) {\n console.log(chat.id);\n}",
+ },
+ python: {
+ method: 'chats.search',
+ example:
+ 'import os\nfrom beeper_desktop_api import BeeperDesktop\n\nclient = BeeperDesktop(\n access_token=os.environ.get("BEEPER_ACCESS_TOKEN"), # This is the default and can be omitted\n)\npage = client.chats.search()\npage = page.items[0]\nprint(page.id)',
},
go: {
method: 'client.Chats.Search',
example:
- 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/beeper/desktop-api-go"\n)\n\nfunc main() {\n\tclient := beeperdesktopapi.NewClient()\n\tpage, err := client.Chats.Search(context.TODO(), beeperdesktopapi.ChatSearchParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n',
+ 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/beeper/desktop-api-go"\n\t"github.com/beeper/desktop-api-go/option"\n)\n\nfunc main() {\n\tclient := beeperdesktopapi.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tpage, err := client.Chats.Search(context.TODO(), beeperdesktopapi.ChatSearchParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n',
},
- http: {
- example: 'curl http://localhost:23373/v1/chats/search',
+ cli: {
+ method: 'chats search',
+ example: "beeper-desktop-cli chats search \\\n --access-token 'My Access Token'",
},
php: {
method: 'chats->search',
example:
- "chats->search(\n accountIDs: [\n 'local-whatsapp_ba_EvYDBBsZbRQAy3UOSWqG0LuTVkc',\n 'local-telegram_ba_QFrb5lrLPhO3OT5MFBeTWv0x4BI',\n ],\n cursor: '1725489123456|c29tZUltc2dQYWdl',\n direction: 'before',\n inbox: 'primary',\n includeMuted: true,\n lastActivityAfter: new \\DateTimeImmutable('2019-12-27T18:11:19.117Z'),\n lastActivityBefore: new \\DateTimeImmutable('2019-12-27T18:11:19.117Z'),\n limit: 1,\n query: 'x',\n scope: 'titles',\n type: 'single',\n unreadOnly: true,\n);\n\nvar_dump($page);",
- },
- python: {
- method: 'chats.search',
- example:
- 'from beeper_desktop_api import BeeperDesktop\n\nclient = BeeperDesktop()\npage = client.chats.search()\npage = page.items[0]\nprint(page.id)',
+ "chats->search(\n accountIDs: [\n 'local-whatsapp_ba_EvYDBBsZbRQAy3UOSWqG0LuTVkc',\n 'local-telegram_ba_QFrb5lrLPhO3OT5MFBeTWv0x4BI',\n ],\n cursor: '1725489123456|c29tZUltc2dQYWdl',\n direction: 'before',\n inbox: 'primary',\n includeMuted: true,\n lastActivityAfter: new \\DateTimeImmutable('2019-12-27T18:11:19.117Z'),\n lastActivityBefore: new \\DateTimeImmutable('2019-12-27T18:11:19.117Z'),\n limit: 1,\n query: 'x',\n scope: 'titles',\n type: 'single',\n unreadOnly: true,\n);\n\nvar_dump($page);",
},
- typescript: {
- method: 'client.chats.search',
+ http: {
example:
- "import BeeperDesktop from '@beeper/desktop-api';\n\nconst client = new BeeperDesktop();\n\n// Automatically fetches more pages as needed.\nfor await (const chat of client.chats.search()) {\n console.log(chat.id);\n}",
+ 'curl http://localhost:23373/v1/chats/search \\\n -H "Authorization: Bearer $BEEPER_ACCESS_TOKEN"',
},
},
},
@@ -486,32 +499,34 @@ const EMBEDDED_METHODS: MethodEntry[] = [
markdown:
"## archive\n\n`client.chats.archive(chatID: string, archived?: boolean): void`\n\n**post** `/v1/chats/{chatID}/archive`\n\nArchive or unarchive a chat. Set archived=true to move to archive, archived=false to move back to inbox\n\n### Parameters\n\n- `chatID: string`\n Unique identifier of the chat.\n\n- `archived?: boolean`\n True to archive, false to unarchive\n\n### Example\n\n```typescript\nimport BeeperDesktop from '@beeper/desktop-api';\n\nconst client = new BeeperDesktop();\n\nawait client.chats.archive('!NCdzlIaMjZUmvmvyHU:beeper.com')\n```",
perLanguage: {
- cli: {
- method: 'chats archive',
- example: "beeper-desktop-cli chats archive \\\n --chat-id '!NCdzlIaMjZUmvmvyHU:beeper.com'",
+ typescript: {
+ method: 'client.chats.archive',
+ example:
+ "import BeeperDesktop from '@beeper/desktop-api';\n\nconst client = new BeeperDesktop({\n accessToken: process.env['BEEPER_ACCESS_TOKEN'], // This is the default and can be omitted\n});\n\nawait client.chats.archive('!NCdzlIaMjZUmvmvyHU:beeper.com');",
+ },
+ python: {
+ method: 'chats.archive',
+ example:
+ 'import os\nfrom beeper_desktop_api import BeeperDesktop\n\nclient = BeeperDesktop(\n access_token=os.environ.get("BEEPER_ACCESS_TOKEN"), # This is the default and can be omitted\n)\nclient.chats.archive(\n chat_id="!NCdzlIaMjZUmvmvyHU:beeper.com",\n)',
},
go: {
method: 'client.Chats.Archive',
example:
- 'package main\n\nimport (\n\t"context"\n\n\t"github.com/beeper/desktop-api-go"\n)\n\nfunc main() {\n\tclient := beeperdesktopapi.NewClient()\n\terr := client.Chats.Archive(\n\t\tcontext.TODO(),\n\t\t"!NCdzlIaMjZUmvmvyHU:beeper.com",\n\t\tbeeperdesktopapi.ChatArchiveParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n',
+ 'package main\n\nimport (\n\t"context"\n\n\t"github.com/beeper/desktop-api-go"\n\t"github.com/beeper/desktop-api-go/option"\n)\n\nfunc main() {\n\tclient := beeperdesktopapi.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\terr := client.Chats.Archive(\n\t\tcontext.TODO(),\n\t\t"!NCdzlIaMjZUmvmvyHU:beeper.com",\n\t\tbeeperdesktopapi.ChatArchiveParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n',
},
- http: {
- example: 'curl http://localhost:23373/v1/chats/$CHAT_ID/archive \\\n -X POST',
+ cli: {
+ method: 'chats archive',
+ example:
+ "beeper-desktop-cli chats archive \\\n --access-token 'My Access Token' \\\n --chat-id '!NCdzlIaMjZUmvmvyHU:beeper.com'",
},
php: {
method: 'chats->archive',
example:
- "chats->archive(\n '!NCdzlIaMjZUmvmvyHU:beeper.com', archived: true\n);\n\nvar_dump($result);",
+ "chats->archive(\n '!NCdzlIaMjZUmvmvyHU:beeper.com', archived: true\n);\n\nvar_dump($result);",
},
- python: {
- method: 'chats.archive',
- example:
- 'from beeper_desktop_api import BeeperDesktop\n\nclient = BeeperDesktop()\nclient.chats.archive(\n chat_id="!NCdzlIaMjZUmvmvyHU:beeper.com",\n)',
- },
- typescript: {
- method: 'client.chats.archive',
+ http: {
example:
- "import BeeperDesktop from '@beeper/desktop-api';\n\nconst client = new BeeperDesktop();\n\nawait client.chats.archive('!NCdzlIaMjZUmvmvyHU:beeper.com');",
+ 'curl http://localhost:23373/v1/chats/$CHAT_ID/archive \\\n -X POST \\\n -H "Authorization: Bearer $BEEPER_ACCESS_TOKEN"',
},
},
},
@@ -527,34 +542,34 @@ const EMBEDDED_METHODS: MethodEntry[] = [
markdown:
"## create\n\n`client.chats.reminders.create(chatID: string, reminder: { remindAtMs: number; dismissOnIncomingMessage?: boolean; }): void`\n\n**post** `/v1/chats/{chatID}/reminders`\n\nSet a reminder for a chat at a specific time\n\n### Parameters\n\n- `chatID: string`\n Unique identifier of the chat.\n\n- `reminder: { remindAtMs: number; dismissOnIncomingMessage?: boolean; }`\n Reminder configuration\n - `remindAtMs: number`\n Unix timestamp in milliseconds when reminder should trigger\n - `dismissOnIncomingMessage?: boolean`\n Cancel reminder if someone messages in the chat\n\n### Example\n\n```typescript\nimport BeeperDesktop from '@beeper/desktop-api';\n\nconst client = new BeeperDesktop();\n\nawait client.chats.reminders.create('!NCdzlIaMjZUmvmvyHU:beeper.com', { reminder: { remindAtMs: 0 } })\n```",
perLanguage: {
- cli: {
- method: 'reminders create',
+ typescript: {
+ method: 'client.chats.reminders.create',
example:
- "beeper-desktop-cli chats:reminders create \\\n --chat-id '!NCdzlIaMjZUmvmvyHU:beeper.com' \\\n --reminder '{remindAtMs: 0}'",
+ "import BeeperDesktop from '@beeper/desktop-api';\n\nconst client = new BeeperDesktop({\n accessToken: process.env['BEEPER_ACCESS_TOKEN'], // This is the default and can be omitted\n});\n\nawait client.chats.reminders.create('!NCdzlIaMjZUmvmvyHU:beeper.com', {\n reminder: { remindAtMs: 0 },\n});",
+ },
+ python: {
+ method: 'chats.reminders.create',
+ example:
+ 'import os\nfrom beeper_desktop_api import BeeperDesktop\n\nclient = BeeperDesktop(\n access_token=os.environ.get("BEEPER_ACCESS_TOKEN"), # This is the default and can be omitted\n)\nclient.chats.reminders.create(\n chat_id="!NCdzlIaMjZUmvmvyHU:beeper.com",\n reminder={\n "remind_at_ms": 0\n },\n)',
},
go: {
method: 'client.Chats.Reminders.New',
example:
- 'package main\n\nimport (\n\t"context"\n\n\t"github.com/beeper/desktop-api-go"\n)\n\nfunc main() {\n\tclient := beeperdesktopapi.NewClient()\n\terr := client.Chats.Reminders.New(\n\t\tcontext.TODO(),\n\t\t"!NCdzlIaMjZUmvmvyHU:beeper.com",\n\t\tbeeperdesktopapi.ChatReminderNewParams{\n\t\t\tReminder: beeperdesktopapi.ChatReminderNewParamsReminder{\n\t\t\t\tRemindAtMs: 0,\n\t\t\t},\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n',
+ 'package main\n\nimport (\n\t"context"\n\n\t"github.com/beeper/desktop-api-go"\n\t"github.com/beeper/desktop-api-go/option"\n)\n\nfunc main() {\n\tclient := beeperdesktopapi.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\terr := client.Chats.Reminders.New(\n\t\tcontext.TODO(),\n\t\t"!NCdzlIaMjZUmvmvyHU:beeper.com",\n\t\tbeeperdesktopapi.ChatReminderNewParams{\n\t\t\tReminder: beeperdesktopapi.ChatReminderNewParamsReminder{\n\t\t\t\tRemindAtMs: 0,\n\t\t\t},\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n',
},
- http: {
+ cli: {
+ method: 'reminders create',
example:
- 'curl http://localhost:23373/v1/chats/$CHAT_ID/reminders \\\n -H \'Content-Type: application/json\' \\\n -d \'{\n "reminder": {\n "remindAtMs": 0\n }\n }\'',
+ "beeper-desktop-cli chats:reminders create \\\n --access-token 'My Access Token' \\\n --chat-id '!NCdzlIaMjZUmvmvyHU:beeper.com' \\\n --reminder '{remindAtMs: 0}'",
},
php: {
method: 'chats->reminders->create',
example:
- "chats->reminders->create(\n '!NCdzlIaMjZUmvmvyHU:beeper.com',\n reminder: ['remindAtMs' => 0, 'dismissOnIncomingMessage' => true],\n);\n\nvar_dump($result);",
- },
- python: {
- method: 'chats.reminders.create',
- example:
- 'from beeper_desktop_api import BeeperDesktop\n\nclient = BeeperDesktop()\nclient.chats.reminders.create(\n chat_id="!NCdzlIaMjZUmvmvyHU:beeper.com",\n reminder={\n "remind_at_ms": 0\n },\n)',
+ "chats->reminders->create(\n '!NCdzlIaMjZUmvmvyHU:beeper.com',\n reminder: ['remindAtMs' => 0, 'dismissOnIncomingMessage' => true],\n);\n\nvar_dump($result);",
},
- typescript: {
- method: 'client.chats.reminders.create',
+ http: {
example:
- "import BeeperDesktop from '@beeper/desktop-api';\n\nconst client = new BeeperDesktop();\n\nawait client.chats.reminders.create('!NCdzlIaMjZUmvmvyHU:beeper.com', {\n reminder: { remindAtMs: 0 },\n});",
+ 'curl http://localhost:23373/v1/chats/$CHAT_ID/reminders \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $BEEPER_ACCESS_TOKEN" \\\n -d \'{\n "reminder": {\n "remindAtMs": 0\n }\n }\'',
},
},
},
@@ -570,32 +585,34 @@ const EMBEDDED_METHODS: MethodEntry[] = [
markdown:
"## delete\n\n`client.chats.reminders.delete(chatID: string): void`\n\n**delete** `/v1/chats/{chatID}/reminders`\n\nClear an existing reminder from a chat\n\n### Parameters\n\n- `chatID: string`\n Unique identifier of the chat.\n\n### Example\n\n```typescript\nimport BeeperDesktop from '@beeper/desktop-api';\n\nconst client = new BeeperDesktop();\n\nawait client.chats.reminders.delete('!NCdzlIaMjZUmvmvyHU:beeper.com')\n```",
perLanguage: {
- cli: {
- method: 'reminders delete',
- example: "beeper-desktop-cli chats:reminders delete \\\n --chat-id '!NCdzlIaMjZUmvmvyHU:beeper.com'",
+ typescript: {
+ method: 'client.chats.reminders.delete',
+ example:
+ "import BeeperDesktop from '@beeper/desktop-api';\n\nconst client = new BeeperDesktop({\n accessToken: process.env['BEEPER_ACCESS_TOKEN'], // This is the default and can be omitted\n});\n\nawait client.chats.reminders.delete('!NCdzlIaMjZUmvmvyHU:beeper.com');",
+ },
+ python: {
+ method: 'chats.reminders.delete',
+ example:
+ 'import os\nfrom beeper_desktop_api import BeeperDesktop\n\nclient = BeeperDesktop(\n access_token=os.environ.get("BEEPER_ACCESS_TOKEN"), # This is the default and can be omitted\n)\nclient.chats.reminders.delete(\n "!NCdzlIaMjZUmvmvyHU:beeper.com",\n)',
},
go: {
method: 'client.Chats.Reminders.Delete',
example:
- 'package main\n\nimport (\n\t"context"\n\n\t"github.com/beeper/desktop-api-go"\n)\n\nfunc main() {\n\tclient := beeperdesktopapi.NewClient()\n\terr := client.Chats.Reminders.Delete(context.TODO(), "!NCdzlIaMjZUmvmvyHU:beeper.com")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n',
+ 'package main\n\nimport (\n\t"context"\n\n\t"github.com/beeper/desktop-api-go"\n\t"github.com/beeper/desktop-api-go/option"\n)\n\nfunc main() {\n\tclient := beeperdesktopapi.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\terr := client.Chats.Reminders.Delete(context.TODO(), "!NCdzlIaMjZUmvmvyHU:beeper.com")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n',
},
- http: {
- example: 'curl http://localhost:23373/v1/chats/$CHAT_ID/reminders \\\n -X DELETE',
+ cli: {
+ method: 'reminders delete',
+ example:
+ "beeper-desktop-cli chats:reminders delete \\\n --access-token 'My Access Token' \\\n --chat-id '!NCdzlIaMjZUmvmvyHU:beeper.com'",
},
php: {
method: 'chats->reminders->delete',
example:
- "chats->reminders->delete('!NCdzlIaMjZUmvmvyHU:beeper.com');\n\nvar_dump($result);",
- },
- python: {
- method: 'chats.reminders.delete',
- example:
- 'from beeper_desktop_api import BeeperDesktop\n\nclient = BeeperDesktop()\nclient.chats.reminders.delete(\n "!NCdzlIaMjZUmvmvyHU:beeper.com",\n)',
+ "chats->reminders->delete('!NCdzlIaMjZUmvmvyHU:beeper.com');\n\nvar_dump($result);",
},
- typescript: {
- method: 'client.chats.reminders.delete',
+ http: {
example:
- "import BeeperDesktop from '@beeper/desktop-api';\n\nconst client = new BeeperDesktop();\n\nawait client.chats.reminders.delete('!NCdzlIaMjZUmvmvyHU:beeper.com');",
+ 'curl http://localhost:23373/v1/chats/$CHAT_ID/reminders \\\n -X DELETE \\\n -H "Authorization: Bearer $BEEPER_ACCESS_TOKEN"',
},
},
},
@@ -613,34 +630,34 @@ const EMBEDDED_METHODS: MethodEntry[] = [
markdown:
"## add\n\n`client.chats.messages.reactions.add(chatID: string, messageID: string, reactionKey: string, transactionID?: string): { chatID: string; messageID: string; reactionKey: string; success: true; transactionID: string; }`\n\n**post** `/v1/chats/{chatID}/messages/{messageID}/reactions`\n\nAdd a reaction to an existing message.\n\n### Parameters\n\n- `chatID: string`\n Unique identifier of the chat.\n\n- `messageID: string`\n\n- `reactionKey: string`\n Reaction key to add (emoji, shortcode, or custom emoji key)\n\n- `transactionID?: string`\n Optional transaction ID for deduplication and local echo tracking\n\n### Returns\n\n- `{ chatID: string; messageID: string; reactionKey: string; success: true; transactionID: string; }`\n\n - `chatID: string`\n - `messageID: string`\n - `reactionKey: string`\n - `success: true`\n - `transactionID: string`\n\n### Example\n\n```typescript\nimport BeeperDesktop from '@beeper/desktop-api';\n\nconst client = new BeeperDesktop();\n\nconst response = await client.chats.messages.reactions.add('messageID', { chatID: '!NCdzlIaMjZUmvmvyHU:beeper.com', reactionKey: 'x' });\n\nconsole.log(response);\n```",
perLanguage: {
- cli: {
- method: 'reactions add',
+ typescript: {
+ method: 'client.chats.messages.reactions.add',
example:
- "beeper-desktop-cli chats:messages:reactions add \\\n --chat-id '!NCdzlIaMjZUmvmvyHU:beeper.com' \\\n --message-id messageID \\\n --reaction-key x",
+ "import BeeperDesktop from '@beeper/desktop-api';\n\nconst client = new BeeperDesktop({\n accessToken: process.env['BEEPER_ACCESS_TOKEN'], // This is the default and can be omitted\n});\n\nconst response = await client.chats.messages.reactions.add('messageID', {\n chatID: '!NCdzlIaMjZUmvmvyHU:beeper.com',\n reactionKey: 'x',\n});\n\nconsole.log(response.chatID);",
+ },
+ python: {
+ method: 'chats.messages.reactions.add',
+ example:
+ 'import os\nfrom beeper_desktop_api import BeeperDesktop\n\nclient = BeeperDesktop(\n access_token=os.environ.get("BEEPER_ACCESS_TOKEN"), # This is the default and can be omitted\n)\nresponse = client.chats.messages.reactions.add(\n message_id="messageID",\n chat_id="!NCdzlIaMjZUmvmvyHU:beeper.com",\n reaction_key="x",\n)\nprint(response.chat_id)',
},
go: {
method: 'client.Chats.Messages.Reactions.Add',
example:
- 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/beeper/desktop-api-go"\n)\n\nfunc main() {\n\tclient := beeperdesktopapi.NewClient()\n\tresponse, err := client.Chats.Messages.Reactions.Add(\n\t\tcontext.TODO(),\n\t\t"messageID",\n\t\tbeeperdesktopapi.ChatMessageReactionAddParams{\n\t\t\tChatID: "!NCdzlIaMjZUmvmvyHU:beeper.com",\n\t\t\tReactionKey: "x",\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.ChatID)\n}\n',
+ 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/beeper/desktop-api-go"\n\t"github.com/beeper/desktop-api-go/option"\n)\n\nfunc main() {\n\tclient := beeperdesktopapi.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tresponse, err := client.Chats.Messages.Reactions.Add(\n\t\tcontext.TODO(),\n\t\t"messageID",\n\t\tbeeperdesktopapi.ChatMessageReactionAddParams{\n\t\t\tChatID: "!NCdzlIaMjZUmvmvyHU:beeper.com",\n\t\t\tReactionKey: "x",\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.ChatID)\n}\n',
},
- http: {
+ cli: {
+ method: 'reactions add',
example:
- 'curl http://localhost:23373/v1/chats/$CHAT_ID/messages/$MESSAGE_ID/reactions \\\n -H \'Content-Type: application/json\' \\\n -d \'{\n "reactionKey": "x"\n }\'',
+ "beeper-desktop-cli chats:messages:reactions add \\\n --access-token 'My Access Token' \\\n --chat-id '!NCdzlIaMjZUmvmvyHU:beeper.com' \\\n --message-id messageID \\\n --reaction-key x",
},
php: {
method: 'chats->messages->reactions->add',
example:
- "chats->messages->reactions->add(\n 'messageID',\n chatID: '!NCdzlIaMjZUmvmvyHU:beeper.com',\n reactionKey: 'x',\n transactionID: 'transactionID',\n);\n\nvar_dump($response);",
+ "chats->messages->reactions->add(\n 'messageID',\n chatID: '!NCdzlIaMjZUmvmvyHU:beeper.com',\n reactionKey: 'x',\n transactionID: 'transactionID',\n);\n\nvar_dump($response);",
},
- python: {
- method: 'chats.messages.reactions.add',
- example:
- 'from beeper_desktop_api import BeeperDesktop\n\nclient = BeeperDesktop()\nresponse = client.chats.messages.reactions.add(\n message_id="messageID",\n chat_id="!NCdzlIaMjZUmvmvyHU:beeper.com",\n reaction_key="x",\n)\nprint(response.chat_id)',
- },
- typescript: {
- method: 'client.chats.messages.reactions.add',
+ http: {
example:
- "import BeeperDesktop from '@beeper/desktop-api';\n\nconst client = new BeeperDesktop();\n\nconst response = await client.chats.messages.reactions.add('messageID', {\n chatID: '!NCdzlIaMjZUmvmvyHU:beeper.com',\n reactionKey: 'x',\n});\n\nconsole.log(response.chatID);",
+ 'curl http://localhost:23373/v1/chats/$CHAT_ID/messages/$MESSAGE_ID/reactions \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $BEEPER_ACCESS_TOKEN" \\\n -d \'{\n "reactionKey": "x"\n }\'',
},
},
},
@@ -649,42 +666,42 @@ const EMBEDDED_METHODS: MethodEntry[] = [
endpoint: '/v1/chats/{chatID}/messages/{messageID}/reactions',
httpMethod: 'delete',
summary: 'Remove a reaction',
- description: "Remove the authenticated user's reaction from an existing message.",
+ description: 'Remove the reaction added by the authenticated user from an existing message.',
stainlessPath: '(resource) chats.messages.reactions > (method) delete',
qualified: 'client.chats.messages.reactions.delete',
params: ['chatID: string;', 'messageID: string;', 'reactionKey: string;'],
response: '{ chatID: string; messageID: string; reactionKey: string; success: true; }',
markdown:
- "## delete\n\n`client.chats.messages.reactions.delete(chatID: string, messageID: string, reactionKey: string): { chatID: string; messageID: string; reactionKey: string; success: true; }`\n\n**delete** `/v1/chats/{chatID}/messages/{messageID}/reactions`\n\nRemove the authenticated user's reaction from an existing message.\n\n### Parameters\n\n- `chatID: string`\n Unique identifier of the chat.\n\n- `messageID: string`\n\n- `reactionKey: string`\n Reaction key to remove\n\n### Returns\n\n- `{ chatID: string; messageID: string; reactionKey: string; success: true; }`\n\n - `chatID: string`\n - `messageID: string`\n - `reactionKey: string`\n - `success: true`\n\n### Example\n\n```typescript\nimport BeeperDesktop from '@beeper/desktop-api';\n\nconst client = new BeeperDesktop();\n\nconst reaction = await client.chats.messages.reactions.delete('messageID', { chatID: '!NCdzlIaMjZUmvmvyHU:beeper.com', reactionKey: 'x' });\n\nconsole.log(reaction);\n```",
+ "## delete\n\n`client.chats.messages.reactions.delete(chatID: string, messageID: string, reactionKey: string): { chatID: string; messageID: string; reactionKey: string; success: true; }`\n\n**delete** `/v1/chats/{chatID}/messages/{messageID}/reactions`\n\nRemove the reaction added by the authenticated user from an existing message.\n\n### Parameters\n\n- `chatID: string`\n Unique identifier of the chat.\n\n- `messageID: string`\n\n- `reactionKey: string`\n Reaction key to remove\n\n### Returns\n\n- `{ chatID: string; messageID: string; reactionKey: string; success: true; }`\n\n - `chatID: string`\n - `messageID: string`\n - `reactionKey: string`\n - `success: true`\n\n### Example\n\n```typescript\nimport BeeperDesktop from '@beeper/desktop-api';\n\nconst client = new BeeperDesktop();\n\nconst reaction = await client.chats.messages.reactions.delete('messageID', { chatID: '!NCdzlIaMjZUmvmvyHU:beeper.com', reactionKey: 'x' });\n\nconsole.log(reaction);\n```",
perLanguage: {
- cli: {
- method: 'reactions delete',
+ typescript: {
+ method: 'client.chats.messages.reactions.delete',
+ example:
+ "import BeeperDesktop from '@beeper/desktop-api';\n\nconst client = new BeeperDesktop({\n accessToken: process.env['BEEPER_ACCESS_TOKEN'], // This is the default and can be omitted\n});\n\nconst reaction = await client.chats.messages.reactions.delete('messageID', {\n chatID: '!NCdzlIaMjZUmvmvyHU:beeper.com',\n reactionKey: 'x',\n});\n\nconsole.log(reaction.chatID);",
+ },
+ python: {
+ method: 'chats.messages.reactions.delete',
example:
- "beeper-desktop-cli chats:messages:reactions delete \\\n --chat-id '!NCdzlIaMjZUmvmvyHU:beeper.com' \\\n --message-id messageID \\\n --reaction-key x",
+ 'import os\nfrom beeper_desktop_api import BeeperDesktop\n\nclient = BeeperDesktop(\n access_token=os.environ.get("BEEPER_ACCESS_TOKEN"), # This is the default and can be omitted\n)\nreaction = client.chats.messages.reactions.delete(\n message_id="messageID",\n chat_id="!NCdzlIaMjZUmvmvyHU:beeper.com",\n reaction_key="x",\n)\nprint(reaction.chat_id)',
},
go: {
method: 'client.Chats.Messages.Reactions.Delete',
example:
- 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/beeper/desktop-api-go"\n)\n\nfunc main() {\n\tclient := beeperdesktopapi.NewClient()\n\treaction, err := client.Chats.Messages.Reactions.Delete(\n\t\tcontext.TODO(),\n\t\t"messageID",\n\t\tbeeperdesktopapi.ChatMessageReactionDeleteParams{\n\t\t\tChatID: "!NCdzlIaMjZUmvmvyHU:beeper.com",\n\t\t\tReactionKey: "x",\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", reaction.ChatID)\n}\n',
+ 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/beeper/desktop-api-go"\n\t"github.com/beeper/desktop-api-go/option"\n)\n\nfunc main() {\n\tclient := beeperdesktopapi.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\treaction, err := client.Chats.Messages.Reactions.Delete(\n\t\tcontext.TODO(),\n\t\t"messageID",\n\t\tbeeperdesktopapi.ChatMessageReactionDeleteParams{\n\t\t\tChatID: "!NCdzlIaMjZUmvmvyHU:beeper.com",\n\t\t\tReactionKey: "x",\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", reaction.ChatID)\n}\n',
},
- http: {
+ cli: {
+ method: 'reactions delete',
example:
- 'curl http://localhost:23373/v1/chats/$CHAT_ID/messages/$MESSAGE_ID/reactions \\\n -X DELETE',
+ "beeper-desktop-cli chats:messages:reactions delete \\\n --access-token 'My Access Token' \\\n --chat-id '!NCdzlIaMjZUmvmvyHU:beeper.com' \\\n --message-id messageID \\\n --reaction-key x",
},
php: {
method: 'chats->messages->reactions->delete',
example:
- "chats->messages->reactions->delete(\n 'messageID', chatID: '!NCdzlIaMjZUmvmvyHU:beeper.com', reactionKey: 'x'\n);\n\nvar_dump($reaction);",
- },
- python: {
- method: 'chats.messages.reactions.delete',
- example:
- 'from beeper_desktop_api import BeeperDesktop\n\nclient = BeeperDesktop()\nreaction = client.chats.messages.reactions.delete(\n message_id="messageID",\n chat_id="!NCdzlIaMjZUmvmvyHU:beeper.com",\n reaction_key="x",\n)\nprint(reaction.chat_id)',
+ "chats->messages->reactions->delete(\n 'messageID', chatID: '!NCdzlIaMjZUmvmvyHU:beeper.com', reactionKey: 'x'\n);\n\nvar_dump($reaction);",
},
- typescript: {
- method: 'client.chats.messages.reactions.delete',
+ http: {
example:
- "import BeeperDesktop from '@beeper/desktop-api';\n\nconst client = new BeeperDesktop();\n\nconst reaction = await client.chats.messages.reactions.delete('messageID', {\n chatID: '!NCdzlIaMjZUmvmvyHU:beeper.com',\n reactionKey: 'x',\n});\n\nconsole.log(reaction.chatID);",
+ 'curl http://localhost:23373/v1/chats/$CHAT_ID/messages/$MESSAGE_ID/reactions \\\n -X DELETE \\\n -H "Authorization: Bearer $BEEPER_ACCESS_TOKEN"',
},
},
},
@@ -693,7 +710,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
endpoint: '/v1/messages/search',
httpMethod: 'get',
summary: 'Search messages',
- description: "Search messages across chats using Beeper's message index",
+ description: 'Search messages across chats.',
stainlessPath: '(resource) messages > (method) search',
qualified: 'client.messages.search',
params: [
@@ -714,34 +731,35 @@ const EMBEDDED_METHODS: MethodEntry[] = [
response:
"{ id: string; accountID: string; chatID: string; senderID: string; sortKey: string; timestamp: string; attachments?: { type: 'unknown' | 'img' | 'video' | 'audio'; id?: string; duration?: number; fileName?: string; fileSize?: number; isGif?: boolean; isSticker?: boolean; isVoiceNote?: boolean; mimeType?: string; posterImg?: string; size?: object; srcURL?: string; }[]; isSender?: boolean; isUnread?: boolean; linkedMessageID?: string; reactions?: { id: string; participantID: string; reactionKey: string; emoji?: boolean; imgURL?: string; }[]; senderName?: string; text?: string; type?: string; }",
markdown:
- "## search\n\n`client.messages.search(accountIDs?: string[], chatIDs?: string[], chatType?: 'group' | 'single', cursor?: string, dateAfter?: string, dateBefore?: string, direction?: 'after' | 'before', excludeLowPriority?: boolean, includeMuted?: boolean, limit?: number, mediaTypes?: 'any' | 'video' | 'image' | 'link' | 'file'[], query?: string, sender?: string): { id: string; accountID: string; chatID: string; senderID: string; sortKey: string; timestamp: string; attachments?: attachment[]; isSender?: boolean; isUnread?: boolean; linkedMessageID?: string; reactions?: reaction[]; senderName?: string; text?: string; type?: string; }`\n\n**get** `/v1/messages/search`\n\nSearch messages across chats using Beeper's message index\n\n### Parameters\n\n- `accountIDs?: string[]`\n Limit search to specific account IDs.\n\n- `chatIDs?: string[]`\n Limit search to specific chat IDs.\n\n- `chatType?: 'group' | 'single'`\n Filter by chat type: 'group' for group chats, 'single' for 1:1 chats.\n\n- `cursor?: string`\n Opaque pagination cursor; do not inspect. Use together with 'direction'.\n\n- `dateAfter?: string`\n Only include messages with timestamp strictly after this ISO 8601 datetime (e.g., '2024-07-01T00:00:00Z' or '2024-07-01T00:00:00+02:00').\n\n- `dateBefore?: string`\n Only include messages with timestamp strictly before this ISO 8601 datetime (e.g., '2024-07-31T23:59:59Z' or '2024-07-31T23:59:59+02:00').\n\n- `direction?: 'after' | 'before'`\n Pagination direction used with 'cursor': 'before' fetches older results, 'after' fetches newer results. Defaults to 'before' when only 'cursor' is provided.\n\n- `excludeLowPriority?: boolean`\n Exclude messages marked Low Priority by the user. Default: true. Set to false to include all.\n\n- `includeMuted?: boolean`\n Include messages in chats marked as Muted by the user, which are usually less important. Default: true. Set to false if the user wants a more refined search.\n\n- `limit?: number`\n Maximum number of messages to return.\n\n- `mediaTypes?: 'any' | 'video' | 'image' | 'link' | 'file'[]`\n Filter messages by media types. Use ['any'] for any media type, or specify exact types like ['video', 'image']. Omit for no media filtering.\n\n- `query?: string`\n Literal word search (non-semantic). Finds messages containing these EXACT words in any order. Use single words users actually type, not concepts or phrases. Example: use \"dinner\" not \"dinner plans\", use \"sick\" not \"health issues\". If omitted, returns results filtered only by other parameters.\n\n- `sender?: string`\n Filter by sender: 'me' (messages sent by the authenticated user), 'others' (messages sent by others), or a specific user ID string (user.id).\n\n### Returns\n\n- `{ id: string; accountID: string; chatID: string; senderID: string; sortKey: string; timestamp: string; attachments?: { type: 'unknown' | 'img' | 'video' | 'audio'; id?: string; duration?: number; fileName?: string; fileSize?: number; isGif?: boolean; isSticker?: boolean; isVoiceNote?: boolean; mimeType?: string; posterImg?: string; size?: object; srcURL?: string; }[]; isSender?: boolean; isUnread?: boolean; linkedMessageID?: string; reactions?: { id: string; participantID: string; reactionKey: string; emoji?: boolean; imgURL?: string; }[]; senderName?: string; text?: string; type?: string; }`\n\n - `id: string`\n - `accountID: string`\n - `chatID: string`\n - `senderID: string`\n - `sortKey: string`\n - `timestamp: string`\n - `attachments?: { type: 'unknown' | 'img' | 'video' | 'audio'; id?: string; duration?: number; fileName?: string; fileSize?: number; isGif?: boolean; isSticker?: boolean; isVoiceNote?: boolean; mimeType?: string; posterImg?: string; size?: { height?: number; width?: number; }; srcURL?: string; }[]`\n - `isSender?: boolean`\n - `isUnread?: boolean`\n - `linkedMessageID?: string`\n - `reactions?: { id: string; participantID: string; reactionKey: string; emoji?: boolean; imgURL?: string; }[]`\n - `senderName?: string`\n - `text?: string`\n - `type?: string`\n\n### Example\n\n```typescript\nimport BeeperDesktop from '@beeper/desktop-api';\n\nconst client = new BeeperDesktop();\n\n// Automatically fetches more pages as needed.\nfor await (const message of client.messages.search()) {\n console.log(message);\n}\n```",
+ "## search\n\n`client.messages.search(accountIDs?: string[], chatIDs?: string[], chatType?: 'group' | 'single', cursor?: string, dateAfter?: string, dateBefore?: string, direction?: 'after' | 'before', excludeLowPriority?: boolean, includeMuted?: boolean, limit?: number, mediaTypes?: 'any' | 'video' | 'image' | 'link' | 'file'[], query?: string, sender?: string): { id: string; accountID: string; chatID: string; senderID: string; sortKey: string; timestamp: string; attachments?: attachment[]; isSender?: boolean; isUnread?: boolean; linkedMessageID?: string; reactions?: reaction[]; senderName?: string; text?: string; type?: string; }`\n\n**get** `/v1/messages/search`\n\nSearch messages across chats.\n\n### Parameters\n\n- `accountIDs?: string[]`\n Limit search to specific account IDs.\n\n- `chatIDs?: string[]`\n Limit search to specific chat IDs.\n\n- `chatType?: 'group' | 'single'`\n Filter by chat type: 'group' for group chats, 'single' for 1:1 chats.\n\n- `cursor?: string`\n Opaque pagination cursor; do not inspect. Use together with 'direction'.\n\n- `dateAfter?: string`\n Only include messages with timestamp strictly after this ISO 8601 datetime (e.g., '2024-07-01T00:00:00Z' or '2024-07-01T00:00:00+02:00').\n\n- `dateBefore?: string`\n Only include messages with timestamp strictly before this ISO 8601 datetime (e.g., '2024-07-31T23:59:59Z' or '2024-07-31T23:59:59+02:00').\n\n- `direction?: 'after' | 'before'`\n Pagination direction used with 'cursor': 'before' fetches older results, 'after' fetches newer results. Defaults to 'before' when only 'cursor' is provided.\n\n- `excludeLowPriority?: boolean`\n Exclude messages marked Low Priority by the user. Default: true. Set to false to include all.\n\n- `includeMuted?: boolean`\n Include messages in chats marked as Muted by the user, which are usually less important. Default: true. Set to false if the user wants a more refined search.\n\n- `limit?: number`\n Maximum number of messages to return.\n\n- `mediaTypes?: 'any' | 'video' | 'image' | 'link' | 'file'[]`\n Filter messages by media types. Use ['any'] for any media type, or specify exact types like ['video', 'image']. Omit for no media filtering.\n\n- `query?: string`\n Literal word search (non-semantic). Finds messages containing these EXACT words in any order. Use single words users actually type, not concepts or phrases. Example: use \"dinner\" not \"dinner plans\", use \"sick\" not \"health issues\". If omitted, returns results filtered only by other parameters.\n\n- `sender?: string`\n Filter by sender: 'me' (messages sent by the authenticated user), 'others' (messages sent by others), or a specific user ID string (user.id).\n\n### Returns\n\n- `{ id: string; accountID: string; chatID: string; senderID: string; sortKey: string; timestamp: string; attachments?: { type: 'unknown' | 'img' | 'video' | 'audio'; id?: string; duration?: number; fileName?: string; fileSize?: number; isGif?: boolean; isSticker?: boolean; isVoiceNote?: boolean; mimeType?: string; posterImg?: string; size?: object; srcURL?: string; }[]; isSender?: boolean; isUnread?: boolean; linkedMessageID?: string; reactions?: { id: string; participantID: string; reactionKey: string; emoji?: boolean; imgURL?: string; }[]; senderName?: string; text?: string; type?: string; }`\n\n - `id: string`\n - `accountID: string`\n - `chatID: string`\n - `senderID: string`\n - `sortKey: string`\n - `timestamp: string`\n - `attachments?: { type: 'unknown' | 'img' | 'video' | 'audio'; id?: string; duration?: number; fileName?: string; fileSize?: number; isGif?: boolean; isSticker?: boolean; isVoiceNote?: boolean; mimeType?: string; posterImg?: string; size?: { height?: number; width?: number; }; srcURL?: string; }[]`\n - `isSender?: boolean`\n - `isUnread?: boolean`\n - `linkedMessageID?: string`\n - `reactions?: { id: string; participantID: string; reactionKey: string; emoji?: boolean; imgURL?: string; }[]`\n - `senderName?: string`\n - `text?: string`\n - `type?: string`\n\n### Example\n\n```typescript\nimport BeeperDesktop from '@beeper/desktop-api';\n\nconst client = new BeeperDesktop();\n\n// Automatically fetches more pages as needed.\nfor await (const message of client.messages.search()) {\n console.log(message);\n}\n```",
perLanguage: {
- cli: {
- method: 'messages search',
- example: 'beeper-desktop-cli messages search',
+ typescript: {
+ method: 'client.messages.search',
+ example:
+ "import BeeperDesktop from '@beeper/desktop-api';\n\nconst client = new BeeperDesktop({\n accessToken: process.env['BEEPER_ACCESS_TOKEN'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const message of client.messages.search()) {\n console.log(message.id);\n}",
+ },
+ python: {
+ method: 'messages.search',
+ example:
+ 'import os\nfrom beeper_desktop_api import BeeperDesktop\n\nclient = BeeperDesktop(\n access_token=os.environ.get("BEEPER_ACCESS_TOKEN"), # This is the default and can be omitted\n)\npage = client.messages.search()\npage = page.items[0]\nprint(page.id)',
},
go: {
method: 'client.Messages.Search',
example:
- 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/beeper/desktop-api-go"\n)\n\nfunc main() {\n\tclient := beeperdesktopapi.NewClient()\n\tpage, err := client.Messages.Search(context.TODO(), beeperdesktopapi.MessageSearchParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n',
+ 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/beeper/desktop-api-go"\n\t"github.com/beeper/desktop-api-go/option"\n)\n\nfunc main() {\n\tclient := beeperdesktopapi.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tpage, err := client.Messages.Search(context.TODO(), beeperdesktopapi.MessageSearchParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n',
},
- http: {
- example: 'curl http://localhost:23373/v1/messages/search',
+ cli: {
+ method: 'messages search',
+ example: "beeper-desktop-cli messages search \\\n --access-token 'My Access Token'",
},
php: {
method: 'messages->search',
example:
- "messages->search(\n accountIDs: [\n 'local-whatsapp_ba_EvYDBBsZbRQAy3UOSWqG0LuTVkc',\n 'local-instagram_ba_eRfQMmnSNy_p7Ih7HL7RduRpKFU',\n ],\n chatIDs: ['!NCdzlIaMjZUmvmvyHU:beeper.com', '1231073'],\n chatType: 'group',\n cursor: '1725489123456|c29tZUltc2dQYWdl',\n dateAfter: new \\DateTimeImmutable('2025-08-01T00:00:00Z'),\n dateBefore: new \\DateTimeImmutable('2025-08-31T23:59:59Z'),\n direction: 'before',\n excludeLowPriority: true,\n includeMuted: true,\n limit: 20,\n mediaTypes: ['any'],\n query: 'dinner',\n sender: 'sender',\n);\n\nvar_dump($page);",
+ "messages->search(\n accountIDs: [\n 'local-whatsapp_ba_EvYDBBsZbRQAy3UOSWqG0LuTVkc',\n 'local-instagram_ba_eRfQMmnSNy_p7Ih7HL7RduRpKFU',\n ],\n chatIDs: ['!NCdzlIaMjZUmvmvyHU:beeper.com', '1231073'],\n chatType: 'group',\n cursor: '1725489123456|c29tZUltc2dQYWdl',\n dateAfter: new \\DateTimeImmutable('2025-08-01T00:00:00Z'),\n dateBefore: new \\DateTimeImmutable('2025-08-31T23:59:59Z'),\n direction: 'before',\n excludeLowPriority: true,\n includeMuted: true,\n limit: 20,\n mediaTypes: ['any'],\n query: 'dinner',\n sender: 'sender',\n);\n\nvar_dump($page);",
},
- python: {
- method: 'messages.search',
- example:
- 'from beeper_desktop_api import BeeperDesktop\n\nclient = BeeperDesktop()\npage = client.messages.search()\npage = page.items[0]\nprint(page.id)',
- },
- typescript: {
- method: 'client.messages.search',
+ http: {
example:
- "import BeeperDesktop from '@beeper/desktop-api';\n\nconst client = new BeeperDesktop();\n\n// Automatically fetches more pages as needed.\nfor await (const message of client.messages.search()) {\n console.log(message.id);\n}",
+ 'curl http://localhost:23373/v1/messages/search \\\n -H "Authorization: Bearer $BEEPER_ACCESS_TOKEN"',
},
},
},
@@ -759,32 +777,34 @@ const EMBEDDED_METHODS: MethodEntry[] = [
markdown:
"## list\n\n`client.messages.list(chatID: string, cursor?: string, direction?: 'after' | 'before'): { id: string; accountID: string; chatID: string; senderID: string; sortKey: string; timestamp: string; attachments?: attachment[]; isSender?: boolean; isUnread?: boolean; linkedMessageID?: string; reactions?: reaction[]; senderName?: string; text?: string; type?: string; }`\n\n**get** `/v1/chats/{chatID}/messages`\n\nList all messages in a chat with cursor-based pagination. Sorted by timestamp.\n\n### Parameters\n\n- `chatID: string`\n Unique identifier of the chat.\n\n- `cursor?: string`\n Opaque pagination cursor; do not inspect. Use together with 'direction'.\n\n- `direction?: 'after' | 'before'`\n Pagination direction used with 'cursor': 'before' fetches older results, 'after' fetches newer results. Defaults to 'before' when only 'cursor' is provided.\n\n### Returns\n\n- `{ id: string; accountID: string; chatID: string; senderID: string; sortKey: string; timestamp: string; attachments?: { type: 'unknown' | 'img' | 'video' | 'audio'; id?: string; duration?: number; fileName?: string; fileSize?: number; isGif?: boolean; isSticker?: boolean; isVoiceNote?: boolean; mimeType?: string; posterImg?: string; size?: object; srcURL?: string; }[]; isSender?: boolean; isUnread?: boolean; linkedMessageID?: string; reactions?: { id: string; participantID: string; reactionKey: string; emoji?: boolean; imgURL?: string; }[]; senderName?: string; text?: string; type?: string; }`\n\n - `id: string`\n - `accountID: string`\n - `chatID: string`\n - `senderID: string`\n - `sortKey: string`\n - `timestamp: string`\n - `attachments?: { type: 'unknown' | 'img' | 'video' | 'audio'; id?: string; duration?: number; fileName?: string; fileSize?: number; isGif?: boolean; isSticker?: boolean; isVoiceNote?: boolean; mimeType?: string; posterImg?: string; size?: { height?: number; width?: number; }; srcURL?: string; }[]`\n - `isSender?: boolean`\n - `isUnread?: boolean`\n - `linkedMessageID?: string`\n - `reactions?: { id: string; participantID: string; reactionKey: string; emoji?: boolean; imgURL?: string; }[]`\n - `senderName?: string`\n - `text?: string`\n - `type?: string`\n\n### Example\n\n```typescript\nimport BeeperDesktop from '@beeper/desktop-api';\n\nconst client = new BeeperDesktop();\n\n// Automatically fetches more pages as needed.\nfor await (const message of client.messages.list('!NCdzlIaMjZUmvmvyHU:beeper.com')) {\n console.log(message);\n}\n```",
perLanguage: {
- cli: {
- method: 'messages list',
- example: "beeper-desktop-cli messages list \\\n --chat-id '!NCdzlIaMjZUmvmvyHU:beeper.com'",
+ typescript: {
+ method: 'client.messages.list',
+ example:
+ "import BeeperDesktop from '@beeper/desktop-api';\n\nconst client = new BeeperDesktop({\n accessToken: process.env['BEEPER_ACCESS_TOKEN'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const message of client.messages.list('!NCdzlIaMjZUmvmvyHU:beeper.com')) {\n console.log(message.id);\n}",
+ },
+ python: {
+ method: 'messages.list',
+ example:
+ 'import os\nfrom beeper_desktop_api import BeeperDesktop\n\nclient = BeeperDesktop(\n access_token=os.environ.get("BEEPER_ACCESS_TOKEN"), # This is the default and can be omitted\n)\npage = client.messages.list(\n chat_id="!NCdzlIaMjZUmvmvyHU:beeper.com",\n)\npage = page.items[0]\nprint(page.id)',
},
go: {
method: 'client.Messages.List',
example:
- 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/beeper/desktop-api-go"\n)\n\nfunc main() {\n\tclient := beeperdesktopapi.NewClient()\n\tpage, err := client.Messages.List(\n\t\tcontext.TODO(),\n\t\t"!NCdzlIaMjZUmvmvyHU:beeper.com",\n\t\tbeeperdesktopapi.MessageListParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n',
+ 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/beeper/desktop-api-go"\n\t"github.com/beeper/desktop-api-go/option"\n)\n\nfunc main() {\n\tclient := beeperdesktopapi.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tpage, err := client.Messages.List(\n\t\tcontext.TODO(),\n\t\t"!NCdzlIaMjZUmvmvyHU:beeper.com",\n\t\tbeeperdesktopapi.MessageListParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n',
},
- http: {
- example: 'curl http://localhost:23373/v1/chats/$CHAT_ID/messages',
+ cli: {
+ method: 'messages list',
+ example:
+ "beeper-desktop-cli messages list \\\n --access-token 'My Access Token' \\\n --chat-id '!NCdzlIaMjZUmvmvyHU:beeper.com'",
},
php: {
method: 'messages->list',
example:
- "messages->list(\n '!NCdzlIaMjZUmvmvyHU:beeper.com',\n cursor: '1725489123456|c29tZUltc2dQYWdl',\n direction: 'before',\n);\n\nvar_dump($page);",
+ "messages->list(\n '!NCdzlIaMjZUmvmvyHU:beeper.com',\n cursor: '1725489123456|c29tZUltc2dQYWdl',\n direction: 'before',\n);\n\nvar_dump($page);",
},
- python: {
- method: 'messages.list',
- example:
- 'from beeper_desktop_api import BeeperDesktop\n\nclient = BeeperDesktop()\npage = client.messages.list(\n chat_id="!NCdzlIaMjZUmvmvyHU:beeper.com",\n)\npage = page.items[0]\nprint(page.id)',
- },
- typescript: {
- method: 'client.messages.list',
+ http: {
example:
- "import BeeperDesktop from '@beeper/desktop-api';\n\nconst client = new BeeperDesktop();\n\n// Automatically fetches more pages as needed.\nfor await (const message of client.messages.list('!NCdzlIaMjZUmvmvyHU:beeper.com')) {\n console.log(message.id);\n}",
+ 'curl http://localhost:23373/v1/chats/$CHAT_ID/messages \\\n -H "Authorization: Bearer $BEEPER_ACCESS_TOKEN"',
},
},
},
@@ -807,32 +827,34 @@ const EMBEDDED_METHODS: MethodEntry[] = [
markdown:
"## send\n\n`client.messages.send(chatID: string, attachment?: { uploadID: string; duration?: number; fileName?: string; mimeType?: string; size?: { height: number; width: number; }; type?: 'gif' | 'voiceNote' | 'sticker'; }, replyToMessageID?: string, text?: string): { chatID: string; pendingMessageID: string; }`\n\n**post** `/v1/chats/{chatID}/messages`\n\nSend a text message to a specific chat. Supports replying to existing messages. Returns a pending message ID.\n\n### Parameters\n\n- `chatID: string`\n Unique identifier of the chat.\n\n- `attachment?: { uploadID: string; duration?: number; fileName?: string; mimeType?: string; size?: { height: number; width: number; }; type?: 'gif' | 'voiceNote' | 'sticker'; }`\n Single attachment to send with the message\n - `uploadID: string`\n Upload ID from uploadAsset endpoint. Required to reference uploaded files.\n - `duration?: number`\n Duration in seconds (optional override of cached value)\n - `fileName?: string`\n Filename (optional override of cached value)\n - `mimeType?: string`\n MIME type (optional override of cached value)\n - `size?: { height: number; width: number; }`\n Dimensions (optional override of cached value)\n - `type?: 'gif' | 'voiceNote' | 'sticker'`\n Special attachment type (gif, voiceNote, sticker). If omitted, auto-detected from mimeType\n\n- `replyToMessageID?: string`\n Provide a message ID to send this as a reply to an existing message\n\n- `text?: string`\n Text content of the message you want to send. You may use markdown.\n\n### Returns\n\n- `{ chatID: string; pendingMessageID: string; }`\n\n - `chatID: string`\n - `pendingMessageID: string`\n\n### Example\n\n```typescript\nimport BeeperDesktop from '@beeper/desktop-api';\n\nconst client = new BeeperDesktop();\n\nconst response = await client.messages.send('!NCdzlIaMjZUmvmvyHU:beeper.com');\n\nconsole.log(response);\n```",
perLanguage: {
- cli: {
- method: 'messages send',
- example: "beeper-desktop-cli messages send \\\n --chat-id '!NCdzlIaMjZUmvmvyHU:beeper.com'",
+ typescript: {
+ method: 'client.messages.send',
+ example:
+ "import BeeperDesktop from '@beeper/desktop-api';\n\nconst client = new BeeperDesktop({\n accessToken: process.env['BEEPER_ACCESS_TOKEN'], // This is the default and can be omitted\n});\n\nconst response = await client.messages.send('!NCdzlIaMjZUmvmvyHU:beeper.com');\n\nconsole.log(response.pendingMessageID);",
+ },
+ python: {
+ method: 'messages.send',
+ example:
+ 'import os\nfrom beeper_desktop_api import BeeperDesktop\n\nclient = BeeperDesktop(\n access_token=os.environ.get("BEEPER_ACCESS_TOKEN"), # This is the default and can be omitted\n)\nresponse = client.messages.send(\n chat_id="!NCdzlIaMjZUmvmvyHU:beeper.com",\n)\nprint(response.pending_message_id)',
},
go: {
method: 'client.Messages.Send',
example:
- 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/beeper/desktop-api-go"\n)\n\nfunc main() {\n\tclient := beeperdesktopapi.NewClient()\n\tresponse, err := client.Messages.Send(\n\t\tcontext.TODO(),\n\t\t"!NCdzlIaMjZUmvmvyHU:beeper.com",\n\t\tbeeperdesktopapi.MessageSendParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.PendingMessageID)\n}\n',
+ 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/beeper/desktop-api-go"\n\t"github.com/beeper/desktop-api-go/option"\n)\n\nfunc main() {\n\tclient := beeperdesktopapi.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tresponse, err := client.Messages.Send(\n\t\tcontext.TODO(),\n\t\t"!NCdzlIaMjZUmvmvyHU:beeper.com",\n\t\tbeeperdesktopapi.MessageSendParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.PendingMessageID)\n}\n',
},
- http: {
- example: 'curl http://localhost:23373/v1/chats/$CHAT_ID/messages \\\n -X POST',
+ cli: {
+ method: 'messages send',
+ example:
+ "beeper-desktop-cli messages send \\\n --access-token 'My Access Token' \\\n --chat-id '!NCdzlIaMjZUmvmvyHU:beeper.com'",
},
php: {
method: 'messages->send',
example:
- "messages->send(\n '!NCdzlIaMjZUmvmvyHU:beeper.com',\n attachment: [\n 'uploadID' => 'uploadID',\n 'duration' => 0,\n 'fileName' => 'fileName',\n 'mimeType' => 'mimeType',\n 'size' => ['height' => 0, 'width' => 0],\n 'type' => 'gif',\n ],\n replyToMessageID: 'replyToMessageID',\n text: 'text',\n);\n\nvar_dump($response);",
- },
- python: {
- method: 'messages.send',
- example:
- 'from beeper_desktop_api import BeeperDesktop\n\nclient = BeeperDesktop()\nresponse = client.messages.send(\n chat_id="!NCdzlIaMjZUmvmvyHU:beeper.com",\n)\nprint(response.pending_message_id)',
+ "messages->send(\n '!NCdzlIaMjZUmvmvyHU:beeper.com',\n attachment: [\n 'uploadID' => 'uploadID',\n 'duration' => 0,\n 'fileName' => 'fileName',\n 'mimeType' => 'mimeType',\n 'size' => ['height' => 0, 'width' => 0],\n 'type' => 'gif',\n ],\n replyToMessageID: 'replyToMessageID',\n text: 'text',\n);\n\nvar_dump($response);",
},
- typescript: {
- method: 'client.messages.send',
+ http: {
example:
- "import BeeperDesktop from '@beeper/desktop-api';\n\nconst client = new BeeperDesktop();\n\nconst response = await client.messages.send('!NCdzlIaMjZUmvmvyHU:beeper.com');\n\nconsole.log(response.pendingMessageID);",
+ 'curl http://localhost:23373/v1/chats/$CHAT_ID/messages \\\n -X POST \\\n -H "Authorization: Bearer $BEEPER_ACCESS_TOKEN"',
},
},
},
@@ -849,34 +871,34 @@ const EMBEDDED_METHODS: MethodEntry[] = [
markdown:
"## update\n\n`client.messages.update(chatID: string, messageID: string, text: string): { chatID: string; messageID: string; success: boolean; }`\n\n**put** `/v1/chats/{chatID}/messages/{messageID}`\n\nEdit the text content of an existing message. Messages with attachments cannot be edited.\n\n### Parameters\n\n- `chatID: string`\n Unique identifier of the chat.\n\n- `messageID: string`\n\n- `text: string`\n New text content for the message\n\n### Returns\n\n- `{ chatID: string; messageID: string; success: boolean; }`\n\n - `chatID: string`\n - `messageID: string`\n - `success: boolean`\n\n### Example\n\n```typescript\nimport BeeperDesktop from '@beeper/desktop-api';\n\nconst client = new BeeperDesktop();\n\nconst message = await client.messages.update('messageID', { chatID: '!NCdzlIaMjZUmvmvyHU:beeper.com', text: 'x' });\n\nconsole.log(message);\n```",
perLanguage: {
- cli: {
- method: 'messages update',
+ typescript: {
+ method: 'client.messages.update',
example:
- "beeper-desktop-cli messages update \\\n --chat-id '!NCdzlIaMjZUmvmvyHU:beeper.com' \\\n --message-id messageID \\\n --text x",
+ "import BeeperDesktop from '@beeper/desktop-api';\n\nconst client = new BeeperDesktop({\n accessToken: process.env['BEEPER_ACCESS_TOKEN'], // This is the default and can be omitted\n});\n\nconst message = await client.messages.update('messageID', {\n chatID: '!NCdzlIaMjZUmvmvyHU:beeper.com',\n text: 'x',\n});\n\nconsole.log(message.chatID);",
+ },
+ python: {
+ method: 'messages.update',
+ example:
+ 'import os\nfrom beeper_desktop_api import BeeperDesktop\n\nclient = BeeperDesktop(\n access_token=os.environ.get("BEEPER_ACCESS_TOKEN"), # This is the default and can be omitted\n)\nmessage = client.messages.update(\n message_id="messageID",\n chat_id="!NCdzlIaMjZUmvmvyHU:beeper.com",\n text="x",\n)\nprint(message.chat_id)',
},
go: {
method: 'client.Messages.Update',
example:
- 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/beeper/desktop-api-go"\n)\n\nfunc main() {\n\tclient := beeperdesktopapi.NewClient()\n\tmessage, err := client.Messages.Update(\n\t\tcontext.TODO(),\n\t\t"messageID",\n\t\tbeeperdesktopapi.MessageUpdateParams{\n\t\t\tChatID: "!NCdzlIaMjZUmvmvyHU:beeper.com",\n\t\t\tText: "x",\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", message.ChatID)\n}\n',
+ 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/beeper/desktop-api-go"\n\t"github.com/beeper/desktop-api-go/option"\n)\n\nfunc main() {\n\tclient := beeperdesktopapi.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tmessage, err := client.Messages.Update(\n\t\tcontext.TODO(),\n\t\t"messageID",\n\t\tbeeperdesktopapi.MessageUpdateParams{\n\t\t\tChatID: "!NCdzlIaMjZUmvmvyHU:beeper.com",\n\t\t\tText: "x",\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", message.ChatID)\n}\n',
},
- http: {
+ cli: {
+ method: 'messages update',
example:
- 'curl http://localhost:23373/v1/chats/$CHAT_ID/messages/$MESSAGE_ID \\\n -X PUT \\\n -H \'Content-Type: application/json\' \\\n -d \'{\n "text": "x"\n }\'',
+ "beeper-desktop-cli messages update \\\n --access-token 'My Access Token' \\\n --chat-id '!NCdzlIaMjZUmvmvyHU:beeper.com' \\\n --message-id messageID \\\n --text x",
},
php: {
method: 'messages->update',
example:
- "messages->update(\n 'messageID', chatID: '!NCdzlIaMjZUmvmvyHU:beeper.com', text: 'x'\n);\n\nvar_dump($message);",
+ "messages->update(\n 'messageID', chatID: '!NCdzlIaMjZUmvmvyHU:beeper.com', text: 'x'\n);\n\nvar_dump($message);",
},
- python: {
- method: 'messages.update',
- example:
- 'from beeper_desktop_api import BeeperDesktop\n\nclient = BeeperDesktop()\nmessage = client.messages.update(\n message_id="messageID",\n chat_id="!NCdzlIaMjZUmvmvyHU:beeper.com",\n text="x",\n)\nprint(message.chat_id)',
- },
- typescript: {
- method: 'client.messages.update',
+ http: {
example:
- "import BeeperDesktop from '@beeper/desktop-api';\n\nconst client = new BeeperDesktop();\n\nconst message = await client.messages.update('messageID', {\n chatID: '!NCdzlIaMjZUmvmvyHU:beeper.com',\n text: 'x',\n});\n\nconsole.log(message.chatID);",
+ 'curl http://localhost:23373/v1/chats/$CHAT_ID/messages/$MESSAGE_ID \\\n -X PUT \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $BEEPER_ACCESS_TOKEN" \\\n -d \'{\n "text": "x"\n }\'',
},
},
},
@@ -894,33 +916,34 @@ const EMBEDDED_METHODS: MethodEntry[] = [
markdown:
"## download\n\n`client.assets.download(url: string): { error?: string; srcURL?: string; }`\n\n**post** `/v1/assets/download`\n\nDownload a Matrix asset using its mxc:// or localmxc:// URL to the device running Beeper Desktop and return the local file URL.\n\n### Parameters\n\n- `url: string`\n Matrix content URL (mxc:// or localmxc://) for the asset to download.\n\n### Returns\n\n- `{ error?: string; srcURL?: string; }`\n\n - `error?: string`\n - `srcURL?: string`\n\n### Example\n\n```typescript\nimport BeeperDesktop from '@beeper/desktop-api';\n\nconst client = new BeeperDesktop();\n\nconst response = await client.assets.download({ url: 'mxc://example.org/Q4x9CqGz1pB3Oa6XgJ' });\n\nconsole.log(response);\n```",
perLanguage: {
- cli: {
- method: 'assets download',
- example: 'beeper-desktop-cli assets download \\\n --url mxc://example.org/Q4x9CqGz1pB3Oa6XgJ',
+ typescript: {
+ method: 'client.assets.download',
+ example:
+ "import BeeperDesktop from '@beeper/desktop-api';\n\nconst client = new BeeperDesktop({\n accessToken: process.env['BEEPER_ACCESS_TOKEN'], // This is the default and can be omitted\n});\n\nconst response = await client.assets.download({ url: 'mxc://example.org/Q4x9CqGz1pB3Oa6XgJ' });\n\nconsole.log(response.error);",
+ },
+ python: {
+ method: 'assets.download',
+ example:
+ 'import os\nfrom beeper_desktop_api import BeeperDesktop\n\nclient = BeeperDesktop(\n access_token=os.environ.get("BEEPER_ACCESS_TOKEN"), # This is the default and can be omitted\n)\nresponse = client.assets.download(\n url="mxc://example.org/Q4x9CqGz1pB3Oa6XgJ",\n)\nprint(response.error)',
},
go: {
method: 'client.Assets.Download',
example:
- 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/beeper/desktop-api-go"\n)\n\nfunc main() {\n\tclient := beeperdesktopapi.NewClient()\n\tresponse, err := client.Assets.Download(context.TODO(), beeperdesktopapi.AssetDownloadParams{\n\t\tURL: "mxc://example.org/Q4x9CqGz1pB3Oa6XgJ",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.Error)\n}\n',
+ 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/beeper/desktop-api-go"\n\t"github.com/beeper/desktop-api-go/option"\n)\n\nfunc main() {\n\tclient := beeperdesktopapi.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tresponse, err := client.Assets.Download(context.TODO(), beeperdesktopapi.AssetDownloadParams{\n\t\tURL: "mxc://example.org/Q4x9CqGz1pB3Oa6XgJ",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.Error)\n}\n',
},
- http: {
+ cli: {
+ method: 'assets download',
example:
- 'curl http://localhost:23373/v1/assets/download \\\n -H \'Content-Type: application/json\' \\\n -d \'{\n "url": "mxc://example.org/Q4x9CqGz1pB3Oa6XgJ"\n }\'',
+ "beeper-desktop-cli assets download \\\n --access-token 'My Access Token' \\\n --url mxc://example.org/Q4x9CqGz1pB3Oa6XgJ",
},
php: {
method: 'assets->download',
example:
- "assets->download(\n url: 'mxc://example.org/Q4x9CqGz1pB3Oa6XgJ'\n);\n\nvar_dump($response);",
+ "assets->download(\n url: 'mxc://example.org/Q4x9CqGz1pB3Oa6XgJ'\n);\n\nvar_dump($response);",
},
- python: {
- method: 'assets.download',
- example:
- 'from beeper_desktop_api import BeeperDesktop\n\nclient = BeeperDesktop()\nresponse = client.assets.download(\n url="mxc://example.org/Q4x9CqGz1pB3Oa6XgJ",\n)\nprint(response.error)',
- },
- typescript: {
- method: 'client.assets.download',
+ http: {
example:
- "import BeeperDesktop from '@beeper/desktop-api';\n\nconst client = new BeeperDesktop();\n\nconst response = await client.assets.download({ url: 'mxc://example.org/Q4x9CqGz1pB3Oa6XgJ' });\n\nconsole.log(response.error);",
+ 'curl http://localhost:23373/v1/assets/download \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $BEEPER_ACCESS_TOKEN" \\\n -d \'{\n "url": "mxc://example.org/Q4x9CqGz1pB3Oa6XgJ"\n }\'',
},
},
},
@@ -939,33 +962,34 @@ const EMBEDDED_METHODS: MethodEntry[] = [
markdown:
"## upload\n\n`client.assets.upload(file: string, fileName?: string, mimeType?: string): { duration?: number; error?: string; fileName?: string; fileSize?: number; height?: number; mimeType?: string; srcURL?: string; uploadID?: string; width?: number; }`\n\n**post** `/v1/assets/upload`\n\nUpload a file to a temporary location using multipart/form-data. Returns an uploadID that can be referenced when sending messages with attachments.\n\n### Parameters\n\n- `file: string`\n The file to upload (max 500 MB).\n\n- `fileName?: string`\n Original filename. Defaults to the uploaded file name if omitted\n\n- `mimeType?: string`\n MIME type. Auto-detected from magic bytes if omitted\n\n### Returns\n\n- `{ duration?: number; error?: string; fileName?: string; fileSize?: number; height?: number; mimeType?: string; srcURL?: string; uploadID?: string; width?: number; }`\n\n - `duration?: number`\n - `error?: string`\n - `fileName?: string`\n - `fileSize?: number`\n - `height?: number`\n - `mimeType?: string`\n - `srcURL?: string`\n - `uploadID?: string`\n - `width?: number`\n\n### Example\n\n```typescript\nimport BeeperDesktop from '@beeper/desktop-api';\n\nconst client = new BeeperDesktop();\n\nconst response = await client.assets.upload({ file: fs.createReadStream('path/to/file') });\n\nconsole.log(response);\n```",
perLanguage: {
- cli: {
- method: 'assets upload',
- example: "beeper-desktop-cli assets upload \\\n --file 'Example data'",
+ typescript: {
+ method: 'client.assets.upload',
+ example:
+ "import fs from 'fs';\nimport BeeperDesktop from '@beeper/desktop-api';\n\nconst client = new BeeperDesktop({\n accessToken: process.env['BEEPER_ACCESS_TOKEN'], // This is the default and can be omitted\n});\n\nconst response = await client.assets.upload({ file: fs.createReadStream('path/to/file') });\n\nconsole.log(response.width);",
+ },
+ python: {
+ method: 'assets.upload',
+ example:
+ 'import os\nfrom beeper_desktop_api import BeeperDesktop\n\nclient = BeeperDesktop(\n access_token=os.environ.get("BEEPER_ACCESS_TOKEN"), # This is the default and can be omitted\n)\nresponse = client.assets.upload(\n file=b"Example data",\n)\nprint(response.width)',
},
go: {
method: 'client.Assets.Upload',
example:
- 'package main\n\nimport (\n\t"bytes"\n\t"context"\n\t"fmt"\n\t"io"\n\n\t"github.com/beeper/desktop-api-go"\n)\n\nfunc main() {\n\tclient := beeperdesktopapi.NewClient()\n\tresponse, err := client.Assets.Upload(context.TODO(), beeperdesktopapi.AssetUploadParams{\n\t\tFile: io.Reader(bytes.NewBuffer([]byte("Example data"))),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.Width)\n}\n',
+ 'package main\n\nimport (\n\t"bytes"\n\t"context"\n\t"fmt"\n\t"io"\n\n\t"github.com/beeper/desktop-api-go"\n\t"github.com/beeper/desktop-api-go/option"\n)\n\nfunc main() {\n\tclient := beeperdesktopapi.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tresponse, err := client.Assets.Upload(context.TODO(), beeperdesktopapi.AssetUploadParams{\n\t\tFile: io.Reader(bytes.NewBuffer([]byte("Example data"))),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.Width)\n}\n',
},
- http: {
+ cli: {
+ method: 'assets upload',
example:
- "curl http://localhost:23373/v1/assets/upload \\\n -H 'Content-Type: multipart/form-data' \\\n -F 'file=@/path/to/file'",
+ "beeper-desktop-cli assets upload \\\n --access-token 'My Access Token' \\\n --file 'Example data'",
},
php: {
method: 'assets->upload',
example:
- "assets->upload(\n file: 'file', fileName: 'fileName', mimeType: 'mimeType'\n);\n\nvar_dump($response);",
- },
- python: {
- method: 'assets.upload',
- example:
- 'from beeper_desktop_api import BeeperDesktop\n\nclient = BeeperDesktop()\nresponse = client.assets.upload(\n file=b"Example data",\n)\nprint(response.width)',
+ "assets->upload(\n file: FileParam::fromString('Example data', filename: uniqid('file-upload-', true)),\n fileName: 'fileName',\n mimeType: 'mimeType',\n);\n\nvar_dump($response);",
},
- typescript: {
- method: 'client.assets.upload',
+ http: {
example:
- "import BeeperDesktop from '@beeper/desktop-api';\n\nconst client = new BeeperDesktop();\n\nconst response = await client.assets.upload({ file: fs.createReadStream('path/to/file') });\n\nconsole.log(response.width);",
+ "curl http://localhost:23373/v1/assets/upload \\\n -H 'Content-Type: multipart/form-data' \\\n -H \"Authorization: Bearer $BEEPER_ACCESS_TOKEN\" \\\n -F 'file=@/path/to/file'",
},
},
},
@@ -984,33 +1008,34 @@ const EMBEDDED_METHODS: MethodEntry[] = [
markdown:
"## upload_base64\n\n`client.assets.uploadBase64(content: string, fileName?: string, mimeType?: string): { duration?: number; error?: string; fileName?: string; fileSize?: number; height?: number; mimeType?: string; srcURL?: string; uploadID?: string; width?: number; }`\n\n**post** `/v1/assets/upload/base64`\n\nUpload a file using a JSON body with base64-encoded content. Returns an uploadID that can be referenced when sending messages with attachments. Alternative to the multipart upload endpoint.\n\n### Parameters\n\n- `content: string`\n Base64-encoded file content (max ~500MB decoded)\n\n- `fileName?: string`\n Original filename. Generated if omitted\n\n- `mimeType?: string`\n MIME type. Auto-detected from magic bytes if omitted\n\n### Returns\n\n- `{ duration?: number; error?: string; fileName?: string; fileSize?: number; height?: number; mimeType?: string; srcURL?: string; uploadID?: string; width?: number; }`\n\n - `duration?: number`\n - `error?: string`\n - `fileName?: string`\n - `fileSize?: number`\n - `height?: number`\n - `mimeType?: string`\n - `srcURL?: string`\n - `uploadID?: string`\n - `width?: number`\n\n### Example\n\n```typescript\nimport BeeperDesktop from '@beeper/desktop-api';\n\nconst client = new BeeperDesktop();\n\nconst response = await client.assets.uploadBase64({ content: 'x' });\n\nconsole.log(response);\n```",
perLanguage: {
- cli: {
- method: 'assets upload_base64',
- example: 'beeper-desktop-cli assets upload-base64 \\\n --content x',
+ typescript: {
+ method: 'client.assets.uploadBase64',
+ example:
+ "import BeeperDesktop from '@beeper/desktop-api';\n\nconst client = new BeeperDesktop({\n accessToken: process.env['BEEPER_ACCESS_TOKEN'], // This is the default and can be omitted\n});\n\nconst response = await client.assets.uploadBase64({ content: 'x' });\n\nconsole.log(response.width);",
+ },
+ python: {
+ method: 'assets.upload_base64',
+ example:
+ 'import os\nfrom beeper_desktop_api import BeeperDesktop\n\nclient = BeeperDesktop(\n access_token=os.environ.get("BEEPER_ACCESS_TOKEN"), # This is the default and can be omitted\n)\nresponse = client.assets.upload_base64(\n content="x",\n)\nprint(response.width)',
},
go: {
method: 'client.Assets.UploadBase64',
example:
- 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/beeper/desktop-api-go"\n)\n\nfunc main() {\n\tclient := beeperdesktopapi.NewClient()\n\tresponse, err := client.Assets.UploadBase64(context.TODO(), beeperdesktopapi.AssetUploadBase64Params{\n\t\tContent: "x",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.Width)\n}\n',
+ 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/beeper/desktop-api-go"\n\t"github.com/beeper/desktop-api-go/option"\n)\n\nfunc main() {\n\tclient := beeperdesktopapi.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tresponse, err := client.Assets.UploadBase64(context.TODO(), beeperdesktopapi.AssetUploadBase64Params{\n\t\tContent: "x",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.Width)\n}\n',
},
- http: {
+ cli: {
+ method: 'assets upload_base64',
example:
- 'curl http://localhost:23373/v1/assets/upload/base64 \\\n -H \'Content-Type: application/json\' \\\n -d \'{\n "content": "x"\n }\'',
+ "beeper-desktop-cli assets upload-base64 \\\n --access-token 'My Access Token' \\\n --content x",
},
php: {
method: 'assets->uploadBase64',
example:
- "assets->uploadBase64(\n content: 'x', fileName: 'fileName', mimeType: 'mimeType'\n);\n\nvar_dump($response);",
+ "assets->uploadBase64(\n content: 'x', fileName: 'fileName', mimeType: 'mimeType'\n);\n\nvar_dump($response);",
},
- python: {
- method: 'assets.upload_base64',
- example:
- 'from beeper_desktop_api import BeeperDesktop\n\nclient = BeeperDesktop()\nresponse = client.assets.upload_base64(\n content="x",\n)\nprint(response.width)',
- },
- typescript: {
- method: 'client.assets.uploadBase64',
+ http: {
example:
- "import BeeperDesktop from '@beeper/desktop-api';\n\nconst client = new BeeperDesktop();\n\nconst response = await client.assets.uploadBase64({ content: 'x' });\n\nconsole.log(response.width);",
+ 'curl http://localhost:23373/v1/assets/upload/base64 \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $BEEPER_ACCESS_TOKEN" \\\n -d \'{\n "content": "x"\n }\'',
},
},
},
@@ -1024,35 +1049,37 @@ const EMBEDDED_METHODS: MethodEntry[] = [
stainlessPath: '(resource) assets > (method) serve',
qualified: 'client.assets.serve',
params: ['url: string;'],
+ response: 'string',
markdown:
- "## serve\n\n`client.assets.serve(url: string): void`\n\n**get** `/v1/assets/serve`\n\nStream a file given an mxc://, localmxc://, or file:// URL. Downloads first if not cached. Supports Range requests for seeking in large files.\n\n### Parameters\n\n- `url: string`\n Asset URL to serve. Accepts mxc://, localmxc://, or file:// URLs.\n\n### Example\n\n```typescript\nimport BeeperDesktop from '@beeper/desktop-api';\n\nconst client = new BeeperDesktop();\n\nawait client.assets.serve({ url: 'x' })\n```",
+ "## serve\n\n`client.assets.serve(url: string): string`\n\n**get** `/v1/assets/serve`\n\nStream a file given an mxc://, localmxc://, or file:// URL. Downloads first if not cached. Supports Range requests for seeking in large files.\n\n### Parameters\n\n- `url: string`\n Asset URL to serve. Accepts mxc://, localmxc://, or file:// URLs.\n\n### Returns\n\n- `string`\n\n### Example\n\n```typescript\nimport BeeperDesktop from '@beeper/desktop-api';\n\nconst client = new BeeperDesktop();\n\nconst response = await client.assets.serve({ url: 'x' });\n\nconsole.log(response);\n\nconst content = await response.blob()\nconsole.log(content)\n```",
perLanguage: {
- cli: {
- method: 'assets serve',
- example: 'beeper-desktop-cli assets serve \\\n --url x',
+ typescript: {
+ method: 'client.assets.serve',
+ example:
+ "import BeeperDesktop from '@beeper/desktop-api';\n\nconst client = new BeeperDesktop({\n accessToken: process.env['BEEPER_ACCESS_TOKEN'], // This is the default and can be omitted\n});\n\nconst response = await client.assets.serve({ url: 'x' });\n\nconsole.log(response);\n\nconst content = await response.blob();\nconsole.log(content);",
+ },
+ python: {
+ method: 'assets.serve',
+ example:
+ 'import os\nfrom beeper_desktop_api import BeeperDesktop\n\nclient = BeeperDesktop(\n access_token=os.environ.get("BEEPER_ACCESS_TOKEN"), # This is the default and can be omitted\n)\nresponse = client.assets.serve(\n url="x",\n)\nprint(response)\ncontent = response.read()\nprint(content)',
},
go: {
method: 'client.Assets.Serve',
example:
- 'package main\n\nimport (\n\t"context"\n\n\t"github.com/beeper/desktop-api-go"\n)\n\nfunc main() {\n\tclient := beeperdesktopapi.NewClient()\n\terr := client.Assets.Serve(context.TODO(), beeperdesktopapi.AssetServeParams{\n\t\tURL: "x",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n',
+ 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/beeper/desktop-api-go"\n\t"github.com/beeper/desktop-api-go/option"\n)\n\nfunc main() {\n\tclient := beeperdesktopapi.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tresponse, err := client.Assets.Serve(context.TODO(), beeperdesktopapi.AssetServeParams{\n\t\tURL: "x",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response)\n}\n',
},
- http: {
- example: 'curl http://localhost:23373/v1/assets/serve',
+ cli: {
+ method: 'assets serve',
+ example: "beeper-desktop-cli assets serve \\\n --access-token 'My Access Token' \\\n --url x",
},
php: {
method: 'assets->serve',
example:
- "assets->serve(url: 'x');\n\nvar_dump($result);",
+ "assets->serve(url: 'x');\n\nvar_dump($response);",
},
- python: {
- method: 'assets.serve',
- example:
- 'from beeper_desktop_api import BeeperDesktop\n\nclient = BeeperDesktop()\nclient.assets.serve(\n url="x",\n)',
- },
- typescript: {
- method: 'client.assets.serve',
+ http: {
example:
- "import BeeperDesktop from '@beeper/desktop-api';\n\nconst client = new BeeperDesktop();\n\nawait client.assets.serve({ url: 'x' });",
+ 'curl http://localhost:23373/v1/assets/serve \\\n -H "Authorization: Bearer $BEEPER_ACCESS_TOKEN"',
},
},
},
@@ -1070,33 +1097,33 @@ const EMBEDDED_METHODS: MethodEntry[] = [
markdown:
"## retrieve\n\n`client.info.retrieve(): { app: object; endpoints: object; platform: object; server: object; }`\n\n**get** `/v1/info`\n\nReturns app, platform, server, and endpoint discovery metadata for this Beeper Desktop instance.\n\n### Returns\n\n- `{ app: { bundle_id: string; name: string; version: string; }; endpoints: { mcp: string; oauth: { authorization_endpoint: string; introspection_endpoint: string; registration_endpoint: string; revocation_endpoint: string; token_endpoint: string; userinfo_endpoint: string; }; spec: string; ws_events: string; }; platform: { arch: string; os: string; release?: string; }; server: { base_url: string; hostname: string; mcp_enabled: boolean; port: number; remote_access: boolean; status: string; }; }`\n\n - `app: { bundle_id: string; name: string; version: string; }`\n - `endpoints: { mcp: string; oauth: { authorization_endpoint: string; introspection_endpoint: string; registration_endpoint: string; revocation_endpoint: string; token_endpoint: string; userinfo_endpoint: string; }; spec: string; ws_events: string; }`\n - `platform: { arch: string; os: string; release?: string; }`\n - `server: { base_url: string; hostname: string; mcp_enabled: boolean; port: number; remote_access: boolean; status: string; }`\n\n### Example\n\n```typescript\nimport BeeperDesktop from '@beeper/desktop-api';\n\nconst client = new BeeperDesktop();\n\nconst info = await client.info.retrieve();\n\nconsole.log(info);\n```",
perLanguage: {
- cli: {
- method: 'info retrieve',
- example: "beeper-desktop-cli info retrieve \\\n --access-token 'My Access Token'",
+ typescript: {
+ method: 'client.info.retrieve',
+ example:
+ "import BeeperDesktop from '@beeper/desktop-api';\n\nconst client = new BeeperDesktop();\n\nconst info = await client.info.retrieve();\n\nconsole.log(info.app);",
+ },
+ python: {
+ method: 'info.retrieve',
+ example:
+ 'from beeper_desktop_api import BeeperDesktop\n\nclient = BeeperDesktop()\ninfo = client.info.retrieve()\nprint(info.app)',
},
go: {
method: 'client.Info.Get',
example:
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/beeper/desktop-api-go"\n\t"github.com/beeper/desktop-api-go/option"\n)\n\nfunc main() {\n\tclient := beeperdesktopapi.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tinfo, err := client.Info.Get(context.TODO())\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", info.App)\n}\n',
},
- http: {
- example:
- 'curl http://localhost:23373/v1/info \\\n -H "Authorization: Bearer $BEEPER_ACCESS_TOKEN"',
+ cli: {
+ method: 'info retrieve',
+ example: "beeper-desktop-cli info retrieve \\\n --access-token 'My Access Token'",
},
php: {
method: 'info->retrieve',
example:
"info->retrieve();\n\nvar_dump($info);",
},
- python: {
- method: 'info.retrieve',
- example:
- 'from beeper_desktop_api import BeeperDesktop\n\nclient = BeeperDesktop()\ninfo = client.info.retrieve()\nprint(info.app)',
- },
- typescript: {
- method: 'client.info.retrieve',
+ http: {
example:
- "import BeeperDesktop from '@beeper/desktop-api';\n\nconst client = new BeeperDesktop();\n\nconst info = await client.info.retrieve();\n\nconsole.log(info.app);",
+ 'curl http://localhost:23373/v1/info \\\n -H "Authorization: Bearer $BEEPER_ACCESS_TOKEN"',
},
},
},
@@ -1104,29 +1131,29 @@ const EMBEDDED_METHODS: MethodEntry[] = [
const EMBEDDED_READMES: { language: string; content: string }[] = [
{
- language: 'python',
+ language: 'cli',
content:
- '# Beeper Desktop Python API library\n\n\n[)](https://pypi.org/project/beeper_desktop_api/)\n\nThe Beeper Desktop Python library provides convenient access to the Beeper Desktop REST API from any Python 3.9+\napplication. The library includes type definitions for all request params and response fields,\nand offers both synchronous and asynchronous clients powered by [httpx](https://github.com/encode/httpx).\n\n\n\nIt is generated with [Stainless](https://www.stainless.com/).\n\n## MCP Server\n\nUse the Beeper Desktop MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.\n\n[](https://cursor.com/en-US/install-mcp?name=%40beeper%2Fdesktop-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBiZWVwZXIvZGVza3RvcC1tY3AiXSwiZW52Ijp7IkJFRVBFUl9BQ0NFU1NfVE9LRU4iOiJNeSBBY2Nlc3MgVG9rZW4ifX0)\n[](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22%40beeper%2Fdesktop-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40beeper%2Fdesktop-mcp%22%5D%2C%22env%22%3A%7B%22BEEPER_ACCESS_TOKEN%22%3A%22My%20Access%20Token%22%7D%7D)\n\n> Note: You may need to set environment variables in your MCP client.\n\n## Documentation\n\nThe REST API documentation can be found on [developers.beeper.com](https://developers.beeper.com/desktop-api/). The full API of this library can be found in [api.md](api.md).\n\n## Installation\n\n```sh\n# install from PyPI\npip install beeper_desktop_api\n```\n\n## Usage\n\nThe full API of this library can be found in [api.md](api.md).\n\n```python\nfrom beeper_desktop_api import BeeperDesktop\n\nclient = BeeperDesktop()\n\npage = client.chats.search(\n include_muted=True,\n limit=3,\n type="single",\n)\nprint(page.items)\n```\n\nWhile you can provide a `access_token` keyword argument,\nwe recommend using [python-dotenv](https://pypi.org/project/python-dotenv/)\nto add `BEEPER_ACCESS_TOKEN="My Access Token"` to your `.env` file\nso that your Access Token is not stored in source control.\n\n## Async usage\n\nSimply import `AsyncBeeperDesktop` instead of `BeeperDesktop` and use `await` with each API call:\n\n```python\nimport asyncio\nfrom beeper_desktop_api import AsyncBeeperDesktop\n\nclient = AsyncBeeperDesktop()\n\nasync def main() -> None:\n page = await client.chats.search(\n include_muted=True,\n limit=3,\n type="single",\n )\n print(page.items)\n\nasyncio.run(main())\n```\n\nFunctionality between the synchronous and asynchronous clients is otherwise identical.\n\n### With aiohttp\n\nBy default, the async client uses `httpx` for HTTP requests. However, for improved concurrency performance you may also use `aiohttp` as the HTTP backend.\n\nYou can enable this by installing `aiohttp`:\n\n```sh\n# install from PyPI\npip install beeper_desktop_api[aiohttp]\n```\n\nThen you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`:\n\n```python\nimport asyncio\nfrom beeper_desktop_api import DefaultAioHttpClient\nfrom beeper_desktop_api import AsyncBeeperDesktop\n\nasync def main() -> None:\n async with AsyncBeeperDesktop(\n http_client=DefaultAioHttpClient(),\n) as client:\n page = await client.chats.search(\n include_muted=True,\n limit=3,\n type="single",\n )\n print(page.items)\n\nasyncio.run(main())\n```\n\n\n\n## Using types\n\nNested request parameters are [TypedDicts](https://docs.python.org/3/library/typing.html#typing.TypedDict). Responses are [Pydantic models](https://docs.pydantic.dev) which also provide helper methods for things like:\n\n- Serializing back into JSON, `model.to_json()`\n- Converting to a dictionary, `model.to_dict()`\n\nTyped requests and responses provide autocomplete and documentation within your editor. If you would like to see type errors in VS Code to help catch bugs earlier, set `python.analysis.typeCheckingMode` to `basic`.\n\n## Pagination\n\nList methods in the Beeper Desktop API are paginated.\n\nThis library provides auto-paginating iterators with each list response, so you do not have to request successive pages manually:\n\n```python\nfrom beeper_desktop_api import BeeperDesktop\n\nclient = BeeperDesktop()\n\nall_messages = []\n# Automatically fetches more pages as needed.\nfor message in client.messages.search(\n account_ids=["local-telegram_ba_QFrb5lrLPhO3OT5MFBeTWv0x4BI"],\n limit=10,\n query="deployment",\n):\n # Do something with message here\n all_messages.append(message)\nprint(all_messages)\n```\n\nOr, asynchronously:\n\n```python\nimport asyncio\nfrom beeper_desktop_api import AsyncBeeperDesktop\n\nclient = AsyncBeeperDesktop()\n\nasync def main() -> None:\n all_messages = []\n # Iterate through items across all pages, issuing requests as needed.\n async for message in client.messages.search(\n account_ids=["local-telegram_ba_QFrb5lrLPhO3OT5MFBeTWv0x4BI"],\n limit=10,\n query="deployment",\n):\n all_messages.append(message)\n print(all_messages)\n\nasyncio.run(main())\n```\n\nAlternatively, you can use the `.has_next_page()`, `.next_page_info()`, or `.get_next_page()` methods for more granular control working with pages:\n\n```python\nfirst_page = await client.messages.search(\n account_ids=["local-telegram_ba_QFrb5lrLPhO3OT5MFBeTWv0x4BI"],\n limit=10,\n query="deployment",\n)\nif first_page.has_next_page():\n print(f"will fetch next page using these details: {first_page.next_page_info()}")\n next_page = await first_page.get_next_page()\n print(f"number of items we just fetched: {len(next_page.items)}")\n\n# Remove `await` for non-async usage.\n```\n\nOr just work directly with the returned data:\n\n```python\nfirst_page = await client.messages.search(\n account_ids=["local-telegram_ba_QFrb5lrLPhO3OT5MFBeTWv0x4BI"],\n limit=10,\n query="deployment",\n)\n\nprint(f"next page cursor: {first_page.oldest_cursor}") # => "next page cursor: ..."\nfor message in first_page.items:\n print(message.id)\n\n# Remove `await` for non-async usage.\n```\n\n## Nested params\n\nNested parameters are dictionaries, typed using `TypedDict`, for example:\n\n```python\nfrom beeper_desktop_api import BeeperDesktop\n\nclient = BeeperDesktop()\n\nchat = client.chats.create(\n account_id="accountID",\n user={},\n)\nprint(chat.user)\n```\n\n## File uploads\n\nRequest parameters that correspond to file uploads can be passed as `bytes`, or a [`PathLike`](https://docs.python.org/3/library/os.html#os.PathLike) instance or a tuple of `(filename, contents, media type)`.\n\n```python\nfrom pathlib import Path\nfrom beeper_desktop_api import BeeperDesktop\n\nclient = BeeperDesktop()\n\nclient.assets.upload(\n file=Path("/path/to/file"),\n)\n```\n\nThe async client uses the exact same interface. If you pass a [`PathLike`](https://docs.python.org/3/library/os.html#os.PathLike) instance, the file contents will be read asynchronously automatically.\n\n## Handling errors\n\nWhen the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `beeper_desktop_api.APIConnectionError` is raised.\n\nWhen the API returns a non-success status code (that is, 4xx or 5xx\nresponse), a subclass of `beeper_desktop_api.APIStatusError` is raised, containing `status_code` and `response` properties.\n\nAll errors inherit from `beeper_desktop_api.APIError`.\n\n```python\nimport beeper_desktop_api\nfrom beeper_desktop_api import BeeperDesktop\n\nclient = BeeperDesktop()\n\ntry:\n client.accounts.list()\nexcept beeper_desktop_api.APIConnectionError as e:\n print("The server could not be reached")\n print(e.__cause__) # an underlying Exception, likely raised within httpx.\nexcept beeper_desktop_api.RateLimitError as e:\n print("A 429 status code was received; we should back off a bit.")\nexcept beeper_desktop_api.APIStatusError as e:\n print("Another non-200-range status code was received")\n print(e.status_code)\n print(e.response)\n```\n\nError codes are as follows:\n\n| Status Code | Error Type |\n| ----------- | -------------------------- |\n| 400 | `BadRequestError` |\n| 401 | `AuthenticationError` |\n| 403 | `PermissionDeniedError` |\n| 404 | `NotFoundError` |\n| 422 | `UnprocessableEntityError` |\n| 429 | `RateLimitError` |\n| >=500 | `InternalServerError` |\n| N/A | `APIConnectionError` |\n\n### Retries\n\nCertain errors are automatically retried 2 times by default, with a short exponential backoff.\nConnection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict,\n429 Rate Limit, and >=500 Internal errors are all retried by default.\n\nYou can use the `max_retries` option to configure or disable retry settings:\n\n```python\nfrom beeper_desktop_api import BeeperDesktop\n\n# Configure the default for all requests:\nclient = BeeperDesktop(\n # default is 2\n max_retries=0,\n)\n\n# Or, configure per-request:\nclient.with_options(max_retries = 5).accounts.list()\n```\n\n### Timeouts\n\nBy default requests time out after 30 seconds. You can configure this with a `timeout` option,\nwhich accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/timeouts/#fine-tuning-the-configuration) object:\n\n```python\nfrom beeper_desktop_api import BeeperDesktop\n\n# Configure the default for all requests:\nclient = BeeperDesktop(\n # 20 seconds (default is 30 seconds)\n timeout=20.0,\n)\n\n# More granular control:\nclient = BeeperDesktop(\n timeout=httpx.Timeout(60.0, read=5.0, write=10.0, connect=2.0),\n)\n\n# Override per-request:\nclient.with_options(timeout = 5.0).accounts.list()\n```\n\nOn timeout, an `APITimeoutError` is thrown.\n\nNote that requests that time out are [retried twice by default](#retries).\n\n\n\n## Advanced\n\n### Logging\n\nWe use the standard library [`logging`](https://docs.python.org/3/library/logging.html) module.\n\nYou can enable logging by setting the environment variable `BEEPER_DESKTOP_LOG` to `info`.\n\n```shell\n$ export BEEPER_DESKTOP_LOG=info\n```\n\nOr to `debug` for more verbose logging.\n\n### How to tell whether `None` means `null` or missing\n\nIn an API response, a field may be explicitly `null`, or missing entirely; in either case, its value is `None` in this library. You can differentiate the two cases with `.model_fields_set`:\n\n```py\nif response.my_field is None:\n if \'my_field\' not in response.model_fields_set:\n print(\'Got json like {}, without a "my_field" key present at all.\')\n else:\n print(\'Got json like {"my_field": null}.\')\n```\n\n### Accessing raw response data (e.g. headers)\n\nThe "raw" Response object can be accessed by prefixing `.with_raw_response.` to any HTTP method call, e.g.,\n\n```py\nfrom beeper_desktop_api import BeeperDesktop\n\nclient = BeeperDesktop()\nresponse = client.accounts.with_raw_response.list()\nprint(response.headers.get(\'X-My-Header\'))\n\naccount = response.parse() # get the object that `accounts.list()` would have returned\nprint(account)\n```\n\nThese methods return an [`APIResponse`](https://github.com/beeper/desktop-api-python/tree/main/src/beeper_desktop_api/_response.py) object.\n\nThe async client returns an [`AsyncAPIResponse`](https://github.com/beeper/desktop-api-python/tree/main/src/beeper_desktop_api/_response.py) with the same structure, the only difference being `await`able methods for reading the response content.\n\n#### `.with_streaming_response`\n\nThe above interface eagerly reads the full response body when you make the request, which may not always be what you want.\n\nTo stream the response body, use `.with_streaming_response` instead, which requires a context manager and only reads the response body once you call `.read()`, `.text()`, `.json()`, `.iter_bytes()`, `.iter_text()`, `.iter_lines()` or `.parse()`. In the async client, these are async methods.\n\n```python\nwith client.accounts.with_streaming_response.list() as response :\n print(response.headers.get(\'X-My-Header\'))\n\n for line in response.iter_lines():\n print(line)\n```\n\nThe context manager is required so that the response will reliably be closed.\n\n### Making custom/undocumented requests\n\nThis library is typed for convenient access to the documented API.\n\nIf you need to access undocumented endpoints, params, or response properties, the library can still be used.\n\n#### Undocumented endpoints\n\nTo make requests to undocumented endpoints, you can make requests using `client.get`, `client.post`, and other\nhttp verbs. Options on the client will be respected (such as retries) when making this request.\n\n```py\nimport httpx\n\nresponse = client.post(\n "/foo",\n cast_to=httpx.Response,\n body={"my_param": True},\n)\n\nprint(response.headers.get("x-foo"))\n```\n\n#### Undocumented request params\n\nIf you want to explicitly send an extra param, you can do so with the `extra_query`, `extra_body`, and `extra_headers` request\noptions.\n\n#### Undocumented response properties\n\nTo access undocumented response properties, you can access the extra fields like `response.unknown_prop`. You\ncan also get all the extra fields on the Pydantic model as a dict with\n[`response.model_extra`](https://docs.pydantic.dev/latest/api/base_model/#pydantic.BaseModel.model_extra).\n\n### Configuring the HTTP client\n\nYou can directly override the [httpx client](https://www.python-httpx.org/api/#client) to customize it for your use case, including:\n\n- Support for [proxies](https://www.python-httpx.org/advanced/proxies/)\n- Custom [transports](https://www.python-httpx.org/advanced/transports/)\n- Additional [advanced](https://www.python-httpx.org/advanced/clients/) functionality\n\n```python\nimport httpx\nfrom beeper_desktop_api import BeeperDesktop, DefaultHttpxClient\n\nclient = BeeperDesktop(\n # Or use the `BEEPER_DESKTOP_BASE_URL` env var\n base_url="http://my.test.server.example.com:8083",\n http_client=DefaultHttpxClient(proxy="http://my.test.proxy.example.com", transport=httpx.HTTPTransport(local_address="0.0.0.0")),\n)\n```\n\nYou can also customize the client on a per-request basis by using `with_options()`:\n\n```python\nclient.with_options(http_client=DefaultHttpxClient(...))\n```\n\n### Managing HTTP resources\n\nBy default the library closes underlying HTTP connections whenever the client is [garbage collected](https://docs.python.org/3/reference/datamodel.html#object.__del__). You can manually close the client using the `.close()` method if desired, or with a context manager that closes when exiting.\n\n```py\nfrom beeper_desktop_api import BeeperDesktop\n\nwith BeeperDesktop() as client:\n # make requests here\n ...\n\n# HTTP client is now closed\n```\n\n## Versioning\n\nThis package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:\n\n1. Changes that only affect static types, without breaking runtime behavior.\n2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_\n3. Changes that we do not expect to impact the vast majority of users in practice.\n\nWe take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.\n\nWe are keen for your feedback; please open an [issue](https://www.github.com/beeper/desktop-api-python/issues) with questions, bugs, or suggestions.\n\n### Determining the installed version\n\nIf you\'ve upgraded to the latest version but aren\'t seeing any new features you were expecting then your python environment is likely still using an older version.\n\nYou can determine the version that is being used at runtime with:\n\n```py\nimport beeper_desktop_api\nprint(beeper_desktop_api.__version__)\n```\n\n## Requirements\n\nPython 3.9 or higher.\n\n## Contributing\n\nSee [the contributing documentation](./CONTRIBUTING.md).\n',
+ "# Beeper Desktop CLI\n\nThe official CLI for the [Beeper Desktop REST API](https://developers.beeper.com/desktop-api/).\n\n\n\n## Installation\n\n### Installing with Homebrew\n\n~~~sh\nbrew install beeper/tap/beeper-desktop-cli\n~~~\n\n### Installing with Go\n\nTo test or install the CLI locally, you need [Go](https://go.dev/doc/install) version 1.22 or later installed.\n\n~~~sh\ngo install 'github.com/beeper/desktop-api-cli/cmd/beeper-desktop-cli@latest'\n~~~\n\nOnce you have run `go install`, the binary is placed in your Go bin directory:\n\n- **Default location**: `$HOME/go/bin` (or `$GOPATH/bin` if GOPATH is set)\n- **Check your path**: Run `go env GOPATH` to see the base directory\n\nIf commands aren't found after installation, add the Go bin directory to your PATH:\n\n~~~sh\n# Add to your shell profile (.zshrc, .bashrc, etc.)\nexport PATH=\"$PATH:$(go env GOPATH)/bin\"\n~~~\n\n\n\n### Running Locally\n\nAfter cloning the git repository for this project, you can use the\n`scripts/run` script to run the tool locally:\n\n~~~sh\n./scripts/run args...\n~~~\n\n## Usage\n\nThe CLI follows a resource-based command structure:\n\n~~~sh\nbeeper-desktop-cli [resource] [flags...]\n~~~\n\n~~~sh\nbeeper-desktop-cli chats search \\\n --access-token 'My Access Token' \\\n --include-muted \\\n --limit 3 \\\n --type single\n~~~\n\nFor details about specific commands, use the `--help` flag.\n\n### Environment variables\n\n| Environment variable | Description | Required |\n| --------------------- | ----------------------------------------------------------------------------------------------------- | -------- |\n| `BEEPER_ACCESS_TOKEN` | Bearer access token obtained via OAuth2 PKCE flow or created in-app. Required for all API operations. | yes |\n\n### Global flags\n\n- `--access-token` - Bearer access token obtained via OAuth2 PKCE flow or created in-app. Required for all API operations. (can also be set with `BEEPER_ACCESS_TOKEN` env var)\n- `--help` - Show command line usage\n- `--debug` - Enable debug logging (includes HTTP request/response details)\n- `--version`, `-v` - Show the CLI version\n- `--base-url` - Use a custom API backend URL\n- `--format` - Change the output format (`auto`, `explore`, `json`, `jsonl`, `pretty`, `raw`, `yaml`)\n- `--format-error` - Change the output format for errors (`auto`, `explore`, `json`, `jsonl`, `pretty`, `raw`, `yaml`)\n- `--transform` - Transform the data output using [GJSON syntax](https://github.com/tidwall/gjson/blob/master/SYNTAX.md)\n- `--transform-error` - Transform the error output using [GJSON syntax](https://github.com/tidwall/gjson/blob/master/SYNTAX.md)\n\n### Passing files as arguments\n\nTo pass files to your API, you can use the `@myfile.ext` syntax:\n\n~~~bash\nbeeper-desktop-cli --arg @abe.jpg\n~~~\n\nFiles can also be passed inside JSON or YAML blobs:\n\n~~~bash\nbeeper-desktop-cli --arg '{image: \"@abe.jpg\"}'\n# Equivalent:\nbeeper-desktop-cli < --username '\\@abe'\n~~~\n\n#### Explicit encoding\n\nFor JSON endpoints, the CLI tool does filetype sniffing to determine whether the\nfile contents should be sent as a string literal (for plain text files) or as a\nbase64-encoded string literal (for binary files). If you need to explicitly send\nthe file as either plain text or base64-encoded data, you can use\n`@file://myfile.txt` (for string encoding) or `@data://myfile.dat` (for\nbase64-encoding). Note that absolute paths will begin with `@file://` or\n`@data://`, followed by a third `/` (for example, `@file:///tmp/file.txt`).\n\n~~~bash\nbeeper-desktop-cli --arg @data://file.txt\n~~~\n\n## Linking different Go SDK versions\n\nYou can link the CLI against a different version of the Beeper Desktop Go SDK\nfor development purposes using the `./scripts/link` script.\n\nTo link to a specific version from a repository (version can be a branch,\ngit tag, or commit hash):\n\n~~~bash\n./scripts/link github.com/org/repo@version\n~~~\n\nTo link to a local copy of the SDK:\n\n~~~bash\n./scripts/link ../path/to/beeperdesktopapi-go\n~~~\n\nIf you run the link script without any arguments, it will default to `../beeperdesktopapi-go`.\n",
},
{
language: 'go',
content:
- '# Beeper Desktop Go API Library\n\n
\n\nThe Beeper Desktop Go library provides convenient access to the [Beeper Desktop REST API](https://developers.beeper.com/desktop-api/)\nfrom applications written in Go.\n\nIt is generated with [Stainless](https://www.stainless.com/).\n\n## MCP Server\n\nUse the Beeper Desktop MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.\n\n[](https://cursor.com/en-US/install-mcp?name=%40beeper%2Fdesktop-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBiZWVwZXIvZGVza3RvcC1tY3AiXSwiZW52Ijp7IkJFRVBFUl9BQ0NFU1NfVE9LRU4iOiJNeSBBY2Nlc3MgVG9rZW4ifX0)\n[](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22%40beeper%2Fdesktop-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40beeper%2Fdesktop-mcp%22%5D%2C%22env%22%3A%7B%22BEEPER_ACCESS_TOKEN%22%3A%22My%20Access%20Token%22%7D%7D)\n\n> Note: You may need to set environment variables in your MCP client.\n\n## Installation\n\n\n\n```go\nimport (\n\t"github.com/beeper/desktop-api-go" // imported as SDK_PackageName\n)\n```\n\n\n\nOr to pin the version:\n\n\n\n```sh\ngo get -u \'github.com/beeper/desktop-api-go@v0.0.1\'\n```\n\n\n\n## Requirements\n\nThis library requires Go 1.22+.\n\n## Usage\n\nThe full API of this library can be found in [api.md](api.md).\n\n```go\npackage main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/beeper/desktop-api-go"\n)\n\nfunc main() {\n\tclient := beeperdesktopapi.NewClient()\n\tpage, err := client.Chats.Search(context.TODO(), beeperdesktopapi.ChatSearchParams{\n\t\tIncludeMuted: beeperdesktopapi.Bool(true),\n\t\tLimit: beeperdesktopapi.Int(3),\n\t\tType: beeperdesktopapi.ChatSearchParamsTypeSingle,\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n\n```\n\n### Request fields\n\nAll request parameters are wrapped in a generic `Field` type,\nwhich we use to distinguish zero values from null or omitted fields.\n\nThis prevents accidentally sending a zero value if you forget a required parameter,\nand enables explicitly sending `null`, `false`, `\'\'`, or `0` on optional parameters.\nAny field not specified is not sent.\n\nTo construct fields with values, use the helpers `String()`, `Int()`, `Float()`, or most commonly, the generic `F[T]()`.\nTo send a null, use `Null[T]()`, and to send a nonconforming value, use `Raw[T](any)`. For example:\n\n```go\nparams := FooParams{\n\tName: SDK_PackageName.F("hello"),\n\n\t// Explicitly send `"description": null`\n\tDescription: SDK_PackageName.Null[string](),\n\n\tPoint: SDK_PackageName.F(SDK_PackageName.Point{\n\t\tX: SDK_PackageName.Int(0),\n\t\tY: SDK_PackageName.Int(1),\n\n\t\t// In cases where the API specifies a given type,\n\t\t// but you want to send something else, use `Raw`:\n\t\tZ: SDK_PackageName.Raw[int64](0.01), // sends a float\n\t}),\n}\n```\n\n### Response objects\n\nAll fields in response structs are value types (not pointers or wrappers).\n\nIf a given field is `null`, not present, or invalid, the corresponding field\nwill simply be its zero value.\n\nAll response structs also include a special `JSON` field, containing more detailed\ninformation about each property, which you can use like so:\n\n```go\nif res.Name == "" {\n\t// true if `"name"` is either not present or explicitly null\n\tres.JSON.Name.IsNull()\n\n\t// true if the `"name"` key was not present in the response JSON at all\n\tres.JSON.Name.IsMissing()\n\n\t// When the API returns data that cannot be coerced to the expected type:\n\tif res.JSON.Name.IsInvalid() {\n\t\traw := res.JSON.Name.Raw()\n\n\t\tlegacyName := struct{\n\t\t\tFirst string `json:"first"`\n\t\t\tLast string `json:"last"`\n\t\t}{}\n\t\tjson.Unmarshal([]byte(raw), &legacyName)\n\t\tname = legacyName.First + " " + legacyName.Last\n\t}\n}\n```\n\nThese `.JSON` structs also include an `Extras` map containing\nany properties in the json response that were not specified\nin the struct. This can be useful for API features not yet\npresent in the SDK.\n\n```go\nbody := res.JSON.ExtraFields["my_unexpected_field"].Raw()\n```\n\n### RequestOptions\n\nThis library uses the functional options pattern. Functions defined in the\n`SDK_PackageOptionName` package return a `RequestOption`, which is a closure that mutates a\n`RequestConfig`. These options can be supplied to the client or at individual\nrequests. For example:\n\n```go\nclient := SDK_PackageName.SDK_ClientInitializerName(\n\t// Adds a header to every request made by the client\n\tSDK_PackageOptionName.WithHeader("X-Some-Header", "custom_header_info"),\n)\n\nclient.Accounts.List(context.TODO(), ...,\n\t// Override the header\n\tSDK_PackageOptionName.WithHeader("X-Some-Header", "some_other_custom_header_info"),\n\t// Add an undocumented field to the request body, using sjson syntax\n\tSDK_PackageOptionName.WithJSONSet("some.json.path", map[string]string{"my": "object"}),\n)\n```\n\nSee the [full list of request options](https://pkg.go.dev/github.com/beeper/desktop-api-go/SDK_PackageOptionName).\n\n### Pagination\n\nThis library provides some conveniences for working with paginated list endpoints.\n\nYou can use `.ListAutoPaging()` methods to iterate through items across all pages:\n\n```go\niter := client.Messages.SearchAutoPaging(context.TODO(), beeperdesktopapi.MessageSearchParams{\n\tAccountIDs: []string{"local-telegram_ba_QFrb5lrLPhO3OT5MFBeTWv0x4BI"},\n\tLimit: beeperdesktopapi.Int(10),\n\tQuery: beeperdesktopapi.String("deployment"),\n})\n// Automatically fetches more pages as needed.\nfor iter.Next() {\n\tmessage := iter.Current()\n\tfmt.Printf("%+v\\n", message)\n}\nif err := iter.Err(); err != nil {\n\tpanic(err.Error())\n}\n```\n\nOr you can use simple `.List()` methods to fetch a single page and receive a standard response object\nwith additional helper methods like `.GetNextPage()`, e.g.:\n\n```go\npage, err := client.Messages.Search(context.TODO(), beeperdesktopapi.MessageSearchParams{\n\tAccountIDs: []string{"local-telegram_ba_QFrb5lrLPhO3OT5MFBeTWv0x4BI"},\n\tLimit: beeperdesktopapi.Int(10),\n\tQuery: beeperdesktopapi.String("deployment"),\n})\nfor page != nil {\n\tfor _, message := range page.Items {\n\t\tfmt.Printf("%+v\\n", message)\n\t}\n\tpage, err = page.GetNextPage()\n}\nif err != nil {\n\tpanic(err.Error())\n}\n```\n\n### Errors\n\nWhen the API returns a non-success status code, we return an error with type\n`*SDK_PackageName.Error`. This contains the `StatusCode`, `*http.Request`, and\n`*http.Response` values of the request, as well as the JSON of the error body\n(much like other response objects in the SDK).\n\nTo handle errors, we recommend that you use the `errors.As` pattern:\n\n```go\n_, err := client.Accounts.List(context.TODO())\nif err != nil {\n\tvar apierr *beeperdesktopapi.Error\n\tif errors.As(err, &apierr) {\n\t\tprintln(string(apierr.DumpRequest(true))) // Prints the serialized HTTP request\n\t\tprintln(string(apierr.DumpResponse(true))) // Prints the serialized HTTP response\n\t}\n\tpanic(err.Error()) // GET "/v1/accounts": 400 Bad Request { ... }\n}\n```\n\nWhen other errors occur, they are returned unwrapped; for example,\nif HTTP transport fails, you might receive `*url.Error` wrapping `*net.OpError`.\n\n### Timeouts\n\nRequests do not time out by default; use context to configure a timeout for a request lifecycle.\n\nNote that if a request is [retried](#retries), the context timeout does not start over.\nTo set a per-retry timeout, use `SDK_PackageOptionName.WithRequestTimeout()`.\n\n```go\n// This sets the timeout for the request, including all the retries.\nctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute)\ndefer cancel()\nclient.Accounts.List(\n\tctx,\n\t// This sets the per-retry timeout\n\toption.WithRequestTimeout(20*time.Second),\n)\n```\n\n### File uploads\n\nRequest parameters that correspond to file uploads in multipart requests are typed as\n`param.Field[io.Reader]`. The contents of the `io.Reader` will by default be sent as a multipart form\npart with the file name of "anonymous_file" and content-type of "application/octet-stream".\n\nThe file name and content-type can be customized by implementing `Name() string` or `ContentType()\nstring` on the run-time type of `io.Reader`. Note that `os.File` implements `Name() string`, so a\nfile returned by `os.Open` will be sent with the file name on disk.\n\nWe also provide a helper `SDK_PackageName.FileParam(reader io.Reader, filename string, contentType string)`\nwhich can be used to wrap any `io.Reader` with the appropriate file name and content type.\n\n```go\n// A file from the file system\nfile, err := os.Open("/path/to/file")\nbeeperdesktopapi.AssetUploadParams{\n\tFile: file,\n}\n\n// A file from a string\nbeeperdesktopapi.AssetUploadParams{\n\tFile: strings.NewReader("my file contents"),\n}\n\n// With a custom filename and contentType\nbeeperdesktopapi.AssetUploadParams{\n\tFile: beeperdesktopapi.File(strings.NewReader(`{"hello": "foo"}`), "file.go", "application/json"),\n}\n```\n\n### Retries\n\nCertain errors will be automatically retried 2 times by default, with a short exponential backoff.\nWe retry by default all connection errors, 408 Request Timeout, 409 Conflict, 429 Rate Limit,\nand >=500 Internal errors.\n\nYou can use the `WithMaxRetries` option to configure or disable this:\n\n```go\n// Configure the default for all requests:\nclient := beeperdesktopapi.NewClient(\n\toption.WithMaxRetries(0), // default is 2\n)\n\n// Override per-request:\nclient.Accounts.List(context.TODO(), option.WithMaxRetries(5))\n```\n\n\n### Accessing raw response data (e.g. response headers)\n\nYou can access the raw HTTP response data by using the `option.WithResponseInto()` request option. This is useful when\nyou need to examine response headers, status codes, or other details.\n\n```go\n// Create a variable to store the HTTP response\nvar response *http.Response\naccounts, err := client.Accounts.List(context.TODO(), option.WithResponseInto(&response))\nif err != nil {\n\t// handle error\n}\nfmt.Printf("%+v\\n", accounts)\n\nfmt.Printf("Status Code: %d\\n", response.StatusCode)\nfmt.Printf("Headers: %+#v\\n", response.Header)\n```\n\n### Making custom/undocumented requests\n\nThis library is typed for convenient access to the documented API. If you need to access undocumented\nendpoints, params, or response properties, the library can still be used.\n\n#### Undocumented endpoints\n\nTo make requests to undocumented endpoints, you can use `client.Get`, `client.Post`, and other HTTP verbs.\n`RequestOptions` on the client, such as retries, will be respected when making these requests.\n\n```go\nvar (\n // params can be an io.Reader, a []byte, an encoding/json serializable object,\n // or a "…Params" struct defined in this library.\n params map[string]interface{}\n\n // result can be an []byte, *http.Response, a encoding/json deserializable object,\n // or a model defined in this library.\n result *http.Response\n)\nerr := client.Post(context.Background(), "/unspecified", params, &result)\nif err != nil {\n …\n}\n```\n\n#### Undocumented request params\n\nTo make requests using undocumented parameters, you may use either the `SDK_PackageOptionName.WithQuerySet()`\nor the `SDK_PackageOptionName.WithJSONSet()` methods.\n\n```go\nparams := FooNewParams{\n ID: SDK_PackageName.F("id_xxxx"),\n Data: SDK_PackageName.F(FooNewParamsData{\n FirstName: SDK_PackageName.F("John"),\n }),\n}\nclient.Foo.New(context.Background(), params, SDK_PackageOptionName.WithJSONSet("data.last_name", "Doe"))\n```\n\n#### Undocumented response properties\n\nTo access undocumented response properties, you may either access the raw JSON of the response as a string\nwith `result.JSON.RawJSON()`, or get the raw JSON of a particular field on the result with\n`result.JSON.Foo.Raw()`.\n\nAny fields that are not present on the response struct will be saved and can be accessed by `result.JSON.ExtraFields()` which returns the extra fields as a `map[string]Field`.\n\n### Middleware\n\nWe provide `SDK_PackageOptionName.WithMiddleware` which applies the given\nmiddleware to requests.\n\n```go\nfunc Logger(req *http.Request, next SDK_PackageOptionName.MiddlewareNext) (res *http.Response, err error) {\n\t// Before the request\n\tstart := time.Now()\n\tLogReq(req)\n\n\t// Forward the request to the next handler\n\tres, err = next(req)\n\n\t// Handle stuff after the request\n\tend := time.Now()\n\tLogRes(res, err, start - end)\n\n return res, err\n}\n\nclient := SDK_PackageName.SDK_ClientInitializerName(\n\tSDK_PackageOptionName.WithMiddleware(Logger),\n)\n```\n\nWhen multiple middlewares are provided as variadic arguments, the middlewares\nare applied left to right. If `SDK_PackageOptionName.WithMiddleware` is given\nmultiple times, for example first in the client then the method, the\nmiddleware in the client will run first and the middleware given in the method\nwill run next.\n\nYou may also replace the default `http.Client` with\n`SDK_PackageOptionName.WithHTTPClient(client)`. Only one http client is\naccepted (this overwrites any previous client) and receives requests after any\nmiddleware has been applied.\n\n## Semantic versioning\n\nThis package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:\n\n1. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_\n2. Changes that we do not expect to impact the vast majority of users in practice.\n\nWe take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.\n\nWe are keen for your feedback; please open an [issue](https://www.github.com/beeper/desktop-api-go/issues) with questions, bugs, or suggestions.\n\n## Contributing\n\nSee [the contributing documentation](./CONTRIBUTING.md).\n',
+ '# Beeper Desktop Go API Library\n\n
\n\nThe Beeper Desktop Go library provides convenient access to the [Beeper Desktop REST API](https://developers.beeper.com/desktop-api/)\nfrom applications written in Go.\n\n\n\n## MCP Server\n\nUse the Beeper Desktop MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.\n\n[](https://cursor.com/en-US/install-mcp?name=%40beeper%2Fdesktop-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBiZWVwZXIvZGVza3RvcC1tY3AiXSwiZW52Ijp7IkJFRVBFUl9BQ0NFU1NfVE9LRU4iOiJNeSBBY2Nlc3MgVG9rZW4ifX0)\n[](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22%40beeper%2Fdesktop-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40beeper%2Fdesktop-mcp%22%5D%2C%22env%22%3A%7B%22BEEPER_ACCESS_TOKEN%22%3A%22My%20Access%20Token%22%7D%7D)\n\n> Note: You may need to set environment variables in your MCP client.\n\n## Installation\n\n\n\n```go\nimport (\n\t"github.com/beeper/desktop-api-go" // imported as SDK_PackageName\n)\n```\n\n\n\nOr to pin the version:\n\n\n\n```sh\ngo get -u \'github.com/beeper/desktop-api-go@v0.0.1\'\n```\n\n\n\n## Requirements\n\nThis library requires Go 1.22+.\n\n## Usage\n\nThe full API of this library can be found in [api.md](api.md).\n\n```go\npackage main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/beeper/desktop-api-go"\n\t"github.com/beeper/desktop-api-go/option"\n)\n\nfunc main() {\n\tclient := beeperdesktopapi.NewClient(\n\t\toption.WithAccessToken("My Access Token"), // defaults to os.LookupEnv("BEEPER_ACCESS_TOKEN")\n\t)\n\tpage, err := client.Chats.Search(context.TODO(), beeperdesktopapi.ChatSearchParams{\n\t\tIncludeMuted: beeperdesktopapi.Bool(true),\n\t\tLimit: beeperdesktopapi.Int(3),\n\t\tType: beeperdesktopapi.ChatSearchParamsTypeSingle,\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n\n```\n\n### Request fields\n\nAll request parameters are wrapped in a generic `Field` type,\nwhich we use to distinguish zero values from null or omitted fields.\n\nThis prevents accidentally sending a zero value if you forget a required parameter,\nand enables explicitly sending `null`, `false`, `\'\'`, or `0` on optional parameters.\nAny field not specified is not sent.\n\nTo construct fields with values, use the helpers `String()`, `Int()`, `Float()`, or most commonly, the generic `F[T]()`.\nTo send a null, use `Null[T]()`, and to send a nonconforming value, use `Raw[T](any)`. For example:\n\n```go\nparams := FooParams{\n\tName: SDK_PackageName.F("hello"),\n\n\t// Explicitly send `"description": null`\n\tDescription: SDK_PackageName.Null[string](),\n\n\tPoint: SDK_PackageName.F(SDK_PackageName.Point{\n\t\tX: SDK_PackageName.Int(0),\n\t\tY: SDK_PackageName.Int(1),\n\n\t\t// In cases where the API specifies a given type,\n\t\t// but you want to send something else, use `Raw`:\n\t\tZ: SDK_PackageName.Raw[int64](0.01), // sends a float\n\t}),\n}\n```\n\n### Response objects\n\nAll fields in response structs are value types (not pointers or wrappers).\n\nIf a given field is `null`, not present, or invalid, the corresponding field\nwill simply be its zero value.\n\nAll response structs also include a special `JSON` field, containing more detailed\ninformation about each property, which you can use like so:\n\n```go\nif res.Name == "" {\n\t// true if `"name"` is either not present or explicitly null\n\tres.JSON.Name.IsNull()\n\n\t// true if the `"name"` key was not present in the response JSON at all\n\tres.JSON.Name.IsMissing()\n\n\t// When the API returns data that cannot be coerced to the expected type:\n\tif res.JSON.Name.IsInvalid() {\n\t\traw := res.JSON.Name.Raw()\n\n\t\tlegacyName := struct{\n\t\t\tFirst string `json:"first"`\n\t\t\tLast string `json:"last"`\n\t\t}{}\n\t\tjson.Unmarshal([]byte(raw), &legacyName)\n\t\tname = legacyName.First + " " + legacyName.Last\n\t}\n}\n```\n\nThese `.JSON` structs also include an `Extras` map containing\nany properties in the json response that were not specified\nin the struct. This can be useful for API features not yet\npresent in the SDK.\n\n```go\nbody := res.JSON.ExtraFields["my_unexpected_field"].Raw()\n```\n\n### RequestOptions\n\nThis library uses the functional options pattern. Functions defined in the\n`SDK_PackageOptionName` package return a `RequestOption`, which is a closure that mutates a\n`RequestConfig`. These options can be supplied to the client or at individual\nrequests. For example:\n\n```go\nclient := SDK_PackageName.SDK_ClientInitializerName(\n\t// Adds a header to every request made by the client\n\tSDK_PackageOptionName.WithHeader("X-Some-Header", "custom_header_info"),\n)\n\nclient.Accounts.List(context.TODO(), ...,\n\t// Override the header\n\tSDK_PackageOptionName.WithHeader("X-Some-Header", "some_other_custom_header_info"),\n\t// Add an undocumented field to the request body, using sjson syntax\n\tSDK_PackageOptionName.WithJSONSet("some.json.path", map[string]string{"my": "object"}),\n)\n```\n\nSee the [full list of request options](https://pkg.go.dev/github.com/beeper/desktop-api-go/SDK_PackageOptionName).\n\n### Pagination\n\nThis library provides some conveniences for working with paginated list endpoints.\n\nYou can use `.ListAutoPaging()` methods to iterate through items across all pages:\n\n```go\niter := client.Messages.SearchAutoPaging(context.TODO(), beeperdesktopapi.MessageSearchParams{\n\tAccountIDs: []string{"local-telegram_ba_QFrb5lrLPhO3OT5MFBeTWv0x4BI"},\n\tLimit: beeperdesktopapi.Int(10),\n\tQuery: beeperdesktopapi.String("deployment"),\n})\n// Automatically fetches more pages as needed.\nfor iter.Next() {\n\tmessage := iter.Current()\n\tfmt.Printf("%+v\\n", message)\n}\nif err := iter.Err(); err != nil {\n\tpanic(err.Error())\n}\n```\n\nOr you can use simple `.List()` methods to fetch a single page and receive a standard response object\nwith additional helper methods like `.GetNextPage()`, e.g.:\n\n```go\npage, err := client.Messages.Search(context.TODO(), beeperdesktopapi.MessageSearchParams{\n\tAccountIDs: []string{"local-telegram_ba_QFrb5lrLPhO3OT5MFBeTWv0x4BI"},\n\tLimit: beeperdesktopapi.Int(10),\n\tQuery: beeperdesktopapi.String("deployment"),\n})\nfor page != nil {\n\tfor _, message := range page.Items {\n\t\tfmt.Printf("%+v\\n", message)\n\t}\n\tpage, err = page.GetNextPage()\n}\nif err != nil {\n\tpanic(err.Error())\n}\n```\n\n### Errors\n\nWhen the API returns a non-success status code, we return an error with type\n`*SDK_PackageName.Error`. This contains the `StatusCode`, `*http.Request`, and\n`*http.Response` values of the request, as well as the JSON of the error body\n(much like other response objects in the SDK).\n\nTo handle errors, we recommend that you use the `errors.As` pattern:\n\n```go\n_, err := client.Accounts.List(context.TODO())\nif err != nil {\n\tvar apierr *beeperdesktopapi.Error\n\tif errors.As(err, &apierr) {\n\t\tprintln(string(apierr.DumpRequest(true))) // Prints the serialized HTTP request\n\t\tprintln(string(apierr.DumpResponse(true))) // Prints the serialized HTTP response\n\t}\n\tpanic(err.Error()) // GET "/v1/accounts": 400 Bad Request { ... }\n}\n```\n\nWhen other errors occur, they are returned unwrapped; for example,\nif HTTP transport fails, you might receive `*url.Error` wrapping `*net.OpError`.\n\n### Timeouts\n\nRequests do not time out by default; use context to configure a timeout for a request lifecycle.\n\nNote that if a request is [retried](#retries), the context timeout does not start over.\nTo set a per-retry timeout, use `SDK_PackageOptionName.WithRequestTimeout()`.\n\n```go\n// This sets the timeout for the request, including all the retries.\nctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute)\ndefer cancel()\nclient.Accounts.List(\n\tctx,\n\t// This sets the per-retry timeout\n\toption.WithRequestTimeout(20*time.Second),\n)\n```\n\n### File uploads\n\nRequest parameters that correspond to file uploads in multipart requests are typed as\n`param.Field[io.Reader]`. The contents of the `io.Reader` will by default be sent as a multipart form\npart with the file name of "anonymous_file" and content-type of "application/octet-stream".\n\nThe file name and content-type can be customized by implementing `Name() string` or `ContentType()\nstring` on the run-time type of `io.Reader`. Note that `os.File` implements `Name() string`, so a\nfile returned by `os.Open` will be sent with the file name on disk.\n\nWe also provide a helper `SDK_PackageName.FileParam(reader io.Reader, filename string, contentType string)`\nwhich can be used to wrap any `io.Reader` with the appropriate file name and content type.\n\n```go\n// A file from the file system\nfile, err := os.Open("/path/to/file")\nbeeperdesktopapi.AssetUploadParams{\n\tFile: file,\n}\n\n// A file from a string\nbeeperdesktopapi.AssetUploadParams{\n\tFile: strings.NewReader("my file contents"),\n}\n\n// With a custom filename and contentType\nbeeperdesktopapi.AssetUploadParams{\n\tFile: beeperdesktopapi.File(strings.NewReader(`{"hello": "foo"}`), "file.go", "application/json"),\n}\n```\n\n### Retries\n\nCertain errors will be automatically retried 2 times by default, with a short exponential backoff.\nWe retry by default all connection errors, 408 Request Timeout, 409 Conflict, 429 Rate Limit,\nand >=500 Internal errors.\n\nYou can use the `WithMaxRetries` option to configure or disable this:\n\n```go\n// Configure the default for all requests:\nclient := beeperdesktopapi.NewClient(\n\toption.WithMaxRetries(0), // default is 2\n)\n\n// Override per-request:\nclient.Accounts.List(context.TODO(), option.WithMaxRetries(5))\n```\n\n\n### Accessing raw response data (e.g. response headers)\n\nYou can access the raw HTTP response data by using the `option.WithResponseInto()` request option. This is useful when\nyou need to examine response headers, status codes, or other details.\n\n```go\n// Create a variable to store the HTTP response\nvar response *http.Response\naccounts, err := client.Accounts.List(context.TODO(), option.WithResponseInto(&response))\nif err != nil {\n\t// handle error\n}\nfmt.Printf("%+v\\n", accounts)\n\nfmt.Printf("Status Code: %d\\n", response.StatusCode)\nfmt.Printf("Headers: %+#v\\n", response.Header)\n```\n\n### Making custom/undocumented requests\n\nThis library is typed for convenient access to the documented API. If you need to access undocumented\nendpoints, params, or response properties, the library can still be used.\n\n#### Undocumented endpoints\n\nTo make requests to undocumented endpoints, you can use `client.Get`, `client.Post`, and other HTTP verbs.\n`RequestOptions` on the client, such as retries, will be respected when making these requests.\n\n```go\nvar (\n // params can be an io.Reader, a []byte, an encoding/json serializable object,\n // or a "…Params" struct defined in this library.\n params map[string]interface{}\n\n // result can be an []byte, *http.Response, a encoding/json deserializable object,\n // or a model defined in this library.\n result *http.Response\n)\nerr := client.Post(context.Background(), "/unspecified", params, &result)\nif err != nil {\n …\n}\n```\n\n#### Undocumented request params\n\nTo make requests using undocumented parameters, you may use either the `SDK_PackageOptionName.WithQuerySet()`\nor the `SDK_PackageOptionName.WithJSONSet()` methods.\n\n```go\nparams := FooNewParams{\n ID: SDK_PackageName.F("id_xxxx"),\n Data: SDK_PackageName.F(FooNewParamsData{\n FirstName: SDK_PackageName.F("John"),\n }),\n}\nclient.Foo.New(context.Background(), params, SDK_PackageOptionName.WithJSONSet("data.last_name", "Doe"))\n```\n\n#### Undocumented response properties\n\nTo access undocumented response properties, you may either access the raw JSON of the response as a string\nwith `result.JSON.RawJSON()`, or get the raw JSON of a particular field on the result with\n`result.JSON.Foo.Raw()`.\n\nAny fields that are not present on the response struct will be saved and can be accessed by `result.JSON.ExtraFields()` which returns the extra fields as a `map[string]Field`.\n\n### Middleware\n\nWe provide `SDK_PackageOptionName.WithMiddleware` which applies the given\nmiddleware to requests.\n\n```go\nfunc Logger(req *http.Request, next SDK_PackageOptionName.MiddlewareNext) (res *http.Response, err error) {\n\t// Before the request\n\tstart := time.Now()\n\tLogReq(req)\n\n\t// Forward the request to the next handler\n\tres, err = next(req)\n\n\t// Handle stuff after the request\n\tend := time.Now()\n\tLogRes(res, err, start - end)\n\n return res, err\n}\n\nclient := SDK_PackageName.SDK_ClientInitializerName(\n\tSDK_PackageOptionName.WithMiddleware(Logger),\n)\n```\n\nWhen multiple middlewares are provided as variadic arguments, the middlewares\nare applied left to right. If `SDK_PackageOptionName.WithMiddleware` is given\nmultiple times, for example first in the client then the method, the\nmiddleware in the client will run first and the middleware given in the method\nwill run next.\n\nYou may also replace the default `http.Client` with\n`SDK_PackageOptionName.WithHTTPClient(client)`. Only one http client is\naccepted (this overwrites any previous client) and receives requests after any\nmiddleware has been applied.\n\n## Semantic versioning\n\nThis package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:\n\n1. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_\n2. Changes that we do not expect to impact the vast majority of users in practice.\n\nWe take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.\n\nWe are keen for your feedback; please open an [issue](https://www.github.com/beeper/desktop-api-go/issues) with questions, bugs, or suggestions.\n\n## Contributing\n\nSee [the contributing documentation](./CONTRIBUTING.md).\n',
},
{
- language: 'typescript',
+ language: 'php',
content:
- "# TypeScript SDK for Beeper Desktop API Library\n\n[)](https://npmjs.org/package/@beeper/desktop-api) \n\nThis library provides convenient access to the Beeper Desktop REST API from server-side TypeScript or JavaScript.\n\n\n\nThe REST API documentation can be found on [developers.beeper.com](https://developers.beeper.com/desktop-api/). The full API of this library can be found in [api.md](api.md).\n\nIt is generated with [Stainless](https://www.stainless.com/).\n\n## MCP Server\n\nUse the Beeper Desktop MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.\n\n[](https://cursor.com/en-US/install-mcp?name=%40beeper%2Fdesktop-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBiZWVwZXIvZGVza3RvcC1tY3AiXSwiZW52Ijp7IkJFRVBFUl9BQ0NFU1NfVE9LRU4iOiJNeSBBY2Nlc3MgVG9rZW4ifX0)\n[](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22%40beeper%2Fdesktop-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40beeper%2Fdesktop-mcp%22%5D%2C%22env%22%3A%7B%22BEEPER_ACCESS_TOKEN%22%3A%22My%20Access%20Token%22%7D%7D)\n\n> Note: You may need to set environment variables in your MCP client.\n\n## Installation\n\n```sh\nnpm install @beeper/desktop-api\n```\n\n\n\n## Usage\n\nThe full API of this library can be found in [api.md](api.md).\n\n\n```js\nimport BeeperDesktop from '@beeper/desktop-api';\n\nconst client = new BeeperDesktop();\n\nconst page = await client.chats.search({\n includeMuted: true,\n limit: 3,\n type: 'single',\n});\nconst chat = page.items[0];\n\nconsole.log(chat.id);\n```\n\n\n\n### Request & Response types\n\nThis library includes TypeScript definitions for all request params and response fields. You may import and use them like so:\n\n\n```ts\nimport BeeperDesktop from '@beeper/desktop-api';\n\nconst client = new BeeperDesktop();\n\nconst accounts: BeeperDesktop.AccountListResponse = await client.accounts.list();\n```\n\nDocumentation for each method, request param, and response field are available in docstrings and will appear on hover in most modern editors.\n\n## File uploads\n\nRequest parameters that correspond to file uploads can be passed in many different forms:\n- `File` (or an object with the same structure)\n- a `fetch` `Response` (or an object with the same structure)\n- an `fs.ReadStream`\n- the return value of our `toFile` helper\n\n```ts\nimport fs from 'fs';\nimport BeeperDesktop, { toFile } from '@beeper/desktop-api';\n\nconst client = new BeeperDesktop();\n\n// If you have access to Node `fs` we recommend using `fs.createReadStream()`:\nawait client.assets.upload({ file: fs.createReadStream('/path/to/file') });\n\n// Or if you have the web `File` API you can pass a `File` instance:\nawait client.assets.upload({ file: new File(['my bytes'], 'file') });\n\n// You can also pass a `fetch` `Response`:\nawait client.assets.upload({ file: await fetch('https://somesite/file') });\n\n// Finally, if none of the above are convenient, you can use our `toFile` helper:\nawait client.assets.upload({ file: await toFile(Buffer.from('my bytes'), 'file') });\nawait client.assets.upload({ file: await toFile(new Uint8Array([0, 1, 2]), 'file') });\n```\n\n\n\n## Handling errors\n\nWhen the library is unable to connect to the API,\nor if the API returns a non-success status code (i.e., 4xx or 5xx response),\na subclass of `APIError` will be thrown:\n\n\n```ts\nconst accounts = await client.accounts.list().catch(async (err) => {\n if (err instanceof BeeperDesktop.APIError) {\n console.log(err.status); // 400\n console.log(err.name); // BadRequestError\n console.log(err.headers); // {server: 'nginx', ...}\n } else {\n throw err;\n }\n});\n```\n\nError codes are as follows:\n\n| Status Code | Error Type |\n| ----------- | -------------------------- |\n| 400 | `BadRequestError` |\n| 401 | `AuthenticationError` |\n| 403 | `PermissionDeniedError` |\n| 404 | `NotFoundError` |\n| 422 | `UnprocessableEntityError` |\n| 429 | `RateLimitError` |\n| >=500 | `InternalServerError` |\n| N/A | `APIConnectionError` |\n\n### Retries\n\nCertain errors will be automatically retried 2 times by default, with a short exponential backoff.\nConnection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict,\n429 Rate Limit, and >=500 Internal errors will all be retried by default.\n\nYou can use the `maxRetries` option to configure or disable this:\n\n\n```js\n// Configure the default for all requests:\nconst client = new BeeperDesktop({\n maxRetries: 0, // default is 2\n});\n\n// Or, configure per-request:\nawait client.accounts.list({\n maxRetries: 5,\n});\n```\n\n### Timeouts\n\nRequests time out after 30 seconds by default. You can configure this with a `timeout` option:\n\n\n```ts\n// Configure the default for all requests:\nconst client = new BeeperDesktop({\n timeout: 20 * 1000, // 20 seconds (default is 30 seconds)\n});\n\n// Override per-request:\nawait client.accounts.list({\n timeout: 5 * 1000,\n});\n```\n\nOn timeout, an `APIConnectionTimeoutError` is thrown.\n\nNote that requests which time out will be [retried twice by default](#retries).\n\n## Auto-pagination\n\nList methods in the BeeperDesktop API are paginated.\nYou can use the `for await … of` syntax to iterate through items across all pages:\n\n```ts\nasync function fetchAllMessages(params) {\n const allMessages = [];\n // Automatically fetches more pages as needed.\n for await (const message of client.messages.search({\n accountIDs: ['local-telegram_ba_QFrb5lrLPhO3OT5MFBeTWv0x4BI'],\n limit: 10,\n query: 'deployment',\n })) {\n allMessages.push(message);\n }\n return allMessages;\n}\n```\n\nAlternatively, you can request a single page at a time:\n\n```ts\nlet page = await client.messages.search({\n accountIDs: ['local-telegram_ba_QFrb5lrLPhO3OT5MFBeTWv0x4BI'],\n limit: 10,\n query: 'deployment',\n});\nfor (const message of page.items) {\n console.log(message);\n}\n\n// Convenience methods are provided for manually paginating:\nwhile (page.hasNextPage()) {\n page = await page.getNextPage();\n // ...\n}\n```\n\n\n\n## Advanced Usage\n\n### Accessing raw Response data (e.g., headers)\n\nThe \"raw\" `Response` returned by `fetch()` can be accessed through the `.asResponse()` method on the `APIPromise` type that all methods return.\nThis method returns as soon as the headers for a successful response are received and does not consume the response body, so you are free to write custom parsing or streaming logic.\n\nYou can also use the `.withResponse()` method to get the raw `Response` along with the parsed data.\nUnlike `.asResponse()` this method consumes the body, returning once it is parsed.\n\n\n```ts\nconst client = new BeeperDesktop();\n\nconst response = await client.accounts.list().asResponse();\nconsole.log(response.headers.get('X-My-Header'));\nconsole.log(response.statusText); // access the underlying Response object\n\nconst { data: accounts, response: raw } = await client.accounts.list().withResponse();\nconsole.log(raw.headers.get('X-My-Header'));\nconsole.log(accounts);\n```\n\n### Logging\n\n> [!IMPORTANT]\n> All log messages are intended for debugging only. The format and content of log messages\n> may change between releases.\n\n#### Log levels\n\nThe log level can be configured in two ways:\n\n1. Via the `BEEPER_DESKTOP_LOG` environment variable\n2. Using the `logLevel` client option (overrides the environment variable if set)\n\n```ts\nimport BeeperDesktop from '@beeper/desktop-api';\n\nconst client = new BeeperDesktop({\n logLevel: 'debug', // Show all log messages\n});\n```\n\nAvailable log levels, from most to least verbose:\n\n- `'debug'` - Show debug messages, info, warnings, and errors\n- `'info'` - Show info messages, warnings, and errors\n- `'warn'` - Show warnings and errors (default)\n- `'error'` - Show only errors\n- `'off'` - Disable all logging\n\nAt the `'debug'` level, all HTTP requests and responses are logged, including headers and bodies.\nSome authentication-related headers are redacted, but sensitive data in request and response bodies\nmay still be visible.\n\n#### Custom logger\n\nBy default, this library logs to `globalThis.console`. You can also provide a custom logger.\nMost logging libraries are supported, including [pino](https://www.npmjs.com/package/pino), [winston](https://www.npmjs.com/package/winston), [bunyan](https://www.npmjs.com/package/bunyan), [consola](https://www.npmjs.com/package/consola), [signale](https://www.npmjs.com/package/signale), and [@std/log](https://jsr.io/@std/log). If your logger doesn't work, please open an issue.\n\nWhen providing a custom logger, the `logLevel` option still controls which messages are emitted, messages\nbelow the configured level will not be sent to your logger.\n\n```ts\nimport BeeperDesktop from '@beeper/desktop-api';\nimport pino from 'pino';\n\nconst logger = pino();\n\nconst client = new BeeperDesktop({\n logger: logger.child({ name: 'BeeperDesktop' }),\n logLevel: 'debug', // Send all messages to pino, allowing it to filter\n});\n```\n\n### Making custom/undocumented requests\n\nThis library is typed for convenient access to the documented API. If you need to access undocumented\nendpoints, params, or response properties, the library can still be used.\n\n#### Undocumented endpoints\n\nTo make requests to undocumented endpoints, you can use `client.get`, `client.post`, and other HTTP verbs.\nOptions on the client, such as retries, will be respected when making these requests.\n\n```ts\nawait client.post('/some/path', {\n body: { some_prop: 'foo' },\n query: { some_query_arg: 'bar' },\n});\n```\n\n#### Undocumented request params\n\nTo make requests using undocumented parameters, you may use `// @ts-expect-error` on the undocumented\nparameter. This library doesn't validate at runtime that the request matches the type, so any extra values you\nsend will be sent as-is.\n\n```ts\nclient.chats.search({\n // ...\n // @ts-expect-error baz is not yet public\n baz: 'undocumented option',\n});\n```\n\nFor requests with the `GET` verb, any extra params will be in the query, all other requests will send the\nextra param in the body.\n\nIf you want to explicitly send an extra argument, you can do so with the `query`, `body`, and `headers` request\noptions.\n\n#### Undocumented response properties\n\nTo access undocumented response properties, you may access the response object with `// @ts-expect-error` on\nthe response object, or cast the response object to the requisite type. Like the request params, we do not\nvalidate or strip extra properties from the response from the API.\n\n### Customizing the fetch client\n\nBy default, this library expects a global `fetch` function is defined.\n\nIf you want to use a different `fetch` function, you can either polyfill the global:\n\n```ts\nimport fetch from 'my-fetch';\n\nglobalThis.fetch = fetch;\n```\n\nOr pass it to the client:\n\n```ts\nimport BeeperDesktop from '@beeper/desktop-api';\nimport fetch from 'my-fetch';\n\nconst client = new BeeperDesktop({ fetch });\n```\n\n### Fetch options\n\nIf you want to set custom `fetch` options without overriding the `fetch` function, you can provide a `fetchOptions` object when instantiating the client or making a request. (Request-specific options override client options.)\n\n```ts\nimport BeeperDesktop from '@beeper/desktop-api';\n\nconst client = new BeeperDesktop({\n fetchOptions: {\n // `RequestInit` options\n },\n});\n```\n\n#### Configuring proxies\n\nTo modify proxy behavior, you can provide custom `fetchOptions` that add runtime-specific proxy\noptions to requests:\n\n
**Node** [[docs](https://github.com/nodejs/undici/blob/main/docs/docs/api/ProxyAgent.md#example---proxyagent-with-fetch)]\n\n```ts\nimport BeeperDesktop from '@beeper/desktop-api';\nimport * as undici from 'undici';\n\nconst proxyAgent = new undici.ProxyAgent('http://localhost:8888');\nconst client = new BeeperDesktop({\n fetchOptions: {\n dispatcher: proxyAgent,\n },\n});\n```\n\n
**Bun** [[docs](https://bun.sh/guides/http/proxy)]\n\n```ts\nimport BeeperDesktop from '@beeper/desktop-api';\n\nconst client = new BeeperDesktop({\n fetchOptions: {\n proxy: 'http://localhost:8888',\n },\n});\n```\n\n
**Deno** [[docs](https://docs.deno.com/api/deno/~/Deno.createHttpClient)]\n\n```ts\nimport BeeperDesktop from 'npm:@beeper/desktop-api';\n\nconst httpClient = Deno.createHttpClient({ proxy: { url: 'http://localhost:8888' } });\nconst client = new BeeperDesktop({\n fetchOptions: {\n client: httpClient,\n },\n});\n```\n\n## Frequently Asked Questions\n\n## Semantic versioning\n\nThis package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:\n\n1. Changes that only affect static types, without breaking runtime behavior.\n2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_\n3. Changes that we do not expect to impact the vast majority of users in practice.\n\nWe take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.\n\nWe are keen for your feedback; please open an [issue](https://www.github.com/beeper/desktop-api-js/issues) with questions, bugs, or suggestions.\n\n## Requirements\n\nTypeScript >= 4.9 is supported.\n\nThe following runtimes are supported:\n\n- Web browsers (Up-to-date Chrome, Firefox, Safari, Edge, and more)\n- Node.js 20 LTS or later ([non-EOL](https://endoflife.date/nodejs)) versions.\n- Deno v1.28.0 or higher.\n- Bun 1.0 or later.\n- Cloudflare Workers.\n- Vercel Edge Runtime.\n- Jest 28 or greater with the `\"node\"` environment (`\"jsdom\"` is not supported at this time).\n- Nitro v2.6 or greater.\n\nNote that React Native is not supported at this time.\n\nIf you are interested in other runtime environments, please open or upvote an issue on GitHub.\n\n## Contributing\n\nSee [the contributing documentation](./CONTRIBUTING.md).\n",
+ '# Beeper Desktop PHP API Library\n\nThe Beeper Desktop PHP library provides convenient access to the Beeper Desktop REST API from any PHP 8.1.0+ application.\n\n## Installation\n\nTo use this package, install via Composer by adding the following to your application\'s `composer.json`:\n\n\n```json\n{\n "repositories": [\n {\n "type": "vcs",\n "url": "git@github.com:beeper/desktop-api-php.git"\n }\n ],\n "require": {\n "beeper/desktop-api-php": "dev-main"\n }\n}\n```\n\n\n## Usage\n\n```php\nchats->search(includeMuted: true, limit: 3, type: \'single\');\n\nvar_dump($page->id);\n```',
},
{
- language: 'cli',
+ language: 'python',
content:
- "# Beeper Desktop CLI\n\nThe official CLI for the [Beeper Desktop REST API](https://developers.beeper.com/desktop-api/).\n\nIt is generated with [Stainless](https://www.stainless.com/).\n\n\n\n## Installation\n\n### Installing with Homebrew\n\n~~~sh\nbrew install beeper/tap/beeper-desktop-cli\n~~~\n\n### Installing with Go\n\nTo test or install the CLI locally, you need [Go](https://go.dev/doc/install) version 1.22 or later installed.\n\n~~~sh\ngo install 'github.com/beeper/desktop-api-cli/cmd/beeper-desktop-cli@latest'\n~~~\n\nOnce you have run `go install`, the binary is placed in your Go bin directory:\n\n- **Default location**: `$HOME/go/bin` (or `$GOPATH/bin` if GOPATH is set)\n- **Check your path**: Run `go env GOPATH` to see the base directory\n\nIf commands aren't found after installation, add the Go bin directory to your PATH:\n\n~~~sh\n# Add to your shell profile (.zshrc, .bashrc, etc.)\nexport PATH=\"$PATH:$(go env GOPATH)/bin\"\n~~~\n\n\n\n### Running Locally\n\nAfter cloning the git repository for this project, you can use the\n`scripts/run` script to run the tool locally:\n\n~~~sh\n./scripts/run args...\n~~~\n\n## Usage\n\nThe CLI follows a resource-based command structure:\n\n~~~sh\nbeeper-desktop-cli [resource] [flags...]\n~~~\n\n~~~sh\nbeeper-desktop-cli chats search \\\n --include-muted \\\n --limit 3 \\\n --type single\n~~~\n\nFor details about specific commands, use the `--help` flag.\n\n### Environment variables\n\n| Environment variable | Description | Required |\n| --------------------- | ----------------------------------------------------------------------------------------------------- | -------- |\n| `BEEPER_ACCESS_TOKEN` | Bearer access token obtained via OAuth2 PKCE flow or created in-app. Required for all API operations. | yes |\n\n### Global flags\n\n- `--access-token` - Bearer access token obtained via OAuth2 PKCE flow or created in-app. Required for all API operations. (can also be set with `BEEPER_ACCESS_TOKEN` env var)\n- `--help` - Show command line usage\n- `--debug` - Enable debug logging (includes HTTP request/response details)\n- `--version`, `-v` - Show the CLI version\n- `--base-url` - Use a custom API backend URL\n- `--format` - Change the output format (`auto`, `explore`, `json`, `jsonl`, `pretty`, `raw`, `yaml`)\n- `--format-error` - Change the output format for errors (`auto`, `explore`, `json`, `jsonl`, `pretty`, `raw`, `yaml`)\n- `--transform` - Transform the data output using [GJSON syntax](https://github.com/tidwall/gjson/blob/master/SYNTAX.md)\n- `--transform-error` - Transform the error output using [GJSON syntax](https://github.com/tidwall/gjson/blob/master/SYNTAX.md)\n\n### Passing files as arguments\n\nTo pass files to your API, you can use the `@myfile.ext` syntax:\n\n~~~bash\nbeeper-desktop-cli --arg @abe.jpg\n~~~\n\nFiles can also be passed inside JSON or YAML blobs:\n\n~~~bash\nbeeper-desktop-cli --arg '{image: \"@abe.jpg\"}'\n# Equivalent:\nbeeper-desktop-cli < --username '\\@abe'\n~~~\n\n#### Explicit encoding\n\nFor JSON endpoints, the CLI tool does filetype sniffing to determine whether the\nfile contents should be sent as a string literal (for plain text files) or as a\nbase64-encoded string literal (for binary files). If you need to explicitly send\nthe file as either plain text or base64-encoded data, you can use\n`@file://myfile.txt` (for string encoding) or `@data://myfile.dat` (for\nbase64-encoding). Note that absolute paths will begin with `@file://` or\n`@data://`, followed by a third `/` (for example, `@file:///tmp/file.txt`).\n\n~~~bash\nbeeper-desktop-cli --arg @data://file.txt\n~~~\n",
+ '# Beeper Desktop Python API library\n\n\n[)](https://pypi.org/project/beeper_desktop_api/)\n\nThe Beeper Desktop Python library provides convenient access to the Beeper Desktop REST API from any Python 3.9+\napplication. The library includes type definitions for all request params and response fields,\nand offers both synchronous and asynchronous clients powered by [httpx](https://github.com/encode/httpx).\n\n\n\n\n\n## MCP Server\n\nUse the Beeper Desktop MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.\n\n[](https://cursor.com/en-US/install-mcp?name=%40beeper%2Fdesktop-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBiZWVwZXIvZGVza3RvcC1tY3AiXSwiZW52Ijp7IkJFRVBFUl9BQ0NFU1NfVE9LRU4iOiJNeSBBY2Nlc3MgVG9rZW4ifX0)\n[](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22%40beeper%2Fdesktop-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40beeper%2Fdesktop-mcp%22%5D%2C%22env%22%3A%7B%22BEEPER_ACCESS_TOKEN%22%3A%22My%20Access%20Token%22%7D%7D)\n\n> Note: You may need to set environment variables in your MCP client.\n\n## Documentation\n\nThe REST API documentation can be found on [developers.beeper.com](https://developers.beeper.com/desktop-api/). The full API of this library can be found in [api.md](api.md).\n\n## Installation\n\n```sh\n# install from the production repo\npip install git+ssh://git@github.com/beeper/desktop-api-python.git\n```\n> [!NOTE]\n> Once this package is [published to PyPI](https://www.stainless.com/docs/guides/publish), this will become: `pip install beeper_desktop_api`\n\n## Usage\n\nThe full API of this library can be found in [api.md](api.md).\n\n```python\nimport os\nfrom beeper_desktop_api import BeeperDesktop\n\nclient = BeeperDesktop(\n access_token=os.environ.get("BEEPER_ACCESS_TOKEN"), # This is the default and can be omitted\n)\n\npage = client.chats.search(\n include_muted=True,\n limit=3,\n type="single",\n)\nprint(page.items)\n```\n\nWhile you can provide a `access_token` keyword argument,\nwe recommend using [python-dotenv](https://pypi.org/project/python-dotenv/)\nto add `BEEPER_ACCESS_TOKEN="My Access Token"` to your `.env` file\nso that your Access Token is not stored in source control.\n\n## Async usage\n\nSimply import `AsyncBeeperDesktop` instead of `BeeperDesktop` and use `await` with each API call:\n\n```python\nimport os\nimport asyncio\nfrom beeper_desktop_api import AsyncBeeperDesktop\n\nclient = AsyncBeeperDesktop(\n access_token=os.environ.get("BEEPER_ACCESS_TOKEN"), # This is the default and can be omitted\n)\n\nasync def main() -> None:\n page = await client.chats.search(\n include_muted=True,\n limit=3,\n type="single",\n )\n print(page.items)\n\nasyncio.run(main())\n```\n\nFunctionality between the synchronous and asynchronous clients is otherwise identical.\n\n### With aiohttp\n\nBy default, the async client uses `httpx` for HTTP requests. However, for improved concurrency performance you may also use `aiohttp` as the HTTP backend.\n\nYou can enable this by installing `aiohttp`:\n\n```sh\n# install from the production repo\npip install \'beeper_desktop_api[aiohttp] @ git+ssh://git@github.com/beeper/desktop-api-python.git\'\n```\n\nThen you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`:\n\n```python\nimport os\nimport asyncio\nfrom beeper_desktop_api import DefaultAioHttpClient\nfrom beeper_desktop_api import AsyncBeeperDesktop\n\nasync def main() -> None:\n async with AsyncBeeperDesktop(\n access_token=os.environ.get("BEEPER_ACCESS_TOKEN"), # This is the default and can be omitted\n http_client=DefaultAioHttpClient(),\n) as client:\n page = await client.chats.search(\n include_muted=True,\n limit=3,\n type="single",\n )\n print(page.items)\n\nasyncio.run(main())\n```\n\n\n\n## Using types\n\nNested request parameters are [TypedDicts](https://docs.python.org/3/library/typing.html#typing.TypedDict). Responses are [Pydantic models](https://docs.pydantic.dev) which also provide helper methods for things like:\n\n- Serializing back into JSON, `model.to_json()`\n- Converting to a dictionary, `model.to_dict()`\n\nTyped requests and responses provide autocomplete and documentation within your editor. If you would like to see type errors in VS Code to help catch bugs earlier, set `python.analysis.typeCheckingMode` to `basic`.\n\n## Pagination\n\nList methods in the Beeper Desktop API are paginated.\n\nThis library provides auto-paginating iterators with each list response, so you do not have to request successive pages manually:\n\n```python\nfrom beeper_desktop_api import BeeperDesktop\n\nclient = BeeperDesktop()\n\nall_messages = []\n# Automatically fetches more pages as needed.\nfor message in client.messages.search(\n account_ids=["local-telegram_ba_QFrb5lrLPhO3OT5MFBeTWv0x4BI"],\n limit=10,\n query="deployment",\n):\n # Do something with message here\n all_messages.append(message)\nprint(all_messages)\n```\n\nOr, asynchronously:\n\n```python\nimport asyncio\nfrom beeper_desktop_api import AsyncBeeperDesktop\n\nclient = AsyncBeeperDesktop()\n\nasync def main() -> None:\n all_messages = []\n # Iterate through items across all pages, issuing requests as needed.\n async for message in client.messages.search(\n account_ids=["local-telegram_ba_QFrb5lrLPhO3OT5MFBeTWv0x4BI"],\n limit=10,\n query="deployment",\n):\n all_messages.append(message)\n print(all_messages)\n\nasyncio.run(main())\n```\n\nAlternatively, you can use the `.has_next_page()`, `.next_page_info()`, or `.get_next_page()` methods for more granular control working with pages:\n\n```python\nfirst_page = await client.messages.search(\n account_ids=["local-telegram_ba_QFrb5lrLPhO3OT5MFBeTWv0x4BI"],\n limit=10,\n query="deployment",\n)\nif first_page.has_next_page():\n print(f"will fetch next page using these details: {first_page.next_page_info()}")\n next_page = await first_page.get_next_page()\n print(f"number of items we just fetched: {len(next_page.items)}")\n\n# Remove `await` for non-async usage.\n```\n\nOr just work directly with the returned data:\n\n```python\nfirst_page = await client.messages.search(\n account_ids=["local-telegram_ba_QFrb5lrLPhO3OT5MFBeTWv0x4BI"],\n limit=10,\n query="deployment",\n)\n\nprint(f"next page cursor: {first_page.oldest_cursor}") # => "next page cursor: ..."\nfor message in first_page.items:\n print(message.id)\n\n# Remove `await` for non-async usage.\n```\n\n## Nested params\n\nNested parameters are dictionaries, typed using `TypedDict`, for example:\n\n```python\nfrom beeper_desktop_api import BeeperDesktop\n\nclient = BeeperDesktop()\n\nchat = client.chats.create(\n account_id="accountID",\n user={},\n)\nprint(chat.user)\n```\n\n## File uploads\n\nRequest parameters that correspond to file uploads can be passed as `bytes`, or a [`PathLike`](https://docs.python.org/3/library/os.html#os.PathLike) instance or a tuple of `(filename, contents, media type)`.\n\n```python\nfrom pathlib import Path\nfrom beeper_desktop_api import BeeperDesktop\n\nclient = BeeperDesktop()\n\nclient.assets.upload(\n file=Path("/path/to/file"),\n)\n```\n\nThe async client uses the exact same interface. If you pass a [`PathLike`](https://docs.python.org/3/library/os.html#os.PathLike) instance, the file contents will be read asynchronously automatically.\n\n## Handling errors\n\nWhen the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `beeper_desktop_api.APIConnectionError` is raised.\n\nWhen the API returns a non-success status code (that is, 4xx or 5xx\nresponse), a subclass of `beeper_desktop_api.APIStatusError` is raised, containing `status_code` and `response` properties.\n\nAll errors inherit from `beeper_desktop_api.APIError`.\n\n```python\nimport beeper_desktop_api\nfrom beeper_desktop_api import BeeperDesktop\n\nclient = BeeperDesktop()\n\ntry:\n client.accounts.list()\nexcept beeper_desktop_api.APIConnectionError as e:\n print("The server could not be reached")\n print(e.__cause__) # an underlying Exception, likely raised within httpx.\nexcept beeper_desktop_api.RateLimitError as e:\n print("A 429 status code was received; we should back off a bit.")\nexcept beeper_desktop_api.APIStatusError as e:\n print("Another non-200-range status code was received")\n print(e.status_code)\n print(e.response)\n```\n\nError codes are as follows:\n\n| Status Code | Error Type |\n| ----------- | -------------------------- |\n| 400 | `BadRequestError` |\n| 401 | `AuthenticationError` |\n| 403 | `PermissionDeniedError` |\n| 404 | `NotFoundError` |\n| 422 | `UnprocessableEntityError` |\n| 429 | `RateLimitError` |\n| >=500 | `InternalServerError` |\n| N/A | `APIConnectionError` |\n\n### Retries\n\nCertain errors are automatically retried 2 times by default, with a short exponential backoff.\nConnection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict,\n429 Rate Limit, and >=500 Internal errors are all retried by default.\n\nYou can use the `max_retries` option to configure or disable retry settings:\n\n```python\nfrom beeper_desktop_api import BeeperDesktop\n\n# Configure the default for all requests:\nclient = BeeperDesktop(\n # default is 2\n max_retries=0,\n)\n\n# Or, configure per-request:\nclient.with_options(max_retries = 5).accounts.list()\n```\n\n### Timeouts\n\nBy default requests time out after 30 seconds. You can configure this with a `timeout` option,\nwhich accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/timeouts/#fine-tuning-the-configuration) object:\n\n```python\nfrom beeper_desktop_api import BeeperDesktop\n\n# Configure the default for all requests:\nclient = BeeperDesktop(\n # 20 seconds (default is 30 seconds)\n timeout=20.0,\n)\n\n# More granular control:\nclient = BeeperDesktop(\n timeout=httpx.Timeout(60.0, read=5.0, write=10.0, connect=2.0),\n)\n\n# Override per-request:\nclient.with_options(timeout = 5.0).accounts.list()\n```\n\nOn timeout, an `APITimeoutError` is thrown.\n\nNote that requests that time out are [retried twice by default](#retries).\n\n\n\n## Advanced\n\n### Logging\n\nWe use the standard library [`logging`](https://docs.python.org/3/library/logging.html) module.\n\nYou can enable logging by setting the environment variable `BEEPER_LOG` to `info`.\n\n```shell\n$ export BEEPER_LOG=info\n```\n\nOr to `debug` for more verbose logging.\n\n### How to tell whether `None` means `null` or missing\n\nIn an API response, a field may be explicitly `null`, or missing entirely; in either case, its value is `None` in this library. You can differentiate the two cases with `.model_fields_set`:\n\n```py\nif response.my_field is None:\n if \'my_field\' not in response.model_fields_set:\n print(\'Got json like {}, without a "my_field" key present at all.\')\n else:\n print(\'Got json like {"my_field": null}.\')\n```\n\n### Accessing raw response data (e.g. headers)\n\nThe "raw" Response object can be accessed by prefixing `.with_raw_response.` to any HTTP method call, e.g.,\n\n```py\nfrom beeper_desktop_api import BeeperDesktop\n\nclient = BeeperDesktop()\nresponse = client.accounts.with_raw_response.list()\nprint(response.headers.get(\'X-My-Header\'))\n\naccount = response.parse() # get the object that `accounts.list()` would have returned\nprint(account)\n```\n\nThese methods return an [`APIResponse`](https://github.com/beeper/desktop-api-python/tree/main/src/beeper_desktop_api/_response.py) object.\n\nThe async client returns an [`AsyncAPIResponse`](https://github.com/beeper/desktop-api-python/tree/main/src/beeper_desktop_api/_response.py) with the same structure, the only difference being `await`able methods for reading the response content.\n\n#### `.with_streaming_response`\n\nThe above interface eagerly reads the full response body when you make the request, which may not always be what you want.\n\nTo stream the response body, use `.with_streaming_response` instead, which requires a context manager and only reads the response body once you call `.read()`, `.text()`, `.json()`, `.iter_bytes()`, `.iter_text()`, `.iter_lines()` or `.parse()`. In the async client, these are async methods.\n\n```python\nwith client.accounts.with_streaming_response.list() as response :\n print(response.headers.get(\'X-My-Header\'))\n\n for line in response.iter_lines():\n print(line)\n```\n\nThe context manager is required so that the response will reliably be closed.\n\n### Making custom/undocumented requests\n\nThis library is typed for convenient access to the documented API.\n\nIf you need to access undocumented endpoints, params, or response properties, the library can still be used.\n\n#### Undocumented endpoints\n\nTo make requests to undocumented endpoints, you can make requests using `client.get`, `client.post`, and other\nhttp verbs. Options on the client will be respected (such as retries) when making this request.\n\n```py\nimport httpx\n\nresponse = client.post(\n "/foo",\n cast_to=httpx.Response,\n body={"my_param": True},\n)\n\nprint(response.headers.get("x-foo"))\n```\n\n#### Undocumented request params\n\nIf you want to explicitly send an extra param, you can do so with the `extra_query`, `extra_body`, and `extra_headers` request\noptions.\n\n#### Undocumented response properties\n\nTo access undocumented response properties, you can access the extra fields like `response.unknown_prop`. You\ncan also get all the extra fields on the Pydantic model as a dict with\n[`response.model_extra`](https://docs.pydantic.dev/latest/api/base_model/#pydantic.BaseModel.model_extra).\n\n### Configuring the HTTP client\n\nYou can directly override the [httpx client](https://www.python-httpx.org/api/#client) to customize it for your use case, including:\n\n- Support for [proxies](https://www.python-httpx.org/advanced/proxies/)\n- Custom [transports](https://www.python-httpx.org/advanced/transports/)\n- Additional [advanced](https://www.python-httpx.org/advanced/clients/) functionality\n\n```python\nimport httpx\nfrom beeper_desktop_api import BeeperDesktop, DefaultHttpxClient\n\nclient = BeeperDesktop(\n # Or use the `BEEPER_BASE_URL` env var\n base_url="http://my.test.server.example.com:8083",\n http_client=DefaultHttpxClient(proxy="http://my.test.proxy.example.com", transport=httpx.HTTPTransport(local_address="0.0.0.0")),\n)\n```\n\nYou can also customize the client on a per-request basis by using `with_options()`:\n\n```python\nclient.with_options(http_client=DefaultHttpxClient(...))\n```\n\n### Managing HTTP resources\n\nBy default the library closes underlying HTTP connections whenever the client is [garbage collected](https://docs.python.org/3/reference/datamodel.html#object.__del__). You can manually close the client using the `.close()` method if desired, or with a context manager that closes when exiting.\n\n```py\nfrom beeper_desktop_api import BeeperDesktop\n\nwith BeeperDesktop() as client:\n # make requests here\n ...\n\n# HTTP client is now closed\n```\n\n## Versioning\n\nThis package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:\n\n1. Changes that only affect static types, without breaking runtime behavior.\n2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_\n3. Changes that we do not expect to impact the vast majority of users in practice.\n\nWe take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.\n\nWe are keen for your feedback; please open an [issue](https://www.github.com/beeper/desktop-api-python/issues) with questions, bugs, or suggestions.\n\n### Determining the installed version\n\nIf you\'ve upgraded to the latest version but aren\'t seeing any new features you were expecting then your python environment is likely still using an older version.\n\nYou can determine the version that is being used at runtime with:\n\n```py\nimport beeper_desktop_api\nprint(beeper_desktop_api.__version__)\n```\n\n## Requirements\n\nPython 3.9 or higher.\n\n## Contributing\n\nSee [the contributing documentation](./CONTRIBUTING.md).\n',
},
{
- language: 'php',
+ language: 'typescript',
content:
- '# Beeper Desktop PHP API Library\n\nThe Beeper Desktop PHP library provides convenient access to the Beeper Desktop REST API from any PHP 8.1.0+ application.\n\n## Installation\n\nTo use this package, install via Composer by adding the following to your application\'s `composer.json`:\n\n\n```json\n{\n "repositories": [\n {\n "type": "vcs",\n "url": "git@github.com:beeper/desktop-api-php.git"\n }\n ],\n "require": {\n "beeper/desktop-api-php": "dev-main"\n }\n}\n```\n\n\n## Usage\n\n```php\nchats->search(includeMuted: true, limit: 3, type: \'single\');\n\nvar_dump($page->id);\n```',
+ "# TypeScript SDK for Beeper Desktop API Library\n\n[)](https://npmjs.org/package/@beeper/desktop-api) \n\nThis library provides convenient access to the Beeper Desktop REST API from server-side TypeScript or JavaScript.\n\n\n\nThe REST API documentation can be found on [developers.beeper.com](https://developers.beeper.com/desktop-api/). The full API of this library can be found in [api.md](api.md).\n\n\n\n## MCP Server\n\nUse the Beeper Desktop MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.\n\n[](https://cursor.com/en-US/install-mcp?name=%40beeper%2Fdesktop-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBiZWVwZXIvZGVza3RvcC1tY3AiXSwiZW52Ijp7IkJFRVBFUl9BQ0NFU1NfVE9LRU4iOiJNeSBBY2Nlc3MgVG9rZW4ifX0)\n[](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22%40beeper%2Fdesktop-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40beeper%2Fdesktop-mcp%22%5D%2C%22env%22%3A%7B%22BEEPER_ACCESS_TOKEN%22%3A%22My%20Access%20Token%22%7D%7D)\n\n> Note: You may need to set environment variables in your MCP client.\n\n## Installation\n\n```sh\nnpm install @beeper/desktop-api\n```\n\n\n\n## Usage\n\nThe full API of this library can be found in [api.md](api.md).\n\n\n```js\nimport BeeperDesktop from '@beeper/desktop-api';\n\nconst client = new BeeperDesktop({\n accessToken: process.env['BEEPER_ACCESS_TOKEN'], // This is the default and can be omitted\n});\n\nconst page = await client.chats.search({\n includeMuted: true,\n limit: 3,\n type: 'single',\n});\nconst chat = page.items[0];\n\nconsole.log(chat.id);\n```\n\n\n\n### Request & Response types\n\nThis library includes TypeScript definitions for all request params and response fields. You may import and use them like so:\n\n\n```ts\nimport BeeperDesktop from '@beeper/desktop-api';\n\nconst client = new BeeperDesktop({\n accessToken: process.env['BEEPER_ACCESS_TOKEN'], // This is the default and can be omitted\n});\n\nconst accounts: BeeperDesktop.AccountListResponse = await client.accounts.list();\n```\n\nDocumentation for each method, request param, and response field are available in docstrings and will appear on hover in most modern editors.\n\n## File uploads\n\nRequest parameters that correspond to file uploads can be passed in many different forms:\n- `File` (or an object with the same structure)\n- a `fetch` `Response` (or an object with the same structure)\n- an `fs.ReadStream`\n- the return value of our `toFile` helper\n\n```ts\nimport fs from 'fs';\nimport BeeperDesktop, { toFile } from '@beeper/desktop-api';\n\nconst client = new BeeperDesktop();\n\n// If you have access to Node `fs` we recommend using `fs.createReadStream()`:\nawait client.assets.upload({ file: fs.createReadStream('/path/to/file') });\n\n// Or if you have the web `File` API you can pass a `File` instance:\nawait client.assets.upload({ file: new File(['my bytes'], 'file') });\n\n// You can also pass a `fetch` `Response`:\nawait client.assets.upload({ file: await fetch('https://somesite/file') });\n\n// Finally, if none of the above are convenient, you can use our `toFile` helper:\nawait client.assets.upload({ file: await toFile(Buffer.from('my bytes'), 'file') });\nawait client.assets.upload({ file: await toFile(new Uint8Array([0, 1, 2]), 'file') });\n```\n\n\n\n## Handling errors\n\nWhen the library is unable to connect to the API,\nor if the API returns a non-success status code (i.e., 4xx or 5xx response),\na subclass of `APIError` will be thrown:\n\n\n```ts\nconst accounts = await client.accounts.list().catch(async (err) => {\n if (err instanceof BeeperDesktop.APIError) {\n console.log(err.status); // 400\n console.log(err.name); // BadRequestError\n console.log(err.headers); // {server: 'nginx', ...}\n } else {\n throw err;\n }\n});\n```\n\nError codes are as follows:\n\n| Status Code | Error Type |\n| ----------- | -------------------------- |\n| 400 | `BadRequestError` |\n| 401 | `AuthenticationError` |\n| 403 | `PermissionDeniedError` |\n| 404 | `NotFoundError` |\n| 422 | `UnprocessableEntityError` |\n| 429 | `RateLimitError` |\n| >=500 | `InternalServerError` |\n| N/A | `APIConnectionError` |\n\n### Retries\n\nCertain errors will be automatically retried 2 times by default, with a short exponential backoff.\nConnection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict,\n429 Rate Limit, and >=500 Internal errors will all be retried by default.\n\nYou can use the `maxRetries` option to configure or disable this:\n\n\n```js\n// Configure the default for all requests:\nconst client = new BeeperDesktop({\n maxRetries: 0, // default is 2\n});\n\n// Or, configure per-request:\nawait client.accounts.list({\n maxRetries: 5,\n});\n```\n\n### Timeouts\n\nRequests time out after 30 seconds by default. You can configure this with a `timeout` option:\n\n\n```ts\n// Configure the default for all requests:\nconst client = new BeeperDesktop({\n timeout: 20 * 1000, // 20 seconds (default is 30 seconds)\n});\n\n// Override per-request:\nawait client.accounts.list({\n timeout: 5 * 1000,\n});\n```\n\nOn timeout, an `APIConnectionTimeoutError` is thrown.\n\nNote that requests which time out will be [retried twice by default](#retries).\n\n## Auto-pagination\n\nList methods in the BeeperDesktop API are paginated.\nYou can use the `for await … of` syntax to iterate through items across all pages:\n\n```ts\nasync function fetchAllMessages(params) {\n const allMessages = [];\n // Automatically fetches more pages as needed.\n for await (const message of client.messages.search({\n accountIDs: ['local-telegram_ba_QFrb5lrLPhO3OT5MFBeTWv0x4BI'],\n limit: 10,\n query: 'deployment',\n })) {\n allMessages.push(message);\n }\n return allMessages;\n}\n```\n\nAlternatively, you can request a single page at a time:\n\n```ts\nlet page = await client.messages.search({\n accountIDs: ['local-telegram_ba_QFrb5lrLPhO3OT5MFBeTWv0x4BI'],\n limit: 10,\n query: 'deployment',\n});\nfor (const message of page.items) {\n console.log(message);\n}\n\n// Convenience methods are provided for manually paginating:\nwhile (page.hasNextPage()) {\n page = await page.getNextPage();\n // ...\n}\n```\n\n\n\n## Advanced Usage\n\n### Tree shaking\n\nThis library supports tree shaking to reduce bundle size. Instead of importing the full client, you can create a client only including the API resources you need:\n\n~~~ts\nimport { createClient } from '@beeper/desktop-api/tree-shakable';\nimport { Accounts } from '@beeper/desktop-api/resources/accounts/accounts';\nimport { BaseChats } from '@beeper/desktop-api/resources/chats/chats';\n\nconst client = createClient({\n // Specify the resources you'd like to use ...\n resources: [Accounts, BaseChats],\n});\n\n// ... then make API calls as usual.\nconst accounts = await client.accounts.list();\nconst chat = await client.chats.retrieve('!NCdzlIaMjZUmvmvyHU:beeper.com');\n~~~\n\nEach API resource has two versions, the full resource (e.g., `Accounts`) which includes all subresources, and the base resource (e.g., `BaseAccounts`) which does not.\n\nThe tree-shaken client is fully typed, so TypeScript will provide accurate autocomplete and prevent access to resources not included in your configuration.\nThe `createClient` function automatically infers the correct type, but you can also use the `PartialBeeperDesktop` type explicitly:\n\n~~~ts\nimport BeeperDesktop from '@beeper/desktop-api';\nimport { createClient, type PartialBeeperDesktop } from '@beeper/desktop-api/tree-shakable';\nimport { BaseAccounts } from '@beeper/desktop-api/resources/accounts/accounts';\n\n// Explicit variable type\nconst client: PartialBeeperDesktop<{ accounts: BaseAccounts }> = createClient({\n resources: [BaseAccounts],\n /* ... */\n});\n\n// Function parameter type\nasync function main(client: PartialBeeperDesktop<{ accounts: BaseAccounts }>) {\n const accounts = await client.accounts.list();\n}\n\n// Works with any client that has the accounts resource\nconst treeShakableClient = createClient({\n resources: [BaseAccounts],\n /* ... */\n});\nconst fullClient = new BeeperDesktop(/* ... */);\n\nmain(treeShakableClient); // Works\nmain(fullClient); // Also works\n~~~\n\n### Accessing raw Response data (e.g., headers)\n\nThe \"raw\" `Response` returned by `fetch()` can be accessed through the `.asResponse()` method on the `APIPromise` type that all methods return.\nThis method returns as soon as the headers for a successful response are received and does not consume the response body, so you are free to write custom parsing or streaming logic.\n\nYou can also use the `.withResponse()` method to get the raw `Response` along with the parsed data.\nUnlike `.asResponse()` this method consumes the body, returning once it is parsed.\n\n\n```ts\nconst client = new BeeperDesktop();\n\nconst response = await client.accounts.list().asResponse();\nconsole.log(response.headers.get('X-My-Header'));\nconsole.log(response.statusText); // access the underlying Response object\n\nconst { data: accounts, response: raw } = await client.accounts.list().withResponse();\nconsole.log(raw.headers.get('X-My-Header'));\nconsole.log(accounts);\n```\n\n### Logging\n\n> [!IMPORTANT]\n> All log messages are intended for debugging only. The format and content of log messages\n> may change between releases.\n\n#### Log levels\n\nThe log level can be configured in two ways:\n\n1. Via the `BEEPER_LOG` environment variable\n2. Using the `logLevel` client option (overrides the environment variable if set)\n\n```ts\nimport BeeperDesktop from '@beeper/desktop-api';\n\nconst client = new BeeperDesktop({\n logLevel: 'debug', // Show all log messages\n});\n```\n\nAvailable log levels, from most to least verbose:\n\n- `'debug'` - Show debug messages, info, warnings, and errors\n- `'info'` - Show info messages, warnings, and errors\n- `'warn'` - Show warnings and errors (default)\n- `'error'` - Show only errors\n- `'off'` - Disable all logging\n\nAt the `'debug'` level, all HTTP requests and responses are logged, including headers and bodies.\nSome authentication-related headers are redacted, but sensitive data in request and response bodies\nmay still be visible.\n\n#### Custom logger\n\nBy default, this library logs to `globalThis.console`. You can also provide a custom logger.\nMost logging libraries are supported, including [pino](https://www.npmjs.com/package/pino), [winston](https://www.npmjs.com/package/winston), [bunyan](https://www.npmjs.com/package/bunyan), [consola](https://www.npmjs.com/package/consola), [signale](https://www.npmjs.com/package/signale), and [@std/log](https://jsr.io/@std/log). If your logger doesn't work, please open an issue.\n\nWhen providing a custom logger, the `logLevel` option still controls which messages are emitted, messages\nbelow the configured level will not be sent to your logger.\n\n```ts\nimport BeeperDesktop from '@beeper/desktop-api';\nimport pino from 'pino';\n\nconst logger = pino();\n\nconst client = new BeeperDesktop({\n logger: logger.child({ name: 'BeeperDesktop' }),\n logLevel: 'debug', // Send all messages to pino, allowing it to filter\n});\n```\n\n### Making custom/undocumented requests\n\nThis library is typed for convenient access to the documented API. If you need to access undocumented\nendpoints, params, or response properties, the library can still be used.\n\n#### Undocumented endpoints\n\nTo make requests to undocumented endpoints, you can use `client.get`, `client.post`, and other HTTP verbs.\nOptions on the client, such as retries, will be respected when making these requests.\n\n```ts\nawait client.post('/some/path', {\n body: { some_prop: 'foo' },\n query: { some_query_arg: 'bar' },\n});\n```\n\n#### Undocumented request params\n\nTo make requests using undocumented parameters, you may use `// @ts-expect-error` on the undocumented\nparameter. This library doesn't validate at runtime that the request matches the type, so any extra values you\nsend will be sent as-is.\n\n```ts\nclient.chats.search({\n // ...\n // @ts-expect-error baz is not yet public\n baz: 'undocumented option',\n});\n```\n\nFor requests with the `GET` verb, any extra params will be in the query, all other requests will send the\nextra param in the body.\n\nIf you want to explicitly send an extra argument, you can do so with the `query`, `body`, and `headers` request\noptions.\n\n#### Undocumented response properties\n\nTo access undocumented response properties, you may access the response object with `// @ts-expect-error` on\nthe response object, or cast the response object to the requisite type. Like the request params, we do not\nvalidate or strip extra properties from the response from the API.\n\n### Customizing the fetch client\n\nBy default, this library expects a global `fetch` function is defined.\n\nIf you want to use a different `fetch` function, you can either polyfill the global:\n\n```ts\nimport fetch from 'my-fetch';\n\nglobalThis.fetch = fetch;\n```\n\nOr pass it to the client:\n\n```ts\nimport BeeperDesktop from '@beeper/desktop-api';\nimport fetch from 'my-fetch';\n\nconst client = new BeeperDesktop({ fetch });\n```\n\n### Fetch options\n\nIf you want to set custom `fetch` options without overriding the `fetch` function, you can provide a `fetchOptions` object when instantiating the client or making a request. (Request-specific options override client options.)\n\n```ts\nimport BeeperDesktop from '@beeper/desktop-api';\n\nconst client = new BeeperDesktop({\n fetchOptions: {\n // `RequestInit` options\n },\n});\n```\n\n#### Configuring proxies\n\nTo modify proxy behavior, you can provide custom `fetchOptions` that add runtime-specific proxy\noptions to requests:\n\n
**Node** [[docs](https://github.com/nodejs/undici/blob/main/docs/docs/api/ProxyAgent.md#example---proxyagent-with-fetch)]\n\n```ts\nimport BeeperDesktop from '@beeper/desktop-api';\nimport * as undici from 'undici';\n\nconst proxyAgent = new undici.ProxyAgent('http://localhost:8888');\nconst client = new BeeperDesktop({\n fetchOptions: {\n dispatcher: proxyAgent,\n },\n});\n```\n\n
**Bun** [[docs](https://bun.sh/guides/http/proxy)]\n\n```ts\nimport BeeperDesktop from '@beeper/desktop-api';\n\nconst client = new BeeperDesktop({\n fetchOptions: {\n proxy: 'http://localhost:8888',\n },\n});\n```\n\n
**Deno** [[docs](https://docs.deno.com/api/deno/~/Deno.createHttpClient)]\n\n```ts\nimport BeeperDesktop from 'npm:@beeper/desktop-api';\n\nconst httpClient = Deno.createHttpClient({ proxy: { url: 'http://localhost:8888' } });\nconst client = new BeeperDesktop({\n fetchOptions: {\n client: httpClient,\n },\n});\n```\n\n## Frequently Asked Questions\n\n## Semantic versioning\n\nThis package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:\n\n1. Changes that only affect static types, without breaking runtime behavior.\n2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_\n3. Changes that we do not expect to impact the vast majority of users in practice.\n\nWe take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.\n\nWe are keen for your feedback; please open an [issue](https://www.github.com/beeper/desktop-api-js/issues) with questions, bugs, or suggestions.\n\n## Requirements\n\nTypeScript >= 4.9 is supported.\n\nThe following runtimes are supported:\n\n- Web browsers (Up-to-date Chrome, Firefox, Safari, Edge, and more)\n- Node.js 20 LTS or later ([non-EOL](https://endoflife.date/nodejs)) versions.\n- Deno v1.28.0 or higher.\n- Bun 1.0 or later.\n- Cloudflare Workers.\n- Vercel Edge Runtime.\n- Jest 28 or greater with the `\"node\"` environment (`\"jsdom\"` is not supported at this time).\n- Nitro v2.6 or greater.\n\nNote that React Native is not supported at this time.\n\nIf you are interested in other runtime environments, please open or upvote an issue on GitHub.\n\n## Contributing\n\nSee [the contributing documentation](./CONTRIBUTING.md).\n",
},
];
diff --git a/packages/mcp-server/src/server.ts b/packages/mcp-server/src/server.ts
index b47894fe..d5e01aeb 100644
--- a/packages/mcp-server/src/server.ts
+++ b/packages/mcp-server/src/server.ts
@@ -28,7 +28,7 @@ export const newMcpServer = async ({
new McpServer(
{
name: 'beeper_desktop_api_api',
- version: '4.7.1',
+ version: '4.8.0',
},
{
instructions: await getInstructions({ stainlessApiKey, customInstructionsPath }),
diff --git a/packages/mcp-server/src/util.ts b/packages/mcp-server/src/util.ts
index 40ed5501..069a2b47 100644
--- a/packages/mcp-server/src/util.ts
+++ b/packages/mcp-server/src/util.ts
@@ -2,9 +2,9 @@
export const readEnv = (env: string): string | undefined => {
if (typeof (globalThis as any).process !== 'undefined') {
- return (globalThis as any).process.env?.[env]?.trim();
+ return (globalThis as any).process.env?.[env]?.trim() || undefined;
} else if (typeof (globalThis as any).Deno !== 'undefined') {
- return (globalThis as any).Deno.env?.get?.(env)?.trim();
+ return (globalThis as any).Deno.env?.get?.(env)?.trim() || undefined;
}
return;
};
diff --git a/scripts/bootstrap b/scripts/bootstrap
index a8b69ff3..2e315f53 100755
--- a/scripts/bootstrap
+++ b/scripts/bootstrap
@@ -4,7 +4,7 @@ set -e
cd "$(dirname "$0")/.."
-if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ] && [ "$SKIP_BREW" != "1" ] && [ -t 0 ]; then
+if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ] && [ "${SKIP_BREW:-}" != "1" ] && [ -t 0 ]; then
brew bundle check >/dev/null 2>&1 || {
echo -n "==> Install Homebrew dependencies? (y/N): "
read -r response
diff --git a/scripts/detect-breaking-changes b/scripts/detect-breaking-changes
new file mode 100755
index 00000000..034131ce
--- /dev/null
+++ b/scripts/detect-breaking-changes
@@ -0,0 +1,31 @@
+#!/usr/bin/env bash
+
+set -e
+
+cd "$(dirname "$0")/.."
+
+echo "==> Detecting breaking changes"
+
+TEST_PATHS=(
+ tests/api-resources/top-level.test.ts
+ tests/api-resources/accounts/accounts.test.ts
+ tests/api-resources/accounts/contacts.test.ts
+ tests/api-resources/chats/chats.test.ts
+ tests/api-resources/chats/reminders.test.ts
+ tests/api-resources/chats/messages/messages.test.ts
+ tests/api-resources/chats/messages/reactions.test.ts
+ tests/api-resources/messages.test.ts
+ tests/api-resources/assets.test.ts
+ tests/api-resources/info.test.ts
+ tests/index.test.ts
+)
+
+for PATHSPEC in "${TEST_PATHS[@]}"; do
+ # Try to check out previous versions of the test files
+ # with the current SDK.
+ git checkout "$1" -- "${PATHSPEC}" 2>/dev/null || true
+done
+
+# Instead of running the tests, use the linter to check if an
+# older test is no longer compatible with the latest SDK.
+./scripts/lint
diff --git a/scripts/fast-format b/scripts/fast-format
index 53721ac0..f1873aef 100755
--- a/scripts/fast-format
+++ b/scripts/fast-format
@@ -31,10 +31,7 @@ if ! [ -z "$ESLINT_FILES" ]; then
fi
echo "==> Running prettier --write"
-# format things eslint didn't
-PRETTIER_FILES="$(grep '\.\(js\|json\)$' "$FILE_LIST" || true)"
-if ! [ -z "$PRETTIER_FILES" ]; then
- echo "$PRETTIER_FILES" | xargs ./node_modules/.bin/prettier \
- --write --cache --cache-strategy metadata --no-error-on-unmatched-pattern \
- '!**/dist' '!**/*.ts' '!**/*.mts' '!**/*.cts' '!**/*.js' '!**/*.mjs' '!**/*.cjs'
+if ! [ -z "$FILE_LIST" ]; then
+ cat "$FILE_LIST" | xargs ./node_modules/.bin/prettier \
+ --write --cache --cache-strategy metadata --no-error-on-unmatched-pattern --ignore-unknown
fi
diff --git a/scripts/format b/scripts/format
index 7a756401..b1b2c17a 100755
--- a/scripts/format
+++ b/scripts/format
@@ -8,5 +8,4 @@ echo "==> Running eslint --fix"
./node_modules/.bin/eslint --fix .
echo "==> Running prettier --write"
-# format things eslint didn't
-./node_modules/.bin/prettier --write --cache --cache-strategy metadata . '!**/dist' '!**/*.ts' '!**/*.mts' '!**/*.cts' '!**/*.js' '!**/*.mjs' '!**/*.cjs'
+./node_modules/.bin/prettier --write --cache --cache-strategy metadata .
diff --git a/scripts/lint b/scripts/lint
index 3ffb78a6..1f532548 100755
--- a/scripts/lint
+++ b/scripts/lint
@@ -4,6 +4,9 @@ set -e
cd "$(dirname "$0")/.."
+echo "==> Running prettier --check"
+./node_modules/.bin/prettier --check .
+
echo "==> Running eslint"
./node_modules/.bin/eslint .
diff --git a/scripts/mock b/scripts/mock
index 7c58865f..9c7c4399 100755
--- a/scripts/mock
+++ b/scripts/mock
@@ -22,9 +22,9 @@ echo "==> Starting mock server with URL ${URL}"
# Run steady mock on the given spec
if [ "$1" == "--daemon" ]; then
# Pre-install the package so the download doesn't eat into the startup timeout
- npm exec --package=@stdy/cli@0.20.2 -- steady --version
+ npm exec --package=@stdy/cli@0.22.1 -- steady --version
- npm exec --package=@stdy/cli@0.20.2 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=repeat --validator-form-array-format=repeat --validator-query-object-format=brackets --validator-form-object-format=brackets "$URL" &> .stdy.log &
+ npm exec --package=@stdy/cli@0.22.1 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=repeat --validator-form-array-format=repeat --validator-query-object-format=brackets --validator-form-object-format=brackets "$URL" &> .stdy.log &
# Wait for server to come online via health endpoint (max 30s)
echo -n "Waiting for server"
@@ -48,5 +48,5 @@ if [ "$1" == "--daemon" ]; then
echo
else
- npm exec --package=@stdy/cli@0.20.2 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=repeat --validator-form-array-format=repeat --validator-query-object-format=brackets --validator-form-object-format=brackets "$URL"
+ npm exec --package=@stdy/cli@0.22.1 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=repeat --validator-form-array-format=repeat --validator-query-object-format=brackets --validator-form-object-format=brackets "$URL"
fi
diff --git a/scripts/test b/scripts/test
index 69a0a1f2..ded574cd 100755
--- a/scripts/test
+++ b/scripts/test
@@ -43,7 +43,7 @@ elif ! steady_is_running ; then
echo -e "To run the server, pass in the path or url of your OpenAPI"
echo -e "spec to the steady command:"
echo
- echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.20.2 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-query-array-format=repeat --validator-form-array-format=repeat --validator-query-object-format=brackets --validator-form-object-format=brackets${NC}"
+ echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.22.1 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-query-array-format=repeat --validator-form-array-format=repeat --validator-query-object-format=brackets --validator-form-object-format=brackets${NC}"
echo
exit 1
diff --git a/scripts/utils/postprocess-files.cjs b/scripts/utils/postprocess-files.cjs
index deae575e..a8cdeb7c 100644
--- a/scripts/utils/postprocess-files.cjs
+++ b/scripts/utils/postprocess-files.cjs
@@ -23,12 +23,19 @@ async function postprocess() {
// strip out lib="dom", types="node", and types="react" references; these
// are needed at build time, but would pollute the user's TS environment
- const transformed = code.replace(
+ let transformed = code.replace(
/^ *\/\/\/ * ' '.repeat(match.length - 1) + '\n',
);
+ // TypeScript's declaration emitter collapses /** @ts-ignore */ onto the same
+ // line as the type declaration, which doesn't work. So we convert to // @ts-ignore
+ // on its own line to properly suppresses errors.
+ if (file.endsWith('.d.ts') || file.endsWith('.d.mts') || file.endsWith('.d.cts')) {
+ transformed = transformed.replace(/\/\*\* @ts-ignore\b[^*]*\*\/ /gm, '// @ts-ignore\n');
+ }
+
if (transformed !== code) {
console.error(`wrote ${path.relative(process.cwd(), file)}`);
await fs.promises.writeFile(file, transformed, 'utf8');
diff --git a/src/client.ts b/src/client.ts
index c7abdf15..0edf0c47 100644
--- a/src/client.ts
+++ b/src/client.ts
@@ -21,8 +21,6 @@ import {
CursorNoLimitResponse,
type CursorSearchParams,
CursorSearchResponse,
- type CursorSortKeyParams,
- CursorSortKeyResponse,
} from './core/pagination';
import * as Uploads from './core/uploads';
import * as API from './resources/index';
@@ -85,7 +83,7 @@ export interface ClientOptions {
/**
* Override the default base URL for the API, e.g., "https://api.example.com/v2/"
*
- * Defaults to process.env['BEEPER_DESKTOP_BASE_URL'].
+ * Defaults to process.env['BEEPER_BASE_URL'].
*/
baseURL?: string | null | undefined;
@@ -139,7 +137,7 @@ export interface ClientOptions {
/**
* Set the log level.
*
- * Defaults to process.env['BEEPER_DESKTOP_LOG'] or 'warn' if it isn't set.
+ * Defaults to process.env['BEEPER_LOG'] or 'warn' if it isn't set.
*/
logLevel?: LogLevel | undefined;
@@ -152,9 +150,9 @@ export interface ClientOptions {
}
/**
- * API Client for interfacing with the Beeper Desktop API.
+ * Base class for Beeper Desktop API clients.
*/
-export class BeeperDesktop {
+export class BaseBeeperDesktop {
accessToken: string;
baseURL: string;
@@ -173,7 +171,7 @@ export class BeeperDesktop {
* API Client for interfacing with the Beeper Desktop API.
*
* @param {string | undefined} [opts.accessToken=process.env['BEEPER_ACCESS_TOKEN'] ?? undefined]
- * @param {string} [opts.baseURL=process.env['BEEPER_DESKTOP_BASE_URL'] ?? http://localhost:23373] - Override the default base URL for the API.
+ * @param {string} [opts.baseURL=process.env['BEEPER_BASE_URL'] ?? http://localhost:23373] - Override the default base URL for the API.
* @param {number} [opts.timeout=30 seconds] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
* @param {MergedRequestInit} [opts.fetchOptions] - Additional `RequestInit` options to be passed to `fetch` calls.
* @param {Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.
@@ -182,7 +180,7 @@ export class BeeperDesktop {
* @param {Record} opts.defaultQuery - Default query parameters to include with every request to the API.
*/
constructor({
- baseURL = readEnv('BEEPER_DESKTOP_BASE_URL'),
+ baseURL = readEnv('BEEPER_BASE_URL'),
accessToken = readEnv('BEEPER_ACCESS_TOKEN'),
...opts
}: ClientOptions = {}) {
@@ -199,20 +197,32 @@ export class BeeperDesktop {
};
this.baseURL = options.baseURL!;
- this.timeout = options.timeout ?? BeeperDesktop.DEFAULT_TIMEOUT /* 30 seconds */;
+ this.timeout = options.timeout ?? BaseBeeperDesktop.DEFAULT_TIMEOUT /* 30 seconds */;
this.logger = options.logger ?? console;
const defaultLogLevel = 'warn';
// Set default logLevel early so that we can log a warning in parseLogLevel.
this.logLevel = defaultLogLevel;
this.logLevel =
parseLogLevel(options.logLevel, 'ClientOptions.logLevel', this) ??
- parseLogLevel(readEnv('BEEPER_DESKTOP_LOG'), "process.env['BEEPER_DESKTOP_LOG']", this) ??
+ parseLogLevel(readEnv('BEEPER_LOG'), "process.env['BEEPER_LOG']", this) ??
defaultLogLevel;
this.fetchOptions = options.fetchOptions;
this.maxRetries = options.maxRetries ?? 2;
this.fetch = options.fetch ?? Shims.getDefaultFetch();
this.#encoder = Opts.FallbackEncoder;
+ const customHeadersEnv = readEnv('BEEPER_CUSTOM_HEADERS');
+ if (customHeadersEnv) {
+ const parsed: Record = {};
+ for (const line of customHeadersEnv.split('\n')) {
+ const colon = line.indexOf(':');
+ if (colon >= 0) {
+ parsed[line.substring(0, colon).trim()] = line.substring(colon + 1).trim();
+ }
+ }
+ options.defaultHeaders = { ...parsed, ...options.defaultHeaders };
+ }
+
this._options = options;
this.accessToken = accessToken;
@@ -282,7 +292,14 @@ export class BeeperDesktop {
return;
}
- protected async authHeaders(opts: FinalRequestOptions): Promise {
+ protected async authHeaders(
+ opts: FinalRequestOptions,
+ schemes: { bearerAuth?: boolean },
+ ): Promise {
+ return buildHeaders([schemes.bearerAuth ? await this.bearerAuth(opts) : null]);
+ }
+
+ protected async bearerAuth(opts: FinalRequestOptions): Promise {
return buildHeaders([{ Authorization: `Bearer ${this.accessToken}` }]);
}
@@ -733,7 +750,7 @@ export class BeeperDesktop {
...(options.timeout ? { 'X-Stainless-Timeout': String(Math.trunc(options.timeout / 1000)) } : {}),
...getPlatformHeaders(),
},
- await this.authHeaders(options),
+ await this.authHeaders(options, options.__security ?? { bearerAuth: true }),
this._options.defaultHeaders,
bodyHeaders,
options.headers,
@@ -795,8 +812,14 @@ export class BeeperDesktop {
}
}
- static BeeperDesktop = this;
static DEFAULT_TIMEOUT = 30000; // 30 seconds
+}
+
+/**
+ * API Client for interfacing with the Beeper Desktop API.
+ */
+export class BeeperDesktop extends BaseBeeperDesktop {
+ static BeeperDesktop = this;
static BeeperDesktopError = Errors.BeeperDesktopError;
static APIError = Errors.APIError;
@@ -854,12 +877,6 @@ export declare namespace BeeperDesktop {
type CursorNoLimitResponse as CursorNoLimitResponse,
};
- export import CursorSortKey = Pagination.CursorSortKey;
- export {
- type CursorSortKeyParams as CursorSortKeyParams,
- type CursorSortKeyResponse as CursorSortKeyResponse,
- };
-
export {
type FocusResponse as FocusResponse,
type SearchResponse as SearchResponse,
diff --git a/src/core/api-promise.ts b/src/core/api-promise.ts
index dcfa9dfc..7ab456e1 100644
--- a/src/core/api-promise.ts
+++ b/src/core/api-promise.ts
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-import { type BeeperDesktop } from '../client';
+import { type BaseBeeperDesktop } from '../client';
import { type PromiseOrValue } from '../internal/types';
import { APIResponseProps, defaultParseResponse } from '../internal/parse';
@@ -11,13 +11,13 @@ import { APIResponseProps, defaultParseResponse } from '../internal/parse';
*/
export class APIPromise extends Promise {
private parsedPromise: Promise | undefined;
- #client: BeeperDesktop;
+ #client: BaseBeeperDesktop;
constructor(
- client: BeeperDesktop,
+ client: BaseBeeperDesktop,
private responsePromise: Promise,
private parseResponse: (
- client: BeeperDesktop,
+ client: BaseBeeperDesktop,
props: APIResponseProps,
) => PromiseOrValue = defaultParseResponse,
) {
diff --git a/src/core/pagination.ts b/src/core/pagination.ts
index 7d51ef7c..d2a3cefc 100644
--- a/src/core/pagination.ts
+++ b/src/core/pagination.ts
@@ -3,7 +3,7 @@
import { BeeperDesktopError } from './error';
import { FinalRequestOptions } from '../internal/request-options';
import { defaultParseResponse } from '../internal/parse';
-import { type BeeperDesktop } from '../client';
+import { type BaseBeeperDesktop } from '../client';
import { APIPromise } from './api-promise';
import { type APIResponseProps } from '../internal/parse';
import { maybeObj } from '../internal/utils/values';
@@ -11,13 +11,13 @@ import { maybeObj } from '../internal/utils/values';
export type PageRequestOptions = Pick;
export abstract class AbstractPage- implements AsyncIterable
- {
- #client: BeeperDesktop;
+ #client: BaseBeeperDesktop;
protected options: FinalRequestOptions;
protected response: Response;
protected body: unknown;
- constructor(client: BeeperDesktop, response: Response, body: unknown, options: FinalRequestOptions) {
+ constructor(client: BaseBeeperDesktop, response: Response, body: unknown, options: FinalRequestOptions) {
this.#client = client;
this.options = options;
this.response = response;
@@ -80,7 +80,7 @@ export class PagePromise<
implements AsyncIterable
-
{
constructor(
- client: BeeperDesktop,
+ client: BaseBeeperDesktop,
request: Promise,
Page: new (...args: ConstructorParameters) => PageClass,
) {
@@ -135,7 +135,7 @@ export class CursorSearch
- extends AbstractPage
- implements CursorSear
newestCursor: string | null;
constructor(
- client: BeeperDesktop,
+ client: BaseBeeperDesktop,
response: Response,
body: CursorSearchResponse
- ,
options: FinalRequestOptions,
@@ -202,7 +202,7 @@ export class CursorNoLimit
- extends AbstractPage
- implements CursorNoL
newestCursor: string | null;
constructor(
- client: BeeperDesktop,
+ client: BaseBeeperDesktop,
response: Response,
body: CursorNoLimitResponse
- ,
options: FinalRequestOptions,
@@ -242,64 +242,3 @@ export class CursorNoLimit
- extends AbstractPage
- implements CursorNoL
};
}
}
-
-export interface CursorSortKeyResponse
- {
- items: Array
- ;
-
- hasMore: boolean;
-}
-
-export interface CursorSortKeyParams {
- cursor?: string | null;
-
- direction?: string | null;
-}
-
-export class CursorSortKey
-
- extends AbstractPage
-
- implements CursorSortKeyResponse
-
-{
- items: Array
- ;
-
- hasMore: boolean;
-
- constructor(
- client: BeeperDesktop,
- response: Response,
- body: CursorSortKeyResponse
- ,
- options: FinalRequestOptions,
- ) {
- super(client, response, body, options);
-
- this.items = body.items || [];
- this.hasMore = body.hasMore || false;
- }
-
- getPaginatedItems(): Item[] {
- return this.items ?? [];
- }
-
- override hasNextPage(): boolean {
- if (this.hasMore === false) {
- return false;
- }
-
- return super.hasNextPage();
- }
-
- nextPageRequestOptions(): PageRequestOptions | null {
- const items = this.getPaginatedItems();
- const sortKey = items[items.length - 1]?.sortKey;
- if (!sortKey) {
- return null;
- }
-
- return {
- ...this.options,
- query: {
- ...maybeObj(this.options.query),
- cursor: sortKey,
- },
- };
- }
-}
diff --git a/src/core/resource.ts b/src/core/resource.ts
index aa4e9d0e..1f80fa77 100644
--- a/src/core/resource.ts
+++ b/src/core/resource.ts
@@ -1,11 +1,16 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-import type { BeeperDesktop } from '../client';
+import { BaseBeeperDesktop } from '../client';
export abstract class APIResource {
- protected _client: BeeperDesktop;
+ /**
+ * The key path from the client. For example, a resource accessible as `client.resource.subresource` would
+ * have a property `static override readonly _key = Object.freeze(['resource', 'subresource'] as const);`.
+ */
+ static readonly _key: readonly string[] = [];
+ protected _client: BaseBeeperDesktop;
- constructor(client: BeeperDesktop) {
+ constructor(client: BaseBeeperDesktop) {
this._client = client;
}
}
diff --git a/src/index.ts b/src/index.ts
index 81c81fe1..d24a1db3 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -4,7 +4,7 @@ export { BeeperDesktop as default } from './client';
export { type Uploadable, toFile } from './core/uploads';
export { APIPromise } from './core/api-promise';
-export { BeeperDesktop, type ClientOptions } from './client';
+export { BaseBeeperDesktop, BeeperDesktop, type ClientOptions } from './client';
export { PagePromise } from './core/pagination';
export {
BeeperDesktopError,
diff --git a/src/internal/parse.ts b/src/internal/parse.ts
index 16476d7e..26fba50a 100644
--- a/src/internal/parse.ts
+++ b/src/internal/parse.ts
@@ -1,7 +1,7 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import type { FinalRequestOptions } from './request-options';
-import { type BeeperDesktop } from '../client';
+import { type BaseBeeperDesktop } from '../client';
import { formatRequestDetails, loggerFor } from './utils/log';
export type APIResponseProps = {
@@ -13,7 +13,10 @@ export type APIResponseProps = {
startTime: number;
};
-export async function defaultParseResponse(client: BeeperDesktop, props: APIResponseProps): Promise {
+export async function defaultParseResponse(
+ client: BaseBeeperDesktop,
+ props: APIResponseProps,
+): Promise {
const { response, requestLogID, retryOfRequestLogID, startTime } = props;
const body = await (async () => {
// fetch refuses to read the body when the status code is 204.
diff --git a/src/internal/request-options.ts b/src/internal/request-options.ts
index 2aabf9aa..2d5bd6e7 100644
--- a/src/internal/request-options.ts
+++ b/src/internal/request-options.ts
@@ -75,6 +75,8 @@ export type RequestOptions = {
*/
defaultBaseURL?: string | undefined;
+ __security?: { bearerAuth?: boolean };
+
__binaryResponse?: boolean | undefined;
};
diff --git a/src/internal/types.ts b/src/internal/types.ts
index b668dfc0..a050513a 100644
--- a/src/internal/types.ts
+++ b/src/internal/types.ts
@@ -40,7 +40,6 @@ type OverloadedParameters =
: T extends (...args: infer A) => unknown ? A
: never;
-/* eslint-disable */
/**
* These imports attempt to get types from a parent package's dependencies.
* Unresolved bare specifiers can trigger [automatic type acquisition][1] in some projects, which
@@ -63,19 +62,18 @@ type OverloadedParameters =
*
* [1]: https://www.typescriptlang.org/tsconfig/#typeAcquisition
*/
-/** @ts-ignore For users with \@types/node */
+/** @ts-ignore For users with \@types/node */ /* prettier-ignore */
type UndiciTypesRequestInit = NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny;
-/** @ts-ignore For users with undici */
+/** @ts-ignore For users with undici */ /* prettier-ignore */
type UndiciRequestInit = NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny;
-/** @ts-ignore For users with \@types/bun */
+/** @ts-ignore For users with \@types/bun */ /* prettier-ignore */
type BunRequestInit = globalThis.FetchRequestInit;
-/** @ts-ignore For users with node-fetch@2 */
+/** @ts-ignore For users with node-fetch@2 */ /* prettier-ignore */
type NodeFetch2RequestInit = NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny;
-/** @ts-ignore For users with node-fetch@3, doesn't need file extension because types are at ./@types/index.d.ts */
+/** @ts-ignore For users with node-fetch@3, doesn't need file extension because types are at ./@types/index.d.ts */ /* prettier-ignore */
type NodeFetch3RequestInit = NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny;
-/** @ts-ignore For users who use Deno */
+/** @ts-ignore For users who use Deno */ /* prettier-ignore */
type FetchRequestInit = NonNullable[1]>;
-/* eslint-enable */
type RequestInits =
| NotAny
diff --git a/src/internal/uploads.ts b/src/internal/uploads.ts
index a89bf1cf..9382b956 100644
--- a/src/internal/uploads.ts
+++ b/src/internal/uploads.ts
@@ -1,6 +1,6 @@
import { type RequestOptions } from './request-options';
import type { FilePropertyBag, Fetch } from './builtin-types';
-import type { BeeperDesktop } from '../client';
+import type { BaseBeeperDesktop } from '../client';
import { ReadableStreamFrom } from './shims';
export type BlobPart = string | ArrayBuffer | ArrayBufferView | Blob | DataView;
@@ -74,7 +74,7 @@ export const isAsyncIterable = (value: any): value is AsyncIterable =>
*/
export const maybeMultipartFormRequestOptions = async (
opts: RequestOptions,
- fetch: BeeperDesktop | Fetch,
+ fetch: BaseBeeperDesktop | Fetch,
): Promise => {
if (!hasUploadableValue(opts.body)) return opts;
@@ -85,7 +85,7 @@ type MultipartFormRequestOptions = Omit & { body: unknow
export const multipartFormRequestOptions = async (
opts: MultipartFormRequestOptions,
- fetch: BeeperDesktop | Fetch,
+ fetch: BaseBeeperDesktop | Fetch,
): Promise => {
return { ...opts, body: await createForm(opts.body, fetch) };
};
@@ -98,7 +98,7 @@ const supportsFormDataMap = /* @__PURE__ */ new WeakMap>
* This function detects if the fetch function provided supports the global FormData object to avoid
* confusing error messages later on.
*/
-function supportsFormData(fetchObject: BeeperDesktop | Fetch): Promise {
+function supportsFormData(fetchObject: BaseBeeperDesktop | Fetch): Promise {
const fetch: Fetch = typeof fetchObject === 'function' ? fetchObject : (fetchObject as any).fetch;
const cached = supportsFormDataMap.get(fetch);
if (cached) return cached;
@@ -124,7 +124,7 @@ function supportsFormData(fetchObject: BeeperDesktop | Fetch): Promise
export const createForm = async >(
body: T | undefined,
- fetch: BeeperDesktop | Fetch,
+ fetch: BaseBeeperDesktop | Fetch,
): Promise => {
if (!(await supportsFormData(fetch))) {
throw new TypeError(
diff --git a/src/internal/utils/env.ts b/src/internal/utils/env.ts
index 2d848007..cc5fa0fa 100644
--- a/src/internal/utils/env.ts
+++ b/src/internal/utils/env.ts
@@ -9,10 +9,10 @@
*/
export const readEnv = (env: string): string | undefined => {
if (typeof (globalThis as any).process !== 'undefined') {
- return (globalThis as any).process.env?.[env]?.trim() ?? undefined;
+ return (globalThis as any).process.env?.[env]?.trim() || undefined;
}
if (typeof (globalThis as any).Deno !== 'undefined') {
- return (globalThis as any).Deno.env?.get?.(env)?.trim();
+ return (globalThis as any).Deno.env?.get?.(env)?.trim() || undefined;
}
return undefined;
};
diff --git a/src/internal/utils/log.ts b/src/internal/utils/log.ts
index 40c2f148..41b8cfd3 100644
--- a/src/internal/utils/log.ts
+++ b/src/internal/utils/log.ts
@@ -1,7 +1,7 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { hasOwn } from './values';
-import { type BeeperDesktop } from '../../client';
+import { type BaseBeeperDesktop } from '../../client';
import { RequestOptions } from '../request-options';
type LogFn = (message: string, ...rest: unknown[]) => void;
@@ -24,7 +24,7 @@ const levelNumbers = {
export const parseLogLevel = (
maybeLevel: string | undefined,
sourceName: string,
- client: BeeperDesktop,
+ client: BaseBeeperDesktop,
): LogLevel | undefined => {
if (!maybeLevel) {
return undefined;
@@ -60,7 +60,7 @@ const noopLogger = {
let cachedLoggers = /* @__PURE__ */ new WeakMap();
-export function loggerFor(client: BeeperDesktop): Logger {
+export function loggerFor(client: BaseBeeperDesktop): Logger {
const logger = client.logger;
const logLevel = client.logLevel ?? 'off';
if (!logger) {
diff --git a/src/resources/accounts/accounts.ts b/src/resources/accounts/accounts.ts
index 3d09c8ba..c6e33e63 100644
--- a/src/resources/accounts/accounts.ts
+++ b/src/resources/accounts/accounts.ts
@@ -3,15 +3,21 @@
import { APIResource } from '../../core/resource';
import * as Shared from '../shared';
import * as ContactsAPI from './contacts';
-import { ContactListParams, ContactSearchParams, ContactSearchResponse, Contacts } from './contacts';
+import {
+ BaseContacts,
+ ContactListParams,
+ ContactSearchParams,
+ ContactSearchResponse,
+ Contacts,
+} from './contacts';
import { APIPromise } from '../../core/api-promise';
import { RequestOptions } from '../../internal/request-options';
/**
* Manage connected chat accounts
*/
-export class Accounts extends APIResource {
- contacts: ContactsAPI.Contacts = new ContactsAPI.Contacts(this._client);
+export class BaseAccounts extends APIResource {
+ static override readonly _key: readonly ['accounts'] = Object.freeze(['accounts'] as const);
/**
* Lists chat accounts across networks (WhatsApp, Telegram, Twitter/X, etc.)
@@ -26,9 +32,15 @@ export class Accounts extends APIResource {
return this._client.get('/v1/accounts', options);
}
}
+/**
+ * Manage connected chat accounts
+ */
+export class Accounts extends BaseAccounts {
+ contacts: ContactsAPI.Contacts = new ContactsAPI.Contacts(this._client);
+}
/**
- * A chat account added to Beeper
+ * A chat account added to Beeper.
*/
export interface Account {
/**
@@ -36,25 +48,60 @@ export interface Account {
*/
accountID: string;
+ /**
+ * Bridge metadata for the account. Available in Beeper Desktop v4.2.789+.
+ */
+ bridge: Account.Bridge;
+
/**
* User the account belongs to.
*/
user: Shared.User;
+
+ /**
+ * Human-friendly network name for the account. Omitted when the network is
+ * unknown.
+ */
+ network?: string;
+}
+
+export namespace Account {
+ /**
+ * Bridge metadata for the account. Available in Beeper Desktop v4.2.789+.
+ */
+ export interface Bridge {
+ /**
+ * Bridge instance identifier. Available in Beeper Desktop v4.2.789+.
+ */
+ id: string;
+
+ /**
+ * Bridge provider for the account. Available in Beeper Desktop v4.2.789+.
+ */
+ provider: 'cloud' | 'self-hosted' | 'local' | 'platform-sdk';
+
+ /**
+ * Bridge type. Available in Beeper Desktop v4.2.789+.
+ */
+ type: string;
+ }
}
/**
- * Connected accounts the user can act through. Includes accountID and user
- * identity.
+ * Accounts configured on this device. Includes accountID, bridge metadata,
+ * optional network name, and user identity.
*/
export type AccountListResponse = Array;
Accounts.Contacts = Contacts;
+Accounts.BaseContacts = BaseContacts;
export declare namespace Accounts {
export { type Account as Account, type AccountListResponse as AccountListResponse };
export {
Contacts as Contacts,
+ BaseContacts as BaseContacts,
type ContactSearchResponse as ContactSearchResponse,
type ContactListParams as ContactListParams,
type ContactSearchParams as ContactSearchParams,
diff --git a/src/resources/accounts/contacts.ts b/src/resources/accounts/contacts.ts
index ff10a4ea..42bd7548 100644
--- a/src/resources/accounts/contacts.ts
+++ b/src/resources/accounts/contacts.ts
@@ -11,7 +11,12 @@ import { path } from '../../internal/utils/path';
/**
* Manage contacts on a specific account
*/
-export class Contacts extends APIResource {
+export class BaseContacts extends APIResource {
+ static override readonly _key: readonly ['accounts', 'contacts'] = Object.freeze([
+ 'accounts',
+ 'contacts',
+ ] as const);
+
/**
* List merged contacts for a specific account with cursor-based pagination.
*
@@ -56,6 +61,10 @@ export class Contacts extends APIResource {
return this._client.get(path`/v1/accounts/${accountID}/contacts`, { query, ...options });
}
}
+/**
+ * Manage contacts on a specific account
+ */
+export class Contacts extends BaseContacts {}
export interface ContactSearchResponse {
items: Array;
diff --git a/src/resources/accounts/index.ts b/src/resources/accounts/index.ts
index 68232fec..1249a9b1 100644
--- a/src/resources/accounts/index.ts
+++ b/src/resources/accounts/index.ts
@@ -1,8 +1,9 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-export { Accounts, type Account, type AccountListResponse } from './accounts';
+export { Accounts, BaseAccounts, type Account, type AccountListResponse } from './accounts';
export {
Contacts,
+ BaseContacts,
type ContactSearchResponse,
type ContactListParams,
type ContactSearchParams,
diff --git a/src/resources/assets.ts b/src/resources/assets.ts
index 337a770b..2281f83b 100644
--- a/src/resources/assets.ts
+++ b/src/resources/assets.ts
@@ -10,7 +10,9 @@ import { multipartFormRequestOptions } from '../internal/uploads';
/**
* Manage assets in Beeper Desktop, like message attachments
*/
-export class Assets extends APIResource {
+export class BaseAssets extends APIResource {
+ static override readonly _key: readonly ['assets'] = Object.freeze(['assets'] as const);
+
/**
* Download a Matrix asset using its mxc:// or localmxc:// URL to the device
* running Beeper Desktop and return the local file URL.
@@ -32,14 +34,18 @@ export class Assets extends APIResource {
*
* @example
* ```ts
- * await client.assets.serve({ url: 'x' });
+ * const response = await client.assets.serve({ url: 'x' });
+ *
+ * const content = await response.blob();
+ * console.log(content);
* ```
*/
- serve(query: AssetServeParams, options?: RequestOptions): APIPromise {
+ serve(query: AssetServeParams, options?: RequestOptions): APIPromise {
return this._client.get('/v1/assets/serve', {
query,
...options,
- headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
+ headers: buildHeaders([{ Accept: 'application/octet-stream' }, options?.headers]),
+ __binaryResponse: true,
});
}
@@ -80,6 +86,10 @@ export class Assets extends APIResource {
return this._client.post('/v1/assets/upload/base64', { body, ...options });
}
}
+/**
+ * Manage assets in Beeper Desktop, like message attachments
+ */
+export class Assets extends BaseAssets {}
export interface AssetDownloadResponse {
/**
diff --git a/src/resources/chats/chats.ts b/src/resources/chats/chats.ts
index d8a01280..a6b40a91 100644
--- a/src/resources/chats/chats.ts
+++ b/src/resources/chats/chats.ts
@@ -3,9 +3,9 @@
import { APIResource } from '../../core/resource';
import * as Shared from '../shared';
import * as RemindersAPI from './reminders';
-import { ReminderCreateParams, Reminders } from './reminders';
+import { BaseReminders, ReminderCreateParams, Reminders } from './reminders';
import * as MessagesAPI from './messages/messages';
-import { Messages } from './messages/messages';
+import { BaseMessages, Messages } from './messages/messages';
import { APIPromise } from '../../core/api-promise';
import {
CursorNoLimit,
@@ -21,13 +21,12 @@ import { path } from '../../internal/utils/path';
/**
* Manage chats
*/
-export class Chats extends APIResource {
- reminders: RemindersAPI.Reminders = new RemindersAPI.Reminders(this._client);
- messages: MessagesAPI.Messages = new MessagesAPI.Messages(this._client);
+export class BaseChats extends APIResource {
+ static override readonly _key: readonly ['chats'] = Object.freeze(['chats'] as const);
/**
- * Create a single/group chat (mode='create') or start a direct chat from merged
- * user data (mode='start').
+ * Create a direct or group chat with mode="create", or use mode="start" to resolve
+ * a contact and open a direct chat.
*
* @example
* ```ts
@@ -101,8 +100,7 @@ export class Chats extends APIResource {
}
/**
- * Search chats by title/network or participants using Beeper Desktop's renderer
- * algorithm.
+ * Search chats by title, network, or participant names.
*
* @example
* ```ts
@@ -119,6 +117,13 @@ export class Chats extends APIResource {
return this._client.getAPIList('/v1/chats/search', CursorSearch, { query, ...options });
}
}
+/**
+ * Manage chats
+ */
+export class Chats extends BaseChats {
+ reminders: RemindersAPI.Reminders = new RemindersAPI.Reminders(this._client);
+ messages: MessagesAPI.Messages = new MessagesAPI.Messages(this._client);
+}
export type ChatListResponsesCursorNoLimit = CursorNoLimit;
@@ -235,8 +240,8 @@ export interface ChatCreateParams {
accountID: string;
/**
- * Whether invite-based DM creation is allowed when required by the platform. Used
- * for mode='start'.
+ * Only used for mode='start'. Whether invite-based DM creation is allowed when
+ * required by the platform.
*/
allowInvite?: boolean;
@@ -246,29 +251,30 @@ export interface ChatCreateParams {
messageText?: string;
/**
- * Operation mode. Defaults to 'create' when omitted.
+ * Operation mode. Use 'start' to resolve a user/contact and start a direct chat.
+ * Omit or set 'create' to create a chat directly.
*/
- mode?: 'create' | 'start';
+ mode?: 'start' | 'create';
/**
- * Required when mode='create'. User IDs to include in the new chat.
+ * Required for create mode. Provide exactly one user ID for 'single' chats and one
+ * or more for 'group' chats.
*/
participantIDs?: Array;
/**
- * Optional title for group chats when mode='create'; ignored for single chats on
- * most platforms.
+ * Optional title for group chats; ignored for single chats on most networks.
*/
title?: string;
/**
- * Required when mode='create'. 'single' requires exactly one participantID;
- * 'group' supports multiple participants and optional title.
+ * Required for create mode. 'single' creates a direct message chat; 'group'
+ * creates a group chat.
*/
type?: 'single' | 'group';
/**
- * Required when mode='start'. Merged user-like contact payload used to resolve the
+ * Required for mode='start'. Merged user-like contact payload used to resolve the
* best identifier.
*/
user?: ChatCreateParams.User;
@@ -276,7 +282,7 @@ export interface ChatCreateParams {
export namespace ChatCreateParams {
/**
- * Required when mode='start'. Merged user-like contact payload used to resolve the
+ * Required for mode='start'. Merged user-like contact payload used to resolve the
* best identifier.
*/
export interface User {
@@ -385,7 +391,9 @@ export interface ChatSearchParams extends CursorSearchParams {
}
Chats.Reminders = Reminders;
+Chats.BaseReminders = BaseReminders;
Chats.Messages = Messages;
+Chats.BaseMessages = BaseMessages;
export declare namespace Chats {
export {
@@ -401,7 +409,11 @@ export declare namespace Chats {
type ChatSearchParams as ChatSearchParams,
};
- export { Reminders as Reminders, type ReminderCreateParams as ReminderCreateParams };
+ export {
+ Reminders as Reminders,
+ BaseReminders as BaseReminders,
+ type ReminderCreateParams as ReminderCreateParams,
+ };
- export { Messages as Messages };
+ export { Messages as Messages, BaseMessages as BaseMessages };
}
diff --git a/src/resources/chats/index.ts b/src/resources/chats/index.ts
index f6396abf..48374162 100644
--- a/src/resources/chats/index.ts
+++ b/src/resources/chats/index.ts
@@ -2,6 +2,7 @@
export {
Chats,
+ BaseChats,
type Chat,
type ChatCreateResponse,
type ChatListResponse,
@@ -13,5 +14,5 @@ export {
type ChatListResponsesCursorNoLimit,
type ChatsCursorSearch,
} from './chats';
-export { Messages } from './messages/index';
-export { Reminders, type ReminderCreateParams } from './reminders';
+export { Messages, BaseMessages } from './messages/index';
+export { Reminders, BaseReminders, type ReminderCreateParams } from './reminders';
diff --git a/src/resources/chats/messages/index.ts b/src/resources/chats/messages/index.ts
index 053fae53..d0cea89f 100644
--- a/src/resources/chats/messages/index.ts
+++ b/src/resources/chats/messages/index.ts
@@ -1,8 +1,9 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-export { Messages } from './messages';
+export { Messages, BaseMessages } from './messages';
export {
Reactions,
+ BaseReactions,
type ReactionDeleteResponse,
type ReactionAddResponse,
type ReactionDeleteParams,
diff --git a/src/resources/chats/messages/messages.ts b/src/resources/chats/messages/messages.ts
index 93fde972..3d3f0b29 100644
--- a/src/resources/chats/messages/messages.ts
+++ b/src/resources/chats/messages/messages.ts
@@ -3,6 +3,7 @@
import { APIResource } from '../../../core/resource';
import * as ReactionsAPI from './reactions';
import {
+ BaseReactions,
ReactionAddParams,
ReactionAddResponse,
ReactionDeleteParams,
@@ -13,15 +14,26 @@ import {
/**
* Manage chat messages
*/
-export class Messages extends APIResource {
+export class BaseMessages extends APIResource {
+ static override readonly _key: readonly ['chats', 'messages'] = Object.freeze([
+ 'chats',
+ 'messages',
+ ] as const);
+}
+/**
+ * Manage chat messages
+ */
+export class Messages extends BaseMessages {
reactions: ReactionsAPI.Reactions = new ReactionsAPI.Reactions(this._client);
}
Messages.Reactions = Reactions;
+Messages.BaseReactions = BaseReactions;
export declare namespace Messages {
export {
Reactions as Reactions,
+ BaseReactions as BaseReactions,
type ReactionDeleteResponse as ReactionDeleteResponse,
type ReactionAddResponse as ReactionAddResponse,
type ReactionDeleteParams as ReactionDeleteParams,
diff --git a/src/resources/chats/messages/reactions.ts b/src/resources/chats/messages/reactions.ts
index eb5db95d..38adf1d0 100644
--- a/src/resources/chats/messages/reactions.ts
+++ b/src/resources/chats/messages/reactions.ts
@@ -8,9 +8,15 @@ import { path } from '../../../internal/utils/path';
/**
* Manage message reactions
*/
-export class Reactions extends APIResource {
+export class BaseReactions extends APIResource {
+ static override readonly _key: readonly ['chats', 'messages', 'reactions'] = Object.freeze([
+ 'chats',
+ 'messages',
+ 'reactions',
+ ] as const);
+
/**
- * Remove the authenticated user's reaction from an existing message.
+ * Remove the reaction added by the authenticated user from an existing message.
*
* @example
* ```ts
@@ -59,6 +65,10 @@ export class Reactions extends APIResource {
return this._client.post(path`/v1/chats/${chatID}/messages/${messageID}/reactions`, { body, ...options });
}
}
+/**
+ * Manage message reactions
+ */
+export class Reactions extends BaseReactions {}
export interface ReactionDeleteResponse {
/**
diff --git a/src/resources/chats/reminders.ts b/src/resources/chats/reminders.ts
index c700051e..60a4e196 100644
--- a/src/resources/chats/reminders.ts
+++ b/src/resources/chats/reminders.ts
@@ -9,7 +9,12 @@ import { path } from '../../internal/utils/path';
/**
* Manage reminders for chats
*/
-export class Reminders extends APIResource {
+export class BaseReminders extends APIResource {
+ static override readonly _key: readonly ['chats', 'reminders'] = Object.freeze([
+ 'chats',
+ 'reminders',
+ ] as const);
+
/**
* Set a reminder for a chat at a specific time
*
@@ -46,6 +51,10 @@ export class Reminders extends APIResource {
});
}
}
+/**
+ * Manage reminders for chats
+ */
+export class Reminders extends BaseReminders {}
export interface ReminderCreateParams {
/**
diff --git a/src/resources/index.ts b/src/resources/index.ts
index 942c8e5a..8a444e9c 100644
--- a/src/resources/index.ts
+++ b/src/resources/index.ts
@@ -1,9 +1,10 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
export * from './shared';
-export { Accounts, type Account, type AccountListResponse } from './accounts/accounts';
+export { Accounts, BaseAccounts, type Account, type AccountListResponse } from './accounts/accounts';
export {
Assets,
+ BaseAssets,
type AssetDownloadResponse,
type AssetUploadResponse,
type AssetUploadBase64Response,
@@ -14,6 +15,7 @@ export {
} from './assets';
export {
Chats,
+ BaseChats,
type Chat,
type ChatCreateResponse,
type ChatListResponse,
@@ -25,9 +27,10 @@ export {
type ChatListResponsesCursorNoLimit,
type ChatsCursorSearch,
} from './chats/chats';
-export { Info, type InfoRetrieveResponse } from './info';
+export { Info, BaseInfo, type InfoRetrieveResponse } from './info';
export {
Messages,
+ BaseMessages,
type MessageUpdateResponse,
type MessageSendResponse,
type MessageUpdateParams,
diff --git a/src/resources/info.ts b/src/resources/info.ts
index eef070c9..f324cbd6 100644
--- a/src/resources/info.ts
+++ b/src/resources/info.ts
@@ -7,15 +7,21 @@ import { RequestOptions } from '../internal/request-options';
/**
* Control the Beeper Desktop application
*/
-export class Info extends APIResource {
+export class BaseInfo extends APIResource {
+ static override readonly _key: readonly ['info'] = Object.freeze(['info'] as const);
+
/**
* Returns app, platform, server, and endpoint discovery metadata for this Beeper
* Desktop instance.
*/
retrieve(options?: RequestOptions): APIPromise {
- return this._client.get('/v1/info', options);
+ return this._client.get('/v1/info', { ...options, __security: {} });
}
}
+/**
+ * Control the Beeper Desktop application
+ */
+export class Info extends BaseInfo {}
export interface InfoRetrieveResponse {
app: InfoRetrieveResponse.App;
diff --git a/src/resources/messages.ts b/src/resources/messages.ts
index 23d6e3a1..9d9eb33a 100644
--- a/src/resources/messages.ts
+++ b/src/resources/messages.ts
@@ -2,13 +2,13 @@
import { APIResource } from '../core/resource';
import * as Shared from './shared';
-import { MessagesCursorSearch, MessagesCursorSortKey } from './shared';
+import { MessagesCursorNoLimit, MessagesCursorSearch } from './shared';
import { APIPromise } from '../core/api-promise';
import {
+ CursorNoLimit,
+ type CursorNoLimitParams,
CursorSearch,
type CursorSearchParams,
- CursorSortKey,
- type CursorSortKeyParams,
PagePromise,
} from '../core/pagination';
import { RequestOptions } from '../internal/request-options';
@@ -17,7 +17,9 @@ import { path } from '../internal/utils/path';
/**
* Manage messages in chats
*/
-export class Messages extends APIResource {
+export class BaseMessages extends APIResource {
+ static override readonly _key: readonly ['messages'] = Object.freeze(['messages'] as const);
+
/**
* Edit the text content of an existing message. Messages with attachments cannot
* be edited.
@@ -56,15 +58,15 @@ export class Messages extends APIResource {
chatID: string,
query: MessageListParams | null | undefined = {},
options?: RequestOptions,
- ): PagePromise {
- return this._client.getAPIList(path`/v1/chats/${chatID}/messages`, CursorSortKey, {
+ ): PagePromise {
+ return this._client.getAPIList(path`/v1/chats/${chatID}/messages`, CursorNoLimit, {
query,
...options,
});
}
/**
- * Search messages across chats using Beeper's message index
+ * Search messages across chats.
*
* @example
* ```ts
@@ -103,6 +105,10 @@ export class Messages extends APIResource {
return this._client.post(path`/v1/chats/${chatID}/messages`, { body, ...options });
}
}
+/**
+ * Manage messages in chats
+ */
+export class Messages extends BaseMessages {}
export interface MessageUpdateResponse {
/**
@@ -145,7 +151,7 @@ export interface MessageUpdateParams {
text: string;
}
-export interface MessageListParams extends CursorSortKeyParams {}
+export interface MessageListParams extends CursorNoLimitParams {}
export interface MessageSearchParams extends CursorSearchParams {
/**
@@ -285,4 +291,4 @@ export declare namespace Messages {
};
}
-export { type MessagesCursorSortKey, type MessagesCursorSearch };
+export { type MessagesCursorNoLimit, type MessagesCursorSearch };
diff --git a/src/resources/shared.ts b/src/resources/shared.ts
index 5756f98c..c8fb137b 100644
--- a/src/resources/shared.ts
+++ b/src/resources/shared.ts
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-import { CursorSearch, CursorSortKey } from '../core/pagination';
+import { CursorNoLimit, CursorSearch } from '../core/pagination';
export interface Attachment {
/**
@@ -290,6 +290,6 @@ export interface User {
export type UsersCursorSearch = CursorSearch;
-export type MessagesCursorSortKey = CursorSortKey;
+export type MessagesCursorNoLimit = CursorNoLimit;
export type MessagesCursorSearch = CursorSearch;
diff --git a/src/tree-shakable.ts b/src/tree-shakable.ts
new file mode 100644
index 00000000..f7b9ba0b
--- /dev/null
+++ b/src/tree-shakable.ts
@@ -0,0 +1,102 @@
+// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+import { BaseBeeperDesktop, ClientOptions } from './client';
+import { APIResource } from './core/resource';
+import { hasOwn } from './internal/utils/values';
+
+export type PartialBeeperDesktop = BaseBeeperDesktop & T;
+
+type InferClientStructure =
+ SimplifyResources>> extends infer O extends MaybeResource ? O
+ : never;
+
+/**
+ * Creates a client with a subset of the available resources to reduce
+ * bundle size.
+ * Import the resource classes you need from `@beeper/desktop-api/resources/*`.
+ * Use the BaseResource variants if you do not need to use subresources.
+ *
+ * @example
+ * ```ts
+ * import { Accounts } from `@beeper/desktop-api/resources/accounts`;
+ * import { createClient } from `@beeper/desktop-api/tree-shakable`;
+ *
+ * const client = createClient({
+ * resources: [Accounts],
+ * });
+ * ```
+ */
+export function createClient(
+ options: ClientOptions & { resources: T },
+): PartialBeeperDesktop> {
+ const client = new BaseBeeperDesktop(options);
+ for (const ResourceClass of options.resources) {
+ const resourceInstance: APIResource = new (ResourceClass as any)(client);
+ let object: object = client;
+ for (const part of ResourceClass._key.slice(0, -1)) {
+ if (hasOwn(object, part)) {
+ object = object[part];
+ } else {
+ Object.defineProperty(object, part, {
+ value: (object = {}),
+ configurable: true,
+ enumerable: true,
+ writable: true,
+ });
+ }
+ }
+ const name = ResourceClass._key.at(-1)!;
+ if (!hasOwn(object, name)) {
+ Object.defineProperty(object, name, {
+ value: resourceInstance,
+ configurable: true,
+ enumerable: true,
+ writable: true,
+ });
+ } else {
+ if ((object as any)[name] instanceof APIResource) {
+ throw new TypeError(`Resource at ${ResourceClass._key.join('.')} already exists!`);
+ } else {
+ (object as any)[name] = Object.assign(resourceInstance, (object as any)[name]);
+ }
+ }
+ }
+ return client as any;
+}
+
+/**
+ * `FromDeepEntry<['a', 'b', 'c'], 'value'>` -> `{ a: { b: { c: 'value'; }; }; }`
+ */
+type FromDeepEntry = K['length'] extends 1 ? { [_ in K[0]]: V } & {}
+: K extends readonly [infer First extends PropertyKey, ...infer Rest extends readonly PropertyKey[]] ?
+ { [_ in First]: FromDeepEntry }
+: never;
+
+/**
+ * `ResourcePath<{ _key: ["a", "b", "c"]; new (): Instance }>` -> `{ a: { b: { c: Instance; }; }; }`
+ */
+type ResourcePath =
+ T extends any ? FromDeepEntry> : never;
+
+/**
+ * `UnionToIntersection<{ a: 1 } | { b: 2 }>` -> `{ a: 1 } & { b: 2 }`
+ */
+type UnionToIntersection =
+ (U extends any ? (x: U) => void : never) extends (x: infer I) => void ? I : never;
+
+/**
+ * Makes the types look nicer:
+ * `SimplifyResources<{ a: APIResource } & { b: { c: APIResource } & { d: APIResource } }>` -> `{ a: APIResource; b: { c: APIResource; d: APIResource; }; }`
+ */
+type SimplifyResources =
+ T extends APIResource ? T
+ : T extends object ?
+ {
+ [P in keyof T as string extends P ? never : P]: SimplifyResources;
+ }
+ : T;
+
+type MaybeResource = MaybeResource_ | APIResource;
+interface MaybeResource_ {
+ [_: string]: MaybeResource;
+}
diff --git a/src/version.ts b/src/version.ts
index 50935122..5ae204f4 100644
--- a/src/version.ts
+++ b/src/version.ts
@@ -1 +1 @@
-export const VERSION = '4.7.1'; // x-release-please-version
+export const VERSION = '4.8.0'; // x-release-please-version
diff --git a/tests/api-resources/accounts/accounts.test.ts b/tests/api-resources/accounts/accounts.test.ts
index e8917eb5..aa78a863 100644
--- a/tests/api-resources/accounts/accounts.test.ts
+++ b/tests/api-resources/accounts/accounts.test.ts
@@ -1,13 +1,22 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+import { BaseAccounts } from '@beeper/desktop-api/resources/accounts/accounts';
+
import BeeperDesktop from '@beeper/desktop-api';
+import { createClient, type PartialBeeperDesktop } from '@beeper/desktop-api/tree-shakable';
const client = new BeeperDesktop({
accessToken: 'My Access Token',
baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
});
-describe('resource accounts', () => {
+const partialClient = createClient({
+ accessToken: 'My Access Token',
+ baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
+ resources: [BaseAccounts],
+});
+
+const runTests = (client: PartialBeeperDesktop<{ accounts: BaseAccounts }>) => {
test('list', async () => {
const responsePromise = client.accounts.list();
const rawResponse = await responsePromise.asResponse();
@@ -18,4 +27,6 @@ describe('resource accounts', () => {
expect(dataAndResponse.data).toBe(response);
expect(dataAndResponse.response).toBe(rawResponse);
});
-});
+};
+describe('resource accounts', () => runTests(client));
+describe('resource accounts (tree shakable, base)', () => runTests(partialClient));
diff --git a/tests/api-resources/accounts/contacts.test.ts b/tests/api-resources/accounts/contacts.test.ts
index e8a9b9a2..83097592 100644
--- a/tests/api-resources/accounts/contacts.test.ts
+++ b/tests/api-resources/accounts/contacts.test.ts
@@ -1,13 +1,29 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+import { Accounts } from '@beeper/desktop-api/resources/accounts/accounts';
+import { BaseContacts } from '@beeper/desktop-api/resources/accounts/contacts';
+
import BeeperDesktop from '@beeper/desktop-api';
+import { createClient, type PartialBeeperDesktop } from '@beeper/desktop-api/tree-shakable';
const client = new BeeperDesktop({
accessToken: 'My Access Token',
baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
});
-describe('resource contacts', () => {
+const partialClient = createClient({
+ accessToken: 'My Access Token',
+ baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
+ resources: [BaseContacts],
+});
+
+const parentPartialClient = createClient({
+ accessToken: 'My Access Token',
+ baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
+ resources: [Accounts],
+});
+
+const runTests = (client: PartialBeeperDesktop<{ accounts: { contacts: BaseContacts } }>) => {
test('list', async () => {
const responsePromise = client.accounts.contacts.list('accountID');
const rawResponse = await responsePromise.asResponse();
@@ -49,4 +65,7 @@ describe('resource contacts', () => {
test('search: required and optional params', async () => {
const response = await client.accounts.contacts.search('accountID', { query: 'x' });
});
-});
+};
+describe('resource contacts', () => runTests(client));
+describe('resource contacts (tree shakable, base)', () => runTests(partialClient));
+describe('resource contacts (tree shakable, subresource)', () => runTests(parentPartialClient));
diff --git a/tests/api-resources/assets.test.ts b/tests/api-resources/assets.test.ts
index 27aab428..84e2db1b 100644
--- a/tests/api-resources/assets.test.ts
+++ b/tests/api-resources/assets.test.ts
@@ -1,13 +1,22 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+import { BaseAssets } from '@beeper/desktop-api/resources/assets';
+
import BeeperDesktop, { toFile } from '@beeper/desktop-api';
+import { createClient, type PartialBeeperDesktop } from '@beeper/desktop-api/tree-shakable';
const client = new BeeperDesktop({
accessToken: 'My Access Token',
baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
});
-describe('resource assets', () => {
+const partialClient = createClient({
+ accessToken: 'My Access Token',
+ baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
+ resources: [BaseAssets],
+});
+
+const runTests = (client: PartialBeeperDesktop<{ assets: BaseAssets }>) => {
test('download: only required params', async () => {
const responsePromise = client.assets.download({ url: 'mxc://example.org/Q4x9CqGz1pB3Oa6XgJ' });
const rawResponse = await responsePromise.asResponse();
@@ -23,17 +32,6 @@ describe('resource assets', () => {
const response = await client.assets.download({ url: 'mxc://example.org/Q4x9CqGz1pB3Oa6XgJ' });
});
- test('serve: only required params', async () => {
- const responsePromise = client.assets.serve({ url: 'x' });
- const rawResponse = await responsePromise.asResponse();
- expect(rawResponse).toBeInstanceOf(Response);
- const response = await responsePromise;
- expect(response).not.toBeInstanceOf(Response);
- const dataAndResponse = await responsePromise.withResponse();
- expect(dataAndResponse.data).toBe(response);
- expect(dataAndResponse.response).toBe(rawResponse);
- });
-
test('serve: required and optional params', async () => {
const response = await client.assets.serve({ url: 'x' });
});
@@ -77,4 +75,6 @@ describe('resource assets', () => {
mimeType: 'mimeType',
});
});
-});
+};
+describe('resource assets', () => runTests(client));
+describe('resource assets (tree shakable, base)', () => runTests(partialClient));
diff --git a/tests/api-resources/chats/chats.test.ts b/tests/api-resources/chats/chats.test.ts
index 6b53959c..34c27c25 100644
--- a/tests/api-resources/chats/chats.test.ts
+++ b/tests/api-resources/chats/chats.test.ts
@@ -1,13 +1,22 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+import { BaseChats } from '@beeper/desktop-api/resources/chats/chats';
+
import BeeperDesktop from '@beeper/desktop-api';
+import { createClient, type PartialBeeperDesktop } from '@beeper/desktop-api/tree-shakable';
const client = new BeeperDesktop({
accessToken: 'My Access Token',
baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
});
-describe('resource chats', () => {
+const partialClient = createClient({
+ accessToken: 'My Access Token',
+ baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
+ resources: [BaseChats],
+});
+
+const runTests = (client: PartialBeeperDesktop<{ chats: BaseChats }>) => {
test('create: only required params', async () => {
const responsePromise = client.chats.create({ accountID: 'accountID' });
const rawResponse = await responsePromise.asResponse();
@@ -24,7 +33,7 @@ describe('resource chats', () => {
accountID: 'accountID',
allowInvite: true,
messageText: 'messageText',
- mode: 'create',
+ mode: 'start',
participantIDs: ['string'],
title: 'title',
type: 'single',
@@ -146,4 +155,6 @@ describe('resource chats', () => {
),
).rejects.toThrow(BeeperDesktop.NotFoundError);
});
-});
+};
+describe('resource chats', () => runTests(client));
+describe('resource chats (tree shakable, base)', () => runTests(partialClient));
diff --git a/tests/api-resources/chats/messages/reactions.test.ts b/tests/api-resources/chats/messages/reactions.test.ts
index 5b0dffb5..f0f81820 100644
--- a/tests/api-resources/chats/messages/reactions.test.ts
+++ b/tests/api-resources/chats/messages/reactions.test.ts
@@ -1,13 +1,29 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+import { Messages } from '@beeper/desktop-api/resources/chats/messages/messages';
+import { BaseReactions } from '@beeper/desktop-api/resources/chats/messages/reactions';
+
import BeeperDesktop from '@beeper/desktop-api';
+import { createClient, type PartialBeeperDesktop } from '@beeper/desktop-api/tree-shakable';
const client = new BeeperDesktop({
accessToken: 'My Access Token',
baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
});
-describe('resource reactions', () => {
+const partialClient = createClient({
+ accessToken: 'My Access Token',
+ baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
+ resources: [BaseReactions],
+});
+
+const parentPartialClient = createClient({
+ accessToken: 'My Access Token',
+ baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
+ resources: [Messages],
+});
+
+const runTests = (client: PartialBeeperDesktop<{ chats: { messages: { reactions: BaseReactions } } }>) => {
test('delete: only required params', async () => {
const responsePromise = client.chats.messages.reactions.delete('messageID', {
chatID: '!NCdzlIaMjZUmvmvyHU:beeper.com',
@@ -50,4 +66,7 @@ describe('resource reactions', () => {
transactionID: 'transactionID',
});
});
-});
+};
+describe('resource reactions', () => runTests(client));
+describe('resource reactions (tree shakable, base)', () => runTests(partialClient));
+describe('resource reactions (tree shakable, subresource)', () => runTests(parentPartialClient));
diff --git a/tests/api-resources/chats/reminders.test.ts b/tests/api-resources/chats/reminders.test.ts
index 82114dc7..7feb3547 100644
--- a/tests/api-resources/chats/reminders.test.ts
+++ b/tests/api-resources/chats/reminders.test.ts
@@ -1,13 +1,29 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+import { Chats } from '@beeper/desktop-api/resources/chats/chats';
+import { BaseReminders } from '@beeper/desktop-api/resources/chats/reminders';
+
import BeeperDesktop from '@beeper/desktop-api';
+import { createClient, type PartialBeeperDesktop } from '@beeper/desktop-api/tree-shakable';
const client = new BeeperDesktop({
accessToken: 'My Access Token',
baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
});
-describe('resource reminders', () => {
+const partialClient = createClient({
+ accessToken: 'My Access Token',
+ baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
+ resources: [BaseReminders],
+});
+
+const parentPartialClient = createClient({
+ accessToken: 'My Access Token',
+ baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
+ resources: [Chats],
+});
+
+const runTests = (client: PartialBeeperDesktop<{ chats: { reminders: BaseReminders } }>) => {
test('create: only required params', async () => {
const responsePromise = client.chats.reminders.create('!NCdzlIaMjZUmvmvyHU:beeper.com', {
reminder: { remindAtMs: 0 },
@@ -37,4 +53,7 @@ describe('resource reminders', () => {
expect(dataAndResponse.data).toBe(response);
expect(dataAndResponse.response).toBe(rawResponse);
});
-});
+};
+describe('resource reminders', () => runTests(client));
+describe('resource reminders (tree shakable, base)', () => runTests(partialClient));
+describe('resource reminders (tree shakable, subresource)', () => runTests(parentPartialClient));
diff --git a/tests/api-resources/info.test.ts b/tests/api-resources/info.test.ts
index fac12965..f430f601 100644
--- a/tests/api-resources/info.test.ts
+++ b/tests/api-resources/info.test.ts
@@ -1,13 +1,22 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+import { BaseInfo } from '@beeper/desktop-api/resources/info';
+
import BeeperDesktop from '@beeper/desktop-api';
+import { createClient, type PartialBeeperDesktop } from '@beeper/desktop-api/tree-shakable';
const client = new BeeperDesktop({
accessToken: 'My Access Token',
baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
});
-describe('resource info', () => {
+const partialClient = createClient({
+ accessToken: 'My Access Token',
+ baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
+ resources: [BaseInfo],
+});
+
+const runTests = (client: PartialBeeperDesktop<{ info: BaseInfo }>) => {
test('retrieve', async () => {
const responsePromise = client.info.retrieve();
const rawResponse = await responsePromise.asResponse();
@@ -18,4 +27,6 @@ describe('resource info', () => {
expect(dataAndResponse.data).toBe(response);
expect(dataAndResponse.response).toBe(rawResponse);
});
-});
+};
+describe('resource info', () => runTests(client));
+describe('resource info (tree shakable, base)', () => runTests(partialClient));
diff --git a/tests/api-resources/messages.test.ts b/tests/api-resources/messages.test.ts
index 6ffdfa08..c434ee8b 100644
--- a/tests/api-resources/messages.test.ts
+++ b/tests/api-resources/messages.test.ts
@@ -1,13 +1,22 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+import { BaseMessages } from '@beeper/desktop-api/resources/messages';
+
import BeeperDesktop from '@beeper/desktop-api';
+import { createClient, type PartialBeeperDesktop } from '@beeper/desktop-api/tree-shakable';
const client = new BeeperDesktop({
accessToken: 'My Access Token',
baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
});
-describe('resource messages', () => {
+const partialClient = createClient({
+ accessToken: 'My Access Token',
+ baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
+ resources: [BaseMessages],
+});
+
+const runTests = (client: PartialBeeperDesktop<{ messages: BaseMessages }>) => {
test('update: only required params', async () => {
const responsePromise = client.messages.update('messageID', {
chatID: '!NCdzlIaMjZUmvmvyHU:beeper.com',
@@ -121,4 +130,6 @@ describe('resource messages', () => {
),
).rejects.toThrow(BeeperDesktop.NotFoundError);
});
-});
+};
+describe('resource messages', () => runTests(client));
+describe('resource messages (tree shakable, base)', () => runTests(partialClient));
diff --git a/tests/index.test.ts b/tests/index.test.ts
index 78116e9a..bb85a522 100644
--- a/tests/index.test.ts
+++ b/tests/index.test.ts
@@ -54,7 +54,7 @@ describe('instantiate client', () => {
beforeEach(() => {
process.env = { ...env };
- process.env['BEEPER_DESKTOP_LOG'] = undefined;
+ process.env['BEEPER_LOG'] = undefined;
});
afterEach(() => {
@@ -130,7 +130,7 @@ describe('instantiate client', () => {
error: jest.fn(),
};
- process.env['BEEPER_DESKTOP_LOG'] = 'debug';
+ process.env['BEEPER_LOG'] = 'debug';
const client = new BeeperDesktop({ logger: logger, accessToken: 'My Access Token' });
expect(client.logLevel).toBe('debug');
@@ -147,11 +147,11 @@ describe('instantiate client', () => {
error: jest.fn(),
};
- process.env['BEEPER_DESKTOP_LOG'] = 'not a log level';
+ process.env['BEEPER_LOG'] = 'not a log level';
const client = new BeeperDesktop({ logger: logger, accessToken: 'My Access Token' });
expect(client.logLevel).toBe('warn');
expect(warnMock).toHaveBeenCalledWith(
- 'process.env[\'BEEPER_DESKTOP_LOG\'] was set to "not a log level", expected one of ["off","error","warn","info","debug"]',
+ 'process.env[\'BEEPER_LOG\'] was set to "not a log level", expected one of ["off","error","warn","info","debug"]',
);
});
@@ -164,7 +164,7 @@ describe('instantiate client', () => {
error: jest.fn(),
};
- process.env['BEEPER_DESKTOP_LOG'] = 'debug';
+ process.env['BEEPER_LOG'] = 'debug';
const client = new BeeperDesktop({
logger: logger,
logLevel: 'off',
@@ -184,7 +184,7 @@ describe('instantiate client', () => {
error: jest.fn(),
};
- process.env['BEEPER_DESKTOP_LOG'] = 'not a log level';
+ process.env['BEEPER_LOG'] = 'not a log level';
const client = new BeeperDesktop({
logger: logger,
logLevel: 'debug',
@@ -311,7 +311,7 @@ describe('instantiate client', () => {
});
afterEach(() => {
- process.env['BEEPER_DESKTOP_BASE_URL'] = undefined;
+ process.env['BEEPER_BASE_URL'] = undefined;
});
test('explicit option', () => {
@@ -320,19 +320,19 @@ describe('instantiate client', () => {
});
test('env variable', () => {
- process.env['BEEPER_DESKTOP_BASE_URL'] = 'https://example.com/from_env';
+ process.env['BEEPER_BASE_URL'] = 'https://example.com/from_env';
const client = new BeeperDesktop({ accessToken: 'My Access Token' });
expect(client.baseURL).toEqual('https://example.com/from_env');
});
test('empty env variable', () => {
- process.env['BEEPER_DESKTOP_BASE_URL'] = ''; // empty
+ process.env['BEEPER_BASE_URL'] = ''; // empty
const client = new BeeperDesktop({ accessToken: 'My Access Token' });
expect(client.baseURL).toEqual('http://localhost:23373');
});
test('blank env variable', () => {
- process.env['BEEPER_DESKTOP_BASE_URL'] = ' '; // blank
+ process.env['BEEPER_BASE_URL'] = ' '; // blank
const client = new BeeperDesktop({ accessToken: 'My Access Token' });
expect(client.baseURL).toEqual('http://localhost:23373');
});
@@ -355,7 +355,7 @@ describe('instantiate client', () => {
});
test('in request options overridden by env variable', () => {
- process.env['BEEPER_DESKTOP_BASE_URL'] = 'http://localhost:5000/env';
+ process.env['BEEPER_BASE_URL'] = 'http://localhost:5000/env';
const client = new BeeperDesktop({ accessToken: 'My Access Token' });
expect(client.buildURL('/foo', null, 'http://localhost:5000/option')).toEqual(
'http://localhost:5000/env/foo',
diff --git a/tsc-multi.json b/tsc-multi.json
index 384ddac5..3aec71fe 100644
--- a/tsc-multi.json
+++ b/tsc-multi.json
@@ -3,12 +3,14 @@
{
"extname": ".js",
"module": "commonjs",
- "shareHelpers": "internal/tslib.js"
+ "shareHelpers": "internal/tslib.js",
+ "pureClassAssignment": true
},
{
"extname": ".mjs",
"module": "esnext",
- "shareHelpers": "internal/tslib.mjs"
+ "shareHelpers": "internal/tslib.mjs",
+ "pureClassAssignment": true
}
],
"projects": ["tsconfig.build.json"]
diff --git a/yarn.lock b/yarn.lock
index e5e2a93b..18e7cbdc 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -709,11 +709,6 @@
"@nodelib/fs.scandir" "2.1.5"
fastq "^1.6.0"
-"@pkgr/core@^0.2.4":
- version "0.2.4"
- resolved "https://registry.yarnpkg.com/@pkgr/core/-/core-0.2.4.tgz#d897170a2b0ba51f78a099edccd968f7b103387c"
- integrity sha512-ROFF39F6ZrnzSUEmQQZUar0Jt4xVoP9WnDRdWwF4NNcXs3xBTLgBUDoOwW141y1jP+S8nahIbdxbFC7IShw9Iw==
-
"@sinclair/typebox@^0.27.8":
version "0.27.8"
resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.27.8.tgz#6667fac16c436b5434a387a34dedb013198f6e6e"
@@ -1220,9 +1215,9 @@ baseline-browser-mapping@^2.9.0:
integrity sha512-B0xUquLkiGLgHhpPBqvl7GWegWBUNuujQ6kXd/r1U38ElPT6Ok8KZ8e+FpUGEc2ZoRQUzq/aUnaKFc/svWUGSg==
brace-expansion@^2.0.2:
- version "2.0.3"
- resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-2.0.3.tgz#0493338bdd58e319b1039c67cf7ee439892c01d9"
- integrity sha512-MCV/fYJEbqx68aE58kv2cA/kiky1G8vux3OR6/jbS+jIMe/6fJWa0DTzJU7dqijOWYwHi1t29FlfYI9uytqlpA==
+ version "2.1.0"
+ resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-2.1.0.tgz#4f41a41190216ee36067ec381526fe9539c4f0ae"
+ integrity sha512-TN1kCZAgdgweJhWWpgKYrQaMNHcDULHkWwQIspdtjV4Y5aurRdZpjAqn6yX3FPqTA9ngHCc4hJxMAMgGfve85w==
dependencies:
balanced-match "^1.0.0"
@@ -1515,14 +1510,6 @@ escape-string-regexp@^4.0.0:
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34"
integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==
-eslint-plugin-prettier@^5.4.1:
- version "5.4.1"
- resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-5.4.1.tgz#99b55d7dd70047886b2222fdd853665f180b36af"
- integrity sha512-9dF+KuU/Ilkq27A8idRP7N2DH8iUR6qXcjF3FR2wETY21PZdBrIjwCau8oboyGj9b7etWmTGEeM8e7oOed6ZWg==
- dependencies:
- prettier-linter-helpers "^1.0.0"
- synckit "^0.11.7"
-
eslint-plugin-unused-imports@^4.1.4:
version "4.1.4"
resolved "https://registry.yarnpkg.com/eslint-plugin-unused-imports/-/eslint-plugin-unused-imports-4.1.4.tgz#62ddc7446ccbf9aa7b6f1f0b00a980423cda2738"
@@ -1674,11 +1661,6 @@ fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3:
resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525"
integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==
-fast-diff@^1.1.2:
- version "1.3.0"
- resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.3.0.tgz#ece407fa550a64d638536cd727e129c61616e0f0"
- integrity sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==
-
fast-glob@^3.3.2:
version "3.3.2"
resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.3.2.tgz#a904501e57cfdd2ffcded45e99a54fef55e46129"
@@ -2841,13 +2823,6 @@ prelude-ls@^1.2.1:
resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396"
integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==
-prettier-linter-helpers@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz#d23d41fe1375646de2d0104d3454a3008802cf7b"
- integrity sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==
- dependencies:
- fast-diff "^1.1.2"
-
prettier@^3.0.0:
version "3.1.1"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.1.1.tgz#6ba9f23165d690b6cbdaa88cb0807278f7019848"
@@ -3144,13 +3119,6 @@ supports-preserve-symlinks-flag@^1.0.0:
resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09"
integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==
-synckit@^0.11.7:
- version "0.11.8"
- resolved "https://registry.yarnpkg.com/synckit/-/synckit-0.11.8.tgz#b2aaae998a4ef47ded60773ad06e7cb821f55457"
- integrity sha512-+XZ+r1XGIJGeQk3VvXhT6xx/VpbHsRzsTkGgF6E5RX9TTXD0118l87puaEBZ566FhqblC6U0d4XnubznJDm30A==
- dependencies:
- "@pkgr/core" "^0.2.4"
-
test-exclude@^6.0.0:
version "6.0.0"
resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-6.0.0.tgz#04a8698661d805ea6fa293b6cb9e63ac044ef15e"