From 91994fa8b9e406c674d5245f2da123608e87046b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 17 Mar 2026 03:07:49 +0000 Subject: [PATCH 1/8] chore(internal): codegen related update --- uv.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/uv.lock b/uv.lock index 3e068d8..99ade34 100644 --- a/uv.lock +++ b/uv.lock @@ -103,7 +103,7 @@ wheels = [ [[package]] name = "beeper_desktop_api" -version = "0.0.1" +version = "4.3.0" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "anyio" }, From 2db5518d6ac525ccd1d753e271f6adcde42398bf Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 17 Mar 2026 03:38:40 +0000 Subject: [PATCH 2/8] chore(internal): tweak CI branches --- .github/workflows/ci.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 525c94f..621fd4b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,12 +1,14 @@ name: CI on: push: - branches-ignore: - - 'generated' - - 'codegen/**' - - 'integrated/**' - - 'stl-preview-head/**' - - 'stl-preview-base/**' + branches: + - '**' + - '!integrated/**' + - '!stl-preview-head/**' + - '!stl-preview-base/**' + - '!generated' + - '!codegen/**' + - 'codegen/stl/**' pull_request: branches-ignore: - 'stl-preview-head/**' From d84f8a50545721a86b7ea48a8af34bd588961c54 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 18 Mar 2026 02:31:17 +0000 Subject: [PATCH 3/8] docs: explain caching --- README.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/README.md b/README.md index 0544b3f..e2d467b 100644 --- a/README.md +++ b/README.md @@ -123,6 +123,27 @@ LIMIT 200; > removed, then PostgreSQL may not [push down the condition](https://wiki.postgresql.org/wiki/Inlining_of_SQL_functions), > causing all pages to be requested and buffered. +## Caching + +Sending requests to the Beeper Desktop API for every SQL query can be slow. Combine [materialized views](https://www.postgresql.org/docs/current/rules-materializedviews.html) with [`pg_cron`](https://github.com/citusdata/pg_cron) for scheduled data pulls: + +```sql +CREATE MATERIALIZED VIEW beeper_desktop_api_messages AS +SELECT * +FROM beeper_desktop_api_messages.search( + account_ids := ARRAY['local-telegram_ba_QFrb5lrLPhO3OT5MFBeTWv0x4BI'], + "limit" := 10, + query := 'deployment' +); + +-- Refresh the view every 4 hours. +SELECT cron.schedule( + 'refresh-beeper-desktop-api-messages', + '0 */4 * * *', + 'REFRESH MATERIALIZED VIEW CONCURRENTLY beeper_desktop_api_messages' +); +``` + ## Troubleshooting ### Installation From 9183ad1d77206204a8650471616d1f97b817f024 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 18 Mar 2026 02:44:59 +0000 Subject: [PATCH 4/8] chore(internal): support env vars in `./scripts/repl` --- scripts/repl | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/scripts/repl b/scripts/repl index 21d1eab..679bf51 100755 --- a/scripts/repl +++ b/scripts/repl @@ -1,5 +1,10 @@ #!/usr/bin/env bash +if [ -z "$BEEPER_ACCESS_TOKEN" ]; then + echo 'ERROR: BEEPER_ACCESS_TOKEN environment variable is required but not set' + exit 1 +fi + echo "==> Detecting PostgreSQL Python executable" PYTHON_EXECUTABLE_PATH=$(pg_config --configure | grep -o "PYTHON=[^ ]*" | cut -d= -f2 | tr -d "'") echo "PostgreSQL uses Python $PYTHON_EXECUTABLE_PATH" @@ -29,8 +34,8 @@ if [ "$PG_MAJOR_VERSION" -ge 18 ]; then done POSTGRES_CONFIG=(-c extension_control_path="$(realpath temp/install/share/postgresql)") else - # In PostgreSQL <18 we cannot point `postgres` to our local extensions directory. So we install directly to - # the system. + # In PostgreSQL <18 we cannot point `postgres` to our local extensions directory. So we install + # directly to the system. sudo make install PG_CONFIG="$(command -v pg_config)" fi @@ -61,10 +66,15 @@ done echo "==> Running setup.sql" psql -d postgres -f test/sql/create_extension.sql +psql -d postgres --variable "value='$BEEPER_ACCESS_TOKEN'" -c 'ALTER DATABASE postgres SET beeper_desktop_api.beeper_access_token = :value;' +if [ -n "$BEEPER_DESKTOP_BASE_URL" ]; then + psql -d postgres --variable "value='$BEEPER_DESKTOP_BASE_URL'" -c 'ALTER DATABASE postgres SET beeper_desktop_api.base_url = :value;' +fi + if command -v pgcli &>/dev/null; then echo "==> Starting pgcli REPL" pgcli postgres else echo "==> Starting psql REPL (TIP: Install pgcli for better autocomplete!)" psql -d postgres -fi +fi \ No newline at end of file From ca3c264cee5d12947269f7fc6f919eb8db071c9b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 20 Mar 2026 02:09:59 +0000 Subject: [PATCH 5/8] refactor(tests): switch from prism to steady --- scripts/mock | 26 +++++++++++++------------- scripts/test | 16 ++++++++-------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/scripts/mock b/scripts/mock index bcf3b39..00b490b 100755 --- a/scripts/mock +++ b/scripts/mock @@ -19,34 +19,34 @@ fi echo "==> Starting mock server with URL ${URL}" -# Run prism mock on the given spec +# 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=@stainless-api/prism-cli@5.15.0 -- prism --version + npm exec --package=@stdy/cli@0.19.3 -- steady --version - npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL" &> .prism.log & + npm exec --package=@stdy/cli@0.19.3 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=repeat --validator-query-object-format=brackets "$URL" &> .stdy.log & - # Wait for server to come online (max 30s) + # Wait for server to come online via health endpoint (max 30s) echo -n "Waiting for server" attempts=0 - while ! grep -q "✖ fatal\|Prism is listening" ".prism.log" ; do + while ! curl --silent --fail "http://127.0.0.1:4010/_x-steady/health" >/dev/null 2>&1; do + if ! kill -0 $! 2>/dev/null; then + echo + cat .stdy.log + exit 1 + fi attempts=$((attempts + 1)) if [ "$attempts" -ge 300 ]; then echo - echo "Timed out waiting for Prism server to start" - cat .prism.log + echo "Timed out waiting for Steady server to start" + cat .stdy.log exit 1 fi echo -n "." sleep 0.1 done - if grep -q "✖ fatal" ".prism.log"; then - cat .prism.log - exit 1 - fi - echo else - npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL" + npm exec --package=@stdy/cli@0.19.3 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=repeat --validator-query-object-format=brackets "$URL" fi diff --git a/scripts/test b/scripts/test index 8b23b9c..3e62240 100755 --- a/scripts/test +++ b/scripts/test @@ -9,8 +9,8 @@ GREEN='\033[0;32m' YELLOW='\033[0;33m' NC='\033[0m' # No Color -function prism_is_running() { - curl --silent "http://localhost:4010" >/dev/null 2>&1 +function steady_is_running() { + curl --silent "http://127.0.0.1:4010/_x-steady/health" >/dev/null 2>&1 } kill_server_on_port() { @@ -25,7 +25,7 @@ function is_overriding_api_base_url() { [ -n "$TEST_API_BASE_URL" ] } -if ! is_overriding_api_base_url && ! prism_is_running ; then +if ! is_overriding_api_base_url && ! steady_is_running ; then # When we exit this script, make sure to kill the background mock server process trap 'kill_server_on_port 4010' EXIT @@ -36,19 +36,19 @@ fi if is_overriding_api_base_url ; then echo -e "${GREEN}✔ Running tests against ${TEST_API_BASE_URL}${NC}" echo -elif ! prism_is_running ; then - echo -e "${RED}ERROR:${NC} The test suite will not run without a mock Prism server" +elif ! steady_is_running ; then + echo -e "${RED}ERROR:${NC} The test suite will not run without a mock Steady server" echo -e "running against your OpenAPI spec." echo echo -e "To run the server, pass in the path or url of your OpenAPI" - echo -e "spec to the prism command:" + echo -e "spec to the steady command:" echo - echo -e " \$ ${YELLOW}npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock path/to/your.openapi.yml${NC}" + echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.19.3 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-query-array-format=repeat --validator-query-object-format=brackets${NC}" echo exit 1 else - echo -e "${GREEN}✔ Mock prism server is running with your OpenAPI spec${NC}" + echo -e "${GREEN}✔ Mock steady server is running with your OpenAPI spec${NC}" echo fi From fe76f5e4d60950521215581557cd0453720d7a71 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 21 Mar 2026 02:11:15 +0000 Subject: [PATCH 6/8] chore(tests): bump steady to v0.19.4 --- scripts/mock | 6 +++--- scripts/test | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/mock b/scripts/mock index 00b490b..f310477 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.19.3 -- steady --version + npm exec --package=@stdy/cli@0.19.4 -- steady --version - npm exec --package=@stdy/cli@0.19.3 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=repeat --validator-query-object-format=brackets "$URL" &> .stdy.log & + npm exec --package=@stdy/cli@0.19.4 -- steady --host 127.0.0.1 -p 4010 --validator-form-array-format=repeat --validator-query-array-format=repeat --validator-form-object-format=brackets --validator-query-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.19.3 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=repeat --validator-query-object-format=brackets "$URL" + npm exec --package=@stdy/cli@0.19.4 -- steady --host 127.0.0.1 -p 4010 --validator-form-array-format=repeat --validator-query-array-format=repeat --validator-form-object-format=brackets --validator-query-object-format=brackets "$URL" fi diff --git a/scripts/test b/scripts/test index 3e62240..18b5b0f 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.19.3 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-query-array-format=repeat --validator-query-object-format=brackets${NC}" + echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.19.4 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-form-array-format=repeat --validator-query-array-format=repeat --validator-form-object-format=brackets --validator-query-object-format=brackets${NC}" echo exit 1 From 71cbd2c8566c6c466557c8ee7209f6710687cf1a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 21 Mar 2026 02:18:35 +0000 Subject: [PATCH 7/8] chore(tests): bump steady to v0.19.5 --- scripts/mock | 6 +++--- scripts/test | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/mock b/scripts/mock index f310477..54fc791 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.19.4 -- steady --version + npm exec --package=@stdy/cli@0.19.5 -- steady --version - npm exec --package=@stdy/cli@0.19.4 -- steady --host 127.0.0.1 -p 4010 --validator-form-array-format=repeat --validator-query-array-format=repeat --validator-form-object-format=brackets --validator-query-object-format=brackets "$URL" &> .stdy.log & + npm exec --package=@stdy/cli@0.19.5 -- steady --host 127.0.0.1 -p 4010 --validator-form-array-format=repeat --validator-query-array-format=repeat --validator-form-object-format=brackets --validator-query-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.19.4 -- steady --host 127.0.0.1 -p 4010 --validator-form-array-format=repeat --validator-query-array-format=repeat --validator-form-object-format=brackets --validator-query-object-format=brackets "$URL" + npm exec --package=@stdy/cli@0.19.5 -- steady --host 127.0.0.1 -p 4010 --validator-form-array-format=repeat --validator-query-array-format=repeat --validator-form-object-format=brackets --validator-query-object-format=brackets "$URL" fi diff --git a/scripts/test b/scripts/test index 18b5b0f..d958b6d 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.19.4 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-form-array-format=repeat --validator-query-array-format=repeat --validator-form-object-format=brackets --validator-query-object-format=brackets${NC}" + echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.19.5 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-form-array-format=repeat --validator-query-array-format=repeat --validator-form-object-format=brackets --validator-query-object-format=brackets${NC}" echo exit 1 From 55db4665dc6d0d81921b0373768c14a73cc71718 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 21 Mar 2026 02:18:47 +0000 Subject: [PATCH 8/8] release: 0.1.1 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 3d2ac0b..5547f83 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.0" + ".": "0.1.1" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index f7634d8..b94fa12 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,27 @@ # Changelog +## 0.1.1 (2026-03-21) + +Full Changelog: [v0.1.0...v0.1.1](https://github.com/beeper/desktop-api-sql/compare/v0.1.0...v0.1.1) + +### Chores + +* **internal:** codegen related update ([91994fa](https://github.com/beeper/desktop-api-sql/commit/91994fa8b9e406c674d5245f2da123608e87046b)) +* **internal:** support env vars in `./scripts/repl` ([9183ad1](https://github.com/beeper/desktop-api-sql/commit/9183ad1d77206204a8650471616d1f97b817f024)) +* **internal:** tweak CI branches ([2db5518](https://github.com/beeper/desktop-api-sql/commit/2db5518d6ac525ccd1d753e271f6adcde42398bf)) +* **tests:** bump steady to v0.19.4 ([fe76f5e](https://github.com/beeper/desktop-api-sql/commit/fe76f5e4d60950521215581557cd0453720d7a71)) +* **tests:** bump steady to v0.19.5 ([71cbd2c](https://github.com/beeper/desktop-api-sql/commit/71cbd2c8566c6c466557c8ee7209f6710687cf1a)) + + +### Documentation + +* explain caching ([d84f8a5](https://github.com/beeper/desktop-api-sql/commit/d84f8a50545721a86b7ea48a8af34bd588961c54)) + + +### Refactors + +* **tests:** switch from prism to steady ([ca3c264](https://github.com/beeper/desktop-api-sql/commit/ca3c264cee5d12947269f7fc6f919eb8db071c9b)) + ## 0.1.0 (2026-03-13) Full Changelog: [v0.0.1...v0.1.0](https://github.com/beeper/desktop-api-sql/compare/v0.0.1...v0.1.0)