feat!: client storage is read-only, storage.save and storage.delete removed

This commit is contained in:
edmand46
2026-09-29 16:43:15 +03:00
parent b115450715
commit 17a55888a5
11 changed files with 28 additions and 104 deletions
+1 -1
View File
@@ -77,7 +77,7 @@ refresh clears tokens and emits `signed-out`. Details:
| Auth | `client.auth` | service |
| Player | `client.player` (`player`, `identities`, `balances`, `items`) | `SyncedState<PlayerProfile>` |
| Catalog currencies | `client.catalog` | `SyncedState<Map<string, CatalogCurrency>>` |
| Player storage | `client.storage` + `.save(type, data)` / `.delete(type)` | `SyncedState<GetStorageResponse>` + mutations |
| Player storage | `client.storage`, read-only | `SyncedState<GetStorageResponse>` |
| Modules | `client.modules.call<T>(module, fn, args?, { moduleVersion? })` | resolves to `result` as `T` |
## Module calls through generated clients
+3 -6
View File
@@ -5,8 +5,7 @@ Per-player storage, one item per `type`. `StorageDomain`, revision key
```ts
client.storage.value // GetStorageResponse | undefined
await client.storage.save(type, data);
await client.storage.delete(type);
await client.storage.reload();
```
```ts
@@ -21,10 +20,8 @@ interface StorageItem {
}
```
- `save(type: string, data: string): Promise<void>`: upserts the item of
`type` (the server keeps one item per player and type), then invalidates.
- `delete(type: string): Promise<void>`: deletes the item of `type`, then
invalidates.
- The client cannot write storage. Module functions (kernel `Storage.Set`) and
the batch admin API write it; call `reload()` after a module call that saved.
## Limits and notes