Commit Graph

158 Commits

Author SHA1 Message Date
Julien Lavocat 60321d603b Copy from original URL to the new one 2025-06-25 19:37:14 +02:00
Chip de7fb8a711 Update db_connection_impl.ts (#194)
fix for https://github.com/clockworklabs/SpacetimeDB/issues/2896
2025-06-25 10:36:34 -07:00
github-actions[bot] 179b666344 Release 1.2.0 (#190)
* Version Packages

* revert major version bump

* changelog

* fix changelog

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-06-18 11:24:04 -07:00
Zeke Foppa 56fc56f6ca Release 1.2.0 (#187)
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-06-17 09:32:55 -07:00
Jeffrey Dallatezza 16b6b75fdf Handle falsy option values (#188) 2025-06-16 10:42:42 -07:00
Jeffrey Dallatezza c99b56fcff Run lint for PRs. (#184)
* Run lint for PRs.

* Fix dir

* Also hide changes to generated test app files.

* Only run on pushes to main.
2025-05-06 14:27:07 -07:00
ChaseLewis 930e7a26a1 Fix so spacetimedb can be hosted with a pathname (#183)
* Allow spacetimedb sdk to work when spacetimedb url is more than a host name.

* run pnpm format

---------

Co-authored-by: DeveloperChaseLewis <developer.chase.lewis@gmail.com>
2025-05-01 12:06:53 -07:00
Jeffrey Dallatezza 1eb2dbd370 Subscribe to all the subscriptions together in the quickstart example. (#173) 2025-04-23 07:59:19 -07:00
Bastian Ganze be38694dec Make ws connection fail when token is invalid (#176)
* Make ws connection fail when token is not verified

* add changeset

---------

Co-authored-by: Jeffrey Dallatezza <jeffreydallatezza@gmail.com>
2025-04-22 11:36:17 -07:00
Zeke Foppa 9565b2fc43 Remove .changeset/pre.json (#177)
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-04-21 11:41:01 -07:00
Zeke Foppa edc68cba4e 1.1.0 release (#170)
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-04-15 18:52:15 -07:00
John Detter 2a1cc4d88d License Apache2 (#172)
Co-authored-by: John Detter <no-reply@boppygames.gg>
2025-04-14 16:11:43 +01:00
John Detter d3aa26e8c3 Version upgrade to 1.0.3 (#162) 2025-03-14 21:11:05 -07:00
Jeffrey Dallatezza 76329e98b0 Reverse byte order when converting to/from hex strings (#161) 2025-03-14 16:00:45 -04:00
Jeffrey Dallatezza a072e8c2e7 Fix some subscription lifecycle issues. (#158)
* Fix some subscription lifecycle issues.

* remove the subscription after an error.
2025-03-14 11:23:00 -07:00
John Detter 2a7d05d2ef Version 1.0.2 (#152)
Co-authored-by: John Detter <no-reply@boppygames.gg>
2025-03-04 13:40:13 -06:00
Jeffrey Dallatezza 47dd62ae00 Set other url params even if we dont have an authToken. (#151) 2025-03-04 13:24:30 -06:00
John Detter 01adcc76ce Bump version for release (#148)
Co-authored-by: John Detter <no-reply@boppygames.gg>
2025-02-28 16:47:35 -06:00
Jeffrey Dallatezza 83da8dd9e6 Handle duplicate rows and delay callbacks (#146)
* Regen the api types from the server.

* fmt the client api code

* Use the multi versions of subscription messages.

* Add ref counting of rows and delay callbacks.

* WIP debugging tests.

* Regen test app

* A lot of changes.

* Use new subscription api.

* remove commented out code.

* Fix update and cleanup.

* Fix path to spacetimedb

* Run tests before checking diff in CI

* Update packages/sdk/tests/db_connection.test.ts

Co-authored-by: Tyler Cloutier <cloutiertyler@users.noreply.github.com>

* Update packages/sdk/tests/db_connection.test.ts

Co-authored-by: Tyler Cloutier <cloutiertyler@users.noreply.github.com>

* Update packages/sdk/tests/db_connection.test.ts

Co-authored-by: Tyler Cloutier <cloutiertyler@users.noreply.github.com>

* Update packages/sdk/tests/db_connection.test.ts

Co-authored-by: Tyler Cloutier <cloutiertyler@users.noreply.github.com>

* Various cleanups.

* Comment out the CI test for the generated code being up to date.

* Regen.

* Add sed command.

---------

Co-authored-by: Tyler Cloutier <cloutiertyler@users.noreply.github.com>
2025-02-26 08:50:25 -08:00
Tyler Cloutier 8e0ed66038 Disable SpacetimeDB integration test for now (#145) 2025-02-19 16:59:20 -05:00
Zeke Foppa fdc8c25d68 bump versions to 1.0.0 (#126)
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-02-19 14:11:28 -05:00
Phoebe Goldman 4d9cc5921e Import timestamp and duration by file, not from root (#139)
this fixes a circular import or circular definition problem that we don't fully understand.
2025-02-11 17:31:55 -05:00
Noa 086a239381 Reimplemented/rebased the changes Noa submitted (#134)
Co-authored-by: Tyler Cloutier <cloutiertyler@aol.com>
2025-02-11 01:01:46 -05:00
Noa a344b5ec2d Switch to Bearer auth (#131) 2025-02-11 00:57:06 -05:00
Tyler Cloutier 204d43c3f9 DBConnection -> DbConnection + some comments (#137) 2025-02-11 00:56:16 -05:00
Tyler Cloutier 61c1f0e27b Implemented the new mutable subscriptions API (#135)
* Implemented the new subscriptions API

* Fixed the ../index thing

* Fixed the ../index thing for realz

* Fixes for Timestamp and TimeDuration

* Better error handling

* Fixed rebase issues

* lint

* Reduce diff

* lint
2025-02-11 00:45:48 -05:00
Tyler Cloutier d16e2d6ae8 Now emitting UnknownTransaction (#138)
* Now emitting UnknownTransaction if reducer name is empty string or the reducer args are not parseable

* Fixed small bug

* Lint
2025-02-10 18:10:04 -05:00
Phoebe Goldman 81631318d5 TypeScript SDK: Rename address to connection ID (#133)
* Rename address to connection ID

* Format
2025-02-10 16:02:58 -05:00
james gilles cc0747c169 Add shared ScheduleAt type (#88)
* Add shared ScheduleAt type

* Lint

---------

Co-authored-by: Tyler Cloutier <cloutiertyler@aol.com>
Co-authored-by: Tyler Cloutier <cloutiertyler@users.noreply.github.com>
2025-02-08 13:29:27 -05:00
Phoebe Goldman f86104f92c Add Timestamp to the SDK, moving it out of client_api (#114)
* Add `Timestamp` to the SDK, moving it out of `client_api`

Companion to SpacetimeDB#1836

* Add `TimeDuration` class

* Add forgotten return type annotation

* 🤦

* Prettier

* Update `client_api` schema to use `TimeDuration`

* Micros, not nanos

From SpacetimeDB 072c2ea3a3:

Prioritize BSATN and BFLATN compat with 0.12

Timestamp and TimeDuration store `micros: i64`, not `nanos: i64`.
This means that old commitlogs and snapshots should still be compatible,
assuming they don't include timestamps greater than `i64::MAX`,
as previously we used `micros: u64`. This seems unlikely.

* Ran new code gen

* Fixed rebase conflicts

---------

Co-authored-by: Tyler Cloutier <cloutiertyler@aol.com>
2025-02-08 13:26:45 -05:00
Tyler Cloutier b882aeeb17 Updates the TypesScript SDK to use the new EventContext variants (#136)
* Updated the quickstart to use the new 1.0 API

* Ran prettier

* Updated CSS

* Removed server code

* Moved out of the client dir

* Updated lockfile

* Added new workflow

* Small fixes

* Updated PR template

* Ran prettier

* Fixes to workflwo

* Workflow fixes

* Fixes the toolchain thing

* Added SpacetimeDB integration test

* Fix workflow hopefully

* Fix workflow

* Prettier

* Updated pull request template to better reflect the reality

* Fixed path in workflow

* Prettier after codegen

* Regenerate

* Say yes to deleting data

* Updated codegen to latest master of SpacetimeDB

* debug actions

* Formatting

* Implemented EventContext update

* Removed unused imports

* Fix merge marker
2025-02-08 00:42:57 -05:00
Tyler Cloutier fa25bedff6 Updated the quickstart to use the new 1.0 API (#130)
* Updated the quickstart to use the new 1.0 API

* Ran prettier

* Updated CSS

* Removed server code

* Moved out of the client dir

* Updated lockfile

* Added new workflow

* Small fixes

* Updated PR template

* Ran prettier

* Fixes to workflwo

* Workflow fixes

* Fixes the toolchain thing

* Added SpacetimeDB integration test

* Fix workflow hopefully

* Fix workflow

* Prettier

* Updated pull request template to better reflect the reality

* Fixed path in workflow

* Prettier after codegen

* Regenerate

* Say yes to deleting data

* Updated codegen to latest master of SpacetimeDB

* debug actions

* Formatting

* add README steps

* Ran lints

---------

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-02-07 21:29:07 -05:00
Phoebe Goldman d6147b06a5 Add subscribeToAllTables method (#129) 2025-01-23 21:38:09 -05:00
Phoebe Goldman 5195a243a6 Amend withCredentials to withToken (#128)
* Amend `withCredentials` to `withToken`

`withCredentials` was designed for our old auth model,
where tokens were always issued by the SpacetimeDB host alongside an `Identity`,
and therefore the bearer always knew their `Identity`.

In our new auth model,
a client may have a valid auth-able JWT but not know what `Identity` it will result in,
as the `Identity` is computed based on the hash of some of the token's contents,
and this hashing algorithm is not included in our client SDKs.
As such, this PR revises `withCredentials` to `withToken`, which just accepts the token.

* TypeScript puts ? on variables, not types

* Prettier
2025-01-22 17:31:40 -05:00
github-actions[bot] 172d992c6f Version Packages (rc1) (#115)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-11-07 02:17:32 +05:30
Mazdak Farrokhzad 9fc6abff66 Companion to SpacetimeDB#1812 (light tx, ts) (#110)
* support TransactionUpdateLight and CallReducerFlags

* Run generate

* Push creds

* run prettier

* Add changeset

* Turn on withLightMode

---------

Co-authored-by: Puru Vijay <awesomepuruvj@gmail.com>
Co-authored-by: Puru Vijay <47742487+PuruVJ@users.noreply.github.com>
2024-11-06 12:34:46 -08:00
Puru Vijay bdc147eb5d Update readme for rc1.0 (#123)
* Update readme

* rc1

* Update packages/sdk/README.md

---------

Co-authored-by: Zeke Foppa <196249+bfops@users.noreply.github.com>
2024-11-06 10:54:45 -08:00
james gilles 7e111bc1c5 Update Identity and Address to use bigints rather than byte arrays (#119)
* Update Identity and Address to use bigints rather than byte arrays

* Add back accidentally-removed APIs

* Remove debugging log

* Add changeset

* Fix names

* Format

* Update creds

---------

Co-authored-by: Puru Vijay <awesomepuruvj@gmail.com>
2024-11-05 00:11:06 +05:30
Puru Vijay e64d29e710 Add gzip for #109 (#117) 2024-10-23 22:53:54 +05:30
Puru Vijay 82951197e5 Enter prerelease mode (#116)
* Enter prerelease mode

* Add major changeset
2024-10-23 22:50:56 +05:30
Puru Vijay a46522ea97 feat: GZIP (#109)
* Pus

* gzip

* Push

* Buffer.from

* Format

* Add changeset

* Push

* Remove deps

* Rvert back to original lib.rs

* Push

* Refactor decompress function

* Autogenerate

* Format

* deferred

* Fix tests

* Remove blob coments

* Message queue. Untested

* Fix test

* Chunked decompress
2024-10-23 22:27:10 +05:30
Tyler Cloutier 49b9522400 Update DEVELOP.md (#111) 2024-10-16 18:06:16 -04:00
github-actions[bot] 06e461b298 Version Packages (#106)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-10-08 23:40:17 +05:30
Puru Vijay 684ba04b90 fix: websocket message handling, Buffer, onConnect (#107)
* Push

* Buffer.from

* Format

* Add changeset
2024-10-08 23:38:57 +05:30
Puru Vijay 0668ba0218 docs: 0.12 public facing docs (#108)
* Push

* Add changeset
2024-10-08 23:35:48 +05:30
Puru Vijay dfea67dc4c fix: temporary token path invocation (#105) 2024-10-08 11:14:13 +05:30
github-actions[bot] a7abfc51d4 Version Packages (#93)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-10-04 01:53:20 -04:00
Zeke Foppa 9082301ef3 Merge pull request #103 from clockworklabs/tyler/stable-sdk/fix-1
Make `subscribe` private
2024-10-03 21:08:53 -07:00
Tyler Cloutier 2ece7b36a6 Small change to API 2024-10-03 23:17:17 -04:00
Tyler Cloutier d64a5dbafa Tyler's Stable SDK API implementation (#102)
* 0.12: Remove global (#99)

* Push

* Half baked satuff

* Push tables stuff

* Update the example a bit

* Added tsup to dev dependencies

* Fixed naming and a lot of issues

* Improved the serialization situation

* More cleanup

* Updating the examples with the code gen

* Unscuffed the scuffery

* Unscuffing

* It works

* Whitespace

* Updated the quickstart

* pnpm format

* Fixed errors and manually imported sdk correctly in code gen code

* Updated the typescript sdk with the new websocket proposal format

* Fixes and removed playground

* Updated for 0.12 still not done fixing tests

* Regenerated the quickstart

* fixes and formating

* Fixed tests almost

* Fixed more tests

* Fixed all tests

* Renamed compile to build

* Fixes

* test-app: Expose the files

* ci: Build the code before tests

* build -> compile

* try to fix CR

---------

Co-authored-by: Puru Vijay <47742487+PuruVJ@users.noreply.github.com>
Co-authored-by: Puru Vijay <awesomepuruvj@gmail.com>
2024-10-03 13:59:43 -04:00